Video Tutorial: How to make a boy band

Tutorial:

Examples:

Super Junior

Mindless Behavior

What are you thoughts on boy bands?
Do you want to help me start one?

Use the contents of a jar file.

How to view the contents of a jar file.
Command

// From the cmd line
jar -tvf fileName.jar

Example Output

C:\BrowserGUI\dist>jar -tvf BrowserGUI.jar
     0 Sat Nov 26 21:46:28 PST 2011 META-INF/
   106 Sat Nov 26 21:46:26 PST 2011 META-INF/MANIFEST.MF
 39313 Sat Nov 26 21:46:26 PST 2011 GUIAboutTab.class
 39952 Sat Nov 26 21:46:26 PST 2011 GUIFrame.class
 45354 Sat Nov 26 21:46:26 PST 2011 GUITabbedPane.class
  5244 Sat Nov 26 21:46:26 PST 2011 GUImain.class
   691 Sat Nov 26 21:46:26 PST 2011 NewJFrame$1.class
   509 Sat Nov 26 21:46:26 PST 2011 NewJFrame$2.class
 15458 Sat Nov 26 21:46:26 PST 2011 NewJFrame.class

Check out the Java Package Tutorial for more infomation.

Code of the Day: DOS Open an existing file or create it if it doesn’t exist

REM filename: openAndORCreateFileTXT.bat
rem\ >> file.txt && file.txt

The following will open a existing file named file.txt. However, it if doesn’t exist then it will create it for you then open it. This is very useful.

“rem\” Let’s you return a empty character.
“>> file.txt” appends the returned value on the left hand side, which in this case is nothing.
“&& file.txt” once the left hand operation is done, then open the file ( file.txt).

Code of the Day: Groovy Print all Methods of an object

Groovy Code

/**
* @function printAllMethods
* @purpose Prints an objects class name and then list the associated class functions.
*/
void printAllMethods( obj ){
    println "class ${obj.getClass().name} functions:";
    if( !obj.metaClass && obj.getClass() ){
        printAllMethods( obj.getClass() );
        return;
    }
    obj.metaClass.methods.name.unique().each{ 
        print it+"(); "; 
    }
    println "";
}

Example Code

// Filename: printAllMethodsExample.groovy
void printAllMethods( obj ){
    println "class ${obj.getClass().name} functions:";
    if( !obj.metaClass && obj.getClass() ){
        printAllMethods( obj.getClass() );
        return;
    }
    obj.metaClass.methods.name.unique().each{ 
        print it+"(); "; 
    }
    println "";
}
 
printAllMethods( "string" );
println '';
printAllMethods( [1] );
println '';
printAllMethods( [1:1] );
println '';

Output

class java.lang.String functions:
equals(); getClass(); hashCode(); notify(); notifyAll(); toString(); wait(); charAt(); codePointAt(); codePointBefore(); codePointCount(); compareTo(); compareToIgnoreCase(); concat(); contains(); contentEquals(); copyValueOf(); endsWith(); equalsIgnoreCase(); format(); getBytes(); getChars(); indexOf(); intern(); isEmpty(); lastIndexOf(); length(); matches(); offsetByCodePoints(); regionMatches(); replace(); replaceAll(); replaceFirst(); split(); startsWith(); subSequence(); substring(); toCharArray(); toLowerCase(); toUpperCase(); trim(); valueOf(); 
 
class java.util.ArrayList functions:
equals(); getClass(); hashCode(); notify(); notifyAll(); toString(); wait(); add(); addAll(); clear(); contains(); containsAll(); isEmpty(); iterator(); remove(); removeAll(); retainAll(); size(); toArray(); get(); indexOf(); lastIndexOf(); listIterator(); set(); subList(); clone(); ensureCapacity(); trimToSize(); 
 
class java.util.LinkedHashMap functions:
class java.lang.Class functions:
equals(); getClass(); hashCode(); notify(); notifyAll(); toString(); wait(); clear(); containsKey(); containsValue(); entrySet(); get(); isEmpty(); keySet(); put(); putAll(); remove(); size(); values(); clone();

Bad Behavior has blocked 984 access attempts in the last 7 days.

FireStats icon Powered by FireStats