Archive for April, 2008

queue.h with the queueitem hidden

Tuesday, April 29th, 2008

A quick troll of the blog stats this morning saw people already downloading some of this work-in-progress hack. I hope they read the thread of posts on the subject that explains that these little hacks are about me getting my chops back. 4 years of research does tend to blunt your coding skills a bit (unless you’re researching code or design I suppose). Google hasn’t helped by placing this on the first page of results for the search “bintree c++”. So I’d better get cracking and make these a bit more respectable.

So, in that spirit, I have quickly refactored queue a bit to hide the QueueItem within the class. Its internal only and has no reason to be exposed.

queueh.txt

More work on the simple queue and bintree - addition of some “STL style” iterators

Monday, April 28th, 2008

Not much time to work on this today, however I have managed to hack in some iterators in the time I’ve had spare. The tree still needs a DFT iterator, I would do it tonight however the template mangling required to make an iterator base and then derive two different iterators from it is beyond me this evening.

bintreeh.txt bintree_testcpp.txt queue.h queue_testcpp.txt

Our place in Tassie

Saturday, April 26th, 2008

As left in March 2008.

invermay

C++ queue and bintree - older c++ style

Saturday, April 26th, 2008

Building on yesterday’s examples, here is a fairly straightforward c++ version of the same things. I’ll expand on this shortly and provide a more modern implementation, with STL style BFT and DFT iterators and exception handling.

queue.h queue_test.cpp.txt Makefile.txt bintree.h bintree_test.cpp.txt

Technical interviews and getting back to basics

Friday, April 25th, 2008

I missed a few things recently in a technical interview that I damn well know. I hate dislike some styles of technical interviews and I’m not alone. I just don’t always shine in the ones that require a raft of instant answers to problems.

Some biased quotes on the subject I agree with:

Scott Meyers: I hate anything that asks me to design on the spot. That’s asking to demonstrate a skill rarely required on the job in a high-stress environment, where it is difficult for a candidate to accurately prove their abilities. I think it’s fundamentally an unfair thing to request of a candidate.

Matt Gerrans: I don’t like when I’m asked to write a program that does X on a piece of paper. Don’t ask the candidate to write a program on paper. That is a waste of time and sweat. People don’t write software on paper, they do it with computers using auto-completion, macros, indexed API documentation, and context-sensitive help. They think about it, refactor it, and even rewrite it. If you want to see a person’s work, ask them to write some small module or implement some interface before the interview and bring the code on a notebook PC or on hard copy. Then you can review it and discuss the design, coding style, and decisions that went into it. This will give you a much more realistic and useful assessment of a person’s work and style.

When I have interviewed people for jobs I have always asked them to do a simple project before coming in. Usually just a simple gui and database application (of about the scope one would expect in a 3rd year unit assignment - half a days work maybe for the average person). This instantly weeds out 99% of those who couldn’t be arsed and shows that a candidate can do something useful from the get go. Some quick discussion about the code can verify that the code’s author and the applicant are the same person. Asking them to make a change or addition to their code also helps illustrate their abilities whilst keeping nerves down as its their own code that they are familiar with.

In response to my mild embarrassment over stuffing up some tech questions, I am going to spend a few days or week, as they are available, over the near future backtracking over some c and c++ to reinvigorate that part of my brain that appears to atrophy as soon as someone whispers the words interview and technical in the same sentence.

In any case, I am thinking of picking up a new language soon (Python seems to be the front runner at present), so reimplementing half of Sedgewick for kicks first might get me started before I embark on doing the same thing in the new language as one should. So this could become a “what you should know in a language” sort of series. We’ll see.

In any case, the following is a minimal tree and queue implementation in c to warm up. For whatever reason, I totally forgot how to do a breadth first traversal in an interview last week. Brain totally froze. How dreadfully embarrassing! Granted, it was the second interview of the day which might have had something to do with it.

