Archive for the ‘programming’ Category

It’s finally here (or at least it’s in the App Store awaiting review)! This is the Super Conversions (aka SuperConvert) that I’ve always wanted to develop. I had some time, so I coded almost non-stop, and it’s ready to roll. This is a fully functional calculator, with Memory, sin, cos, Pi, tan and other useful functions. See the calculations at the top and the unit conversions at the bottom, with easily selected conversion categories and units. Copy either the calculated value or the converted value.

If you have a support question on this or other SuperConvert or Super Conversions apps, please post a comment below or @Super_Covert on Twitter. There are also “conversion facts” that show up every once in a while. If you have a fact you’d like to see in the App, tweet it to @Super_Convert and I’ll add it to the list. Include a link to an image if there’s an appropriate one for the fact. Note that all facts are moderated.

The design of the new SuperConvert 9.0 is actually based on an old calculator I’ve had for about 28 years. The solar powered device still works, and it’s still the primary calculator I use at my desk. Check out the picture of the app and compare it with the picture I took of my calculator. I used that picture to design most of the visual elements of the app.

If you have any support questions, or features you’d like to see, bugs to report, etc… – please post a comment below and I’ll get back to you.

 

I’m currently testing an iPad Dashboard app for QuickBooks Windows Desktop. It shows a few informational things about your QuickBooks company in a dashboard style app on an iPad. I have no idea yet if it’ll be useful for anyone, or if I’m showing the right kind of information. I’m using TestFlightApp.com to get testers running the app before (if) it goes live in the Apple App store.

If you’ve never published into the Apple app store before, and you’ve never used TestFlight before… I have to say, it isn’t an easy process to use. It took me about 3 hours to finally get the TestFlight process down to the minimum. I installed and deleted and re-installed on my iPad.

Apple doesn’t help – if you delete a device from your allocation of 99 test devices, then re-add it, it takes up 2 slots. I added my personal iPad, then deleted it, then added it again. Presto: down to 97 devices. Avoid deleting a device if you can. Apparently my allocation will reset after a year. When I pay another $99 for the iOS developer subscription.

Intuit has, of course, a developer account and provisioning certificates and all that… but is also limited in the number of devices. When you have a dozen apps you’re testing, then the team doing the apps will need their own iOS developer subscriptions. I guess that’s okay.

And that’s step number 1: get your own iOS developer subscription.

Apple has a great product in Xcode, but make sure you have the latest version – 4.3.3. Because if you don’t, using TestFlight gets harder.

That’s step number 2: use the Mac App Store to install Xcode 4.3.3 – note that it’ll nicely, at least mostly nicely, update your Mac and get rid of the older version for you.

Step number 3 is to always use Xcode to manage your developer profiles and account – go to the Organizer in Xcode, Devices/Provisioning Profiles and click Refresh. That’ll generate the various certificates and such that you need – just click the various dialogs to automatically submit requests and such. Hey, and make sure your iPad is connected to your Mac when you do the refresh.

Next you will need to go back to the Developer site and add an Ad-Hoc Provisioning profile. That’s step number 4. Provisioning, Distribution, New Profile, Ad Hoc. That’s pretty much it – select all your devices (probably only your personal one will be there). Apple will accept that “new profile” as a request, then approve it. Apple used to take up to 24 hours, it seemed, to approve, but now it appears to happen within seconds.

Step number 5 is to go back to the Xcode organizer (after your Ad-Hoc profile is approved) and click Refresh again. That’ll download the new Ad-Hoc provisioning profile.

Step number 6 is to make sure your app is setup with the proper profile. In Xcode, go to your Target, Build Settings, Code Signing. Click the Top “Code Signing” line and select iPhone Distribution. If the Ad-Hoc is the only distribution profile you have, it’ll be the one properly selected for everything. If it isn’t the only one, you’ll have to look at the drop down and select your new Ad-Hoc profile.

Okay, that’s it for the basics. Those 6 steps don’t have to be done again. However, the next part of the process, using TestFlight, is a bit repetitive – you must do it over and over, every time a new tester is added (or at least every time you want to authorize new tester(s) for your app).

Step A: Invitations - TestFlight has a couple of ways to invite folks. I’ve found the one-off invitation form to be useful. Click on Add Teammate and you can enter an email address and a short message. The recipient will get a link to TestFlightApp.com’s acceptance page, with a single button click to accept (and an optional form to fill out if they want to permanently register on TestFlightApp.com).

In addition to Accepting, the invitee must also install a TestFlightApp profile on their device (shows up as an Add my device type of button after Accept is clicked). It’s just a matter of “Yes, accept, yes, install, Done” type clicks.

You’ll get an email for each action – Accept and Device Added. The Device Added email will include an attachment containing the device ID for that tester.

