Thursday, 31 October 2013

This task only takes 2 minutes!

...but if that 2 minute job occurs 1000 times, it's 33 man hours.

That's only 100 users doing the same thing 10 times each.

If you have 1000 users who need to do this once every day at work, that's 200 times per person per year,  or 6 1/2 hours per year per person, and per 1000 users this is 6666 hours or 277 full 24 hour days or 833 8-hour work days, days, or 4 employee years (@200 days per year) + 33 days.

So the 2 minute task is quite the time (and money) sink!

Monday, 28 October 2013

Char Sui chasing Bratwurst & Eggs chasing Chicken Kiev chasing Omlette

Day 1:

Make lots of cuts into the top of a pork belly.  If you like, stab it with a needle too(or a bunch of needles you tied together), as many times as you can be bothered.  Put on a trivet on a plate uncovered into the fridge to dry out, overnight.

Day 2:

In the morning, rub the belly top with ground sea salt working the grains into the cuts.  Make a mix of 1TB  fishsauce, 1 tsp Fivespice powder, 2 TBL vodka, 2 TBL rosewater, pour into a tray with sides that the belly can sit in.

Bathe the non-salted parts of the belly in this,  leave to sit for 3-4 hours.  Dab the moisture off the top, bathe the sides of the belly again, and rub some more salt into the top.  Leave to sit another 3-6 hours. Wipe the top again.

Now take a pyrex tray (I like the big quiche forms) put the trivet back, place belly in skin side down, cover with foil and bake @150 C in a convection microwave (oven only!) for 30 minutes.  Remove the foil, bake another 30 minutes, douse in whatever marinade was left.    Turn over on the trivet.  Bake (no nuke!) another 10-15 minutes @ 170C, until the skin blisters.

Grab a big black iron wo or fry pan.  Put a big hunk of beef tallow in so it's about 2cm deep in the very middle, heat smoking hot.  Sling the belly in, skin down and cover this show with a fat guard (also, wear an apron and stand back, this can and will spit) and watch the skin crackle and pop like popcorn.  When it looks nice, remove, turn over and put on the cutting board.  Eat in slices.  Works great cold too! (and stays crunchy, so it's lunch box material!)

Day 3: 

Heat the wo again, cook 2-3 belly slices for breakfast, along with 2-3 eggs.

Heat the wo yet again, and fry a bratwurst along with 2-3 eggs for lunch.

In afternoon, go to work on a big fat chicken, Pepin style:




Note: Pepin doesn't remove the Parson's nose(ie, the tail) here -- and that usually has the glands the birds use to oil their feathers with, and that doesn't taste that nice.  So I always cut it off and chuck it. (If you have a deserving doggie, then a few minutes in the nuke will make a good treat from this)

The chicken roll Pepin demonstrates is very nice(as is all of his food!), but for my purposes, I split the bird up, and peel the skin off the chicken breast halves.

Grab another pyrex quiche dish again.  Put the chicken breast halves like yin and yang, sprinkle with Italian seasoning, use the parmesan grater to grate a clove of garlic on each, and park as much grated cheddar/mozarella as you can pack on it, top with a slice of Emmental.  Cover with a thick slice of middle bacon (the stuff that is one piece of back AND streaky), mill pepper and cover again with more grated cheddar/mozz mix.

Stick that in your convention microwave and combination cook on 140C for 30 minutes.

Heat your wo (which will have plenty of flavored fat still) again to smoking.  Park the baked chicken (cheese side up) in there and fry for about 5-8 minutes until it's cooked through (the bottom will not be cooked when it comes out of the microwave!)

Serve and eat.

Day 4: 

This fat has a bit of cheese in it, so browning meat is not such a good idea, but heating the wo gently to medium and frying some mushrooms and pouring beaten eggs for an omlette is going to make a nice tasting breakfast.

Now go code some stuff! :)

Sunday, 27 October 2013

New invoke-diff-cmd feature: --svn-cfg-file

Wrote this feature yesterday, all in one go.

