Daily photograph for 2008-05-11 - "bus stop"

Today's photograph on my photoblog, "Photo-Persistence"

Archive for

Links to utils: Count your lines and obfuscate

Wednesday, August 27th, 2003

The JDJ email had some links to some very useful tools. 2 in particular I could see myself using for personal projects.

Proguard is used to obfuscate your Java classes…never 100% secure, but deters those other than the really commited. Not sure how well it does the job as I’ve heard some obfuscators are better than others and some are downright useless. Comes with an ant task for inclusion in your build scripts.

JavaNCSS gives you some source code metrics on your classes. I’d like to monitor this to see my progression of code over a period of time. It would be great if I could get this to write the results to a database so I could see the progression over time. A point-in-time measurement isn’t always so useful. There’s an ant task for this one as well.

Who needs electricity?

Monday, August 18th, 2003

I decided to work at home this day. And I’m really glad I did. It turned out to be one of the smartest decisions I’d made in a long time. But it also left me a little puzzled since I was home alone. Shortly after 4pm, my computer suddenly died. Along with my stereo and other electronics. I’d had the air conditioner going on low. The thought of a power outage in my apartment didn’t shock me since we’ve blown some fuses here before. I tried the fusebox switches but none of them were tripped. I was so confused. I looked out in the hallway but all the lights were on. Hmmm. I guess it must be just my apartment. I decided to take a trip downstairs to talk to the staff. No elevators. This at least indicated I wasn’t alone. Back into the apartment & out to the balcony. I saw some guys a few balconies over and one floor up listening to a radio. I shouted over to them. They didn’t have power either. One guy said it was Toronto-wide since he’d just talked to a buddy of his. So I think to myself…”ok…it’s a hot day, everyone’s got their a/c going…we’ve got some brownouts. Power should be up in a while.” A woman a few floors down hears us and yells that the entire eastern seaboard is out!! This is not a standard brownout. Immediately, my thoughts go to terrorism. Are we under attack again?

Luckily I had a battery powered radio. I turned on CBC and sure enough, power was out almost everywhere in Ontario, New York, Michigan. This is huge. After listening to this for a while, I realized around 5pm that it may continue for a while and I’m not properly prepared. I grabbed my camera, a backpack, radio walkman and what little cash I had and went on a search for photos and supplies. A quick decent down 18 flights of stairs (not a good thing for when I come home). The grocery store shut the doors immediately. No chance of buying water. I went to Yonge St cause I knew there’d be action there with everyone trying to get home. The streets were totally packed. I ducked into a dollar store to get a flashlight. I squeezed my way past the lineup of people buying similar items. Flashlights, batteries, battery radios, water, flipflops (women walking home ditched their high heels and donned flipflops - brilliant idea) were all selling out. I was escorted down the aisles to the flashlight section, grabbed some batteries and a bottle of water for good measure. Now I just needed some food.

Standing up on a flower planter, I started taking some photos of the street scenes. Crowds of people walking north out of the downtown core. Ordinary people, not cops, directing traffic at intersections. Cars trying to push their way north through the people. Spontaneous carpooling or “urban hitching” started…people with empty seats in their cars and minivans would open their doors to people they didn’t even know trying to walk north. It was great to see people helping each other. I also ran into my housemate on the street amongst the crowds. I was explaining what we knew happened at the time. A random guy started talking to us about it. The 3 of us chatted for a while and learned about the blackout in ‘65. Apparently the birthrate 9months after that blackout skyrocketed. And we didn’t realize for a while the guy was walking around drinking beers on the street. What cop is going to take time out of directing traffic to give a ticket for public drinking? Not today anyways.

Ran into another friend on the street (who says Toronto is a big city? Either that or I know a decent amount of people). She works for an environmental firm. Apparently her boss was exstatic and was writing a press release once they found out what happened. He wanted to bring to light our dependencies on water, electricity, fuels and how we should be conserving them. See an opportunity and grab it.

Back to food…gotta get some food. Street meat! The hotdog vendors were making a killing. As I went from vendor to vendor they had all just sold out. No!!! Later in the evening I did get a hotdog around 10pm in the downtown core. One of the few remaining who hadn’t sold out. I waited 10 minutes to get a dog without a bun. They ran out of buns so I had to eat a napkin-dog. Ketchup, mustard, relish & napkin. Mmm.

