Archive for November 2009

Great tools to test JSON and (totally unrelated) Pingbacks

I’ve done lot’s of “web 2.0″ stuff lately and i just want to write down to really nice tools i found. Test and Validate JSON I have just built an API for AlternativeTo. It use JSON and this tool was really a life saver when it came to debug and test everything. http://jsonformatter.curiousconcept.com/ Test if [...]

Return random rows from a MS SQL database

I always forget this command: SELECT * FROM YourTable TABLESAMPLE SYSTEM (10 PERCENT) This gives you some sample data from your database. In this case 10 percent of the content.  You could also use TABLESAMPLE SYSTEM (1000 ROWS) to get 1000 sample rows. Great to use if you have a big database and do not [...]

Convert String Array to Int Array and vice versa in C#

Sometimes you want to convert arrays back and forth. This is to nice extension methods to convert a int array into a string array and vice versa. public static class ExtensionMethods { public static string[] ToStringArray(this int[] intArray) { return Array.ConvertAll<int, string>(intArray, delegate(int intParameter) { return intParameter.ToString(); }); } public static int[] ToIntArray(this string[] strArray) [...]

Convert all checked checkboxes into an comma seperated string with JQuery

Sometimes i just love jQuery. Well most of the time actually. I did some work for a client a couple of week ago and i needed get all checkoboxes that was checked as a comma seperated list. I started with this code. I found out about the “map” method of jQuery wich has the following [...]