Monday, February 07, 2011

The Reddit Effect

Early this morning an old post of mine got voted up to the main page on Reddit. I may sift through the comments when my day settles down but I just want to show you the impact of the exposure, thanks to my Analytics page:

a 4147% growth. That's not 40x, that's 4000x, as evidenced by this next graph:


Looks like the Reddit comments wound up on my post's page. Do I really have to delete all the chaff?

Sunday, February 06, 2011

@RunAsJUnitTest, @RunAsPluginTest

After many idle months I'm starting to pick up work on the Workspace Mechanic for Eclipse, and that included finally publishing some of the tests that accompanied it.

And then, after starting to work on the tests some more, I realized I was missing something I used while writing plug-ins internally at Google, and so I copied them into the internal tests package. They're mostly documentation, but useful documentation. Here's the slightly reduced code for both of them. Their purpose should be clear:
/**
 * Declares that this test can be run as a JUnit test, and does not require
 * the trappings of running as an Eclipse plug-in test.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface RunAsJUnitTest {
}
 
/**
* Declares that this test must be run as a plug-in test.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface RunAsPluginTest {
}
Nobody likes running tests in the plug-in container if he or she doesn't have to. Surely, I'd much rather run nice fast JUnit tests, particularly when I've separated out code specifically for fast unit tests.

Of course, without infrastructure to support these, they're little more than documentation, but documentation that has type completion in the IDE.

So, what do you think? Would it be reasonable to have Eclipse support annotations like these? Do you think these have merit, or are utterly worthless?

Thursday, January 27, 2011

guava-osgi project gets a fresh update!

Thanks to Mikaël Barbero, the guava-osgi project has been revived!

At the new update site you can find bundles for Guava versions 3, 4, 5, 6 and 7. This is just in time for the imminent release of r08, and we will publish a plug-in shortly after its release.

Between me and Mikaël, guava-osgi will henceforth be updated just days after Guava releases. This is because Mikaël wrote a script that automates most of the nasty work.

Please give your thanks to Mikaël!

Thursday, January 13, 2011

fluid security

I flew out of SJC today. As mentioned on my Buzz post, I was worried about trying to bring a bottle of prescription cough syrup with codeine through an airport TSA checkpoint.

According to the TSA's website, each container must be 3.4 oz (100ml) or less. Medications are allowed in reasonable quantities exceeding 3 oz, and must be declared for inspection. I was also told to be prepared to verify that the name and address on the bottle correspond with my identification.

It's hard to read unless you view the full image but the bottle has tick marks for measuring contents. The bottle holds 120ml of liquid and at that time had only 100ml of liquid (which makes sense, I took two 10ml doses.) Of course, they wouldn't know that unless they examined the bottle.

Tick marks are visible in this photo
Gratuitous second photo

So when I passed through TSA I dutifully presented the bottle to an agent on the outside of the security checkpoint, who told me to pass it through with the rest of my luggage. He did not ask for ID to verify that I owned the contents. I walked through the metal detector and waited for my belongings.

However, there conveyer belt stopped moving followed by a long delay. The agent responsible for scanning the X-ray view for dangerous substances was definitely looking at something. I didn't know what he was looking at, nor did I care, I assumed I would be quizzed about the bottle after which I would present identification. Instead he called over another agent, and asked for her advice.

Eventually I found out what they were making a fuss about: the Nalgene bottle attached to the exterior of my backpack.
Don't they realize that only peace loving docile sheep travel with their own water bottles?
There was a small quantity of water left in the bottle and they could not figure our what to do. I offered to drink the water. They ignored my suggestion and continued conferring. After yet a little more time, they passed the bottle through, allowing me to board my flight home. They never inspected the bottle of cough syrup. So, a 120ml bottle with 100ml of liquid was unexamined, but a Nalgene bottle with a little water in it underwent great scrutiny.

Just how much water was in the Nalgene bottle? Let's look.


You should be able to make out the liquid at the bottom of the bottle. Below is another view of the scale on the bottle's side for reference.


Eyeball it .. two ounces? One ounce?

I dumped the contents into a shotglass:

Even criminals need water.

0.8 fluid ounces, which is 23.6 milliliters.

So they ignored a 120ml bottle (which ostensibly could have had 120ml of fluid) but stared at 23.6ml of water.

To be fair, it's possible they were discussing a finer point of procedure rather than the immediate potential risk of my water bottle, but it's not as if there wasn't a line of travelers behind waiting on this issue's resolution.


Chart Time!

Here are the quantities listed in this discussion. Remember, it's that small value they made they made the big fuss about.

Apologies to the color-blind
Fin


Thanks for reading. You may now proceed with the eye-rolling and advising better ways to spend time.

In the meanwhile, it's time to dose up on codeine and get some rest. Good night!

(ps no nudie scanners in use at SJC.)

Wednesday, November 24, 2010

Tenneseans, I hope there's no disaster, but if there is, you're welcome.

 In 2005, there was a hurricane which forever changed New Orleans. But not only that, it woke up many people who were in the business of ensuring that poor people affected by those disasters had access to funds and services to which they were due by their government, their employers, et cetera. My wife was one of those people. As far as I can cobble together, disaster legal services was a much more organized and effective years before that, and it went in to a bit of a decline. Until we met Katrina.

So my wife, a former disaster legal aid attorney, asked if there was a way I could help coordinate communication between different groups. "Something like a listserv." I still find it adorable that she calls it a listserv. So I set up a mailing list so people around the country could share information. Nothing much, really, but it helped get people together.

I have come to find out that the Memphis Bar association has a nice condensed disaster relief legal assistance reference guide for volunteer attorneys. Stuff like this:
Q. 7 I received my check for rental assistance, but there are no places to rent. 

If you are eligible for housing assistance from FEMA but are unable to find a rental house or apartment within a reasonable commuting distance of your damaged home, please contact FEMA at 1-800-621-FEMA (3362) or visit a nearby Disasater Recovery Center. FEMA will evaluate your situation, and, if appropriate, may authorize a travel trailer or mobile home.
Going back to the title page it says:
With special thanks to the following contributors:

...
Robert Konigsberg
I didn't do much, but it's nice that it helped.

Thursday, November 11, 2010

Replacing my Mac Keyboard with a Logitech Internet Navigator

(Second in my Luddite Internet Technology Series)

The Caps Lock key on my Mac keyboard was not responding so I pulled out the first keyboard I could find lying around: the Logitech Internet Navigator keyboard. You know the type: the one with buttons labeled "Search", "Shopping", "Favorites". It probably came with a machine I bought long back when. But you know what? I love it.

It has some nice features I came to expect from my Mac keyboard: volume controls, and media play/rewind/pause buttons. All those work as you would expect. There's also a little scroll wheel on the keyboard which I don't really need since I have a scroll wheel on my mouse. Even the "Sleep" button brings up the sleep dialog box. The only thing missing is a replacement for the eject button. (Update: downloading the Logitech Control Center for OSX did the trick. Now the only thing missing is a USB port.)

The only change I had to make for it to work well with OSX was to swap the behavior of the Command and Option keys (Pressing Command was sending Option and vice versa.) So thankfully the OSX keyboard settings allow me to reprogram the function of those keys, so I implemented a modifier swap. (Update: Once I installed the Logitech Control Center, the keys were swapped once more, Restoring original behavior of keyboard modifiers did the trick, effectively making this paragraph "Remember to install the Logitech Control Center and do nothing else."

As for general keyboard behavior, the keys have a nice tactile feel, you don't feel like you're constantly hitting the bottom of the keyboard tray as you do when using the Mac keyboard. It comes with a keypad on the right side, which I've come to expect with all my keyboards. The keys are slightly more smooshed together. But hey, nothing is going to do it for me quite like my IBM Model M. I just wish in this case that for "IBM Model M" the M stood for "Macintosh."

In retrospect, the keyboard and mouse that came with my Mac Pro were probably the first two such peripherals that I have ever thrown out due to mechanical defect. Oh, and their earbuds. And on the other side of that is Logitech: with the exception of one piece of hardware, I've never been disappointed with their products, and as of today I'm no longer disappointed with that one exception.

It's nice to be able to bring a 2002 peripheral with so many silly buttons to just work naturally with a modern OS. Back in 2002, all those buttons were pie in the sky. Today they're launching my apps.