[Duncan's Home] Duncan's Jotter
faq -  feedback -  home 
Members
Logon   -   Sign Up
smeed >> duncan.smeed.org | Duncan's Jotter
duncan.smeed.org | Duncan's Jotter

Day Link Icon 2/19/2001

Java to HTML converter (Freeware)

(by Duncan, @ 12:32 AM)

via Jim [hbwt] - Java to HTML converter (Freeware)
This tool converts Java source code to HTML with syntax highlighting.
Jim says it works great. That's good enough for me!

Comments: 0 | Reply | Categories: None

RE: The Web Standards Project: Fighting for Standards in our Browsers

(by Duncan, @ 12:46 AM)

Well ALA has bitten the bullet. In A List Apart: 16 February 2001 - Issue No. 99 they start out on their journey:
Building a standards-compliant redesign of ALA should have been easy. It wasn't. The first problem was understanding how CSS actually works. The second was getting it to work in standards-compliant browsers.

A List Apart: From Web Hacks to Web Standards

THERE ARE JOURNEYS that touch the deepest core of the human spirit. And then there is this one. This is a journey from six years of conventional web design practice to the way we'll build sites in the future. Only it's not set in the future. You're soaking in it.

From the beginning, we've done whatever we had to do to make our sites work in every browser. In the world of non-standard HTML Design, we bolt every word, every image into place by manipulating table cells.

For the record ALA looks great in Mac/IE5.

Comments: 1 | Reply | Categories: None

Duncan on Software

(by Duncan, @ 5:07 PM)

One of my favourite weblogs is Joel on Software and I have often linked to his site. Although updated relatively infrequently it's well worth the wait for the latest news and opinions. Case in point is Joel's latest article [no longer a valild link - check out the Joel on Software - Archive (in fact Joel on Software - Archive for February 2001)] :
...Human Task Switches Considered Harmful, explains why you should be careful that each programmer is only working on one thing at a time.

I am often to be found nodding my head in silent agreement as I read Joel's weblog entries and I agree entirely with his latest thesis that human task-switching is to be avoided whereever possible. The problem is that it is often difficult to avoid distractions. One of the reasons there are gaps in my weblog calendar is that the dates coincide with periods of activity where I will mask out all other interrupts. Processing of applications and marking exams are prime exams of very high priority tasks that once started often run to completion. (Aside: isn't it weird how computer scientists sometimes do the opposite of anthropomorphisation and talk about life in terms of algorithms and programming, but let me RTS - Return To the Subject ;-))

Evidence that it is a small world made even smaller by e-mail and the web was the fact that I was contacted by Michael Pryor as a result of my link to his answers to technical interview questions weblog [Update: Michael ran the 'Bad King' puzzle today]. I hadn't realised at the time I made that link that Michael worked for Joel's company - Fog Creek Software, Inc. but now of course it all makes perfect sense - the puzzles are the sort of questions that wannabe Fog Creek programmers get asked. I've forwarded to Michael a copy of the Departmental Friday Afternoon Puzzles so some of these may appear on his site in due course. Good luck to Joel and Michael for the success of Fog Creek Software. It's the sort of outfit I would've liked to work for when in my twenties. [1]

Even more evidence of uncanny coincidences is the e-mail I received this morning from one of my students. Basically the student was asking me how he could become a better programmer - I teach C and low-level programming for my sins - so that he'd be in line for one of those really well paid jobs I rant about. [Fellow academics will know the reason for the rant - new graduates getting paid a starting salary in excess of what we earn after 20 years. Not that I'm bitter ;-)]. All credit to the student for admitting that he wasn't happy with his programming skills and that he still had a lot to learn. Where to start with such advice?

First off, I'm still of the old school that believes that good programmers are born with that gift. Whilst not necessarily an advocate of 'programming as an art form' I have taught enough students C and low-level programming over the years - probably in excess of 2000 students - to conclude that some have a natural ability in programming and some don't. Plain and simple. Same of course goes for most other aspects of human endeavour. I'll have to dig out the quote but I think it was Bill Joy who said that there was at least an order of magnitude difference (in productivity) between the best programmers and the programmers of average ability.

