Mostly unoriginal

wherein I document some of my thoughts and observations on software and development

About Me

My Photo
Rytmis
I'm 27, hell-bent on becoming a better programmer, addicted to reading, loud, and wrong about things at least twice a year.
View my complete profile

Monday, December 15, 2008

This is not how it was supposed to go

I know I tend to have long breaks between posts, but this one wasn't because nothing interesting happened, or because I didn't think about writing.

Just over four weeks ago I went to sleep on a Saturday night, only it didn't work out so well, because my bad eye began to hurt so I couldn't sleep. The next morning I gathered myself, went to the emergency room of the local ophthalmology clinic. They gave me an ibuprofen pain killer and a prescription for eye drops that would relieve the intraocular pressure.

I bought the drops, and when evening came, I tried them. That was a mistake -- the drops caused burning that felt more intense than pain of the previous night.

I took a sick day, and phoned the doctor with whom I discussed the evisceration operation before. I got an appointment for Thursday. I slept pretty well for two days, and then a night before the appointment, the pain was back.

The doc prescribed pain killers, a combination of paracetamol and codeine. In the next eighteen days I went through 120 of them -- and I only took them during the nights, when the pain woke me up.

Last Monday, I ran out. Even though he wasn't available for the day, I managed to reach the doctor, thanks to a sympathetic optician who left him a message for me. He called me back, and this time prescribed a combination: the aforementioned codeine-laced pills and another sort opioid. And for a couple of nights I actually slept pretty well.

Right now, it's been over four weeks since the whole deal began, and during that time, I've slept maybe four full nights total. Next Friday I have an appointment at the clinic where the evisceration will be performed. At this point, I can honestly say I'm really waiting to get rid of an eye.

One curious detail about the pain is that it really isn't that bad until I go to sleep -- when I lie down, that is. Something to do with the fluids in the anterior chamber, I guess. I've managed to work during the day, and why not -- it's not like I can rest either. So I try to be useful at work, although it gets a bit hard to keep a clear head at times, due to sleeping mostly in 15 to 30 minute bursts.

Lectures at the university became intolerable pretty quickly, so I had to drop them. I did manage to pass my English courses with a placement test, though, and I'm guessing I probably passed both linalg II and discrete math -- not with flying colors, but I guess I can try to do better once I'm all good again.

That's all for today, and I'll probably be going back on a hiatus till I'm pain-free again, because I'm really tired of complaining all the time. Unfortunately, I'm not good for much else right now.

Thursday, November 13, 2008

Book meme

Just because I want to belong. Meme instructions:

  1. Grab the nearest book.
  2. Open it to page 56.
  3. Find the fifth sentence.
  4. Post the text of the sentence in your journal along with these instructions.
  5. Don’t dig for your favorite book, the cool book, or the intellectual one: pick the CLOSEST.

I considered doing this yesterday at work, when the closest book was Gödel, Escher, Bach -- but then I thought that would have been a bit wankerish. Today at work the book would have been either my co-worker's IIS 6 reference book or "This is Your Brain on Music: The Science of a Human Obsession". Since I'm home, the book at the moment happens to be one I haven't read yet: "On Writing Well, 30th Anniversary Edition", and the quote goes:

One sentence that explains the incident that the column is based on.

In other news, I was astoundingly tired today. Caffeine didn't help. Took hours to solve a problem that's normally in the 15-minute range. Going comatose in about an hour...

Edit: just to show how far the winner was from the next book:
Photo of the book in question
The next candidates would have been "Slack" (the bottom book) and "On Writing" (the one on the top).

Monday, October 20, 2008

Book delivery!

I wasn't expecting the package to arrive so soon, but it did: I just brought in a box containing nine new books -- well, actually, eight books and one booklet. I've unboxed the books, and I was just reading the latest mile-long Steve Yegge text, when this bit jumped at me:

if you're a programmer and you haven't yet read Gödel, Escher, Bach: An Eternal Golden Braid (usually known as "GEB"), then I envy you: you're in for a real treat. Get yourself a copy and settle in for one of the most interesting, maddening, awe-inspiring and just plain fun books ever written. The Pulitzer Prize it won doesn't nearly do it justice. It's one of the greatest and most unique works of imagination of all time.

Lucky me. One of the eight full-sized books is none other than the aforementioned GEB. :)

Sunday, October 12, 2008

And then some

