posts - 916, comments - 758, trackbacks - 11

My Links



Post Categories

Misc. Coding

April 2004 Entries

And now a mark Poem in your pocket day...

First post in a while...illness and other stuff I'll blog about later...but to mark Poem in your pocket day...a bit early, here's one from one of my homies - Robert Burns (born just down the read from where I was - we all speak like this you know!). To A Louse Robert Burns ON SEEING ONE ON A LADY'S BONNET AT CHURCH Ha! whare ye gaun, ye crowlin ferlie! Your impudence protects you sairly: I canna say but ye strunt rarely Owre gauze and lace; Tho' faith, I fear ye dine but sparely On sic a place. Ye ugly, creepin,...

posted @ Wednesday, April 28, 2004 2:20 AM | Feedback (0) |

For Future Reference: Creating Templated Emails...very nice method using UserControls

I've done this in a few ways in the past, ranging from custom XML templates with XSLT / Regular Expressions to screen scraping - this is just the simplest and cleanest way I've seen to do this (also a very nice example of using the RenderControl method...). Actually, be sure to check out the rest of the content on this blog, some really handy stuff on there...

posted @ Monday, April 19, 2004 11:41 AM | Feedback (0) | Filed Under [ ASP.NET For Future Reference Links ]

Site Search with Index Server Companion

I've written previously that I've been hunting for a decent way to do web site search (specifically for CMS 2002 but just in general too...). I have been looking at Lucene.NET (which is in .TEXT 0.96) and a few other options. One interesting (and low cost - $39.99) option seems to be this. Essentially it provides a web crawler extension for Index Server, anyone tried this, any other options for low cost site search (as distinct from DB search / file-system based ones) I should consider?

posted @ Sunday, April 18, 2004 7:38 PM | Feedback (0) |

Turning HTML Documents into images...the code

