Like, uh, whatever, I guess


  Friday, May 28, 2004
    [9:49:32 AM]

Hierarchical categories in DasBlog

A few people have expressed a desire to have nested, or hierarchical categories displayed on the front page of their blogs.
After a bit of digging around, I found this FAQ on the DasBlog Wiki: http://wiki.shahine.com/default.aspx/DasBlog.FrequentlyAskedQuestions
Straightforward-ish, here's some step by step details to ensure you see it working:
  1. Go to the Add Entry page
  2. Type stuff
  3. Add "topCategory" to the category list (type it then click "add")
  4. Post
  5. Go to the Add Entry page
  6. Type stuff
  7. Add "topCategory|nestedCategory" to the category list (type it then click "add")
  8. Post
  9. Go to the front page, and you should see "topCategory" displayed in the category list, with "nestedCategory" indented below it
The key for this to work, is that all categories must have at least one post associated with them, and "topCategory" and "topCategory|nestedCategory" are treated as distinct categories.
More information:

  Wednesday, May 26, 2004
    [3:58:30 PM]


It's been a while since I wrote any VB, but I still remember the mysterious DoEvents statement, sometimes dropping it into some code sorted things out, sometimes it didn't, noone every really seemed to know.

So how surprised was I to find this lurking in someones C# code earlier? Very.


However after a quick Google search, this explanation popped up, which sounds sensible:

When you run a Windows Form, it creates the new form, which then waits for events to handle. Each time the form handles an event, it processes all the code associated with that event. All other events wait in the queue. While your code handles the event, your application does not respond. For example, the window does not repaint if another window is dragged on top.

If you call DoEvents in your code, your application can handle the other events. For example, if you have a form that adds data to a ListBox and add DoEvents to your code, your form repaints when another window is dragged over it. If you remove DoEvents from your code, your form will not repaint until the click event handler of the button is finished executing.

Typically, you use this method in a loop to process messages.

Microsoft reference: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsApplicationClassDoEventsTopic.asp

    [2:16:57 PM]

damm that dog

god knows why I haven't figured out how to get rid of it, but when I'm angry and frustrated at having lost some important file (read: probably deleted in frenzied hard drive de-cluttering half hour, oh woe shift-delete) why do I have to see that stupid dog wagging its tail at me while it supposedly searches my hard drive?

nothing quite belittles the code hacking process than some cutsey little animal trying to look helpful

it's probably best I take up smoking again and go for a walk right about now...

    [8:45:58 AM]

How to give an assembly a strong name

It's not hard, but as I had to learn how to do this yesterday while creating a sharepoint webpart, I thought it might be helpful to post the steps up here.

  1. Open the Visual Studio.NET Command Prompt
  2. Type:

    • sn.exe -k <path for key file to be saved>\<name of key file>.snk

      • I'd recommend saving the key file in the same directory as the project
      • I'd also recommend giving the key file the same name as the assembly (with out the extension)

  3. The key file will now have been created, you should see a message like: Key pair written to <path for key file to be saved>\<name of key file>.snk
  4. Open the AssemblyInfo.cs file in your project
  5. Change the [assembly: AssemblyVersion("1.0.*")] to a "hard" version, such as [assembly: AssemblyVersion("")].  This is so any references to the assemblys strong name (which contains the name, version and public key), don't break when the project is rebuilt and the version is automatically incremented.
  6. Change the [assembly: AssemblyKeyFile("")] to be [assembly: AssemblyKeyFile("<path for key file to be saved>\<name of key file>.snk")]
  7. Rebuild
  8. Done

To find out the public key token for your assembly, type the following into your Visual Studio.NET Command Prompt:

sn.exe -T <path to assembly>\<assembly name>

You should see a message like:

Public key token is c9d6fafd5a623323

So now when you want to refer to your assembly by it's strong name, you'll use something like:

<assembly name>, Version=, Culture=neutral, PublicKeyToken=c9d6fafd5a623323

  Monday, May 24, 2004
    [8:30:41 PM]

