Matteo Agosti

Software engineer

Hints for Improving the Learning Process

As a software engineer I’m always challenged with new languages and frameworks, potentially of great use in my daily work. During the last 5 years, in fact, I spent several time (almost everyday) in learning new things. With this post I’d like to share my considerations on how the learning process could be improved. I am far from being an expert on learning methodologies and related-stuff, so consider this post more like a list of tips that works… at least for me :)

Add Spaces to Mac OS X Dock

I recently discovered that you can easily add spaces between Mac OS X Dock icons. Simply open the Terminal and run the following command:

1
$ defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'

To see changes you need to restart the Dock process:

1
$ killall Dock

You can drag and move the spacer between icons as you would do with app icons. If you want to add another spacer simple re-run the first command. An example of what you could obtain

Screenshot of a Mac OS X Dock with spaces

For geeks: if you want to add the spacer to the right side of the Dock (documents section), run the following command:

1
$ defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'

MySQL 5.5 on Mac OS X Issues Fixed

If you have recently installed MySQL 5.5 on Mac OS X you have probably faced some issues with anything that relies on libmysqlclient as, for example, the handy node.js db-mysql or gem mysql2 modules.

The problem lies into the fact that the system doesn’t know the full path to the library. To solve the issue, you simply have to setup the full path in your enviroment variables. Assuming you have a UNIX system with a Bash shell you could simply run the following command:

1
$ echo 'export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH' >> ~/.bash_profile

Compiling Ruby Extensions With Xcode 4.3

Today I decided to try out Octopress for handling my personal website. As always, things never go as smooth as it should be, otherwise where is the fun?

The major flaw I had to face was the failure in compiling some Ruby extensions, apparently due to missing header files and binaries.

My system currently runs OS X 10.7.4 with Xcode 4.3 and the standalone command line tools installed (the latter is not any longer packaged into Xcode and has to be installed manually).

After having checked that all required libs and tools were installed on my system I started to think on a path-related issue. Before Xcode 4.3, in fact, all dev related stuff was stored in /Developer, whereas since Xcode 4.3 everything is packed inside the application folder itself.

I found out the handy command line tool xcode-select whose responsability is to manage the path for Xcode and UNIX tools and decided to force the new path:

1
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/

That did the trick and the fact that you are reading this on Octopress proves its success :P