Sys. Admin Miscellany

The transition of the site seemed to go smoothly over the weekend. The problem was it went a bit too smoothly. Let me preface this short tale with a disclaimer that I'm not a system administrator by trade. I've not dabbled here before.

I'm using Hover to manage the domain registration. With Tumblr I pointed the DNS to their servers and it just worked. This time around I did things differently (and the wrong way in hindsight).

I switched the DNS from Hover to Digital Ocean, and pointed my nameservers at Hover to Digital Ocean's nameservers. This seemed to work quickly and efficiently.

Today I discovered that I wasn't receiving email to my jsorge.net domain (also managed by Hover). Turns out I did it wrong. DNS needs to be managed by Hover for my email to continue working. So I undid my DNS at Digital Ocean, pointed the nameservers back to Hover and changed the DNS A records to my actual Digital Ocean server. Problem solved.

So the moral of the story for me is to not go making things "more efficent" when I don't know exactly what I'm doing. The kicker is that I could have missed some pretty important emails over the last few days since Sunday night. Hopefully the downtime won't come back to haunt me too badly.

I ain't afraid o' no Ghost

After 6 years on Tumblr, I've decided to make the move to another blogging platform. This new site is being powered by Ghost, the new node.js backed blogging software. I'm hosting it using Digital Ocean on an Ubuntu Linux server.

The reasons that I made the move are many but the biggest one is that I want to own the process: On Tumblr I was just responsible for submitting the content that I wanted to post. I could change my theme (which I did) but I couldn't make the CSS responsive. So instead there was a mobile site. I didn't have any database access if I wanted to do something funky, either. It was also more tricky to get my posts out than I would have hoped. Now that I'm on Ghost all my content is stored in an SQLite file, which I can play with all I want.

I was able to bring all my posts from Tumblr over using a Ghost exporter for Tumblr and that worked really well for an initial export. The two gotchas are images (which are still linked over to Tumblr) and formatting of posts. I figure I can go back and reformat some of my bigger posts to read better but that's a job for another day.

Ghost comes with a system called themes that allows you to customize how everything looks. The built in theme is Casper. I'm no CSS whiz but I was able to tweak Casper to look good enough for launch. I'm going to continue playing with it and dialing things in further.

I also want to build out the sidebar. Right now the links point to a pretty bare about page and the Twitter feed for the site. Every post will be sent to that feed. There's also an RSS option at the bottom of every page in the center, which points to http://jsorge.net/rss.

The other thing that I'll want to build is a simple app to create and send my posts to the site. There's an API on the roadmap for 0.5 which I'm excited to play around with in a week or so after that version launches. I think I'll open-source the code for that app and put it on the app store.

I'm really excited about this new site.

Tragedy

You might have noticed a large change in how this site looks. For a little while I've been wanting to move from tumblr to a different platform. That platform is Ghost, and I'm going to write an introductory post shortly; however there have been a couple of things that overshadow a site change.

This week has been overflowing with tragedy. Two people that I am blessed to have counted as friends passed away. On Tuesday, Bill Strothman was onboard a KOMO helicopter when it crashed and he died along with the pilot. Yesterday Will Loper, one of my friends who was part of our Mars Hill community group passed away. I don't know the cause of his death yet.

With Will's death, I had to talk with a bunch of guys in my current group and former members as well. On one of the calls we talked about how it wasn't supposed to be this way. That's so true.

Death was not part of God's creation in the beginning. Only after sin came in was it part of our lives as the penalty for turning our backs on him. In fact, all of us have some sense of the eternal. Ecclesiastes says that he has set eternity in our hearts (3:11). Death is tragic because it's not how we are wired. It's unnatural.

I knew both of these men through relationships at my current and former churches. They both led vastly different lives, but loved Jesus and were made new by him. They never met in this world, but now are in the presence of Jesus, their Lord and Savior. In the midst of tragedy, there can be rejoicing because they are home.

URL Schemes and UIViewControllers

Our last 3 assignments in class this quarter have all been building on each other to create a photo list and location tagging app. It's really lightweight, and this last part of it involved adding a URL scheme for extra credit.

Part of it led me to posting this tweet:

Why don’t UINavigationController pop and push methods have completion blocks?

