02 5 / 2012

iPhone tethered with the new iPad: Bad Idea »

iPhone’s WiFi periodically sleeps and disconnects from WiFi when the screen is locked.

iPad’s hotspot SSID is not visible when its screen is locked.

The combination of this means your iPhone keeps dropping the connection when it’s in your pocket, and you have to turn on iPad’s screen to reinitiate the WiFi connection. Not a good idea.

Now I’m using iPhone tethered through T-Mobile Android phone, till I get the SIM card from Straight Talk. It should sound like the stupidest thing you can do with an iPhone, but because Android’s hotspot advertises its SSID all the time, the connection gets reinitiated immediately, and works much better.

Sad.

What’s even more sad, is that the bandwidth speed isn’t as bad as AT&T’s “4G”, even with T-Mobile’s 3G (of course much slower than the new iPad’s blazingly fast 4G LTE).

UPDATE: as mentioned in the post, there’s a hack/workaround to let iPhone not going to “deep sleep” and hence keep the wifi connection alive: playing music. I cached lots of music files via iTunes match and play all the music while on the move. It’s silly but it seems to work very well, and doesn’t drain battery as much.

Permalink 1 note

02 5 / 2012

Android to iPhone »

Wife has been an iPhone 4 user and her contract just got eligible for upgrade to 4S, and now that AT&T allows unlocking iPhones that got out of contract, thought it’s about time to get an iPhone for myself!

I just walked in to the Apple Store on Stockton, got a white 16GB iPhone 4S, and also replaced her iPhone 4 to the brand new one because the home button issue (thanks to Apple Care). All in $250 incl. taxes. Not so bad.

We activated the new 4S in store, and put back the new SIM to 4 so she can continue using it. My 4S is now activated but has no SIM, i’m using it with tethered to iPad’s Verizon LTE, but i just ordered Straight Talk SIM that should allow unlimited talk+text+data for $45 prepaid, even on AT&T locked phone. Updates on that later.

(Couple of Apple Store employees also have told me that AT&T would unlock your iPhone for international use if your account is clear for 60 days or more, like Verizon and Sprint, and that it’s a recent development. I still doubt that, but it sounds worth a try)

Coming from Android, this is my first iPhone (although I’ve used the original iPad and the new iPad, so iOS 5 and Retina display are not the first experience for me) and here’s my 12 hour impressions:

  • Camera’s quality is stunning.
  • Battery life is awesome. I will never complain about that coming from 6-hour ICS that always needs a micro USB cable in your pocket.
  • Notification Center is a mess. Turning off Sound notifications for each app is a pain, and can’t dismiss each notification with swipe?
  • The screen feels tiny. I know Retina Display is awesome, but its physical size is just too small. Note that I came from 4 inch Galaxy S, not like Galaxy Note or Nexus with the huge displays.
  • Yet, with the small screen, the device feels heavy, and is actually heavier than my Galaxy S.
  • I miss back buttons and Intent. And systeem dialer integration with Google Voice.

Overall I like it, but there are definitely things that worked better on Android, but there’s no perfect phone in the world. I’ll keep the Android phone around especially for international use and tethering. I hope Apple fixes tethering with iPad so that the same SIM card that can do tether fine with Android can do the same with the iPad.

03 4 / 2012

Perl QA Hackathon 2012 »

Over the weekend I travelled to Paris, France for the wonderful Perl QA Hackathon 2012.

Paris

This is my second trip to Paris - the last time was around 2007 when I stayed at echolet’s place for Act Hacking, sponsored by the YAPC::Asia funds.

Paris is a great place to visit. Beautiful city, Great food, Subway stations for every 1 minute walk.

P1080251.JPG

The things that bugged me during this travel was the lack of decent 3G prepaid plans for travelers (I wasted 2 days looking for a mobile phone/carrier shop that sells a prepaid SIM card with data, no avail) and hay-fever-like allergy that causes me drowsy eyes and sneezing all the time. Next time, I’ll make sure to find the exact place that sells 3G SIM for travelers and with handful of Claritin capsules.

P1080280.JPG

Hacking

P1080323.JPG

CPAN testers for cpanminus

On day 1 and 2 I suffered from the hay fever described above, but had a good conversation with garu on his attempt to implement CPAN testers report on top of cpanm’s build.log output. xdg’s blog post mentions this in details.

—test-only for cpanminus

I also implemented —test-only option for cpanminus which ticket was originally created 2 years ago. I was just reminded of the issue by charsbar, and discussed it briefly on irc and gave it a quick run to implement it. This is one of the nicest things about Hackathon - lots of tuits given by just talking to fellow hackers.

