Monthly Archives: December 2012

Check string isBlank method

Meeka_is_blank_by_RGP
To check the string is blank use next:

public static boolean isBlank(String str) {
    int strLen;
    if (str == null || (strLen = str.length()) == 0) {
        return true;
    }
    for (int i = 0; i < strLen; i++) {
        if (!Character.isWhitespace(str.charAt(i))) {
            return false;
        }
    }
    return true;
}

Or just use apache commons for short.

Resource loading order in JSF 2 and PrimeFaces 3.x

dister-mechanic
To override primefaces style use next in h:head tag:


  
    
    
    
  
  
    
  
  
    
    
  

And it works fine, instead of using this:


  
  

See also, http://blog.primefaces.org/?p=1433

Just a great online graphic editor Pixlr

pixlr
For quick edit of images you can use http://pixlr.com/editor/. Awesome online editor allows to edit a simple images without install any desktop app.

MySQL backup/restore from command line

backup:
# mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

restore:
# mysql -u root -p[root_password] [database_name] < dumpfilename.sql

ConEmu. Just a great software!


Many times i’ve tried to find free console emulator for windows without bugs. And its occurred!
Thanx to author http://code.google.com/p/conemu-maximus5/

Web

Horizontal and vertical align in CSS

To effectively align elements use:

TYPE here!!!

Thanx to http://stackoverflow.com/questions/5421334/vertical-and-horizontal-align-middle-and-center-with-css
Also, http://www.gtalbot.org/NvuSection/NvuWebDesignTips/HorizontalAlignment.html

Web

Confirm dialog in Javascript

To implement confirmation for some action in webpage, use:


In element attribute onclick:

onclick="return doConfirmMultipleInvoice();"