Monthly Archives: January 2012

HTML5 canvas full view

I just wanted to share this small code sample for embedding HTML5 canvas fully inside the browser window. The simplest HTML looks like this:

<!DOCTYPE HTML>
<html>
    <head>
    </head>
    <body>
        <canvas id="myCanvas" style="">
        </canvas>
    </body>
</html>

Read the rest of this entry

Advertisements

Uniform resizing of multiple containers in Windows Forms

When dealing with resizable dialogs, anchoring is the best way to ensure that certain controls, like containers or data grids, stretch and resize along with with the form itself. This ensures that the user experience is enhanced when dealing with large quantities of data that are, by default designed, viewed on small window. While this design is sufficient for certain cases, in other, more business like, there are limitations that can be overcome by using different container. Read the rest of this entry

Google Data API with RestSharp on WP7 Update

Special thanks to John Sheenan who pointed out an error in my code. First of all, calling Dispatcher.BeginInvoke is redundant since the callback action will be invoked on the main thread.

Secondly, there is a powerful deserialization feature in RestSharp. Create a simple class that will correspond to the deserialized JSON object: Read the rest of this entry

Google Data API with RestSharp on WP7

RestSharp is an open source REST client for .NET. I will use it for consuming Google Data API. You can easily install via the following NuGet command

Install-Package RestSharp

First step is creating an application in API Console and selecting services that you will be using. In this example, we will use the Tasks API. Once you create your project with the appropriate settings, you will need client_id and client_secret which is available on the API Access page. Read the rest of this entry

Google data API and OAuth: “invalid_grant” error

This extremely frustrating error can be remedied by simply re-requesting device code. You will need to authorize your app again, but at least it will work. You can also try changing the secret first, but in my case it did not work.

Visual Studio Achievements

Spawned from a popular blog post, this new add-in for Visual Studio brings gamification to everday work job to serve as a relaxing distraction from mundane code crunching. Even though most of the originally proposed achievements were cynical comment on the fact that there is so much bad code written today, and in that sense you do not want to achieve those “anti-achievements”, the actual list contains fun facts about the projects you happen to load inside your Visual Studio.

There is an excellent post at Ars Technica, check it out. The VS is portrayed as an expensive game in its Ultimate edition, comparing builds with spells and portraying compiler and linker as dungeon masters.

Download it from Visual Studio Gallery.

Useful links:

Sprite Sheet Packer

Sprite Sheet Packer (at codeplex.com) is an excellent little utility for packing all sprites in a single large texture. It is very simple to use, simply add all the files that need to be packed and select destination file path and type. Transparency will be preserved for PNG images. For preventing issues when using mipmaps, you can add the padding around each image. Read the rest of this entry