Urgle
Friday, November 03, 2006 — 03:41
Wow. A recent post on Microsoft’s Mac Mojo blog (The Mac BU’s Blog) stated an amazing/stunning/horrifying fact. Ever wonder how many lines of code are in Microsoft’s Mac Office?
30,000,000.
Thirty million.
Here’s what else they had to say about it:
Just to throw another mind-numbing number out at you, there are about 40 lines of text on the page of an average paperback book. That means one developer is responsible for about a 10,700-page book. Or if you break it down smaller, if the average paperback is 300 pages, that means each developer is responsible for about 35 or more paperbacks on his desk. Imagine trying to find a single typo in all those books — that’s what most bugs are, don’t ya know!
No wonder it’s taking so long to get out the Universal Binary of Mac Office.
Apollo
Tuesday, October 31, 2006 — 04:25
Adobe is developing yet another web technology-based application environment called Apollo. However, unlike Dashboard and Yahoo! Widget Engine, Apollo lets you make real applications and not just widgets. These applications are cross platform. You can use HTML, Javascript, Ajax, Flash, and Flex to make these apps.
Does this seem like a trend to anyone else? Using web-based technologies to write desktop applications (or widgets or whatever you want to call ‘em). It definitely goes along with the idea that the internet is becoming more and more integrated into our computers.
Math.random?
Sunday, October 22, 2006 — 17:23
Fair warning: This is a geeky post.
In a widget, the way you generate random numbers is through a JavaScript function called Math.random(). Random numbers are useful for lots of things: We use them in Old Faithful (has to do with refreshing the image), Uncle Sam (generating random quotes), and MadLibs (auto-generating random words).
However in Dashboard, the Math.random() function doesn’t truly generate random numbers. Each time you close and reopen a widget it gives you the same sequence of numbers. Here they are. (Note that these numbers have been multiplied by 1,000,000,000 and rounded there, for readability.)
- 7826
- 131537788
- 755605322
- 458650132
- 532767237
- 218959186
- 47044616
- 678864717
- 679296406
- 934692896
To prove my point, I’ve created a quick-and-really-dirty widget to demo this. Here it is: RandomDemo.zip. This widget will show you the first 10 random numbers. You’ll notice that the first time you run it, it has these exact numbers in the same order.
If you close the widget and re-open it (Note close and re-open; a simple Cmd + R refresh won’t do), you’ll get the same exact sequence of numbers. That’s the problem. Dashboard’s Math.random() gives you the same numbers each time you open it in a new widget. This is especially a problem for widgets that do stuff like generate random passwords, because everyone sees the same password. However, it’s also annoying to us because everyone sees the same Uncle Sam quote and MadLibs auto-generated output each time they re-open the widget.
We have found a way to work around this bug, but it’s messy, annoying, and it would be much, much simpler if Apple just fixed the Math.random() function in Dashboard. So please, Apple: Fix it, will ya?
Build Widget
Saturday, October 21, 2006 — 20:39
In my day-to-day widget developing, I’ve developed a few shortcuts to help along the way. One is my “Build Widget” Automator action that I use as a Finder Plugin. You can see what it looks like in the image on the right.
In short, it will take a normal folder and turn it into a widget bundle in the Widgets folder. Here’s what it actually does:
- Gets the selected Finder item. WARNING: This is not necessarily the item you right-clicked on.
- Copy it to the Desktop. Because it uses the Desktop, you cannot have you widget’s folder on the Desktop.
- Rename the folder by adding ‘.wdgt’ onto the end.
- It then moves the
foldernew widget to the Widgets folder. - It will then ask you if you want to continue on and make the widget a .zip archive.
- If you clicked yes, it will create the .zip archive. These last two are hidden to save space.
Well, there you have it. Inside the workflow (pun intended) of one widget developer.
How I Spent My Weekend
Monday, October 16, 2006 — 22:12
Over the weekend, I worked a little on our newest widget. Here’s what I did.
- Changed ‘http’ to ‘https’. Oh yeah.
- Re-wrote the DOM processor. It’s actually much shorter now.
- Put in a little error handling. It’s not much, but it’s a start.
While it sound like I almost got nothing done, oh wait… I did get almost nothing done. Actually, Austin’s writing most of this one. What’s the widget? I can’t tell you; it’s not done yet!