My mood picked up considerably on Wednesday, when our lecture was shorter than usual, which meant I had time to sit and have lunch with a couple of my fellow students. It's amazing how much 45 minutes of idle chitchat with people I barely know can have that effect. But I'm glad it does. I'm also glad that I've managed to avoid isolating myself.

The appointment with el doctor was a refreshing change. He doesn't want to do the evisceration -- instead, he'd rather spend time looking for alternate ways to make the pain go away before we do something that drastic. Interestingly enough, none of those options were on the table with my previous doc.

I'm getting a mentee tomorrow -- that is, a new employee is joining my project and I'll be his mentor. (Interestingly, I thought "mentee" couldn't possibly be a real word, and so does Firefox's spell checker. But lo and behold, if you trust Wiktionary, it actually is.) In practice that means I'll make sure he gets all the info he needs to work in the project, like how to report hours worked, where to get access to different systems and so on. Nice to be getting a teammate. :)

Samuli keeps amazing me by writing thought-provoking blog entries that I read way too infrequently. I've known him for over nine years now, and the way he's grown into the person he is today is nothing short of stunning. I really miss having him around. I need to pay him a visit one of these weekends.

LinAlg exam is on next Wednesday. I'm thinking today I'll try to go through all the exercises we've had and make sure I understand the solutions. I'm pretty sure I'll pass the exam, but I'd like for it to not be a close call.

Tuesday, October 7, 2008

We interrupt this transmission to bring you the latest news

LinAlg course exam is quickly approaching. I've already decided I'm going to go with LinAlg II and Discrete Math next period, and see if I can just exam my way out of English. I feel like I have a relatively good grip on matrices, a rudimentary idea of what vector spaces are and some tools to deal with them, but I'm still sorely lacking the exposure to math in general I'd need to be able to see solutions to the problems I'm being dealt. Still, I guess the fact that I'm not entirely lost is something I can be proud of.

Work is getting interesting. I'm getting a new cow-orker on my project, been doing some preparations to reduce the amount of confusion and ramp-up in advance by trying to ensure he'll have a place to sit in and access to all the systems he'll need to work with. Not doing as well as I'd like in the Flex department, but I manage.

What free time I have left is mostly spent watching Buffy the Vampire Slayer with the missus -- she's pretty much hooked now, and I'm glad we've got something we can do together that doesn't take a whole lot of preparing. If it did, it might not get done at all.

I feel stuck in a weird place in my head where I don't really know who to identify with. It's easiest at work, since those are the people I spend most of my waking hours with, and luckily I've been seated with a bunch of people with whom I share, if nothing else, then at least a sense of humor. Ideologically speaking, it feels like we're worlds apart.

At the university, it's not as clear-cut. I have basically one person I talk to on a regular basis, and two semi-regular. Seeing pictures from the freshman events is a bit strange -- I wish I could have been there, but I still think I wouldn't quite fit in. It's just not possible to jell with people with whom one spends so little time.

Then there's all the other people I call friends. This schedule basically rules them out entirely, not that I'd see them very much anyway.

I know it's just a question of reaching out to people and keeping the bonds working, but it feels like it would take more effort than I can put in.

On Thursday I have an appointment with an eye surgeon. Am going to talk to him about the evisceration. The thought still gives me the chills, but chronic pain really isn't something I want either.

Wednesday, September 10, 2008

Radio silence

So yeah, unintended blog hiatus and what have you. First couple of weeks after my last post I didn't have much to talk about, and now I do but I hardly have the time.

Long story short: began my studies at the university. Way cool. Am starting off with some linear algebra, and looks at the moment like I might actually be able to pull it off. Doing a couple of mandatory "computers for dummies" courses at the same time.

Trying to manage a full work week while studying is um... exactly as hard as one might think, perhaps a bit more so. Somehow, I'm still kind of shocked. Then again, I'm also adjusting to waking up around 6:00 every morning, which may contribute to the problem. :)

The CS dept. got neat little Asus EEE 900's for all the freshmen this year. Lucky me. And I just got a new work phone, a cool Nokia E71. Which pretty much fills my gadget quota for the next couple of years -- since in addition to those two I've got my desktop, a Mac Mini, the Lenovo laptop and the Dell laptop from work. Holy lack of places to put these things, Batman!

Work-wise things are nice, especially now that the client and I agree on a schedule and a set of features to deliver in that schedule.

That's about it for now. Sleepy time!

Wednesday, August 13, 2008

And now for something completely different

