How to rotate iPhone video on a Mac

I ran into what is apparently a not uncommon problem with iPhone video: you start to take a video while phone still thinks it’s in portrait orientation (long axis of the phone vertical) and then the rest of the video is stuck that way, even if you took 99% of it in landscape mode (the way God intended). You thus have a video that the Mac always wants to display sideways. If that didn’t make any sense, the bottom line is I had a video I needed to rotate 90 degrees, and maybe you do, too. While there were plenty of solutions available on the PC, tons of Googling turned up virtually nothing for the Mac, short of finding an old copy of iMovie from five years ago.

Fortunately, I lucked in to a great solution, which doesn’t even require transcoding (with the attendant loss in quality that would result). By the way, this worked for me in getting a video from portrait to landscape, and I suspect it may only work in that situation. (That said, this should be the only valid situation in which this problem occurs, as nobody in their right mind should ever shoot a video in portrait mode, and if you do, I’m certainly not going to be complicit in aiding and abetting that crime against humanity.)

The solution requires a copy of the very nice all-purpose video player, VLC.

  1. Open the video in VLC
  2. It should actually open up in landscape orientation, regardless of the erroneous orientation data in the movie file from the iPhone.
  3. Select “Streaming/Exporting Wizard” from the File menu.
  4. Select “Transcode/Save to file” and click next.
  5. Use “Existing Playlist” and select the file you just opened below, click next.
  6. Leave everything untouched (i.e. both check boxes blank) on the transcode screen and click next.
  7. Choose MPEG4, click next.
  8. Click the button to tell VLC where to put the output file, then click next.
  9. Click finish.

This should be all it takes. The process will be fairly quick, since there’s no transcoding, but its not instantaneous as it does have to move a lot of bits into a new file.

Proof you’re a parent

For some reason I decided to take a look at the top 50 most played songs on my iPod. Here they are, listed from 5 to 1.

Rank Title               Artist             Number of Times Played
5.   Many the Miles      Sara Bareilles     66
4.   Fireflies           Owl City           67
3.   The Wider Sun       Jon Hopkins        81
2.   Baby Monkey         Parry Gripp        322
1.   Oatmeal             Parry Gripp        393

One guess as to which two songs are Alex’s favorites?

Hypothesis testing proves ESP is real

Or maybe it would be more accurate to say that ESP proves frequentist statistics isn’t real. In what has got to be one of the best object lessons in why hypothesis testing (the same statistical method usually used by the medical research industry to produce the Scare of the Week) is prone to generate false results, a well-respected psychology journal is set to publish a paper describing a statistically significant finding that ESP works.

The real news here, of course, is not that ESP has been proven real, but that using statistics to try to understand the world is a breeding ground for junk science. If I had to guess, I’d say the author (who is a well-respected academic who has never published any previous work on ESP) has had a case of late-career integrity and has decided to play a wonderful joke on the all-too-deserving field of psychology by doing a few experiments until obtaining statistically meaningful results that defy everything we know about the universe. As I’ve pointed out before, one of the many problems with hypothesis testing is that you don’t have to try all that hard to prove anything, even when done “correctly,” given that nobody really keeps track of negative results.

Getting the most data speed out of your cell phone

You may have noticed there have been very few posts here. There’s a reason for that. The first and foremost is that sending my rants in to the void has not been as personally cathartic as I’d hoped. My other goal for the blog, which actually has been somewhat successful, was to simply provide a vehicle for putting information out on the web that I thought might be useful for people, and that I couldn’t find elsewhere. Based on the traffic stats, those posts have actually been worthwhile, and my only reason for not doing more of this kind of post has been that I’ve been too busy playing with my son, finishing up my projects at MIT, and trying to get a job (in that order).

So, going forward, I’m just going to focus on the second category of posts (though I reserve the right to devolve to the first occasionally). This blog was getting too negative, anyway. In that spirit, here’s a particularly useful trick I just figured out while sitting in a coffee shop working remotely.

I recently gave up my nice window office since I was feeling guilty about taking up a nice spot but only working part time. So, I’ve been doing a lot of work remotely, usually from a coffee shop given that working at home just isn’t very productive when there’s an adorable toddler running around begging to be hugged. So, I splurged and decided to start paying the extra $20 a month to use my phone as an internet connection for my computer. This is becoming a pretty common thing, and Sprint even offers phones that will create a WiFi network on the fly (I use Bluetooth with my iPhone). I expect this will become even more common once the iPhone hits Verizon, as Apple will reportedly allow this version of their phone to create WiFi hotspots, too.

