• Interesting, Programming

    Posted on August 12th, 2010

    Written by Emad Ibrahim

    Tags

    , , ,

    Blackjack Simulator

    What’s a better way to get ready for a gambling trip other than write a blackjack simulator?  I am no blackjack expert but one of the strategies I heard off is to double your bet every time you lose.  So, if I start with a $100 bankroll and play $10 hands then I lost the [...]

  • Programming

    Posted on July 30th, 2010

    Written by Emad Ibrahim

    Tags

    , , ,

    Display a Dictionary/KeyValuePair as Grid in WPF

    Every time I work with WPF, I constantly think “I hate this shit” and “why is everything so damn hard”, but once I figure it out, I realize how powerful it really is and what I can really do with it.  I remember starting out with WPF and trying to figure out how to bind [...]

  • Programming

    Posted on May 3rd, 2010

    Written by Emad Ibrahim

    Tags

    , , , , , ,

    Subversion (SVN) to Mercurial and TeamCity

    Every time I think I got all the tools I need and I have a killer setup, something comes along that makes me question it all.  I am referring to mercurial.  For some reason, I have just heard of mercurial from TekPub.  I don’t know why I never heard of it before.  Probably because I [...]

  • Programming

    Posted on February 23rd, 2010

    Written by Emad Ibrahim

    Tags

    , ,

    Serialize Object To Clean XML

    I hate all the junk that gets added when serializing object to XML, so here is a quick way to do it cleanly. Here is the dirty way: public static string Serialize(this object obj) { string XmlString = String.Empty; using (var memStream = new MemoryStream()) { var serializer = new XmlSerializer(obj.GetType(), string.Empty); using (var xmlText [...]

  • Programming

    Posted on December 16th, 2009

    Written by Emad Ibrahim

    Tags

    , , ,

    Select Random Records Using Nhibernate

    Selecting 5 random rows in SQL is easy select top 5 * from users order by newid() .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode [...]

  • Older Posts Yeah! There are more posts, check them out.

    Newer Posts Yeah! There are more posts, check them out.