Ubuntu 9.10 On A Macbook 5,1 (2008 aluminum unibody)

November 26, 2009

Here’s what I did to get Ubuntu 9.10 running as a dual boot alongside the default OS X installation.  They are a little different from what is detailed on the Ubuntu help site because 9.10 uses a new version of Grub that is not currently compatible with rEFIt version 0.13:

  1. Make a backup of any critical files on your computer.  If something goes wrong, you may have to reinstall OS X.
  2. In OS X, run the Bootcamp Utility (in Finder -> Applications -> Utilities) to create a new partition for windows.  I made mine 70GB.  This took several minutes of nervous waiting while it set up the partition.
  3. Reboot to the Ubuntu 9.10 CD.  Hold the Option key when starting up in order to get the option to boot to the CD.
  4. Start Ubuntu in the LiveCD mode (something like “Start Ubuntu without making any changes to this computer”).
  5. Once Ubuntu is started in LiveCD mode, open the gparted partitioning program in System -> Administration -> GParted
  6. Delete the new windows partition and apply the changes.  You will now have a bunch of unused space at the end of your disk.
  7. Close GParted.
  8. Double click the “Install Ubuntu 9.10” icon on the desktop.
  9. Continue through the installation wizard until you get to the Partitioning step.  Choose the “install to the largest continuous free space” option.
  10. Continue to the final “Ready To Install” step.  Click the Advanced button.  Check the “Install Grub boot loader” checkbox, and select /dev/sda as the Grub installation location.
  11. Install, and reboot.
  12. To boot into Ubuntu, press the Option key while starting up to enable the Bootcamp chooser.  Ubuntu will be the “Windows” option on the right.

Skype On Linux With A QuickCam 9000

September 25, 2009

With my new job I’m doing mostly Java and experimenting with Erlang and Ruby.  One of the many benefits is that I’m no longer tied to windows with .NET development.  I inherited an upgrade machine this week so I decided to try running Linux full time.  I chose Ubuntu 9.04.

One of the tools my team uses for communication is Skype.  Skype 2.1 Beta for Linux seems to work very smoothly.  Installation was easy, I just download the version for Ubuntu from the Skype website (even though it was compiled for 8.04) onto my desktop, right-clicked the .deb file and choose “Open with GDebi Package Installer.”  It had to install a few dependencies, none of which seem to conflict with anything already installed.

The only hiccup was I couldn’t get Skype to receive sound from the Logitech QuickCam 9000 usb webcam I have plugged in (my only microphone).  Taking some hints from this forum post, here is what I did to solve it:

  1. Install the Pulse Audio Manager package:  $>sudo apt-get install paman
  2. Run the Pulse Audio Dev Chooser (which puts a headphone icon in the system tray):  $>padevchooser
  3. Left-click the padevchooser icon and go to “Volume…” then select the Input Devices tab.
  4. Mute any other microphone devices and adjust the input volume for the webcam device.
  5. Close the Volume window, and go back to the Dev Chooser Icon, this time clicking “Manager…”
  6. In the Devices tab, find the input device that belongs to the Quick Cam 9000, select it, then click the Properties button.
  7. From the properties window, select the value of the Name property and copy it to the clipboard (in my case it was “alsa_input.usb_device_46d_990_9692CEE7_if2_sound_card_0_alsa_capture_0”).
  8. Finally, go back to the Dev Chooser Icon and click “Default Source” –> “Other…”.  Paste in the device name from your clipboard, say okay, and restart Skype.  Hopefully it works!

Otherwise, the sound and video quality is very good and I haven’t had any crashes.  I can receive screen sharing from other platforms, but sharing my screen is still not supported.

Developing .NET On A Mac – Performance and Productivity

November 11, 2008

I’ve had a number of questions about performance since I posted about ctrl+alt+insert and Resharper from VMWare Fusion.  Essentially, performance is totally acceptable.

I kind of have two parts to my answer – the speed of Windows when running within VMWare Fusion on a Mac, and also my overall productivity of having OS X as my main operating system.

