Creating your South Park Avatar

South Park AvatarSo, you are a fan of South Park and you want a fancy avatar like mine. It’s quiet easy and free. Just to to the South Park Studios website. Where by the way you can view all the 174+ episodes of south park.

Now to go the Avatar Creation section. You will find below the procedure to create a fully fancy south park character. You can try it yourself afterwards.
Step 1: New Character

Click on the New Character button on the bottom of page and then choose your character charcteristics:

Female, Male, Canadian, 4th Grader, Kindergartner

Then click Select to go to the next step


Create a new Character

Step 2: Choose your skin type

Step 3: Choose your accessories and be creative

Here are some random creation that i came up with 🙂 you can download and use them as you wish.

Click to see larger Click to see larger

Click to see larger

Click to enlargeClick to enlargeClick to enlarge

If you want to post your creation here, don’t hesitate send them to me, I’ll gladly put them on this post.

mypictr – we make your profile picture

While adding my blog on some blog directory yesterday, I “bumped” on a nice web tool that helps you to create profile picture for web social networks. It is many a times a harassing task to get pictures in an acceptable format for each of the social networks website you are registered too. Some need avatars size, some portrait size and others custom size. With the help of this small web tool, you can in a flash create the picture either save it on your PC or send it to an email address. Here are some screen shots of the site: http://mypictr.com/

mypictr interface

Exception: Collection was modified; enumeration operation may not execute.

It’s been a while that i didn’t get this Exception, while working, and yesterday, while I was performing some test on a new module that I implemented i got this exception. I knew i did get it sometimes back last year, and managed to solve it. So here is one solution when you are dealing with this kind of issue:

[csharp]

IList<Product> productList = new List<Product>();
productList.Add(new Product(“Some product 1”);
productList.Add(new Product(“Some product 2”);
productList.Add(new Product(“Some product 3”);
productList.Add(new Product(“Some product 4”);

[/csharp]

[csharp]

for(int i=(productList.Count -1); i >= 0; i–)
{
//Perform Edit, Update, Delete Operation using for .. i loop in reverse order
}

[/csharp]

There is a list of other solutions that can be found on the following websites:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=372532&SiteID=1
http://forums.asp.net/p/1147145/1861164.aspx
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_21585534.html

IT Workers gaining weigh and possible health problem

I’ve just found a nice article that talks of a study performed by CareerBuilder.com, it talks about how IT workers have begun to gain weigh just by sitting all day in front of their computers :). Let’s just hear what they have to say.

Here is a little intro:

Feeling a little, shall we say, sluggish lately? You might be among the vast ranks of IT workers who have put on some extra heft while sitting at their desks.

A study by CareerBuilder.com found that half of U.S. IT workers have gained weight at their current jobs.

The study, which polled nearly 7,700 participants from Feb. 11 through March 13, found that 34 percent of IT workers report they have gained more than 10 pounds in their current positions. Even more alarming, 17 percent say they have put on more than 20 pounds!…

Read the full article on: IT Workers Weigh In on Health Habits

Paging large result sets with SQL query

I’ve been searching on the internet for several ways to perform paging on a large result set from an SQL Query, there are several solutions, that can be found some are custom and others are already provided with ASP.NET Controls. This is the solution i have been using for performing paging of large datasets for data that is being used on a current web 2.0 site.

Here is a common problem:
A website offering search capabilities for it’s users is having performance issues while getting the result from it’s database, they have more than 100K record, and users are able to perform criteria search or just a text search on it. Criteria search can take up a lot of time to process depending on how it has been implemented. Statistics have shown that the average result count is about 1000 record for text search and 500 for criteria search.

The Stored Procedure
Let’s take this SQL Query as a sample query to get result for a typical text search.

SELECT Id, ProductName, ProductDescription, ProductRating, ProductPrice
FROM tbl_Product
WHERE
ProductName LIKE '%' + @Query + '%'
OR
ProductDescription LIKE '%' + @Query + '%'

This stored procedure takes one parameter a query ( @Query ), that the website visitor types in to search for something. And the query search both the Product Name and Product Description Field. This may result in some huge result set for some key terms.

We need to optimize this query to be able to perform custom paging on the other side.

here is how the optimized code would be:

--Will calculate the number of records of this particular request
SELECT @RecordCount = COUNT(1)
FROM
tbl_Product
WHERE
ProductName LIKE '%' + @Query + '%'
OR
ProductDescription LIKE '%' + @Query + '%'

SELECT *
FROM
(SELECT ROW_NUMBER() OVER (ORDER BY Id ASC) AS Row, Id, ProductName, ProductDescription, ProductRating, ProductPrice
FROM
tbl_Product
WHERE
ProductName LIKE '%' + @Query + '%'
OR
ProductDescription LIKE '%' + @Query + '%'
) AS TmpTbl
WHERE Row BETWEEN @RowStart AND @RowEnd
ORDER BY ProductRating

I have added 2 input parameters which are the @RowStart and @RownEnd, and 1 output parameter which is @RecordCount. With these new parameters added you will be able to lauch a query based on the number of records you want to display on a particular page. If you want to display 10 records per page your input parameters will have the following values
@RowStart = 1
@RowEnd = 10
since the query is inclusive.

You can use your prefered data control to display the data, and to build up the Paging logic in ASP.NET

Annoying software: a rogues’ gallery

Found this little article while reading some newsletter this morning:

Here is a little preview.

Adobe Reader
What does Adobe Reader do? Displays PDF pages. How does it do it? With as much bloody-minded bureaucracy, delay and needless interaction as possible. Perhaps it’s because we humans have been spoiled by books, where the gap between wanting to read something and reading it is as short as the time taken to lift the cover. But Reader’s incessant updates (demanding you reset your computer — why?), thundering great list of modules to load …

Apple
Oh, Apple. You created a domain where humans came first. You took usability and distilled it into an art form. Now look at you. iTunes is a music player the size of a fat-bottomed whale that gobbles resources like krill. It spends half its time trying to sell us stuff and the other half trying to stop us using it. But that’s not as bad as your auto-update policy: slipping us stealth copies of Safari under the cover of important version updates to iTunes and Quicktime….

Windows Update
Your machine will reset in four minutes. Your machine will not shut down until these five updates are installed. You must restart your machine now. You will install Microsoft Genuine Advantage. Please wait while these updates are installed. Please shut down all applications before applying this update. Pop! New updates are ready to be installed. And now that we’ve stopped you doing whatever it was you were doing (like we care)…

Read the entire article from zdnet: Annoying software: a rogues’ gallery