Showing posts with label fun. Show all posts
Showing posts with label fun. Show all posts

Monday, 6 December 2010

cowsay and cowthink fun

Time for me to lighten up a little. I stumbled upon the cowsay and cowthink commands today while reading the Wikipedia entry about Tux. Cowsay prints an ASCII art picture of a cow and a speach bubble around some provided text, and cowthink puts the text in a think bubble.

cowsay "Well this is all very amusing."
 ________________________________
< Well this is all very amusing. >
--------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||

The -f flag allows one to specify different picture, for example -f tux draws Tux instead of a cow.

cowthink -f tux "Why is my kernel building so slowly today?"
 _____________________________________
( Why is my kernel building so slowly )
( today? )
-------------------------------------
o
o
.--.
|o_o |
|:_/ |
// \ \
(| | )
/'\_ _/`\
\___)=(___/

There are over 50 pictures to chose from, use cowsay -l to list them all.

To install, use: sudo apt-get install cowsay

Enjoy!

Thursday, 29 October 2009

Tuesday, 20 October 2009

Makerbot - an open source 3D printer

This week I'm attending a Ubuntu Kernel Sprint and my colleague Steve Conklin brought along a fantastic gizmo - the Makerbot 3D printer. It is most fascinating watching it print 3D objects by extruding a thin ABS plastic trail of plastic in layers. It can print objects up to 4" x 4" x 6" - the imagination is the limiting factor to what it can print. Steve already demo'd it printing a variety of objects, the most impressive being a working whistle including a moving ball inside the whistle. It's not too slow either - it took about 25 minutes to print the whistle, which isn't bad considering the complexity and size of the object.













It's a cool piece of kit - doubly so because it's completely open sourced.

Friday, 2 October 2009

Amusing Linux vs Windows comparison blog article

Ubuntucat has an amusing tongue-in-cheek comparison of installing software on Linux and Windows in this blog article. Made me laugh.

Sunday, 26 July 2009

Rambling around in Winnie the Pooh Country

Sunday afternoon I took the family down to Ashdown Forest, West Sussex (home to Winnie the Pooh). It's only about 10 miles away from our home in Crawley; basically almost on our door-step. Instead of visiting the Pooh Sticks bridge which is quite a bit further down the road in Hartfield, we stopped off at Hindleap Warren for a walk and a typically English cup of tea from a Thermos flask. The walk is detailed in this PDF from AshdownForest.org




View My Saved Places in a larger map


Like a typical English Summer, it got a bit cloudy and there was spits and spots of rain, but that did not deter us from the short walk. En-route we discovered a lone pheasant and a bunch of Sunday ramblers (fairly typical of the kind of wildlife in the forest!)


Below, looking South towards the South Downs (on horizon):


Not surprisingly, it's kind a like the illustrations by E. H. Shepard in the A.A.Milne books...


Hopefully sometime this Summer we may make it to Pooh Sticks bridge and have a go at Pooh Sticks. If we do make it, I will try and get some photos and attach them to this blog. And if you are wondering, we did not see Tigger, Eeyore or Winne the Pooh.

Sunday, 19 July 2009

Rainy Weekend - Lego Time!


Wet weather over the weekend usually means the kids are trapped indoors and need some form of entertaining. I use this as an excuse to get the box of Lego out and show my 6 year old son David how much fun engineering and construction can be.

Here is a photo of a crane we built using a load of 2x8 and 2x6 beams and 2x2 and 1x1 stud bricks for a tower and a massive block of yellow bricks to balance out the jib. While my son did enjoy helping to get something built that was taller than him, the real fun for him was knocking it over and watching hundreds of bricks fly everywhere! Ho hum.

The Lego City kits look really exciting and promise a lot of building and playing fun, but I still think the kids get more fun when I buy them big buckets of hundreds of bricks and order loads of beams and plates, wheels and window bricks from the Lego website. David can spend hours just building loads of weird and wonderful cars and lorries from his imagination rather than following instructions from a booklet; it's far more creative.

Anyhow, rainy weekends let me get the Lego out and regress back to being a kid again - and also help teach my son the tried and tested techniques of building fun towers and buildings in the process.

Wednesday, 15 July 2009

ESKY Lama back in action!

By the wonders of E-commerce, my early Monday morning order of a replacement helicopter tail boom arrived today (Wednesday). Unfortunately the Royal Mail did not ring the door bell and just dumped the parcel on the door step, so goodness knows how long it had been sitting there for the World and his dog to see.

The tail boom kit from Miracle Mart included a fake engine and side buckets. The engine comprised of 10 tiny components which took me just as many minutes to assemble with some poly-cement glue. It has been a while since I did any gluing at this kind of detail; I used a match stick to help me dab the glue in the correct places, but I've come to realise my eye sight is not as good as it was since I last made Airfix kits when I was 12 years old!

So here's the assembled engine (note the tiny grill on the air intake, sweet!):


Fixing the tail boom was relatively straight forward, it just required unscrewing 4 tiny 2.5mm long screws and screwing on the new flexible replacement. Easy with the right micro screwdriver.

I did not attach the side buckets as they added just a little too much weight for my liking. Also, the instructions suggested they should be attached using double sided tape and I could imaging seeing them pop off during a bad landing and flying up through the blades causing all sorts of blade carnage.

Here's the results of my 20 minutes of work:


I then took it out for a quick late evening spin and it works well; I don't think the new parts are much heavier than the original parts, and they look better and the boom is far more resilient to bad landings. Result!

Now all I need to do is learn to fly properly!

Tuesday, 14 July 2009

Abusing C for fun

I'm easily amused by the way people can abuse C. Duff's device is a classic example of abusing the C grammar for an optimisation hack. Basically Duff unrolled a loop and realised he could interlace a switch statement into it to jump into the loop and fall through the rest of the memory copy statements:

send(to, from, count)
register short *to, *from;
register count;
{
register n=(count+7)/8;
switch(count%8) {
case 0: do { *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
} while (--n>0);
}

So, inspired by this madness, I conjured up my own switch statement abuse, this time to show that one can get away without using break statements in a switch by abusing the while loop and continue statements. It's an ugly abuse of C:

void sw(int s)
{
switch (s) while (0) {
case 0:
printf("zero\n");
continue;
case 1:
printf("one\n");
continue;
case 2:
printf("two\n");
continue;
default:
printf("something else\n");
continue;
}
}

The while (0) statement makes one think that the code won't be executed, however the outer switch statement essentially jumps control to the case statements and the continue jumps out to the end of the loop which then never re-iterates. Urgh.

Well, I posted this discovery to comp.lanc.c in 2005 only to be trumped by this ingenious abuse of the switch statement:

int main(int argc, char **argv)
{
int a = atoi(argv[1]), b = atoi(argv[2]);

switch(a) while(0) {
case 1:
printf("case 1 of outer switch\n");
break;
case 2:
printf("case 2 of outer switch\n");
switch(b) {
case 1:
printf("case 1 of inner switch\n");
break;
case 2:
printf("case 2 of inner switch\n");
continue;
}
printf("end of inner switch\n");
break;
}
printf("end of outer switch\n");

return 0;
}

This masterpiece(?) above allows one to break out of either of two nested switch statements without a goto. I will leave this as an exercise to the reader to figure out how this works! Thanks to Richard Tobin who posted that follow up code snippet on comp.lang.c too.

So while GCC happily accepts this valid C grammar fortunately we won't be seeing code like this entering the kernel because kernel hackers are far too sensible... :-)

Saturday, 27 June 2009

Ultra Drinkable Dell Laptop?!


While on my travels to UDS my colleague spotted this sign in an airport technology shop which I could not resist taking a photo of. Is Dell making an Ultra Drinkable Laptop now? :-)

Sunday, 21 June 2009

Fun with my ESKY Lama Helicopter

The weekend is here and it's time to relax a little!

My brother sent me an ESKY Lama remote controlled Helicopter for my 40th birthday a few weeks ago (very generous!) and I've been a waiting for the right weather conditions to fly it outdoors. Fortunately this weekend there almost no breeze at all, so I gave it at spin in the back garden.

David, my 6 year old, got a little over excited about it all (he kind of lost the ability to speak coherently in English and then threw is chuck glider at it!)

As you can see from the video, I'm still in newbie learning mode! (Actually, just out of shot is my apple tree which I was trying to avoid..). I need to do a whole load more training on a simulator! I've already put in an order for 12 pairs of new rotor blades as my landings in the rose bushes and close encounters with the apple and pear trees have wrecked the first set(!) Fortunately they are not too expensive to replace and I'm waiting for some to be delivered by Wednesday!




Anyhow, this is my first flying radio controlled toy and dealing with 4 channels of control as a newbie is keeping my hand/eye co-ordination busy! Perhaps by the end of the Summer I will have figured out how to do something a little more impressive than take off, hover and land!

References: ESKY

Friday, 19 June 2009

Hacking the Chumby


A few weeks ago I was given a Chumby. What is a Chumby? Well it's a nifty little Linux based internet enabled device that plays Flash Lite widgets. The Chumby has a small 3.5" 320x240 colour touch screen, a couple of USB 2.0 ports, stereo 2W speakers and a headphone socket. The processor is a 350Mhz Freescale MX21ADS (ARM926EJ-Sid(wb) rev 4 (v5l)) and on board is 64 MB SDRAM and 64MB NAND flash.

It also has a squeeze sensor and a motion sensor (accelerometer) - the latter is used for interaction, such as games Widgets.

Hacking this device is fairly straight forward, there is a hidden button on a configuration screen that selects a hidden options menu. This has an option to allow one to enable SSH, and once enabled one can SSH in as root and start playing! To keep SSH enabled even after a reboot one needs to touch the file /psp/start_sshd.
Another hidden option enables a simple Web Server. I've hacked this to allow me to check the system status, it's rather crude, but it works!

The Chumby Website allows one to select from over a 1000 widgets - you simply add these to one of your personal Chumby channels and the device downloads these Flash Lite widgets which are free to use. There are a huge range of widgets, ranging from internet radio players, clocks, RSS news feed viewers, webcam viewers, games, photo viewers and more beside!

As for hacking, there is a Wiki with plenty of information on how to download the GCC toolchain and kernel source - with which one can start porting apps. It's early days for me - I've only rebuilt the kernel and ported bash, but I'm looking to do some hoopy things, such as get a C64 emulator ported - there may be enough horsepower on this device for it to work. Watch this space!

Chumby References:

Chumby Industries

Wikipedia
ARM

Saturday, 13 June 2009

I Have No Tomatoes



So I've been squishing bugs all week, how about squishing some tomatoes? "I Have No Tomatoes" is an amusing little game that basically involves steering your little red tomato around 10 grid mazes and in the process one squishes a whole load of other tomatoes.

Your tomato has the ability to drop bombs which blow any tomato in its path to smithereens, and you pick up power-ups by doing this. My technique is to pick up a Willow-the-Wisp which starts picking up power-ups for you. Then try to get a Potato Man which then automatically goes squishing more tomatoes for you. There a bunch of other power-ups, ranging from a lightning zaps, traps and more powerful bombs.

It's all light relief from tracking down and squishing kernel bugs! My scores are around the 420-450 mark, and any suggestions on how to get better are gratefully received!

To install, use: apt-get install tomatoes

Go on.. squish a bunch of tomatoes today! :-)