Had the idea whilst pondering what to do with the --invoke-diff3-cmd interactive user dialogue.

Maybe the new agate necklace magic really works?  Heh.

Saturday, 26 October 2013

My new Agate Necklace

"Agate provides a calming influence, improves perception, concentration and helps to develop and increase one's analytical talents." 

Clearly a must-have for any lady who codes. So, of course I bought it!

(Not that I actually believe this, but hey, I had to justify the purchase somehow, and this is as good a reason as any.  See? The agate is already working!)


Made by Tantric Tokyo.

Thursday, 24 October 2013

How to use svn diff to create a list of visitable files with line numbers in the Emacs compile buffer


Here is how to use the svn diff output within the emacs compile buffer to generate a handy list of files with line numbers that you can click on to visit every bit of code you've changed:

M-x compile

svn diff |\
perl -ne '/Index: (.*)$/ && ($name = $1);\
/^@@.*\+(\d+),/ && print "./$name:$1:diff\n";'  


Tuesday, 22 October 2013

The svn diff Project: First part done, review passed!

The --invoke-diff-cmd part of the svn diff project has been completed (bar one possible improvement).

The BRANCH-README file explains it all.

Of course, there has to be a fitting video for this post:



Now for the second part --- the invoke-diff3-cmd section!

Monday, 21 October 2013

Merging the trunk to branch, the lazy way

#!/bin/sh                                                                                                                                 
${SVN_INSTALLATION?"Please set the environment variable SVN_INSTALLATION."}
SVN=$SVN_INSTALLATION
BRANCH_DIR=`pwd`
tmp=`$SVN info 2>&1 | grep SVN_ERR_WC_NOT_WORKING_COPY`
if [ -n "$tmp" ]; then
    echo "Error: The branch directory does not contain a SVN repository." >&2;
    exit;
fi
TRUNK_DIR=$1
REL_DIR=$2
if [ -z "$TRUNK_DIR" ]; then
    echo "Usage: mergeBranch <trunk directory>" >&2;
    exit;
fi
if [ ! -d "$TRUNK_DIR" ]; then
    echo "Error: Trunk directory not found." >&2;
    exit;
fi
cd $TRUNK_DIR
tmp='$SVN info 2>&1 | grep SVN_ERR_WC_NOT_WORKING_COPY'
if [ -z "$tmp" ]; then
    echo "Error: The trunk directory does not contain a SVN repository." 1>&2;
    cd $BRANCH_DIR
    exit;
