The Rantings of a .NET developer in a Web 2.0 world.

Latest

Strokes: achievements while programming! | Timdams’s Blog

 

 

 

As if your Stackoverflow.com or fourSquare achievements weren’t enough, now you can rack up some recognition of your .NET skills with a Visual Studio extension called “Strokes”. More in the link below.
Strokes: achievements while programming! | Timdams’s Blog
.

DOT NET TRICKS: Writing a Custom ConfigurationSection to handle a Collection

 

Found a nice article that describes an easy way to set up your own custom configuration section for your .NET applications.
DOT NET TRICKS: Writing a Custom ConfigurationSection to handle a Collection
.

Paging an IEnumerable collection using one easy method

If you’re looking for a way to easily display an IEnumerable collection in a paged format, I have below a rather simple extension method that I wrote to do the job.

public static IEnumerable GetPage(this IEnumerable collection,
                                     int pageIndex,
                                     int pageSize)
{
    return collection.Skip((pageIndex - 1) * pageSize).Take(pageSize);
}

Now, what this method is essentially doing is utilizing the Skip and Take LINQ extension methods to create a new IEnumerable collection containing the paged result. It does this by first figuring out how many elements it needs to skip over based on the page index and size, and then takes the next pageSize-th elements. The nice thing about this is since we are using the Take method, if the page size is greater than the number of elements on the on the last page, it will just simply return the remaining elements with no fuss.

So let’s say we have a collection named “foo” of 320 elements and we want to show them off 30 elements at a time. To grab the first page of the collection, we simply only need to call:

foo.GetPage(1,30); //Returns the first 30 elements.

And as for elements further down in the collection, simply increment the page index:

foo.GetPage(2,30); //Returns the second set 30 elements.
foo.GetPage(3,30); //Returns the third set 30 elements.
foo.GetPage(11,30); //Returns the last 20 elements of the collection,
                    //as it is 10 shy of filling 11 pages of 30 completely.
foo.GetPage(12,30); //Returns zero elements as we are now skipping over
                    //all of the elements at the given page size.

It’s very simple to use, and even easier enough to implement and I hope it makes dealing with collection paging in your code all the more enjoyable.

30+ Useful Photoshop Custom Shapes

Found an awesome and varied collection of custom made Photoshop shapes for you to use in your designs. Click here to view the collection.

jQuery inline Form Validation

Found a nice article describing how to use jQuery and RegEx to validate form input fields on your webform.

Click here to view

Full-Sized Calendar in jQuery

Came across this nice little Calendar widget that you can plug into your web applications with jQuery. Check it out here.

Certification vs Graduation: The educational dilemma of the modern IT professional

Recently I was asked the following question by a colleague of mine in regards to IT education:

What do you think is better for someone in IT to have: A four-year degree from a college or university? Or, certification for their field of work?

The short answer: both, obviously. But what if one had to choose between the two? What then would be the best course of action?
Read the rest of this page »

Surviving in the IT world in an economic recession

In today’s economy everyone is trying to find ways to supplement their income they receive from their regular job, or try to replace the income they’ve lost due to cut backs at their place of employment. For others, they may find themselves looking for a new gig altogether. Despite having the luxury of working in the field of IT, web developers and designers are not immune to the woes of an economy in decline.
Read the rest of this page »

Regular Expression Library Website

I was researching for a regex expression to use for validating a particular input for time when I discovered this website, The Regex Library.

It has a plethora of expressions for validating practically any kind of string format you can think of. Even better, you can test the expression on the site itself! For those of you out there who aren’t RegExperts, you’ll find the information contained in this website a huge help when you want to validate or search for a particular string.

Know of a better website/resource on Regular Expressions for developers? Let us know!

The IT Contract from Hell

Had an interesting and amusing story under wraps here for some time from ITContractor.com. For those of you thinking of going the consulting/contract route, please read this as a cautionary tale. For those of you already there, you’ll find the article amusing, maybe even bring back a few memories of horrible managers, bad clients, and projects gone wrong from the get go.
View Article

Have an interesting or funny story to tell? Share it below!