If I’m Marco

If I’m Marco Arment and I dislike the way bugs in the iOS Framework are being handled by Apple, here’s what I’ll do.

I’ll buy a domain name. pre-radar.com and pre-radar.org are both available. I’ll probably go ahead and get both.

Then I’ll build a site. Some sort of community site, probably something similar to Stack Overflow with reputation and badges. The site will allow developers to submit their code, which they believe is buggy due to the frameworks, for peer review. Since I have a large influence in the iOS Development Community, I can convince the best of the best developers to have a look at the code.

This peer review process will solve problems. First, it will get rid of many bad bug reports being filed to Apple, because someone would point out the error in the developer’s code that isn’t in the framework. Second, it would strengthen the reputation of pre-radar.com in the eyes of the community and in the eyes of Apple. Apple would be able to trust reports filed from the community. Third, it would build a combined voice that single tweets and angry blog posts cannot match – here are the bugs that we have found and verified: fix them.

By doing this, I also solve another big complaint about the current system – lack of transparency. The entire community can see everything submitted, and other developers can vote “me too” about bugs, after submitting their own code that shows the same behaviour.

I know, I know – Apple should do this. It is their responsibility to fix their system. But I’m a part of that system. And if I can make it better, why won’t I?

Emma, One Year Later

A year ago, my daughter started seizing in the back seat of my car.

Since that day she drinks a syrupy medicine twice a day and I carry a shot of Diazepam with me wherever we go. If she starts seizing again, I’ve been instructed to call 911 and watch the clock. If she seizes for five minutes then I inject the Diazepam in her rear.

Fortunately, she hasn’t started seizing again. From what I see, the seizure has had no adverse effect on her. Obviously, it is not possible to know what she would be like if she hadn’t had the seizure – but her curiosity and awareness of the world grows daily. She teaches me children’s songs and I teach her Beatles songs.

The past year hasn’t been about major breakthroughs – its about hundreds of incremental improvements. I am happy to say that Emma is really becoming herself. Now she is three and we can start to see her personality – hints of who she will be.

Emma started school a few months ago and has picked up some wonderful bad habits from the other kids. My favorite is when she doesn’t get her way and starts fake crying – the crying lasts for about five seconds and then she puts both hands on her nose, whinily saying “Nose”. I’ll have to get some video of it.

The part of that that really makes me happy is that she wants to get her way. That means something to me – that means that she knows what is going on around her.

I’ll share another thing she loves. I’m not a big fan of singing songs in the traditional manner every single time, that gets boring. So I’ll change the tempo of a song like “Twinkle Twinkle Little Star” when I sing it with Emma – changing it from “Twin-kle Twin-kle, Lit-tle Star” to “Tweeeeeeeeeeenkle, Tweeeeeeeeeeeeeeeeeeeeeeenkle, Liiiiiiiiiiiiiiiiiit-tle Staaaaaaaaar”. She absolutely adores it. Every time she sees me she grabs my mouth and starts singing it that way to me. She is also very quick to adapt. If I change the tempo in a different way then she will do the same.

These incremental improvements don’t lend themselves to my concept for her site. My intention there was always to show the major milestones and the big ways that she overcomes expectations. Because of that, I haven’t posted anything about her progress in a long time. I fear that may make anyone who has heard her story think she isn’t making progress or that she hasn’t recovered from her seizure.

So going forward, in addition to the major milestones, I will be doing “State of the Emma” posts there, to share all the little things that turn into something big when put together. I hope to have one out soon.

Thank you for caring about Emma.

Dharma Talks

Despite living in the heart of the Bible Belt, I’m not religious. But that doesn’t mean that I’m not curious. That I don’t believe that somewhere in the roots of religion and other forms of spirituality you can find something real, something that applies no matter the century.

I’m really enjoying learning about Buddhism. My curiosity was first sparked listening to Dan Benjamin on 5by5 podcasts Back to Work and Build and Analyze. Dan would regularly throw in small bits of Buddhism to other topics.

To add to that spark, the first time I visited my sister in San Francisco, she told me about Mission Dharma. Mission Dharma describes itself as a San Francisco sangha that has gathered in the Mission District for over 25 years. In the midst of the overwhelming experience that is that city, I didn’t absorb what she was saying.

Fortunately, my sister is a pusher. I can’t remember how many times it took, but she eventually got me to listen to one of Howie Cohn’s Dharma Talks on the website. The talk was great.

