Technology Musings

September 29, 2010

Amusing / Why to Not Use Dreamhost for Important Sites

JB

I host one of my sites on Dreamhost.  Dreamhost is very alluring, because of the number of features you get for almost no money at all.  The problem is, Dreamhost has the right to pull the rug out from under you with no warning.

I had spent hours trying to get my rails app to work under Dreamhost.  I had frozen Rails, specified which version of Rack to use, and a number of other tweaks.  Then, today, I go there, and I get the dreaded "Passenger Error".  I logged in, and tried to change some settings, and got nothing.  However, I noticed that the error message continued to display the same line numbers even though I had changed the file.  Wierd.

So I keep messing with it, and even start deleting files.  The errors *still* pop up, no matter which files I delete - it keeps the same filenames and line numbers even though the files no longer exist.  I had assumed that it just wasn't restarting, and maybe it had cached the files.  So I went looking for a force-restart thingy on the Dreamhost panel.

I didn't find one, but I found something else - Dreamhost had, without so much as an email saying so, moved me to a completely different server!  They left the files on the old server, but my domain was no longer pointed there.  Surprise!  I had been working on the wrong server altogether!

So, once I logged into the correct server, I was able to delete my frozen version of Rails, and unset my Rack preferences, and all was well with the world.  But who in the world switches apps to a box with a different configuration without notifying the customer!

If you want to know why you shouldn't buy webhosting for $5/month, this is it.

I'll probably still keep my account, but I'll stick with only having very-low-profile domains there.

September 18, 2010

Platforms / Change in Video Playback in iOS 4 (MPMoviePlayerController)

JB

It seems that Apple has changed the way that it handles video playback in iOS 4.  In previous iPhone OS releases, you merely initialized the movie player instance and then hit play.  iOS 4 is slightly more complicated because it no longer presumes that all video playback will be fullscreen, or even that there will only be one video on the screen at a time.  So here is the code to get the old behavior: 

MPMoviePlayerController* thePlayer = [[MPMoviePlayerController alloc] initWithContentURL: [NSURL URLWithString: trailerURL]];
thePlayer.scalingMode = MPMovieScalingModeAspectFill;
thePlayer.view.frame = self.view.bounds;
[self.view addSubview: thePlayer.view];[thePlayer setFullscreen: YES animated: YES];

Unfortunately, Apple still keeps its old documentation around. Here are the updated docs.

I ran into this when I was updating an app from 3.0 to 4.0. When you clicked on the button to play the video, rather than playing a video, nothing happened, and then a few seconds later only the audio would start playing. I had listed in my code the URL for the docs from Apple which I had used, and verified that it was correct - I had no idea that the document itself was out-of-date! It was quite a problem for me, and at first I thought it was a bug in my code. Later I learned that Apple updated their API, but not all their docs. Anyway, hope this helps someone.