fi
cd $TRUNK_DIR;
$SVN up
tmp=`$SVN info | grep "Last Changed Rev:"`
TRUNK=${tmp##*: }
cd $BRANCH_DIR
tmp=`$SVN info | grep "Last Changed Rev:"`
BRANCH=${tmp##*: }
$SVN up
WHAT=${BRANCH_DIR##*/}
echo "On the $WHAT branch: trunk revision $TRUNK merged into branch revision $BRANCH." > log.mesg
$SVN merge $REL_DIR

Friday, 18 October 2013

What I miss about not being a MUD wizard anymore...

... the screams of agony that freshly killed players type. 


On the MUD, you hunt players with your code. 

With C, the code hunts ->YOU<-

Friday, 11 October 2013

GDB and the shell game

Sometimes, a good thing can be too good, and so it is with GDB's pretty printing of strings.

I spent quite some time trying to figure out why GDB showed me "\"AA" and not (as expected) "AA" or, even just "\"AA"\". 

To cut a long story short, svn_cstring_split() doesn't do strings with spaces inside strings many favours, and so, "AA BB CC" ends up as 3 elements, '"AA', 'BB' and 'CC"' respectively, which then ends up as "\"AA", "BB" and "CC"\" in the GDB display.

I didn't think that GDB would pretty print anything let alone decorate strings with escaping slashes... and so wondered for quite a while where the extra "\ went! :-D

I should have employed this kitty to help me here:


Monday, 7 October 2013

Programming My Old Tom Cat

My cat of act has committed an act of cat and shredded neighbor's toddler.  (Not terribly so, but it's never good!)

He did something like that before I adopted him, which is why he was exiled, and having his tail broken 9 year ago by a toddler apparently was still fresh in his memory and he suffered intense nightmares for a week afterwards.

My neighbor has been supplied with a decent supersoaker so he can easily dispel my cat's territorial ambitions, and because ASBO kitteh is now grounded during the day, I also bought a food maze to keep him entertained.

At least this was the theory and I was convinced this is a great idea after watching this video:




It's not popular.  He worked it for a bit and then decided that he'll go on a nil-by-paw diet instead.  It's not that he can't see the crunchies, it's that he refuses to see them -- he wants his bowl back AND his cat door open, and has formed a union of one, picketing the kitchen, lobbying for that extra portion of wet food he feels entitled to in lieu of the unreachable crunchies.

I on the other hand have realised that the food maze saves food because the crunchies are not sitting in his drool in a bowl.  And whilst he is on cat strike, he at least is not serenading the cat door in protest because his feline right of free movement has been curtailed.

Also, he is a grumpy old man, and really does not like change, at all. 

So, what to do?  Treats.  He may not work for food (as that is surely beneath his catly dignity) and no-one would be so unkindly honest to call him thick... but treats... that's another matter.  Raw beef or ham is kitteh crack that causes instant IQ enhancement!

Stage 1: remove the ring on top, put a box for the cat to sit on, add crunchies to top layer.  Place cat in position, tease with catnip treat, place it on mound of cat food.  Leave your perplexed sphynx to meditate over the puzzle, tease with catnip bicci every ten minutes or until you hear feeding action.  Carry on a few days until this is his new bowl where he feeds and he understands that it contains food inside and that it falls through holes.

Stage 2:  Now that he has understood that his food lives in this annoying plastic tower, remove all the inner layers.  Add crunchies to bottom layer then tease all the way from the fridge to the maze with a delicious strip of ham until he is ready to riproarslaymassacre that morsel... and drop it in small pieces (taking your time) onto the crunchies on the bottom level.  Tease cat with a strip of ham through the paw holes, let him munch his winnings and repeat, then walk off, leaving his prize on the crunchies in the maze.  Steinitz took 2 weeks for this stage, and I started to suspect him of training me to feed him goodies... heh.  But no, I think he was just forgetting he could reach them.  Once he starts eating them up, you can go on to ...

Stage 3:  Replace middle layer.  Add crunchies and drop a few through the holes(the sound of success!) and some thinly slivered raw steak in small pieces.  Tease with a long strip of meat as in step 2.  If your cat has the goldfish nature, this can take quite a few sessions.  He just didn't make the connection that the crunchies land on the bottom layer before dropping through clean and got quite frustrated when he pawed at a goodie that didn't turn up immediately in the bowl.

Stage 4: Replace the top layer and the and top ring.  Fill feeder.

Your cat is now fully programmed to operate the food maze!

Update:  He now has started to use his paw to scoop his wet food in the same way that he fishes for crunchies.  Dare I teach him how to use knife and fork?  Maybe better to just stick to a spoon! :-D

Friday, 4 October 2013

The Story of Alchemy

You can draw many parallels between this book and the state of modern science; how individuals think and explain what they think they know to others(..or not!), and what the collective believes it knows.

Moreover, it's beautifully read by Peter Yearsley!


Wednesday, 2 October 2013

Rotring ArtPen Quality Disappointment

I am the (once proud, but not longer) owner of an array of Rotring Artpens.

After finally running out of my stash of ink cartridges I ordered a batch of new ones from Rotring.

Said cartridges now are shorter by 1mm, with the result that my ArtPens now rattle when I write if I carry a spare ink cartridge.

I could of course 'fix' the problem by stuffing some paper in there, but... eh.  I just feel like my entire kit has been vandalised, why not just charge me a few pennies more and sell quality items instead of junk?

From the Rotring home page:

"Technical pens, mechanical pencils, calligraphy pens: Premium performance tools which enable thinking and creativity with precision."

--- if you can put up with the rattle that is! 

*grump*