Well, after a bit of playing I've got something working now, I'm no Win32 coder but this seems to work:using System; using System.Drawing; using System.Drawing.Imaging; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using mshtml; using System.Runtime.InteropServices; using Microsoft.Win32; namespace ThumbMaker { /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { private AxSHDocVw.AxWebBrowser axWebBrowser1; /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null ; private const string urlStr = "" ; public Form1() { //...

posted @ Thursday, April 15, 2004 8:36 PM | Feedback (0) |

Hmm..this is wierd...

A sudden problem has occurred on my blog and I'm not sure why...RSS feeds work fine, but the actual homepage does not, tried reindexing my SQL server, deleting a bunch of posts etc...still no joy! Very annoying! UPDATE: So changing the skin seems to have cured the problem - I'll leave this boring one on for the moment, I'll upgrade to 0.95 (maybe 0.96 if I'm feeling brave) at the weekend.

posted @ Thursday, April 15, 2004 7:15 PM | Feedback (0) | Filed Under [ .TEXT ]

This is very interesting - turn HTML documents into images

This is one of these things that's been running on a background thread in my brain for about a year, I have never seen a good example of how to do this but it just seems handy (I don't know what for but it 'feels' handy). Anyway, in the Codeproject mail thingy today this article was hiding at the bottom. Now, one of the comments mentions a way to do this in C# - going to have to try to get this working!UPDATE: I almost have this working (just a very slight size issue right now) the handiest info is...

posted @ Thursday, April 15, 2004 1:36 PM | Feedback (0) |

One of the really sucky things about working for a small company...

You don't get to go to conferences. It really sucks, I would love to go to these things (though when I worked at a previous company which did send me to the Wrox conference in Amsterdam I umm... remember very little of it!). So, the choice is, blow almost £2000 of my own money going to a conference (so conference or holiday in the Bahamas would be my choice :-|) or just don't go..guess which is more likely. Incidnetally, if there is some Microsoft person who wants a gofer during the Teched Europe - or just someone to point at and...

posted @ Thursday, April 15, 2004 12:34 PM | Feedback (0) |

Fonts for I in the minority

I was doing some work on the new version of my first article last night and I got to thinking, all the code in the new version is in the same font / colours that I use in my VS.NET. So, I was showing the new version to a friend and he mentioned that most people use fixed-width fonts when coding like profont. This got me to thinking, am I missing some trick here, I always use Verdana 8pt on a 1600x1200 120DPI screen with tuned Cleartype when I code - what's the disadvantages of this - why would I want...

posted @ Thursday, April 15, 2004 11:55 AM | Feedback (0) |

My wide and varied experience - or Jack of all trades, master of none.

I worte a few days about reasons I'd never be an MVP - today is a great exemplar of that. So far, I've fixed a few bugs on a bespoke community application (event handlers, HTML changes, T-SQL the lot), I' have some more work on a generic search control based on Lucene.NET for inclusion in some of our projects,I have bit more work on an HttpModule I'm writing to hook CMS2002's workflow and security systems in with an external one we require and done some initial planning on a new pitch...I'm also in the planning stage of a quick Forum control which...

posted @ Thursday, April 15, 2004 11:42 AM | Feedback (0) |

Interesting new Googleized search engine from Amazon - a9 is born (and coincidentally a road from Perth to Aviemore)

Been having a play with the new search engine of the moment, suspects that Amazon will be collecting a fair bit of market info from this engine (can you think of another reason they'd want to do this?). First impressions are that it's very 'feature rich' (i.e, packed with stuff I'll never use), the popup site infor thing is pretty good I have a Traffic Rank of 1369996 - which probably puts me around the realms of the native Latin speakers portal.

posted @ Thursday, April 15, 2004 12:44 AM | Feedback (0) |

It's the little things that make you happy

I've been lurking about in the ASP.NET forums a fair bit this evening and lo and behold I'm not moderated any more! Very cool - I guess I may have accidentally stumbled upon some right answers (see, you can apply JSP knowledge to ASP.NET ;-))

posted @ Thursday, April 15, 2004 12:37 AM | Feedback (0) | Filed Under [ Random ]

Pet hate...well one of many..

I tried my experiment again today. I don't know about overseas but in the UK at crossings we have a green man and a red man - you walk at the green man. Now, I had believed it was commonly known that the green man doesn't appear unless you press the little button at the crossing which activates the 'wait' sign - which then triggers the crossing to change to green. Apparently this is not common knowledge (not in Edinburgh at least). Today I tried my experiment (I had a little time to spare :-)) when I arrived at the...

posted @ Wednesday, April 14, 2004 1:30 PM | Feedback (0) |

Scanning for viruses during file uploads

I'll be honest, this one puzzled me and I came up with some really hackneyed solutions to manage the situation where a user-uploaded file contained a virus (I develop lots of community sites which allow file uploads). Most of the solutions I came up with relied on using a FileSystemWatcher running as a service that detected when the Visrus Scanner on the server moved a file to quarantine - which works, but the fact is that even for a short period you have a virus laden file on your Web Server - sysadmins hate that! So, I was doing a...

posted @ Wednesday, April 14, 2004 11:48 AM | Feedback (0) | Filed Under [ ASP.NET ]

Fairly interesting ASP.NET forums question - on using Global static variables instead of Application state in ASP.NET

I was replying to this forum post I actually couldn't find a good example on how to do this - wierd, it's such a common thing to do. So, the problem is, is there a better method than using the Application object to store objects which should be available for the entire lifetime of the application? Yes, global static variables are a great way to do this. Simply, you use the global.asax.cs file to define a static property - you can then access this simply using the Global.* in your code. For example, in the global.asax.cs: public static ArrayList...

posted @ Tuesday, April 13, 2004 11:50 PM | Feedback (0) | Filed Under [ ASP.NET ]

Why I will never be an MVP...

Oddly I've had a couple of email (even one from a Microserf) asking why I thought I would never become an MVP. Well, the simple answer is - time. Keeping a blog takes relatively little time, I probably spend an hour a day max posting to this thing and leaving selacious comments on other peoples - fine, I have no problem doing that. The problem arises when I have to block out significant periods of time to do stuff. In any one day I probably have about 2 hours where I can truly devote time to doing stuff of a...

posted @ Tuesday, April 13, 2004 2:47 PM | Feedback (0) |

For future reference...Page Events article

Just noticed this article by Paul Wilson from reading this post on his V1.x MasterPages Stuff. Nice, compact article on the timing of Page events in ASP.NET...very handy!

posted @ Tuesday, April 13, 2004 1:49 PM | Feedback (0) | Filed Under [ ASP.NET For Future Reference ]

The morning after the night before...and please give the value back to the MVP label.

Roy clarifies his position on the whole Rory thing...(incidentally, Rory, I tried to email you but it bounced back)My response, well, I posted an ill concieved post yesterday about the whole debacle which I have since withdrawn. Here's the response only response I'm willing to give on the whole thing - I will not enter into a debate on this - sorry!I will never be made an MVP - so I have no vested interest in this apart from the desire to form a strong .NET community.Sad thing is, the MVP title is worth something it's just not transparent enough and the few bad...

posted @ Tuesday, April 13, 2004 11:17 AM | Feedback (0) |

Version 2 of my Nested Repeater source code available.

Someone emailed me asking when the new version of my nested repeater article would be available - all I can say is very soon - hopefully I'll get some time to finish it this week. Anyway, the source code for the examples is complete, I'll probably add a couple more things to it when I publish the next version but these are the basics. You can download the archive here. I the archive you'll find examples of nesting using 'member method' and 'declarative' syntaxes as well as the ItemDataBound method detailed in my earlier article.

posted @ Monday, April 12, 2004 9:32 PM | Feedback (0) | Filed Under [ ASP.NET ]


Sorry, I had some downtime over the weeken - I was away for the Easter break and so was only able to restart just now. If you've sent me any mail over the last couple of days, chances are I haven't recieved it.

posted @ Monday, April 12, 2004 5:12 PM | Feedback (0) |

Lost it for a while but found it again...ILMerge - merge multiple assemblies into a single one (can make deployment easier)

I was reading SampoSofts blog when came across this which links to ILMerge, this is a little tool made by MSR (who are kind of the smartest guys at the smartest compnays - i.e., pretty smart!). What this does is combine multiple assemblies into one - why would you want to do that? Well, it can make deployment a bit easier for one and it lets you distribute a single exe instead of an exe and the 10 assemblies you you to provide most of the functionality (a lot cleaner)! Anyway, you can read more about it here. Also just found a really...

posted @ Thursday, April 08, 2004 2:01 PM | Feedback (0) |

Hmm...should I ditch .NET?

OK, let me start by saying that I enjoy working in C# / .NET more than I have any other language / framework in my working life. The problem is, that's just not enough. The simple fact is that I've chosen to live and work in Scotland and this severly limits my choices so far as my career goes - there's just not that many jobs up here in .NET and even fewer at my current level - if I hear the phrase 'I'm afraid the client thinks you have too much experience' once more I may have to start killing recruitment...

posted @ Thursday, April 08, 2004 1:39 AM | Feedback (0) |

nLucene - full text search crawler / engine for .NET

I've been doing some work on using MSCMS2002 and have had to look at ways to implement search (by default it doesn't have it and requires that you buy a much expensive Sharepoint license) well, I revisited the nLucene project - this had stalled for a while but looks like it's back in development. Interestingly, one of the contributors seems to be Scott W. - so I wouldn't be surprised if this became integrated with .TEXT in the near future... Anyway, take a look, it does seem incredibly cool and it would seem to benefit from the tons of development already exisitng for the Jakarta-Lucene...

