Sunday, August 30, 2015

New Open Source Library for Extracting Schedule Data from Digital TV ATSCgh

I decided to release as open source (MIT license) my collection of Objective-C classes that can parse out the schedule information from ATSC broadcasts. These are just the classes for that narrow purpose and anyone using them will have to make their own TV tuner class to interface with the actual hardware. So, there isn't even an Xcode project included.

If 2 people can actually use this code I will be happily surprised. Regardless, here it is on Github.

Sunday, August 09, 2015

Goodbye to a Colleague

Yesterday, my former coworker Alan Gorman died of cancer at 51.

Alan and I were hired a month apart at the then CambridgeSoft to work on ChemDraw. He was the PC guy, and I was the Mac guy. For 7 years, we'd chat over cube walls or sat back to back. I've been in more meetings and exchanged more Emails and had more, cordial, arguments with Alan than any other human being. 

Given the stress of keeping ChemDraw's old codebase moving thus paying the salaries of 150 CambridgeSoft employees, plus my own ego and snippiness, it is remarkable that we got along. He was an amazingly dogged debugger, and would follow the trail of a bug for days. It was to him that new document features were assigned, so if you are a chemist who makes use of the Stoichiometry Grid, or need to do an R-group analysis, or if you are a biologist composing biopolymers, thank him.

He was better suited for management, and much more organized, than I, so to him fell the horrible task of eking out productivity from our outsource developers. I certainly didn't envy him that but he took the burden with characteristic stoicism and, mostly, contained temper.

Being the Mac programmer, I fancied myself an artist of sorts, but it was Alan who shamed me with his constant flow of lovely vectored templates for BioDraw such as this one displaying the organelles of an animal's cell.

While commuting by train, he'd draw these out with ChemDraw's own spline tools, making him the absolute master of using ChemDraw to draw. Who knows into how many PowerPoint presentations Alan's bright and joyous vectors have found themselves. 

If there was anything I learned from Alan, was something he didn't learn while I worked with him. He commuted 3 hours a day with some combination of train, bike, truck or car. He was known to sleep in his cubicle if he missed the last train. Whenever I think of getting one of the many available iOS jobs down in Boston, I remember Alan and say no. 

Being a transplanted Brit, he loved both kinds of football.  The only time he made it to my house was to watch the World Cup when England was playing and he couldn't get it at his home.  He was a Pats fan; I remember telling him the Pats had traded Randy Moss and him looking like those words made no sense in English.

I hadn't talked to him since February of 2014, I was regrettably miffed with him for two, in hindsight, trivial slights and hadn't even known he was fighting for his life this whole time. Alan was a good person, coder and father, and the world is a lesser place without him. 

Wednesday, June 24, 2015

Amazon Vine and The Power to Tax is the Power to Destroy

For many years, I've been a happy member of Amazon Vine, taking frequent deliveries of random consumer items for review and then keeping them. I've reviewed 432 items over the years, and it has been sweet.

But, in today's eMail, came word that Amazon would now be reporting the "Fair Market Value" of my review items to the IRS so I could be taxed for the income. So instead of being free, items would now cost their value multiplied by my marginal tax rate. Since my marginal tax rate is 25%, it would be as if they were offering me a random assortment of stuff, most of which I have no particular need for 75% off. And, I can't sell the stuff, so there is no getting the money back.

Looking through a couple of pages of stuff I reviewed recently, I have to think that few are things I would have purchased for 75% off.

  • 6 Lightning cables (maybe I could have used 2)
  • Mattress. Like this mattress but at the time, I struggled to even justifying it for free, there's no way I would have taken it.
  • Kids bow and arrow set. Maybe.
  • Princess mechanical pencils. We've got plenty of pencils already.
  • Task chair. I didn't really want it when it was free. No way.
  • Skin cream. No.
  • Mango juice. No.
  • USB scanner. No, have too many already.
  • Children's book. Too young for my youngest. No.
  • Decoratable toy. Probably
  • Avenger's movie toy. Cheap looking junk. Nope.
  • Pencil sharpener. Already have some. No.
  • Expensive noise canceling headphones. On the one hand, I have headphones, on the other hand, very nice looking. Maybe.
  • Cheap headset. Nope.
  • Hammer. Probably.
  • Pack of children's scissors. Who needs an entire pack of scissors?
  • Mattress pad. Probably. 
  • Taco shells. Nope.
  • USB wall outlet. Too much trouble. Nope.
  • Air purifier. Already have fans in the house. 
Basically, I won't be able to justify the expense of much more than 1 item in 10 if I have to pay for it. 

And then there are books. Non-children's books take time to read. As an experienced iOS developer, my short term contract rate is around $110/hr. It might take literally thousands of dollars worth of my time to read a book. Even when they were free, I rarely reviewed real books. The fair market value for a book for me is a large negative number. I can't imagine ever reviewing a real book again for Amazon Vine.

