Xunit using F#

by sunil ravulapalli /17. May 2014 06:01 /.net /Comments (0)

Create new F# Library project. Install Xunit from Nuget Create a class called MyTest.fs like this

module MyTests  
open Xunit

type myTest1() = class

    member self.myTest() =
       Assert.Equal(1, 1);


Build it, and then, just right click any where on the myTest1 method and choose Run Test. In the Test Explorer Window you should see the test run succesfully.

How to use Ninject in ASP.NET MVC 5 and WEB API 2

by sunil ravulapalli /30. April 2014 05:17 /asp.net /Comments (0)

Dependency injection frameworks are becoming a common place in all modern code bases. One of the most popular dependency injection framework in the .NET world is Ninject. This post will show a very simple example of how you can get started with Ninject. Check it out here: http://aspnetguru.com/how-to-use-ninject-in-asp-net-mvc-5-and-web-api-2/

My first Windows 8.1 game!

by sunil ravulapalli /27. April 2014 04:30 /windows8 /Comments (0)


Defend the planet from a continues barrage of asteroids. You control a ship which moves around a planet and has an unlimited supply of laser cannons to destroy the incoming asteroids. Don't let the asteroid come too close to the planet or your ship. How many levels can you go without getting destroyed? 

Nokia Lumia 1520 Initial review

by sunil ravulapalli /5. April 2014 06:26 /other /Comments (0)


Nokia lumia is simply six inches of goodness. The HD screen is amazing. I am not sure if it will dull down with age, but out of the box it is just begs you keep looking at it. Windows Phone OS is now quiet a mature OS, it usually performs well on even low end devices, but on this quad core 2.2 Ghz machine it is just treat. I am quite happy with the  OS and looking forward to the 8.1 upgrade. I did have a little bit of an issue getting the google contacts on to my phone, I am not sure if this really is a wide spread issue or it was just me.

Although Nokia is supposed to be a hardcore phone company which knows everything about building phones. I had a couple of issues with my previous phone, the Lumia 920. When I did a phone reset it just took forever along with multiple tries to reset the phone to its initial state. The second issue was at some point the camera on phone became permanently blurry. May be it was my fault, I may have dropped it once or twice, but it was still very annoying and couldn't find fix for it. I just held out and waited for my contract to expire to get the new phone.

Anyways, I am enjoying my new phone and Nokia did an amazing job with it.

Although, they are major apps, I would love to see vonage, fitbit apps on the windows phone and my life will be complete.

Links for the Windows Phone Fanboy

by sunil ravulapalli /1. April 2014 05:39 /other /Comments (0)


There is no hiding that I am a Windows Phone Fanboy. But I didn't know about these websites until recently.




These are my new favorite websites. I visit them as often as The Verge, Engadget and the Reddit front page.

Podcast recommendations for developers

by sunil ravulapalli /1. April 2014 05:16 /other /Comments (0)


The following are all the podcasts I currently listen to. I usually listen to them on my short commute and while exercising. I don't listen to every episode. I tend to skip some episodes based on the topic.

Developer/IT podcasts


This is what started the development podcasting trend. Still going strong. Features esteemed guests.


Features famous and not so famous guests, but a lot of variety. Each episode is just about 30 minutes and to the point.


Features various development topics in the Microsoft space.


Interviews with independent game developers.


Very entertaining show for windows and windows phone developers.


Features Microsoft IT topics.



Entertaining and thought provoking information about various issues surrouding our daily lives.


If your interested in space. Very entertaining.


Add a Music On/Off button to "Easy Menu" asset in Unity 3d store

by sunil ravulapalli /15. March 2014 07:06 /unity /Comments (0)

The "Easy Menu" I am referring to is https://www.assetstore.unity3d.com/#/content/4230.

In MenuElement.js, In the ElementTypes enum just below image add "button_MusicSwitcher" as a new option.

In the function OnGUI add this code

case ElementTypes.button_MusicSwitcher:
 if (GUI.Button (Rect (currentPosition.x, currentPosition.y, size.x, size.y), GUIContent (caption, icon)))
	if (!locked) {
		Camera.main.GetComponent(AudioListener).enabled =  !Camera.main.GetComponent(AudioListener).enabled;
		var musicOnOff = PlayerPrefs.GetString("MUSIC");
		if (musicOnOff == "OFF")
			PlayerPrefs.SetString("MUSIC", "ON");
			PlayerPrefs.SetString("MUSIC", "OFF");


Usually, if you have background music in a game scene you will have an "Audio source" component attached to game object like the "Main Camera" and you would have the option "Play On Awake" checked.

Uncheck "Play On Awake" option and modify code so that you start the music using code. It will look something like this:

public class MainCamera : MonoBehaviour {

	// Use this for initialization
	void Start () 
		string musicOnOff = PlayerPrefs.GetString("MUSIC");
		audio.loop = true;        
		if (musicOnOff == "OFF")

		Debug.Log("Hello:" + PlayerPrefs.GetString("MUSIC"), gameObject);		
	// Update is called once per frame
	void Update () {

Replace List<T>.Where() with your own "Where" to understand Func<T>

by sunil ravulapalli /1. March 2014 06:25 /c# /Comments (0)
class Program
	static void Main(string[] args)
		List<string> names = new List<string> {

		var outnames = names.Finder(x => x == "donald");

		foreach (var name in outnames) 

public static class MyExtentions
	public static IEnumerable<string> Finder(this IEnumerable<string> strings, Func<string, bool> predicate)
		foreach (var str in strings)
			if (predicate(str) == true)
				yield return str;

Enumerable.Range Example

by sunil ravulapalli /1. March 2014 05:18 /c# /Comments (0)


var numbers = Enumerable.Range(1, 10);

foreach(var num in numbers)








Web Api 2 Authentication Tutorial Video

by sunil ravulapalli /21. January 2014 05:24 /asp.net-web-api /Comments (0)