posted @ Wednesday, April 07, 2004 3:39 PM | Feedback (0) |

Excellent article on the new ASP.NET 2.0 Caching features from G. Andrew Duthie

Really exciting changes by the looks of it - not long now before we can actually use these features (well about a year). Anyway, a usual an excellent article from G. Andrew Duthie (or G. for short).

posted @ Tuesday, April 06, 2004 4:05 PM | Feedback (0) | Filed Under [ ASP.NET ]

Probably old news but...Exchange Intelligent Message filter

I was scouting around to find a solution to my current spam overload (I currently use Cloudmark's Spamnet but it only runs on a client) and I came across this I just think it's really interesting that MS is planning to address the Spam plague in such a proactive way - and at long last! The real pain in the butt though is this:Intelligent Message Filter, scheduled for release in 2004, will be available exclusively to customers enrolled in Software Assurance. If your Exchange servers and associated client access licenses (CALs) are enrolled in Software Assurance (SA) when Intelligent Message Filter is...

posted @ Tuesday, April 06, 2004 3:06 PM | Feedback (0) |

My little compression helper...improved version

I posted my compression helper class before and realised almost instantly that it suffered from 'legacy lag' - so it'd been changed so much over the months that it was really bad! Anyway, presented below is a modified version of that class (which I've also tried out my new formatting scheme on) as a reminder, it's just a simple wrapper around SharpZipLib. using System; using System.Text; using System.IO; using ICSharpCode.SharpZipLib; namespace SerializableJob.Compression { public enum CompressionType { GZip, BZip2, Zip } public class Compression { public static CompressionType CompressionProvider = CompressionType.GZip; private static Stream OutputStream(Stream inputStream) { switch(CompressionProvider) { case CompressionType.BZip2: return new ICSharpCode.SharpZipLib.BZip2.BZip2OutputStream(inputStream); case CompressionType.GZip: ...

