Augmented Reality using Appcelerator Titanium Starter

I just purchased this book by Trevor Ward, actually bought the bundle – eBook AND paper copy ($17.99 for both), because sometimes you just want to dog ear a page, read it on a plane during take off, or on my deck with no glare). Even though I havn’t opened the eBook yet – my mind is whirling with possibilities.  I can’t wait to see what I come up with.  For those of you that are interested – below is the description and a link to the publisher’s site where I bought it.  Keep watching for a book review, and new projects that implement what I learn.

Book details from the site :

Titanium Mobile has quickly become the platform of choice for many mobile developers and is growing and changing at a rapid rate. From the implementation of CommonJS, Cloud Services, MVC design patterns and more, the last year in Titanium development has been a roller coaster of change for the better. Augmented Reality is a hot area for mobile applications and this book along with the augmentedTi open source application will give a great start to all augmented applications.

This book will show you how to build an Augmented Reality application, which is clean, efficient and usable. It shows how to hide the processing from the user and build a display which updates and rotates smoothly.

Mobile devices have got more powerful, but they still have limitations. Augmented Reality applications test these devices to breaking point and without the correct coding techniques make the applications unresponsive and cumbersome.

This book gives a solution, which will enable you to build an effective application, and is accompanied by a complete working application and source code. It’s essential for anybody who is creating a multiple points of interest augmented reality application. It shows how to build this type of application efficiently and takes into consideration the devices limitations and processing capabilities.

You can see more here and order the book from here – Augmented Reality using Appcelerator Titanium Starter


Posted in Appcelerator | Leave a comment

Jadu and shared content

Skip this and just watch the video

Jadu is an amazing CMS and delivers a host of functions out of the box.  Messiah College has adopted this CMS for our site and we launched a couple months ago.  As we continue to work with it, we’ve found some needs that go beyond what the CMS offers.  The most recent item is shared content.  Say for example the Admissions department wants to post tuition rates on their section of the site.  That’s not a problem, and obviously default functionality.  What if the Nursting department also wants to display the tuition rates on their section of the website?

Traditionally you would just link over to the master page that lists the rates, or you they would copy and paste the content from the main page into a tuition page under the Nursing site.  There are undesirable outcomes for both of these solutions.  Linking to the main tuition page is perfect for data integrity, and keeping the main content updated in one place.  The navigation becomes an issue however.  You don’t want to open a new browser, since you’re not leaving the website.  and you if you link over to the main tuition content, and the user starts clicking around, they’ll have a back arrow mess to get back to the page they left from.

Copying the content from the main tuition page to a new page under the Nursing major pages is a quick and easy solution, however, can cause a world of problems when the tuition rates change, verbiage is added, or any host of things happen to the main content.  Now there’s an outdated copy of the rates sitting around and nursing students will be irate when they find out the price is more than they read on the site.  It also creates a maintenance nightmare for the Nursing content editor if they’re supposed to look at those rates every day and catch any changes.

Imagine if all the majors on campus decided to do this!  You’d possibly have hundreds of outdated copies and multiple versions of the college tuition and in these days – possibly a law suit.

Enter the Shared Content Block.  I took a look at how content is handled within the CMS and derived a solution that contains NO MODIFIED CORE CODE, yes, that’s right – there is no core code modified here.  I do have a custom class file placed in the /custom directory that I call, and where some of the magic happens.  Shared content is marked in the CMS with a custom widget style, and the Shared Content Block widget uses that marking to list content that is able to be shared.  (yea, that sounded confusing to me too)  Its easier if you watch a demonstration –

(Full screen works best)

Its super simple to use, and in fact we’re using it today with all of our Graduate programs content.

Posted in Uncategorized | Leave a comment

Autom8 your connections

Mac Automator

UPDATE : 10/10/2012 8:00am : Apparently I have no idea what I’m doing :-/  I built the tutorial as I was building the scripts. These did not actually work at the end of the day or the next morning.  Working on determining why.

UPDATE : 10/10/2012 8:45am : So I figured out these do indeed work, however, my Automator Launcher process was wedged, and these three scripts were just sitting there, not doing anything.  I found this by running Activity Monitor and looking at the processes.  I killed off my scripts and the launcher process, and now they work.