Which brings me to Step B: Add Device. You must add that tester’s device ID to your Apple developer account list of devices. In the developer portal, click on Devices, then click Upload Devices. Select that text file that was attached to the email from TestFlight. That’ll add that tester’s device.

Next, you must add that new device to your Ad-Hoc Provisioning Profile, aka Step C. Click on Provisioning, Distribution, then click Edit and Modify next to your Ad-Hoc profile. There you can Select all the devices for that profile – the new one you just uploaded will be available but un-selected. Just select it and then click Save.

Step D: Update Xcode. Now go back to Xcode’s Organizer and click Refresh. It’ll churn for a bit, eventually updating your Ad-Hoc profile with the new one that includes the tester devices.

Step E: Compile and save your app as an IPA file. Now that you have valid testers in the Ad-Hoc provisioning profile, you can compile a version of your app that is ready for TestFlight-ing. Build for Archiving, then Archive. The organizer will pop up and you can select Distribute, Save for Enterprise or Ad-Hoc. Make sure you select the same Ad-Hoc provisioning profile in the subsequent drop down that you used to create the build. The dialog will ask you the filename to save as an IPA.

Step F: Upload your build to TestFlight. Next click on the Upload Build in TestFlight and upload your IPA. Easy peasy.

Step G: Inform your tester. After uploading, you’ll see the “Permissions” dialog in TestFlight. Select the new tester and click the Update and Notify button. That’ll send an auto-generated email to that tester with a link to install the app.

And you’re done! At least until the next time a tester accepts your invitation, because you’ll have to go back to Step A (well, really Step B since they’ve obviously been invited already) and do it all over again! Ahh well, at least it’s much easier than trying to enter those IDs manually and distribute the IPA to be installed via iTunes or other such messy means.

Okay, so most of you probably already know how to do this, but it only occurred to me today. I develop various websites, usually creating a local version, then uploading it to an online dev version, and finally to the production instance.

In the past, I’d go into my httpd.conf configuration file and change my DocumentRoot to a different website, then restart Apache.

But I realized I could just use a hosts file to point local subdomain to a different folder, e.g. gi.localhost or site2.localhost, or, I could even use the real site’s eventual url: mysite.com or some such.

On my Mac (generally my exclusive machine these days), I edit /etc/hosts and add a line:

gi.localhost       127.0.0.1

Then I make the appropriate changes in /private/etc/apache2/httpd.conf

<Directory />
    Options FollowSymLinks
 AllowOverride All
    Order deny,allow
 Allow from all
</Directory>
NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
    DocumentRoot /Users/mhart/localhost
    ServerName localhost:80
    ServerAlias 127.0.0.1:80
</VirtualHost>

<VirtualHost 127.0.0.1:80>
    DocumentRoot /Users/mhart/gi.localhost
    ServerName gi.localhost:80
    ServerAlias 127.0.0.1:80
</VirtualHost>

In Windows, the hosts file is in c:\Windows\System32\Drivers\etc, and your Apache config file can be found from the Start menu.

First part in a series detailing my journey line as a programmer

I encountered my first computer when I was in the 8th grade. I was living in Reno, Nevada, and had a friend who’s dad ran a couple of 7/11 stores with the help of a TRS-80 and some software he’d written. The program’s listing was printed out on tractor feed paper and was completely incomprehensible to me. I also saw the “Dancing Demon” application. The listing for it was even more crazy since it made extensive use of string packing, where machine language was encoded into BASIC string statements.

I was hooked and had to know more about this “personal computer” thing where you could write your own games and such.

Enter my summer job washing dishes at Dodson’s Cafeteria, circa 1979. I worked full time and saved my money. At the end of the summer, my step-dad took me to Radio Shack and kicked in the last hundred dollars or so for my very own TRS-80 Model I Level II, a 16K black and white computer with a cassette tape drive for storage. I also got a subscription to SoftSide magazine, a monthly publication with program listings n BASIC for the TRS-80. I typed in the listings and, with the help of the computer’s reference manual, debugged the programs and got them running. Thus I began to learn how to program.

In 1980, at the age of 14, I was hunched over a keyboard in the attic office space of our home in Dallas, writing a silly Enterprise vs. Klingons game, with a big blocky Enterprise on the left and a Klingon warbird on the right. Each player used a pair of keys to move their ship up and down the screen, and another key to fire upon their opponent. I knew little about realtime action programming at the time, so all movement ceased during a firing. It wasn’t the funnest of games to play, but it was my first real program, created entirely from scratch.

I was off and running!

I’m working on a couple of things, including a way to make some of our internal conferences interactive and engaging. We have some big touchscreens we can use as kiosks to deliver schedule information, pictures and videos. They have the ability to read an RFID badge or otherwise allow a person to log in to the kiosk. We wanted a way to get people to login and find the additional things available when they do, so we’re creating a few games for people to play, with competitive leaderboards.

