This is definitely a pet hate! Well said Coding Horror - keep your sticky fingers to yourself!! :)

Let’s say, just as a hypothetical, you’re sitting at your computer, casually chatting up a fellow programmer. You begin to describe some bit of code, then bring it up on your display to illustrate. You want to highlight some particular part of the code. Perhaps you move the cursor invitingly over the area to bring it to their attention, or gesture towards it with your hand.

What happens next?

When I said there were two types of programmers, here’s what I really meant:

  1. Programmers who touch displays with their greasy, disgusting, bacteria-addled fingers.
  2. Programmers who don’t.

I am incredibly anal about people not touching my displays. I’m not even going to apologize. If you touch my display, I’ll kill you. Displays are for viewing, not touching. Put down your damn sticky bun and go touch your own filthy display. Here’s my mental image of everyone who has ever touched my screen:

You know that’s you. You know it. You do. And you just can’t resist touching my display, can you?

Every time it happens, I replay it in slow motion, desperately trying to insert some part of my body between the toucher and my monitor. But I rarely succeed.

http://www.codinghorror.com/blog/archives/001115.html

SQL Replication Fun!

May 9, 2008

We use Microsoft SQL Server as the back end for our Retail Management & EPOS software. On most systems we use merge replication configured with pull subscriptions. Recently we’ve had a few instances of the replication mysteriously hanging on a merge - the first sign is usually the client calling to say their system is running very slowly. A quick look will show CPU usage at 100% with the replmerg process appearing to do a lot but actually doing very little! This could happen to one subscription or several at the one time - while remaining subscriptions operate fine.

 

Symptoms (you may get some or all of these)

  1. Subscriber machine slow & unresponsive
  2. ReplMerg.exe process takes 100% CPU time
  3. Agent process takes considerable CPU time on Publisher
  4. Replication “hangs” for long period
  5. Pretty much zero network traffic while it’s “working” away
  6. Query timeout messages at the subscriber repeating ever so often
  7. The following errors are found in replmerg.log on the subscriber :-
  8. Replprov.dll, 2008/05/07 09:32:57.479, 3964, 16890,  S1, ERROR: ErrNo = 0×8004501e, ErrSrc = <null>, ErrType = 8, ErrStr = The merge process was unable to create a new generation at the ‘Subscriber’. Troubleshoot by restarting the synchronization with verbose history logging and specify an output file to which to write.

    Replprov.dll, 2008/05/07 09:32:57.760, 3964, 16890,  S1, ERROR: ErrNo = 0×80045607, ErrSrc = <null>, ErrType = 8, ErrStr = The Merge Agent was unable to update information about the last synchronization at the Subscriber. Ensure that the subscription exists at the Subscriber, and restart the Merge Agent.

  9. Errors at the server include :-

The replication agent has not logged a progress message in 10 minutes. This might indicate an unresponsive agent or high system activity. Verify that records are being replicated to the destination and that connections to the Subscriber, Publisher, and Distributor are still active.

 

Cause

The cause is a known bug in SQL Server where it gets into an infinite loop when trying to run sp_MSmakegeneration. An update is supposedly due for release in July/August 2008 to resolve this problem - in the meantime a recommended solution is to set generation_leveling_threshold to 0 using the following SQL Code.

update sysmergepublications set generation_leveling_threshold = 0

This has worked for us most times - although sometimes it does seem to get reset back to the default 1000 and eventually will die again.

 

Other detail

Here’s a quote from the MSDN Forums which explains things a little :-

This basically tells the merge agent how many commands to put into a given generation.  This setting coupled with DownloadGenerationsPerBatch will tell the merge agent how much to download at a given time.  For example, if DownloadGenerationsPerBatch is set to 1, and generation_leveling_threshold is set to 100, and there are 10 generations to process (totalling 1000 changes), merge agent will sync 1 genreation at a time, and if it fails anywhere along the line, it will restart from the failed generation.  This is highly useful in scenarios with unreliable network as it gives the agent a chance to make progress amonst the many retries.  By setting it to 0, it will try to sync 1000 changes all at once, and if by the 999th change the network cuts out, merge agent will retry from the beginning all over again.
http://forums.microsoft.com/msdn/showpost.aspx?postid=1655111&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=3

 