posted @ Tuesday, April 06, 2004 11:31 AM | Feedback (0) | Filed Under [ .NET ASP.NET Code Snippets ]

The 'factoryised' version of the cryptography class I mentioned previously...

I posted earlier about the really useful little encryption class by Ian Medvedev and mentioned that this could be factoryised pretty easy (well not really factoryised but you can switch the encryption provider). Anyway, here's what I can up with, pretty simple extension of the original allowing you to use whichever encryption type you want. using System; using System.IO; using System.Security.Cryptography; namespace SerializableJob.Compression{ public enum EncryptionType { DES, RC2, TripleDES, Rijndael } public class Encryption { public static EncryptionType Algorithm = EncryptionType.Rijndael; private static SymmetricAlgorithm m_cAlg { get { switch(Algorithm) { case(EncryptionType.Rijndael): return Rijndael.Create(); case(EncryptionType.DES): return DES.Create(); case(EncryptionType.RC2): return RC2.Create(); ...

posted @ Monday, April 05, 2004 1:47 PM | Feedback (0) |

Nice little point from a forum post on DbDataRecord and IDataRecord

When replying to this post in the ASP.NET forums, Dave023 (I wish people would use their real names, we're not posting porn there or anything!) he mentioned using the System.Data.IDataRecord instead of the System.Data.Common.DbDataRecord I normally use when binding to list controls using IDataReaders (such as SqlDataReader for the most part). I happen to like this - mainly because System.Data is one of the default namespaces improted into a VS.NET ASP.NET code behind page and System.Data.Common isn't - so you don't have to remember to import another namespace. Another nice side effect of this is that it makes switching from DataSets...

posted @ Monday, April 05, 2004 10:42 AM | Feedback (0) | Filed Under [ .NET ]

.NET Passport as a Web Service - in the 'whatever happened to' file

Just came across this story from 2003 about MS planning to expost the .NET Passport stuff as a Web Service - now I've even seen a document outlining how this was to be done, SDK everything - but it never happened - anyone know why?

posted @ Friday, April 02, 2004 3:19 PM | Feedback (0) | Filed Under [ .NET ]

Another future reference thing...really nice Symmetric encryption util class - well Rijndael as presented but easy to 'factoryise'

This is a solution to a pretty common problem - using encryption simply in .NET. Well, here's a simple class which provides decent encryption with zero effort (the best way!)UPDATE: Forgot to mention, this little class is from Ivan Medvedev who writes a really useful blog focussing on Security in .NET

posted @ Friday, April 02, 2004 2:49 PM | Feedback (0) | Filed Under [ .NET ]

For future reference...pronouncable password generator

From Gareth Brown, a very handle little tool which I can think of a dozen uses for right now - a pronouncable password generator.

posted @ Friday, April 02, 2004 2:46 PM | Feedback (0) | Filed Under [ .NET Security ]

Powered by: