April 2009 Entries

Safer Duck

No, it's not made from Latex. It can still quack like a duck and walk like a duck - but you'd be saved from trying to make it qauck like a duck. I call it a Rubberduck language (for obvious reasons). So how do you make a safer (and faster) duck-typed language? By using regex. This would be a good example of a rubberduck method: public IEnumerable<string> ~Get_(<table>[^_]*)_b... GetTableRowByFieldValue(string fieldValue) { if(table == "users") return Foo(field, fieldValue);...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Wrapping on Specific Characters

Wrap on specfic characters during a S.D.Graphics.DrawString()

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Browser != OS

I just read a ZDNet Article by Jason Hiner, and I strongly believe he is missing the point. Before I delve into the details, I would just like to state my opinion. The browser has become frankenstein - these word processors (if you can call them that) and so forth are using the browser for things that it was never designed for. Sure you have V8 in Chrome now - but JS will never match real OOP languages like C# and Java in terms of maintainability. These are 'cool' things that should have remained...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Unbox Enum as Integral Value

I needed a way to get the integral value of an System.Enum that is boxed. The solution wasn't immediately obvious after my experimentation mainly because: My enum was derived from byte (and I was trying to cast it to an int). My .Net jitsu wasn't up to scratch. Lucky thanks to a friendly guy called Guffa I managed to create generic solution. As it turns out you can unbox an enum value to its base type. As such the following can be unboxed to an uint. struct FoolishStruct : uint { Gluttony, Pride,...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

«April»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789