I understand that somebody from the outside might see that I get a printer priced at $100 so I've made $100 worth of income. But that printer is worth much less than $100 to me, otherwise I would have gone out and bought one already. As it is, I have a bunch of perfectly good printers in the house waiting to be hauled to the electronics recycling center because they are out of ink. If Amazon were to offer me another free one, I might not take it. Now that the IRS will be charging me $25 for it, there is no way.  Fair market value has no meaning to me when I can't resell the item, and it's a random assortment of stuff that I'm not in the market for in the first place.

[Update: Well this has settled down and the situation is better than the initial reports. "Fair Market Value" ranges from 0% to over 100% of Amazon's price. Unfortunately you don't know it before you agree to the deal. Food, cosmetics and other disposables are generally 0%. And I guess you can now sell your items after 6 months. Sometimes I can't help myself, so yesterday I took in an expensive Android tablet with its 101% Fair Market Value, oops.

I've definitely scaled back my reviewing, and will not take items I perceive as low quality. Thus my average review rating has gone up and is now over 4. In the past, I'd have taken a try for something iffy and would give out my share of 2 and 3 star reviews.]

Saturday, June 13, 2015

Apple Needs to Thin Out The PNGs

Had a pleasant time at WWDC. As is my habit, I spent most of my time in the labs going over every issue I had that had vexed me. One of the highlights were some soon to be released improvements to my SVGgh rendering library to allow live updating in Interface Builder via support for the IB_DESIGNABLE switch. It took effort, but I finally beat my project into shape, got rid of the old fashioned static library, and was magically playing with showing SVGs inside of IB, and playing with my various button themes. Seeing that first image for the first time was sweet. Also got an assist with some long term problems with rotated gradients, and some pointers about text on a path.

But it also reminded me of how obnoxious Apple's reliance on fixed size PNG bitmap assets has become. The iPhone 6+ brought a need for a 3rd image resolutions, and the possibility of responsive design brings a preference for even more. I spent a couple hours slicing together the 30 PNGs I needed for use with a UISegmented control last week. I have better things to do. Apple added support for dropping a PDF into assets last year, but that just automates the process of making a bunch of bitmaps. And bitmaps are bulky, to the point that Apple will be automatically culling unnecessary ones out before installing them on user's devices

I find my own workflow of generating SVG artwork to be much more satisfying. They match up well with the simple, clean themes encouraged since iOS 7. They are less bulky and I typically only need one image per button. I can even use the 'currentColor' property to manipulate pressed and unpressed states from Interface Builder. I can use SVG's 'non-scaling-stroke' vector-effect to keep outline strokes to be 1 pixel wide regardless of scale. And with responsive design, I can use auto-layout to make my view elements whatever size I need without having to worry about scaling issues.

I would not be surprised if Apple were to support either an existing vector format, or perhaps a new one with size hinting in some future version of UIKit. It's past time.

Saturday, May 30, 2015

The 5 Rating Minimum and Releasing to the App Store

