Archive for the ‘programming’ Category
As I’ve worked building the Cartera OfferLink app on iOS, I’ve learned a little about Apple’s Push Notification service. One thing that I wanted to do from the start was avoid sending a notification when someone might be sleeping! Every once in a while, I’ll get a text message early, like 6am. I’m a late sleeper, and the BUZZ! that my phone makes will always wake me.
I really don’t like that.
So I decided early on that I’d do the best I could to avoid sending messages at inappropriate times. I know you can change your phone settings to avoid notifications at certain times, but the default – and most folks devices are set to the default – is to just deliver the message when it arrives, buzzing and binging and waking you up.
What I did with OfferLink is send the current time, local to the phone, to the server, along with its data requests. Then I calculate the seconds offset from the server and the phone’s time. This gives me the current time zone of the phone as of that request.
It’s not a perfect system – the user could fly around the world to a different time zone, and get a notification before the app refreshed its data and told the server its new time zone. But it should be a good 80/20 solution – solving for 80% of users.
// (pseudo code for handling the time zone)
localTime = time();
remoteTime = localTime + tzOffset;
if (hourOf(remoteTime) > 8 && hourOf(remoteTime) < 22) doNotify();
Please be kind to your users – handle push notifications in such a way that you don’t annoy them.
Or wake them up.
Thought I’d take a second to recommend Blitz.io – a cloud service to load test an application or API. I found it via NovaNet after a quick Google search. (Note – I’m hoping for some free extra credits at Blitz indicates they’ll give if you blog about them.)
But hey, I might have blogged anyway – it’s VERY cool. I was able to immediately test my API and get a response time and likely capacity.
So I signed up, then ran a few more tests. I modified my app slightly to accept recognition that it was being hit by a load test, so that PUT data to my REST API would go into development database rather than my production DB. It took maybe a minute or two to update, and BAM – I could run a quick (free) load test of 10 users for 6 seconds.
Neat. I’m waiting for a company response to see if we have a load test mechanism. If not, I’m going to let our enterprise operations team know I’m going to load test, get a good time to run it, and just nail the server and see how it does.
I remember writing my own load testing application back in the day, and now I’m happy to highly recommend Blitz.io – it’s an Easy button.
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 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:
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?
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.
If you haven’t already done so, you’ll need to install the free Google Text to Speech service. Click here to install it.
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.
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!