I support a web application that is hosted on a virtual private server. The application architecture is JavaEE running under GlassFish on CentOS.
Like most ISP’s, my hosting provider builds vanilla Linux boxes that can be configured with various flavors of the OS.
Out of the box these images have their timezone set to UTC, and since my end users are in California, and I’m not doing anything on the client to handle timezone conversion, the times that come up in the application are off by 7 or 8 hours (depending on whether it’s Daylight Savings time or not. Continue reading →
If you read my previous post (WordPress Recovery), you know I’ve been writing some code to recover my old posts. It occurred to me I could take a small segment of what I’ve been doing with that code to demonstrate my approach to TDD.
Since I’m a hacker from way back, and also because I was in semi-panic mode about losing the content, I didn’t approach this task with testing in mind. Now that doesn’t always result in bad code: I’ve been doing this long enough that I can usually think through a fairly good model and code something that isn’t one long method full of inline code.
In this case however, once I had started coding, I realized again that this was an opportunity to practice coding the “right” way. I had already begun with a Maven project, and generated unit tests as I went through the process of starting to build the code, so I had at least some good functioning unit tests.
So when I finally got my blog set up to host the few static pages I had, I just changed the directory on my server to have a symbolic link to the directory where wordpress.accuweaver.com had it’s content:
Removed the directory httpdocs from /var/www/vhosts/accuweaver.com
Added a link in that folder to /var/www/vhosts/accuweaver.com/subdomains/wordpress/httpdocs.
This actually worked really well, since the content was only in one place, and all I had to do was change the host name in WordPress. Continue reading →
I decided I’d walk through creating a new app to replace one I’ve used for years on my iPhone that no longer appears to be maintained. The app in question is called GasBag which as near as I can tell stopped being updated in 2009 (see: http://blog.jam-code.com/).
I could just write a quick and dirty web app to store my mileage, but I figured I’d approach this as an exercise in building an iOS application with a design first approach.
At a high level, what I want is an app that easily captures my mileage, and allows me to save that information somewhere that won’t get destroyed. There are a number of features that GasBag had that I liked (for instance being able to send an email with my mileage information), and a number that it doesn’t have that would be nice (like allowing me to use it for multiple cars, or to do some data capture from a gas station receipt).
Alternatively, you can use the standard GMail settings, on the iPhone, but my favorite approach is to actually use the GMail app from Google in the App Store. The reason I like that app over the standard iOS mail app is that it is much more of a true mobile client that takes advantage of the platform.
You can do this either from your iPhone/iPad directly, or using the iTunes store on your Mac/PC.
Once you have the app installed, you need to set up your GMail accounts. Either tap “open” from the App Store page about GMail, or find the GMail icon and launch it.
On launch the app will prompt you to log into your account. For a Google Apps account, this will be the email your administrator assigned you like firstname.lastname@example.org, and the password that you’ve set up previously by going to http://gmail.com.
Launching the App the first time takes you to the login page, where you can type in your email address and password. Note that this is the same whether you are logging in to a GMail account or a Google Apps account, to Google they are just different users as far as mail goes.
Once you log in, you will be shown the inbox for that account, and be able to read your email pretty easily. To navigate the folders (like sent, draft, etc), you tap on the little icon in the upper left corner that looks like a box with stacked bars.
This will cause the folders and settings pane to slide out from the left and reveal your email structure so that you can choose. Clicking on a particular folder will display that list in the same fashion as you saw with the inbox.
Additionally from this screen, you can add other email accounts by tapping on the profile area at the top of the pane, which slides the list of accounts down and changes the direction of the panel indicator at the top of the pane.
If you’ve already done this, you will see the list of accounts, and each one will be badged with the number of unread messages. Adding a new account is as simple as tapping the large plus icon and logging in. Tapping on a profile picture will switch you to that account once you are logged in.
The little gear icon in the upper right of this corner brings up settings for you email where you can set a few things (such as vacation responder, signature, etc).
Once you log into the new account, you will again see the loading page, this time with the image from the new account’s name and profile image
The next time that you go to the account selection page, you’ll see a list of accounts with the icon for each badged with the number of unread messages showing so that you can easily see what needs your attention at the moment.
Google apps on the iPhone are a mixed bag, with some being native, and others not, so it’s also a good idea to set up the Apple “Mail, Contacts, Calendars” for synchronization of those things (which can use the Exchange push in the same way as an actual Exchange server).
First go to your settings (normally you can find this by clicking the home button on and looking for the gear icon that says “Settings”.
If you’ve previously added accounts, the “Add Account …” will appear below the existing account settings list (in my case I actually have to scroll in order to get to this button.
Tap on the add account button and you’ll be presented with the choice of types of account that you want to use. You can use GMail here, but I prefer to use Exchange simply because it pushes the information to the phone asynchronously
Once you tap on the Exchange button, you’ll get a new page that prompts you for the authentication information. This uses Microsoft’s autodiscover method to figure out how the account should be configured.
Type in the user name and password for your account here, and give it a description. Typically I use the name of the company that has the domain that I’m adding (for example PMI-SFBAC for my pmi-sfbac.org address).
Then click the “Next” button which should bring up the Domain screen. The only thing you need to make sure of is that the server ends up being m.google.com, and that you still have the right username and password. To continue, tap “Next”.
The final step is to choose what you want to be pushed to your phone. Generally the important ones are the contacts and calendars, since those are business related.
It really doesn’t hurt to have Mail turned on as well, since that keeps your inbox in the iOS Mail app up to date, but if you’re worried about your data plan, just set up the contacts and calendars, since that is the part that the GMail app won’t really be as helpful with.