ninja star LINQ for JavaScript Lovers

by Michael Ceranski, posted on January 01 2010
LINQ was a major advancement in programming. Traditionally when you wanted to find a few items in a object collection you would write a loop and inspect the properties of each object and then return the items that matched. This was cumbersome and often resulted in the developer writing a lot of functions to return objects based on different types of searches. LINQ solved this problem completely because now you can use a SQL like syntax to return objects from a collection. LINQ comes in many different flavors, there is LINQ to SQL, LINQ to XML and LINQ to entities. However, today I ran across a project called jLinq, which is LINQ for JSON!. JSON stands for JavaScript Object Notation. JSON is simply a way to serialize object(s) to a string so they can be marshaled and eventually consumed by the client. For example here is the JSON string representing a Person: { "firstName": "John", "lastName": "Smith", "address": { "streetAddress": "21 2nd Street", ... [More]

ninja star Asteriods Clone in Silverlight

by Michael Ceranski, posted on December 23 2009
When each year comes to an end people tend to reflect on the past year and their accomplishments. For a programmer this often results in a look through the previous years source code. Of all the projects that I did last year my favorite project was the asteriods silverlight clone that I built. The asteroids clone was my first attempt at a Silverlight game and it was really fun to build. The project was developed over the course of a weekend and it helped me to get acquainted with Silverlight. I will go through some of the source code in case you are considering building something similar and need some tips to on how to get started. Getting Started Like most games, you need to have a main loop where you can draw and redraw sprites based on some variables. This is accomplished by created a DispatcherTimer that invokes a drawing routine at a predefined interval. The drawing routine is responsible for looping through all the objects on the canvas and updating their positions. For exam... [More]

ninja star Migrating From Blogger to BlogEngine.Net

by Michael Ceranski, posted on December 20 2009
Update: After moving to BlogEngine I started getting a large amount of spam comments. I went through the trouble of implementing captcha and I outlined the steps here. I recently went throught he painstaking process of migrating my blog from Blogger.com to BlogEngine.NET. Here is a brief walkthrough of the process: Export the blogger site to BlogML using Aaron Lerch's Poweshell Script. The powershell script produces an XML file which you can use to import all of your posts into BlogEngine.NET through the settings page. The BlogEngine.NET uses a concept called SLUG which is a relative URL. So if you write an article named "The Chistmas Story" it will produce a relative url of ~/post/the-christmas-story.aspx . Unfortunately the Blogger engine works differently. It removes certain words and punctuations from the URL string. In Blogger the same article would have a relative url of /2009/12/christmas-story.html. You will notice a few main differences here, Blogger uses the year and mon... [More]
Tags: ,

ninja star Blogging - Lessons Learned

by Michael Ceranski, posted on December 17 2009
UPDATE: I have made the switch to BlogEngine.NET. Thanks for the recommendation from Elijah Manor. Yes, it supports live writer and no database is required! I am reaching the end of my first year of blogging. I really learned a lot in my first year and I wanted to share my experience with you. Like most people, I started out with three major questions: 1. What service or blog engine should I use? This is a difficult question because there are quite a few free blogging sites out there. For example Wordpress and Blogger will allow you to sign up and start blogging for free. In the end it really comes down to personal preference. I am currently using blogger but I am less than enthused with the way the whole engine works. The themes are driven by XML templates which makes customizations a real pain. However, there is a large offering of widgets which makes things like adding a tag cloud a breeze. Since I am a .NET developer, and I want to make extensive customizations to my site withou... [More]
Tags: ,

ninja star Generating Dynamic HTML Tables with jQuery From an In-Memory DataTable

by Michael Ceranski, posted on December 11 2009
By nature, web applications are stateless so you have to work a little harder to make them produce an user experience equivalent to that of a traditional windows application. In this article, I will go over the process for how to load an HTML table to a web page using Ajax and jQuery. The process will require you to execute an asynchronous query in SQL Server, load it into a DataTable and return it to the browser as JSON (JavaScript Object Notation). Finally the JSON string can be consumed by jQuery and rendered as an HTML table on the browser. Lets start out by looking at this traditional snippet of ADO.NET code: System.Data.DataTable tbl = new System.Data.DataTable();try { using (SqlConnection conn = new SqlConnection(connectString)) { SqlDataAdapter da = new SqlDataAdapter(sql, conn); da.Fill(tbl); }}catch { //do something} The code simply loads a query result into a DataTable. This is something t... [More]

About the author

MikeMichael Ceranski is a developer specializing in the .NET stack. I have spent time as a DBA, Web Developer and even a network engineer. Up til now most of my career has revolved around the .NET stack but I have recently taken an interest in microcontrollers which has forced me to get acquainted with lower level languages such as C, and C++.

View my resume

Sponsors