Hillegass/Cocoa Programming for Mac OS X

I bought a copy of this fantastic textbook on Friday.

I won’t write a review, suffice to say it is the book to use to learn how to program on the Mac.

The last time...

It’s an interesting situation, this whole change of career business. I’ve had lots of opportunity to say to myself, or anyone who will listen, “this is the last time I will do this.”

Most recently, this is the last time I will write reports. Something I have always despised, and I won’t miss it one iota.

I’ve also had the last Year Level Meeting, last Student Free Day (those are pretty good, but), and last time I have to submit student work for moderation.

In three days, I’ll have my last teaching lesson. That’s a big one!

And then, at the end of next week, my last day.

Roll on, last day!

Google Sketchup 6

I have used a number of Computer Aided Design and CAD packages. Today, I used Google Sketchup for the first time.

It has some differences, and could be an excellent program, but it just does lots of things (IMHO) wrong.

For instance, it allows you to place a dimension on a line, and then change it. But it doesn’t actually change the length of the line. If it did this one thing, giving it parametrically controllable dimensions, then it would do most of what I want. Instead, I need to create a line or box, (change tools to) place a dimension, (change tools again to) resize it until it is close enough to the size I want.

To make it a bit better to use coming from Inventor, I set up ‘D’ as a shortcut key for Dimension, and F5/6 for Previous View/Iso View. Much better for my muscle memory!

It uses a different paradigm than Inventor, rather than using a series of parts, it really is just a sketch. Having said that, here is an accurate representation of my house. Accurate in some ways, not all.

And the best thing over Inventor? It runs native on OS X.

Mac Mini Media Machine

Well, I’ve bit the bullet and bought a Mac Mini Core Duo to use as my media centre. The old Xbox just doesn’t cut it anymore - the two things I need to be able to do are play H.264 movies, and record video from Digital TV, and it can’t do either of these. I’ve had to purchase an eyeTV USB TV Tuner to do the latter (and I’ll be returning my Miglia TVmini2, since it doesn’t do what it is advertised to do - which is play Digital TV properly, or do scheduled recording properly).

The machine was ordered online via the Apple Store. I’ve had issues with NextByte in the past, so I was a bit loathe to purchase through them. I rang them anyway, figuring that if they had one in store, I could order it, and collect it the same day.

They didn’t and said that they had about 6 on order, and there weren’t any in Australia.

Now, I knew that wasn’t the case, as Apple have a 24 hour shipping note on this model. So, it was “no thanks” to their offer to place an order. And I ordered online.

Within about 5 hours, my order had shipped. And, for evidence that it has been shipped, TNT have the following data about my package:

So, I’m all excited. My new machine is supposed to arrive tomorrow…

VMWare startup time and flakiness

I don’t know why, but just recently VMWare has been performing rather badly for me. It used to start up to a saved session of Windows in a matter of seconds, but now takes minutes before I can start work. Selecting Unity mode takes another minute or so to get all set up.

Working on anything while VMWare is running is bad news - everything in the system slows down to a crawl, especially during the startup phase, but even whilst running. I used to be able to switch around with ease, and even though Inventor was sometimes a little laggy, it was quite responsive. Now, I need to wait seconds for every operation in Inventor to complete (which may be a Network licensing issue, since the same thing appears to be true of Windows machines on the network, too), and it affects my OS X software, too.

Finally, I had a crash today, where VMWare shut down. I think I’d saved all of my work, but I can’t be arsed waiting for it all to load up again to check. I’ve only got 20 mins to work on the stuff I need to use VMWare for, and I think I’ll just do something else instead of waiting for half of that for it to boot up.

I don’t know if it is an OS X issue, a VMWare installation issue, an Inventor issue or a VM image issue. I only need to keep using Inventor for a couple of weeks, and I have to use Access to write my last lot of school reports. After that, I may be able to remove VMWare and Parallels from my system entirely.

Actually, I think I’ll do a complete reinstall of OS X and all of my applications when I get Leopard. And perhaps I’ll have several partitions: OS, Applications and Data. That way I can have separate backups, that are restorable easily.

xkcd Success

Ah, I’ve been there. Mine was dual-booting OS X onto an unsupported Dell PC. I had a second Hard Disk that I was putting it onto, yet somehow I managed to screw up the Windows partition as well. Luckily I didn’t destroy the laptop. And I never got near the sharks…

And, yet another plug for xkcd.com - if you haven’t subscribed to his RSS feed, then you really should.

Ikea Masque

And yes, that is a Movember.

Savings & Loans - Internet Banking - Information