As for the hardware, I have the slower hard drive (5400pm), 2.53gz Intel Core Duo processor and 4GB of RAM.  I’m running Windows XP on my virtual machine (not installed in Boot Camp).  So far I’ve had plenty of memory, and the processor remains pretty idle.  The slower hard drive is definitely the performance bottleneck, but really this is to be expected on any laptop, especially when it comes to compiling large projects.  I will most likely upgrade to a faster hard drive in a few months but it has certainly not caused any pain yet.

Opening a fresh copy of the Lucene.NET trunk source tree in Visual Studio, including initializing Resharper, takes 20 seconds.  Doing a full Rebuild on the solution takes 3 to 4 seconds.  How does that compare to what other people experience?  Considering how many big servers run on VMWare, I cannot imagine the performance degradation of VMWare is very high.

Frankly, I never feel like I am waiting for Visual Studio any more than I do at work, and the “Resharper break” at startup is not noticeably any longer than my other computing experiences.  Installing VMWare, Windows, Visual Studio, and Visual Studio SP1 took a whole afternoon, but I also spent that time busy learning how to use a Mac.

But aside from performance, I feel that I myself am a faster and better computer user in OS X.  I’m doing all of my normal computing (email, finances, blogging, office, music, etc.) on the Mac side, and only run the virtual machine for Visual Studio, Windows Explorer (Tortoise SVN) and Internet Explorer.  I’m almost always in the Unity view, which makes Windows apps appear in normal OS X windows and puts the Start menu up on the top OS X application menu.  VMWare has done a very nice job making the line between the two OS’es as seamless as possible.

As for stability, Windows XP doesn’t seem any more unstable when running as a virtual machine as it normally is.

OS X has not crashed or been crippled on me yet, even when under an extremely heavy load of multiple Firefox windows, Garage Band, VMWare + Windows + VS, Apple Xcode, iTunes, Open Office and Chat all running at the same time.  I’ve put it in sleep mode and back eight times or so, and I have manually rebooted it only once or twice so far.  I’m not sure that I have powered it off yet.  There is no way Windows XP would have lasted even five days under the same stress.

I hadn’t really used a Mac since high school when they were all pretty much black and white, so I had a very steep learning curve with the new operating system.  It’s different, especially with the keyboard and shortcuts.  After a month of use, I’ve come to really love OS X and cannot imagine switching back.

The trackpad gestures on the new Macbook (and Macbook Air) are a joy to use.  When I first bought my laptop, I assumed that I would go right out and buy a bluetooth keyboard and mouse.  But it turns out the trackpad is so powerful that I don’t really want a mouse at all anymore.

Setting up a shared wireless network with an Airport Express and Airport Extreme is super easy and the services are really stable — I have automatic external backups with Time Machine and my Airport Express is plugged into my 1960’s phonograph.  I stream the sound from iTunes and Pandora to my home stereo from anywhere in my house.  All of that was just a matter of running a configuration wizard and installing an app called Airfoil.

All in all, I think I am more productive with my current setup than I ever was just running Windows.  The built-in Spaces and Exposé features are awesome.  When Windows is rebooting, I switch spaces and read some blogs or catch up on email and whatnot.

There’s also just something special about being able to run software written for Windows, Linux, and OS X all at once on the same machine.  It really lets you get out and expand your horizons as a programmer and a geek.

For example, one of the biggest unexpected pleasures so far has been discovering how amazing the OS X Cocoa development platform is.  The frameworks are complete with a nice API’s and their patterns enforce an MVC architecture.  The drag-n-drop UI designer rocks and the generated “codebehind” type classes are much closer to what I consider to be sane code than what VS.NET generates for WinForms.  They also have a built-in profiler that is one the nicest I have used.

After exploring the Cocoa framework, it became very clear to me how Apple has developed so many impressive and stable products in such a short amount of time – the iPod, a whole new OS, the iPhone, and the iPod Touch are all relatively young products and all of them have been ground-breaking.  I don’t know who their technology and patterns evangelists are, but I’ll wager that they’re sharp, vocal, and have apparently done a great job selling people early-on about how to create frameworks with lower technical friction.

