Pet Project: Sunsetter

At home I have a nice view of the Fujisan to the south-west. I often take pictures of it in winter when the skies are so clear.

Many times I’ve told myself it would be nice to take a picture with the sun setting right behind the mountain. I’ve searched the internet for an app that would tell me when this happens but all I could find were apps that tell you where the sun sets on a particular day, not the other way around. So I decided to build it…

Sunsetter is a simple python web app running on Heroku. It’s based on the brilliant pysolar library for the hardcore astronomical calculations and binds it all to Google Maps with a dash of Ajax and JavaScript.

The app still needs polish but the data it gives out should be pretty accurate and reliable at normal altitudes (standing on top of a very tall mountain overlooking a wide plain will change the distance of the horizon and screw with the calculations a bit).

If this app was useful to you or you have suggestions, I’d love to hear from you in the comments.

Update (2012-06-03): I’ve open sourced the code on Github.

Foreman and Procfile tips&tricks

Lately I’ve been playing around with the Heroku stack and I’d like to share little tricks that might be common knowledge but which I’ve not seen mentioned on the Heroku standard documentation.

So the doc tells you you must set your Procfile as such (for a Python app):

web: gunicorn app:app -b 0.0.0.0:$PORT -w 3

You can then run the webserver on your machine for development with the command:

foreman start

But if your app also uses memcached, redis, postgres or others, then you must open as many additional tabs in your terminal to run each service (I don’t want to have the daemons running all the time on my all-purpose macbook air).

What you can do to make your life easier is to create a new file Procfile.dev which you should add to .gitignore (so that it is not uploaded to Heroku and does not affect your production environment) and add all those services in there:

web: python app.py
memcached: memcached -v
coffee: coffee --watch --output static/js/ --compile lib/

And run it with:

foreman start -f Procfile.dev

This will launch my app with standard Python (easier for quick debugging than gunicorn), my memcached instance and even compile my CoffeeScript on the fly so I can edit freely while testing my changes.

Looking in your terminal you’ll even see each service logs all pretty and color coded.

SoftBank plans for new iPad

SoftBank has just published their new deals for iPhone owners wanting to buy one of the newer iPads.

The mechanics of the plan are the same as for the iPad 2 campaign last year, you get a full rebate on the 16GB model’s price, but that applies only on the data plan charge. So if you use less than the 100MB free allotment of 3G/4G data, you will still have to pay at least the iPad’s price (split over 24 months).

Now the big differences with the iPad 2 campaign we had last year:

  • The iPad 2 3G model used to be offered by SoftBank for the same price of the WiFi only model at Apple. This is not the case anymore. You will pay a ¥10,960 to ¥10,800 premium for the 4G model over the simple WiFi model.
  • The access to SoftBank WiFi hotspots which was included for free before is now charged at ¥490 a month.

This makes this campaign plan much much less interesting than its predecessor.

3G or 4G speeds?

Additionally, the page adds an enigmatic note next to all mentions of 4G

日本国内ではSoftBank 3Gエリアのみで、ご利用いただけます。

Inside Japan, can only be used in SoftBank’s 3G area.

I suspect this is a shrouded way of saying that the iPad sold currently will only work with SoftBank’s 3G network, corroborating other sources around the web that it is incompatible with 4G LTE network bands used outside the US.

Masters of the Universe

Recently I read an article sent in by a friend of mine: What price the new democracy? Goldman Sachs conquers Europe

This is The Goldman Sachs Project […] to create such a deep exchange of people and ideas and money that it is impossible to tell the difference between the public interest and the Goldman Sachs interest.

It’s an interesting article, a realistic conspiracy theory. It made me think there might actually be guys sitting right now in a board room having a conversation like this:

Mr. Pink: “So what are we gonna do today?”

Mr. Brain: “The same thing we do every day Mr. Pink, try to take over the world!”

Except Mr. Pink probably isn’t an idiot in this story…

Is Softbank’s new iPad 2 campaign worth it?

Updated 2011/11/09 — see bottom of the post

For the iPhone 4S launch, Masayoshi Son, Softbank’s CEO, decided to go all out to keep his customers from going to aU by KDDI.

Fun Fact: during his keynote on October 7th, one day after Steve Jobs passing away, Son-san declared tearfully that these campaigns were his gifts to spread the Steve’s “art work” (he used the word 作品 as opposed to 製品) to as many people as possible.

One of these campaigns is for the iPad and it’s description is very confusing. See the figure below:

Many people take this to mean that you can get a 16GB iPad for free, ¥0 per month, if you are already a Softbank iPhone subscriber. That’s not true because ¥1,860 monthly discount on the second to last line only applies to the communications charge and not to the iPad hardware monthly cost. Going to the cost simulation page shows this well: your minimum monthly bill is still ¥1,860 (the cost of the 16GB iPad 2) and the data plan is free up to 100MB.

So in the end we get a free data plan if we don’t use 3G internet (almost don’t use it, 100MB a month wouldn’t get you much farther than regular email checking). That sounds like a classic mobile operator swindle: giving you something for almost free and then hammering you with extra high fees whenever you go over the pathetically low usage limits. Let’s look at the data plan details:

So yes, free for 100MB, capped at ¥4,980 over 111.5MB or you could choose to just pay a flat plan ¥4,410 every month whatever your usage. You end up paying a ¥470 premium for the flexibility of paying nothing the months when you almost don’t use 3G… Is that actually a good deal? I put the numbers into Numbers to see:

  • iPad 2 16GB + ZERO data plan under 100MB usage per month: ¥22,320 per year
  • iPad 2 16GB + ZERO data plan over 111.5MB user every month: ¥63,540 per year
  • iPad 2 16GB + FLAT data plan: ¥56,700 per year

So over the course of a year you would be saving money only if you stay under the 100MB cap for more than 3 months.

Is that a good deal? If you only use the 3G for emailing in the train and turn off the modem when not in use (letting it check your mail every 15min in the background would significantly bump your usage) then it could be. But having already an iPhone, do you really need to check your email on your iPad?

Myself, I will probably pass on that campaign. What would really be interesting would be a tethering option for my iPhone at a reasonable price… Well reasonable would really be ¥0 as I consider I’m already paying for the bandwidth and how I use it is none of Softbank’s business. An “acceptable” price would be maybe ¥1,000.

Please tell me in the comments what you think about this campaign.

Update: Very good point added in the comments by Maddy. If you get an iPad from Softbank for that campaign and remove the SIM card, never to use it again, you still get to download the Softbank WiFi roaming profile that lets you connect to all Softbank / FON / YahooBB / Tokyo Metro access points for free (that’s a pretty extensive network in Tokyo) and a GPS to boot. That’s a clear advantage over buying a WiFi only version from Apple for the exact same price.

Lady Homare of Greystoke

The other day as we were watching TV, my girlfriend was saying that 沢穂希 (Homare Sawa), captain of Nadeshiko Japan the national women soccer team, should really keep her hair tied up under all circumstance lest she look like an ape…

To which I replied that comparing her to a monkey is a bit harsh, but she does look a bit like the Earl of Greystoke, Lord of the Apes. As she looked at me dumbfounded, I realized she had never heard of the original Tarzan apart from the Disney adaptation. So I dug out a torrent of the movie Greystoke and we watched it together.

The movie is just as good as I remember it from my childhood. It was Christophe Lambert‘s first major movie role. It was also Andie McDowell‘s first role so next up on the movie list is “Four Weddings and a Funeral”.

Impact of 3/11 disaster on Tokyo real estate marketing

Now a bit past 3 months after the March 11th disaster in Japan, we can observe some trends of changes to different aspects of life here. Here is one thing I could see on the real estate business 震災後 (post-disaster): there is a big focus on designing buildings that not only will withstand earthquakes, but will also help living conditions during the days or weeks without water/gas/electricity that follow as we continue to witness in Tohoku. Recently, on my way to work, I was handed a pamphlet outside my station for apartments for rent at a new building in Sugamo (Northern Tokyo). The 4xA4 page glossy paper advertisement shows on pages 1 & 3 pretty pictures of the interior and modern amenities. The back page shows a plan of the neighborhood and touts 0 key money, 0 agent fees and free rent and parking space for 2 months (this was already becoming more common before March). Pretty much standard… But on page 2, something new: a full-page dedicated to the “防災 qualities” (disaster prevention) of the building. Here is a scan with some explanations:

mansion

  1. The 2.2ha park in the middle of the grounds can hold 500 people camping for 1 week.
  2. Storage rooms hold water reserves, batteries, lamps, covers, radios, emergency toilets and other emergency supplies.
  3. Benches in the park can be converted to kitchen counter tops. The pergola can be tented over to provide shelter for refugees during bad weather. A line of multiple manholes is ready to set up emergency toilets.
  4. The building is 7.4km along main arteries from Otemachi (the traditional business center of Tokyo) meaning that even if all trains are stopped after a big earthquake you can walk home in about one hour and a half.

The website for the building also has a page on its disaster prevention design.