I’m lazy.  If I can write a program or script to do something to save me time, I’ll do it. Especially when I have to do something over and over and over. Take for example connecting to servers every morning when you log in, or disconnecting them when you leave at night.  I have a MacBookPro and I repeatedly connect and disconnect to various places on campus.  I also have a fire-wire drive that is my Time Machine backup.  If you’ve used a Mac, you know you get ‘yelled at’ if you simply unplug it without properly dismounting it.

When you have 4-5 servers connected and external devices connected, that’s a lot of wasted time even just ejecting them when you want to leave. So I started a quest to save me time (even if its just 2 minutes a day, it adds up, right?).

Enter Automator.  This is a special utility on Mac that lets you build a set of steps and run it.  These can be as simple or as complex as you want.   Here is what I wanted to accomplish –

  • connect to my 5 servers at 7:30 (when I’m typically at my desk)
  • disconnect from those servers at 4:50 (when I’m ready to leave)
  • disconnect from my fire-wire drive at 4:50 (since this auto-mounts when I plug it in in the morning)

Here’s what I did –

Open Automator (from the Launchpad)

New Application

On the left is a set of action.  Either choose the Files & Folders listing from the Library column, or type in Get Specified Servers.

Drag that from the left onto the right pane like the image below –

Then we want to tell Automator to do the actual connecting to these servers.  Be advised – if you have to log into these servers, and those credentials are not stored in your key ring, it will prompt you to log in to each server.

Now save it.

Create a new iCal Alarm – File | New | iCal Alarm

Find the Launch Application action and drag it over.

Choose ‘other’ from the drop down list and go find where you saved the application above.

Choose the application you built before and click Choose. Along with any other actions  you want. I build a separate application to disconnect my Time Machine drive, and added it below.  Save this and it will prompt for an alarm name –

Once you enter that, iCal will launch and you can then edit the alarm details, such as when time and how often you want this to run – for me we’ll set this to every day @ 7:30am –

Now my computer will connect every morning and save me the headache of doing it myself (I said I was lazy, remember)

So now – at the end of the day – I have to pack up and clean out my coffee pot – so I want the computer to disconnect from all of these things.  Earlier I created a separate application to disconnect from my Time Machine drive, so I could execute that separately if I had to.  I’ll set up a new iCal Alarm to disconnect the servers and my drive at 4:50PM each day  just like we did before.

then save it –

Save iCal Alarm

Then set the time / date in iCal when it opens.

iCal set time and date for automator application run

Now you’re done, and I’m happily lazy.

Posted in Personal | Leave a comment

Inspiration found

We all need it.  Sometimes we have it.  Sometimes we loose it.  Sometimes we find it in the oddest places.  I’m talking about that odd little feeling that can make the day fly by or drag on … inspiration.

I’m always looking for inspiration, whether its for an app design, a new method of working something out, or even just something to get me through a tough day. When you build applications like I do,  there are these things called design patterns.  Essentially they’re best practices for a design layout, the way its been proven to work efficiently.  There are good handful of design pattern sites that have pages and pages of screenshots or sketches to help guide and inspire you.

For a programmer, and if you’re looking at code, you can get some design patterns that help you code, or help you understand how things should work.  Sometimes these sites are helpful and other times no so much.  I’m always on a quest looking for great sites that I can go to to be inspired.  Smashing Magazine is one I like to read.  Even though I’m not a designer (which is what a lot of their content is geared toward) I still get inspired reading about the various font treatments, use of white space, or even  how to freelance and cut off that terrible client 🙂

I recently found what I think is the best mobile development design pattern site and that is – Inspired UI.  They have a list of categories down the left and pages of screenshots from various apps that deal with the type of layout pattern you’re interested in.  I had to design a mobile page for building details.  On a 3D map of campus, you select a building and the next screen lists all the important information about that building.  Feeling uninspired, I krufted up a terrible screen that did have all the information listed, but it was pretty dull.  After finding this site, I clicked to the Venue category, and saw a multitude of ways to present that data on the screen.

Now – be advised – I’m not saying – rip off the screen layouts from these design pattern sites.  Use them as a basis for your own design.  These screens all have common elements to help you understand what details are important.  Quite possibly, these might include items you don’t think are important.  But when you see they’re on a screen in the Four Square, or Pintrest apps, they just might be valuable to your audience as well.

So a big thanks goes out to @inspireUI because your site helped inspire me and design a screen I was having trouble with.

UPDATE: Just found their facebook page as well if you’re interested.

