Tuesday, August 13, 2013

Making conscious changes in life.

I have been off meat for 19 years. One day I just decided that I did not want to eat animals anymore. I am ok with chicken eggs and cow milk. No animal has to be killed to give me that.

I have been off sugar in drinks for a few years now. Mainly to decrease calorie intake. But it should help with keeping teeth healthy too.

Lately, I started being off caffeine. I switched from regular to decaf coffee and I never really drank cola drinks. I am very susceptible to caffeine. I could start with one cup of coffee a day on Monday, and finish with five cups a day on Friday.

I am officially off alcohol now. Not even one beer. This is awkward in social situations, but I believe the positives outweigh the negatives.

I am trying to be off food additives and to care more about how food is produced. This one is not easy either, but I am trying to buy organic, free range, and fair trade products.


In another category, I switched from MS Windows to Mac OS for the bulk of my personal computing. No regrets here.

I am getting off Google Search as well. I set all my browsers to use duckduckgo.com for search. It is what Google was 10 years ago: simple, accurate, and beautiful.

I use Python and Ruby where feasible.

I will ditch Skype, the moment a viable alternative appears.

Sunday, July 14, 2013

The Kokoda Challenge 2013

My daughter took part yesterday in the Jim Stillman Cup of the Gold Coast Kokoda Challenge. The Kokoda Challenge is a uniquely Australian event. It is a walk to commemorate WWII battles in Papua. The full length Stan Bisset Cup is 96 km long. It is open to students who are at least 15 years old. The Jim Stillman Cup is half the distance and is open to students at least 13 years old. There are shorter Kokoda Challenge walks in Brisbane and Melbourne.

185 school teams of 4 students and an adult and 190 other teams got to the finish line in Nerang Velodrome yesterday and today. This is a gruelling event. The participants walk and run for 28 or 14 hours on average, day and night in difficult terrain, and most of them make it to the finish line.

A big thank you to the support teams and all teachers!

Jim Stillman Cup start in Numinbah Valley.

The full 96 km track.

Thursday, July 4, 2013

Software Testing

I would like to share with you an approach to software regression testing that works for systems consisting of multiple applications.

First things first. Software regression testing should always mean automated testing. Manual regression testing is a wasteful practice that will make you loath change. If you go the manual testing path, the process will take more time every time you add a feature, and soon you will  find out that a simple change, that takes a programmer a few minutes to implement, takes weeks to deliver to the customer. It's best to leave manual testing to beta customers, internal or external. When they find a problem, add a test case for it to the automated test suite to prevent regression. Automated testing ensures that no regression occurred in the last build. Just like continuous integration, it is a must, and ideally you should have it right from the start of the project.

Continuous deployment that triggers tests is a bit more difficult to implement with limited resources - you would need a new test environment for every check-in, but definitely every build should generate all installers, and you should have an automated nightly deployment and test run.

Automated testing of some systems is difficult. A system consisting of web applications, desktop applications, services, all interacting with different operating systems, cannot be functionally tested the same way you test a class library with unit tests. You need something that will emulate one or more users, and will interact with all parts of the system running on multiple computers at the same time. Mocks won't do. You need a program that will click buttons, read text, close windows, launch programs, and remote desktop (yes, it's a verb).

We chose Sikulideveloped at MIT and maintained by people from around the world. Sikuli (“God’s eye” in the language of Mexico’s Huichol Indians) is still quite new, and some features don't work very well, but it is the best one out there. Especially IR (Image Recognition) works great if you remember that it uses fuzzy matching and your images need to capture the essence of what you are looking for. For example, if you have icons on the screen and you need Sikuli to find one, your images should include only the parts of the icons that differ, which may mean not including their borders. Turning off the mouse cursor is tempting, it speeds things up a lot, but it makes troubleshooting harder and may cause weird errors when a program is surprised that a mouse click happens without any preceding events.

What doesn't work very well in Sikuli?
  • OCR (Optical Character Recognition) works best when text is 12-14 pixels big. Use smaller or bigger text and you get funny results. 
  • Switching between applications on Windows is not reliable, the operating system sometimes doesn't honour your requests. You need to resort to switching by clicking on things, like Windows taskbar -> right click -> show desktop -> click on app icon. On Macs it may work better. 
  • There is no serious IDE, and no unit test framework, but that problem is easily mitigated with Google's Robot Framework and Eclipse. For a simpler environment try Notepad++ with a workspace file and Python and Robot Framework language style templates.

When you have tests running overnight and something goes wrong you need to know what happened. Logs are good, but not enough. You need to see what happened. We record all tests with Screenpresso. Just yesterday, I saw a recording of an error that I would find very hard to believe, if reported by a tester. And that's what I like about programming - I see miracles every day. :-)


Saturday, June 8, 2013