So what advice do I have for the student. Well, first off I would check out the The Art Of Unix Programming by Eric Raymond that I linked to last week. One of the phrases that struck home to me is that a good programmer must be passionate about their craft. I paraphrase this as the 'Can Do' versus 'That Will Do' mentality. I am passionate about my programming. I suppose I am fortunate that as an academic I can pursue perfection in my programming and not necessarily be subject to the normal commercial pressures of marketing-driven ship dates and 'that will have to do' attitudes. I know students have deadlines too but I believe they can, and should, make the time to practise their craft without undue external pressures. Alas, years of lecturing suggests that the opposite view prevails amongst most students. But I digress...

The next thing I would recommend is to read some of the classic texts about programming techniques in general and C programming in particular. By classic I probably mean books that I already own so I'll dig these out and cite them later ;-) When I was student Ethernet had not even been invented (must check my dates!) and of course the web wasn't even on the event horizon.

More later. In the meantime, my students might like to check out last tuesday's technical interview question ;-)

Apropos the implementation of an atoi() function, the current cohort of students that took LLP last semester will no doubt be reminded of the pain of their attempts at my 'conversion utility to convert numbers into different bases' practical and I'm sure many kicked themselves at the elegance of the http://www.cs.strath.ac.uk/%7Eduncan/teaching/llp/solutions/s05.html">solution. Although not strictly an implementation of the atoi() to the specification given in the technical interview question, my version has the advantage of being unique insofar as trying to find a copy on the web and the fact that it copes with arithmetic overflow so is fairly bulletproof.

A wee programming exercise for budding C programmers is to modify the conversion utility to cope with numbers up to base 36. [Hint: only two lines need to changed. The sample solution already incorporates the changes so no cheating by checking that out first ;-)]

[1] Some students may doubt that I was ever employable B-}. I was a graduate of 1977 which were halycon days for graduate employment - much like the current situation - and every first interview I attended in my final year turned into a second interview and every second interview - bar one - turned into a job offer. Thirteen job offers out of fourteen interviews. The company that didn't offer me a job would have had it not been for a hiring freeze. A bit like Cisco currently. The name of the company - Hewlett Packard. Guess which company I wanted to work for!? I believe that I still hold the departmental record for the most job offers made to an undergraduate ;-)

[Updated 11/1/2001 to link to the new location of the answers to technical interview questions website.]

Comments: 0 | Reply | Categories: None



Day Link Icon 2/18/2001

RE: answers to technical interview questions

(by Duncan, @ 11:12 PM)

Jeremy [iRights] Bowers solves the Bad King Friday Puzzle. Further explanation is given in my original solution. Before you peek why not try the puzzle yourself?

Comments: 0 | Reply | Categories: None



Day Link Icon 2/17/2001

Watching the Rugby

(by Duncan, @ 4:01 PM)

Relaxing this Saturday afternoon with half an eye on the Ireland vs France rugby game on TV. Later on (4pm) Scotland play Wales at Murrayfield. Lucky son Ken is travelling up to Edinburgh in a school-arrnged trip to the game. Wish I could be with him but I'll keep an eye open to see if I can spot him in the crowd. [France has just kicked a penalty. A couple of minutes later Ronan O'Gara has just missed a fairly easy penalty kick so the score remains 3 each]

gunkdunc.jpg
Gunc Dunc - 1996

Earlier today I phoned up for a Comic Relief supporters pack so that should come in a week or so. Comic Relief day is on March 16th this year. Seems that the students want a repeat of Gunk Dunk - can't imagine why - so this time I'm giving them plenty of warning of the impending event. Gunk Dunks from the past have raised over £750 for the charity so hopefully I'll be able to take advantage of my 'popularity' and raise a substantial amount again this year. My target is at least £250 this time to get over £1000 in total. I'm quietly confident that this is a realistic target. I normally leave it until the last minute to arrange the stunt but this year it'll be different. One other indicator that the students might be keen to participate is that when I was asked by student at a lecture whether I was going to do it and when I replied in the affirmative there was a very positive response ;-). That and the fact that when I asked the students at the lecture when Comic Relief day was one student wise-cracked "not soon enough!" Needless to say we almost all ROTFL at that!!

Ireland are leading 9-3 at the start of the 2nd half. Just before half-time O'Gara kicked a penalty from the halfway line. A great kick. Looks like it will soon be 12-3 since France just gave a penalty away in front of the posts. Yep, no problem for O'Gara: 12-3.

Many of my students kid me on that I am a hard taskmaster but I think they know that I have their best interests at heart. Sometimes I play on this reputation and have kidded them on that Ann Robinson, quizmistress...

