Simon Taylor - .Net developer, Cheltenham

My record of coding problems solved and new things discovered

Using Lucene.NET with BlogEngine.NET

clock April 25, 2010 17:06 by author Simon

I've just changed the search functionality of this blog to use Lucene.NET and all of the quick, rich searching functionality that that provides. It is testament to whoever first wrote the original blog engine search functionality, that it was as relatively straight forward to do as it was. Below are the steps and an explanation of some of the code changes I made - I'm not going to explain what Lucene is or how it works, there are plenty of resources out there that alreday do this, just use your favourite search engine to find them. Smile More...



How NHibernate integrates with second level cache

clock April 23, 2010 01:03 by author Simon

It's never been 100% clear to me when using second level cache with NHibernate, when NHibernate accesses the cache and when it needs to go to the database directly. There is a great explanation of how NHibernate uses caching in The NHibernate FAQ, but even after reading this, I still wasn't completely clear on when NHibernate has to hit the database, so I went about testing it out myself. Below are the results of my testing; I was using NHibernate 2.1.2.400, FluentNHibernate 1.0.0.629, SQLServer 2008 and NCache 3.6. I created a single test consisting of each of the code snippets below and I set the NHibernate show_sql configuration parameter to true so that I could see when NHibernate hit the database. I also created an IClassConvention that tells NHibernate to cache all entities as read write (in reality I would probably be more granular than this). More...



Integrating with Microsoft Project Server 2007 (2)

clock August 13, 2009 18:42 by author Simon

I have already done one post on integrating with project server. Since then I have had to get much more involved with it and have discovered it's a bit of a dark art to say the least. Hopefully, this post will serve as a useful resource to anyone else who needs to do the same and stop them from having to go through all of the pain that I went through.Cry More...



Cool sharpcoder widget available

clock August 8, 2009 09:42 by author Simon

I've created a cool widget using the clearspring platform at www.clearspring.com. You can embed this widget pretty much anywhere - google, facebook your own web page etc - it's a great way of sharing links in a way that is under your control.More...



Copying datarows

clock August 8, 2009 09:06 by author Simon

Some succinct code for making a copy of a row from a DataTable.More...



IronPython: Properties

clock August 8, 2009 08:42 by author Simon

To create a property in IronPython (equivalent to a C# property) you need to create the get and set functions and then pass them into the in built property() function and assign the result to a variable with the name of the property you wish to create. For example, the code below defines a getter:More...



TSQL: Drop all your tables

clock August 8, 2009 08:30 by author Simon

Some useful TSQL for dropping all of the tables in a database: More...



Creating classes at runtime

clock June 14, 2009 21:55 by author Simon

I've been working on an application that has a number of forms that need to be laid out based on configuration data in the database, this enables the application to meet the requirements of many different customers. Laying out the forms based on the configuration data is relatively trivial - it is just a matter of writing the code that normally ends up in the .designer file. However, because there could be any number of controls on the form, binding an object to them is a little more tricky. I approached this problem by creating a class that describes a control that will added to the form together with a boolean, integer and string value field that is used to initialise the control and capture the users input based on the type of control. I had a list of these objects representing all of the controls that needed to be rendered on the form, to bind the controls to these objects, I needed an adapter which I created at runtime.More...



Passing an IronPython method to a C# method that takes a delegate as a parameter

clock June 14, 2009 21:42 by author Simon

This is again IronPython 101, but again took me a little bit of time to work out how to do it. Consider the following C# delegate and method:More...



IronPython String formatting and concatenation

clock June 14, 2009 21:33 by author Simon

This is really IronPython 101 but this was a really difficult thing to find by Googling! There are also examples in IronPython in Action but again, searching for them if you're not sure what you're searching for won't get you very far. The solution is pretty similar to how you would do it in C:More...



About the author

Simon is currently living and working in Toronto, Canada as a software consultant for Infusion. He is primarily a .Net developer although sometimes has to turn his hand to other technologies such as Java and flex. Simon has also recently started iPhone application development. Contact me.

Sign in