The weakness of my commuter bike

I have had my commuter bike for close to 4 years now. I have ridden about 11.000 kms on it and I think I can safely say that I have come to know its design’s weak point. We’re talking about a 2013 Giant Rapid. It has the same alloy frame as the given year’s Giant Defys, so I think this applies to those bikes as well.
The weakness is its headset. It has Giant’s own OverDrive steerer, which means that both headset bearings are ‘oversized’. This adds better control and increased handling, but it has a drawback. The bottom bearing sits in its integrated housing in the frame itself, and the gap between the frame and the fork is about 2-3 millimeters. This doesn’t seem much or out-of-the-ordinary, but since the wheel is pretty close to this –about 2 cms–, it means all dirt from the road will fly to where this gap is. Unfortunately this means that no matter how well the bearing is greased, after about 2000 kms it gets really dirty. My bike starts to have constant clicking noises when this happens. There’s no other way around it but disassemble the headset, clean all parts with WD-40, apply a great amount of grease again and get back to riding. It can get a little bit worse if you ride the bike in rain — this itself can cause the clicking noise.
This is not actually a big deal. After doing it a couple of times, you can go over the whole thing in about half an hour. The bike’s awesome to ride, so this little price I’m OK to pay. It’s just something that needs to be shared.

Small wins

I recently moved to a new team within the firm. I was “hired” as an architect/infrastructure designer: this is a team with close to the business and they’re lacking some hard-core technical/technological people. I was a really good match for what they’re trying to achieve. They (and now we) have an old calculation engine that has all the shortcomings from the last decade of software design and development: uses XML heavily, has too many abstractions and it tries to be too smart by allowing too generic things. I’ll be looking into redesigning this while also upgrading the overall architecture of the systems we own. I’ thrilled to do this as I think this is where I want to lead my career.
The first couple of days have been sent with getting familiar with the environment, people and everything. Just out of fun and interest I spawn up a JProfiler and run some huge calcs through the engine. Surprisingly, the top three hotspots were very simple functions – that were called way too many times. One of these was actually just returning the same value 97% of the time, but delegated all the calls back to the parents in the hierarchy. It took about 80 seconds while the calc only used 200 seconds CPU time. It was too apparent that this is the place to start. So I analyzed the code and added some caching where I knew the value can’t change, sparing the huge call chains. I managed to reduce the 80 seconds to around 1-2, dropping CPU usage by 40% for huge calcs (the optimization is not that significant or smaller ones, actually).
When I explained this to more senior people in the team, they were surprised that this was a hotspot – they never imagined it would even come up in a profiling. Then they really like the caching idea. Then the news started to spread, and when I got to talk to the head of the wider team, he already mentioned that he heard that I already cracked the engine and that we’re saving a lot of time :) I explained to him what happened and how it works and that it won’t be reducing time of calcs by 40% as we’re still waiting a lot for IO.
I think this was an easy small win for me: I knew what to do, did it and already made my name heard in the team. I’m not saying people should start playing the cowboy in their new positions, but it’s always worth it to show what you can do iff you have the chance.

Streak of bad luck

Since we have moved to our own house two weeks ago, our luck has left us:
1. Our new fridge freezes in the upper compartment, it’ll need to be fixed or replaced
2. A piece of gas equipment has broken, leaving us without heating and hot water for a night
3. I have wrongly wired money to my account, so I lost some money (see here)
4. Our car broke down today (it needed a new generator, leaving us with $290 less)
5. The alarm system for the house has been acting up, so I disabled it, so someone will have to reprogram it

I think that’s kind of enough for 2017, if I can choose, I’d go for an easier rest of the year. Despite all these bad things happening, we’re still healthy (as far as we know) and nothing irreversible had happened – if I consider it from this point of view, I have nothing to complain about!

My experience with Apple products that Just Work™

