Saturday, January 19, 2008

I don't get the Apple Nation...

Truth be told, I never paid too much attention to the Apple Nation. Sure, I kept up-to-date on many of the products they release, but not because they were from Apple. It was more that I wanted to see what's the latest mp3 player and the iPod is one of the top choices, etc. This is just to say that I never paid much attention to Macworld other then read a news article here and there after the fact.

Since I got the Macbook Pro, I've been finding out a little more about Apple stuff mainly because I've been looking for software and utilities and since you can't go to any Apple-related site without hearing about Macworld, I actually paid some attention to Steve Jobs' announcements. This year there doesn't seem to be much revolutionary new products coming from Apple as compared to last year when they announced the iPhone. At the same time, though, the Apple fanbois made everything sound like Apple has just invented fire.

Macbook Air? It's a pretty neat product and while it might be something new in the Mac universe, sub-notebooks are hardly a new thing here in the rest of the world. Almost as soon as it was announced, Gizmodo did a comparison of Apple's sub-notebook with 5 other sub-notebooks. At most in the sub-notebook category, it has some evolutionary refinements, but the Apple Nation was cheering as if they've never seen a light portable notebook before...

Monday, January 14, 2008

Customizing my work environment.

I'm continuing to get more familiar with working with a Macbook Pro and am starting to customize it to suit my working style. The first thing was to get some parity with what I was used to in Windows. At work, I have two machines (Macbook Pro notebook and a Linux workstation) and two monitors (24" LCD and 17" LCD). I previously had a Windows notebook instead of the Macbook and had configured my system to be a three monitor system. The Windows notebook was on the far left and connected into a docking station. I used the notebook's LCD for Thunderbird, IM buddies, etc.

To the right of the notebook, I had the large monitor which is the extension of the Windows desktop and what I'm staring at most of the day (when I'm at my desk that is). Next to large monitor is the 17" monitor that is connected to my Linux work station.

There is only a single keyboard and mouse, and both are connected to the Linux workstation. By running a VNC Server on the Windows machine and a program call x2vnc on the Linux machine, I can move the mouse/keyboard cursor across all three monitors as if they were one and even copy-and-paste between UNIX-Windows apps. The only limitation is that Linux apps can't be moved off the the 17" screen and Windows apps can't be on the 17" screen, but effectively my one keyboard and mouse controls both computers.

Being so used to VNC, I tried to do the same thing with OSX. Imagine the above system except with the Macbook instead of the Windows notebook. At first I tried using Apple's Remote Desktop which is suppose to be basically a VNC Server. The problem is that x2vnc or any other vnc client I tried could connect to OSX. I then downloaded a VNC Server for OSX, but that didn't recognize the dual monitor display of the notebook+external monitor.

Fortunately, the solution was the open-source Synergy tool which does much of the same thing as x2vnc and has both a server and client for Linux and OSX. Basically, on the Linux workstation, I run the Synergy "server". On the Macbook, I run the Synergy "client" and now I can do what exactly the same thing as before with one mouse and keyboard.

Installing Synergy was a snap. On Linux, use whatever your app management tool might be (i.e. "yum install synergy") and on OSX use Macports (i.e. sudo port install synergy). The Synergy site has instruction on what the configuration file should be and then it's just a matter of running the programs on each machine.

With my physical environment ready, I started to tackle trying to get a good ToDo app for OSX. For me, a todo utility must be easy to access. I'm too lazy to have to move my hands from the keyboard to the mouse. ^^; I also want the data to be presented simply and non-obtrusively. It's surprisingly hard to find this combo. Even on Windows, I didn't have a great solution: I used Google Desktop's todo widget which required that I use the mouse to select the widget before I can type into it, but the look was simple and basic.

I tried a few Mac Todo lists and was going to go with DoIt since it had Quicksilver integration that allowed me to write items to the list with keyboard strokes... almost. The problem was that DoIt also requires you select a category from a drop down list before it adds the todo item, and for the life of me I couldn't figure out how to select the category without using the mouse.

I finally came across a mixed low-tech/high-tech solution. Quicksilver has an action called "Append to text file". Using a simple text file (i.e. todo.txt), I created a trigger and keyboard shortcut that when hit, let's me type a todo item that gets appended directly into the text file. To see my changes, I used a very neat little app called Geektool that display a transparent window containing the text output of anything log file, script output or image.

Todo List

One limitation of this setup was that I used Geektool's file type to handle the display of the todo file. This only works when the file is appended to at the end like typical log files. This means that if you edit the file with another application, the change doesn't show up. The solution is to not use "file" but use a Geektool "command" with a refresh timer. By using the command, "curl " every 30 seconds, it'll regularly update the window with whatever is in the text file. Not as good as detecting a change automatically, but works well.