Scarecrow by Matthew Reilly

An AIM-120 AMRAAM being loaded onto an F-16CJ by Senior Airman Hector Huguet. Source: wikipedia. 

Scarecrow by Matthew Reilly reads like a script for an opening scene of a James Bond movie, repeated ad infinitum. You can open this book on almost any of the 450 pages and you will find an action scene.

Let me try a few random pages:

  • page 33 - headhunters are chasing captain Shane Schofield, aka Scarecrow, inside an abandoned Russian submarine;
  • page 77 - Gant Fox, Scarecrow's girlfriend, and her team, enter a tunnel into a mine full of terrorists;
  • page 156 - Scarecrow rescues Gant from headhunters inside a Hercules transport plane;
  • page 281 - a quiet moment, while flying Black Raven (Su-37), Rufus tells Mother how he met captain Knight;
  • page 346 - Scarecrow is on a supertanker where multiple fights are going on: Nigerian Presidential Guard, Israeli commandos, headhunters;
  • page 415 - Knight, who was flying a rocket plane (X-15) put his plane in a path of an AMRAAM rocket that was about to hit Scarecrow in his X-15.
Matthew Reilly has sold millions of books, and many people think that a movie about Shane Schofield would be a great hit. However, it would be very expensive to make if using real planes, boats, vehicles, and locations. Also, the level of improbability - Schofield should have died many times in Scarecrow, and lack of romantic scenes make it feel less like James Bond and more like Stainless Steel Rat. Still, could be a good action movie.

Friday, May 3, 2013

Karate-Do Nyūmon


Karate-Do Nyūmon - "A passage through the gates of the karate way" by Gichin Funakoshi, translated by John Teramoto. First published in Japanese in December, 1943.

Gichin Funakoshi is known as the founder of Shōtōkan-ryu, the most popular style of karate, which takes its name from master Funakoshi's pen-name.
"As far as I know, the only styles that have been handed down from the past are the Gōjū-ryū of Master Miyagi and the Shito-ryu of Master Mabuni. I have never given a name to the karate I am studying, but some of my students call it Shotokan-ryū."
Karate-dō means: the way (dō) of the empty (kara) hand (te).
Note: the dash above 'o' signifies a long 'o' sound and is called a macron.

There are a few interesting stories in that book about master Funakoshi's teachers in Okinawa: Yasutsune Azato and Yasutsune Itosu, and about those who came before them. There is a chapter about history of karate, and a detailed description of master Funakoshi's kata (formal exercise): Ten no Kata.

The term karate in the meaning of empty hand was introduced by master Funakoshi after he arrived in Tokyo in 1922. Before that, in Okinawa, he used terms Okinawa-te and To-de.  Okinawa Prefecture was at one time known as Kingdom of the Ryukyus. Kara also means 'China' in Japanese, and some translate karate as Chinese hand. Okinawa had close relations with China and 'Chinese' had an additional meaning of 'fine quality'.

Master Funakoshi gives six reasons to use the character meaning 'empty' instead of 'China':
1. There were no written records, so kara could mean both 'empty' and 'China'.
2. Karate written with character for China could be confused with chinese martial art of kenpō. They are similar, but not the same.
3. Karate is a Japanese art form, so 'China' character should not be used.
4. 'Empty' implies weaponless, empty-handed self-defense, which is a good characterization of karate.
5. 'Empty': karateka must rid himself of self-centeredness and greed.
6. Emptiness is the true form of the universe.

How to make a traditional outdoor makiwara (striking post):
Use Japanese cypress or cedar wood.
2.1 meters long and 9 cm wide.
9 cm thick at the bottom, 1.6cm at the top. Note: You can make two makiwaras from a 9cm by 9cm block.
1/3 buried in the ground.
The pad is made from straw and then softened with a mallet.
A cloth can be used to soften the pad.
The pad has to be protected from rain.

Karate Glossary

Hand:
seiken - regular fist
uraken - back fist
shuken - hand fist
ippon-ken - single-point index finger fist
chūkōken/nakadakaken - single-point middle finger fist
tettsui - iron hammer
nukite - spear hand, same as shihon nukite
shihon nukite - four-finger spear hand
nihon nukite - two-finger spear hand
ippon nukite - one-finger spear hand
shutō - sword hand
haishu - back of the hand

Foot:
koshi - ball of the foot
sokutō - sword foot, striking with outside edge of the foot, close to the heel
tsumasaki - toe tips
enshō - back of the heel
sokkō - top of the foot
sokutei - sole of the foot, used for sweeping opponent's foot

Elbow:
empi - elbow
ushiro empi - rear elbow
yoko empi - side elbow
shita empi - low elbow
mawashi empi - round elbow