So to conclude, yes, Visual Studio is probably a little slower here in Alt.NET Mac-land, but I’m not convinced it has anything to do with OS X or VMWare — I am running on a 5200 laptop drive, after all and it’s only highly disk-intensive operations (like installing VS.NET) that seem slower than I am used to.  But any performance loss is easily overturned by the other productivity gains I’m seeing by using OS X.

I hope this stuff helps people in making their decision.  I am very willing to talk with anyone via email or phone if they have questions.  I was pretty unsure about the whole thing myself, and the decision took about six months to process before I went ahead and jumped off the cliff.  So far, I have no regrets.  It’s embarrassing to admit, but I have totally become a Mac fanboy.

Developing .NET On A Mac – Resharper Alt+Insert

October 28, 2008

I’ve recently switched to a Macbook Pro and am doing my .NET development using VMWare Fusion.  I love it and it’s working very smoothly.

So far the biggest headache I’ve encountered is that I couldn’t figure out how to execute the Alt+Insert “Generate…” Resharper shortcut.

I found a few different posts with suggestions, neither of which worked for me for some reason.

If they don’t work for you either, then maybe you can try what I did:  Manually map the Fn+return combination to the Insert key within the VMWare Fusion preferences.

Step 1. Open the VMWare preferences panel from the “VMWare Fusion” menu,
Step 2. Navigate to the Keyboard & Mouse panel and then the Key Mappings subpanel,
Step 3. Click the + on the bottom left to add a new mapping,
Step 4. In the From: area, select input textbox and enter Fn+return  (will be displayed as “Num Pad Enter”).  Then choose “Insert” from the To: dropdown.

Now I can open the “Generate…” Resharper command with the Fn+option+return key combination.  Much better.

Re: If… (Time is the ultimate YouTube Audio Preview Moderator)

October 15, 2008

Jeremy Miller posted today about double-checking his tests when they pass on the first run because something must be wrong.

I definitely empathize with that. Lately, having a test pass the first time is one of the most uncomfortable feelings I get as a programmer.

I have oh-so-many memories of times when I said something which in retrospect is embarrassingly stupid and naive. Memories like these remind me that Father Time is the real youtube audio playback moderator.

One such episode was back in October of 2000 when I was a very young PHP developer. I turned to my friend Ben-the-sysadmin and said:

Dude! I just wrote 700 lines of PHP and ran it in my browser…not a single error!

Only the wind knows how many bugs are still in that 700 lines of error-free PHP (which is still used 8 years later).

The recent Me says things like, “That just can’t be right…it’s highly unlikely that code is bug-free.

Just like Adam was hit with the proverbial door on his way out, I’ve grown into a cynical test-oriented programmer. Nowadays I cringe at the thought that I was naive enough to consider writing 700 lines of bug-free code in one swipe a good thing.

So the recent Me also says things like, “All 307 tests still pass, so it was probably okay to store that data in separate files instead.” Much better, I think.


April 18, 2008

Joel (on Software) and Jeff Atwood are starting up a site called stackoverflow.com meant to be a free Q&A forum for helping to improve the collective knowledge on writing good software. It’s an exciting idea and I hope it’s successful!

Discussing Joel’s post at work, the head of our technology group asked me what I think of the site’s odds for success. I have a mixed response.

I think the traffic and volume of helpful solutions will be high if they can score well on google searches for things like “ASP.NET renders invalid xhtml”. In my experience that’s the best way to find solutions to daily problems, despite the questionable help from sites with which Joel would like to compete.

Joel says there is a problem with too much poor software, and the reason is that people aren’t buying software books.

People I talk to aren’t buying computer books anymore because the technical books are outdated by the time they reach the shelves and they’re too expensive to be continually refreshing your library. Nowadays, all of my technical learning comes from blogs, online documentation like MSDN, and by exploring the source code of good open source projects (like StructureMap, Hibernate and Castle).

I guess don’t see disappointing book sales as the problem itself. I see it as a symptom.

The real problem is the drastic onslaught of .NET development shops. In the past four years or so, .NET has stormed the market for mid-size companies who are growing into the need for robust software. And just like a puppy growing into its big feet, there’s lessons need learnin’.

The problem with .NET owning this HUGE market is that more than half of the developers come to it from VB and Classic ASP. I’m not saying VB and ASP are bad, but the two platforms are targeted for projects with a “let’s just get it out there ASAP, who cares how it runs next year” type of rapid application development.