Unfortunately, the experience of listening to the talk wasn’t great. I listen to things like that on the way to work. The length of the talk doesn’t correspond perfectly to the length of my drive. And mobile Safari has a way of reloading tabs due to memory demands, which means that I would regularly lose my place in the middle of listening to a talk.

So I started making an app to solve those problems. This past December Mission Dharma gave me permission to put it on the iOS App Store.

You can find it here, for free. I hope you’ll try it out and get something meaningful from Mission Dharma’s Dharma Talks.

I have also made the source code free. Maybe you can use it for your organization. Most of it is generic, but the part that pulls the audio files from the web page is a little hairy.

If you are part of or know of an organization that is doing good in the world that could use an app like this, please reach out to me and hopefully I can help.

Write, Powered by Magneto

In my original post about Don Melton’s Magneto, I said that one of the disadvantages of using Magneto is that there was no good way to write a post on mobile devices. When I wrote that, I had every intention of building an iOS app to work with Magneto. I am proud to open source a beta version of that project today, which I am calling Write, Powered by Magneto in my typical pattern of naming things generically.

I am not planning to make any further commits to this project until iOS 7 is out to avoid releasing any code that is under NDA.

And yes, I know it’s ugly (especially on iOS 6.) Adding design, and hopefully a bit of delight, are next on my to do list.

Prerequisites

  • You must have your Magneto blog’s folders linked to Dropbox in some way, whether it be by symlinking Dropbox folders to your local directories or by storing all of your directory tree in Dropbox directly. Write uses Dropbox to keep all of the draft, post, images and video in sync and accessible on iOS.

  • You must have a Dropbox Core API key, which you can get from Dropbox.

  • You must have Xcode so that you can build the app

  • You will need to make your own “Credentials.h” file in your project. It will need to look something like this (or you can look at my commit history, because I accidentally committed it…whoops!):

      #ifndef Write_Credentials_h
      #define Write_Credentials_h
    
      #define CONSUMER_KEY @"your Dropbox key goes here"
      #define CONSUMER_SECRET @"your Dropbox secret goes here"
      #define USER_NAME_TOKEN @"choose a name for the oauth token to be saved in the keychain"
      #define USER_NAME_TOKEN_SECRET @"choose a name for the oauth token secret to be saved in the keychain"
      #define USER_NAME_USER_NAME @"choose a name for the user name to be saved in the keychain"
      #define SERVICE_NAME @"choose a service name under which to save the keychain information"
    
      #endif
    
  • As specified in the Dropbox Core API setup instructions, you will need to change this section of “Write-info.plist” to have your Dropbox key after the “db-“:

      <key>CFBundleURLTypes</key>
      <array>
          <dict>
              <key>CFBundleURLSchemes</key>
              <array>
                  <string>db-0bzv4hxmz3d1144</string>
              </array>
          </dict>
      </array> 
    

About Write, Powered by Magneto

While designing Write, I tried my best to keep true to the way that Don designed Magneto. To that end, Write is designed simply, with no underlying database. The app relies only on the file system in Dropbox and two preferences that are stored about your blogs: the location of the blogs in Dropbox and the index of the blog you are currently viewing.

This approach has at least one limitation that I have run into so far – since all of the information about your drafts and your posts is stored in memory, a large number of either could overwhelm the relatively small amount of memory available on your iOS device. I have done my best to keep that impact to a minimum.

My other major design goal was to enable the user to complete the entire drafting and posting process inside the app. That is another reason I created the html5video plugin for my daughter’s site - I can easily and directly take the video on the device and upload it to Dropbox. In this version, any cropping of videos or images must be done in the Photos app, but at least everything can be done on the phone.

Limitations

Since the iOS app is not actually putting the file on your server when you press the “Post” button, some other process must be running to do so. The two options that I know of to do that are to be running Magneto in auto mode on your Mac, or to be running Magneto in auto mode on your server, with the Dropbox files shared to your server.

Currently, I am doing neither of those – I am manually deploying to my server after posting in the iOS app.

Walkthrough

When you first open Write, after connecting to your Dropbox account, you will be shown a list of directories that might contain Magneto sites.

Blog choosing screen

Upon choosing the site or sites that you want to have available in Write, you are taken to a list of the sites you have selected. You can choose one to see the drafts and posts for that blog.

Available blogs

Once you have chosen the blog you want to see, you will be shown a list of the file names for your drafts on that blog. Using the segmented controller at the top, you can choose to see the ten most recent posts.