Will people log in to play a game? Will other people watch, and thus learn more about the kiosks? Will a game environment around the kiosks lead to interactions among people at the conference, especially interactions away from the kiosk?

This game is all CSS and Javascript and works in Firefox and Safari. I didn’t test it in IE since our kiosk runs on a Mac Mini ;-)

Download Trek.apk

More fun with Google’s Android App Inventor. This one is a Star Trek Communicator. Use the “open communicator” move to “flip” open the cover, then speak your command. The lights do things, too, so press them to find out.

There’s only a couple of commands active in this. I’m demoing it at the Intuit Tech Forum and will add a new command there, plus I’ll probably play with it more and add commands. Fun!

If you haven’t already done so, you’ll need to install the free Google Text to Speech service. Click here to install it.

Download Trek.apk

Click here to download the TextyDriver application

If you haven’t already done so, you’ll need to install the free Google Text to Speech service. Click here to install it.

It’s inevitable. You’re driving down the road, and you get a text message. What to do, what to do. You can read it – that takes your eyes off the road briefly. But… what if you need to respond? Can you pick up groceries? Make a quick call? Stop and pick up the kids from the mall?

You can text back a response. Dangerous. Trying to type while driving is a pain. Maybe your text message app accepts voice and transcribes it? That’s a little better, but you still have to click on the text field, then find the tiny microphone icon, speak your message, then read it to see if it was correctly transcribed, then press the send button.

Of course, you’re about out of luck if there was a transcription error. You have to try and delete the message and start over.

You could call. But that means more button pressing, locating the contact, getting to the right phone number, pressing the call button.

Enter Texty Driver. Massachusetts, like many states, has outlawed texting while driving – and for good reason! As I wrote above, it’s distracting. So the Texty Driver app is voice command driven. You can setup 3 frequent texters and with one button press, activate the texting sequence.

First, it states the name of the contact you are about to text and tells you to speak your message. When you are finished, just stop talking. The Android operating system on equipped phones, such as my Motorola Droid, will connect to servers and transcribe the message. It’s very accurate and works well even in road-noise environments.

Second, your transcribed message is read back to you. That lets you confirm the accuracy of transcription without looking away from the road. You can respond with “Yes”, “No” or “Cancel”. Yes sends the message, with a voice confirmation. No starts the transcription over, letting you speak your message again. Cancel stops the process.

If the app is kept running, there is an option that lets it speak received messages back to you. If one of the selected contacts responds, the app will convert the message to voice and speak it. However, App Inventor doesn’t currently allow applications to run as background processes, so it won’t speak if something else is running, or if the phone is locked.

Click here to download the TextyDriver application

A co-worker of mine told me of an ongoing contest at my office: a contest centered on me. The winner would be the person who could get me to say “Hello” to one of them. Someone would see me go for some coffee or popcorn, and they’d queue up to go into the break room and try to talk to me.

It wasn’t that I was intentionally unfriendly… I was just… focused. This was back when I was coding every minute of every day, cranking out applications at a rapid rate. My fellow programmers joked that I must type with my feet, too, since I was so fast. That speed was, in part, enabled by my ability to focus. Even necessary activities like restroom breaks or a snack were unwanted intrusions, an opportunity for my attention to drift away from the next line of code, the next bug to resolve.

My concentration was such that I would acknowledge other people, but often only in my mind. I said “Hello”, it was just so low-pitched, and sometimes no-pitched, that it was simply not there. So the only winners in that contest were the ones who happened to catch me at a transition, like finishing a bug sheet or a major part of code.

When I joined the Intuit Innovation Lab in 2002, some of that… lack of social grace… was necessarily overridden by the nature of my new work: I had to visit customers and talk to them. Or at least listen closely and ask the right follow up questions. I talked more to my co-workers, with my co-workers, and I learned how to connect with customers.

But all that change was just an unthoughtful response, not a deliberate difference compared to my “contest” days. It certainly wasn’t enough. I still had a lot of friction with my co-workers, viewed as “smart, fast, creative, and hard to work with”. It came to head when I locked horns with a co-worker, pushing things “my way” and not allowing a different opinion into the room. I didn’t like working that way, and neither did people like working with me when I was that way.

Fortunately, my boss at the time, Tara, suggested and supported me with a plan to change. She hired an executive coach for me. With his insights and help, I transformed how I interact with people – everyone, from my family, to my co-workers, to customers and just to everyone I meet.

I first took a personality test called an Enneagram. There are many such tests out there, and the Enneagram is probably one of the best. It has 3 person types, and 3 sub-types. The three types are Body, Mind and Feeling. I’m a Body type, with a sub-type of 1 – the Reformer. I want to solve problems, to make everything better. At my worst, I’m a perfectionist, plowing ahead with my own solution and pushing everyone else to the side.

