Researchers publishing some groundbreaking findings today in the journal Science have concluded that poverty imposes such a massive cognitive load on the poor that they have little bandwidth left over to do many of the things that might lift them out of poverty – like go to night school, or search for a new job, or even remember to pay bills on time.
The large seconds hand (#6 in the diagram above) on my watch somehow got screwed up; when resetting the chronograph, it would always rest on 56 instead of zero. Apparently fixing this is an undocumented feature, though really quite easy to do.
Simply pull out the crown (#12) to the second position as if setting the date. Now, when you press the reset button (#11) the seconds hand will advance by one. Just keep pressing it until you reach zero and you’re all set!
If you’ve ever run into this annoying message before:
$ wget https://raw.github.com/bagder/curl/master/lib/mk-ca-bundle.pl
--2012-06-12 14:42:46-- https://raw.github.com/bagder/curl/master/lib/mk-ca-bundle.pl
Resolving raw.github.com... 22.214.171.124
Connecting to raw.github.com|126.96.36.199|:443... connected.
ERROR: cannot verify raw.github.com's certificate, issued by `/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3':
Unable to locally verify the issuer's authority.
To connect to raw.github.com insecurely, use `--no-check-certificate'.
Sounds easy, doesn’t it? Well it actually is quite simple but the error messages along the way can really trip you up!
My first attempt at profiling a bit of code was to use the full-boat Eclipse stack: Eclipse Test & Performance Tools Platform Project! Well, what they don’t tell you anywhere on the project page is that it’s only supported on Windows and Linux. A Mac port was started sometime around 2004 and never completed. Yeah, it’s been that long!
And so this brings us to Apple’s Shark: an extremely barebones, no-frills profiler, but, what the heck, it’s free. For the basics on using this tool with your Java app, this great post has all the details. There’s just one catch: 64-bit support. There is none. If you’re on a 64-bit stack and you try to run it, you’ll see something like the following:
$ java -agentlib:Shark -cp foo.jar com.foo.Bar
Error occurred during initialization of VM
Could not find agent library: libShark.jnilib (searched /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries:/System/Library/Java/Extensions:/Library/Java/Extensions:.)
Er, what? Now let’s see here…
$ ls -al /System/Library/Java/Extensions/libShark.jnilib
-rwxr-xr-x 1 root wheel 50352 Oct 24 2010 /System/Library/Java/Extensions/libShark.jnilib
Well, that’s odd. But it said it looked there, right?! Well, as it turns out, the Shark JNI library only supports 32-bit JVMs. So finally, we arrive at the following:
I recently compiled Q4M on my Mac and I’m documenting it here now because it proved to be somewhat painful so hopefully you’ll avoid a bit of grief by reading this.
First off, you need MySQL Server. I’ve been using MacPorts for some time now, so this is installed via ports. Unfortunately, it seems to be a pretty barebones config so I had to create a custom variant to add the necessary --with-fast-mutexes option. You can grab my modified Portfile from github. Just clone it into some directory and then add that path into /opt/local/etc/macports/sources.conf before the rsync line. Once you have that, go ahead and reinstall MySQL:
$ sudo port install mysql5 +fast_mutexes
Q4M also requires access to the MySQL sources, so let’s get those unpacked:
I spent a bunch of time the last couple of days sprucing up a few of my personal projects. Today was mostly spent on the lunchomizer, which gives you random suggestions for lunch, based on your location. It still only works for Midtown Manhattan since the locations all come from Midtown Lunch and that’s also the neighborhood where I happen to work.
The biggest change today was fixing the HTML5 location support and a much better mobile experience via a separate Rails layout tailored for small screens. All in all, it was pretty easy, but one thing that surprised me was a noticeable lack of a de facto standard library for doing mobile, or really any, browser detection. I ended up using a gem called Nomadic and that worked well with the following controller code:
class LunchController < ApplicationController
# use mobile layout for mobile clients (using browser detection)def choose_layout
Nomadic.mobile?(request.env) ? "mobile" : "default"endend
A fairly simplistic solution, but perfect for this app which has only a single controller and a single view :)
And for the curious, the full source is available on github. Fork away!
I got this creepy voicemail today on an unused Vonage number that I have:
Vonage transcription: “Good morning and good morning and good more and then I’m. I’m alone. So in the shower. I am gonna be more than any card board boat races in my dreams. Swimming in the lake trip the water”
PS. this is just an excuse for me try out the new HTML5 <audio> tag, which apparently doesn’t work in Firefox 3.6.x.
So it turns out that Windows Firewall, even in Windows 2008, still can’t accept a range of ports, either in the UI or via command line, most commonly when setting up PASV FTP transfers. The common workaround is to create one entry per port in your range like so:
C:> FOR /L %I IN (60000,1,60200) DO netsh firewall add portopening TCP %I "Passive FTP"%I
While this does work, it’s slightly annoying that you have to create 200 individual entries in your config. My slightly better workaround is to just stick every port into the text entry field using this simple ruby helper:
You can run this either in IRB or directly on the command line using the following command:
$ ruby -e 'puts (60000..60200).to_a.join(",")'