December 8, 2008

3 Random MacOSX Tips

I've been a Mac convert for about 4 months now, and I'm loving it. I'm getting more fluent, but I'm still find new tricks and techniques for getting things done. Here are a few that I've found most helpful the last few days:

1. Screenshots

Using my standard MacBookPro laptop keyboard I don't have a snazzy "PrintScreen" button like I had on my old Windows machine, but it turns out Mac gives you even more choices on what to capture on your screen. Here's a few of the tip listed on Taking Screenshots list from MacRumors.com:
  • Command-Shift-3: Take a screenshot of the screen, and save it as a file on the desktop
  • Command-Shift-4, then select an area: Take a screenshot of an area and save it as a file on the desktop
  • Command-Shift-4, then space, then click a window: Take a screenshot of a window and save it as a file on the desktop
See the full list of Screenshot techniques on MacRumors, theres some great stuff on there, but the 3 listed above are what I find myself using most often.

2. Force Quit

It hasn't happened often, but every once in awhile a program will lock up on me. Nothing is more annoying than trying to close a program that won't respond. Everyone knows the standard ctrl+alt+delete for Windows. Command+Option+Escape is how you force a program to quit in MacOSX.

3. Switch JDKs

Switching JDKs on a Mac is done via the Java Preferences UI. Go to Applications | Utilities | Java | Java Preferences and simply adjust the list of JDKs to select which one should be used.

November 6, 2008

Tip: Using the JavaScript Debugger with Alfresco Surf

Debuggers are an essential part of a software developer's toolkit, and as such, the JavaScript Debugger has been a sanity-saver for me over the last few weeks. Having the ability to step through the code while it executes has helped me to better understand the Alfresco Surf Platform and some of the intricacies of JavaScript execution. Alfresco bundles the Rhino Debugger with versions 2.1 and up. It can also be used with any application built on top of the Alfresco Surf Platform such as Alfresco Share. To turn it on simply go to this URL, and click the "enable" button:
http://<host>:<port>//<application>/service/api/javascript/debugger
Note: Once the debugger is enabled, in order to shut down your application server, you must first disable the debugger or close its window.
The debugger has many of the features you come to expect: Set breakpoint, Remove breakpoint, Go, Step Over, Step Into, and Step Out. The lower-left context panel gives you a nice view of all the variables defined in the script, however I find the interface to be a little flaky. In theory you can click on the arrows to expand complex objects and drill down to more specific attributes, but it doesn't always work. Instead, I find the "Evaluate" and "Watch" panes to be the most useful, because you can quickly drill down to the data you're interested in. Evaluate gives a snapshot of the expression you're interested in, and keeps a history of the values you've looked at, whereas Watch evaluates the expressions as you step through the application so you can see how the values change.
Try it out:

November 5, 2008

An Introduction

I've been coding in Java for over ten years now. I've made a career out of it for over eight. I'm now working or Alfresco Software where I'm developing the new Alfresco Network. It's a fun challenge to apply all my software engineering skills to solve familiar problems with new technology. I'm new to content management. I'm new to Alfresco. I'm new to JavaScript. I'm new to Freemarker Templates. So, along the way I'm learning a lot. As I discover new tools, new tricks, and new concepts, I'll document them as best I can.