The Daily WTF
"The attached class connects to an Access database," writes Nicolai. That's always a good start for a WTF. Let's take a look. public class ResultLoader { private static Logger sysLog = Logger.getLogger(ResultLoader.class); private static String url = "somePath"; /** * get the ResultTable from the Access database * * @param tableName...
Tim Y. is on Fire with this burn. "Competing teams inside Google? Or just the AI recognizing marketing tactics?" Not to be outdone, the other big search conglomerate comes in for some anonymous criticism from a poster who says their name is "irrelevant". "I was suspecting for some time that bing is giving less and less reward points....
While Java didn't invent putting a toString method in the base class of every object, it certainly made it mainstream. The nice thing about the method is that it allows you to turn any object into a string, though it's up to the implementor to decide what a good string representation is. But what if you want to ensure that the object you're handed is...
Comments explain a lot about our code. And sometimes, the comments explain more than the code itself. Alastair found this lovely comment, which demonstrates an excellent, if confusing, understanding of a boolean "or": // Only add delivery option if it has no weight bands or at least one weight band. The developer has left the company, so no one...
While poring through some VB .Net code, John noticed some odd things in their datamodel. For example, a different process would scan files, and log any "suspicious" files into a database. The program John supported would then report on that data. One of their classes had a property which looked like this: Public ReadOnly Property SuspectedItem As...
You have some text, and need to replace every sequence of spaces with a single space. E.g., My text becomes My text. Now, if you're most of us, you ignore the famous quote and reach straight for regexes. But Samuel's co-worker isn't most of us. toReturn = toReturn.Replace(" ", " "); toReturn = toReturn.Replace(" ", " ").Replace(" ", " ").Replace("...
Bouw uw eigen nieuws-stroom
Klaar om het te proberen?
Start een 14-daagse proef, geen credit card nodig.