Debugging

16 05 2009

Excerpts from the commit log of a Subversion repository I am privy to, in chronological order, for your enjoyment:

r281: Fixed parsing bug in (filename).  Now, it doens’t care if there are double spaces or no spaces at the ends of lines.
r282: Added a debug message.
r283: This parsing bug is starting to drive me out of my mind.
r284: Okay, I think this bug is actually squished now.  (*crossed fingers*)
r285: THERE SHOULD BE A GODDAMN LICENSE FOR USE OF ‘#define’ !!!!

These were all made by the same author.  I hope he doesn’t murder his poor coworker…





New host; CTo’W

15 05 2009

Welcome to my weblog’s new home at WordPress!  Make sure to update your bookmark or RSS feed address.

Sorry I’ve been out of touch for awhile; I’ve been pretty busy lately – which isn’t to say I’m not now! – but with the new address and some recent finds I thought it was about time for another edition of CTo’W.

This arbitrary period of time, I’ll be focusing on tech stuff.  Given my technical interests, this should hardly be surprising.  First of all is an article I found some time ago about genetic programming, titled Creatures From Primordial Silicon.  Definitely worth a read, whether or not you’re a genetic programmer.  Here’s a taste: “A further five cells appeared to serve no logical purpose at all–there was no route of connections by which they could influence the output. And yet if he disconnected them, the circuit stopped working.

For those of you unfamiliar with genetic programming, it is, in short, a way of phrasing a complicated problem in a way that the computer can find a good solution for it.  That description is extremely general and pretty useless without more detail, though, so here we go: the kind of problem that genetic programming typically solves is one with no one correct answer, but rather a multitude of them – and when you have a “good” solution, it may not have a black-and-white distinction from a not-so-good one.  For example: “Design a bicycle” is a very difficult problem.  There are many factors to consider: what kind of riding is being done?  How much shock absorption do you need?  How light should the frame be?  How strong should the frame be?  (These last two requirements are an example of a tradeoff – more strength means more weight.)  The problem pretty obviously has no one right answer, or there would only be one kind of bicycle on the market.

Genetic programming tries to answer the problem by taking a page out of evolution’s book: it starts off with a bunch of random “gene sequences”, analyzes their performance according to a “fitness function”, “mates” some of the better ones, introduces random “mutations”, and ends up with a new pool of genes.  This process is repeated many, many times, until one of the gene sequences performs acceptably well according to the fitness function.  In genetic programming, a “gene” is one of the parameters of the problem – for example, “length of front shock”, “length of rear shock”, “number of front gears”, “number of rear gears”, “frame composition”, etc.  A “gene sequence” is simply the combination of all of the genes required of a solution, with a unique combination of values for all the genes.  The “fitness function” is what, in nature, causes “survival of the fittest” – those gene sequences with the highest survival and reproduction rate tend to dominate the gene pool.  In genetic programming, you define what the fitness function is, so you get to pick which traits to focus on.  In our bicycle example, the fitness function may include such factors as “failure rate of the frame” (i.e. how often the frame bends or breaks), “effort required” (how much work it takes to perform the same task on different bicycles), and some measure of “safety” – how often an equally-talented rider will end up falling off the bike, for example.  “Mating” and “mutation” are simply ways of producing new gene sequences; obviously, in mating, some genes are taken from two (or more) parents to create a new sequence, while in mutation, random changes are made to some genes, producing a new sequence.  The child of a mating process may also get mutated a bit, too.  There you have it!  A two-minute introduction to genetic programming.  (If I haven’t done a very good job explaining something, please feel free to ask questions in the comments.)

My next Cool Thing is targeted to programmers: Free Programming Books.  It’s an excellent collection of programming books on a variety of languages and topics, including such classics as The C Programming Language, Programming Pearls, and How To Design Programs.  I’ll be spending some time very soon downloading many of these to my collection of ebooks, even though I already own some of them in hard copy.

And, finally, my last Cool Thing for this arbitrary time unit: Moon, a film by Duncan Jones.  Don’t watch too much of the trailer; it’s rather long and gives away a lot of the movie.  Don’t be afraid to stop it before it’s finished playing!  Having said that, I’m looking forward to seeing it in theatres in June.  Think you recognize the astronaut?  He played Zaphod Beeblebrox in HHGttG.  The voice of the computer?  Kevin Spacey.  Yep, I can’t wait either.

Aaand that’ll just about do it for me.  You stay classy, The Internet.

AC





CTo’W

15 03 2009

Hey, it’s been a few weeks! What’s happening?

I thought I’d stop by and drop you a link to this interesting article about work, hours, and the seemingly odd statement that “counting hours doesn’t make sense”. Even if you don’t really have the option to simply work when you like, and not when you don’t, there are some valuable insights about activities that can help increase your energy.

Short post for today. That’s all for now!