From this screen, you can choose a draft or post to see and edit the contents, or you can click on the “New Draft” button to create a new draft.

Drafts for my blog

The view of the draft is simply the content of the markdown file. As you can see in the screenshot, nothing is wysiwyg. It is the exact same thing you would see if you were editing the file in Sublime Text 2 on your Mac.

Editing a Draft

As you can see in this next screenshot, I haven’t put anything nice like a keyboard tray with common markdown keys in this version, but probably will in the future. You will also see a “Save” button. That button will upload the file to Dropbox, as will going back to the drafts screen. The file is automatically saved locally every five seconds. I have also included a button to add media, whether an image or a video. As I said before, this button will add the media to your Dropbox and place the proper tag at the cursor location in your file.

Editing a Draft with Keyboard

I think I am handling conflict resolution for the versions of files in a conservative manner. If the copy of the file on the local file system was modified after the copy on Dropbox, then Write updates the copy on Dropbox with the local copy. If the local file was modified before the Dropbox copy then Write creates a new “conflicted” version of the file.

From the draft editing screen, you can choose the “Post” button to move the file from the Drafts folder to the items/current year folder. Choosing that button will change the time stamp in the file to the current time and change the name of the file to the name on the title line, if they differ.

Conclusion

I hope you find Write useful.

If you would like to contact me for bug reporting or any other reason, I am on twitter @davidbrunow or you can email me at [email protected]

Wake Up to Music

You really should subscribe to Rdio. I cannot recommend the service enough, and I genuinely believe that it has made my life better.

But maybe you don’t subscribe to Rdio. Perhaps you already have a huge music collection and don’t like the new stuff that the kids these days are into. Or maybe you only listen to The Beatles and other artists whose music is owned by people who have an interest in holding back technology.

But obviously you really love Jenni Leder’s design of Wake Up, Powered by Rdio.

And since that’s the case, you will want our new app, Wake Up to Music. All the same functionality but powered by the music collection you have on your iPhone or iPod touch.

$1.99 in the App Store now.

Magneto Revisited

I recently created my second site with Magneto, so I’m going to share my experience in doing so.

Background

I have had a website for my daughter hosted on Squarespace for a little over a year. The initial concept for the site was a sort of picture based storybook, something that I could read to my daughter as a bedtime story perhaps. None of the templates on Squarespace did exactly what I wanted, so I got a close approximation of what I wanted by futzing around with javascript and CSS every time that I made a post.

All of that futzing meant that I only made about 3 posts, all very soon after I created the site. I attribute that lack of posting to two factors (and I like to believe that it isn’t because I’m a bad father):

  1. The time it took to make a post – to make the Squarespace site do what I wanted it to do, I had to spend about 20 to 30 minutes for each post. That was mostly because I would have to look at the past posts to re-learn what I had hacked together the previous time.
  2. Having to log in to Squarespace – I’ve found that having to log in to a service is a large enough hurdle to discourage me from using it. Any friction in the form of discouragement is a factor that will undermine my intentions and that I want to eliminate.

So I decided to abandon Squarespace and create another Magneto site.

Change of Plans

As I said earlier, I had an idea in my head of creating a website that was sort of like a children’s bedtime story book, to which I would add new information about my daughter as she grew up and could do more things. But I ran into problems with this concept. Where would a new user start in reading the story? If I put them at the beginning of the book then they would get the full effect of the story. However, my friends and family that checked back often would have to jump through hurdles to get to the new stuff. Additionally, in a children’s book there is generally one picture and caption per page. Having the same effect on the web would require a lot of clicking and waiting1, delivering a poor overall user experience.

So I abandoned the original idea and one of my primary reasons for leaving Squarespace2. The new concept reminds me of what you would see on many Tumblr sites, pictures or videos with some comments.

New Implementation

Setting up Magneto was very easy to do. I simply followed my instructions (having to fix a couple of typos along the way) and I had the basic site up in a few minutes. It is so much easier the second time around.

Despite changing my overall concept of the site, I still want to tell a story through the use of pictures and videos. In order to do that, I had to make some modifications to the stock Magneto setup.

First, I added some hacky javascript to the article template so that my pictures are in a separate div from the caption text. You can see that javascript in post_article.erb on GitHub. This allows me to show the caption text on top of the image when it is moused over, and let’s the images speak the rest of the time.

