Saturday, October 31, 2009

String.Reverse And Microsoft Interviews

A question which often comes up in interviews (and, I'm told, at Microsoft) is "write a method/function to reverse a string."
This, of course, isn't very difficult and lots of people get it wrong or give up. The following links are useful in getting the best answer, but really the best answer is how you work it out at the time. My opinion, though, is that the best answer is along the lines, "I'd look up some good examples and apply what I've learnt to the actual problem I have." This is appropriate simply because most people at work (especially when programming) are not in the firing line solving some real time James Bond type challenge and that there is usually a better solution created/invented/found by someone more intelligent/luckier somewhere in the world.

None of the points above are excuses for laziness or stupidity, however. Mostly, in my experience, points are gained by having experience and applying it well. Therefore;
It's also worth noting that:

string reversed = forwardStr.Reverse();

does not work. See link above.

[EDIT]

I'll include some extra links here, found recently while pondering the current state of affairs in the world. It's interesting to note that (it seems) a large number of interviews think that some (alleged) programmers are not, in fact, programmers...

Monday, October 19, 2009

Roundup: Week Ending 16/10/09

Hmmm...
And the not-gizmodo not-lifehacker...

Chasing The Tail

Sunday, October 18, 2009

System32 Always Opening! Argh!

I've had this infuriating event happening every time I log into Windows. The Windows\System32 directory keeps opening up in Windows Explorer, every single time, just after I log in. This didn't used to happen, is really annoying and just highlights how crappy Windows can be.

Fortunately, there's a solution - even Microsoft know about this. And it's weird. My initial google search on this brought back this handy little site:
Which lead me to this Microsft knowledge base article:
Which lead me to opening the registry editor (Start -> Run -> regedit), following the path down the registry folders to:
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
And finally deleting the entry for "MultiScreen", which had a value of " ". Like I said; Weird.

Anyway, this seems to have solved the problem. Why there is code somewhere inside Windows which opens the System32 directory when you log in if there is an invalid registry entry is beyong me, but at least it's fixed now.

Thursday, October 15, 2009

How To Capture Page Output, Caching

Found this on the net, while trying to capture the rendered output of a page...
Only takes a little modifying to adjust to writing to disc. In .NET2.0 and above you can use the File.WriteAllText to dump out your html file and easily implement disc caching:

The Fear Of The Noob

Monday, October 05, 2009

That Will Always Be The Dream

Roundup: OCR, LifeHacker, Gizmodo And The iPhone, For The Week

This week's latest...
Some verrry interesting stuff last week...