Internet Banking uses industry-standard encryption to help keep you safe online, while our Factor2 Personal Icons help protect you from unauthorised transfers from your account. The first time you transfer money to another financial institution or use BPAY, you will be asked to choose three secret icons that you’ll need to select every time you use these services.

(From Savings & Loans - Internet Banking - Information)

Okay, so let me get this straight. You have introduced a second set of paswords, right?

Each time you use BPAY or transfer funds to another financial institution, you will be prompted with nine icons, including your three chosen icons, in a random order. You will need to select your secret icons in the correct order before you can BPAY or transfer funds.

Okay, I have some issues with this.
Firstly, if someone already has access to my login details, they have breached security. They can look at personal details about me, including the address my credit union has on file. But not my date of birth. Which they might be able to get by google.
Okay, you are trying to do something nice and stop someone stealing all of my money if they happen to get my PCLink access details. And you give me a system where I need to click on three icons.
Surely shoulder-surfing is easier to do if you just have to see the three icons someone clicks on, rather than try to see what keys they have pressed on the keyboard.

If you forget your Factor2 Personal Icons, you will need to call our Member Contact Centre on 13 11 82 to have them reset.

Okay, so someone could get my login, pretend to forget my icons, and ring and get them reset. So the system can fairly easily be bypassed. But then I wouldn’t be able to get in myself. Granted, it is a level of security that didn’t exist before, but I don’t really see that it is any more secure. If they have gotten in, it stops them transferring all of my money out.
Until they ring, read off my address, google my date of birth, and then they can steal all of my money. Now, it happens I have been pretty good at keeping my date of birth private. I even use a faked D.O.B. for lots of online sites. Which I have to remember when I have used that fake.
It’s just lucky I don’t have much money in there…

Review: miglia TVmini2/equinox The Tube

I lashed out yesterday, and bought something that I’ve been wanting for a while.

A USB TV Tuner stick.

I went for the miglia TVmini2, as it was (I thought) fairly inexpensive. I’m not sure I made the right decision right now.

For starters, it doesn’t actually come with the software. Sure, it’s got a CD with some demo software of other stuff, but the actual software (which is actually written by another company, called equinox), The Tube, needs to be downloaded from the internet before installation.

Which wouldn’t be too bad, but it’s a 104Mb download. Which meant I couldn’t (a) start playing with it as soon as I bought it, since I was in town, and not near a free wireless point, and (b) start playing with it as soon as I got home, since it took about 30 minutes to grab.

It gets worse, though. Even though the software really requires a dongle (the USB tuner is really just a dongle, after all), the manufacturers insist that you register the software, using the included key string. And it only works on one machine without de-registration, apparently. Which kind of sucks, because I’d like to have it moved between more than one machine.

The hardware itself seems okay. I haven’t been able to make it work with any other software yet. I’ve tried a couple of downloads, but they wouldn’t recognise it.

System Profiler reports the device as looking like:


Version: 1.00

Bus Power (mA): 500

Speed: Up to 480 Mb/sec

Manufacturer: Miglia

Product ID: 0x0069

Serial Number: 0000000001

Vendor ID: 0x18f3

The software, on the other hand, seems to have some good features, but quite a few flaws.

The manufacturers have decided to make the application scriptable. This is a very good thing, as it will allow me to, for instance, set up Salling Clicker to be able to control it. Which will be very good. I’d also be able to make a rudimentary controller for network or local remote control. Which I may do: more on that later.

Another good feature is the simplicity of the software. The basic window is shown below.

You basically have a video section, with a controller on the right. This appears to be fixed. Although you can hide the main video area, they resize together. Which is a bad thing, if you like to resize the video to a small size while you write a review of something, for instance. Like I’d like to do now. It means that the controller becomes fairly unusable fairly quickly:

This is as small as the remote area gets. Any further resizing just shrinks the video display in that window. You can hide the Details area (this is shown above), but you can’t hide the record area.

You can hide the remote, too. This makes shrinking the video a bit more usable:

I anticipate being able to build another controller that floats, and can be used in conjunction with the view shown above. More below on some issues that might appear with this, when I discuss the AppleScript interface in a bit of detail.

The controller itself is mostly okay. The main/default view has a list of channels. This is customisable. You can scan for channels, and then delete the ones you don’t watch, and rename the ones you do. Scanning takes a long time, and is probably worth re-doing every now and then, just in case a new station has been added.

The bottom area of the controller is the recording pane. You can pause live TV, record the current stream, and if you have been watching a channel for a little while, skip back through the already viewed stuff. I did a quick test where I watched for a while, then went back to try to record a section from the past. The program developed a spinning beach ball, and I had to Force Quit. I’ll continue to test it again later, as this is a nice feature.