The key to my transformation was to take the worst stereotype of a Reformer and apply that to myself. In every situation, I would laugh at that stereotype picture and refuse to fit into it, even as I knew that my normal mode would fit into it! I became a listener, a peacemaker, able to get things done as a team, as part of a team. I could let other ideas join my own without feeling like the solution would be “worse off”.

I can feel the difference, and it usually astonishes me. I’m happier, friendlier. I can connect with almost anyone. I get onto a plane where a flight attendant is greeting people. She didn’t look particularly happy, saying “Hi, welcome aboard.” I said, “Hi, thanks! How are you?” It was amazing – her face brightened, she talked some more, told me thanks for asking. I could hear her behind me greeting others with a smile! That’s why I’m astonished – I really had no idea before that I could personally, individually, brighten someone’s day just by, well, caring about them, to be honest. It’s more than just a “friendly” hello, rather I actually mean it when I ask, “How are you?” I talk to people about their day, their work, their feelings.

Those of you who know how I was “before” will, I believe, be pleasantly surprised at how I interact with you and those people around you. It’s a world full of people out there, and they’ve had all kinds of days: good and bad and indifferent. Open up ye engineers and explore the people around you. We’ll all be happier for it!

Software is… hard. There are so many things to think about, even when creating an offering as simple as an automated email message. Click on the image on the left and you’ll see what I mean. Notice the link in the bottom status bar and the highlighted link in the text. It’s for Hertz.com, but the actual link reference is for Hertz.com. – an added “.” period. Note that it is also an SSL secure website, which means that the security certificate needs to exactly match the URL if you don’t want the browser to pop up a scary “security exception” notice. Someone at Hertz.com didn’t get it right. More likely several someones.

Creating good software takes an attention to detail that the “engineering” discipline attempts to enforce. But unlike many traditional engineering tasks, there are many different ways of accomplishing the same task, and they can all be valid at one point or another. The number of systems, concepts, languages, end customer environments… it’s staggering how much a programming “maven” needs to keep in his or her head.

Processes and project roles are a big help. A project manager to plan and maintain the big picture, designers who sweat the details, developers who are experienced and focused, quality assurance folks who nitpick every little comma and period. Every one of those roles has a responsibility to catch that “Hertz.com.” error.

  • Did the project manager ensure that the wording in the email is correct?
  • Did the designer check the text, the fonts, the highlighting colors?
  • Did the developer know how to construct a link in both HTML and Text formats?
  • Did the QA folks actually click the link – and clicked it using a “clean” environment?

I remember a tester who worked on my EasyACCT stuff back at Tax and Accounting Software Corporation (TAASC) in Tulsa – Brian Anderson. He was a superb tester, and later became a developer as well. He owns Hostek.com, where this website (and my others) are hosted.

He would sometimes come up with the craziest sequences to duplicate an error – press Ctrl-Shift and then down arrow five times, type “Q-2″ and press Enter, and you see this error message. Maddening. But if Brian tested it, then I was confident that my application was thoroughly tested and working as good as mortal man could make it.

A great tester is worth his or her weight in gold, as is a nit-picky designer, a thorough and knowledgeable project manager, and a careful and experienced developer. Don’t skimp on your people, and always have at least one truly experienced person in your project team. Programming is an art, not a science. You put chlorine onto gold, you’ll get dissolved gold and a very unhappy investor. There aren’t variations when those two elements are mixed. You design an application, and there are dozens if not hundreds of ways that things could be mixed to create the working application. Experience is absolutely necessary if you want Quality.

I’ve been using the App Inventor for Android for a while now. I managed to get in on the private beta, partially on my credentials as an MIT Scratch educator. I’ve taught 3 Scratch classes to kids from elementary to high school. I also follow the App Inventor Google group and came across a few people needing a URL Encoder.

I’d already written a simple URL encoder while testing out a mapping application. It uses the Google Maps staticmap API function to retrieve a map with markers. The markers are created by passing in an address, and although many browsers will accept spaces in URLs, the Image component in App Inventor won’t: you must encode a space either with a plus + character or with the hexadecimal encoding %20.

The newline character “\n” is also encoded, but the routine to test for it is separate from the others as App Inventor doesn’t find the correct location of various characters when you include it.

Here are the blocks for the character codes and their translations, plus some misc variables used in the encode routine. The “chars” block contains $&+,/:;=?@ “<>#%{}|\^~[]‘ and the codes block contains 24262B2C2F3A3B3D3F4020223C3E23257B7D7C5C5E7E5B5D60.

Now the URLEncode routine itself is fairly simple. It loops through each character in the provided text and searches for it in the chars and ctrl strings. If it finds it, it calculates the offset position for the code and adds that to the URL. If it doesn’t find it, then it just adds the character from the provided text. The offset position for each character is ((pos-1)*2)+1.