• Time To Learn

  • Be More Productive


  • Archive for July, 2007

    « Previous Entries

    Understanding Exceptions and Handlers in Cocoa

    Tuesday, July 31st, 2007

    tile imageLearn how to use Cocoa to build an exception handling system. This article shows the classes and keywords needed, how to prepare and raise a Cocoa exception, as well as how to intercept and process the exception.

    Use AppleScript to count words and characters in text

    Tuesday, July 31st, 2007

    Here’s a quick way to count the number of characters, words or paragraphs in some text, without having to launch a full-blown third party application. First, copy the text you wish to count to the clipboard, then open Script Editor (in Applications -> AppleScript), and then enter any one of these AppleScript commands (the lines that start with are comments; you don’t need to enter those):

    -- count all characters
    count (the clipboard)
    
    -- count all the words
    count words of (the clipboard)
    
    --count the paragraphs
    count paragraphs of (the clipboard)

    Press the Run button to execute the code you have written. The result will be displayed in the lower half of the window. If you want to check some other text, copy it to the clipboard and simply press the Run button again.

    [robg adds: I took this one step further, and wrote a simple application that will display a dialog with the results. Here’s the code:

    set myCount to co...

    Possible causes of a self-waking Mac

    Tuesday, July 31st, 2007

    Every night, I put my computer to sleep. Some mornings, I find that, for no discernible reason, my computer has turned itself on. It’s not scheduled to turn on, and I don’t know of any program that could be doing it. There’s nothing in the system log that gives any hint; it shows essentially the same thing that it shows when I wake up my computer manually.

    After scouring the net for an explanation, I found reports from people with similar problems. Somebody pointed out that you can sometimes (always??) wake up a computer by plugging in or unplugging a USB device. My keyboard is plugged in through a cheap hub; a loose connection might cause intermittent disconnects. One user on a forum somewhere (I’ve lost track of the original location) claims that his computer wakes up whenever he uses his microwave or other high-power device! He says that his electrical system is rather old, and suspects that the sudden power drain causes his computer to temporarily reduce power to his US…

    Check Parallels’ MAC addresses for some network issues

    Tuesday, July 31st, 2007

    Where I work, access to the network by hardware is (somewhat) controlled by using hardware MAC addresses to identify machines before DHCP will issue IPs etc. Parallels emulates RealTek Ethernet adaptors, which have their own MAC addresses. Because I use Bridged Mode rather than Shared networking, I had to get that MAC address registered with our network admins, too. Once that was done, Windows XP worked like a charm.

    However, later I also created an Ubuntu VM setup that worked at home but not at work, and today when I got time to look at why, it dawned on me that Parallels allows you to run multiple VMs at the same time. Therefore, each VM is assigned its own MAC address. Copying the MAC address from my WinXP configuration to the Ubuntu configuration solved the problem — the network became available once I also set the networking to use en0: Ethernet Adaptor (as the “default” did not seem to work).

    Anyway, this is just a reminder for those in similar situ…

    8-bay RAID solution delivers up to 400MB/s

    Monday, July 30th, 2007

    CalDigit has begun shipping the HDPro Tower and Rack Mount 8-bay RAID storage solution. The bay supp…

    Three things hopeful iPhone developers might want to know

    Monday, July 30th, 2007

    1. You probably want to wait for the binary UI toolchain if you can. Getting it built and configured is a nightmare.

    2. /private/var/logs/CrashReporter is, as you expect, your friend

    3. You don’t have to edit DisplayOrder.plist. SpringBoard will add any applications it finds to the Widget display. Only use DisplayOrder.plist to change the order or to hide items from the /Applications folder.

    Use external USB hard drives with Apple TV

    Monday, July 30th, 2007

    Patrick Walton and Tom Anthony have collaborated to deliver a hack that allows the Apple TV to use i…

    iTunes - Growl scripts for rating, skipping, and artwork

    Monday, July 30th, 2007

    I’ve posted some of the AppleScripts I use constantly to manage my iTunes library on my blog. Specifically, there’s the standard rating/display info scripts that incorporate with Growl, and are designed to work with the very small Smoke notification window, displaying not only the title - artist - album, but also star rating, album art (as the notification icon), and the position of the playhead and total time.

    Additionally, I have a script that skips ahead within the current song to either 25%, 50%, 70% or three seconds from the end, whichever is next from the current position of the playhead.

    Finally (and most useful in my case), is a script that takes the album cover fetched by GrowlTunes (which is cached locally, but not set as the track’s album cover), and sets the album cover of the song, but only i…

    And so the iPhone class-action action begins (and recut trailers)

    Monday, July 30th, 2007

    Yes, iT’s Monday’s iT Blogwatch: iN which we learn of an iPhone class-action lawsuit. Not to mention some more recut classic movie trailers…

    Jesus Diaz broke the story :

    It was bound to happen. It seems that a guy called Trujillo has been the first to file a class-action suit against Apple and AT&T because of the iPhone. The reason? You guessed it—it’s the battery. Read all about this dumbtastically stupid lawsuit, including the entire complaint text … Trujillo, hopefuly not related to the former Dominican dictator, claims that he didn’t know that the battery is a "sealed unit with it’s [sic] battery soldered inside" and that, "The battery enclosed in the iPhone can only be charged approximately 300 times before it will be in need of replacement, necessitating a new battery annually for owners of the iPhone."

    Putting aside that this guy’s lawyer’s grammar is worse than mine, is he really that ignorant? Does he think that the judge is going to be stupid? (OK, you don’t need to answer that. It was a rhetorical question.) The fact is that the iPhone battery lasts for more than "300" charges and doesn’t need to be changed after that. According to Apple, the battery "is designed to retain up to 80% of its original capacity after 400 full charge and discharge cycles."

    KisMAC: down by law

    Sunday, July 29th, 2007

    Distressing news from Germany, where the developers of the excellent KisMAC wireless-network discovery tool have ceased development of the project out of fear of a new German law that would criminalize (according to one translation) "Whoever prepares a crime … and who creates, obtains or provides access to, sells, yields, distributes or otherwise allows access to passwords or other access codes, that allow access to data; or computer programs whose aim is to commit a crime." I don’t read German (alas), but this sounds very much like some of the ugly language of UCITA and the DMCA, modernized with some of the more hysterical claims equating hacking with terrorism.

    Whatever German (or American) lawmakers have been told by their respective lobbyists / advisers, there are many legitimate uses for a passive discovery tool such as KisMAC, and plenty of places online where covert development can continue (as KisMAC’s developers hope will happen with their software). That’s great news for programmers and security folk in those nations, but not great for those of us working in Germany or the U.S… not to mention where it leaves the next generation of would-be security folk in countries thus afflicted. Slashdot’s one-line editorial about "when security tools are outlawed" certainly obtains, but I particularly like what CW columnist Jon Espenschied — a  security professional who uses KisMAC for perfectly legal purposes — says about the problem of stupid legislation driving security researchers and their tools "underground" to other countries: "One day you wake up and you’re someone else’s service economy."

    How to compile for your iPhone

    Friday, July 27th, 2007

    Here’s a quick how-to for people wondering how they can install the iPhone toolchain and try out their own command-line programs.

    1. Jailbreak your iPhone and install ssh. You need full access to your iPhone’s file system.
    2. Download a copy of the binary toolchain and unpack it onto your i386 Macintosh.
    3. Copy arm-cc-specs to your home folder as .arm-cc-specs
    4. Move the entire build (local-toolchain) into /usr/local/. (I don’t recommend breaking it out any further so you keep the entire install together.)
    5. Edit .arm-cc-specs to match the location of your toolchain, e.g. /usr/local/local-toolchain/share/
    6. Edit your path to include /usr/local/local.toolchain/bin and start a new window so the path matches up.
    7. Create a new, standard helloworld.c
    8. Attempt to compile it using arm-apple-darwin-cc, which will now be in your path. This will fail.

    And now we come to the hard part. You either have to edit your system headers, which Apple made read-only for a reason, or load pre-updated headers, which you’ll have to google for. Editing headers basically goes like this: Whenever your compile fails, add || defined(__arm__) to any line that includes if or elif defined (__i386__). Repeat as needed until your hello world compiles. Then, copy your executable to your iPhone and test it there.

    iPhone AC adapters failing

    Friday, July 27th, 2007

    It appears that a number of wall power adapters (AC) for iPhones are failing. A post by Jason D. O’G…

    FFOSS (Freeware/Free & Open Source Software) Friday

    Friday, July 27th, 2007

    Ning: Build Your Own Social Network Site
    Sat, 21 Jul 2007 22:39:12

    Ning.com

    read more


    GnuCash 2.2.0: First Windows Release
    Thu, 19 Jul 2007 21:24:28

    GnuCash 2.2.0. is an Open Source finance software that has been available for Linux and Mac OS X for a while now. However, this recent release (July 15) is the first production release that provides a binary version for Microsoft Windows.


    Democracy Player Changed Its Name to Miro
    Wed, 18 Jul 2007 23:11:14

    The Open Source online video player formerly known as Democracy Player got a new name…

    Miro (version 0.9.8)

    I’ve had problems with the Windows version. But, the Mac OS X version worked fine the last time I tried it.


    The Open Library: Online Book Library
    Tue, 17 Jul 2007 23:13:32

    The Open Library

    read more

    Geek and Granny : iPhone

    Friday, July 27th, 2007

    Geek gushes.
    Granny calls him a hopeless fanboy.

    Jim: Welcome to Geek and Granny, a candid forum discussing pressing (or not so pressing) current events in the technology landscape, with representatives of the technology community. Our two panel members represent distinct viewpoints and perspectives, and as moderator I will attempt to navigate the debate to some natural conclusions, or at least avoid any serious bloodshed. Mmmm?

    Agnes: I’m sure we can keep it to a minimum.

    Harry: I only go for the jugular in Grand Theft Auto! [smiles]

    Jim: Sure. On my left is Ms. Agnes Titlebore, whose long and storied career has included executive roles at everything from software startups to corporate giants. Welcome, Agnes.

    Agnes: Hello, glad to be here.

    Jim: And to my right is Harry Geary, the renowned tech blogger, video game reviewer, and open source advocate. Welcome, Harry.

    Harry: Thanks for having me.

    Jim: As our inaugural forum, we thought the most fitting topic would be the recent release of Apple’s iPhone.

    Agnes: Yes, there hasn’t been enough coverage of that, has there now? [smirks]

    Jim: Well, yes, everyone seems to have something to say about it, but let’s see if we can bang this around a bit and help the folks out there that are drowning in all these bits. To keep things simple, I thought we could cover three areas: What is Apple’s game here, how have they done so far, and what should they do next? Sound good?

    Harry: Yeah, that narrows it right down.

    Jim: So it seems to me that Apple is clearly targeting the consumer cellular market here, as a start towards bigger things…

    Harry: Wrong! It’s much bigger than that. Apple is trying to revolutionize our digital experience overall, the same as they’ve always done. Just like Steve said on stage, it’s a phone, iPod and internet device, and the best of each that I’ve seen so far.

    Agnes: Gosh, is this what they call a “fanboy” in the forums? I never met one in person. I haven’t seen any other companies making iPods, dear, so the “best iPod” is kind of a pointless measure, isn’t it?

    Harry: You know what I mean - a portable media player. I’m no fanboy, Granny. Can I call you Granny? [smirks] I mean, games on Apple hardware really suck out loud, the iPod doesn’t support Ogg format - but you have to admit that the iPhone is a homerun.

    Agnes: Well, I wouldn’t say that, but it is quite impressive for a few reasons.

    Jim: Before we get into that, would you agree, Agnes, that Apple is doing more here than just making a consumer mobile phone play?

    Agnes: Sure, absolutely. But not the way this Geek - can I call you a Geek, dear? - was gushing about. I think Apple is definitely trying to position the iPhone as “more than a mobile phone”, but other players in this field have been doing the same for years.

    Harry: But Apple has outdone them here…

    Jim: Come on, give her a chance to finish her thought.

    Agnes: Thanks. I think what they’re trying to do is put themselves into the driver’s seat in this area, like they did with portable media players and the iPod. My comment earlier was actually a compliment to Apple - people don’t buy “MP3 players” anymore. They buy “iPods”. Apple has been scouting the field, seeing where the players are weak, seeing where there’s an upside in terms of consumer experience, and they’ve taken their shot at it. The interface is innovative and intuitive, two things that no mobile phone in the past 3 years can claim to have achieved. And the quiet little revolution here is the activation process that Apple negotiated with AT&T. They’ve truly taken the mobile phone purchase experience out of carrier stores and mall kiosks, and into Apple retail stores and the home. Quite brilliant on their part.

    Jim: You’re starting to sound like a bit of a fanboy yourself, Agnes.

    Agnes: Not at all. I respect what Apple has done on these fronts. But I have serious doubts that they’ll be as successful here as they were with the iPod.

    Harry: Why not? [brandishes his iPhone] This thing is gorgeous, works brilliantly, and…

    Agnes: Watch it dear, you’ll get drool all over it.

    Harry: Yeah, yeah.

    Jim: OK, so we’ve moved on to “How are they doing?” Harry, I think your position is pretty clear.

    Harry: Well, I’m pissed that they’ve closed the platform (lame-ass Web 2.0 apps don’t count). But yeah, I think this thing is excellent, and I think they’ll be a big player in the phone market from here on out. The big player, eventually.

    Agnes: Closing the platform was another smart move by Apple - they need some space to build faith in their platform, for consumers and the carriers. If they had pushed this thing out there as a brand new mobile platform, and people started loading all the usual crap onto it that they do with Windows Mobile and Blackberrys, they would have marginalized themselves right out of the gate.

    Harry: That’s just the cost of an open platform. The platform has to be able to take advantage of innovation in the market, not just in Apple’s labs. Natural selection will weed out the good stuff from the bad, and…

    Agnes: OK, OK, I don’t want to trigger a lecture on the virtues of open source. My point is that normal human beings, non-geeks, don’t get the distinction. It’s all part of the product, and if my phone locks up, I’m going to yell at the two names on the face - the guy who made the handset and the guy that sold me the service. But to get back to the question, my reservations stem from the fact that this is a much more complex market that Apple is jumping into. Carriers have a lot of muscle, and, especially in the US, they want to control the consumer as much as possible. They have been notoriously intolerant of device guys muscling into their consumer relationships. Apple scored a win with AT&T with the iTunes activation and other aspects of their exclusive deal, but don’t expect that track record to continue.

    Harry: Gosh, sounds a lot like the music industry to me. And Apple has really been dragging there, haven’t they? [grins]

    Jim: I was about to say the same thing. Apple has been extremely successful in music along these same lines, haven’t they? True, their video efforts haven’t been spectacularly successful, but they are an undeniable driving force in music now, and they were nowhere 5 years ago. What makes this any different, Agnes?

    Agnes: Well, they’ve been successful to a point, but they had market factors on their side in that one. The music industry was sitting at the side of the pool instead of jumping all over the technology that was available to transform their business, and digital music players were still fairly immature. The iPod and iTunes were aimed right at those weak spots, and they scored a bullseye. But even in music, that honeymoon seems to be over, doesn’t it? Universal dropping their exclusive contract is just the start. And I think things will be even harder for Apple in the mobile market, because the mobile phone players are much more savvy, and there’s a lot more at stake. The carriers have fairly sophisticated approaches for exploiting their networks, and the device manufacturers continue to innovate around their platforms. On top of that, people spend a lot more, directly and indirectly, through their mobile carrier, and the potential upside in terms of using the mobile network as a controlled channel for other things (including music), is huge. Apple’s trying to weasel into that market, and the players that are already there won’t just sit around and be marginalized.

    Jim: Well, I wouldn’t describe what Apple is doing as “weaseling”, but I take your point.

    Harry: I really don’t see any difference here. People hate their mobile carriers because they feel like the service and support stink, they spend too much, and they get nickeled and dimed for everything. Geez, if I go over on my minutes, I have to take out a loan to pay my bill. Sounds a lot like CD and concert prices in the music industry. Those guys had to be dragged into online music by their [censored], and Apple was the major force doing the dragging. This all applies in the mobile market, too. Mobile phones today really do suck, when you think about it. The hardware is interesting in some cases, but the operating systems are really pretty lame, and people don’t like them. They barely tolerate them. Same goes for carriers and their crazy-ass plans and so-called customer support. That sounds like an opportunity to me, and I think Apple will be the white knight that rides in and saves us all from all this mediocre stuff. Just like they did in music.

    Agnes: I’m sure that’s the attitude Apple has, but I really think they’ve fooled themselves (and you, dear) into a state of over-confidence. iPhone will peeter out in the next 12-18 months, after a much more abbreviated honeymoon. Apple might make their numbers in the next quarter, but not for the next year.

    Harry: I’ll be laughing when they hit 10 million next year.

    Jim: OK, so what should Apple do next?

    Harry: More of the same. They need a 3G model soon, especially when they try to sell these things in Europe and Asia. And they have GOT to open up the platform so we can write apps for this thing.

    Jim: What’s your advice for Steve Jobs, Agnes?

    Agnes: I’m sure that Apple will follow their usual approach here. They’ll target mass consumers and so-called thought leaders - geeks like Harry that will lap these things up and tell all their friends and family to buy them, too. And they’ll largely ignore or marginalize business users in their plans. But again, I don’t think it will work in this space. The carriers will subsidize (directly or indirectly) competitive innovation with other handset developers, to keep Apple from being too much of a controlling force. Eventually, Apple will plateau as a marginal player in this space. And if they don’t support business users, sell to corporate accounts, cater to corporate IT shops, then they’ll just end up with a smaller piece of the pie when that happens.

    Jim: OK, that’s clear enough. Doom and gloom for Apple, eh?

    Agnes: Not really, just no fame and glory in this case. They’ll still manage to make a lot of money with overpriced hardware, as they always do.

    Harry: You’re just PO’ed because you can’t use Exchange with it. Stick with your Blackberry while the rest of us move on. Apple has the hardware platform, iPhone, the operating system, Mac OS, and the network platform, iTunes, to win huge in the mobile market. In the media market, actually. Just wait until they start to do more with iTunes and networking with this thing - they are going to be the driving force in the mobile market.

    Jim: OK, OK, any last words, guys?

    Agnes: I know it seems petty, but speaking of Blackberrys, the keyboard on the iPhone is really awful.

    Harry:
    Yeah, it does suck.

    Jim: Hmm, yes. Well, that’s it for this round of Geek and Granny. See you next time.

    DISCLAIMER
    Agnes and Harry are fictional characters. Any resemblance to individuals living, digital or dead is unintentional.

    Avoid unintended recipient issues in Mail

    Friday, July 27th, 2007

    OS X’s Mail program uses auto-completion in an email’s address fields — type Sall and Mail will grab the email address for Sally Sample. Most of the time, this is good as it saves typing. However, when you have two contacts with similar names, things can get troublesome. In my case, I have a very good friend who shares the same first name, and a very similar last name, with my manager at Macworld. In the past, when sending messages to either of them, I had to type a few letters of the person’s name, then wait for Mail to drop down its list of matches and select the one I wanted to send the message to. This was not only annoying, it also took more time than I’d like, given how often I email both of them.

    Then I remembered that Mail can also auto-complete based on groups in Address Book. So I created two new groups in Address Book — one called da boss and another called WRX (my buddy’s car). I then dragged the boss’ name from the All listing to th…

    Avoid duplicates when copying music from another PC

    Friday, July 27th, 2007

    I am sure some of you have had this issue before if you use more than one platform at home. Personally for me, OS X and iTunes lack some audio features I like so I don’t do my audio ripping from my personal CD collection on a Mac. I do it on my windows/Linux box so I can take advantage of some good open source formats like OGG, FLAC, and MP3vbr (though I think the newest release of itunes will support VBR? not sure). [Editor: iTunes has had VBR support for quite a while.] However, I like to have my music collection on my Mac so I can listen to my music when I am working on it, and my laptop is a Macbook Pro.

    I am sure a lot of you already know this, and this is nothing new or exciting, but I have used basic Unix commands to copy my music directory from my PC to my Mac using rsync, and have not had it copy over any duplicate albums. For example, I have about 40GB of music ripped to my PC of my own personal collection. When I copy it via SMB over the network, …

    iSkin Revo debuts: iPhone protection

    Thursday, July 26th, 2007

    iSkin, best known for its iPod cases, has announced the availability of a new case for the iPhone, d…

    An untimely obituary for the Mac mini?

    Thursday, July 26th, 2007

    Dan Knight at Low End Mac has written an obituary for the Mac mini, basing his assumption of its death on the lack of updates since September 2006.

    Dan’s theory boils down to this:

    If Apple still considered the Mac mini a viable model, at the very least they would have upgraded it to 1.66 and 1.83 GHz Core2 CPUs or 1.83 and 2.0 GHz Core Duos by now. The fact that they have allowed the Mac mini to languish when an upgrade requires nothing more than plugging in a better CPU tells us that the Mac mini really has reached the end of its road.

    The mini’s lack of easy expandability was the main thing that made people hesitate, Dan asserts.

    I’m inclined to think that the reason was even simpler than that. Dan writes:

    All the Mac mini really had going for it was offering a decent amount of power in a very compact package. It wasn’t enough.

    Right, because there was another Apple computer offering the more power, in an even more compact package: the MacBook. Yes, it costs a bit more, but as many reviewers have said, it represents superb value for money. As demonstrated by rocketing sales. I suspect that the MacBook has ended up taking a lot of sales from the Mac mini.

    I rather hope that Dan’s wrong, and that the Mac mini has years of life left. I think it’s a great little machine, well-suited to use as a basic family PC, or a geek’s tinkering playground, or even a dedicated server. For the time being, I hope that reports of its death are greatly exaggerated.

    The Good Easy on OS X

    Wednesday, July 25th, 2007

    tile imageGiles Turnbull examines Mark Hurst’s “Good Easy” productivity tools and methods for Macs. Giles spoke with the author of “Bit Literacy” about his philosophy and choices for simplifying computing.

    Add high-end printers to other machines via the shell

    Wednesday, July 25th, 2007

    This excellent tip explained how to manage LPR printers using the command line lpadmin printing tool, but there were no instructions on how use printer queues for high-end printers with a RIP — like those from Xerox and Canon. Typically, these printer queues will contain options such as Print, Hold or Direct. Although it’s easiest to use Open Directory to manage your printers and these special settings, if you use ARD or Filewave for Desktop management, you can issue a shell command or shell script to automatically add these special type of printers without end-user disruption.

    Simply add your printer’s queue to the end of the IP address or URL like the example shell script below, and voila, your users will have all of their special printer configurations added automagically.

    « Previous Entries