I would typically just leave my phone laying flat on the table next to my laptop. However, giving it a minute of thought, this is actually pretty dumb, for two reasons. First, having the phone so close to the laptop is probably not smart, as computers are notorious spewers of electromagnetic interference at pretty much every frequency imaginable. In theory, they should be shielded, but nothing is perfect and between the memory data rates and the processor clock speeds, a computer pretty much has the cell phone spectrum covered directly, if not with overtones. So, keep the cell phone away form the computer at least a foot or so.

Most importantly, however, leaving the cell phone flat on a table is a bad idea because it puts the antenna horizontal, whereas cell phone signals are polarized vertically. (What this means, if you’re not a fan of electromagnetics, is that the electrons in the cell phone tower antenna are being shaken up and down, not side-to-side. Radio waves are really just a way of keeping track of how electrons interact with each other. Without anything interfering, the electrons in your cell phone’s antenna will be wiggled in the same orientation and frequency as those in the cell tower antenna. However, antennas are designed for their electrons to be wiggled in a certain direction (it’s almost always along the long axis of the antenna) and a cell phone’s antenna is oriented with the assumption that the user is holding it upright against their ear.) Once I realized this, I put my phone up against a nearby wall so that it was standing straight up and down (as if somebody were holding it) and my data rates nearly doubled.

So, if you’re using your cell phone as an internet connection, keep it a bit away from the computer and prop it up so it’s vertical. Keeping it vertical in your pocket probably isn’t a great idea, since your body is pretty good at blocking radio. If you find this helps, please let me know in the comments. Right now my experience alone isn’t very statistically significant, to say the least.

Google saves the world five seconds at a time

Google just announced new technology that will cause search results to be predictively presented to the user as they type each letter of their search, saving the user from having to type their entire search, or hit enter after each search. According to Google’s Vice President, this will save the user an average of “two to five seconds…” from each search. This is what they have been working on as their next generation of search. It’s impressive, to be sure.

But does it strike anyone else as odd that we, as a society, are putting our technological efforts and resources into developing technologies that save us seconds each day when we can’t, as a society, get it together to develop infrastructure and transportation technology that will save us hours from commuting? It seems perverse that most Google engineers probably sit in California traffic for over an hour each day so that they can come into work and make sure nobody has to wait more than 15 seconds for a search result.

Moving…

In the coming months, I’m going to be leaving MIT. I’m not sure how long my access to my computer account will last, so I’m starting the process of moving everything over. For those of you that access this blog via an RSS feed, nothing will change. However, if you have this blog bookmarked, please change the bookmark to point to www.jonbirge.net. For now, that will still put you here. In the future, who knows?

Interesting article on high frequency trading patterns

The Atlantic recently carried a fascinating article on the odd patterns in stock market data caused by mysterious high frequency trading algorithms which post and remove bids and asks on stocks with no intention of ever buying the stock in question. My best personal theory is that these mysterious bids and asks are simply ways of “pinging” the market electronic infrastructure for information about the speed and timing of the hardware running it. High frequency trading has become so fast that firms do their best to but their computers as close as possible to the exchange’s servers.

My guess is these bid patterns are just acting as clocks. To quote one of the experts in the article, the speed of light actually starts to matter. Given that the timing of trades can mean millions in profits for some of these firms, it stands to reason they would try to keep close tabs on the speed of their connection to the exchanges. By sending in a sequence of false bids (bids so far away from the current price and retracted so quickly they will never result in a buy) they can safely figure out how long it takes an order to go from their computer to the exchange’s computer. They use a sequence (ramp) of increases prices simply to keep track of all the different orders and their timing. (If they used the same price repeatedly, they’d have no way of knowing which order was which.)

My next best theory is that they are probing the HFT algorithms of other firms, trying to either reverse engineer other trading programs (which would give them a decided advantage) or search for some way to induce other programs to act in a way that can be exploited, like a big robot battle played with real money. They are trying to see if they can predict what others’ programs will do in a way that doesn’t require them risking any money. Frankly, I don’t see this as too likely, given that it would be very poor programming for anybody to let their HFT algorithm respond to ludicrous bids.

A final, rather crazy possibility, is that these false bids are a way to communicate between market participants over public, non-traceable channels. If encrypted information were embedded in the timing or changes of the bids, it would be a good way for firms to collude in a way that would be nearly impossible to trace: everybody is allowed to post bids, and every is allowed to read them. Unless you knew how to decode the information encoded, you’d have no way of proving information was being exchanged between parties. And what better avenue of communication between financial firms than the stock market’s public quote system?

One thing that is certain is that this frenetic activity, with hundreds of quotes a second being generated and cancelled, is clearly meant for the “benefit” of other computers, either at the same firm or another. It’s a fascinating phenomenon. I’m not sure what it portends for the markets, however. As people leave the market in droves (as evidenced by 13 straight months of mutual fund outflows) I wonder what will happen when the only people left aren’t people.