Read about:

picture of me

About Me

My name's Enrico Bianco and I love web technology and open source software. In my spare time, I study Japanese language and culture and produce a podcast about learning Japanese.


Why I curse the TTC

(Miscellaneous)

It’s a quarter past 9 in the evening. I’ve just arrived from my office, which I departed from at not too bad a time: 6 PM. My commute on the TTC subway and bus from work to home, which typically takes an hour and a half, has taken me three hours. For that amount of transit time, I probably could’ve paid my good friend maplealmond a visit in Kitchener. But I don’t live in Kitchener. I live near Finch and Islington.

My subway ride was smooth as usual. Having left the office later, the subway cars were not as crowded and almost halfway through the trip I managed to snag a seat and sit comfortably for the rest of the stops leading up to the north end of the Yonge line, Finch station.

This is where the fun begins.

A large crowd waits for 36 buses at Finch Station on the Yonge line

Read the rest of this entry »

Writing is Human Persistence

(Personal Development)

One of many tips for improving one’s creativity is to keep a notebook available to write down ideas as you get them. The rationale behind this is that if you don’t have something to record your idea in the moment you get it, you might forget it by the time you do have something to write it down on. It occurs to me that this might be another sense in which we are similar to computers.

Read the rest of this entry »

Take the Reins

(Personal Development)

A few days ago, Jon Crowley tweeted (and I retweeted) a piece of advice that I’ve lately found more and more relevant to my life and the lives of others around me:

@joncrowley: "I'm convinced that the key to failure is thinking of life as something that is done to you, rather than something you do."

Read the rest of this entry »

Context Switching

(Miscellaneous, Programming)

One of the reasons this blog is called “Live & Code” is because Computer Science (and by extension programming) is one of the lenses through which I view the world. There are often parallels between the way we think and the way computers work. I don’t think that this is an accident; the term “computer” used to refer to a human being whose profession was computing values. These people would sit and work through algorithms to calculate values that would be used in scientific research.

One of these parallels between humans and computers is the way that we multitask. Computers only seem to multitask by switching between tasks rapidly, with the exception of new multi-core and multi-processor systems, which can run as many tasks in parallel as there are cores or processors. So it was interesting to read recently that the prevailing theory is that humans multitask in precisely the same way!

Read the rest of this entry »

Looking Forward to 2010

(Miscellaneous)

2009 has been a year of turbulent change for me.

Near the beginning of the year, I decided that I needed to switch gears in my career. I made a very dedicated push towards becoming a full-time Ruby developer, leaving my comfortable position as a J2EE web content management and identity management specialist. My leisure time was consumed with sharpening my Ruby skills and learning new technologies. I made Rails Pub Nite a monthly ritual and networked like crazy on just about every networking site I could. I followed a number of job site feeds and sent out many cover letters and resumes.

Finally, my break came from a very unlikely source: Facebook. I posted to a Ruby on Rails group on Facebook to advertise my skills and experience and offer my services. This was seen by the Systems Manager at the Canadian Society of Immigration Consultants, who asked me to send her my resume. I did so gladly and not too long after that I was asked in for an interview.

Read the rest of this entry »

Don’t “fix”, improve!

(Personal Development)

Perhaps it’s a sign that I have incredibly ambitious friends and acquaintances that they are already writing about making the coming year even more awesome than the last. Jon Crowley’s advice to those who are about to make New Year’s resolutions is not to try and “fix” themselves:

You can’t fix yourself.  You have to rebuild.

Take stock of who you are, where you are, and what has changed about your life and yourself.  And then do the things that will make you happier, make you smarter and better and stronger, and do them because you want to.  No one who is trying to fix a loss, or a heartache, is going to move on – if you do this, you are defining yourself by your tragedy.

This is such an important point that I felt I needed to echo it and add a bit of my own experience to it.

Read the rest of this entry »

Life advice in code

(Personal Development, Programming)

Live & Code has been largely about programming and life lessons. So, you can imagine that I was incredibly delighted to see these two combined in a small exchange on Facebook started by Reginald “raganwald” Braithwaite.

Life Advice in Code (raganwald)

Self-esteem expressed in Ruby

It’s a valuable life lesson made incredibly concise in my favourite programming language, Ruby. I leave the interpretation to the reader. It relates to some themes that I’ve already written about before and will probably write more about in the future.

LDAP-based RBAC with ActiveLdap and declarative_authorization

(Programming)

If you followed my previous tutorial on implementing pass-through authentication to LDAP with Authlogic, you might be wondering how it can be extended to give different permissions to members of different LDAP groups. ActiveLdap and declarative_authorization make this incredibly simple.
Read the rest of this entry »

Rediscovering my music

(Miscellaneous)

Years ago, I was torn between two passions. I had loved tinkering with computers and other electronic gadgets since I was as young as 10 (possibly younger!). But I also played the piano, taking lessons with my sisters and playing around with melodies and chords on the keys when I wasn’t practicing my lesson pieces.

That love of music carried into high school. I had stopped playing piano but in music class I picked up the clarinet quite quickly. I transferred to another school after grade 9 because the school I was in was planning to cut their music program entirely and I could not imagine being without it. At my new school, I was blown away when I heard the excellent performances of the senior jazz band and ensembles. I was fiercely determined to play with them but not many modern jazz arrangements called for a clarinet. So I learned to play saxophones.

At the same time, I continued tinkering with computers, teaching myself how to program because I wanted to program video games one day. An exhibit at the Ontario Science Centre featuring the “new” graphical web browsers, Netscape and Mosaic, inspired me to try my own hand at web publishing as soon as we were able to get connected to the Internet. In high school programming classes, I was well ahead of the curve, frequently finishing assignments meant to take hours in a matter of minutes.

And so, when I graduated from high school and decided I wanted to go to university, I had a difficult choice to make: which of these two things would I choose to focus on?
Read the rest of this entry »

Adventures in Ruby: When Constants Aren’t

(Programming)

I just squashed a bug that had me scratching my head for at least a good half-hour or so involving a class constant that kept on getting changed. Here’s the setup (anonymized so that I’m not exposing gooey proprietary secrets):

class WebTransaction
 
  # Base URL for transaction web service
  SERVICE_URL = "http://accountingservice.com/"
 
  def transaction_url
    url = SERVICE_URL
    url < < "VAL1=foo"
    url << "&VAL2=bar"
    url
  end
 
end

The class is meant to represent a transaction being posted against a rather odd web service that actually uses GET rather than POST for posting transactions (bad web service!). In my actual code, the URL parameters appended to the SERVICE_URL base would be determined on a per-object basis but I’ve simplified it here.

Here’s the punchline: SERVICE_URL was changing! Calls to transaction_url would keep on appending more variables to it. If you’re particularly clever with Ruby, you’ve already figured out exactly why. But if you’re scratching your head like I was, here are some hints:

  • In Ruby, constants aren’t. In fact, they’re really no different from variables except for the fact that Ruby detects that variable names in all-caps are probably supposed to stay constant and warns if you try to assign to them.
  • <<, for strings, will append to the end of the string.
  • Ruby strings are mutable. That is, operations on a string variable will usually be done in place, rather than returning a new string. (Method calls, on the other hand, are a different story!)
  • Assigning a String variable to another String variable will assign the reference. That is, the two variables will be pointing at the same object.

Hit the jump to see the solution to this little mystery…
Read the rest of this entry »