Developer Blog

February 9th, 2012: The Google weather API

If you happen to want a quick way for looking up the weather in your own applications, you can use the hidden Google weather API. To access it, just fetch the response for http://www.google.com/ig/api?weather=[your city]. You can replace [your city] with anything you want… a ZIP code or the name of the city you want to look up. This API provides the current weather and a three-day forecast in a handy XML format.

The usage is quite straight forward… just try it out. Originally it’s apparently used for iGoogle’s weather widget, so it’s not very detailed. However it’s still very handy for a quick look at the weather.

Filed under C# | No comments »

January 6th, 2012: Monte Carlo Pi

Unit circle

Today we’re gonna calculate pi. You might say, it doesn’t seem too interesting; it’s an old hat. You may be true, but we’re going to calculate pi using a method, other than approximating a circle with a polygon. So here’s what we do:

  1. We draw the unit circle on our cartesian coordinate system.
  2. We randomly drop points on the square, which contains our unit circle.
  3. The probability of the point dropping on the circle is Pi/4

    Continue reading »

Filed under C#, Mathematics | One comment »

January 2nd, 2012: Happy new year!

So, I’ve been quite lazy again… My bad, but I’ve also been really busy with my studies at the university. I’ll put “write more blog posts” in my new year resolutions… You know what? To make it up to you, I’ll write two interesting math-related blog articles in the next two weeks, so look forward to it!

Filed under General | No comments »


Copyright © Yichuan Shen 2012

→ Project icons by Mihaiciuc Bogdan → Vegur header font by arro → Glyphish icons by Joseph Wain → Thumbnail generatior by Joe Lencioni