[O'Driscoll has just scored a try - or has he, there's some doubt - the video replay referee says it was. Lansdowne Road goes wild! And O'Gara kicks the difficult conversion from a very narrow angle. Great game. 19-3. Latest score from Twickenham: England 30 - 20 Italy. Sounds like Italy are giving England a run for their money. Yet another 3 penalty points from O'Gara's boot: 22-3.]

...of 'The Weakest Link' is my heroine! Robinson has a fearsome reputation on that programme as she's extremely rude and disparaging when the contestants get their questions wrong and get voted off by their fellow contestants...

[France has just scored a try from a scrum pushover. It's far from over. Lamaison kicks the conversion: 22-10 with 19 minutes to go.]

...so I had this idea to play on this reputation. For Comic Relief I am considering dressing up as Robinson - her red hair and long black dresses are distinct trademarks...

[Bernard Salle has just scored a try in the corner for France. Lamaison fluffed the kick: 22-15]

...so I'll need to borrow a red wig - or dye my hair red - and a black dress. (Please believe me that I don't have these in my wardrobe at the moment!) So what would a cross between 'Gunk Dunk' and 'The Weakest Link' look like?

[O'Gara's just missed another penalty chance. It's a very exciting last 10 minutes. Ireland haven't been beaten at Lansdowne Road since 1973. 4 minutes of injury time so far. Ireland get penalty 85 minutes into the game. No final whistle yet. Lineout ball won by Ireland. Stringer kicks ball into touch. Whistle blows. Ireland win!! Great game Ireland.]

OK, Scotland are running onto the pitch. Bill Maclaren commentating. National anthems being played.

Neil Jenkins drops a goal less than a minute into the game!!

[Apologies for not having provided a provide a blow-by-blow account of the game. I was too busy watching it. Suffice to say that 2 minutes into the 2nd half Scotland went 25-6 behind and it looked all but over. The last 20 minutes turned round the whole game and Scotland managed to score another 22 points to Wales' 3 so the final score was 28-28. Pretty exciting stuff.]

Comments: 0 | Reply | Categories: None

Gunc Dunc 1999

(by Duncan, @ 5:04 PM)

gunc001s.jpg
Gunc Dunc - 1999
One of my students - Gareth - took a camera to the last Gunc Dunc!

Comments: 0 | Reply | Categories: None

answers to technical interview questions

(by Duncan, @ 11:08 PM)

Every Friday a member of staff at my workplace e-mails the 'Friday Puzzle'. I was prompted to post this revelation (;-)) when Dave's Scripting News linked to the Tech Interview site which is a good example of the type of puzzles that get circulated on a Friday:
this site is about challenging yourself to new puzzles and problems. do not be afraid that if a question you use appears here then it won't be worth asking anymore. first, people who come to this site to read the problems are the type of people you want to hire. they are the people who get excited about solving problems, and actively search out new problems to ask themselves.

Here's one of the Departmental Friday Puzzles that I was chuffed to be the first to answer:

A bad king has a cellar of 1000 bottles of delightful and very expensive wine. A neighbouring queen plots to kill the bad king and sends a servant to poison the wine. (Un)Fortunately the bad king's guards catch the servant after he has only poisoned one bottle. Alas, the guards don't know which bottle but know that the poison is so strong that even if diluted 1,000,000 times it would still kill the king. Furthermore, it takes one month to have an effect.

The bad king decides he will get some of the prisoners in his vast dungeons to drink the wine. Being a clever bad king he knows he needs to murder no more than 10 prisoners - believing he can fob off such a low death rate - and will still be able to drink the rest of the wine at his anniversary party in 5 weeks time.

Explain how....

Comments: 6 | Reply | Categories: None

Automate your build process using Java and Ant - JavaWorld October 2000

(by Duncan, @ 11:17 PM)

Automate your build process using Java and Ant - JavaWorld October 2000
Ant is a powerful scripting tool that lets you craft build processes around your code requirements using predefined tasks and provides expansion capability to handle even more difficult tasks. This article is an introduction to the powerful XML-based scripting tool that can automate your mundane tasks and allow you to concentrate on your business rules and code development.

Comments: 0 | Reply | Categories: None

Copyright © 1999-2005, Duncan Smeed. All rights reserved.
 
February, 2001
Sun Mon Tue Wed Thu Fri Sat
  1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28  
Jan  Mar
Tell ICANN to keep their hands off .org!


Run the HTML validator for this page
Webmaster: web at smeed.org