Note that --test-only actually installs dependencies if they are not installed. If you want to test a distribution with a fresh non-core dependency versions, you should combine it with -L option.

TEST_REQUIRES for MakeMaker

One of thing that I always wanted to implement was to skip test requires dependencies when --notest is specified. It felt kind of odd to implement features to skip installing test modules at a “QA Hackathon”, but well, who cares :)

rjbs’s post explains this in details, but overall, my cpanminus code handles the logic to skip test dependencies when --notest is in effect already, but because majority of build tools, i.e. MakeMaker and Module::Install merge test requires into build requires, the code has never worked like I hoped, in real world distributions.

rjbs took my complaint over our walk back to the hotel on day 2 and he implemented the patch to accept TEST_REQUIRES, as well as preserving test requires in META.json when dumping them into MYMETA.json.

carton bundle

Masaki Nakagawa, while absent from the hackthon, has implemented a pull request for carton bundle command a few months ago, and now it got merged. Now you can run carton bundle command to fetch the tarballs from CPAN mirrors and have 02packages file locally, which you can use to replay in the remote machine without relying on external CPAN mirrors on the deployment time. It’s a huge win.

P1080347.JPG

cpanfile

On Day 3 when I recovered from the jet lag and hay fever, I got the speed at full gear and started implementing cpanfile which I briefly presented at London Perl Workshop 2011.

tl;dr

cpanfile is to CPAN what gemfile is to Rubygems. It allows you to describe dependencies for your Perl applications in a DSL pretty close to (and somewhat compatible to) Module::Install or Module::Build::Functions DSL.

Listing dependencies

First, Perl distributions usually have Makefile.PL and Build.PL to describe dependencies and the way to build, test and install dependencies. There’s nothing wrong with these files for CPAN distributions. Meanwhile, when your perl application (even if it is not a CPAN distribution per se) needs a way to describe dependencies when you expect other developers to run it locally cloned from github, or PaaS (Heroku, dotCloud, Stackato) to satisfy its requirements before running on the platform.

Most PaaS providers described above support cpanm --installdeps . to install dependencies, which means you should put Makefile.PL or Build.PL in the repository to push out to these platforms, but to me it always has felt like a non-ideal situation for several reasons:

  • What you’re writing is an app, not a CPAN distribution.
  • Your application is not meant to be installed. Rather, meant to be run from the current directory
  • Experienced developers usually use tools like dzil or Module::Install to list dependencies, and you don’t commit inc/ or generated files to git - which most PaaS uses to deploy files. Ugh.

Dzil has a releaser plugin to cope with this issue, and you can always write Makefile.PL with MakeMaker by hand, but there’s a gap to this problem.

Self-executing or Perl DSL

Second, these *.PL files are meant to be self-executed, i.e. you run it like a black box perl Makefile.PL; make; make install. In a recent batch of evolution in CPAN clients and ecosystem such as local::lib, I think it’s a better design for CPAN clients to figure out the way to extract dependencies and how to build & install the application. MYMETA spec and Leont’s CPAN static installer spec is a great way to achieve this, and you can consider cpanfile as an additional simplification to have a canonical syntax to represent the dependencies in a CPAN::Meta::Prereqs compatible format (in fact, CPAN::cpanfile module only has one method that generates the CPAN::Meta::Prereqs out of the cpanfile DSL).

cpanfile in cpanminus

I added a cpanfile support in cpanminus devel branch, which means you can just have cpanfile in your application root and expect cpanm --installdeps . to install dependencies, without having a Makefile.PL at all. It is a good start, and I’ll expect more support for cpanfile in the ecosystem such as Module::Install.

Actually, rjbs has just jumped on the wagon a few minutes before I left the venue and implemented cpanfile releaser plugin for dzil.

I hope I can get more done in a coming Carton hackthon in Tokyo next week. I just scheduled this hackathon to work with hackers like Masaki and Tokuhirom, and can also work on features to fill up my slides for OSDC.TW in the weekend right after that. CDD++ :)

Acknowledgements

P1080387

I want to give huge thanks to elbeho, BooK and French Perl Mongers for organizing the hackathon, and awesome sponsors who made the hackathon possible.

I heard the QA hackathon will continue going on at London in 2013, and can’t wait to participate to hack more.

Check out my flickr set for more photos taken in Paris.

Permalink 1 note

03 4 / 2012

