oddsblogs


::::: February 11, 2007 at 11:22 pm

IP Address to Integer Conversion in C# (and other languages)

A couple of times, I’ve needed a function to convert a string representation of an IP address to a 32-bit unsigned integer, to save in a database for example. It’s kind of a waste to save the string representation of an IP address in a database, as IPv4 addresses are only 32 bits and fit nicely in a 32-bit unsigned integer field of, for example, a MySQL table. Each character in the string would be a byte! »Click to continue reading…

Popularity: 73%

By Billy ::::: Permalink ::::: 5 Comments
See Related Stories In: Programming

::::: February 10, 2007 at 2:18 pm

Playing Card Hands - A Wordpress Plugin for Displaying Cards

Playing Card Hands is a wordpress plugin that allows playing cards to be easily inserted and displayed using simple tags in posts and comments. This is useful for bloggers writing about any card game: poker, spades, bridge, etc. The plugin is simple to install and use. –>

Popularity: 100%

By Billy ::::: Permalink ::::: 9 Comments
See Related Stories In: Programming

::::: February 4, 2007 at 2:46 pm

Shuffling Cards (Randomizing Arrays) the RIGHT Way!

A while back, I was writing a blackjack simulator where I needed to model shuffling a deck of cards (randomizing the elements of an array). This problem seemed simple; so simple that I made a big mistake. The code I was writing was in Java, but the examples here are in C. –>

Popularity: 58%

By Billy ::::: Permalink ::::: 1 Comment
See Related Stories In: Programming

::::: January 26, 2007 at 9:44 pm

Converting time from 24-hour (military) to 12-hour (AM/PM) in PHP

Today I was writing some code in PHP for a weekly schedule and found a need to convert an integer equivalent of an hour in 24-hour format to 12-hour format. So there was some table layout, and each cell represented an hour period of one day of the week. –>

Popularity: 85%

By Billy ::::: Permalink ::::: 6 Comments
See Related Stories In: Programming