Saturday, January 5, 2008

Eclipse IDE

I've looked at Eclipse on-and-off since the very beginning, but I was never compelled to use it for a variety of reasons. The last time I made a attempt to use Eclipse was a couple of years ago and it wouldn't start up for me for reasons I was never able to determine, so I just left it at that.

I decided to take another look at Eclipse again because 1) I've been hearing a lot of good things about it so I figure a lot of issues have been resolved, 2) I don't have any software for the Mac so the free open-source nature of Eclipse is a plus, and 3) I'm thinking I'm going to be doing some Java coding.

I went to the Eclipse site and downloaded the the J2EE package. The different packages just means they come with different sets of plug-ins. You can always download the most basic package and install each plug-in your want manually. I didn't want the hassle of doing something and then finding out in the middle of it that I was missing a plug-in so I grabbed the full J2EE version.

Installing and running it was as simple of uncompressing the archive and clicking on the Eclipse icon. While Java has made a lot of progress addressing performance issues especially on the server side, I wanted to see how it does on a desktop application that is stopped and started frequently. While I didn't do any real benchmarking, the IDE started up faster then I remember it is still no speed demon. Once started, though, the performance seems pretty good.

Eclipse has it's own set of terminology like perspectives, Team, etc. which takes a bit getting used to, but the features you'd expect in a modern IDE is all there such as code completion, syntax highlighting, code navigation, etc. One thing I really like is that it checks your code for you even as you type. When you open up a project, you can immediately see which directory/file/line has potential errors through the explorer pane. You can do a lot more with templates code assists that will help with some coding tasks.

Before I did too much with Eclipse, I found out about PDT (PHP Developer Tool) plug-in. This adds PHP support to Eclipse and was a project that originated from the makers of the Zend IDE. Since my current projects tends to be PHP-based, it peaked my interests to see if I can use this IDE to handle my projects.

Installing the plug-in is super easy with Eclipse now. Just go to the plug-in manager and add the PDT repository to it's list and tell it to install. A few clicks later, I had PDT in Eclipse that recognizes PHP files and my project directory. Unfortunately, I haven't had much more time to get beyond that. I still want to test the debugging tool, etc. but I'll have to do that later.

Thursday, January 3, 2008

OSX Networking

Setting up wireless connection was surprisingly easy and I was able to get it up in minutes, so points there for Apple. I connected the machine through the built-in ethernet at work and the performance was dog slow! I saw packet loss of about 70 percent so definite negative points. Initially I thought that there might have problem with the ethernet hardware but then I read online that Macbook Pros have problem if they are on a LAN that has 802.1q/vLAN. The problem is discussed here.

I hook the notebook on another network and it performed fine so it seems like I got bit by this same bug. I'm surprised that Apple still haven't fixed it, but I suspect this mainly effect corporate users which might still not be a big customer base for Apple to pay attention to.

Tuesday, January 1, 2008

Dev environment on OSX

I feel like I'm behind at work recently so I didn't want to start the new year at the office spending time configuring the new notebook. The baby was nice to me tonight and went to bed early so it allowed me to have the chance to get my development environment on the new Macbook Pro with OSX Tiger configured. Thanks to M in Ohio who saved me hours of time by pointing me to the right solution.

The nice thing about the OSX is that it is build on top of UNIX which is a developer's OS. You'll find that most open source tools are available and if not then getting it compiled from source is usually possible. I used compile everything from source including the kernel, but now that I am a lazy old man, I tend to prefer using some sort of package management solution that has the dependencies resolved. For Linux, I like the yum package management tool that sits on top of RPM. It beats the hell out of downloading the source and figuring out all the dependencies.

M pointed me to MacPorts as a similar repository/package management solution for OSX open source packages. It's really easy to use. Simply download the install package from the site, run it and you're ready to go. I did ran into one bug where it didn't create a .profile file for me so the path to "port" couldn't be found. I'm not sure why, but a quick look on the site and I knew which directories to add to my $PATH variable.

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

Don't forget to "source ~/.profile" to pick up the change.

With MacPorts installed, it was only a matter of grabbing the programs I needed for a web development environment: Apache2, MySQL, PostgreSQL, PHP5.

Installing Apache2:


  • sudo port install apache2

  • cp /opt/local/apache2/conf/httpd.conf.sample /opt/local/apache2/conf/httpd.conf

  • sudo /opt/local/apache2/bin/apachectl start

  • point your browser to http://localhost to see that everything is running.


If you want to automatically start apache at boot-up then do then:

sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist



