Archive for November, 2006

Java finally opened up!

Thursday, November 23rd, 2006

After much debate and talk Sun Microsystems finally released part of the java platform under the General Public License (GPL) . While much has been said about the GPL, I like its insistence that adaptations or improvements made to the code must be made available for no charge.
Components available today include the HotSpot V.M. and javac (the java compiler). I’m particularly looking forward to getting my hands dirty with the compiler. A large propoirtion of the code is set for release in early 2007, and should be buildable from source.
I’m genuinely excited by the move, but my foremost concern is that the platform remains consistent and doesn’t diverge too much though as the write once run anywhere nature of java is one of its best features.

Technorati Tags:

Adding files to Subversion

Tuesday, November 21st, 2006

I picked up this tip when I was beginning to work with Ruby on Rails and Subversion. I added the following alias to my .profile file

alias svnaddall=’svn status | grep “^\?” | awk “{print \$2}” | xargs svn add’


This command takes all files in the present directory and flags them to be added in the next commit. This saves adding each of the files one-by-one. You don’t just have to use the command for Rails either- use it for everything. I do!

Technorati Tags:
, ,

Text selection on OS X kicks ass!

Saturday, November 18th, 2006

I’ve just found out about a really neat trick at creativebits. If you hold the option key and drag you can select a freeform area of text. Cool!

Technorati Tags:

Please help, I’m missing a link

Thursday, November 16th, 2006

I’ve lost a link. It happened when I was browsing away, jumping from site to site, as you do. Anyway back to the matter at hand. The link I have in my mind refers specifically to a tool that backs up Xcode projects to a zip file. Does anybody know the tool I mean? Please get in touch!

Leopard looking tasty

Wednesday, November 15th, 2006

The new screen shots for OS X 10.5 are looking pretty sweet, I cant wait for it to outdate Vista upon its release.

Sockets and IOException

Wednesday, November 15th, 2006

I’m writing a dependable system. I’m having problems:

  1. I’m writing it in java. (Yes I know it isn’t Cocoa, but I’m deploying cross-platform)
  2. I have a thread to deal with server communication. (Thank god for synchronized methods.
  3. The communication thread spawns another thread to send out a keep-alive ping. (Can’t I just set a reasonable SO_KEEPALIVE time, instead of 2 hours?)

When I close the server down at the network end, the ping thread continues to write my ping object to the output stream, without throwing an exception. How on earth is this even possible? Answers on a postcard, or leave a comment below……..

Technorati Tags:
,

Cool Backgrounds

Tuesday, November 14th, 2006

I’ve just come across some cool background images courtesy of Adam Betts. I like a nice plain background, and this hits the spot for me!

X11 forwarding tips on Mac OS X

Wednesday, November 8th, 2006

I have found X11 forwarding on the mac to be excellent, however there is one tip that I’d like to share.
I have used both the -X and -Y flags as arguments to the ssh command, and found -Y to be faster every time. So when using X11 forwarding on OS X remember to use:
ssh -Y adam@myserver.com

Technorati Tags:
,

The Human Interface Guidelines and Interface Builder Annoyances

Wednesday, November 1st, 2006

I’ve already gushed about how I’m learning to love Interface Builder but there are still some things that I find annoying.

  1. Toolbars
  2. If Interface Builder is supposed to be WYSIWYG editor, then why can’t I create my toolbar in Interface Builder? I could then preview my complete user interface in Interface Builder. Why on Earth should I be expected to write *so much* code to accompany a mock-up of demo GUI?

  3. Resizing Springs
  4. It took me ages to get the hang of those darn springs! Is the fixed position relative to the enclosing view or the window? How many people get caught out by this every day? I actually think that the spring metaphor is a good one, but I think its detail as presented in the sizing window of the inspector could be more clear.

  5. Consistent Look and Feel
  6. In the first instance I think that using a standard widget set is fantastic. This provides fantastic consistency between applications, and really reduces the burden on the user. So why does Apple insist upon changing the look of an app at every release? Take the latest iTunes for example, with its darker toolbar. It looks different to Mail, which both look different to Safari’s metal toolbar. Each time Apple releases a new look the independent developers rush to produce something “similar” such that their app is not deemed to look obsolete.

  7. Human Interface Guidelines
  8. Is anybody actually following these anymore? John Gruber doesn’t think we should blindly follow them. Daniel Jalkut has a great article on where we go from here. As mac users we’re spoilt for great looking and easy to use GUIs. But I have to ask why does Apple insist on
    writing the Human Interface Guidelines when they themselves violate them so frequently. I struggle to think of a single Apple application that obeys all of the HIG.

In short, I am learning to combine the visual approach with a hand-coded approach. There are a lot of things that Interface Builder does well, especially when combined with bindings. However, I can’t help but feel that Interface Builder in its present state is only half the tool it could have been.

Technorati Tags:
,

Do not fear the NIB!

Wednesday, November 1st, 2006

In all of my Cocoa adventures to date, the creation of graphical user interfaces (GUIs) using Interface Builder has been both the best part of the experience and the worst. Coming from a java background I had previously hand coded all of my GUIs, and in the process have gained a valuable insight into the dreaded GridBagLayout manager (yes I am aware of the various java GUI designers, but I have never found one that I like using).

In the early days it was fantastic to create a native GUI with ease pushing the components around, conforming to Apple’s human interface guidelines was a mere snap away. I was blown away, I was able to take charge of tables like never before! But as I began to understand a little more Cocoa and move away from the tutorials I got a little lost. Where do I put this object? Should I instantiate it in the NIB or from the code? I did (and *occasionally* still do) miss connections, and then wonder why things aren’t happening.

However recently I’ve noticed that I am getting better at understanding where to instantiate objects, and how to link code to NIB files and so on. In the event of any unexpected behaviour, a systematic approach seems to solve most bugs and I can finally spot missing actions. It may take time, and even a little patience, but as you travel on your quest for more cocoa knowledge do not fear the NIB!