tod man pla

August 6th, 2008

This is a slight variation on the excellent recipe found at http://eetsmakelijk.thesserie.com/tod-man-pla-fish-cakes/

Ingredients:

A 425-500gm tin of tuna in brine

3 tbsp cornflour

1 tbsp fish sauce

1 egg

1/2 cup coriander leaves

Small red onion diced

2 tsp red curry paste

1-2 red chilis or chilli flakes

100 g beans finely sliced

peanut oil for frying

In a food processor place the fish, flour, fish sauce, egg, coriander, curry paste and chilis for few seconds or enough to get a cakey consistency. Or just mush it all together in a bowl using a bamix. Transfer then to a bowl, mix in the chopped beans and spring onion. With clean hands both damp, form rounded patties then flatten them..size is up to you. In a frying pan, with oil over medium heat, fry the patties until they turn golden brown on both sides. Place a kitchen paper on a plate and let the cakes drain on top.Serve with sweet chilli sauce or the thai sweet and sour recipe thus:

(nicked from Rick Stein at http://www.bbc.co.uk/food/recipes/database/thaifishcakeswithgre_12214.shtml)

I often omit the vegetables and make just plain sauce. It works very well either way.

For the sweet and sour cucumber sauce:
50ml/2fl oz white wine vinegar
100g/4oz caster sugar
1½tbsp water
2 tsp Thai fish sauce
50g/2oz cucumber, diced very finely
25g/1oz carrot, diced very finely
25g/1oz onion, chopped very finely
2 red bird’s eye chillies, sliced thinly
Method
1. For the sauce, gently heat the vinegar, sugar and water in a small pan until the sugar has dissolved.
2. Bring to the boil for 1 minute, then remove from the heat and leave to cool
3. Stir in the fish sauce, cucumber, carrot, onion and chillies. Pour into four small dipping saucers or ramekins and set aside.

Dear Kev, a suggestion on how to explain carbon trading simply

July 6th, 2008

After seeing you vacillate on Insiders, heres a simple way to explain it:

The message:

Polluting in Australia has always been essentially free. We can’t allow companies to continue polluting for nothing otherwise there is no real incentive for them to find ways to stop. The best way to do this is to attach a price to polluting by having a carbon trading system and make it illegal to pollute without having enough credits to cover it. Then companies can shop around and buy carbon credits where they genuinely can’t avoid polluting and sell their credits where they can save on pollution.

That’s a lot simpler than what you were banging on about. Its also less accurate but thats the cost of explaining something complicated in a simple fashion. You can add more later - thats how you teach. Make sure they understand addition and subtraction first before moving on to invariant calculus.

If you are going to add more, make sure the more you add is still simple. Use a metaphor.  Think of a market full of different stalls selling carbon credits. You buy a credit and then you’re allowed to emit one credits worth of carbon. You can go to different stalls and buy at different prices. You can also set up your own stall if you have left over credits and resell them. Clean energy companies might have lots of credits to sell where a coal company might need to buy a lot of credits.

Don’t get too bogged down in the metaphor either. Just a sentence or two IF YOU NEED IT. Look up the KISS principle: Keep it simple, stupid.

On a longer spot you can discuss the alternatives to a market solution, such as regulation, but explain clearly how if you do that that imposes the negatives of carbon trading (raising costs, suppressing output) without any of the positives of the market solution (selling on your carbon savings, allowing the prices to shift as other market forces change, creating new businesses, etc). However, you should only discuss the extras on a longer spot but at the end reiterate the short message above. You could reiterate the short message instead of blaming the last government. Sledge the liberals once, thats ok, but doing it a few times in a spot makes you look like you’re evading the question.

If you’re on a business program you can explain that you know that businesses have income, profit and costs. This way is the simplest way for companies to deal with this. It becomes an added cost to begin with but smart companies will be able to lower their pollution costs by polluting less. Really smart companies will be able to sell their left over credits to other companies. Regulation doesn’t work well as the fines are never large enough and companies continue to pollute, factor in the costs of the fines and pass them on to consumers. This is what happens every single day right now (if you don’t believe this look into the smelting or casting industries - or take a trip to Tassie).

Alan Kohler did a pretty good job of discussing it on Inside Business just then as well.

Please watch insiders this morning and inside business and have a think about getting a clearer message. You’re not in the public service anymore, toto. Stop sounding like it.

Cheers,

Brad

(A scientist)

Intel Graphics, Ubuntu and 915resolution

June 22nd, 2008

Getting 1440×900 going on some Intel onboard video chipsets and Ubuntu can be less than automatic.

Install 915resolution from synaptic then run one of the following:

sudo 915resolution 3a 1440 900 8 1904 934
sudo 915resolution 4b 1440 900 16 1904 934
sudo 915resolution 5a 1440 900 32 1904 934

This will change the each mode’s settings. Restart X (ctrl+alt+backspace) and see if you have a fix.

To make the change permanent, edit /etc/default/915resolution and plug in the values from the mode/colourdepth above that made things happy.This did it for me:

#
# 915resolution default
#
# find free modes by /usr/sbin/915resolution -l
# and set it to MODE or set to ‘MODE=auto’
#
# With ‘auto’ detection, the panel-size will be fetched from the VBE
# BIOS if possible and the highest-numbered mode in each bit-depth
# will be overwritten with the detected panel-size.
MODE=5a
#
# and set resolutions for the mode.
# e.g. use XRESO=1024 and YRESO=768
XRESO=1440
YRESO=900
#
# We can also set the pixel mode.
# e.g. use BIT=32
# Please note that this is optional,
# you can also leave this value blank.
BIT=32

Real Men Smoke Pipes

June 1st, 2008

I have 12 pipes in my rotation. On average I might smoke 1 a week. I originally took up the occasional cigar, but tough times (being a professional student) forced me to look for a cheaper alternative.

I have:

  • 3 falcons - 2 straight and 1 with a slight bend
  • 2 MM cobs - 1 corn and the other cedar
  • A small yellow bole
  • An amadeus greek briar (takes a 9mm filter)
  • A black, straight “the pipe” graphite
  • A peterson standard system
  • A regal Dr Grabow
  • A kaywoodie standard
  • 2 no name briar bents - 1 rusticated and the other plain

Favourite blends include most englishes, half and half and, for a aromatic, amphora red.

Recent C++ Interview Questions

May 11th, 2008

Fortunately my search for a job seems to have come to an end. For those want some kind of measure of how long it takes for a masters/PhD qualified developer/analyst/team leader with 10 years experience to get a job: the answer is a bit short of a month in the current market. In some cases my education actually hindered with one proven example of a company binning the resume when they saw the ongoing PhD work mentioned - only in Australia.

The main problem I have is that I don’t have any J2EE (which I’ll fix once my PhD is finished by taking a certification) as there is lots of java work around. It shits annoys me because there is nothing in J2EE that I don’t know about but if you can’t show commercial experience you’re screwed. Especially with clueless recruiters in the way shortlisting people.

c++ is very scarce at the moment. My estimation would be about a dozen jobs available at most at any one time and the companies interviewing for them are being ridiculously picky and very slow to hire.

Getting to the point of this post, I’ll list some of the questions I got on a few job interviews. I’m doing this in the spirit of giving people a good idea of what gets asked these days for c++ jobs in Australia. I’m not identifying the companies that asked them so I’m hardly poisoning the recruitment process. This blog is also quasi-anonymous so a recruiter that has inside information on me shouldn’t be able to put 2 and 2 together either and give their next candidate an unfair advantage. I’m doing it because I was really unsure of what the process was going to be like given how long I’ve been out of the permanent job market. This interview came to me as quite a shock given the questions asked in the last round of interviews I took when I last went for a permanent job (7+ years ago). Yes, this post does relate to an earlier one.

Here are some questions that I got for a fairly senior c++ position at a medium sized company. I considered them an excellent set of questions that certainly made me think. They are mostly in order to the best of my memory. They range from modern c++ then to a bit of SQL along to some team leading and finishing with a little behavioural.

1. Why would you declare a destructor virtual?

2. When would you inherit or use templates?

3. Whats wrong with using the default copy constructor all the time?

4. Tell me about what design patterns you have used.

5. What unit testing or test driven development have you done?

6. What do you need to do to manage a multi-threaded application?

7. How do you debug a multi-threaded application?

8. How do you prevent a race condition in a multi-threaded application?

9. What was the last profiler you used?

10. What version of gcc did you last use?

11. Whats your favourite dev environment?

12. What do you know about the STL?

13. What did you find most useful in Boost?

14. Demonstrate iterating through a map in STL. Write code on paper.

15. Demonstrate a breadth first search in pseudocode (this was actually shown as how do i iterate this tree in this order - where a binary tree was shown numbered such that a BFS was required - so you actually needed to know what a BFS was as well)

16. What have you done with .NET?

17. Consider the following code:

new

third_party_function();

delete

where would you add exception handling to deal with errors the third party function?

18. Consider the database table with the following values:

+———-+
| red |
| green |
| blue |
| red |
| green |
+———-+

How do you stop multiples from being entered in future?
How do you return only the duplicate values?
How do you return just the unique values?

19. What are the 4 types of cast in c++?

20. What do you have on your desk?

21. What would you do if you were managing a person who was given a week to do a job and then at the end of the week asked for a few more days and then a few days after that still hadn’t finished?

22. What would you do if there were two jobs that needed doing and only a week to do them in and only one person with which to do it?

23. What do you do outside of work?

24. Tell me a joke.

A Fix for Flash Sound in Ubuntu 8.04 Hardy Heron

May 11th, 2008

After an upgrade, sound in flash stopped on a few on my machines.

Easy fix:

In Synaptic, install libflashsupport and restart firefox.

That should be it.

Inner City Pressure

May 2nd, 2008

Sir Humphrey is alive and well and working at VicRoads

May 1st, 2008

char_sirhumphrey.gif

Jim Hacker: Humphrey, the National Health Service is an advanced case of galloping bureaucracy!
Sir Humphrey: Oh no minister… Certainly not galloping; a gentle canter at the most.

I have never seen a system like this.

To change your licence (car, boat, motorcycle, etc) over from an interstate one requires you to make an appointment with VicRoads. No, you can’t just walk in and fill in a form and do it over the counter like anywhere else on the planet. You need an appointment. You also have to make separate appointments to change registration over as well. I have three licenses: car, boat and motorcycle. I own two registered vehicles: a car and a trailer. This to VicRoads is a completely unusual occurrence and has never happened before.

To change these things over requires me to make four (yes, 4) separate appointments.

l2d.jpg

It has taken me the best part of an entire day just to make appointments to change licenses and registration over. Not change the licenses, just make appointments to do it. I have yet to spend a separate afternoon filling these appointments. This apparently I should be thankful for as the Vogon I was dealing with was surprised to get them all in one afternoon for me a mere two weeks in the future. A very polite vogon, I must admit, but still a Vogon administering a ridiculous system.

The phone waits to make an appointment are at least 30 minutes. Calls drop out. They accidentally hang up on you when they try to pull you off hold (happened twice). The girl I finally spoke to in full needed to get special dispensation from a supervisor to allow me to make appointments for both a car and boat licence. The software wouldn’t allow her to make two appointments for two licenses (because you can’t possibly do both at the same time) as it obviously doesn’t differentiate between the different kinds of license. “You can’t change a license twice!” The business logic exclaims with an exasperated look.

vogon.jpg

I never thought that I would consider the RTA superior to anything. NSW’s licensing system now appears to be a shining beacon of competence and efficiency compared to this. I have lived in Tasmania and even they manage to do this without needing a vast army of bureaucrats filling in little appointment schedules that takes the same amount of time to do as would the actual work. Perhaps our Tasmanian friends ejected their Golgafrinchans, who went and founded VicRoads and Melbourne at the same time (If you read the history of Batman and Fawkner, Melbourne’s own Romulus and Remus, there may actually be some truth to my insult).

brazil.jpg

For the love of mike, if you must have this Dickensian appointment system, let one person handle most or all of the transactions at the same time. In every case its 95% the same information typed into the same terminal.

Apparently the office scenes in Brazil were not shot on a UK soundstage but filmed in situ in Melbourne.

queue.h with the queueitem hidden

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

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