Some Intelligent Humorous Quotes about Computer/Science

Here is some my favorite quotes that i collected from different pages


  • "In order to understand recursion, one must first understand recursion."
  • Any fool can write code that a computer can understand. Good programmers write code that humans can understand.-Martin Fowler
  • Theory is when one knows everything, but nothing works. Practice is when everything works, but nobody knows why.
  • Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why.
  • If Java had true garbage collection, most programs would delete themselves upon execution.
  • Beware of bugs in the above code; I have only proved it correct, not tried it. Donald Knuth
  • "There are 10 types of people in the world, those who can read binary, and those who can't."
  • We better hurry up and start coding, there are going to be a lot of bugs to fix.
  • UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity- Dennis Ritchie
  • If I had more time, I would have written a shorter letter-Cicero
  • "When all you have is a hammer, everything starts to look like a nail." 

java zip - create text file of String and zip it

Create a text file with some string (without temporary file) and zip it : working source code java

 private static void zip_single() throws Exception {
  final StringBuilder sb = new StringBuilder();
  sb.append("Test String that goes into text file inside zip");

  final File f = new File("single_text_file_inside.zip");
  final ZipOutputStream out = new ZipOutputStream(new FileOutputStream(f));
  ZipEntry e = new ZipEntry("inside_text_file.txt");
  out.putNextEntry(e);

  byte[] data = sb.toString().getBytes();
  out.write(data, 0, data.length);
  out.closeEntry();

  out.close();
 }

Call as :
 public static void main(String[] args) throws Exception {
  zip_single();
 }

For creating text files from List of string and zip them - see my earlier post 

Final Presentation Slide :Text Prompted Remote Speaker Authentication : Joint Speech and Speaker Recognition/Verification System

Here is the download link for our final years project's presentation slide. The title of project is Text Prompted Remote Speaker Authentication which is a Joint Speech and Speaker Recognition/Verification System and uses Gaussian Mixture Model and Hidden Markov Model/Vector Quantization for classification and MFCC as feature Vector.

Refer to http://ganeshtiwaridotcomdotnp.blogspot.com/2010/12/text-prompted-remote-speaker.html for detail of our project.

This project was done at Tribhuvan University, Institute of Engineering-Department of Electronics and Computer Engineering, Kathmandu, Nepal during November 2010 to January 2011.
The project members were:
Ganesh Tiwari
Madhav Pandey
Manoj Shrestha

Speaker Verification for Remote Authentication

Java open url in default system browser

open a url in system default browser - work for all  : windows, mac, linux operating systems

Full working JAVA source code example
import java.io.IOException;
public class StartBrowserUtil {
    private StartBrowserUtil() {
    }
    public static void openURL(String s) {
        String s1 = System.getProperty("os.name").toLowerCase();
        Runtime runtime = Runtime.getRuntime();
        try {

Java Image Processing : Negative of Input Image - source code

The code below is for getting negative of an input image in JAVA:


public class TestImagesss {
    public static void main(String[] args) {
        BufferedImage org = getImage("test.jpg");
        BufferedImage negative = getNegativeImage(org);
        new ImageFrame(org, "Original");
        new ImageFrame(negative, "After Negative");

java hex -int-string-byte conversion source code

Hexadecimal conversion - string, byte, integer - working java source code example :

public final class HexConvertUtils {

    private HexConvertUtils() {
    }

    public static byte[] toBytesFromHex(String hex) {

Java delete a folder and subfolders recursively

Java source code for deleting a folder and subfolders recursively.
Code for copying and moving files is here.
Working source code example:
public final class FileIOUtility {
    private FileIOUtility() {}
    public static boolean deleteFile(File fileToDelete) {
        if (fileToDelete == null || !fileToDelete.exists()) {
            return true;
        } else {

Java - contro lkeyboard 'lock key' state programmatically

Java Controlling the lock keys : Caps Lock, Scroll Lock, Num Lock 's state - programmatically
public class Lock_Key_Control_In_Java {
    public static void main(String[] args) {
        Toolkit tk = Toolkit.getDefaultToolkit();

        //enable disable key state Caps Lock, Scroll Lock, Num Lock keys
        tk.setLockingKeyState(KeyEvent.VK_NUM_LOCK, true);
        tk.setLockingKeyState(KeyEvent.VK_CAPS_LOCK, false);
        tk.setLockingKeyState(KeyEvent.VK_SCROLL_LOCK, false);
    }
}
The lock keys LED in the keyboard should be  turned ON or OFF ?

Java: Loading images in JFrame - Reusable ImageFrame

Sometimes we need to show multiple images in separate window by using single line statement :
new ImageFrame(inImg, "Input Image ");// inImg is reference to Image object
The code below can be used to load images in JFrame as a separate window.

java copy file, move file code example

Java source code - copying a file , moving a file - working source code example :
Code for deleting a folder and sub folder recursively is here 
public final class FileIOUtility {
    private FileIOUtility() {}
    public static void moveFile(File src, File targetDirectory) throws IOException {
        if (!src.renameTo(new File(targetDirectory, src.getName()))) {
            String str = (new StringBuilder()).append("Failed to move ").append(src).append(" to ").append(targetDirectory).toString();
            throw new IOException(str);
        } else