AC





CTo’W and a personal project

12 02 2009

Hello again! I am back. This week, I’ll be talking about LaTeX, XP-Dev, and a personal project I’m working on.

LaTeX is a programming language used to typeset documents. Instead of a WYSIWYG editor like Microsoft Word, it’s a WYSIWYM language to describe elements of what you’re writing and let styling rules decide how your document should look. This is nice for a few reasons; notably, once you’re familiar with the language, it is very easy to create documents. You can write it in whatever text-editor you like, set up your document information (which paper size you’re using, whether it’s a report, an article, a book, etc.) and go. Whenever you have a section, you just say so:
\section{Section Title}
Lorem ipsum dolor sit amet…

and LaTeX (or one of its slaves – I’m still pretty fuzzy on what happens behind the scenes) will make it look nice for you. The Wikipedia page has some example LaTeX code and the corresponding output to check out. I’m trying to move to LaTeX for future documents – probably my work term report this term, for example – because I don’t enjoy dealing with Word to try and get my document to look just right.

Next up: XP-Dev.com! In an earlier post, I mentioned Subversion. XP-Dev is a free Subversion host that includes project tracking capabilities as well. I’m really enjoying it so far – I had a minor problem the other day with something, so I reported a bug. The issue was dealt with in four hours, complete with a friendly, “Hey – should be fixed now :)” I’m working on a couple different projects we’re hosting at XP-Dev; for one of them, there are five of us on the team and the forums are proving to be a very useful way to discuss the project. We can also create and assign tasks, so it’s very easy to see what’s been done and what is left to do. This brings me to…

My personal project! I haven’t been making much progress on it lately, but my plan is to write an audio visualizer, like you can see in Windows Media Player or foobar2000 or Winamp or Amarok or whatever else you like. Since I’ve been using XP-Dev lately, I decided to track the project with its utilities, and create this wiki page describing the project in a little more detail than I’ll do here. There are still a lot of details to work out, but I’m looking forward to it! I might wrangle a programmer friend or two into helping me with it over Reading Week… (Not that I have Reading Week while I’m on co-op, but they do.)

That’s it for now. Cheers!
AC





CTo’W, round 2

28 01 2009

For those of you just joining us, CTo’W is my “Cool Thing of the Week”. It may or may not actually be weekly; we haven’t figured that one out yet. For those of you still with us, welcome back! Glad to have you here. Huddle up and let it snow (preferably from the right side of a nice, thick, well-insulated wall), because here we go!

This week, I decided to share an article I read at defmacro.org called Taming Perfectionism, by Slava Akhmechet. I liked this article because it corresponded so closely with what I’ve been feeling lately – unmotivated to start anything because nothing I do will live up to my own expectations or standards. When I conceive of something, I have a vision in my head, and when I try and implement it, it either disappoints my vision or it falls by the wayside, incomplete. When either of these things happen, I end up frustrated and unhappy, and less likely to pursue another project in future. Slava writes about Wabi-sabi, a Japanese school of thought centred on the concept of beauty as it applies to things that are transient or impermanent. I really enjoyed the article and it helped me understand my own behaviour a little better. I’m going to have to pick up the Book of Tea he mentions… if I ever get around to reading the half-dozen books or so I already have piled up and waiting!

That’s all for the CTo’W for now. Work has been interesting lately. I am very enthusiastic about it, and I’m looking forward to see where we get by the end of the week! It’s very motivational to be working for my boss; he’s an enthusiastic, intelligent guy, and his enthusiasm for work, life, and everything else is highly contagious. Maybe I’ll write more about the work I’m doing in a later post.

Cheers for now,
AC





Cool thing of the week, round 1

17 01 2009

As suggested by Abe, I will start posting a cool thing once a week, with arbitrary regularity. This week, it is the List of common misconceptions. There are some interesting things in there – for example, “eyestrain” from reading in low light or playing video games does not explain myopia. Also, black holes do not somehow develop a stronger gravitational field than the stars that formed them. If our Sun was immediately compressed into a black hole, it would have the same mass as it did beforehand, and (hypothetically) the same centre of mass; the Earth would continue to go around it as normal, only without the usual sunlight. (This also explains why the miniature black holes theorized to form at the LHC are not a threat to the planet. You can look up Hawking radiation if you want more information about why they’re not a threat.)

I feel that hoarding “cool things” so that I’m assured to have something each week would be silly – I’d rather post everything as I find them and force myself to find something else cool if I run out. On that note, I’ve been meaning to set up a Subversion (SVN) server for a while now, to take care of versioning schoolwork and my programming projects. This past week at work, I got started setting one up for the job – it turns out it’s much easier than I’ve been expecting, and I’ll definitely be using it from now on. The Wikipedia article might be a little technical for you, but it’s really cool stuff. Some people say that even artsies should use it to take care of their papers and so on. I’m personally using TortoiseSVN (a Windows shell extension standalone SVN client); I think Visual Studio 2008 probably has its own built-in plugin, so I’ll be seeing if that connects to my server as well. If you’re one of my less-technical friends, and interested in setting up Subversion for yourself, let me know and I might be convinced to lend you a hand.