Installing MySQL and PostgreSQL:


  • sudo port install mysql5 mysql5-server; sudo -u mysql mysql_install_db5 (to start the daemon: cd /opt/local ; /opt/local/lib/mysql5/bin/mysqld_safe &)
  • To automatically have mysql start: sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
  • sudo port install postgresql84 postgresql84-server
    To create a database instance, after install do
    sudo mkdir -p /opt/local/var/db/postgresql84/defaultdb
    sudo chown postgres:postgres /opt/local/var/db/postgresql84/defaultdb
    sudo su postgres -c '/opt/local/lib/postgresql84/bin/initdb -D /opt/local/var/db/postgresql84/defaultdb'
    (to start: /opt/local/lib/postgresql84/bin/postgres -D /opt/local/var/db/postgresql84/defaultdb)



Installing PHP5 with support for MySQL, PostgreSQL:


  • sudo /opt/local/apache2/bin/apachectl stop
  • sudo port install php5 +apache2 +postgresql +pear
  • sudo port install php5-mysql php5-sqlite
  • sudo cp /opt/local/etc/php5/php.ini-development /opt/local/etc/php5/php.ini
  • sudo vi /opt/local/apache2/conf/httpd.conf
    • add "Include conf/extras-conf/*.conf" to /opt/local/apache2/conf/httpd.conf

  • sudo /opt/local/apache2/bin/apachectl start


Installing Eclipse IDE:


  • Download the IDE from Eclipse.
  • unarchive it to whichever location you want to run it from (I put it in /Applications/eclipse).


With that, the an Unix development environment capable of doing web development with PHP, MySQL and/or PostgreSQL as well as Java/C/C++ development is all ready!

For a little more detail about the set up process, I stumbled on this nice post.

Using OSX... a few days later.

I've now had a few more days to use the MacBook and OSX 10.4. The first day was mostly getting familiar with the environment and it wasn't until the second day that I started to migrate data from my Windows XP notebook.

The migration turned out to be simpler then I expected. Part of the reason is that I tend to use open source applications which are often developed for multi-platforms so the data transfers easily.

For example, you can copy Thunderbird mail, settings and extensions directly from the Windows location (C:\Documents and Settings\\Application Data\Thunderbird\Profiles\) to it's OSX equivalent (~/Library/Thunderbird/Profiles/. The same can be said for Firefox.

Users of GAIM/Pidgin will most likely use Adium on OSX and since they share the same foundation, their IM archive share the same structure so just copy the "logs" directory over.

I then copied over "My Documents" to "~/Documents" where by default it is recognized by Parallel's XP instance.

