I have moved my blog to Wordpress at theunixgeek.wordpress.com. I will still be checking back periodically on this one as well, though. 19 April 2009


Merging Mkdir and Cd | 280 Slides Interview | I Switched to KDE 4

clickable portals

Wednesday, January 21, 2009

Dictionary Print Panel

Has anyone else noticed that Dictionary.app's print panel doesn't include a print preview?

Monday, January 19, 2009

Microsoft Previews Future Windows UI

Microsoft seems to be previewing the future of the Windows UI with Office 14. Take a look at SharePoint's window border. It may be that, with Microsoft flattening the Windows interface in Windows 7 (as can be easily seen in the new Explorers - the file manager and Internet Explorer), Office is to follow suit. Besides a flatter and brighter ribbon, the Aero interface is to be flatter as well. 

Either that or the user who leaked the screenshot applied a special theme... 

Friday, January 16, 2009

Quasi for PDF Grouping

A while ago, I downloaded Advanced Linux Programming (it's available for a legal free download) in its PDF form. Each chapter was separate, and, due to alphabetical order, the appendices were earlier in the list than the actual chapters. This created a huge delay from when I opened the folder to getting to the actual file I wanted to read. Then I decided that there should be something to fix this.

Quasi is a very easy-to-use, step-by-step application. It starts by asking you which files you want to group together. You can select multiple files at once and later reorder them. When you go to combine the files, you're shown the final file to see if you like it or not. If you do, all you have to do is save it (and, optionally, apply a Quartz filter). If not, the file is automatically deleted off your hard drive.

Quasi is available for US$9.99 . 


Wednesday, January 14, 2009

Introducing Rational Raccoon

I have now founded a software development company (Rational Raccoon Software), and will be releasing a product soon. I am waiting for the product line to expand in order to more legally use the Universal Binary logo.

You can visit it at http://rationalraccoon.co.nr

Monday, January 12, 2009

Understanding Cocoa Notifications

Thanks to Martin Pilkington and Steven Degutis for helping out with this article!

Being a Cocoa developer, you are probably aware of delegates. Delegates are "helper objects" that run custom code when called by its object. For example, the class NSWindow has the delegate method windowDidMove:. If I have a Controller object with that method implemented and I set it to be a certain NSWindow's delegate via [myWindow setDelegate:aController]; then whenever the window moves, my delegate object will be notified of it and run the code in the windowDidMove: method's implementation.

The problem with delegates, however, is that an object can only have one delegate object, so it can't notify multiple objects of something at once via delegation. Also, you can't get feedback from all instances of a class, while with notifications, you can call a method when any window in your app is moved, minimized, closed, etc. That is the great part of a notification: notifications allow the notifier to notify multiple objects at once.

The two main classes used in notifications are NSNotification and NSNotificationCenter. NSNotification is very simple: it contains a name for the notification, the object that sent the notification, and an optional userInfo dictionary. But where the real magic lies is in NSNotificationCenter. With it you can basically do three things: add an observer, remove an observer, and post a notification. 

Code Dissection: Adding an Observer
Let's continue using the window moving idea. Take a look at the following piece of code:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(aWindowMoved:) name:NSWindowDidMoveNotification object:nil];

  • [NSNotificationCenter defaultCenter] is a shared instance.
  • addObserver:self sets the current class to be the observer of defaultCenter. This is useful in a controller class, but self can be replaced to any other object that contains the method referred to in the next argument.
  • selector:@selector(aWindowMoved:)  is the name of the method within the observer that should be called when the notification (in the next argument) is sent out. Selector declarations should have something similar to (NSNotification *)aNotification as an argument, so aWindowMoved: is defined as -(void)aWindowMoved:(NSNotification *)aNotification; in the observer's @implementation.
  • name:NSWindowDidMoveNotification is the name of the notification. You can find these in the documentation for objects that have support for notifications
  • object:nil says that any object that has an NSWindowDidMoveNotification notification can notify the observer. If you wanted to make this more delegate-like, though, you could specify an object, such as object:myWindow
Code Dissection: Removing an Observer
Removing observers is just as simple. The simplest way to remove an observer is like so:

[[NSNotificationCenter defaultCenter] removeObserver:self];

That should be pretty much self-explanatory. However, if you want to remove one observance and keep the rest intact, use the -removeObserver:name:object: method. Here are a few examples:

  • [[NSNotificationCenter defaultCenter[ removeObserver:self name:NSWindowDidMoveNotification object:nil]; removes self as the observer for all move notifications.
  • [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidMoveNotification object:myWindow]; removes self as the observer from move notifications from myWindow specifically.
  • [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:myWindow]; removes self as the observer from all notifications from myWindow
Other possibilities exist as well.

Try it out!
Write an application with a window and a panel. The window should have a check box saying "warn me when this window moves." When the window moves, have the panel appear with a message on it: "a window moved" if the check box is checked. 

Hint 1: Check Boxes are a type of NSButton. 
Hint 2: NSButtons need neither delegates nor notifications. Being derived from NSControl, they only use targets and actions.

Click here to view the answer to the exercise.

Saturday, January 10, 2009

Is Research the Best Part of Microsoft?

Here's something I was genuinely thinking lately: is Microsoft Research the best thing Microsoft has to offer today? Seriously, think about it. Forget Windows 7; forget Office 14; forget Live Search; forget the Zune. Here are a few things, oriented to both developers and consumers, that are currently being offered from Microsoft Research:

  • Songsmith - Ok, I must admit that the ad is really cheesy, but it seems like a feature that Apple should have put in GarageBand. It's easier to sing into a microphone and have the program make up the song for you rather than pulling out instruments and messing around with them."Songsmith comes up with a music that matches your voice," touts the ad, which seems very interesting. Even better would be a mixture of the two. (By the way, is it just me or is that a MacBook Pro they used, using a flower sticker to cover up the Apple logo?)  
  • Kodu - I'd bet a lot of younger children would like to write their own games on their computer. With Kodu, anyone (but it's being marketed for children) can visually develop a game without typing out any code. I'm not sure if you need some Kodu interpreter to run the games or if they can run as stand-alone application on PCs and Xboxe 360s, but it seems very enticing.
  • WorldWide Telescope - It seems that WWT (as Microsoft abbreviates it) is a sort of Google Earth for the rest of the universe. 
  • Boogie and Spec# - Boogie is an "intermediate program verification language" and Spec# is something similar, except it developed separately into a separate programming language. Neither of the websites make it very clear as to what each of the products is.
  • Coconut - a .NET library for working with matrix mathematics
  • Domestic 2.0 - this is more of a philosophical project that tries to design new user experiences based on their socio-domestic background. 
Sadly, many of the projects have incomplete descriptions, such as HDR Image Hallucination, Chalice, and  CAPTCHA 2.0 .

Besides these main projects, there are numerous other small projects being developed.  I think it's time for Micrsofot to drop Office with OpenOffice and Symphony (which is based on OpenOffice) as completely viable office suite alternatives and focus more on these interesting products that very few people know about.

Friday, January 9, 2009

Windows 7 Beta Review

So, I went onto MSDN, downloaded my copy of Windows 7 Beta (build 7000), and here are a few notes of what I think of the new version of Windows, specifically my overall impression of it, the new Aero and system-wide features, the interface redesigns, and the overall usability of the new operating system.
Setup is surprisingly beautiful for Microsoft's previous standards, especially the boot screen, which says "Starting Windows" and after a while little balls come flying out and turn into a flashing Windows logo, and the "Setup is checking your computer" part. 

I originally thought the taskbar would look too big, but it looks really nice and the look was well thought-out. When you hover over an inactive application's icon, a little blue light appears under it, with two lines on the side. I decided to launch IE. On hovering, a white light follows the mouse cursor and the background adapts to the app. It's nice to be able to close an app via thumbnails. It really reminds me of the dock in Mac OS X, or (as some Microsoft reps like to call it), a copy of the Windows 1 and Windows 2 desktop. Right...

As far as moving taskbar icons is concerned, GNOME has already had that for a while now.

The notification bar seems too empty. The icons are too small. Perhaps 2 rows like in KDE? on hover, a blue triangle appears under the icons.

Aero Peek isn't very obvious. You have to hover over the "Show Desktop" button. It can also be enabled when you hover over a thumbnail so you can see where the window is on the desktop.

Aero Snaps was already available in previous versions of Windows, but fairly hidden and called "Arrange windows horizontally/vertically" and "Cascade windows" instead of "Snaps."

Windows is still obviously document-focused instead of app-focused like OS X. If you have two windows of Word open and one of Paint, and you use "Aero Shake" (when you shake a window to minimize all the other ones), all other windows go down and all you have is a lone window. Very useful, though

Jump lists are nice. Not much to say about them, though, except there isn't an exact standard to what their content should be.

Control Panel has been revamped; the view is simpler, and finally, Wallpaper Slideshows are available (like in KDE and Mac OS X). Interestingly enough, wallpapers are now called backgrounds. Yet another feature copied from GNOME.

The new redesigned Paint is really interesting. The tools are clearer and there are new shapes. Unlike the Office apps, which have a big round button with the app icon that is the "File" menu, the file menu is a separate drop-down menu in the ribbon. There are now 4 different brush styles. Upon being created, a new shape is treated like an object, so it can be moved around and manipulated without messing with the rest of the image. What would be nice is to be able to go back and separately select that shape again. Now, it's more obvious that you can personalize the color palette. The bottom of the window has become more useful, easing magnification and with quicker access to selection size and overall window size.

There is still no spell checking in Wordpad.

Gadgets are now seen as separate Windows, which may go in front of others, closed, etc. I'm glad there's no sidebar anymore, and the new free gadgets remind me of KDE 4.

XPS viewer isn't IE and is obviously written in WPF.

Now, let's take a look at what the new Explorers have to offer:

  • Interface is too flat
  • there's a special toolbar just for web slices and bookmarks. a bookmark bar is what I've been waiting for for a long time.
  • on first open, you have an option to turn on Suggested Sites, a web slice that recommends sites based on your browsing history.
  • Nicely enough, the default search provider is Google (finally!)

Explorer (file browser)
  • brighter look
  • cleaner than the Vista explorer
  • you can now resize the space between the address bar and the search bar
Libraries are a bit strange. It seems like a plan to replace file folders, which still exist. It's a nice concept, but very strangely implemented. The Start Menu shortcuts link directly to the libraries. Even when clicking the user's name link, you get a list of your libraries. The only user folders MS expects to be accessed with frequency now are Desktop and Downloads. In fact, after going back to the user folder, what had been renamed in Vista do "Documents," "Pictures," "Videos," and "Music" have now been suffixed with "My" ("My Documents," "My Pictures," etc), like the older versions of Windows. However, Microsoft thinks users will rarely access their "user folder" anymore (even save dialogs offer you to save your files in libraries instead of actual directory folders).

I find it a nice touch that, unless you're hovering over the drop-down lists on the sidebar, the little arrows for the lists are hidden.
So,  there are a lot of new features, new looks, new designs, and Windows 7 is really stable (although it boots up rather slowly). It's still the same old Windows, though. It still has the same basic functionality since the one established in 1995, but the revamp is a nice one.

Tuesday, January 6, 2009

iWork 09 is Coming

It's official: iWork '09 is coming today. Apple's even already changed its name on their downloads page.

Monday, January 5, 2009

Today's Old Computer: Imlac PDS-1

It's been quite a while since the last time I wrote a "Today's Old Computer" article (click on the old computer portal at the top to see some of the other ones), so as I was paying the Old Computers Museum website a due visit, I came across a mostly-undocumented interesting machine called the Imlac PDS-1. This "professional" computer was released in 1970 and programmed in assembly language.

Upon further research, it's quite surprising what this "minicomputer" could do! Its graphics were completely vector-based (something modern operating systems only beginning to implement. As a further matter, I can't believe it's already 2009, 39 years ahead of 1970, and we're still dealing with raster graphics on our displays) and could do multi-window editing of text, graphics, photosetting. Even more surprising to some would be the fact that the Xerox Alto, which was designed in 1972 and constructed in 1973, was preceded by the Imlac PDS-1.

The Imlac had a sort of precursor to the mouse as we know it today. Instead of moving around a little round object and pressing a button, one would point at the screen with a light pen and press a pedal (funny that this should be mentioned - I came up with this idea last year or the year before but it seems to be 39 years old or even older).

Oh, and what's up with the portrait displays?

Either way, the Imlac PDS-1 seems like a computer such ahead of its time that it's quite surprising! Vector graphics throughout its assembly-based operating system (ok, that latter part maybe doesn't so amazing, but I still haven't seen a person or group bragging in this millenium that they wrote a completely vector-based operating system in assembly language), a precursor to the GUI, photosetting, and rather small compared to the sizes of computers in that time! RAM and other hardware specs don't even matter that much when it comes to talking about the Imlac. I'd like to see something like this today!

Image from the Old Computer Museum website

Sunday, January 4, 2009

Alpine and Mailing Lists

Alpine is a rather well-known email client. It stands for "Alternatively-Licensed Pine." The developers at the University of Washington (Seattle) wanted to maintain a free code base while keeping a close relationship to the trademarked Pine.

I like Alpine. It's really nice, but I only use it for my text-only mailing lists. That's because a lot of modern newsletters and personal email are filled with images. Sure, I know I could just download the images from within Alpine and open them with Feh, but then I'd need to try to piece together the images to see what part of the email the image belongs to... all in all, it would be some tedious work.

However, with text-only emails, Alpine has the speed and stability I need to quickly get to a message, read it, reply (if needed), or send out a new one in a way that is yet unmatched by GUI mail clients. Moreover, the clean interface makes using it all the more fun.

Why not try out Alpine? Most distros' package managers should have it, and it's easy to set it up for using your Gmail account and IMAP.

Saturday, January 3, 2009

New Features in GTK+ 2.15.0

Thanks to TuxMachines for helping this post give me over 1,424 total views today!

Two days ago (1 January, 2009) the development release leading up to GTK+ 2.16.0 was released. Here are the new features that will be available in the next release as far as widgets go (I've especially been waiting for GtkFileChooser to be able to show file sizes):
* GtkFileChooser
- Optionally shows file sizes
- Mounts volumes when necessary
- Picks better mime icons

* GtkEntry
- Can show icons at either side of the entry, which can be made
clickable, drag sources, etc
- Can show progress information
- Picks the best available placeholder character for invisible entries
unless it is explicitly set. See the invisible-char-set property
- Input methods work again in invisible entries
- Invisible entries can optionally display a caps-lock warning. This
can be turned off with the caps-lock-warning property

* GtkStatusIcon
- Uses an extension of the tray icon spec to negotiate RGBA support.
This is also supported by the GNOME panel. For details, see
- Supports scroll events, middle clicks and rich tooltips

* GtkLinkButton
- Respects user-defined tooltips
- Has a default url hook

* GtkBuilder
- Can construct menus
- Can associate accel groups with windows
- Child properties can now be translatable, e.g.

* GtkOrientable
- A new interface implemented by all widgets that have horizontal and
vertical variants

* Printing support
- Print-to-file can save to non-local files
- Page rendering can be deferred to a thread to avoid blocking the

- GdkKeymap emits a state-changed signal when the Caps Lock state

There are also new theming and translation features, as well as four newly-deprecated functions. See the mailing list announcement for more details.

Read Mail Really Fast

This is simply amazing. Click the image to view it full size.

Even the Small Talk will be Big

Maybe the rumors are true, and the iPhone nano is coming along. MacRumors has a shot of a banner somewhere in San Francisco. Small Talk... iPhone nano is small... Big news...?

Except it's IDG-sponsored and it's very similar to a MacWorld slogan. Who knows? Maybe they decided to match it up this year.

via MacRumors

Thursday, January 1, 2009

A Better Desktop Button for Ubuntu

In the bottom left of Ubuntu's bottom bar, there is a Show Desktop button. I never use it, though. If I need to show the desktop I usually just switch to another virtual workspace, so I replaced it with something more useful: a Window Selector menu.

With this Window Selector, all open application windows (including those on other workspaces) appear in this little menu, allowing me to quickly switch to another app without having to search every single workspace for it. Besides, it looks rather nice, as well :)