Posted in Appcelerator, Personal | Leave a comment

Titanium Resources

Over the last 6 months, I’ve gotten into Titanium Mobile heavily.  I recently completed work on a  conference app for a client using Titanium and really love working with it. This was the 3rd app I’ve written (iMessiah / PABUG ), but first using Titanium.  I started following a bunch of developers on twitter and reading more and more tutorials, code, projects, and interacting with the community more.  It seems that every day or so I bookmark a new page that I find is interesting and realized that there may be others out there like me looking for resources and googling to find them.  I’ve decided to post them here for anyone to access, with the hope that it will help someone else out.

You can see my list of Titanium Mobile resources here.

If you have one to add and/or have suggestions on the organization, please email me [ jonathan.wheat @ ] and I’ll add it to the list.

Posted in Appcelerator | Leave a comment

New Mobile App built

I’ve been working hard the last few months learning Titanium from Appcelerator.  Its a pretty amazing mobile sdk allowing you to build and deploy mobile apps using JavaScript as the core language.  When you run the app, it compiles to native code (Objective C for iOS) and because of that it is super fast.  You can also build for Droid as well using the same codebase.  Depending on the one you build and test with most (for example I did iOS first) – you’ll have to make some layout tweaks.  Especially for droid with all the different screen sizes.

I’ll save my Titanium review for another time, so if you’re interested you can take a look at the screenies for the new conference app here (still awaiting review in the app store – yippee)

Posted in Appcelerator | 2 Comments

Failure To Launch

I’ve recently completed a web app for an event registration on campus, and it is now being tested by the client. I sent an email to the client letting them know its ready for them to test it and to send me any changes they would like to implement (I get a salary so doesn’t matter if is 1 thing or 100 things).

They actually did a nice job going through and making comments, however, their delivery put me off a bit.

Why will people say – “The app [insert whatever here] works great [ sometimes they even say perfectly] and we’re ready to launch it.  Can you change this text, change this email subject line, make the user experience path go here instead, alter these prices and add a link to our Facebook page?”

Ok.  All really good feedback (because the customer is always right, except for when they’re incredibly stupid), but don’t tease me with the first line into a false hope that I’m “done” working on the project.

I’ve done this enough to know – once it launches there will be tweaks, that’s expected.  I understand and HOPE the client tests (beyond my testing) it and makes comments and had changes.  But please don’t tell me its ready to launch – and give me a pick list like a housing inspector.  “Yea, this house is ready to sell, you just need to replace the roof, fix the railings on the deck, patch the sidewalk, repair the furnace”

I’ve also done this long enough to expect this type of to do list, today it just got to me.  Maybe they’re trying to make me feel good before dumping work on me.  Maybe they’re uncomfortable asking me to change things, I’m not sure. I’m happy to change things, I even asked them to tell me what I needed to change.  But that “we’re ready to launch” followed by the task list thing stuck me.

Doing that completely negates the first sentences of the email where you praise and assure me you’re happy with the solution.  I’m all about improving something I’ve built ESPECIALLY when it improves the user experience.

So please, if you’re reading this and you are the client, here’s a suggestion.

If you’re asked to test and submit changes, do that.  Say – I’ve worked through the app and here is a list of changes I’d like.  You can even list them by priority, or by – needs and wants.

If you think you have to give praise – say – thanks for all the work, I think we’re almost there, here are some final things…

Ok, I’m good now, got some changes to make.

Posted in Personal | Leave a comment

How Chrome saved my bacon

I have a MacBook Pro and I have a ‘computer-all-my-life’ background and know the importance of backups and keeping them secure.  The institution I work at is still predominately windows – and therefore has no backup solution for mac computers.  I’ve been hounding them for months to allow me to purchase an external drive so I can use Time Machine to backup my system. This is my entire career of code here.  They dragged their feet and never came through.

Apple folder / question mark icon means you're probably screwed.

The icon of Death

Two weeks ago the inevitable happened.  My drive crashed.  On a mac, when it can’t find the filesystem, you don’t get a geeky message like you do on windows explaining what is wrong.  What do you get? This precious icon to the right.  Apparently that is the universal icon for ‘you’re screwed’ with an Apple-esk design to it.  After much googling about this – it seemed that icon meant one of two things.

  1. The problem could be simply the mac couldn’t find the startup disk, and you just reconfigure it using the iOS boot disk. Or – more likely
  2. You’re screwed, and your filesystem is so messed up – you might want to go back to paper and pencil and use a real folder like the one in the icon for storage.