On an entirely unrelated note, I watched The Devil Wears Prada yesterday, and despite the subject of fashion being rather far from my typical interests, the movie is really frigging good.

Also, Disturbed is finally coming to Finland. And I managed to secure tickets from the floor level, which means I have a fair shot at getting relatively close to the stage, woo!

Flex: dynamically sized clipping container

Here's something that took me two days to figure out: I wanted to have a VBox nested inside another VBox, which I shall call ChildOne and Parent, respectively. I wanted to add child components to ChildOne so that ChildOne would conjure up scroll bars on demand, which is what it does by default due to the clipContent property being true by default.

That was easy enough, apart from the fact that I also wanted ChildOne to fill up Parent except for a tiny bit at the bottom, say, 20 pixels tall, which would contain a button I shall imaginatively dub ChildTwo.

All the approaches I tried at first resulted in either ChildTwo getting squashed, ChildOne extending beyond what it was supposed to, Parent conjuring up the scrollbars or some combination thereof, until I figured out that I had to code around the issue.

The solution itself was simple: compute a fixed height for ChildOne from Parent.height - ChildTwo.height. But as it turns out, the heights weren't available during the construction of Parent, nor in the FlexEvent.CREATION_COMPLETE event handler. Fortunately, perusing the Flex documentation, I noticed ResizeEvent.RESIZE which is rather conveniently also fired upon the first layout.

The full solution, then, was approximately the following:

public class Parent extends VBox {
private var ChildOne:VBox = new VBox();
private var ChildTwo:Button = new Button();
public Parent() {
this.addEventListener(ResizeEvent.RESIZE, this.resized);
}
private function resized():void {
ChildOne.height = this.height - ChildTwo.height;
}
}

This example is reduced to the bare minimum, so it doesn't take to account things like paddings and margins and whatnot, but it may help someone. (Hi future me! Forgot this already?)

Note: I was originally under the impression that I should be able to do this with constraint-based layouts, but when I tried it, ChildOne no longer clipped its contents, opting to expand instead which then led to Parent clipping. This seems a bit strange to me, so mayhaps I was doing something wrong. If that happens to be the case, please let me know. :)

Sunday, August 10, 2008

Flexing the mental muscles

Whenever I'm learning a new language -- or rather, a new environment, because it's never just the language -- at first I inevitably try to coerce it into a model I'm already comfortable with. It's just the way my mind works. It usually feels very clumsy, which is the point where I start looking for clues on how I should be approaching the issue.

At some point, I read a blog post, article or bit of documentation that clues me in a bit. Then I try it out, and hit that "A-ha! So this is how things work here" moment. After that, the ride gets a lot smoother.

That initial befuddlement and subsequent feeling of victory is never limited to just one aspect of the environment, though. First, it happens with the language. Then it happens with something else, like the way you're supposed to handle interactions between GUI components.

My latest such experience has been with Adobe Flex. The language is somewhat familiar, being of the ECMAScript variety, but the libraries are most definitely not, and things like skinning components are a source of great bewilderment to me.

I've enjoyed dipping into something altogether new, although some design decisions made at Adobe do seem somewhat questionable, such as having a dedicated namespace for SomethingManagers.

I do wish there was a way to unit test Flex code with something like the Eclipse JUnit runner or a NAnt/Ant command line script. It doesn't seem altogether impossible, although I suspect all the MXML code would have to be compiled into ActionScript first. Any pointers that are *not* referring to FlexUnit are welcome -- I know of FlexUnit and that's not quite what I'm looking for. :)

Tuesday, July 29, 2008

Staking my claim

Well, my first gig at the new job is well into its second full week, and I've got to say it looks like I've got interesting challenges ahead. For one, I'm introducing unit testing (and TDD) into a codebase that was written without tests in mind. Fortunately I've read (and re-read, and then re-read again for good measure) Michael Feathers' Working Effectively with Legacy Code. It's a great source of working techniques.

I have to say, I find quite a bit of satisfaction in conquering an area of code, marking it as mine and covering it with tests. The small victories slowly turn into larger ones, and eventually I may even feel safe making changes.

I was particularly pleased when I had written the bits of a new feature (pluggable in place of an equivalent, pre-existing one) in a TDD way, and then after a while of slow but steady progress, the code rapidly converged to a fully working and more or less finished state. I had the benefit of knowing that this is the way it works, but my guide from the customer company was surprised and delighted.

There's a lot of work to do, but I'm pretty confident. :)

Blog Archive