Archive for June, 2009
June 24th, 2009 | 5 Comments »
The Singleton design pattern is well known and used among programmers. It is so easy to use that unfortunately it often gets misused. In Java a singleton usually looks like this: public class Singleton { private static final Singleton INSTANCE = new Singleton(); // Private constructor prevents instantiation from other classes private Singleton() {} public [...]
Published in Uncategorized |
June 19th, 2009 | Comments Off
All programmers at all languages are familiar with the concept of default values. Many languages allow default parameter values when calling a functions, some provide a function overloading mechanism which is an expansion of this idea. For example in python you can have named parameters with default values: def multiply(v, mult=2.0) return v * mult [...]
Published in Uncategorized |
June 17th, 2009 | Comments Off
I’m relatively new to git and I’m already in love with it, but there was one thing that bugged me and I couldn’t get a good answer anywhere else, so I wrote my own thing, posting it so maybe you can find it helpful. The problem: Use a visual diff tool for git; and view [...]
Published in Uncategorized |
June 8th, 2009 | Comments Off
I was asked by a fellow worker whether flash can be? Short answer: no. Long answer below. But why would you even want to encrypt flash? I asked. He told me about a product he’s working on, some kind of hook for online games which identifies cheaters and bots as they play in real-time by [...]
Published in Uncategorized |
June 3rd, 2009 | 5 Comments »
Hey CSS guys, how about a CSS island tag?! This is what I’m talking about: <html> <style> h1 { font-size: bigger; } </style> <body> lots of html code…. <cssisland resets=”h1;h2;div.img;#id”> <style> h1 { font-size: smaller; } </style> here all page css code is preserved except for h1, h2, div.img and #id h1 has a smaller [...]
Published in Uncategorized |