Stance:
heisoku-dachi - feet together stance; formal attention stance
musubi-dachi - feet together, toes out; informal attention stance
hachinoji-dachi - open leg stance, like musubi-dachi but feet 30cm apart; many kata start and end in this stance; hachi means eight - the stance resembles the Chinese character for eight: 八
zenkutsu-dachi or zenkutsu - front stance
migi zenkutsu - zenkutsu with right leg forward
hidari zenkutsu - zenkutsu with left leg forward
kōkutsu-dachi - back stance
fudō-dachi - immovable stance
kiba-dachi - horse riding stance

Command:
yōi - ready
yame - stop
rei - bow

Other:
omote - front
ura - back
kenpō - lit. fist method, Chinese martial art
budō - martial arts

kata - formal exercise
kihon - basics
kumite - sparring
karateka - karate practitioner

uke - block
soto-uke - outside block
uchi-uke - inside block
age-uke - rising block

zuki - punch
uchi - strike

oi-zuki - lit. pursuing punch, aka: front punch, lunge punch, straight punch, stepping punch
jun-zuki - front punch, shoulders 90 degrees to the arm
kizami-zuki - front punch, shoulders in line with the arm
gyaku-zuki - reverse punch
morote-zuki - double punch
teisho-zuki - palm-heel punch

kimete - focus
chūdan - middle level
jōdan - upper level
gedan - lower level
barai - sweep
ryū - style
fū - type
tanden - center of gravity in the lower abdomen

ichi - one
ni - two
san - three

ichidan - first grade, first black belt rank

kiai - spirit
maai - distance
kawasu - turning
kawashi - interaction, step in and turn to avoid an attack

yarijutsu - spear techniques
bōjutsu - stick techniques

kuchi bushi - "mouth" warrior
bushidō - the way of the warrior
makiwara - sheared straw - striking post

Tuesday, April 2, 2013

Gold Coast - Burleigh Head, Binna Burra, Labrador

I am still smitten by the beauty of Gold Coast beaches and hinterland. Here are a few interesting pictures from the last few weeks.


A view from Burleigh Head National Park towards Surfers Paradise:


A view from Burleigh Head National Park towards Coolangatta with Tallebudgera Creek in front:


On a track in Burleigh Head National Park:




A view from the mouth of the Tallebudgera Creek inland:



A view from the mouth of the Tallebudgera Creek towards the ocean:

Lower Beechmont towards Nerang lake:

Binna Burra Lodge in Lamington National Park:

A skink in Binna Burra:

On a track in Binna Burra:

A plaque to honour Romeo W. Lahey:



A colourful bug in Labrador. There was also a red one and a hundred of blue ones in a cluster, but it was an evening and the pictures were not good quality:


A little blue crab in Labrador:

Beach erosion after recent storms. It is being fixed currently by the Gold Coast City Council. A view towards Surfers Paradise:

Labrador doesn't have access to the open ocean. Instead, it has access to Broadwater which separates mainland from islands and peninsulas of the open ocean. A view from Labrador towards Southport.

Australian Sand Sculpting Championships - in 2013 the theme was Sand Safari:

 Penguins of Madagascar:


Monday, March 25, 2013

Gold Coast MakerCamp 1

I've been to a MakerCamp yesterday. It was organised by Gold Coast TechSpace in Southport.

TechSpace is a place for enthusiasts to meet twice a week and work on hobby projects. You can work every evening or night if you want - every full member has a 24 hour access.

If you work remotely, but you don't want to, or can't, work from home, Gold Coast TechSpace offers cubicles for $200 a month, see co-working.

So, what's a MakerCamp? It's a "show and tell" for people who make things, primarily involving electronics, often based on Arduino or RaspberryPi, but there was also Pavel who wants to build a catapult, and is looking for people who can help him build a Roman village in Australia.

Steve Dalton showed this low-cost plotter:

And a Lego Mindstorms kit set up and programmed to solve Rubik cube:

Neil, Rod (Skip), and Chris are working on a tiggy game for little 3D printed robots.

Anna Gerber who participates in The Edge showed her LilyPad creations. I liked an octopus-like doll that moves its arms and head when somebody is talking to it. 

Phil showed a display made of 240 flexible waterproof RGB LEDs, which you buy by a meter.

If you want to start with electronics a good place are the kits made by freetronics.

When you are making something, you may need custom parts, and a 3D printer like this printerbot comes handy:

3D printers are getting cheaper, more precise, and more versatile. The cost of material for making a small plastic part is about $1. You buy material per kg in what looks like wire on a spool, and for a certain nozzle diameter, this one had a 0.5mm nozzle, you get a certain number of meters of wire per 1 kg. The instructions that are sent to the printer show the total number of meters of wire that you will need. Jorge from Rabbit + Cocoon Arts Precint was telling me that 3D printers can now print metal parts, and big parts for planes. Amazing!