Category: Work


I’m back to wandering around the house in a somewhat tipsy manner. The tonne of Halcion they put me on wore off. I slept from 3 until 9:30. Now I have a mouthful of temporary apparatus. Smile picture in a few days when I am less self-conscious.

Obviously there is hunger (having to eaten since 9pm last night)

I had some wonton soup, a pepsi, and am now attempting mango sorbet.

We’ll see how this goes.

For those curious about The Project. The house rule was as follows:

  1. You may blog
  2. You may not drive
  3. You WILL NOT code.

SO back to that tomorrow.

hurdleA happy new year to all! May we all join in peace with the shared knowledge that for the next month we shall all be writing “20134″

The reason I put “Vacation” in quotes like that, is that when you are the sole coder on a project of your own devising for your own release for your own product for your own (intended) revenue. The only think that delays said revenue is said sole coder. So you find yourself working even when you say you won’t.

This week was predominantly learning Java and Servlets. I would be a fool to say that I’ve learnt it all. But, I seem to now have enough under my belt that I am successfully using Eclipse, making a minimal number of Syntax Errors per revision, pushing the class to the Tomcat server, and seeing the fruits of my work.

And what are said fruits?

Originally my client was pulling data from a JSON file that I belched out from a program that made the data than I entered by hand. This JSON file was a static resource that had to be kept up and verified with each data modification. This was a painful process.

Google-r Bruno Oliveira puts this very well: (click for a larger version)geeks-vs-nongeeks-repetitive-tasks

 

When left to our own devices, we will try to simplify long and annoying process. We may do so through some even more annoying process, but the payoff is ginourmous.

Last week I had a monolithic JSON file with every bit of data in one place. This week, I now have a MySQL database with the data broken into different tables and a Tomcat Servlet, making the necessary calls to create only enough JSON data  populate the view on the client. This is reduce some major overhead and going forwards will allow far better expandability, data management, and communications scaling.

Ain’t net tech awesome in the 2010s? This is so much better than trying to compress user level data into a few bits in a byte because you only had 400K to store your data and your BBS.

Important Java tip:

In a try-catch-finally block, finally is always called.

Do not assume that you are in finally because your try threw an exception. Cleaning up resources that you built in try during finally will really make your program fail.

javaNow, I’m honestly trying to not work on the project specifics except during the work week of Monday – Friday. Granted, like everyone else; I find a project I like; I dive in with both feet. Ironically, the average diver would probably hazard trying to go in hands first. But, then again; I’m not a diver.

What this means is that I spend the weekend trying to refine the work that needs to be done. I spend it learning technologies, experimenting with them and dreaming how they will incorporate. Despite being a holiday weekend (well, Yulishmash spill-over) I knew there wasn’t going to be much to get done. Also, with family in town, I really can’t kick them out of my home office when it’s also the guest room. (Yes, my home office has a Thinking-Queen-Sized-Bed)

So, it was down to sitting on the couch with laptop and hashing out the following. First was refreshing Java. I touched Java aeons ago. This was probably back when you could count Java’s age on one hand. Java is not yet 20, though it did become legal this year in the states. I’ve done a boatload of C and a shipload of Objective-C, and maybe a dinghy of C++. But Java was something that I kept getting pulled back from spending too much time in. Believe it or not; I’ve survived as a third-party Apple OS developer for over 25 years.

Java itself isn’t so much the problem. Object-oriented code with some syntax adjustments. Obj-C protocols are Java interfaces… sort of. The problem with most OO languages are the libraries and the build processes. In java is comes down to Packages, Jars, ClassPaths, and the like. So to learn Java I also brought in Eclipse. Eclipse is a popular Java IDE.  Well, after watching 5 horrendously painful lectures on the baby steps of Java for non-programmers, I was able to get the ever joyful “Hello World” up and running. But why stop there?!?

Next up was loading Tomcat. Tomcat is a web server that runs mini Java programs (known as Servlets). This allows me to do dynamic generation of content dependent on calls to a server. The server takes the request and passes it to the Servlet. The servlet uses java to parse the request, do stuff, and return data. So my next job was setting up Tomcat on my internal server (on the scared side of my firewall) and trying to write a Servlet.