Here is a screen capture of my app TV Towers USA as it looked in the iOS App Store on May 2, 2015:
May 2, 2015 (or so)
And here is what it looks like today (May 30, 2015):
May 30, 2015
Notice that the current version has no stars. Why, because on May 3rd I released a much overdue update which included bug fixes and updates to the database. Which means the new version has only one review, which means that potential customers can't tell at a glance that it's a decent product (lifetime rating average 4.58). Which means sales drop. April sales were $7.79/day, whereas since the update, they have been $4.70/day. (Obviously, I'm not quitting my day job for this product, either way.) 

The app gets a review every month or so, so it will be Autumn before I accumulate the 5 ratings needed to get my rating display back, and then it will be time for another update.

I don't understand how some apps accumulate thousands of reviews. It's true that I've avoided fame and fortune, but my niche apps are almost always well liked by the folks who purchase them. The problem is that only one person in a hundred will write a review, and small apps that are responsibly updated suffer for it, or allow people who post phony reviews to benefit. 

I was interviewing for a job last year, down in Cambridge, and one of the engineers looked over at me and asked suspiciously how I'd managed to get a perfect 5 for 5 for 5 users rating on the then current TV Towers.  The hard way, apparently. 

Monday, April 27, 2015

SVG Paths Tutorial

About a year and a half ago, I left myself a Reminder on my iPhone to make an educational video about creating path elements in SVG documents. I finally fired up ScreenFlow and did so. 27 minutes about me talking about the path element. It's more interesting than it sounds—how could it not be?

So hopefully, one or two of you will be out hand crafting your own SVG shapes like this one:

Tuesday, December 23, 2014

Reusing An Old Mac Mini

At every Mac hardware launch event, Phil Shiller will go through the features of the latest/greatest and towards the end will bring up the Environmental Checklist as at the 2012 WWDC when the MacBook Pro with Retina Display was introduced. “...and of course the glass and high grade aluminum is really desired by recyclers.” I don't know exactly what high grade aluminum means, but the aluminum in beverage cans costs $0.90/lb, so whenever I hear Phil say that I sort of shake my head at the concept of looking forward to turning a $2200 computer into maybe $3 dollars worth of scrap metal and glass.

I think we've all heard the mantra: Reduce, Reuse, Recycle. If we want to tread lightly with our resource usage, this is what we should do, in the order in which we should do it. Reducing is more important than reusing, and reusing is more important than recycling.

So this brings me to my little project to repurpose my wife's 2006 Mac Mini Core Duo. She'd run Windows on it for many years, and it had eventually just got too slow for a variety of reasons—no official Windows 7 BootCamp support, only 2GB of RAM, a bunch of junk getting installed. I replaced it with a 2012 Mini, and we hope to get at least an other 8 years out of the replacement. But this left me with an old Mac Mini which I knew to be slow, capable of at most running OS X 10.6.x, 2GB of RAM and 32-bit only software. It had a nice hybrid 1TB drive but only a SATA 1 bus. It didn't have much of a future, and the lack of software updates made me worried about even putting it on the Internet.

Apple had not gone out of its way to make this computer re-usable. It was close enough to the next years model Mini that it turns out you can just flash the firmware to turn it from a Mini 1,1 to a Mini 2,1 and raise the maximum RAM from 2GB to 3. Yet this is a Internet hack and not an automatic install.

An official Windows 7 Boot Camp driver set would have gone a long way towards keeping it in service in the first place.

The processor was a socketed Intel Core Duo. I was able to find a 64-bit Intel T7600 (2.33 Ghz), refurbished (i.e. reused) on Newegg and swap it out, making it a computer capable of running 64-bit OS X 10.7 Lion, and yet I had to jump through all sorts of hoops to install Lion on this box: I ended up booting my Lion capable early 2011 MacBook Pro off an SD card and mounting the Mini as a targeted Firewire drive to install Lion. Apple could have spent the engineering time to make this all automatic to any Mini with a 64-bit processor regardless of its provenance. It would have extended the lifespan of the Mini and reduced the resources needed to be a Mac user. I bought an extra license for Lion from Apple's website, although they don't send out DVDs anymore, I just downloaded the installer from my previously purchased items. 

Since I'd be in there replacing the CPU and upping the RAM anyway, I bought a Broadcom Crystal HD video decoder on eBay to replace the unused Airport card in the PCI-e slot, and put in a new clock battery. I also managed to break the audio board's ribbon cable port; so I ended up ordering a replacement InterConnect Board. The result is a reasonably fast machine, easily twice what I started with, although the memory access speeds and slow SATA bus keep it from living up to its processor. I'll either make it my daughter's computer, or use it as the HTPC in the TV room. It runs MythFrontend playing 1080p MPEG2 over the air recordings well, with the CPU/GPU temperatures barely above 100°F, extremely quiet. I've been trying a cheap Raspberry Pi running XBMC as an HTPC, and this Mini is more stable, responsive and flexible (it'd better be for the price). 

  • T7600 refurbished $75
  • 2GB SO DIMM DDR2 667MHZ RAM $27 
  • Broadcom Crystal HD Video Decoder $22 
  • Mac OS X 10.7 $20 
  • Thermal Paste, Nylon screws, etc. $5 (or so)
  • Replacement Interconnect Board $32 

So, a total of around $181 for a computer with such niceties as TOSLink out, Gigabit Ethernet, Firewire 400, a line in audio port, an infrared remote, slot loading DVD player, a real Intel 64-bit processor running OS X, but with such obsolete tech as SATA 1, USB 2, slow RAM, DVI and slow Intel integrated graphics. Presumably, I didn't really have to buy a 10.7 license, and I could have not broken my Interconnect Board, and maybe your software doesn't use the decoder. So, maybe $107 for a greatly improved experience. Perhaps you wouldn't buy a computer with these specs these days, but it feels good to reuse it instead of putting it on a shelf till the day comes to junk it. As this Mini doesn't have HDMI out, I needed a DVI+TOSLink to HDMI converter box do that was $30 and another 2W power drain—I already had all the cables.

And, I have to ask the question, what could Apple do to help me use less resources? Making computers that are easier to recycle or computers that are more easily reused? 

One major thing to take into account that I hadn't thought of earlier is energy efficiency. The 2014 Mac Mini is admirably energy efficient for an Intel system, drawing 6W idle. This hacked Mini running a non-approved firmware/OS and an unexpected processor draws 19W both while idle and asleep. Assuming I use it to replace my HTPC Raspberry Pi which draws 2W at most, I'm not being as resource conserving as I could or perhaps should. Which would be another benefit of Apple providing an official software stack update for this machine, I'd hope they could have gotten it closer to the 14W idle that a similar 2009 Mac Mini uses. 

At one time, I had a Dell Pentium 4 here in the house that I repurposed as a Linux server, but I felt obliged to replace it, not because it couldn't do that task,  but because its 110W idle power draw was ridiculously energy intensive. Any savings in money and manufacturing resources from keeping it was swamped by the long term cost to just keep it running. In that case, it made sense to me to replace it. This Mini, for instance, would have made a fine replacement for that P4 Dell as it is faster and has ⅙ᵗʰ the power draw at idle.