I had most of what I needed, but still no food. Maybe I had something at home. Trudged up 18 flights of stairs. I hoped I wouldn’t be doing that too many times. I was thankful for the times we’d run stairs in my old condo for exercise in the winter. 4x 25 stories made this seem easy. Z & I kicked back, listened to the radio and tried to contact relatives & friends to make sure they were ok. And then we invited them to come over. Might as well enjoy the time with friends. A couple came over and we later wandered in search of beers and food. A pizza shop served slices by candlelight and the lineup was down the street. Forget it. Ended up stocking up on chips, popcorn and fruit from a convenience store. Walking down Yonge St for a while, it was great to see people out, talking to each other and making the best of it. Would have been great to live in a residential neighbourhood during this.

Jenn came into the city around 9:30. She was hanging at relatives homes in the ‘burbs near her work until the highways cleared up. She had running water at her place so it would be a bit more comfortable than being here. We lit a ton of candles, ate our napkin-dogs, snacked on chips and listened to other peoples stories on the radio. It was really great. I’m thinking of implimenting one electricity-free evening per month. Definitely an enjoyable time, but I don’t think it would be the same again without the silence of the city.

Friday, August 15
Friday morning we awoke to some power and the joyful news that offices were closed. Long weekend! Jenn & I took a walk to the St. Lawrence market. I knew they wouldn’t be sitting at home if there was some power on. A relaxing breakfast of pastries and reading the paper. I really need to take advantage of this on weekends.

Later that afternoon, we saw someone with a grocery bag. Grocery store is open! We better stock up on food for the weekend. We weren’t the only geniuses with that idea. It was packed! People were buying everything that didn’t have to be kept cold or could be bbq’d. I wish I had a bar-b-que. The entire bread section of the store was sold out. Nothing left at all. All buns, breads were totally sold out. The only bread Jenn could get was weight-watchers…and believe me she doesn’t need weight-watchers bread and neither do I. Where’s the weight-gainers bread? $90 of non-perishable groceries later, we were outta there.

The electricity was still out for most of the day at home. It was on at 5am, out around 9:30 for the rest of the day. I had a stag party to go to north in Wasaga Beach. A good 2-3 hour drive depending on traffic. I wasn’t even sure if there would be rental cars available still. I had a reservation but that doesn’t mean much sometimes. With all the people with cancelled flights, I figured rental cars would be at a premium. Sure enough, they kept my car for me. Arrived around 10pm to a bunch of drunken guys…I had some catching up to do.

Saturday, August 16
Woke up in the passenger seat of my car. Ended up sleeping there around 4am. Got a couple of hours sleep, but not nearly enough. Trip to the beach for the rest of the day and got a spotchy sunburn from areas I missed with the SPF30. Another long drive back wondering if there would be still gas to fill up the rental. Gas stations on friday were reporting they were almost out of gas at some locations. People were lining up for hours to fill their car and the stations were running out. I filled up a little outside of town without any problems.

Dinner…man was I hungry. We hadn’t eaten a decent meal in days, so J & I went to Canyon Creek Chophouse. A steak and veggies would fill me up.

Sunday, August 17
Power seemed stable. Worked on wedding-ish stuff. Nothing too exciting. Getting closer to the big decision on reception locations. Pizza & a movie (The Hunted - thumbs down). The Restaurant was another exciting night. I love this show. My favorite reality tv. Next to Trailer Park Boys, that is.

Monday, August 18
Am I a non-essential worker? The recommendation is for non-essential workers to take another day off. Luckily for my company (unlucky for me) I can work remotely. They suggested we work from home if possible. I gladly will. From what I’ve heard, the office is a sweaty mess. Sounds like this might continue for the rest of the week.

Installing Tomcat as a service

Monday, August 18th, 2003

