Wednesday, August 22, 2012

VS extension for SQL Lite


Found this excellent VS extension for SQL Lite.

Visual database designer and editor
Create / Manage Tables in VS Server Explorer
EF Connecter for dot net 4

Download here for VS 2010/ Dot Net FW 4/x86:

For other versions/ editions:


~ Sumit Pranav

Friday, July 27, 2012

My experience with MonoTouch that allows development of iOS apps with C# and .NET


I have tried my hands on monotouch that allows iPhone and iPad apps with C# and .NET.

My experience had not been good, few of the reasons below:

  • ·         It has own IDE which is slow and crashes at times
  • ·         It’s SDK does not support all the native functionalities
  • ·         Code, once written for iPad needs rewrite of many components (specially UI) to port it on Android.
  • (The advantage of sharing code between Mono for Android and MonoTouch applications is greatly diluted because the UI definitions, proprietary SDK function calls, and even resource assets are mostly specific to each target platform.)
  • ·         The bulky Mono runtime that has to be either compiled into the application's resource bundle or installed as a separate runtime adds considerable overhead and start-up time, especially for small applications.
  • ·         Learning - development on monotouch for android and iOS is not straight forward, it needs the developer to be familiar to native development concepts of both of these platforms (like, Activities, Intents, UIControllers, View, Sub-view, NavigationControllers, …)
  • But, monotoch for iOS and Android generates nearly true native code that’s a plus.
  • Monotouch suits a use case where we want a native app and we don’t have objective c developers.

Modernize Your Dev

Modernize Your Dev

- Maturation of your .NET Roots
• Client-side Development
- Do more in the browser
• Abandon Post-back and ViewState
- Client-side network calls are here to stay
• Separate Concerns
- Don’t Comingle Markup, Design and Code

Tuesday, June 26, 2012

DNS Changer Malware- its effects and how to secure your computer from this


DNSChanger Malware has been infecting computers from November last year.
The roughly half a million devices are still infected with DNSChanger.

Infected machines had their Domain Name System settings altered so websites would redirect to servers controlled by the criminals. The scammers reportedly earned millions in affiliate and referral fees by diverting users through those sites.

Computers affected with this Trojan will not be able to access Internet after 9th July.

If infected machines are not fixed by then, their Internet connections will go dark.
On Google, infected computers will see a warning atop their screen when completing a search (see below). 


Read more about this Malware and how to check whether your computer has been infected by this here in FBI’s Publication

Canvas vs. SVG


Canvas vs. SVG
With the advent of Canvas and SVG (scalable vector graphics), developers now have better choices for doing graphics on the Web than in the past.

Before Canvas, plug-ins such as Flash or Silverlight were the standard way to create animations on the Web. The alternative was to create a collection of good old-fashioned HTML, JavaScript and images, and bundle them into a collection of moving parts—a tedious task at best.

Two primary types of graphics are used on the Web:
·         Raster graphics are arrays of pixels arranged on a grid, also known as a bitmap. Common raster file extensions are .jpg, .bmp, .png, .tiff and .psd. Because Canvas uses pixels, it is raster based.
·         Vector graphics use mathematical metadata contained in a file to describe the graphic. The V in SVG stands for vector. Common vector file types are .svg, .eps and .xps.
Canvas and SVG have a few features in common. Both Canvas and SVG have an Open Source library ecosystem, and you never need plug-ins for either technology.

Side-by-side comparison of common Canvas and SVG characteristics.
Single DOM element
Multiple DOM elements
Script language
Markup language
Raster graphics
Vector graphics
No file format
.svg file format
Must reset canvas to change drawn shape
Can edit shapes after drawing
Not accessible
Doesn’t support event handlers
Supports event handlers
Non-searchable, can’t index
Searchable, can index
Can use hardware acceleration
No hardware acceleration

Canvas tends to be well suited for highly interactive games, especially when combined with Internet Explorer 9 GPU offloading.
Canvas is a great choice for image editing, and although you can’t edit , you can save the context state to allow the user to undo actions, essentially to do real-time editing.
SVG is great for graphic basics such as displaying a resolution-independent company logo that scales to any screen size without pixel distortion.
Fractals and Mandelbrot sets are just two types of complex data visualizations that are well suited for SVG.