Next, I created an HTML5 plugin that I use instead of Don’s video plugin. As I learned after diving into this, HTML5 video is a bit of a pain in its current form, which I attribute to Firefox’s insistence on not supporting the H.264 format. The plugin that I created does not account for this issue and therefore the videos do not show up in Firefox (although I added more hacky javascript to allow them to be downloaded). Not supporting Firefox has given my father a reason to troll me, but I had to make a decision based upon my particular constraints, and one of those constraints is that I would like to be able to make the posts completely from the file system on my iOS devices. From my research, it isn’t super straightforward to export Ogg Vorbis from the iPhone and even if I did that, I would be using twice as much space to store each video, which is just a waste. I also want to have full control over my videos, and I don’t want to have to log into yet another web service. So for now, HTML5 with no Firefox support is the way I’m going.

Now a short bit about my experience serving images and videos. I have no prior experience in this area (my current professional work involves sites on an intranet that have little to no media assets) so I was experimenting with serving these assets straight from my server (which is the lowest tier virtual private server at Midas Green Tech). With this strategy, my server would become unresponsive shortly after uploading updates to the site. I believe that this is because the server was caching those assets in memory, but I am not completely sure. I next experimented with a CDN, Cloudflare to be exact, and the server’s unused memory went up dramatically and load times shortened dramatically. In other words, as convention would tell you, use a CDN.

The last thing that I modified was Don’s timeago.coffee. I wanted the time stamps on my daughter’s site to display my daughter’s age at the time of the posting, so I created timesince.coffee. You can provide the script a starting date and it will display how long after the date that that post occurred, with accuracy to a month.

Conclusion

I am quite pleased with my switch to Magneto for my daughter’s site. I have already posted more times than I did on the previous platform, and more importantly I don’t get that feeling of dread that I usually do when I have to put in a password and navigate a site that I’m not used to navigating. I can almost do everything on my iPhone.

Would I recommend this setup to someone who is not technically minded? Definitely not. But if you are already managing a Linux server and want to share some pictures and memories with family and friends, or just want to have a memory for yourself, I think this is a great way to go. I might just be putting together another soon, and I will definitely be iterating upon my daughter’s site in order to get it closer to my original concept.

You can follow me on Twitter @davidbrunow where I will post links to any further blog posts about my experience with Magneto. And as a reminder, Magneto was created and open sourced by @donmelton.

  1. I could make the waiting after clicking much shorter by fully loading all of the content at the beginning, and then using JavaScript to hide and show different “pages”, but that would add more complexity to the site and make the template system generated by Magneto more difficult to use. Scrolling is very natural on the web, and probably the best way to do it.

  2. I do not regret my decision to stop using Squarespace, because of the following benefits of self hosting: 1) I have the content on my local machine and can use it any way that I like, 2) I don’t have to log in, and 3) I can run my daughter’s site on the same server that I run my own which saves me money.

She’s Seizing

Last Thursday night I didn’t sleep well. My heart was racing and I was restless most of the night. Then I felt “off” all day Friday. Didn’t know why.

On the way to pick up my daughter from my ex-wife’s house I was anxious and uncomfortable. For no known reason I had a feeling something bad would happen soon.

I’d been driving for about 15 minutes with my daughter in her carseat in the back. She made a coughing/gagging sound and I looked back at her. She looked like she was spitting up some mucous. Her body was limp against the straps of the seat. I sing-songed “Emma” with no response. I started saying the ABCs, one of her favorite things to say back to me. Still no response, only more gagging, more spit up.

I frantically found a place to pull over, put on the hazards, and got her out of the car. She slumped over on me and continued to cough and gag every few moments, spitting up on both of us. I held here there on the side of the road, hoping I could help her get out whatever was causing her sickness. Nothing more than that mucousy substance came out. She barely had the energy to contract her stomach to cough.

After a few minutes, I gave up on the idea of her coughing up whatever was bothering her and got her back in the car. It was only five minutes back home so I decided it would be better to get her comfortable and laying down there. I called her mother to see if she had been acting strangly at all that day – no, she’d been acting normally.

I laid her down on the floor of my apartment, took off her clothes that she’d spit up on, and tried to comfort her. Her face was pale white and her lips had little color. She was breathing erratically. I was flipping out on the inside but tried to stay calm on the outside.

Finally, she spit up more than just mucous. Finally, she started looking better. I sat down next to her and she looked up at me. She was more responsive than she had been since she started gagging in the car.

Then her left arm started moving rhythmically. Up and down, up and down, up and down. I didn’t want to believe that something was wrong – I wanted to believe that she was comforting herself through that rhythmic movement. Then her eyebrows started moving up and down, then her leg, then her tongue. I got her in the car to head to the ER.