And some other references on the forums

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1619326&SiteID=1

http://forums.microsoft.com/msdn/showpost.aspx?postid=1655111&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=0

One of my first blog posts last year was on my new T60 - I was really pretty happy with the purchase - at least after wiping it to get rid of all the pre-installed nonsense and sticking on a nice fresh install of Vista . So after 15 months hard use am I still as happy?

Amazingly the answer is yes - a fairly remarkable achievement given that I normally tire of my new gadgets before a week is out and start looking towards the replacement which will do things better. But the T60 really has delivered - and in fact the only problem which still bugs me slightly is the low screen brightness - something which has been annoying since day one. That and the fact that very occasionally it doesn’t hibernate properly when I close the lid and then my bag turns into an oven as it runs away until the battery dies - I think this one’s fixed by a recent firmware upgrade though.

I’ve used the laptop a lot over the year - done lots of development work on it - and lots of the usual email & web browsing when travelling. It really is the perfect balance for me - substantial enough to use every day - and small enough to make a good travelling partner.

However it has suffered the usual fate of a geek’s laptop and had hundreds of programs installed, uninstalled, upgraded, uninstalled, then reinstalled again! As a result it’s starting to grind a little. Ok .. starting to grind a lot actually …

It was time for a reformat and reinstall! I’ve been putting it off for months due to the sheer hassle of it all - but it had to be done sometime  … so I’ve bitten upon the bullet this weekend .. stuck a bit more RAM in it … imaged the old machine off using VMWare Convertor (a way cool tool by the way) … and installed XP SP3 RC1!

As for the XP as opposed to Vista .. I’ll explain why later! :)

We use a Voice over IP telephone system at work. This gives us a lot of flexibility - we have 2 main offices and also extensions at home. We can effectively control our system from anywhere - and if I’m working at a client’s site for a couple of days I can even take my office phone and plug it into their network.

We’re using Voipfone as the provider - there was some reliability issues back last year but since then they have proved to be pretty solid. Four lessons learnt early on if you want to use Internet based voice over IP in any kind of professional capacity :-

1. Buy a decent low-contention business grade broadband package. Headline rates don’t mean anything. A £50 per month business grade broadband is better than a £9 one. Period. And a cheap-ass broadband connection will break your heart ….

2. Buy a decent router which understands VoIP/SIP traffic and can prioritise - and if you don’t have in-house IT expertise to configure it find someone who does. Otherwise your calls will get cut up every time someone tries to download or upload a big file. You don’t need to spend a fortune - we’re using an Intertex IX68 which is about £150 or less.

3. Buy decent phones. Cheapo phones will give cheapo quality and reliability. We’ve been using Linksys 941’s which are reasonable. The last two phones are Snom 320’s which seem a bit nicer - albeit a bit more expensive (had some problems getting them to work but that’s a blog article for later!)

4. Have a backup plan. The reliability of ADSL broadband is improving all the time but it still can be a bit shaky at times - and the lack of a proper SLA is still a problem. Make sure you know what you’re going to do when (not if!) it fails. We have some redundancy with multiple office locations - and also have failover to PSTN & Mobiles in an emergency. Depends on your business but we could quite easily operate like this for a few days if we absolutely had too,

Are we happy using internet based VoIP for our business? Yes. The flexibility & ease of expansion is great. For a 7/8 extension phone system across two offices it’s VERY economical. And we can live with the lack of a SLA agreement and potential difficulties with getting problems sorted quickly.

The acid test though - would I install it for a client yet? Truthfully … probably not …

Like many people Google is my browser home page - it’s where I start almost every Internet search / browse from.

I might be a bit slow of the mark here - it’s possibly common knowledge - but here are a few useful things you can do with the Google search tool.

Calculator

To do some basic arithmetic just type your expression - hit search and Google will return a result.

Calc1

Or something more advanced,

Calc2

 

Units of Measure conversions

Convert gallons to litres, or acres to hectares, or bits to bytes,

Calc3

 

Currency conversions

Or do a quick currency conversion,

Calc4

 

Or how about a combination,

Calc5

Pretty handy. Read more at the Google Guide.