As we walked back to the hotel before dinner, I asked Miyagawa how his hackathon was going. He said he wanted to get better support for all of META.json’s prereq types (suggestions, test requirements, etc.) into cpanminus, but had been stymied by ExtUtils::MakeMaker’s lack of support for test requires. One big motivator for him was to speed up the —notest option by skipping test prereqs, but that wouldn’t work if EUMM had no mechanism for them.

I filed a pull request for adding TEST_REQUIRES with tests. It’s a bit of a mess, but that seems to be life with EUMM.

rjbs, like always, my hero!

17 3 / 2012

Today I was looking around a way to override/patch Net::HTTP requests to a Sinatra app in tests, and happily found that the sham_rack gem exactly does that.

ShamRack.at("rackup.xyz").rackup do
  run MyApp.new
end

Put this snippet in your test_helper and all the calls to Net::HTTP inside your tests go through the Sinatra app. Neat.

I then wondered if someone has ported this to Perl, and voila: I did that almost an year ago.

my $psgi_app = sub { ... };  # any PSGI compat app
LWP::Protocol::PSGI->register($psgi_app);

and now all the LWP supporting libraries go to your app.

I really like moments like this.

Permalink 4 notes

17 3 / 2012

resque-top »

resque-top is my first Ruby gem released to the world of rubygems.

Like mytop and memcache-top, resque-top connects to the resque database and displays the information about queue and processing workers. Basically the same information available on the resque-web UI but on the command line.

Permalink 2 notes

29 1 / 2012

Exciting Times »

Here’s a quick (big) announcement: I’m parting ways with DotCloud and will join COOKPAD in February.

As for DotCloud, It’s been an interesting ride for me at 180 Sansome and I will definitely miss working with them, and wish the best luck at their challenge to be the best platform as a service. My last day at DotCloud is 1/31.

On February 1st, I will join COOKPAD, Inc. to work full-time as a senior developer. COOKPAD may not need any introduction for any Japanese audience, since it is everyone’s favorite recipe sharing website. Here’s a quick intro about the company in English.

P1050389.JPG

As a weekend chef, I use the site a lot myself, and am thrilled to join the company to contribute to the growth. The company is Tokyo-based (with its lovely headquarters in Shirokanedai) but I will continue my life in San Francisco and will see my friends more often in my occasional visits to Tokyo.

P1050396.JPG

I’m really excited to work with brilliant folks from COOKPAD, most notably the founder Aki Sano, and Daisuke Horie, who I enjoyed working with at Six Apart, along with very talented engineers in the team. (Oh, and I heard they’re hiring :D)

Exciting times!

Permalink 59 notes

28 1 / 2012

Lumix DMC-GX1 JPEG settings »

One of the problems I see with GX1 has been that the default JPEG output is so “flat” and it’s not my taste, especially when compared to the GF1. After a bunch of trial and errors, also with reviews on kakaku and 2ch, here’s something I came up with.

Feel free to cargo cult it, but don’t blame me for bad JPEG rendering because of that.

Mostly used with Summilux 25mm f/1.4. Some settings might not be appropriate when used with other lenses.

Before doing this, don’t forget to apply the firmware Version 1.1 update. It fixes the AWB performance and it’s really important.

  • Photo Style: Custom (STD) / Contrast +2 / Sharpness +1 / 彩度 -2 / NR -1
  • Aspect ratio: 3:2
  • Resolution: L 14M
  • Quality: RAW + Super Fine
  • Intelligent Resolution 超解像: Weak 弱
  • iD Range Control: Weak 弱
  • ISO high limit: 800 (might not appropriate if you use the zoom lens)

This setting makes a personally satisfying JPEG rendering, and the auto white balance seems more appropriate than Lightroom in many cases with the firmware update. (Lightroom tends to color things more warm and make it look like more dramatic)

Yet, if you take shots in a dark room, shooting with RAW will probably get you a better white balance and exposure adjustments. See my photo gallery for samples - those with .JPG (uppercase) are GX1 auto JPEG and .jpg (lowercase) are published from Adobe lightroom 4 beta.

I will mostly use JPEG and only render from RAW for such underlight photos or failed shots with over/under exposure.

Oh by the way, if you render from RAW, you can still make geotagging work, if your software supports the XMP sidecar files. You still have to transfer from Eye-Fi to your computer wirelessly, instead of reading directly from the SD card though.

25 1 / 2012

Shit San Francisco hipsters says at hipster cafes.

Permalink 2 notes

25 1 / 2012

DMC-GX1 firmware update version 1.1 is available from the Panasonic website.

I applied the update this morning and it’s yet too early to judge if it actually got better, but i definitely see the differences.

GX1 AWB, v1.1:

P1070561.JPG

RAW Lightroom 4 AWB:

P1070561.jpg