All-in-all, getting everything over to the Mac has been pretty easy. I've found most of the apps I needed to have an OSX versions although I've still not found a good note taking program like Evernote (I'll give Yojimbo a try). I'm also still trying to understand how to configure the system to give me some of what I'm used to in Windows (such as displaying image thumbnails for graphic files).

Some annoyances with OSX include the sensitivity of the track pad. I tend to use my right hand fingers to move the pointer around, but my left hand stays near the keyboard. The track pad often senses my left hand and gets confused.

The keyboard on the Macbook Pro is pretty good, but I'm more used to where the CTRL (in the case of Macs, the Apple key) so there is some finger gymnastic action. The lack of a second mouse button is also annoying to a Windows/Linux user spoiled by the convenience of it. I've always wondered if Apple is just too proud to admit someone else could come up with good interface ideas and that's why they've stuck with the one button mouse.

The biggest annoyance is the screen and font! OSX's font rendering especially its anti-alias/font smoothing is plain fuzzy to my eyes and the Macbook screen makes it worst when you're not looking at it from a specific angle. This is a controversial topic as can be seen here and here, so I won't talk about it much here. A lot of it is personal preference, of course, but I've always had a hard time with the softness around some of the anti-alias text. I wish they just soften curves instead of everything. I don't understand why a solid dash line isn't just a solid black, for example.

I figured what I can do is just turn off anti-aliasing (Apple calls it font smoothing) or select a different system font. Then I found out that Apple seems to be to headed down the road of less user customization by restricting what fonts the system uses, etc. I read it was to make sure that users don't confuse the brand by customizing the UI to not look like OSX... I'm not sure if that is true, but I was surprised by the lack of customization available to the user.

My eventual solution was to download a small app called TinkerTool which exposes many of the hidden settings available but not exposed by Apple in the preferences tool. I was able to tell OSX to not use font smoothing for text greater then 12pt, to change the default fonts (not all parts of OSX respects this setting nor do all OSX apps, but so far it's been ok), and to use the Tahoma font instead of the default OSX font:

TinkerTool > Font Smoothing: "Turn off font smoothing for font sizes 16 pt and smaller"
TinkerTool > Fonts:
System: Tahoma, 13pt
Application: Tahoma, 12pt
Messages: Tahoma, 13pt
Labels: Tahoma, 10pt
Help Tags: Tahoma, 11pt

So now that I got my data over, my most essential apps installed, and the UI is not giving a headache to look at , it's on to the fun part of customizing the environment to suit my working habits!

Friday, December 28, 2007

Feeling the power of the Dark Side of the Force

At this point, I'm not sure who is actually the dark empire: Microsoft or Apple. Neither seems to be in the role of the "Rebel Forces" and neither seems to be as vast of an empire to warrant being called the Empire. I'd give the Rebels designation to the Linux camp.

Anyway, I've never been an Apple fan boy and I didn't like how proprietary their hardware used to be. Despite how their UI was touted from the get-go, I've always thought all the ones pre-OSX were pretty crappy in how they "dumbed down" the interface for the users. It wasn't until OSX was released that I even had a vague interest in a Mac and that interest was the result of Apple switching to a FreeBSD kernel as the underlying OS. To have a full UNIX system with all the tools AND a nice UI is nothing to sneeze at. Still, it wasn't enough to get me to want a Mac.

When Apple announced that they were going to switch to an Intel processor, that's when I started to take greater notice. Sure enough, not long afterwards, the ability to run Windows on Mac hardware became reality. Having the ability to run Windows on top of OSX with a UNIX base is the best of all three worlds and made the Mac an compelling development environment. To have this all on a notebook... well, that's enough to turn the heads of even the toughest critics of Apple.

So, was this enough to get me to give up my familiar tool set that I've accumulated over the years on Linux and Windows and to learn a new environment? Not really. The cost of switching is still too high for me from both hardware and software perspectives. However, if work gives me the opportunity to work with this platform then I have no objects.

Yep, you guessed it. I got a Macbook Pro from work which I'm now working to get my data transfered over from my Windows notebook. I'm learning the "Mac" way which is different experience from either Windows or Linux. We'll see how it goes.

Tuesday, December 25, 2007

Back in the Java again

One of the things I did when I joined Yahoo was that I put all my Java books into boxes and took them out to the garage. Java wasn't my favorite language, but I didn't dislike it either. I can appreciate some of the advantages that it brought to the table and how it simplified some of the grunt work that is required when using another language.

Thus, it's been a few years since I really did anything serious with Java and I decided it's about time to refresh myself as well as finding out what all has been changed. The newer things I've been hearing are Spring and Hibernate while a lot of the things I was using before like Tomcat are still around.

I picked up the book, "Beginning Pojos" by Brian Sam-Bodden to give me an introduction on some of these topics. It's been a decent read so far. I think the next thing I study more on is GWT.

Monday, December 24, 2007

Canon EF 70-200mm f/4 IS

My last trip taught me that what I'm missing in collection of lenses is a more general traveling lens. Carrying all those different lenses around was just too bulky and I ended up pretty much keeping the EF 28-105mm on all the time. However, because of the type of shots I was taking, the 105mm didn't have the range that I really wanted. This X-mas I finally decided to go for my first L-series lens to address the short coming of my collection.

Canon EF 70-200mm f/4L IS USM

I decided to go with the 70-200mm f/4L IS lens for a number of reasons. The reviews (and here) on the quality of this lens is superb and even though it doesn't have the f/2.8 of its renowned older sibling this is a much less bulky lens and 1/3 the price. I think the trade-off is worth it for amateur photographer like myself especially since I want to be able to carry this lens around when I'm on vacation.

I decided to go with the IS version even though it's a hefty premium over the non-IS version but I'd much rather invest in a lens then get photos that causes me to kick myself later. With this lens, I figure that my travel collection would be 1 prime (either the 28mm or the 50mm) and/or the 28-105mm and this one. Most likely I will try to stay with just 2 lens to keep the weight down.

I haven't had a chance to put it through its paces, but maybe the upcoming holiday will give me that chance!

Bears at Raiders

2733

I went to my first NFL game when the Chicago Bears came to play against the Oakland Raiders. I've seen the Bulls, Cubs, White Sox and even the Chicago Fire play but the one team I never saw live was the Bears, so I was pretty excited. Hearing the stories about Raider Nation and Raider fans, I wasn't sure if I should wear my Bears gear, but once at the stadium there was a surprising number of Bears jerseys. I guess because there isn't much of a rivalry between the Raiders and the Bears there aren't as much animosity for the visiting team.

It was a fun experience. The weather was great, the seats were much better then I expected (I could make out all the players on the field) and with only a few minutes remaining, the Bears staged a come-from-behind victory.

2736

If the Bears play the Raiders again, I'd definitely want to try to see them play again.