Once again Facebook demonstrate their finesse by kicking off a high profile blogger. In this case I agree that it’s not the “kicking off” which is the problem - the naming of this account was quite clearly in contravention of their rules - but rather the heavy handed and abrupt method in which they pulled the plug. No warning - just gone!

In a recent Scoble interview with Mark Zuckerberg he expressed the desire to encourage new applications which are less useless (my words not his!) and more functional. But why would anyone trust their data to a company who can restrict your access to your own data, and kill you off without so much as a sniff!

As it stands I wouldn’t be all that bothered if I wasn’t able to poke someone with a carrot - or throw a wardrobe at them! But if I was using this platform for anything other than total trivia I would be starting to get concerned ….

Web Browser Shortcut keys

January 16, 2008

While we’re on the topic of shortcut keys - here’s a nice post from Jeff Atwood on his blog Coding Horror.

The Five Browser Shortcuts Everyone Should Know

This is one area where a little effort can result in a big return in daily efficiency …. save a few seconds on something you do hundreds of times a day and it soon adds up to a more pleasurable & efficient experience.

One shortcut that was completely new to me is the Windows key + <Number> to launch applications which are on your Quick Launch bar on the task bar - very useful for firing up your browser or anything else you frequently use for that matter.

Just hold down the Windows Key and press the number of the icon - starting at 1 from the left.

Been using Google Reader for the last few months as my main RSS reader/aggregator - I was initially reluctant to go with a web based reader but have definitely gotten used to it with time. Having access from any machine at home, work, or when travelling is great.

This morning I lost the sidebar / panel thingy that usually lists your subscriptions on the left hand side of the screen - and in a bit of an airhead moment couldn’t quite work out how to turn it back on! I could still use the dropdown list but that’s a bit of a faff.

So, for all my fellow web thickos who have found this page - here’s how to turn on the missing panel. :)

Two options :

1. Click on the little arrow pointing to the right - this opens out the panel. It’s a bit on the pokey side which was how I missed it I guess. Doh!

2. Use the “u” shortcut key to toggle it back on again.

Incidentally - the Google Reader keyboard shortcuts are well worth a look - speeds up reading quite a lot. The ones I use most are :-

J - Next Item

K - Previous Item

S- Star Item

Shift-S - Share Item

Shift - A - Mark all as read

U - Hide / Show sidebar panel

And ……..

SHIFT-? to get a full list of shortcuts.

PS - Here’s an article from last year with some information on what RSS feeds are!

These will be very familiar to the UNIX heads - but they’re a pretty unutilised concept for us windows types. I certainly don’t use them every day, but there are times when a junction/symbolic link can be very useful.

For example, I had an issue today where I had to create a load of files in a directory on my server’s c:\ drive. The file path was hardcoded in the program  and so I couldn’t change the location the files would end up in - it was c:\folder or nothing! And typically there wasn’t nearly enough space on the drive for the files!

So - I created a junction point which mapped a folder on my c:\ drive to a folder on another driver where there was plenty of space. My application could then quite happily dump stuff into c:\folder - completely unaware that the data was actually stored on another NTFS volume altogether.

Basically - the junction point maps a folder onto another location - or to think about it another way, is a bit like a shortcut to another folder location - but a shortcut that appears to all intents to be an actual NTFS folder.

Junction Links have been with us since NTFS 3.0 (I think) - Windows 2000, XP, 2003 etc. You can use Junction Link Magic from RekenWonder software to set up junction links.

Symbolic Links are new for Vista / Server 2008 and allow for linking to network shares and also for linking files in addition to folders. You can set up symbolic links using the command line tool “mklink”

A word of warning though. These (particularly Junction Links) can be DANGEROUS. Deleting a junction linked folder will delete the contents of the target also! I don’t believe this is the case with Symbolic links - but don’t test it with a folder containing your life’s work! The NTFS Junction page on Wikipedia is well worth a read before messing with this stuff!

Lots more reading here :-

http://blogs.msdn.com/junfeng/archive/2006/04/15/576568.aspx

http://en.wikipedia.org/wiki/NTFS_junction_point

http://en.wikipedia.org/wiki/Symbolic_link

http://www.rekenwonder.com/linkmagic.htm

http://wesnerm.blogs.com/net_undocumented/2006/10/symbolic_links_.html