I needed to reinstall Tomcat as a service this morning. I found this reference which I’d used before in the past but has now disappeared. Luckily Google cached it.This originally appeared on mattkelli.com.
Setting up TomCat 4.1.12 to run as an NT Service:
* Set NT environment variables:

  • CATALINA_HOME=C:/jakarta-tomcat-4.1.12
  • CATALINA_OPTS=-server -Xms128m -Xmx512m
  • * Open up a new command prompt (ensures environment variables you just added are active)
    * Run the following (must be all one line so you may have to put in notepad and then copy — copy from this page should work OK):


    %CATALINA_HOME%/bin/tomcat.exe -install Tomcat %JAVA_HOME%/jre/bin/server/jvm.dll -Djava.class.path=%CATALINA_HOME%/bin/bootstrap.jar;%JAVA_HOME%/lib/tools.jar -Dcatalina.home=%CATALINA_HOME%
    %CATALINA_OPTS% -Xrs -start org.apache.catalina.startup.BootstrapService -params start -stop org.apache.catalina.startup.BootstrapService -params stop -out %CATALINA_HOME%/logs/stdout.log -err
    %CATALINA_HOME%/logs/stderr.log

    To Uninstall Tomcat Service use:

    %CATALINA_HOME%/bin/tomcat.exe -uninstall Tomcat

    * You should get a message saying that the task was installed successfully.
    * The service is called Tomcat

    Huge list of UML tools

    Wednesday, August 13th, 2003

    In my RSS aggregator, I was reading about a list of UML tools. What a great resource. It even lists by price…which is very important to me. I like the open source stuff. I tried out the first one, ESS-Model. It’s awesome. One single file, point it at a src tree and it’ll parse the whole thing into class diagrams. Very nice UI. Check out a screenshot. I’ll be holding onto this utility.

    5 Lessons from XP

    Monday, August 11th, 2003

    Five Lessons you should learn from Extreme Programming. This was posted to the XPToronto mailing list. I’m a bit of an XP sceptic. I think there are some good practises, but some of them I can’t adhere to. I’ve never been a total supporter of peer programming. I do think it’s a great idea and it has its benefits (no code ownership, peer review, learn coding by watching others) but I also couldn’t sit there and watch someone program. It would be a mental struggle for me to sit beside someone and pay attention to watching them code. I’d like to try it out with a senior programmer someday just to see their technique and see how others work. But there’s no way I could do that daily. I can’t sit still like that.

    Test-first design is great. And I really try to adhere to this in personal projects. Continuous Integration is essential. Daily (if not more) automated builds are crucial to a successful product. At my last company, the first thing I did when I got in there was automate the build process. Previously, it was a mish-mash of manual steps on different machines to build a Win32 client. VB6 compiling plus Installshield creation. There was a small sheet of instructions on how to do the build manually and this was out of date. So I created a full set of ant scripts to automate everything. It made everyone’s lives easier once this was completed. Just don’t ever ask me to work with VB again…compiling with dependencies is ridiculous. Blagh.

    And who doesn’t like the practise of a 40-hour week? :)

    Bad hair day or lightning strike?

    Friday, August 1st, 2003

    Last night the weather at our Ultimate game was not the nicest. Overcast and cloudy. About halfway into the game, rain drops started to fall. Rain or shine, it’s game on. Only in the case of lightning are the games stopped. Sure enough, Lightning soon arrived with it’s louder, more obnixious brother - Thunder.

    As we were walking the field between points, John said to me “look at your hair sticking up”, which didn’t seem strange to me because with all the product I put in my hair, it’s supposed to be sticking up. But other people were saying the same thing about other peoples hair, in particular the girls. I didn’t notice it, but some peoples hair was really sticking up. So what? Bad hair day? That happens when you’re running around outside. Not in this case.

    Boom! Lightning flashed a few kilometers away from the field. And a certain member on the team - let’s call him Z (not revealing names to keep the possibly embarrased anonymous) started yelling. “Get down! Get down! We’re going to get hit! My hair is standing up and my scalp tightened up.” If you know Z, this is really funny because he’s a pretty calm guy but to see him start freaking out and diving (yes, he truely dove) onto the ground was pretty hilarious. Z looked at BP (another anonymous person) and yelled “Your hair is sticking up! Get down!” He grabbed her and pulled her down to the ground. Apparently her hair was sticking up like she was touching a VandeGraaff machine at the Ontario Science Centre. The rest of us, including the other team, laughed at them rolling around on the ground trying to get as low as possible. Z: “I watch enough Learning Channel to know about this stuff. Lightning is going to strike here”. It’s true, he does watch a lot of TLC.

    Everyone on our field dropped to the ground looking at each other thinking i)am I going to get hit? ii)is laying on the ground really going to help me? iii)is that guy crazy? iv)I wish I’d worn my lightning-proof underwear today. We quickly grabbed all our gear and ran for the cars. We waited for about 10 minutes and the storm had passed. Game was back on. We lost 14-13, but waged a severe comeback for 6 points straight at the end and should have won, but the other team was really watching the clock (started late & didn’t include the storm delays) limiting the points we could get. No, seriously…we would have won. :)

    After we got home, Z checked the almighty source of all knowledge, the Internet, to confirm his lightning-avoiding techniques. Turns out we did the entirely wrong thing. Spreading out on a field is not so smart - actually it’s one of the worst things to do. It makes you a massive target. The real thing to do is to stand on the balls of your feet in your rubber shoes making the smallest contact patch with the ground possible and bend down.

    Moral of the story: don’t always trust someone who watches TLC all day. But it’s alright to laugh at them when they dive around rolling and screaming.