Programming

Blackjack Simulator

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(…)

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:

The resulting XML looks like this: Here is a cleaner way: And the resulting XML looks like this:

Select Random Records Using Nhibernate

Selecting 5 random rows in SQL is easy

Nhibernate is a different story.  I am new to NHibernate and I both love and hate it.  I hate the steep learning curve and the unobvious ways of doing things.  Anyway, here is how to select 5 random records using nhibernate. First class a new order(…)