Public Face Sucking: why is it bad?

Sounds horrible doesn't it? Maybe, maybe not, but I'd like to take a few minutes of your time to try and explain why I think it is. I don't want to succumb to a self-indugent list of why I think it's bad, but rather present a hopefully more rational argument.

Firstly, what exactly do I mean by "public face sucking", or rather what is this poorly disguised rant directed at?

It's more than just a public display of affection (PDA): how could a simple affectionate touch, hug, or kiss offend anyone? How indeed? No, what I'm referring to, I suppose, is overly affectionate displays of affection in a confined public space.

Quite a mouthful to be sure, let me elaborate: I'm referring to crowded public transport: the London underground during rush hour, busy shops, buses and pubs, you get the gist.

Just what do I mean by "overly affectionate"? Well, anything more than a simple gesture really, face sucking may sound a little harsh, but I think the mental image it conjures up signifies what I'm directing this at.

When one witnesses two people being affectionate to each other, a number of possible explanations come to mind: perhaps they're related, meeting or departing, it's quite possible that the people are friends, but most likely of all is that they're lovers. After all, surely that's where most of our affection goes? These are the people I want to talk about.

When two lovers meet, it's easy to imagine that they've just been reunited after a seperation of desperate longing unable to contain themselves. A night of passion spent together that just can't help but spill over into the next day. Or the exciting prospect of travelling towards a shared destination, where fantasies might be indulged.

All valid reasons for an unchecked outpouring of affection surely? Perhaps, and this is when I give myself away as a prudish old man at the tender age of twenty seven, but I counter the above with these reasons for waiting. Delaying gratification for the greater reward when it does arrive. The delicious anticipation of something worth waiting for. The excruciatingly fine line between pleasure and pain.

One could argue that noisily licking someone's face whilst on a crowded train is so acutely embarrassing as to be strenuously avoided at all times, but lust and passion carry their own version of the serial aggressors "Red Mist". I say it's "Pink Mist": everything else fades into the background, embarrassment and even awareness of others is a distant thought.

To finish off this diatribe, I should finish with a well worded and carefully thought out conclusion, perhaps I would ask people to exercise more self restraint, not just in displaying affection publicly, but in all walks of life. Then again I could just say the same things to myself, after all haven't I just partaken in a public rant?

    [4:45:43 PM]

Best C# Bloggers?

Judge for yourself, the list is here: http://blogs.msdn.com/ericgu/archive/2004/05/22/139564.aspx

Personally I subscribe to Craig Andera, Clemens Vasters, and Miguel de Icaza, and find them all to be interesting and useful.

    [1:05:44 PM]

Soaking in Spam

Aaron Pratt is inviting people to send their spam to his new gMail account (prattboy@gmail.com), he's also posting statistics of how the spam filter is coping on a day by day basis.

It seems that the spam filtering is getting better, Aaron speculates that Google probably update the relevant algorithms weekly.

More information at: http://gmail.prattboy.net

Oh, since I posted my own gMail address up on this blog, some spam has begun to trickle in, not really enough to provide any real kind of analysis though...

  Friday, May 21, 2004
    [4:16:15 PM]

Lookup a users email address using Active Directory

Based on some VB.net code I found on 123aspx.com, I knocked up a little class in C# that given a SAM account name, returns the first email address it encounters in active directory.

The class is called ActiveDirectoryHelper.

To use the class, do something like this:

string emailAddress = ActiveDirectoryHelper.GetEmailAddress("SAM Account Name");

Here's the code verbatim:

using System;
using System.DirectoryServices;

