Category: Work


progressThis is going to be short and sweet. But after a few days of being utterly distracted with other things on the blog and endless phone calls today; I got the live data from the server to show up in the app. It formats correctly and even sorts on the fly.

Now we’re cooking!

confused cat huhWell, it was bound to happen working on all the backend stuff today. Once I knew that I was reading the data in; today it was all about putting the data in a commonly accessible area; formatting the data for different calls; and then letting those calls bask in the glory of real data.

At least that was the plan. (Hang on kids, it gets technical now)

Originally, the data was pulled in at app startup using the call:

sendAsynchronousRequest:queue:completionHandler:

Then I moved that out of the startup system and into its own data management class. All was going along well, but I couldn’t get the shared data where I wanted it. So I decided to pull out the big guns. We call that “Gang of 4.” This is the bible of software design patterns. I reached into the tome (well, not actually; as I don’t really need the book as much anymore) and called on one of my favourite (albeit most overly used and accursed) patterns: The Singleton.

The singleton, is muchly like building a cookie cutter for a one of a kind cookie. You take great care in making a cookie cutter, which could make lots of cookies; but this one is specially crafted so that people will simply have to share the one (and only one) cookie it will ever cut out.

That’s when life got weird. Suddenly the call above stopped working. It didn’t cause an error; it didn’t complain; it didn’t throw a wild exception and crash the device… It just blithely skipped over it.

I tried wiping the object files and compiling fresh. That didn’t work. I tried changing and maintaining the queue. That didn’t work. I changed how the singleton was instantiated… Nope. Just weirdness all around. Sadly; I got to this point about 30 minutes before I had to leave to pick up my boy from school. (My spouse got the flu). I figured, Okay… I guess I’ll spend 3-4 hours fixing it more tonight.

This also would not come to pass because I also am deeply invested in the show “The Sing Off” and have been writing reviews and analysis…es…(plural?!?!). Granted, if you read this blog… which you are at the moment (take my word on it) , then you probably have noticed a few of those posts.

So tomorrow: I have to write my Sing Off review from tonight, spend about 5 hours figuring out why the API took a hike, and then gearing up for the penultimate episode of the Sing Off. Oh what a hard life I lead at the moment. Honestly, I’m hoping that it’s 1 hour of fix and 4 hours continuing to get the real data in the app.

Oh, and to those who said they’d be interested in testing once I get to the iPad; Please remember that iPhone apps run just fine on the iPad and you can test them early. (Yes, S… I’m looking at you first and foremost 😉

We’ll figure out what went kerschlump tomorrow. I’m going to actually try to get some sleep tonight.

progressWell, the code moves on. Today I did pretty much ZERO UX. Today it was all about consuming the data, getting it into the data structures and then being able to start consuming where the user is. This comprised about 3 hours of work this evening.

The JSON now lives on an internal server.  My internal network is firewalled, so in the words of the (not exactly im-)mortal Wil Wheaton, “Don’t be a d!©k.” I see my blog logs and know how many script kitties are out there trying to see what they can do; and with enough effort damage could be done; but come on. It’s not worth it. I run a blog. People like reading about stuff. That’s it. No heavy crazy stuff.

Well, with that disclaimer, likely to bait people (unintentionally)… The JSON was moved to the internal server so that the app could call it up. At this point it’s just a JSON file that gets belched out in one large monstrosity; but the REST will come later. (Ooh, bad pun.) Having used my data structures to generate my first two JSON records, it was easy, but busy work to turn it around to consume the JSON into data structures rather than create the JSON from the data structures. (Hurray for serialisation libraries.)

Once that was all tested, then I went on to build in the location management. I have stuff, now I need to know where it is in relation to a location. (And vice-versa). And there is a first hint about what I’m working on!

The location stuff I’d played with in another project (aeons ago) so it just took a little bit of a memory jog to remember how to make it work.

Tomorrow is the data wedding. I pull the lorem ipsum data out and push in the data that’s now loaded into proper data structures. And then I can do my first demo’s to people who have been looking forwards to see progress. I showed it last evening to one supporter with only the lorem ipsum data and they seemed to want to start using it. (My lorem ipsum data was somewhat convincing). So, I take that as a good sign.

We’re (I love the royal we when my engineering team is “Me”) developing initially on the iPhone, then branching to Android and iPad. Win 8.x… not worth it at this point to me. So, people who may be interested in seeing or playing with early alphas and want to offer comments/criticism/suggestions are welcome. For this, I’m likely to keep it to people I know personally unless you convince me through the power of commutative coolness.

Happy with where code is. Happier with where it is going! More soon. (Sing Off is Wednesday)

P.S. For those who want to feel really young (or old). It’s probably been about 17 years since I had a web page that had the icon for this post on it.

Fear not friends, there will be a SingOff post or two today.

Today I’ve been working on the back end of my software. UI is one thing, but you can only get so far with ‘lorem ipsum‘ data. Well, okay… in my case some fake data that sort of fits the project. So today, I started the process of moving from fake data to real data. This is always an iterative process that programmers and project designers know far too well.

First we sketch out what we think is the data we want. I usually jump from a text editor to a spread sheet. I realise this would probably be better right off the bat with a database; but that’s just crazy talk. I start out by trying to map out my main object (not really normalised at this point) and then make one or two side objects where I think they will need to stand off by themselves. With this model we build up some quick code to insert data by hand to have it generate out into a couple of different formats: (CSV, XML, JSON, etc) This allows me to easily re-use this data once output.

Now I go looking for actual data. I know what data I’m working with, so finding sample data on the interwebz is fairly easy. HOWEVER, and that’s a big however; once you start looking at real data and trying to shoehorn it into your model; you begin to realise exactly how limited your model is and where you need to make fixes. (This is why lorem ipsum only gets you so far).

Unfortunately, I need about 10 entries to work with the data correctly and each entry is about 60 lines/2000 characters of hand transposed data. (The whole database side of things happens once I am happy with what I have.) Oh, did I mention… if there is ANYONE reading who knows how to go from MySQL through REST calls into a JSON output (preferably using Tomcat) I may have some work/hobby time for you? Not kidding here. Also, if anyone knows a service that does this (with load balancing, metrics, yadda yadda yadda) comments welcome… knowledge dump will be appreciated/rewarded (eventually)

So, currently I’m up to 3 records. I’ll be working this afternoon on the other 7. Now that the first part is done, each record takes about 5-10 minutes to research and build up. Then I turn the whole monster around and have the Project import and use the data. That’s when things start to get ‘exciting.’

Those who I talked to informally about “The Project” should feel free to message me if they want details or are interested in some questions.

Until later… having fun and making great progress!

auto-layoutsWell, here’s the accomplishment of the evening. Been working on the code project and managed to completely grok Objective-C auto layout including the Visual Format Language. And I’ve managed to do this with animations. It was very much a bumpy road; but the end effect is Soooooooooooo much better than the first draft of the UI for the screen.

Now of course, it’s really just pretty UI with dumb data. But, as noted in my previous post…. I’m looking to find someone to help me with less than dumb data. It’s been a very good run of code tonight. I’m going to check it in and show it off to the rest of the ‘team’ this weekend. (Oh, yes. There are people already working on this with me 😉

So short but sweet. But very happy.