Page Up, Page Down, Home and End Keys

June 3rd, 2009

One of the hardest thing for a new Mac users is the keyboard shortcuts in OS X. If you’ve just bought a Mac and try to find the delete, home, end or any common keys from Windows/Linux operating systems, you can’t :) Even you google and find some helpful information, they’re using some weird signs to represent keyboard shortcuts. Honestly this happened to me as well. I guess there are two reasons behind it; first Mac operating systems are mainly designed for graphic applications and second you’re so used to use your Windows Minded side of your brain :P

Anyways, first thing I’d suggest you guys is to try to forget Windows/Linux comparisons. They have their own advantages or disadvantages. Comparing them to a pretty much perfect operating system is not fair :P

Okay, the reason I create this post is to give you guys a cheat-sheet about OS X key combinations. The very basics are:

You can find almost full list from this link or this link.

MacOSX

1 Comment

How to Put Exception Breakpoint?

May 18th, 2009

Tracing stacktrace is sometimes very boring. Especially your code is not above certain quality. If you’re an IntelliJ user, there are many many ways to trace your code like Exception Breakpoints, Field Watchpoints, Method Breakpoints and even JS breakpoints :) Anyways, today I needed to trace an exception in one of Eclipse project for work. I was gonna place an Exception Breakpoint, but then I remember that this is not IntelliJ. So a little investigation showed me that it is possible to place an Exception Breakpoint in Eclipse as well. Here is how I do it:

First, open the breakpoint view by going into views menu.

Then click the create an Exception Breakpoint button on the top right corner. It will pop up a window for you to type which exception you want to trace.

That’s it. All you need to do after this is just debug your application. Hope it helps.


Eclipse

4 Comments

Convert String to Enum

May 18th, 2009

Last month we were coding some Groovy stuff and we needed to use Enum equivalents of couple Strings. We had couple dynamic Strings coming from off-shore developers, which defines the type of the entity. In our system, those types were represented by Enums. Anyways, basically we had to resolve the Enums from given Strings. After a little reading, we came up with following solution:


enum Colors {
  BLUE,
  WHITE
}

// ..

Colors blue = Enum.valueOf(Colors.class, "BLUE");

I thought I should post a blog entry about this :)

Java

2 Comments