Category Archives: Personal

Mac modifier keys

Posting this here for my own use:

⌘/Apple/Command:
This is known as the “Command” key, as in “press Command-q to quit.” This can be used to access most major menu items by pressing the key combination listed next to those items in the menu.
There are several standard commands which are consistent across nearly all Mac applications, such as ⌘Q (Quit), ⌘W (Close), ⌘C (Copy), ⌘V (Paste), ⌘X (Cut), ⌘O (Open), ⌘A (Select All), ⌘N (New), and ⌘-? for Help. ⌘-Tab quickly switches between applications. Learning these shortcuts can save you a lot of time.
Command-clicking can also be used to select multiple items at once.

⇧/Shift:
There aren’t enough letters to match every menu item, so shift is generally used in combination with ⌘ for less-commonly accessed menu items.
Shift-clicking can also be used to select a range of items.

⌥/Option/Alt:
This is known as the “Option” key. This is used in combination with ⌘ and ⇧ for even lower-priority menu items, or for variations on standard items. (For instance ⌘⌥W will close all of an application’s windows, instead of just one.) If you pull down a menu and then press option, the menu items will change to their variant options in real time.
In the menus, option is represented by “⌥”, presumably because there weren’t any other symbols left. (The key has “alt” printed on it for compatibility with Windows applications.)
When ⌥ is used as a modifier without ⌘, it accesses alternate characters. For instance, ⌥-2 gives you ™, and pressing ⌥ in conjunction with vowels lets you place accents over international characters.
Option-dragging items will copy them instead of moving them.
You can also use option with the arrow & delete keys to work with entire words at a time.

^/Ctrl/Control:
The control key exists primarily for compatibility with Windows and Unix applications. You won’t generally use it in Mac applications. If an application does include a control-key shortcut, it will be abbreviated as “^”.
Control-clicking is equivalent to a right-click.

Fn/Function:
The function key is unique to notebook computers, and exists solely to access secondary functions on the keyboard. Use this to access Home, End, Page Up, Page Down, the F1-F7 keys, and the number keypad.

source: ask.metafilter.com:

Guys Weekend

I flew down to Los Angeles last weekend to be with my dad and my brother as part of our first annual guys weekend. My brother picked me up at LAX on Friday night and we drove to Mojave to meet my dad who drove down from Mammoth. Saturday morning we got up and had a leisurely breakfast and then drove 17 miles to the north entrance of Edwards Air Force Base for the 2006 Open House (I was a plane nerd when I was a kid). Unfortunately, I didn’t have a camera with me (Flickr has some great pictures if you’re interested) but I learned all kinds of interesting things on this visit:

New design

I got really bored with the old design of this site and all the cool kids seem to be using WordPress these days so last weekend I exported all 900 or so entries from Movable Type and imported them into WordPress, installed the ScribbishWP Theme and wrote a servlet filter to map my /blog/year/month/day/entry_name.html Movable Type permalinks to the WordPress style which is /blog/year/month/day/entry-name/. Oh, and comments are back on.

Enjoy!

Wildfire Enterprise launches..

For the last couple weeks I’ve been working on the ‘Deep, Real-time Reporting’ features of Wildfire Enterprise, which officially launched today (if you’ve ever thought about messing around with instant messaging / XMPP / Jabber, I’d highly recommend checking it out and that’s the last corporate pitch you’ll hear out of me). Herewith (as Tim Bray likes to say) are some notes about the tools we used to develop said features.

  • Prototype / script.aculo.us: Before I started working at Jive in April, I had done enough JavaScript to get by but my general attitude toward it was disdain. It seemed like it was always safer and easier to do things on the server. Prototype and script.aculo.us changed all that for me. If you haven’t worked with either: get started now. For whatever reason, the prototype website doesn’t contain a lick of documentation, so head on over to this site and this site once you’re ready to dive in. If nothing else, get rid of all your document.getElementById('thisAndthat') code and replace it with $('thisAndThat'), you’ll feel cleaner afterward. Also, make sure you get the latest version of prototype by downloading the latest version of Script.aculo.us because there’s a nasty bug with prototype 1.4 which I’ve written about before.

    Which leads me to script.aculo.us. Go ahead, be amazed at the drag and drop shopping cart, the ‘sortable elements with AJAX callback’ and the sortable floats. Now, put all that useless stuff aside and look at the core library, called Visual Effects, which include the ability to do just about anything, but make it really easy to do things like slide elements in and out, show and hide elements, and highlight elements. You can see some of the cool effects in action by watching this movie our marketing team made ofthe dashboard in action.

  • DWR: I didn’t mention anything about AJAX in the previous two paragraphs because all of the AJAX work is being done by DWR, which takes away all the hassle of binding the objects that exist on your server to the logic on the client and back again. You don’t have to deal with JSON, XML or HTTP requests. On the server you create a class, expose one or more methods and point your DWR config file at the class. On the client, you include a couple DWR JavaScript files and write JavaScript to call methods on the server. It’s drop dead simple. I highly recommend trying it out if you’re using a Java servlet container as your platform. We used DWR in a couple different places, but notably on the dashboard to create a digg.com/spy-esque view of the conversations on the server.
  • JRobin: Before working on this project I had never seen JRobin or heard about RRD. In short, it’s a way of keeping statistics about your system over time without having to maintain giant log files or large databases. So if you ever find yourself in a situation where you want to keep track of oh, let’s say the number of database connections to a server, over a period of minutes, hours, days, weeks, months and years, take a look at JRobin. It’s fast, can record just about anything you want and the size of the log file(s) it generates will be the same on day one as it is on day 323.
  • JFreeChart: I’ve used JFreeChart on a number of projects in the past, but I used it more on this project than any other. It is not the easiest tool in the world to use. There are about 600 different knobs you can turn, which makes it tedious to make something look exactly like you want it too and the full documentation costs $40, but the product itself is free.
  • iText: Last but not least, we used iText to produce some pretty nifty looking reports in PDF format, which includ the graphs created by JFreeChart. I hadn’t ever used iText for anything more than messing around in ColdFusion back in the day, but it was still relatively easy to get something working quickly. It would be fantastic to be able to hand iText an HTML document and say ‘create a PDF’, but you can’t have everything in life.

