Music Code Words

minecraft — as played by a 4 year old

no comment

so i’ve been playing minecraft. a lot. and one day my 4 year old daughter asked if she could play that ‘block miney game.’

sure! why not?


Home Sweet Home

so we started a game up, and lo and behold! she had coal, and iron and tons of animals right away.

i was so jealous.

we worked well as a team, as mouselook + movement is a bit to manage for someone who’s only ever played kids flash games, but she would move, and i would control the mouse. it worked quite well.

there were lots of adventures! we found a treasure room, and she was a little scared to go back, but we managed to defeat the monsters! she was very excited to see the treasure.

anyhow, she learned quickly that night time was when you ran indoors and hid from the monsters. this made perfect sense to her. when she found out that light kept the monsters away well, here’s the interior of her house:

house interior


note also the garden in the bottom level of the interior. she *loved* moving the mushrooms and flowers around.

we also made a mine. and we put a sign outside:

no monstrs or anumls allowed

no monstrs or anumls allowed

sadly this was version 2, as a creeper appeared one day a blew the sign and part of the first mine up. *sigh* like the one creeper image says: “that’s a lovely EVERYTHING you have there…it’d be a shame if anything happened to it.”

she was unperturbed though! she very resolutely said we could make another sign, and put a door on the mine.

presumably to keep out the monsters and animals.

i++ vs ++i The Eternal Struggle!

no comment

So the other day i encountered a curious thing — if you create the following (not recommended) code:

$i=++$i * $i++ * ++$i;
echo "$i";

what do you think the value of $i would be?

according to what i figured:

$i starts out as ‘1’ then the ++$i makes the value 2
then the value of $i is 2 for the purpose of the multiplication
then is post incremented by the $i++ (making it 3)
then the ++$i makes the value 4
$i is then assigned the value as expressed: 2 * 2 * 4

which is a value of 16

but this is only true in C#,  javascript,  java,  and php!

in perl we get a value of 24, but this is due to perl using ++$i in all cases giving us an expression of 2*3*4 (all values of $i are pre-incremented)

in C++ it’s a whole other kettle of fish — it seems to depend on the compiler.

effectively, C++ figures out the final value of $i then post increments it (because of the $i++).

this gives us a value of 13 (2*2*3 = 12 then the post increment makes it 13)
i saw this behaviour using g++


this gives us a value of 28 (2*3*4 = 27 then the post increment makes it 28)
this behaviour was in visual studio

no wonder making constructs like ++$i * $i++ * ++$i are frowned upon!

So much to say…

no comment

Yet another blog on the net. i promise i’ll try not to bore you.

there will be at least three sorts of post here:

code — that’ll be anything programming related, either snippets of source code or just general commentary on programming in general.

music — that will likely have some mp3’s or (hopefully in the near future)  youtube links to tracks i’m working on, or general music commentary.

words — this one will probably have some writing in it eventually, and probably a lot of general commentary.

well, now at least you know what to expect!


Here is a music file as a test

no comment


here is a music file that i made super fast.

Exciting Calendar

January 2018
« Oct