Loops in Go - a Cheat Sheet

This is the first in my “Cheat Sheet” series, which provide a side-by-side view of the idiomatic way to write a piece of code in the languages I know well enough to do so. Each example prints the same output in all of the languages shown. Iterating over values iterating over a numeric range for i in xrange(5): print i for my $i (0..4) { say $i; } for i := 0; i iterating backwards over a numeric range for i in xrange(5, 0, -1): print i for (my $i = 4; $i >= 0; $i--) { say $i; } for i := 5; i >= 0; i-- { prinln(i) } Iterating over collections iterating over a slice/array for x in my_list: print x for my $v (@array) { say $v; } for _, v := range myList { println(v) } This one is easy to get caught out on: the ‘range’ expression gives you indices, not values when it is passed a list.

Read more

Share Comments

The Gopiphany

Recently, I took a job where I get to write go full time as a primary language. How did I get here? A long time ago, I took a go tutorial at a Linux Conference in Australia. The tutorial lasted about 4 hours, and in that time I remember coming away with a vague idea that go was like a better C, with a stronger notion of types and concurrency and multiprocessing built in.

Read more

Share Comments

Oh, Nick, you've done it again

I do love my husband, Nick. He means so well, and his presence around the world and dedication really does mean a lot to a large number of people. But you know, lately he’s been getting ideas from reading people’s christmas lists. They used to be such easy gifts for our troupe of elves to make, and for Santa to deliver. But around 2007, when we were making preparations to move our base of operations in preparation for the massive ice melt that was upon us, there was this one christmas list he read to me… it said, “All I want for Christmas is a binding agreement on carbon emissions from the world’s leading emitters”.

Read more

Share Comments

cut up backup tapes

the cut up words of William S. Burroughs and John McAfee From symbiosis to parasitism The odyssey Sam and I have been on a short step did not begin after the death of Mr Faull The word is now a virus. it began on October 15 this year, an aborted raid by the police of San Pedro and Belize City. Since that time Victimless crimes are the lifeline we have been on and off the run from the RIGHT virus.

Read more

Share Comments

Welcome to ZeTrip

Geographic consultants: Fox News

Read more

Share Comments

Fact or Fiction—Chinese Medicine's San Jiao theory?

“Theory” is certainly not the right word from the perspective of mainstream medical culture. Most times it just refers to a body location. It’s mostly terminology. The Upper Jiao is essentially the Thoracic Cavity, and the Orophalanx (mouth basically). Everything above the diaphragm relating to Digestion and Circulation, and almost all of of the organs of Perspiration. It belongs alongside Thoracic Cavity in a Scientific Occidental Medical Practitioner, as an Organ Group.

Read more

Share Comments

Offsetting my Air Travel (and then some)

As many people know, I tend to fly around the world a lot. A long time ago, back in about 2006 or 2007 I think, I signed up with Dopplr and put my travel in there. I did this mostly so I could hook up with friends I knew online as I travelled around the world. Well, this only actually resulted in actual meetups with friends once or twice I can remember, notably a few cocktails with Randal Schwartz in Hawai’i during our respective travels across the Pacific in opposite directions.

Read more

Share Comments

Wild-Type Outer Membrane Vesicle Vaccines

Vaccines. They’re putting hobbled viruses and bacteria into our system so that they can cause an infection, and thereby build an immunity, right? Like Smallpox and Cowpox, right? Well, sometimes. That is called a Live Attenuated vaccine. They’re difficult to manage and relatively high risk. There are many different types of vaccine, all of which involve hobbling the rogue organism to different degrees. If they get cooked, nuked (that is, sterilized in an irradiation facility such as the one in Upper Hutt), or perhaps killed with strong salt, acid, base, or some such - then it’s called an inactivated vaccine.

Read more

Share Comments

Vaccines and MeNZB

There’s a big anti-vaccination movement around at the moment, and I think it’s ill-advised and extremely unhelpful to society. I recently had a friend die of Meningococcal disease. Not a very close friend, to a person I know she was like a second daughter, well by analogy she was to me like a second cousin I saw at larger family gatherings. However as she died at a ridiculously young age and was otherwise in good health, I found it somewhat disturbing and so started to research on this phantom menace disease.

Read more

Share Comments

The GitTorrent Commit Reel

The commit reel is defined in section 5 of the GitTorrent RFC. It is defined as an uncompressed stream of objects, sorted in a particular way. In practice, it is only the commit objects that are sorted, and all of the dependent objects for those commits are placed with the commit which first introduces them. So, you start with a repository: You sort the objects so that they are in reverse date order (tie breaking is still required over git rev-list --date-order, as well as fetching their types and sizes, to produce the commit reel index.

Read more

Share Comments