namespace Numerica.Core.Util
    /// <summary>
    /// <c>ActiveDirectoryHelper</c> contains a number of static methods
    /// to assist with using Active Directory
    /// </summary>
    public class ActiveDirectoryHelper
        private static string _path = "LDAP://DOMAINNAME.TLD/DC=DOMAINNAME,DC=TLD";

        /// <summary>
        /// Private constructor as methods are all static
        /// </summary>
        private ActiveDirectoryHelper()

        /// <summary>
        /// Queries Active Directory for Numerica.ads for a users email address.
        /// </summary>
        /// <param name="samAccountName">The users SAM account name</param>
        /// <returns>The first email address that is returned by AD, null if no results are found</returns>
        public static string GetEmailAddress(string samAccountName)
            string rtn = null;
            DirectoryEntry directory = new DirectoryEntry(_path);
            DirectorySearcher searcher = new DirectorySearcher(directory);
            // Build LDAP searcher
            searcher.Filter = "(&(objectClass=user)(samaccountname=" + samAccountName + "))";
            SearchResultCollection resultCollection = searcher.FindAll();
            // No need to proceed if there aren't any results
            if ( resultCollection.Count > 0 )
                SearchResult result = resultCollection[0]; // Just use the first result

                ResultPropertyCollection resultProperties = result.Properties;            
                rtn = resultProperties["mail"][0].ToString(); // Just get the first email address

            return rtn;

Original article: http://www.123aspx.com/redir.aspx?res=30841

    [2:15:34 PM]

Change of feed URL

FeedBurner offers a rather nice free service, where they consume your XML feed, and then convert that feed into a number of different formats as required. So at the moment, as I use Blogger.com, my feed format options start and stop with Atom, but using FeedBurner I can hand out a new URL: http://feeds.feedburner.com/jurasource, and the format of the feed is dependant on what is reading it.

What does that mean? Well for one, if a newsreader identifies itself as say FeedDemon/1.0, FeedBurner knows that that reader doesn't support Atom, so it returns an RSS feed instead, pretty cool eh?

Also, FeedBurner will track accesses, and click throughs, giving some extra traffic reporting, which is nice

Formats supported are: RSS 0.90, 0.91, 0.92, 0.93, 0.94, 1.0, 2.0, and Atom.

More information: http://www.feedburner.com

FAQ: http://www.feedburner.com/fb/a/faq

    [10:20:31 AM]

DasBlog checkins