.NET clearly began as a “rapid” development solution, and Microsoft has softly continued that tenor with things like drag-n-drop designers and providing “enterprise” tutorials with hard-coded sql statements embedded in the xml content of .aspx pages.

The thousands of new programmers are .NET’ers, and they’re being indoctrinated into the sloppiness of rapid application development under Microsoft’s “Enterprise” Practices. The demographic of apprentice programmers we expect to buy computer books like Joel’s has become non-existent simply because it’s not a common practice for .NET developers to wholeheartedly pursue the craft of quality software.

The kind of crafted software that Joel is trying to cultivate is more like the “we’re going to have to mature this into an invulnerable system and live with it for the next 10 years” type of enterprise development. Joel’s kind of software requires a tremendous amount of thought, discussion, discipline and practice.

There are some excellent conceptual books out there that instruct people on how to develop flexible, robust software. These books are not technical in nature and will never become obsolete.

I feel pretty strongly that these books are required reading for any software engineer who wants to be taken seriously. It is just too difficult to believe someone knows what they’re doing as a programmer when they don’t have battle-weary copies of The Pragmatic Programmer or Patterns of Enterprise Application Architecture on their desk. It’s like trusting a corporate accountant who’s never read any of the standards written by the Federal Accounting Standards Board.

For me the good news is that .NET also has a growing contingent of people who come from the worlds of C++, Ruby, Smalltalk and Java. These platforms tend to be more conceptual in their practices and consequently their young developers have been indoctrinated into the far-sighted planning of Martin Fowler, Kent Beck, Joel Spolsky and Dave Thomas. These souls are the remaining survivors of Joel’s lost demographic.

I’m excited by the incredible growth in volume of the ALT.NET mailing list, a forum for .NET developers who want to study the craft of software and are willing to look outside the bounds of the status-quo for more elegant solutions.

Microsoft is also helping the cause with its recent projects such as an Object/Relational Mapper, an xUnit-like unit testing framework, and a highly testable Model-View-Controller web application framework.

It seems the tide is shifting and an increasing number of the “quick and dirty” .NET’ers are learning how to become students of software design. As this happens, I think we’ll see a proportional growth in the sales of books like the ones Ayende recommends.

Shortly thereafter, we’ll see an overall improvement in the quality of software, and saying things like “WinForms databinding doesn’t belong in our domain model” in a .NET shop won’t get you blank stares or downright excluded from architecture discussions. Heck, there might even be architectural discussions!

The Robustness Requirement

April 14, 2008

There comes a point when writing professional software that a system simply must have the following characteristics, which I collectively refer to as The Robustness Requirement:

  • Data Auditability: Every non-system configuration object record must contain fields to capture when and by which user the record was created, as well as when and by whom the record was deleted. “Deleted” rows should either remain and be marked as “deleted” or be moved to a _history table.
  • Scalability: Services should be easily moved to additional servers and the web front-end should be clusterable.
  • Cacheable: Data should cached in a distributed manner.
  • Sophisticated UI: User interfaces should have a level of sophistication that intuitively displays invalid fields and error messages.
  • Logging: The system should have a deeply-rooted logging system where all messages are aggregated in a searchable manner. Logging levels and filters should be able to change on the fly without interrupting any services.
  • Fault Tolerance: The system should be relatively fault-tolerant so that services can automatically restart, and helpful messages are displayed to the user while services are unavailable.
  • Permission-based Security: Almost any action should be permissioned on both a user and role basis.
  • Data Storage Scalability: Data persistence read/write operations should be specifically routed through read-only and writeable connections so that read operations can be separated and distributed across multiple servers (and consequently be scalable beyond just one data server).
  • Vendor Agnostic: Care should be taken to hide any vendor-specific implementations as much as possible so that service vendors can be changed with minimal effort. This includes the database platform. Too many software shops become tied to a specific platform or vendor.

Admittedly, this is a little bit of a Xanadu type of place to be. Hardly any system actually meets all these requirements, but it should be a conscious decision by the team to abandon any of the above requirements.