Regarding exhilaration

28 05 2008

As promised in my last entry…

Physical workouts are a great way to start the day. They force me to wake up early, and thus, to get to bed on time; they’re a great way to get my blood flowing and my whole body started up early in the day, reducing my “boot-up” time; and, I suppose, they’re doing my health good.





Beginning of term

26 05 2008

Work is exciting – at least, as I get closer to working, it’s becoming more that way. Computer setbacks have fortunately been minor, so while I’m not quite yet capable of running the software I need to, I still have other things to do that I don’t need a computer for. My project is pretty exciting and my professor is great – and he treats his students very, very well. I’ve very much enjoyed working for him so far.

Living in residence comes with all the pros and cons I’ve become accustomed to. My roommate this term is great, as is just about everybody else here this summer. I haven’t seen most of them in quite some time – which, in some cases is regrettable; in others, not so much. Living on a floor with a bunch of other students is a lot of fun, but it can make focusing on work more challenging. The laundry is expensive and the food is of a lower standard than I like to think I can cook, but I don’t have to prepare it or wash the dishes. Ultimately, the social benefits and supreme convenience of being able to walk to work in ten minutes win out over all the downsides.

Oh yeah; did I mention that I don’t have terribly much closet space or shelving to put stuff in? ‘Cause I don’t like that much, either.

Also we don’t have air conditioning.

The jazz band is going well this term. I’ve taken on a new position in it which comes with a new set of challenges and rewards. I’m enjoying it very much so far. Our first gig will be around the end of June, I believe… at which point the combo should be back together and rehearsing regularly.

Speaking of jazz, and gigs, The Bad Plus are playing in Toronto on June 13, and I think that a friend and I will go.

Lately I’ve been reading Zen and the Art of Motorcycle Maintenance, and I’ve been enjoying it immensely. It’s quite the mental workout: I can feel my mind straining and growing while I read it and for a time afterwards. It’s quite addictive… I wonder if physical workouts are as exhilarating? I’ll have to investigate. More on that in a future post.

Anyway, Monday evening beckons. Be seeing you.





Vacation’s end

2 05 2008

Well, another break has come and gone. Tomorrow I’ll be shopping and packing, and Sunday I leave pretty early, arriving in Kitchener before dinner.

It was nice seeing family and friends again. I got to talk to some old band teachers, which provided some insight I think I’ll find valuable while conducting With Respect To Time this summer. I also got to see many friends I haven’t in a while, have a few drinks, play a reasonable amount of Brawl, and completely vegetate on the recliner in the family room. Somebody (she knows who she is) I didn’t see at Christmas gave me a present that she’d been saving since then. If you’re reading this: your Christmas present is full of win! Thank you!!

Last weekend I made a trip to Vancouver, driving one way (Mom drove the other), for my little sister’s golf tournament. I had a good time; Saturday morning I stopped by Long & McQuade to take a look at some sheet music for WRTT, and while I saw some things I liked, big band arrangements cost something like $70 a piece. I’m hoping that the band will have room in the budget for a couple charts, and I’m thinking about getting in touch with a few publishers, like Kendor, to get their promotional CDs featuring the charts they sell sheet music for.

Work starts on Monday and I’m getting pretty excited about it. I have yet to really know the full spectrum of what I’ll be doing, but it sounds like I’ll learn a lot and like I’ll get to travel to Arizona once or twice to work with a reasonably large telescope to boot. I’m more excited about the work than I am the pay, which is saying something given the improvement in pay over my previous co-op jobs.

Unfortunately, there’s been a mix-up with one of my professors from this past term and it’s causing some fuss about the midterm for that class, and another class has a final pending due to illness at the time of writing, but hopefully those should both get cleared up quickly, leaving me with a better (and more final) grade average for this term. Wish me luck!

Cheers for now; I have a barbecue to attend.





Stormy weather

11 04 2008

I love energetic weather. Strong wind, hard rain, thunder and lightning… Even weather that’s less energetic but left of normal nonetheless: fog or mist (especially heavy fog or mist), ominous clouds, intense sunsets…

There’s something about interesting weather that I love. The town I’m living in now is much more humid than the one in which I grew up, and as a consequence, fog and mist frequent it much more often. If I’m out and about in such weather, I’m generally grinning from ear to ear.

Tonight it was pouring rain, and on a whim, I decided to go for a walk in sandals, jeans, and a t-shirt. My hair was thoroughly soaked after maybe ten minutes. It was delightful.