The drive to the ER felt like forever. Emma was limp in the backseat, her body moving beyond her control. When looking back at her at a light, I’d picture her smiling during bathtime – laying her back in the bathtub, with her hair floating above her head in the water. Then a snapshot of the enthusiasm with which she would look at me when I would start saying the ABCs came to the forefront. I almost lost it a few times. But I told myself “now is not the time for that.”

I get her to the ER, out of the car as she slumps over, still rhythmically moving. They take her to the back, put her on a table and start stabilizing her. An insensitive tech is suddenly standing next to me and states “She’s seizing?” I don’t know what to say. “That’s what they’re saying” is what I come up with. My daughter is having a seizure. I almost lose it again. I almost lose it so many other times in that ER as the techs, nurses, and doctor work to stabilize her. They do.

Emma was taken to a Children’s hospital and spent the next day there. Through the haze of anti-seizure and anti-fever medication, my daughter started to come back. She talked a little. She drank some milk. She smiled.

Emma is back to her normal self now. Her EEG showed that she had abnormal activity on the right side of her brain. We have no idea why the seizure happened or if anything triggered it, but the abnormal activity means that she’s more prone to future seizures than the average child. She’ll be taking anti-seizure medication twice a day for who knows how long. And like with everything else Emma has gone through, we’ll see how this all turns out down the road. It’s just one more unknown.

Emma in the ER

Minimal to a Fault

Jenni and I intentionally shipped an app with a fatal flaw.

No, I don’t mean the inability to change am/pm manually.

iOS, the operating system that runs on iPhones and iPads and iPod Touches, will not allow our app to do what it needs to do if it isn’t running. That means we can’t let the phone go to sleep and then have the app automatically open when it is time for the alarm to go off. That means that you have to open the app to set the alarm every night (or morning) before you fall asleep.

I knew about this fatal flaw when I started development on this app a little more than a year ago.1 I did research into different hacks that could possibly be used to allow the app to function in the background. At one point, I had decided not to make it at all since I couldn’t make it work perfectly. That’s what Apple does, right? They wait for the technology to mature before creating something half-baked? Well, I really wanted it to exist, so I built it anyway.

Fully knowing the burden of the flaw2, I made choices to allow setting your alarm every night to be as simple as possible. I added the ability for the alarm to start automatically at launch, so you only have to tap the icon to set the alarm. I designed the time input so that you can directly choose the numbers for the time you want to wake up, instead of scrolling back and forth in a picker like in a typical alarm app. And you don’t have to choose am or pm, because the app picks the next occurrence within 12 hours. With this design, choosing 6:30 am takes 3 taps.

I’ve used this app almost every night for the past year. I am constantly thinking of things that would make my process of going to bed and waking up better and adding those ideas to the app. I hope they make your nights and mornings a little better too.

I hope you enjoy our imperfect app.

  1. I’ve used a handful of different iPhone alarm clocks over the years, but I never stuck with them because of the friction involved with setting the alarm every night.

  2. I stopped using this feature after Jenni’s beautiful redesign of the app. Now I actually want to experience the UI, rather than skip it.

Daddy Daughter Time

Tonight as I was feeding my daughter, she reached out her arms towards me and I leaned forward.

She grabbed the sides of my face and moved my head towards her right side.

She paused and looked at me.

She moved my head towards her left side. And paused again, looking again.

Then she pushed my face away, and softly, with a tiny smile, ‘cough cough’.

A huge smile spread over my face and my heart melted.

I’m ‘cough cough’. She knows me.

Where I Work

My Rad Desk

This is where I’m working right now.

I took the top from my cheap, particle board with dark wood veneer breakfast table, which I bought from Walmart about a year ago, and cut it in half. Surprisingly, the veneer didn’t peel back – the Internet’s advice to cover the cut line with blue painter’s tape actually worked. Unfortunately, I didn’t have my saw configured correctly from the start, and the cut isn’t straight.

After cutting the tabletop in half, I placed it on a couple of the chairs from the table. Voila, desk.

Really, it’s a pretty bad solution at this point. My knees hit unless I slide my feet to the extremes of my range of motion, carefully maneuvering around the chair legs. My elbows drop below my wrists and in the lightly padded folding chair, I crumple over most of the day.

Anyhow, you don’t get to make excuses about a comfortable chair or proper ergonomic position holding you back from creating things. Set up a desk, follow my recommendation, and start sharing with the world!