Don’t use this for assignment study or for controlling a nuclear reactor as I’ve quickly hacked it out on the evening of a public holiday after a few glasses of wine. Comments are welcome - but remember this is a quick first version - obviously some of that ugly looking double pointer stuff could be typedef-ed away as well as well as a more decent set of tests. I think its right :-) Let me know if I’ve cocked some of it up as its been a good while since I’ve done straight c.

This is only bare bones enough to implement a BFT - so I know full well that there are some fairly obvious functions missing - deleting the tree would be an obvious omission should this be a serious attempt at a library.

I’ll do a c++ version as soon as the next bottle is opened. Tomorrow.

tree.h tree.c queue.h queue.c main.c

Here is some sample output:

bcg@bcg-laptop:$ ./tree_test
test_tree_created passed
test_tree_empty passed
test_node_data passed
test_node_linked left passed
test_node_linked right passed
Depth first:
1 2 4 5 8 3 6 9 7
Breadth first:
1 2 3 4 5 6 7 8 9

The caravan of courage

Thursday, April 17th, 2008

The truck and the trailer coming over from Tasmania.

image439.jpg

And when they say, 2.1m maximum on the ferry, they are not kidding:

image453.jpg

Yes Minister (Equal Opportunities)

Thursday, April 10th, 2008

char_cartwright.gif

Dr Cartwright: I fear I shall rise no further.
Hacker: Why not?
Dr Cartwright: Alas, I’m an expert.

I heart IT recruiters

Tuesday, April 8th, 2008

I’m looking for a full time role in Melbourne. I’m not feeling the love week one. Here’s one example.

Job description: C++, Object Oriented Design, Systems analysis.

Me: 12 years C++ experience. Bachelors, masters and (by the end of the year) doctorate in computer science. Umpteen jobs describing exactly what they are looking for in glorious detail in my resume. Have worked here in Australia and overseas. Papers published. Referees for jobs completed available. Big jobs, small jobs. Process control systems in heavy industry, public multimedia systems and also web sites like centrebet.

The recruiter: “Thank you for your updated resume, unfortunately you are still not a technical match for the noted position.”

Not even the offer of an interview for the client to decide for themselves.

Occasionally I do come across a recruiter that seems to have some idea about the nature of software jobs, but its not as often as one would expect. Instead it is often people who are completely and utterly ignorant of all of the acronyms they are requesting you have 5 years experience in. This can’t possibly be the best solution for a company looking to recruit quality staff.

It would be interesting to see things from the recruiter’s side and see if its really is just a boiler room as I expect that it is. During my sojourn in academia I was hoping that the IT recruitment stupidity of the .com era would have been naturally selected along with all of the contracts that they were fielding back then. Unfortunately, that seems not to be the case.

For those recruiters who are doing their jobs properly, more power to you. For those of you who think a technical PhD is “not working for 4 years” and irrelevant to the technology job market, as I’ve been told over the past fortnight, please get out of the way as you’re just contributing to inflation. And for those who remark: “isn’t PhD a web language?”, you’re really just wasting our oxygen.

Atheros wifi drivers + WinXP = wasted day

Sunday, April 6th, 2008

The Atheros XP drivers,especially chipset 5005G running on an Acer Aspire 3680 laptop just do not work correctly under XP. I have tried every version of the drivers available on the web and there is no happy ending. Dropouts, CPU spikes mixed in with brief periods of correct functioning makes me wonder what kind of QA is going on with whoever wrote the drivers. A google search confirms that I am not unique with this criticism. The Microsoft drivers for Vista (I don’t think there are any MS ones for XP- couldn’t find any in extensive searching) work ok.

Anyway there is a work around of sorts - dial your router back to 802.11b. File transfers will not be so snappy between machines, but you will be able to get WPA2 protected wifi and web browsing going for your in-laws - as was all I needed to declare the damn thing fixed.

Perhaps they only tested with 802.11b? As so far it seems ok.