Wednesday, May 16, 2012

HTML boilerplate code to start your mobile supported HTML project

Check out this HTML boilerplate code to start your mobile supported HTML project

Paper.js an excellent HTML5 vector drawing scripting library

I came across this excellent HTML5 vector drawing scripting library called paper.js.

Paper.js is an open source vector graphics scripting framework that runs on top of the HTML5 Canvas. It offers a clean Scene Graph / Document Object Model and a lot of powerful functionality to create and work with vector graphics and bezier curves, all neatly wrapped up in a well designed, consistent and clean programming interface.

See some wonderful examples here:

Download source from here at github

Tuesday, May 8, 2012

Excellent JS playground to test your Java Script code with third party libraries


Found this excellent JS playground to test your Java Script code with different third party libraries
You can also save your code and share with the world, like this Knowckoutjs sample code:

-Sumit Pranav

Thursday, March 22, 2012

Generating Tag Cloud in /C#

Tag Cloud or Word Cloud is used to show frequency of words or phrases on your website or in some content.
Here is what this Tag Cloud will look like:

//Add this code in your solution:

public class TagCloudGenerator
	public string GetTagCloudHTML(Dictionary<stringint> tagNameWithFrequesncies)
		StringBuilder tagCloudString = new StringBuilder("");
		int highestFrequency = tagNameWithFrequesncies.Values.Max();
		int counter =1;
		foreach (string tag in tagNameWithFrequesncies.Keys)
			string tagClass = GetTagClass(tagNameWithFrequesncies[tag], highestFrequency);
            //TODO: need to set proper URL where links should redirect to
			string targetUrl  = "" + tag;
			string tagItem = " + counter + "' class='" + tagClass + "'> + targetUrl + "'>" + tag + "";
		return tagCloudString.ToString();
	public string GetTagClass(int tagFrequency, int highestFrequency)
		if(tagFrequency == 0 || highestFrequency ==0)
		return "tag0";
		var percentageFrequency = (tagFrequency * 100) / highestFrequency;
		if (percentageFrequency >= 90)
			return "tag90";
		if (percentageFrequency >= 80)
			return "tag80";
		if (percentageFrequency >= 70 )
			return "tag70";
		if (percentageFrequency >= 60)
			return "tag60";
		if (percentageFrequency >= 50)
			return "tag50";
		if (percentageFrequency >= 40)
			return "tag40";
		if (percentageFrequency >= 30)
			return "tag30";
		if (percentageFrequency >= 20)
			return "tag20";
		if (percentageFrequency >= 10)
			return "tag10";
		if (percentageFrequency >= 1)
			return "tag1";
// This is the required code to be placed in the Page where you want to generate Tag cloud 
protected void Page_Load(object sender, EventArgs e)
        Dictionary<stringint> categoryTags = new Dictionary<string,int>();
        categoryTags.Add("Science", 100);
        categoryTags.Add("Maths", 80);
        categoryTags.Add("Biology", 190);
        categoryTags.Add("Physics", 70);
        categoryTags.Add("Commerce", 60);
        categoryTags.Add("Behavioral Science", 90);
        categoryTags.Add("Psychology", 40);
        categoryTags.Add("Numismatics", 43);
        categoryTags.Add("Philately", 45);
        categoryTags.Add("English", 28);
        categoryTags.Add("Hindi", 145);
        categoryTags.Add("Oriya", 40);
        categoryTags.Add("French", 10);
        categoryTags.Add("German", 9);
        categoryTags.Add("Sanskrit", 8);
        categoryTags.Add("Telugu", 20);
        categoryTags.Add("Kannara", 2);
        categoryTags.Add("Malyalam", 1);
        categoryTags.Add("Pongal", 0);
        categoryTags.Add("Earth Sciences", 90);
        tag.InnerHtml = new TagCloudGenerator().GetTagCloudHTML(categoryTags);
// This is the CSS Style you need for rendering Tag Cloud
// Put this is the head section of your ASPX /HTML page 
<style type="text/css">
            border:1px solid black;
        .tagCloud span
        .tagCloud a
        .tagCloud a:hover
return "tag0"; } }