Scripting to the top of Hearthpwn Leaderboards

Hearthpwn is a community Hearthstone site where most people go to find the latest decks to try their hand at making legend for the season.

Another feature on the site is the Hearth Pack Simulator, a fun little ‘game’ where you can try your luck at opening a random pack of Hearthstone cards. There are 8 different rarities to Hearthstone cards: common, rare, epic, and legendary (and golden variants of each), and each one gives a different ‘score’ on the Hearth Pack Simulator. Tens of millions of packs have been opened on the site and there is a leaderboard that keeps track of the daily/weekly/etc best packs opened. I decided I wanted to make it to the top of the leaderboard.

Did I make it to the top?

Read on →

Truncating SQL DateTime in SQL Server 2008

Recently a coworker was writing a T-SQL script to compare ten-minute timeslices against each other. He was trying to figure out an easy, performant way to remove the ones place so that he could treat all timeslices from 01:00.00 to 01:09.99 as the same datetime, and so on. I found a few StackOverflow resources like this one but none that did exactly what I wanted. I adapted those with some trial and error into this:

Read on →