Main

August 17, 2007

Joel and FogBugz

I'm going to the World tour: North America - Joel on Software. If anyone wants to tag along with me, just register and let me know. It is free!

May 1, 2007

Twittervision

I'm still waiting for someone to come up with a good use case for Twitter in the Enterprise. Monthly status reporting comes to mind. If I can Twitter everything I do throughout the day and then come back later with some tool to help build my monthly status report...I think that could be useful. But that is a stretch.

It was Twittervision that started this post. I'm not sure how much of my life I have wasted staring at this page but the time (measured in minutes) was still way too much!

February 2, 2007

Stopping System.exit

Java has a robust and flexible security framework to control many aspects of a running application. Blocking System.exit() is one of those fined grain things that can be easily controlled with a SecurityManager. But why? If you don't have control over the entire code base (e.g. a third party library) then to make sure your app will keep on running it may just be something you have to do.

    final SecurityManager securityManager = new SecurityManager() 
        {
            public void checkPermission(Permission permission) 
            {
                if ("exitVM".equals(permission.getName())) 
                {
                    throw new SecurityException("System.exit attempted and blocked.");
                }
            }
        };
    System.setSecurityManager(securityManager);

January 12, 2007

Database Connection Strings

From Mark comes a couple of useful sites listing common database connection strings

January 2, 2007

Java Character Encoding

Charlie sent this to me earlier this year and I read it again tonight. Character Encoding when doing Java web development isn't easy and this article spells out what needs to be done when dealing with non-Western languages.

  • UTF-8
  • UTF-8
  • UTF-8
  • ...

October 23, 2006

Java IP Caching

There was an interesting piece in a recent Java Lobby Newsletter on Java IP Caching. The basic story goes something like this. Two servers each running a Java Process are communicating with each other. Server #1's IP Address changes and Server #2 will only reconnect after a JVM restart.

Digging into the javadoc for InetAddress makes it real easy to explain this behavior. And I'll be the first to admit that I had no idea this was the default behavior. Java's default is to cache IP addresses!

Java's IP caching behavior can be controlled by two system properties:

networkaddress.cache.ttl (default: -1) Indicates the caching policy for successful name lookups from the name service. The value is specified as as integer to indicate the number of seconds to cache the successful lookup. A value of -1 indicates "cache forever".

networkaddress.cache.negative.ttl (default: 10) Indicates the caching policy for un-successful name lookups from the name service. The value is specified as as integer to indicate the number of seconds to cache the failure for un-successful lookups. A value of 0 indicates "never cache". A value of -1 indicates "cache forever".

Remember this the next time you are playing Java Trivia, or if you want to be really devious, put this on a interview questionairre.

February 11, 2006

Hello, World!

Every introductory programming book begins with a "Hello, World!" program, but this Louisana Tech site takes that concept to the extreme. Almost 200 different examples using 200 different languages.

Sites like this don't make me miss college. I can't believe I had a whole semester of Lisp and Prolog.

Lisp

(DEFUN HELLO-WORLD ()
                  (PRINT (LIST 'HELLO 'WORLD)))

Prolog

hello :-
printstring("HELLO WORLD!!!!").

printstring([]).
printstring([H|T]) :- put(H), printstring(T).


Fatal error: Cannot redeclare is_valid_email() (previously declared in /homepages/38/d90648280/htdocs/mt/php/mt.php:745) in /homepages/38/d90648280/htdocs/mt/php/mt.php on line 751