Sunday, 26 April 2015

How to unconfuse someone

Since I am to implement the odf filters for Corinthia, I initially started by copying whatever structure was in the ooxml/word tree and set about deciphering the meaning and plucking out things and plugging them in.

Quite tough going, because it's a pretty, sophisticated piece of code that does a lot of things (much squinting and lots of peppermint tea was involved in the study thereof).  My little opus sort of worked, for some values of sort of.  That is, it compiled and I learned a lot.

But it was a bit of a woolly ball because much of what is in ooxml/word doesn't really apply to odf, so, Peter rescued me and helpfully made a great starting structure for me in this patch:

https://github.com/apache/incubator-corinthia/commit/ccd08368b033293c3607341ad4d25038e349bf9e

So, more peppermint tea, some good hacking music and I'm all set to code this thing ;-)


Saturday, 25 April 2015

Git being a git.

I needed to revert a commit I made.

So....

$ git revert 83720d9ddad4d1021e3cf0b416ebd7a761771cae
Please supply the message using either -m or -F option.

$ git revert 83720d9ddad4d1021e3cf0b416ebd7a761771cae -m "Revert mistaken approach"
error: switch `m' expects a numerical value

$ git revert -m "Revert mistaken approach" 83720d9ddad4d1021e3cf0b416ebd7a761771cae
error: switch `m' expects a numerical value

(writes logmesg file...)

$git revert 83720d9ddad4d1021e3cf0b416ebd7a761771cae -F logmesg
fatal: bad revision 'logmesg'

$ git revert -F logmesg 83720d9ddad4d1021e3cf0b416ebd7a761771cae 
fatal: bad revision 'logmesg'

Grrr.

All that was needed was to simply: 

$ git revert 83720d9ddad4d1021e3cf0b416ebd7a761771cae
$ git commit -a -m "Revert mistaken approach"

Moral: Don't believe everything you read.  Especially not error messages.



Thursday, 23 April 2015

TIL: Nuked Broth + Salt = Instant Geyser

This is not a code post.  But I was very impressed and thought I share this warning.  But sheer luck I avoided what could have been a serious burn on my hands and fingers ;-( )

I made some of my famous broth[1], formed 4 small meatballs and dropped that with a squirt of tomato paste and some parsley into a 1pt pyrex jug and filled it up to 1/2 pt with extra strong broth. Covered it with a silicone mat and nuked it  @600W for 4 minutes and ... added 1/2 teaspoon of salt.

Luckily I poured the salt into my hand and dropped it in from a height --- because the entire thing welled up with a bubbly vengeance and poured forth over the edges of the jug.

Superheated much?  OMG.

Points to make:

  • I was very lucky moving it out of the nuke didn't make it erupt.
  • I was even more lucky not to stick the salt onto a spoon and stir.  To stir this kind of thing, you'd need a long cooking spoon.  But that's not the smart way to do it either.
What I should have done is pull it out at 1 minute intervals and stir it, leave it sit for 20-30 sec before zapping it again.  

Be safe and eat well.

[1] The recipe!

Don't use salt or pepper (and other spices) until you're ready to use the result.  

Hour 0:

Start with a slow cooker or a pressure cooker (because that closes very well).  Set on low heat, you want a very slow simmer, if the pressure valve releases steam, it's too hot.  Ideally, no steam leaves the vessel.

Add 1 kg+ of oxtail or other big bones (break with a hammer if not cut), 2 table spoon of vinegar (to leach the bones' goodness) and cover the bones with boiling water.

Hour 24:

Add those frozen, broken bird bones, gristle, skin and knuckles you carefully have saved in a freezer bag every time you gnawed or otherwise dissected something delicious.   Add more boiling water to just cover.

Hour 40:

Add veggies --- 1/2 a green celery head, 4-6 carrots, 1 -2 quartered onions and if you have it, some chopped celeriac or, chopped parsley root(for the gardeners amongst you).  And a big bayleaf.  Add more boiling water to just cover.

Hour 47 1/2:

Now is the time to optionally add things like parsley stalks (not the leaves) or 1/2 a leaf of lovage (beware.  It's nice but easily dominates, pervasively so).

Hour 48:

Leave it to cool down, now pour the entire thing through a sieve.

Once cooled down:

It should solidify into a jelly.  If not, use bags you put into mugs for easier pouring and tying, before you stick 'em into the freezer (minus the mug).  For small cubes, use the ice cube tray, or silicone muffin cups.  If you have jelly, use a big spoon to carve off pieces, wrap into cling film and freeze. 

The fat is good for frying eggs and other stuff in (skim and heat carefully to evaporate the last bits off moisture), or if you don't like fat, for bribing a deserving doggy with suitably small portioned treats.

You broth stash will go well in soups and the smaller pieces in cling film go well in vegetables and sauces.  

Plus, it makes your kitchen smell great for 2 days. This makes about 1-2 litres of very strong broth, depending on how many bones and water you've used.  Not enough?  Well, make another lot! ;-D


Friday, 17 April 2015

I installed tree and found a useful forest

Today I was idly reading some random unixy stuff, and, came across the 'tree' command.

I had to install it for Ubuntu, but, it definitely was well worth it.

It's s useful if you are connecting with a shell and need to navigate a forest, and also makes a neat html file from any tree you like, which looks good in lynx, or in any web browser for that matter.

The tree gives you the big picture, with tree -d -H . > tree.html


(OMG, I'll be whistling this all day long now.  And so will you ;-D )

Thursday, 16 April 2015

Sometimes, it's not a bug, but a workaround.

I found a few ';;' in the Corinthia source and thought -- aha, typo!  So, I fixed and committed, but alas...

http://www.mail-archive.com/dev@corinthia.incubator.apache.org/msg01164.html

...it's a VC++ bug, it won't do C99 without this little hack.