Today I wanted to install Windows on my MacBook Air. The wife needs to run a software on the laptop that’s not available on anything else than Windows. It requires proper 3D acceleration, so virtualization is out of question. I didn’t have a choice but to have a native Windows installation. This would’ve been a joy ride, considering Apple created Boot Camp, and things they do just work. Right?
First of all I needed a USB drive for some reason. I didn’t understand why it couldn’t create a temp partition with the install image. First, I tried using an SD card (which is, from the software’s perspective is just a USB drive), but Boot Camp was implemented by more clever people, so it simply rejected the card as a viable medium. OK, I dug up my cheap 64G flash drive from the bottom of the drawer, created the install disk and copied the Apple drivers to it.
The next step should’ve re-partitioned the disk so I have a new one that can be used by Windows. Boot Camp failed at this step. It didn’t tell me why exactly, so I thought that I could do this manually, I could even name the partition BOOTCAMP, hoping they wouldn’t check for anything else. Started the Disk Utility that comes with Mac OS, selected my drive and clicked the Partition button. To my surprise, the product created by the Kings of UX doesn’t handle me changing the partition size in the numeric spinbox, only by moving the handle in the pie chart. *SIGH*. OK, I’ll use that even though it’s much harder to size it exactly to what I want. After hitting Apply, it ran a quick disk check but found errors. Of course those can’t be fixed while you run the OS booted from the drive, so I rebooted in recovery mode to run fsck. After starting the partitioning process again (using the stupid handle to precisely resize) and hitting Apply, the check finished successfully, but. But it simply couldn’t resize the partition. That’s it, no meaningful error details. This is when I said, screw it.
I started looking around for third-party software that would accomplish this hard task. Unfortunately these ranged from $30 to $50 in price, but I didn’t intend to pay for something that I’d only use once and should be available fro free. A hint I read is that probably the volume was fragmented and this wasn’t handled by Apple’s own software. Hurray! I’d need to defrag the drive first, then re-partition. Eventually I decided to revert to something I knew, GParted. It can’t run on Mac OS natively, so I needed a Live USB drive to boot. Went to look for a second USB drive in the drawer and I created the Live GParted disk. I booted it and using the ugly-but-working UI I resized the partition (I could type in numbers that meant megabytes!), created a new one, formatted it to NTFS and I started to feel the accomplishment. Oh, how wrong I was.
Apple silently converted all simple GPT disks to CoreStorage, aka a Logical Volume Manager. This was needed so they can implement FileVault and these hybrid HDD/SSD disks. It kind of makes sense, although nobody asked me if I wanted this or not, or even if I’d ever need it. Not only me, but GParted was also not aware. Changing things around basically broke all the meta data this thing needs. The MacBook started not to boot up. I tried to analyze the kernel’s log, but googling the error message didn’t reveal much. I went over about 10-15 blog posts/Apple forum posts, but nothing really helped. I slowly started to give up on the data on my original partition. Then I started to look around in the list of available commands the command-line version of diskutility supports. I’ve found an interesting one: ‘corestorage revert’, which should revert a CoreStorage Logical Volume to regular GPT partitions. I said what the heck, I can’t lose my stuff even more, I ran the command. Everything related to CoreStorage was gone from my drive. I rebooted.
Voila, the OS managed to start up. I started to feel a little bit better. I went back to Boot Camp to finally finish the installation. I was naive, haha. It said that it couldn’t partition the disk because it needed it to have only one partition. What?! Great. I need to add the LVG back, so I can arrange the thing to only have one partition logically. So I did. The diskutility can do this in a non-destructive manner. I issued the command. I rebooted again to make the new Logical Group online, reran Boot Camp again, got the same error. I went to Disk Utility, and tried to completely remove the new partition (I planned to give Boot Camp only the space, not the partition), but when I deleted it, it always resized the HFS one to occupy the full available space. A quick round of googling didn’t help, nobody had this issue. So I rebooted the GParted USB drive once again, hoping I wouldn’t need to replay the mess with CoreStorage. I deleted the partition and for some reason this time CoreStorage didn’t go haywire and I could straight up boot into Mac OS. Gave Boot Camp another chance. I think you can guess if it succeeded or not. Crap!
I got angry at all those very clever engineers behind Boot Camp, so I thought that I’d simply install Windows on my partition without that stupid thing. I did a google search that revealed that this should work. So I rebooted from the Windows USB drive and installed Windows. Everything succeeded, even the drivers added by Boot Camp installed correctly. The last test remaining was checking if I could still start Mac OS. I could. Pheww, such a relief!
This is my story with the great Apple User Experience. It reminds me of the time when I had a course at the university about J2EE. It all works perfectly until it simply doesn’t, and you can’t possibly fix it because of the endless layers of crap (abstraction!) added to it. Apple managed to close the gap to Sun in this regard, for sure.

My laptop has an uptime of 451 days

screen-shot-2017-01-16-at-20-04-55
This means that I’m probably the worst kind of user. I don’t care for any security updates, maintenance or anything else, I just want to use the machine. Ok, it doesn’t need to handle very high workloads, mostly browsing and the occasional compiling when I’m presenting or on meetings at the university. Still, I think all sys admins and ITsec people would frown upon me for this.