There’s also a button link to their other software, MediaCentral, which totes itself as a total replacement for FrontRow. And, I’ve had a bit of a look at it. It looks pretty good, actually. May be worth investing in, and using this on the Mac Mini when I finally get it, and set it up as my Media Centre. (Typing Central reminds me to just let all of the yanks out there know the correct way to spell centre. Yank is a slang term Australians use to refer to Americans).

If you record live TV, it stores it in the recordings pane.

You can then export from here, in order to be able to view on another device, or in another program. It exports raw DV fairly quickly (almost real time, I think, perhaps even faster), but as expected exporting to m4v takes a bit longer. It appears that these are the only formats it will export: iPod, iPhone and AppleTV are all m4v, and iMovie is DV. I’m still going to record some stuff and see what the quality is like. Gotta wait for some decent content first.

Which brings me nicely to the next topic. Electronic Program Guide and Scheduled Recording. The interface is, again, fairly simple. All programs appear in the one list, there doesn’t appear to be a method of filtering so sort by channels. You can search or filter by title and description. To schedule a recording, simply click the black dot next to the program time.

Clicking on a title will show the details about that program. This is obtained from the digital TV data stream, although it is possible to add in an external TV guide, using the open XMLTV standard. Unfortunately, there doesn’t seem to be a way to subscribe to an XML feed. EPG via RSS, that would be awesome.

If you click on the “Show Recordings” button, it will filter to only display the programs you have scheduled to record. You can then de-select them by re-clicking the red dot. Fairly easy to understand. It also seems to have some smarts about overlapping programs, and will display a different coloured dot when they clash.

Okay, feature list is pretty much done. What doesn’t it do, or what does it do badly?

AppleScript support.

You can do quite a few things with AppleScript, such as pause, play, start recording and so on. It appears that you cannot get decent data from the EPG, for instance. So I can’t build a fully replacement EPG in another application, unless I access the data directly from the file. This file is stored as an SQLite database. So I should be able to grep data out of this using the relevant tools. This seems to be an oversight, since you can schedule recordings, and access the EPG data, but I can’t figure out how to get meaningful data from the EPG. This would be a necessity for a proper Salling Clicker interface, that allowed me to just run the program in full-screen mode and only use the phone for the remote, doing all of the programming with that instead.

You can also export from AppleScript. Not sure if you can choose to export DV, which I would probably want to do. So I can post-process the data and remove advertisements, for instance. But I cannot find a way to choose a channel by channel name. Which would be useful for a remote program, either on phone or computer.

Possibly the biggest annoyance: in every instance I have seen, this application is called The Tube. But to access it in AppleScript, you need to use TheTube. Why do this? You can have spaces in application names in AppleScript and it works fine.

Data file formats.

The channel data is stored as an XML/plist file. Which is a good thing. You can hand-tweak this file, which is much faster than, and less error-prone than deleting them inside the software. Especially since right-clicking to delete doesn’t actually select the channel, so the previously selected channel gets deleted instead.

Scheduled programs are also plist files. You could create these files with another piece of software, and just rely on The Tube to record them. I haven’t tried creating a file and seeing if it automatically records, or whether you need to start/re-start The Tube to get it to notice. Still on the TODO list.

The video data is stored in a package. There are a couple of TIFFs, for preview purposes, but these aren’t always the correct aspect ration. In fact, since most of my Digital TV seems to be broadcast in 16:9, with black bars on the sides, this is always the wrong aspect ratio as these TIFFs are all 4:3.

Bonus points if you can name the song and artist this preview is from!

Inside the package is a plist file with data about the recording. But the actual data is stored in two files, Media.tvi and Media.tvm. I’m still trying to find out what file format these are - VLC doesn’t seem to recognise them, although I suspect they are a standard file format, just hidden. I’d like to be able to get this data without necessarily having to use The Tube. According to one website, this data is just the raw MPEG stream. Changing the file extension to .mpg or .mpeg doesn’t allow for playback Might need more research.

num lock on MBP keyboard.

I obviously don’t use my MacBook Pro for much data entry. At least, not numerical data entry.

Like almost every laptop, MBP is lacking a dedicated numeric keypad. However, you can turn on the numeric keypad by using fn-F6.

What’s interesting is that there is actually a light under there to indicate when it is on:

When it is on, the remainder of the keys no longer operate - even those not associated with the numeric keypad. The only one I can find that doesn’t have a small ‘num-lock’ extra symbol on the key but still operates is the F6 key, which turns num lock back off.