I have a URL that can be activated to open the app and delete all the photo entries. What I wanted to do is make sure that the UI was in a good state for this to happen so that deleting a photo while you might be viewing that photo won't cause any catastrophes.

I haven't implemented anything like this before but I'm happy with my solution.

First, I'm calling the method on my view controller using NSNotificationCenter. In the init method I register for the notification, and my header file broadcasts a string constant that names the notification.

In my app delegate, when the application:openURL:sourceApplication:annotation method I verify the URL and post the notification, which my view controller will pick up. Yes, I have to import my view controller so that I can access the string, but I figure that

Now the tricky part: get the current view to a usable state before prompting the user to delete their photos.

The app can exist in 4 different states: the main photo list, adding a photo from the image picker, attaching a location to a picked photo (but not yet added to your list) or viewing a photo in the map or it's details.

So I wrote a method that will get the view back to the photo list with a callback block to handle the next action after getting the view onscreen.

What made me smile about this technique is that it was the first time I used a block as a parameter and it worked perfectly. I just called performBlock on the main queue (since I'm performing UI code and that has to happen on the main thread).

Here's what that method looks like:

- (void)bringSelfToMainViewWithCompletion:(void(^)())completion
{
    if (self.navigationController.visibleViewController == self) {
        [[NSOperationQueue mainQueue] addOperationWithBlock:completion];
    } else {
    	id presented = self.presentedViewController;
        if ([presented isKindOfClass:[UIImagePickerController class]] || [presented isKindOfClass:[UINavigationController class]]) {
            [self dismissViewControllerAnimated:YES completion:^{
                [[NSOperationQueue mainQueue] addOperationWithBlock:completion];
            }];
        } else {
            [UIView transitionWithView:self.navigationController.visibleViewController.view
                              duration:0.75
                               options:UIViewAnimationOptionTransitionCrossDissolve
                            animations:^{
                                [self.navigationController popToRootViewControllerAnimated:YES];
                            } completion:^(BOOL finished) {
                                [self.navigationController setViewControllers:@[self]];
                                [[NSOperationQueue mainQueue] addOperationWithBlock:completion];
                            }];
        }
    }
}

I'm interested to hear what other techniques there are for this kind of thing. It's my first shot and I'm sure there are other optimizations I could make. I don't know how I would handle a more complex navigation structure, but that's a problem for another day.

Next quarter starts in 2 weeks, and I'm really wanting to take a more Brent Simmons-type approach and blog what's going on in real time. Hopefully I have something useful to contribute.

If you're interested in the code from this project it's available here: https://github.com/jsorge/CP125_HW-6-7-8.

Atticus Jack Sorge

Atticus Jack Sorge

Our son, Atticus Jack Sorge, was born today at 1:49PM. He weighs in at 8 lbs and 3 oz, a crazy cute head of hair and super snuggly. Now the ride of parenting begins. I pray that God includes his name in the book of life.

Welcome to the world, Atticus!

FileMaker Clipboard Assistant - OS X App

The Problem

I’m refactoring an old database tool that I built 3 years ago to normalize the weird price lists we get for importing into our products catalog. I built it as one of my first reintroductions into FileMaker and didn’t have any standards or close examination into what I was doing. This tool is still necessary for our business but I wanted to bring it up to date with my new standard practices and naming conventions. The issue is that I updated table occurrences and this broke all of my “Import Records” script steps.

My Solution

I know that FileMaker uses an XML backed scheme to drive its scripts, tables and fields. There are apps like Clip Manager, but that’s a pretty spendy app and I don’t know how often I will use it to justify the price to my boss. Not to mention, I’ve been learning to build Mac apps and as a developer this presented a great challenge.

I built a simple Mac app that will import the contents of the clipboard, run some replace rules and copy it back to the clipboard. The trick is that FileMaker uses a special hidden clipboard type, which is why you can't copy a script step and paste it into a text editor. So you have to get the type of the pasteboard using the NSPasteboard types method. I set this as a property on my document class so that the copy back action knows where the contents came from.

Initially I created the app to do some hard-coded find and replaces but I spent a little time updating it and adding a Core Data stack as well as a table view. It will now run through the table sequentially, doing a find and replace and you can save multiple documents. So you could have a template to convert a script step and another to convert a table occurrence.

Future Versions

Im thinking that I want to paste in with a tidied version of the XML so that its easier to identify whats going on, as well as some error checking to make sure that both the search and replace rules are populated. Im giving links to the binary and the repository so you can look over the code if you wish. Its not pretty right now, but its functional.

####Files

Back to School

Monday was my first day back at school. I’m going after a certificate from the University of Washington in iOS & Mac App Development. It’s going to take a school year to complete and consists of 1 class for the next 3 quarters. This first quarter focuses on Mac development.

If you’re interested, you can find my homework code on my Github account at my Github page. I’ll probably post some updates through the program.

Thoughts on FileMaker

In my day job I spend a lot of time building apps based in the FileMaker Pro ecosystem. I ‘ve been wanting to share some of my unstructured thoughts about the platforms and give some preview of things that I’ve built that I want to share with the larger developer community.

For the uninitiated, FileMaker Pro is an application that allows for easy creation of database driven applications. They include a good amount of templates (like contact managers, invoice tracking, etc). But the real power comes when you start customizing the interface to make it function like your own application. Over the past 7 months I’ve been doing just that at work and am about to release internally a new sales application for our quotes, orders, contact management and many other things.

While it’s easy to get rolling with a simple application, naturally more complicated things are increasingly difficult. I’ve been spending a lot of time in Xcode in my free time as I develop my other programming skills and am really craving for some improvements in how FileMaker handles things. Here are a few of my wish list items.

  • Improve the calculation engine

    • Make it work like a standard text editor. I shouldn’t have to worry about the undo command; that it will wipe away everything I’ve done when I just put a character in the wrong place
    • Implement auto-complete for table occurrences and fields. You can validate the existence of said TO’s but can’t help me find the one that I want without going to my mouse. I don’t want to use the mouse if I can avoid it, since it slows me down. While you’re at it, you should also auto-complete functions.
    • Code hinting. Solid black text doesn’t help me do my job better when I can’t identify things at a glance.
    • Let me change the font. If I want to line everything up I should be able to because I’ve selected a mono-spaced font. Developers don’t want variable spaced fonts.
  • Scripts

    • Give us the ability to type out our scripts. I know that this is really difficult (maybe impossible) to accomplish but it would be a huge step up as a development tool. Like I said before, the mouse slows me down especially when I can’t search script steps
    • Allow undo of a a mistake in the script editor. I can’t use the undo command to go back a level of two while working on a script. I can either save and manually undo, or close the script without saving. That is a joke.
    • Some way to diff/merge scripts. This is part of a larger request for version control, since there is no way to handle versioning of my files. Git is a remarkable tool that is rendered less helpful because of the way files are packaged. I should have a way to track changes made to files, roll back or try something out on a different branch.

Those are my biggest day to day frustrations with the platform. Because there are no frameworks to speak of, and very little in the way of shared code, I’ve had to create things that frameworks would give me for free. I’ve builds my own navigation controller, my own unwind segue controller, and my own centralized code to handle uploading to and deleting from S3. I plan on sharing some of these things on modular filemaker when I have the time to generalize them.

The biggest thing I think FileMaker needs to talk about is their direction. What are they and where are they going? When they first started their biggest competition was Excel, and they were glorified spreadsheets. Now things are very different. We live in an age of mobile and apps. Last year, the FileMaker Talk podcast featured John Sindelar and Todd Geist talking about this very thing before DevCon. More than a year later, we don’t have clarity about their direction.

As it stands right now, FileMaker will never be able to produce the kind of quality apps found in a native platform. They don’t have access to low level Apis that make building native feeling apps. I doubt you’ll ever see parallax in an iOS 7 FileMake app, let alone gestures. But what they can do is easily spur the creation of little helper apps that let you get things done.

I hope that FileMaker will have things to say in the near future, but I wouldn’t count on it. We probably won’t get a new release until early ish next year. 2 years between releases is too long, especially in this day and age. FileMaker is a good tool for sure, but there’s still much work to be done.

What do you think? Sound off on Twitter or in the comments.

And the gender is...

Profile of Baby Sorge

It’s a boy!!!

We had the ultrasound on Wednesday and everything seems to be normal. Emily is now 20 weeks along and feeling well. The due date is December 19, which would be amazing because that’s my recently-deceased Grandma Ginna’s birthday too.

Christmas is going to be crazy.