Home / Blog

Utilities.NET 1.0 released

02 October 2007 Filed under: , , | 28 comment(s)

Homer: Listen, what would you say if I told you a woman did most of the work? Kent Brockman: I'd have this gazebo torn down and built into a coffin...for your manhood. Homer: (Shrieks) Kent Brockman: Why did my hypothetical scenario scare you so? Homer: Uh, like all manly men, I have a vivid imagination. Kent Brockman: Well said! Let's take off our shirts and wrestle. Utilities.NET is a collection of helper classes and components for quickly solving common .NET programming tasks.

The library is pretty large, currently 117 classes, 300ish unit tests and many, many methods. When I'm developing I have a habit of throwing what is generic in helper classes and Utilities.NET is a combination of many of them times nearly 5 years of .NET development.

The code in Utilities.NET is a rather eclectic mix. A lot is the result of other project's I've worked on (i.e. the reflection stuff comes mostly from implementing a serializer for Json.NET) while other parts come from experimenting with .NET features (such as a lot of what is under threadingSmile)

There is no way I could summarize the functionality of every class and static method in one post so I recommend you download it and take a look for yourself. I plan to write some posts looking more closely at specific classes that I think are useful or interesting. In the meantime here is a brief summary of what Utilities.NET covers:

  • Collections
  • Configuration
  • Type converters
  • Database
  • Email
  • Files and streams
  • Events
  • Validation
  • Reflection
  • Resources
  • Services
  • Testing
  • Text
  • Threading
  • Web and ASP.NET
  • Xml

Documentation for Utilities.NET is currently quite light, with XML comments over about half of the library. In the future I plan to use SandCastle to generate help files but for now you are largely on your own Smile

Utilities.NET CodePlex Project

Utilities.NET 1.0 Download - Utilities.NET source code and binaries

kick it on DotNetKicks.com

Sitemaps 1.1 released

12 September 2007 Filed under: , , | 3 comment(s)

Don't kid yourself, Jimmy. If a cow ever got the chance, he'd eat you and everyone you care about!GoogleSitemap.NET has been renamed and re-released as Sitemaps.NET 1.1. When I originally wrote it in 2005, XML sitemaps were a Google only feature but since then Microsoft, Yahoo and Google have gotten together to create a standard, hence the rename.

There a couple of changes and bug fixes in 1.1 but nothing major.

  • New feature - Ability to ignore URLs in your ASP.NET sitemap by adding the attribute sitemapsIgnore="true"
  • Change - Renamed from GoogleSitemap.NET to Sitemaps.NET to reflect the new standard at http://www.sitemaps.org
  • Change - Namespace updated to http://www.sitemaps.org/schemas/sitemap/0.9
  • Bug fix - Fixed culture issues related to writing the decimal point in a URL's priority

While I was putting Visual Studio's rename refactor through its paces I also changed the license, created a Sitemaps.NET page on my blog here and created a CodePlex project containing the source. Links below.

Sitemaps.NET CodePlex Project

Sitemaps.NET 1.1 Download

Json.NET 1.3 + New license + Now on CodePlex

08 September 2007 Filed under: , | 4 comment(s)

Homer: Welcome to the internet my friend, how can I help you? Comic Book Guy: I'm interested in upgrading my twenty eight point eight kilobaud internet connection to a one point five megabit fibre-optic T-1 line. Will you be able to provide an IP router that's compatable with my token ring ethernet LAN configuration? Homer: (long pause) Can I have some money now? Since the last release of Json.NET JSON's popularity and usage has continued to grow, with many people taking the time to report bugs and make suggestions. This latest version addresses all known bugs and adds a few of the most requested features.

  • New feature - Added JsonPropertyAttribute. This attribute lets you define the name of a JSON property when serializing and deserializing. It is equivalent to XmlElementAttribute for XML serialization.
  • New feature - JsonSerializer now supports deserializing read only collections and has better support for custom collections.
  • Change - Improved JavaScript string escaping.
  • Bug fix - XmlNodeConverter now correctly writes integers, floats, booleans and dates in elements.
  • Bug fix - JSON text that ends with whitespace no longer causes the JsonReader to enter an infinite loop.
  • Bug fix - Fix for culture issues with DateTimes and doubles when deserializing.

What's New

The most notable new feature is the ability to control the name of the JSON property a .NET property will serailize to and from using an attribute. For example if you want the BillingAddress property on your Person .NET class to be serialized as billing_address on your JSON object, just add the JsonPropertyAttribute to the BillingAddress in .NET and set the PropertyName to billing_address. This feature is equivalent to the functionality the XmlElementAttribute providers for XML serialization.

public class Person

{

  private Guid _internalId;

  private string _firstName;

 

  [JsonIgnore]

  public Guid InternalId

  {

    get { return _internalId; }

    set { _internalId = value; }

  }

 

  [JsonProperty("first_name")]

  public string FirstName

  {

    get { return _firstName; }

    set { _firstName = value; }

  }

}

New license

I have changed the license Json.NET is provided under to the MIT license. Json.NET previously used a Creative Commons license, a license which is more commonly used with media than software. Also since Creative Commons isn't compatible with the GPL I have regularly been getting emails asking whether it is ok to use Json.NET in a GPL licensed project, which I have no problem with.

I chose the MIT license because it is the least restrictive license in common use that I could find. Json.NET is yours to do with it as you want Smile

Codeplex

Finally, I've created a CodePlex project for Json.NET and uploaded the source code plus this release. I've downloaded many projects off CodePlex since it was created but this will be the first time I've set one up. Hopefully Codeplex will be beneficial to Json.NET (plus a good learning experience Smile)

Json.NET CodePlex Project

Json.NET 1.3.1 Download - Json.NET source code and binaries

Update:

There was a bug in 1.3's JavaScript string escaping. It has been corrected in Json.NET 1.3.1 which is now on CodePlex.

One year at Intergen

31 August 2007 Filed under: | No comments

Maybe we should tell the big secret: that all those chimps we sent into space came back super-intelligent.

It is nearly a year to the day that I started at Intergen and it is fitting that I'm giving personal presentation to the office (sort of an Intergen tradition) at the same time.

Below are the highlights of my year at Intergen:

Highlights

  • Meeting a lot of cool people, both at Intergen and in the wider MS software development community. At my previous job I was pretty isolated from the local software scene and working at Intergen has definitely changed that.
  • Working with a lot of new technologies: SQL Server 2005, WCF, WF, SSIS, Silverlight.
  • Learning that writing good code isn't just about getting it to work, but that it also has to be maintainable and extensible. I had already done some work using unit tests with Json.NET but while at Intergen I've learn't a lot about using unit testing with larger software projects and designing for testability.
  • Working in larger teams and combining TFS, build servers and unit testing. Continuous integration seems so natural now I'm suprised that we're the exception, not the norm.
  • Having a great time at TechEd 2007. TechEd is something every developer needs to experience at least once. Bug your boss (or come work for Intergen Wink)
  • Making great strides in my Halo skills (really looking forward to Halo 3 Smile)

Change of location - http://james.newtonking.com/

28 August 2007 Filed under: | No comments

This blog is moving to http://james.newtonking.com/.

To handle links and traffic going to the old location I've setup a brilliant little HttpModule called UrlRewritingNet.UrlRewrite. It will redirect all traffic to the new address. Hopefully it should help make the transition fairly painless.

Technorati Profile

Here are your messages: 'You have 30 minutes to move your car', 'You have 10 minutes', 'Your car has been impounded', 'Your car has been crushed into a cube', 'You have 30 minutes to move your cube'.

More Posts Next page »