And that’s the story! Send me an email if you have any questions about how we integrated the above tools, I’d be happy to help.

CIS 552: Database Design

I took the final exam today in my CIS 552 Database Design course. I think I did ok on the exam but more importantly, I learned a lot this semester. I think the main takeway from the course is that it helps to realize that a database application (meaning an application like MySQL, Oracle or SQL Server, not a database instance like Northwind) is more than just SQL, in fact the bottom level of a database management system stack is “just” reading and writing files to the file system, albeit with transactions and atomicity and multiple users and well, a bunch of other stuff but bear with me. See, when you first start out, you do things like SELECT * FROM table and then you read somewhere how inefficient it is to bring back all the records from your table and so you use SELECT id FROM table. And then pretty soon you hit a wall where you have a query that takes like 5 seconds to run and you learn about indexes. Well, if you’re like me, you just learn that indexes make things go faster… you might read SQL Server books online and see that an index in SQL Server is a B-tree, but you don’t go any further than that and so you just come away knowing that indexes make your application run fastertm. After that, you read find someone somewhere that says that the order of your selection criteria matters and that you should try and give hints to the query optimizer when in fact, the query optimizer can do whatever the hell it wants with your declarative SQL statement and probably will.

And then you take a class like this and you learn how a database management system stores records in pages and you get to write some code that stores and retrieves bytes to and from said pages, all the while paying attention to the page header which stored (in our case) the page offset, the number of records in the page and a record size / pointer data structure, all of which is just part of a big file. After that you write code that looks up records in an index, which turns out to be a file as well. Finally, you use a block nested loop to process a join query and it turns out that again, you’re just reading bytes from a file system.

So now I understand why the guys at viaweb didn’t use a database (although I’d never go there myself) and I can have a somewhat intelligent conversation about the differences between a linear search, a binary search, an index scan, a B-tree index seek, and a hash index lookup. And oh man do I wish I was a math major in college.

Other cool stuff I saw along the way:

· On the Goodness of Binary Search by Tim Bray

· General Purpose Hash Function Algorithms

· Binary logarithm

· Google SparseHash a project that contains several hash-map implementations in use at Google, with different performance characteristics, including an implementation that optimizes for space and one that optimizes for speed.

· The Anatomy of a Large-Scale Hypertextual Web Search Engine: “Google’s data structures are optimized so that a large document collection can be crawled, indexed, and searched with little cost. Although, CPUs and bulk input output rates have improved dramatically over the years, a disk seek still requires about 10 ms to complete. Google is designed to avoid disk seeks whenever possible, and this has had a considerable influence on the design of the data structures.” (emphasis mine)

· Lucene architecture

· Quicksort

Thanksgiving

I think it was my friend David that pointed me to a blog called slacktivist, but I don’t remember when or how. Fred Clark, the author of that blog, recently attended the memorial service for his friend, Dwight Ozard, who passed away on November 14 and posted an excerpt from the program. I thought the last paragraph might read better as a directive and would be an apt post for this Thanksgiving weekend:

Suck the marrow out of the bones of life, live deeply and without reservation, hesitation or fear. Breathe deep the air of spring and the breath of God, savor the depths of flavors and the best of God’s good earth; “taste and see” the goodness of God, hold the things that matter close to the heart, treasure the hard parts of loving and frolic like a 4-year-old in a mud puddle in the good, easy parts. Don’t waste this thing. It’s too good.