To make a long, depressing story short, my drive was toast, and I replaced it.  Out with the bad drive, in with the good drive.  We have an amazing disk image install process here – so all I had to do was plug in a network connection and power, hold down N and power it up.  The MacBook Pro then went out and found the image on our network and through a wizard – installed Lion (an upgrade even).

Data recovery efforts were grim.  I created a Knoppix CD and hooked the dead drive to an external SATA rig and attempted to get some specific code and MySQL databases off. These particular items were not in production anywhere, and were pretty important to me.  I was able to scavenge some code with no errors, but the databases I needed were all corrupt.  I’m guessing because they were opened when the drive hit the fan.  So I have code, but no database for it.  Yes, I can reconstruct the database from looking through the class files, determine the field names, etc … fun.

Enter Chrome.

Remember Chrome? That’s what this is all about  (we’ll come back to my database reconstruction efforts in a bit)  During the re-setup process of my laptop I had installed Chrome.  I prefer this browser over all others because its fast and doesn’t feel bloated like Firefox does (which used to be my favorite browser).  I now have a new appreciation for Chrome – because I learned something I had no idea about.  With a fresh iOS installation obviously I didn’t have a backup of anything, much less my bookmarks.  I open Chrome, sign into Gmail – and a little while later, I notice all of my bookmarks are there.  All organized like they were before the crash.  Not only that, but any site I had told to “Remember Me” for logging in – it did.  Very cool.  I even texted a friend and asked  – ‘How does chrome have all of my bookmarks!?’

I’ve since learned that Chrome is linked to your google account (or can be).  You can configure whatever you want stored by accessing Chrome Preferences .. or by entering chrome://settings/browser.  From here select Personal Stuff from the left, and you can connect / disconnect your google account

Chrome Settings : Personal Stuff

You can also choose to manage your synced data on Google Dashboard – this webpage (once you log in) allows you to stop the sync and delete the data that has been synced, along with a host of other google settings not related to Chrome.

Clicking advances settings gives you options to choose what you want synced.  From here you can also choose to encrypt all data that is sent – default is ‘encrypt passwords’ and change the passphrase – might be a good idea – depending how paranoid you are.

Chrome Settings | Advanced

Database reconstruction

We’re back to my database woes.  Because I had the ever so controversial autofill checked to sync my forms, and since I originally hand built the MySQL database using PhpMyAdmin – when I got MAMP all set back up – I went in to build my database and tables.  Imagine my surprise when it did a drop down suggestion when I typed in the database name.    I created a new table and when I started entering field names again, it listed suggestions from when I had done it before.  Very cool.  So I was able to fudge my way through creating my tables again because I had some paper notes about the origianal names for things.

But what about the seed data I hand inserted using PhpMyAdmin?  Yep – that auto filled for me as well, the same data I had to think hard about when I put it in, just auto-suggested for me as I typed away names, and values.  So in a little less than an hour, I had my database and seed data setup and my salvaged code working.

Thank you Chrome and Google!


Posted in Personal | Leave a comment

How web programmers should be more like lawyers

I got to thinking the other day how I was similar to a lawyer, but really should leverage more lawyer-ish practices.  How did this pop into my mind?  Quickbooks.  The software I love to hate.  At this point in my life, I use it for invoicing, managing client information and tax reports.  Its way more software than I need, and I got to thinking what other service industry might have software that does what I do.  I’m not aware of something (cost effective) that will do the basics that I want, granted I haven’t really done much research because I own Quickbooks (so feel free to tweet @thecodedog what you use for invoicing and book keeping).

When you set up Quickbooks, you choose a similar industry – and it goes off and sets up accounts and some of the ledgers, etc (stuff I don’t care about). Anyway I got to thinking how the functions of what I do are similar to a lawyer.  THEN I had an amazing idea that I think I’ll implement for 2012 – and we’ll see how it goes (I’ll get into that after these lists) –

Here’s how I’m similar –

  • I charge hourly for my expertise and work (unless its a bug fix)
  • I take on projects, small and large
  • I meet with potential clients to determine if I can help
  • I advise people with my expertise (whether they follow it or not isn’t my issue)
  • I manage multiple projects at once
  • I research and learn all the time
  • I create structured documents
  • Occasionally I build and implement templates
  • I reuse items from other projects
  • I rarely produce a physical product
  • success is determined by the client, peers and typically the public
  • everything I do is to help the client
  • I have a pretty damn good success rate

