Advent of Code – Day 1

Advent of Code is a series of small programming puzzles for a variety of skill levels. They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme. Solution


rocksRocks are falling from the sky! You get an array of columns: rocks o and platforms #
Simulate rocks’ flight until they hit a platform, another rock or the bottom. Platforms stay put.
map is an array in the format ['ooo###...', ...] where map[2][5] translates to the rock at x: 2, y: 5
return the result after all rocks have stopped moving.

Asp.Net MVC Calendar Helper

Calendar DemoRecently while working on a project with Asp.Net MVC 3 there was a need for a small calendar similar to the calendar control. After some searching I decided that the easiest method to get this done would be to write a Html Helper. Below is the code that seems to work nicely. This works even if the browser does not support javascript. For added functionality you could add an extra parameter to show highlighted dates or extend it to fill a page and add content to the cells.