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.
Category: code
Schedule a Pending Intent
When subscribing to topics with GCM the documentation says to use an Exponential backoff method in the event of an error.
Web Service Generic JSON Call with Volley and GSON
Getting json into a java object from a web service is something that needs to be done all the time. This code makes it a little easier.
devdating.net Solution
Rocks are falling from the sky! You get an
array
of columns: rockso
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###...', ...]
wheremap[2][5]
translates to the rock atx: 2, y: 5
return
the result after all rocks have stopped moving.
Asp.Net MVC Calendar Helper
Recently while working on a project with Asp.Net MVC 3 there was a need for a small calendar similar to the asp.net 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.