How I’m NOT like a lawyer

  • I’m honest and not seedy (I know not all lawyers are bad)
  • I’m 100% up front with pricing and charges and my clients ALWAYS know what to expect when an invoice comes
  • I don’t charge for phone calls
  • I don’t charge for quick tasks that take more effort to create the invoice than the actual work performed
  • I probably do not charge enough (thus don’t overcharge) for the work I do
  • I don’t have an assistant to do my dirty work (book keeping / phone calls, research, etc)

There is one thing that a lawyer does that is good that I don’t currently do, and it hit me and I’m curious if it will fly.  Keep me on retainer.  I looked it up and here’s a quick definition for a retainer –

A retainer is a fee paid to an attorney or other professional in advance, for services. Often, retainers are paid monthly, based on an estimate of the amount of work to be done for the client each month.

A retainer might work like this: You would pay your attorney $500 a month for legal services during that month. If you have a question or need a matter handled, it comes off the retainer amount. If you don’t use the full amount of the retainer, in most cases you would not get a refund or a credit toward the next month. If you use more time than the retainer amount will cover, you will need to pay the additional fees.

With that in mind, I’m wondering if any other programmer does this, and if clients would go for it.  In the past I’ve offered support contracts for an app I’ve built for a client.  If they wanted small changes, tweaks (all defined beforehand) they didn’t have to worry about it.  If a user had questions, needed training (again outlined specific hours) that was included.

The upside to a retainer agreement this is that you have reliable/consistent income each month, the client has the assurance you’re not going to walk away from the job.  They have the security in knowing that you’re there to call if anything comes up. They have a reliable budgeted amount to allocate for the project. And most importantly – if you have a retainer agreement with them, they would get preferential treatment and pop to the top of the workload (or as near as possible depending on what you have going on)

The downsides (two that I can think of) is that if you do this with too many clients, you might be overwhelmed with ‘high priority’ work (which would probably happen regardless of a retainer agreement and the same number of clients).  The other (seems petty) is that you probably have to invoice them every month instead of hoping they remember to pay you (which you may not have to do if you didn’t do any work for them that month).

Deciding I’m going to offer this…what’s a fair rate then?

Figuring here in Pennsylvania the typical rate for what I do is $70-$100/hr – are clients seriously going to pay me 4-5 hours ($280 – $500) a month so I’m at their beck and call?  I personally don’t have any clients that large – I think they’d say – no, that’s ok, you can just invoice us for work performed. Maybe if they do put me on retainer – I lower my rates? Even 50% seems a bit steep for some of them and then you’re just screwing yourself because now you’re performing 5 hours of work for half the price you would be if you weren’t on retainer for them.

Its an interesting issue I’ve been pondering.  I like the idea of offing this to clients, I guess if they take it, its a win either way.  Especially if I get a month in there where they don’t use the 5 hours.

If you do this or have done this – feel free to comment below or shoot a tweet to @thecodedog

and if you want me on retainer for you definitely contact me and we’ll talk – jonathan.wheat @ 🙂



Posted in Personal | 1 Comment

Forcing SSL with PHP

Occasionally you have a registration form, login page or other php item that should be secured.  Its easy to link to something securely, however, some people play with urls ( I know, gasp ), search engines might get to the page with http, or users might somehow otherwise end up there unsecured.  Yes you can accomplish this with an .htaccess file, but sometimes you don’t have the ability to edit / create one on a server.

Add this php code to the top of your php page to have it verify and flip to secure mode if needed –

if ($_SERVER['SERVER_PORT']!=443)
$url = "https://". $_SERVER['SERVER_NAME'] . ":443".$_SERVER['REQUEST_URI'];
header("Location: $url");

Conversely if yiou have to pop back to http, you can alter the code to this –

if ($_SERVER['SERVER_PORT']!=80)
$url = "http://". $_SERVER['SERVER_NAME'] . ":80".$_SERVER['REQUEST_URI'];
header("Location: $url");

That’s all, just wanted to share something I found when I need this behavior on an application form.

BTW if you want to do this via .htaccess – you can use something like this –

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R,L]
Posted in PHP | Leave a comment