Showing posts with label frustration. Show all posts
Showing posts with label frustration. Show all posts

Wednesday, June 20, 2007

Rant:

I think I'm going to boycott the bus for distances less than 15km for awhile. Today I spent nearly an hour and a half getting from Bathurst and Steeles to Dufferin and Lawrence. According to Google Maps, that's 11.2km and takes 14min (by car, obviously).

Here's what I went through:
* 10 minute walk to the bus stop (that's normal)
* Caught the #7 Bathurst bus
* The #7 stopped for about 5min before turning south on Bathurst
* Took the #7 down to Lawrence, this took about 30min.
* Waited for the #34 Lawrence bus.
* I first saw the #34 after 10 minutes of waiting
* After three green lights it finally made it across the intersection
* Two stops up we waited a few minutes before moving because people weren't behind the white line
* Arrived at Lawrence West station, waited 5min there.
* 5min later we got to Dufferin.

I came up with a list of frustrations while during my trip:
1) Why is there bus stops on both sides of an intersection? All this does is cause the bus to be stuck at extra red lights. In most cases the bus stop should be after the lights, to help avoid getting stuck at them.
2) The bus is a lot slower than I remembered. It really sucks when it takes half an hour to go from Steeles to Lawrence.
3) It's difficult to estimate how long it will take to get somewhere unless you do it on a daily basis. To arrive on time you usually need to give yourself a lot of extra time, which often ends up making you really early!
4) Buses get really crowded.
4) The things mentioned above cause a huge amount of frustration for me.

I think one of the reasons the bus is more frustrating now is because I'm in the far north of the city. When I was living closer to Bloor I don't remember it being this bad.

For now, I'm going to use my bike whenever I can. I'd forgotten how nice it is to have control over your mode of transportation.

Monday, December 04, 2006

Not so Rational Rose

Apparently Rational Rose changes their file formats between minor versions. Because of this I just had to re-do a large amount of work.

This whole program is a piece of crap. Their UI is terrible, inconsistent, and feels like it was built for Windows 3.1. For example, how do you delete something from a model? The 'delete' key you say? Of course not! You use ^D! Did you make a change you didn't like? Would you like to undo it? Sorry! You can't! Delete the object and then add it again.

Yargh!

Tuesday, November 07, 2006

"It's Frozen" -- The Story of My Day

I just went for my break to grab dinner.

First I wanted a veggie burger -- 20 minute delay because they are all frozen.
Then I wanted a pita with hummus -- the hummus was frozen!

Who the hell shuts down their kitchen at 5pm.
*grumble grumble*

Friday, November 03, 2006

More Unit Testing


bhearsum@wesley:~/projects/mozilla/buildbot/buildbot-bonsai/buildbot/test$ trial test_bonsaipoller.py

Ran 9 tests in 0.061s

PASSED (successes=9)


So I've finished my first set of test cases, rejoice!

When I started writing them I thought it would be really easy, I didn't expect to spend more than a few hours on them. Boy, was I wrong. It's been over a week since I started and I probably spent 8 to 10 hours total on a 181 line file. I received help and advice along the way from Rob Helmer for which I am much appreciative.

Problems I encountered

  • My original code was more or less untestable

  • Python regular expressions were confusing

  • My original code used a mixture of exception and return values for error reporting

  • Comparing two objects by their data, _not_ their references



Very quickly I decided to do rewrite of the BonsaiPoller module. It was untestable, confusing, and just plain ugly. I had been planning to do a rewrite becausue of the ugliness alone, so it wasn't hard to reach this decision. This also gave me a chance to attempt some test-driven development. I was looking at _some_ of the old code while writing the test cases but by the end the BonsaiPoller and BonsaiParser worked quite a little differently internally. For reasons of simplicity I decided to keep the interface the same.

I found much of the test case writing very tedious. Just inputing all the data I needed was a chore. I thought it might be easier to input one "good" piece of data and base all of the broken ones off of it. This worked well enough while using the replace() method to do simple substituition but as soon as I needed regular expressions I was in a world of hurt. For some reason the Python developers seem to have decided that they don't want regular expressions as a built-in part of the language. For the life of me I don't know why. I was stuck carrying around a 're' (regular expression) object for most of the regular expressions I used. Compared to how they work in Perl it's a complete pain in the ass. Observe:
Python:

import re

data = "<blah><ci><f></f></ci></blah>"
myre = re.compile("<ci.*></ci.*>", re.DOTALL, re.MULTILINE)
newdata = re.sub(myre, "", data)

Perl:

$data = "<blah><ci><f></f></ci></blah>"
($newdata = $data) =~ s/<ci.*><\/ci>//;


Not such a big deal when doing one or two, like I was, but if you're doing heavy text parsing this would be an ugly nighmare.

In my original code I used a lot of 'return True' and 'return False' to indicate when there was no more data. Seeing as python is object oriented and throws lots of exceptions I wanted to be consistent. This made much of my code a _lot_ cleaner and it has a nicer "feel" to it. There's one part I'm still not happy with though.
Here's the code when I was using True/False:

data = BonsaiResult()
while self._nextCiNode():
ci = CiNode()
ci.log = self._getLog()
ci.who = self._getWho()
ci.date = self._getDate()
while self._nextFileNode():
fn = FileNode()
fn.revision = self._getRevision()
fn.filename = self._getFilename()
ci.files.append(fn)

data.nodes.append(ci)

return data

And with exceptions:

nodes = []
try:
while self._nextCiNode():
files = []
try:
while self._nextFileNode():
files.append(FileNode(self._getRevision(),
self._getFilename()))
except NoMoreFileNodes:
pass
except InvalidResultError:
raise
nodes.append(CiNode(self._getLog(), self._getWho(),
self._getDate(), files))

except NoMoreCiNodes:
pass
except InvalidResultError, EmptyResult:
raise

return BonsaiResult(nodes)


I tried to think of a way to use exceptions cleanly with while loops but drew blanks. If anyone can think of a way to improve the above code please let me know! The function works fine, however, so I shouldn't worry so much.

The last problem I ran into was comparison of my BonsaiResult objects. I didn't have this problem before writing the test cases because there was no point where I needed to compare them! This part wasn't too difficult once I figured out what I had to do -- but that took awhile. I was considering pulling the __cmp__() method before creating a diff but I don't think it hurts to leave it in.

Overall I am very pleased with my test cases and new BonsaiPoller module. As soon as I get the energy I will be submitting it to Brian.

Thursday, October 12, 2006

The little connection that couldn't.

The wireless internet at my school sucks. Since the start of the Fall semester is has been barely usable. My connection is dropped every 2 to 10 minutes. I've upgraded the drivers for my wireless card -- didn't help at all. It happens all over the damn school but not *all* the time.

It's hard to say exactly what it is. Between the summer and fall semesters I upgraded to Ubuntu Dapper, but I don't think that would cause these problems. Especially since I'm running a custom kernel and the latest drivers. Tom has similar issues. I think it's just the access points being overloaded with traffic.

It's really frustrating though, and defeats the purpose of having wireless access.