I've just checked in a couple of little changes to DasBlog, hopefully these will benefit others too:

  1. Fixed the access denied problem when using any web dialogs on the AddEntry.aspx page. (Code was trying to load the SiteSecurity.config file from the wrong location, which always resulted in failed authentication)


    • This problem was preventing us (Numerica) from inserting images and formatting code, and I suspect only occurs when Windows Integrated Security is being used (as thats the only time I've seen the problem)


  3. Added "Author" to syndicated content, the value is taken from SiteConfig.Contact, which is typically an email address (as recommended in the RSS2.0 spec).

    • I'm hoping this wasn't originally omitted for any particular reason.

    • I'm aware that there is a recommendation that the author isn't included when the syndication source is a single authored weblog.
    • Perhaps I should change this to be the login name of the person who actually created a post, to allow for multi-authored blogs. Having said that, the rest of DasBlog isn't really geared up for that (one only has to look at the configuration options to see what I mean).


More information: http://wiki.shahine.com/default.aspx/DasBlog.VersionHistory

DasBlog source code: http://www.gotdotnet.com/Community/Workspaces/fileshare.aspx?id=77a29128-4746-4473-b676-e4f1517a1907

DasBlog home: http://www.dasblog.net/

RSS 2.0 Specification: http://blogs.law.harvard.edu/tech/rss

RSS 2.0 Author Element: http://blogs.law.harvard.edu/tech/rss#ltauthorgtSubelementOfLtitemgt

  Thursday, May 20, 2004
    [9:18:41 AM]

Top 10 elements of good software design

Mr Ed of Hacknot comes up trumps again with this succinct list of good design pointers.

For example, how often is this point forgotten or ignored? (not that I'm referring to anyone in particular ;) (emphasis mine):

10. [An element of good design] Considers the Sophistication of the Team that Will Implement It

Does it seem odd to consider the builder when deciding how to build? We would not challenge the notion that a developers' skill and experience has a profound effect on their work products, so why would we fail to consider their experience with the particular technologies and concepts our design exploits? Given fixed implementation resources, a good design doesn’t place unfamiliar or unproven technologies in critical roles, where they become a likely point of failure.

[Update] As Steven has just pointed out, this is not always a hard and fast rule. There are situations where the risk associated with using a new technology is offset by the potential increase in functionality that the technology provides. In other words, each situation should be analysed, thus giving the most desirable outcome.

Full essay: http://www.hacknot.info/hacknot/action/showEntry?eid=54

Discussion: http://www.theserverside.com/news/thread.tss?thread_id=26021

    [8:59:44 AM]

Refreshing angle on worried parenthood

From time to time I do wonder just how people cope being parents. It seems that even looking after cats comes with way more worry and grief than seems reasonable.

The following post paints a more heartening picture, albeit one still slightly fraught:

I am much more scared of agendas than I am four-letter words. Fucks and shits and damns aren’t going to brainwash my daughter, although they might make her unpopular with the other mothers at playgroup. It will be much easier to undo the fucks and shits (“How about we say something else in front of Grandmommie?”), but much harder to undo ideas

Full post: http://www.dooce.com/archives/daily/05_19_2004.html

  Thursday, May 13, 2004
    [4:39:03 PM]

Information Heaven!

Stacks of articles already litter my desk, bag, and home, and there's always more interesting things to read and learn about. Imagine my delight when coming across a list at Google that contains links to "things that they want their engineers to be passionate about", or conversely, "if you're passionate about these things, we want to hire you".

For example The anatomy of a large scale hypertextual search engine is utterly fascinating, and well worth a read if you're in any way intrigued in just what is required to efficiently index four billion pages.

This is whats currently sitting on my desk, freshly printed, stapled, and awaiting persual in a comfortable place:


For a full list, see http://labs.google.com/papers.html

Yes, I do realise that I'm turning into a bit of a Google Whore, I'm sure it'll pass though :-)

    [11:15:18 AM]

Another project open-sourced by Microsoft

The Microsoft Windows Toolkit Library (WTL) has been just been made open source, which is nice.

Although this won't affect me in the slightest (still slowly working my way through C++ for Programmers by Leen Ammeraal), it's encouraging and I'm sure that the relevant communities will be happy.

What is the WTL?:

Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. It extends ATL (Active Template Library) and provides a set of classes for controls, dialogs, frame windows, GDI objects, and more.



  Wednesday, May 12, 2004
    [3:45:32 PM]

Google's blogging


Ref: http://www.google.com/googleblog/

    [3:34:57 PM]

I've got a page rank !

PageRank is one of the ways that Google decides where a particular search result should feature in a results page. Just noticed that mine is 1/10, it's a start :-)

<worried>Should I be this excited? Probably not</worried>



    [3:26:49 PM]

.NET SqlConnection Revelation

Revelation may be too strong a word, but that's what it felt like when I figured out this problem earlier:

  1. Create a SqlConnection, _con

  3. Set _con.ConnectionString to my connection string

  5. Open connection

  7. Do some stuff

  9. Close connection, no need for it to be open if it's not being used? (In this application this is the best approach)

  11. Re-open connection

  13. Try and do some stuff, but get an Error: Access denied message

  15. Throw up hands in dispair after realising that the password parameter has been dropped from the connection string... Why why why?

Thankfully there's a very simple solution to this, just add Persist Security Info=True to the connection string, and the password will be, well, persisted, regardless of how many times the connection is opened and closed.

Ref: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataSqlClientSqlConnectionClassConnectionStringTopic.asp

  Monday, May 10, 2004
    [4:29:25 PM]

Is this another ridiculous Amazon patent?

Whilst browsing over on Amazon.com earlier, I noticed this at the bottom of the page I was reading (note the "TM"):

Bottom of the PageTM Deals for May 10

Amazon.com = low prices. Save up to 50% on these great deals, updated every day at noon (central time).

Followed by a load of links to "particulary" good deals. So, is this another absurd patent along the lines of "1-Click"?

More details of Amazon patent controversy over on O'Reilly.com: http://www.oreilly.com/news/patent_archive.html

    [1:32:47 PM]

Unproduced screenplays, for download

Quite interesting, apparently shed loads of screenplays are written each year, but never become films.

Story here: http://www.kuro5hin.org/story/2004/5/8/73755/86297

I quite like the sound of Avatar by James Cameron, it's printing as I type.... http://www.wordsurge.com/Avatar__by_James_Cameron.txt

    [10:27:05 AM]

First spam to hit my gMail account

Well, it had to happen, I received my first spam in my gMail account today (actually I received it 5 times in the space of about a minute, but hey, they were all the same). This was to be expected, as I've already made my email address public by entering it in a previous post, mainly to try and attract spammers to see how well gMail's spam filter works.

So, how well does filter work? A little too well so far actually. Most of the subscriptions emails I've signed up for have arrived in the spam pot, and as there is no visual indication that emails are in there, I have to remember to check periodically. Though no real spams have made it into my inbox, yet.

  Wednesday, May 05, 2004
    [3:39:27 PM]

ASP.NET: Encryping credentials and connection strings

Several people have mentioned lately that they were concerned that their user credentials for DasBlog were stored in plain text in an xml configuration file on the web server. The standard response to that, at least on GotDotNet, is that if your webserver is compromised, then your blog is also compromised (tough luck).

While that is true, the problem I have is that in a corporate environment, all sorts of people have access to web servers: system administrators, systems support etc., but they don't necessarily have access to other resources. Other resources in particular being databases, but the ability to add/edit someones blog is also undesirable.

With that in mind, it may be worth looking at this Microsoft Knowledgebase article (http://support.microsoft.com/default.aspx?scid=kb;en-us;329290), on how to encrypt the settings just described.

The article references a downloadable utility, Aspnet_setreg.exe, which basically encrypts the settings and stores them in the system registry. Those settings are then referenced from the configuration file by using the registry key and some other parameters (full details in the article).

    [12:50:27 PM]

Website/blog re-design

I've thought about redesigning this blog, and associated (content poor) website for a while now, sadly each new attempt seems to result in:

  1. Spending hours tinkering with some javascript to get those drop down menus just right

  2. Agonising over the colour scheme, without chosing one

  3. Realising that I need to write a shed load of stuff to fill out the site, in other words actually write those Java/C#/SQL tutorials that're in my head

  4. Giving up in disgust, and anyway, plain old black and white is nice....

  5. Repeat

At least next time I'll be consulting the useful sounding tools referenced here: http://www.randsinrepose.com/archives/2004/05/04/your_redesign_toolbox.html which may make the process easier, longer, or more successfull, we'll see.

  Tuesday, May 04, 2004
    [1:27:23 PM]

Greg Reinacker has just posted some code up on his blog that allows you to create an RSS feed from Visual Source Safe activity (check in/out, includes comments etc).

Could be handy, though may be worth waiting to see what product it ends up being part of (the build has an expiry date).

  Monday, May 03, 2004
    [9:27:14 AM]

dasBlog 1.6 released

Omar's just released a new version of dasBlog on GotdotNet workspaces, my little contribution means that it's now possible to add additional configuration options for the Mail to Weblog functionality, namley:

  • Only delete emails that have been processed (i.e. posted to your weblog)

  • The ability to not log ignored emails

These options are particulary useful when a number of people are using the same POP3 mailbox, for example in a corporate environment, which is precisley why I added the changes

I also enhanced the cross post functionality, allowing you to choose a particular blog from a list of available blogs from a remote location (as opposed to the first one, which was the default)

Full list of changes here, and you can grab the release here


November 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004

This page is powered by Blogger. Isn't yours?  Weblog Commenting and Trackback by HaloScan.com