RSS .92| RSS 2.0| ATOM 0.3
  • Home
  • About Me
  • Quotes
  •  

    Text Editor

    October 31st, 2006

    Can anyone recommend a good free text editor for Windows?  Something a little more powerful than Notepad2.


    Language Limbo

    October 23rd, 2006

    Old habits die-hard, I’m still tempted to put semi colons and curly braces in my Ruby code.  This is what happens when you are coding in two different languages.

    Ever since I started programming in Ruby, I’m forgetting to declare the access modifier in front of my methods and other times I didn’t bother declaring a main method, I just started writing code in the middle of the class wondering why Eclipse is drawing red lines under my code.

    I experienced the same problems when I was coding in C++ and Perl at work, and it took about a year to get over it.  At least then I was using a different IDE, lately I’ve used Eclipse for both Ruby and Java development and there’s nothing to remind me that I’ve started coding in a different language.

    Maybe this is a sign that I should look into JRuby.


    How-to write Java programs that work with HTTP proxies

    October 22nd, 2006

    Sometimes, your network administrator may force you to connect to the internet through a HTTP Proxy. While this makes the administrator’s job of managing net security easier, a http proxy server will make your java application that communicates with the internet fall flat on its face.

    If you are behind a proxy server, your java application must know that internet calls will go through a proxy, to do this, add the following lines to your program:

    System.getProperties().put( “proxySet”, “true” );
    System.getProperties().put( “proxyHost”, “server1″ );
    System.getProperties().put( “proxyPort”, “8080″ );

    Some proxies also require you to send a username and password, if your proxy requires such action then you must also add the following lines to your code:

    URL url = new URL(”http://www.somedomain.com/”);
    URLConnection conn = url.openConnection();

    String password = “username:password”;
    String encodedPassword = base64Encode( password );
    conn.setRequestProperty( “Proxy-Authorization”, encodedPassword);