This stage didn’t go quite as smoothly. Servlets have their own brand of packaging that goes even further into the world of Java. Thanks to some helpful folks at StackOverflow I was able to get a better handle on WEB-INF directories and my Java crashing web.xml file. Granted, after all that, the Servlet still wouldn’t run. After many hours it was sleep time.

Today, undaunted, I went back to the Servlet. I tried to figure out why the samples that came with Tomcat worked but mine belched “Resource not found” errors. Then I learned about how Tomcat Servlet paths worked and there was my happy “Hello World!” Servlet running on my Tomcat Server. (2 notches on the tinkerer’s belt)

So, obviously “Stuff” means fetching from the data store. We go to MySQL for that. This is a low effort relational database that will let me keep the data that I will pick and choose for my web requests. Client calls URL, URL hits Servlet, Servlet parses request, Servlet fetches from MySQL, Servlet pushes response out to client.

For those of you who do this all the time like it’s a piece of cake. Remember, some of us have been working on an entirely different kind of pastry. So, I salute the work you do so effortlessly. I hope to get there soon-ish.

Some fine tuning on a quick install of MySQL, a mini throw-away database and VOILA, Servlet is responding and showing a nicely formatted table. Now going back to the client; as previously mentioned I’m going to be using a data format called “JSON.” JSON has a lot of clients and APIs that can consume data in that format and turn it into something usable. So, next up on my agenda was finding a JSON library my Servlet could consume.

Remember, this is all seat of the pants, and I’m likely doing half of this all wrong. But if I can get a working proof of concept that looks good enough for seed money, then I can hire in people who do this for a living to do it right. So, I find an open source JSON java library. I even figure out how to turn it into a JAR (Java Archive) and soon was able to have a sample java program burping out my data in the much hoped for data format.

So, next up is moving this JAR and JSON code into the Servlet. Once that is there, we have an end-to-end request from MySQL JSON generator. But by then it’s the end of the weekend and it’s back to working on the client proper with the hand coded data set.

All this and I had a cold this weekend, too. It’s quite an adventure and I’m really thrilled with what we’ve accomplished so far. We being now a team of 5 contributors (including myself) even if half don’t really consider themselves contributors yet.

As we get closer to our Proof of Concept I will endeavor to get less vague.

Til next time…

Back to code!

300px-Tomcat-logo.svgWith the holidays, the usual entertainment segment of the blog has been on holiday. We do promise not one, but two post Sing Off wrap-ups. I’m pleased to announce that many of you really seemed to enjoy the Armchair Judge; so we’ll be bringing her on as permanently as she wishes to participate.

But onto the project. Code in the project itself was fairly quiet. I put in some analytics and testing libraries to allow me to start getting the alpha into people’s hands to abuse and give feedback. In doing so there’s been a lot of Product Management and Software Management going on. As always, read the following “We’s” as the pre-corporate “I” 😉

We’re now running Jenkins, Bugzilla and Tomcat on our internal servers for the purpose of building, running, and monitoring our software. We’ve added in hooks for Flurry and TestFlight to make it easy to track usage, take feedback, and distribute alphas. I have been re-doing the company’s NDA so we can send out the alphas to people. Also, we’ve put dual 1TB RAID’ed drives in place for data security as well as system backups. We’ve been running gitolite for SCM. All of this is running on OS X 10.8 + Server on a Mac Mini. So updating that to 10.9 will be an experience.

I’ve also given the app to our first Alpha tester. In the first evening we got two bug reports (S, You rock!) as well as a few unanswered feature questions. I’m more than happy to get more testers like this! Further, I did do some coding to create a data entry front end application to let me enter and validate data more easily.

So, currently I am looking for Java folks who’ve done Tomcat, general hobbyist programmers who might like to do some pre-financing work, and testers. Feel free to drop a line on this. 🙂

Well, it’s back to Tomcat for Dummies for me.

More soon!