header

Torsten Curdt’s weblog

Off to Australia

It has been a bit quite on this blog lately. Not without a reason. Our team had quite a few exhausting weeks lately. So not time for blogging but still quite a few things to talk about. Hope I am going to find some time writing about them now.

For the next weeks some work and some traveling in Australia is coming up. I am really looking forward to that. As Marcus already blogged we will be near Brisbane for an offsite meeting next week. Then two weeks working in Melbourne. On a weekend I would like to go to Sydney again. After that… two weeks vacation traveling from Mackay to Cairns.

Awesome!

AirPort Express extending Linksys WRT54G

148794187 9ee96115cb t AirPort Express extending Linksys WRT54GAt home I am using a Linksys WRT54G router to give me wireless connectivity. But the house is quite big and it’s really not like I have wirless everywhere. So I thought of getting a bridge to extend the range. As I was blogging before you can increase the transmit power of the router …but that did not really do the trick for me – especially since I do not want to fry my access point. The recommendet max power was just not good enough.
After some investigations I found that it is -despite what apple says- possible to use that tiny little white airport express device to extend other non-airport networks. So all you really need is WDS support. Antonio pointed me to the excellent Sveasoft firmware for the Linksys.I had some problems getting my PPPoE working for T-Online but once that was working tried to connect my Airport Express.

First thing you need to do is to configure the Linksys. You will need the MAC address of your Express. Attention: you need to pick the right one! Of course it has two. A lot of people have spent a lot of time fiddling around with the wrong one.148794215 340530fb08 t AirPort Express extending Linksys WRT54GThe WAN address is written on the bottom of the Express. The wireless MAC is meant to be off by one. I found it safer to just connect to the Express and “ping” the gateway and then get the MAC from the arp table (”arp -a”). In the end using the Airport
Utility seems to be the best choice. Just connect to the Airport Express network. You want the “Airport ID”. Ok, back to the Linksys. Under the WDS tab you now need to register the Express as a LAN extention. Use the “Airport ID”. Also make sure the “WDS subnet” is disabled. Having “Laszy WDS” disabled works for me. Although with the new Firmware you also can choose WPA you have to use 128Bit WEP. After those settings are active you are ready to go with the Airport Express configuration.

148794255 027ba16338 t AirPort Express extending Linksys WRT54G148794296 9b6ead7f69 t AirPort Express extending Linksys WRT54GDon’t spend any time mocking around with the Airport Express Wizard – it just won’t work. Again use the Airport Admin Utility. On the “Airport” tab select the name you want. Actually it can be same like the network you are extending. I’ve chosen a different one because I want to be able to explicitly choose. Also because the Airport speakers are only available on that very access point. Make sure you select the same channel your Linksys is running on. Select “Create a Wireless Network” as wireless mode – not the client mode. On the “Internet” tab tell your Express to connect to the Linksys via WDS. Let him get a DHCP address from the WDS host and enable wireless clients.148794327 7a592b2659 t AirPort Express extending Linksys WRT54G148794364 2f1b5c645e t AirPort Express extending Linksys WRT54G
On the “Network” tab deactivate the DHCP server. On the “WDS” tab you define the WDS host and tell the Express to act as “remote base station”.

Well …so that should be it. Configure your Airport Express and after a while you should get a green light.

Why JavaDocs suck

It’s just a funny coincident that Martin Fowler lately blogged about the “code as documentation” approach when Marcus and I were discussing our javadoc and documentation policies.

Over the years I came to the conclusion that javadocs just suck! …not as a concept – but what most teams make out of it. Especially if they are enforced via a strict checkstyle policy. Have a look at the following code and javadoc snippet:


    /**
     * Comment for m_manager
     */
    private ServiceManager m_manager;

    /** HttpRequest */
    private HttpRequest request;

    /**
     *
     * @param manager sm
     * @throws ServiceException on error
     */
    public void service(final ServiceManager manager) throws ServiceException {
        m_manager = manager;
    }

The main problem of documentation is that it needs to kept up to date. So having it separate from the code is really hard to mantain. So javadocs make this a bit easier. Especially if your favorite IDE knows how to handle them. But looking at the above code …what’s the benefit of having those comments? It is just redundant! Usually we programmers -as a species- hate redundency …but why do we write such docs then? Well, we are lazy asses and we don’t want checkstyle to barf at us. …and the IDE will just generate it for us with a keystroke.

But taking a step a back and looking at this …useless comments just clutter the code and do NOT help understanding what’s going on. So what I found useful is to focus on the general concept of the class. Explain the algorithms and usecases on the class level. At the end of the day it’s going to be a developer that will look at the code. So understanding the general idea will help him much more and he we will quickly work out the details. Maybe it’s not what you’ve learned at university – but am I the only one that sometimes removes comments to get more condensed code and visually see what’s going on there?

So my few rules are….

  • Explain as much as possible at the class level
  • If you want to force proper javadocs with checkstyle do it only for non-private or even public scoped elements
  • Focus on self-explanationary names. Often that’s enough or even better than comments because the explanation is visible not only at declaration time but with every use.

Plug in, plug out

148794150 20b351c6dd t Plug in, plug outHm… now I had my first experience with the Apple support. To be honest so far the best support I’ve ever had (*knock on wood* …maybe I was just lucky) although the problem is not solved yet. I called them to get some details about the loooooooooong delay I get when plugging in a headphone into the headphone/line-out output.

Plugin …10 seconds silence while OS X seems to be a bit busy (doesn’t feel healthy) …then finally sound on the headphones. The other way round when unplugging.

I never thought this could be such big problem and called the Apple hotline. Actually I ended up speaking them for about an hour trying all differen kinds of resets. Thought I share what I’ve learned:

Bios reset
Remove battery and power adapter. Hold the power button
for about 5 seconds. ATTENTION: I was told NOT to do this
reset twice (without rebooting)
Update: Ctrl+Alt+Shift on boot seems to be another way

Audio and video reset
Comand+Alt+R+P as soon as the machine boots.

Safe mode (boot up with only required components)
Shift on boot.

Firmware Reset
Command+Alt+O+F as soon as the machine boots.
The Open Firmware console should show up. Enter the commands

reset-nvram
set-defaults
reset-all

The reseting did help a bit but it is still far too long according to the support.
When booting up in safe mode I don’t get any sound. No sound output or input devices are being found. The guy from the hotline said that this would be a really bad sign! …but actually it is the same for Marcus! (Any other reports welcome!) Would be a strange coincident.
In the end he wanted me to re-install my operating system …not very eager to do so. Especially since I probably need to do that in a few weeks anyway – when Tiger comes out :-D

Sharing files across platforms

As earlier reported I had some problems with my external usb disk under OS X. (just did not automount my extra large partition). In the end I did a backup of all the data and reformated my former FAT32 volume with HFS+. Then copied everything back. *sigh* Having all the data on a non-journaled filesystem did not feel good anyway …so in the end it was worth the effort. Although I have to say I was a bit surprised (disappointed?) that OS X does not support ext2/3 filesystems out-of-the-box. On my investigations I came across the following links. But be aware – I haven’t tried a single one just yet.

ext2/3 drivers for Windows:
free http://uranus.it.swin.edu.au/~jn/linux/ext2ifs.htm
free http://sourceforge.net/projects/ext2fsd
pay http://www.partition-manager.com/n_ext2fs_main.htm

ext2/3 drivers for OS X:
free http://sourceforge.net/projects/ext2fsx

ntfs drivers for Linux:
pay http://www.mount-everything.com
free http://linux-ntfs.sourceforge.net
free http://www.jankratochvil.net/project/captive

hfs/hfs+ for Windows:
pay http://macdrive.com/products/macdrive6