IRC notifications

I currently use IRSSI, a traditional text-based client for IRC. I’ve used various GUI clients in the past, but found them all to have bugs and quirks that drove me crazy. IRSSI’s been very good to me, but it’s lacking one major feature that every GUI client has — notifications. And so unless I actually *look* at my IRC terminal, I can’t tell if someone’s trying to get my attention. To make things even worse, I run IRSSI under screen on a Mozilla server (so it’s always online even if my laptop isn’t). That makes it tricky to get a notification on my local system when the trigger is on a remote system.

Back in 2010 Justin Dow blogged about one way to get this working. It’s a little complicated… You first configure IRSSI to log notifications to a text file, the run one normal interactive SSH connection to screen+IRSSI, and another SSH connection to pipe the IRSSI log back to a local script that feeds it into Growl. I didn’t want to do that.

I tried using iTerm 2 for a while. Among its many bells and whistles is the ability to do actions (like notifications) upon a regex match. Neat little feature, and was easy to get working for someone saying “dolske” in whatever channel I had active. But background mentions don’t send any obvious string, so that was a huge limitation. (I tried regexing for the ANSI control codes that hilight an IRSSI window number, but that didn’t work reliably.)

I recently read that as of OS X 10.7, the default Terminal.app includes a simple feature — whenever it receives a bell character, it will bounce the Dock icon and annotate the icon with a number. Perfect! I got this all working, so here’s what you can do:

1. Configure Terminal.app. Actually, you don’t need to. This works automatically. But Preferences –> Settings –> Advanced –> Audible Bell may be something you want to disable if you dislike terminals making noise. Or enable it for debugging this.

2. Configure IRSSI to beep on private messages and hilights: /set beep_msg_level MSGS HILIGHT

3. Configure Screen to allow passing through beeps. You can put “vbell off” in ~/.screenrc and/or toggle it interactively via Control-A, Control-G. An easy test for this is to enable Audible Bell (see step 1) and use IRSSI’s /beep command. If you hear a sound, you’re good to go.

Note that IRSSI also has a “/set bell_beeps on|off” toggle. It’s not needed for the above; it seems to be for filtering out bell characters from channel messages, but the docs are somewhat vague (and a quick skim of the source wasn’t any more enlightening).

Posted in PlanetMozilla | 3 Comments

Ten year year retrospective

Think back to 10 years ago. February 1st 2003, around 9am (EST) in the morning. Some of you will have this date burned into your memory, but many will not. Do you remember where you were, when you first heard?

I do, and won’t ever forget.

I woke up late that morning. I’d meant to watch the landing live, but getting up early isn’t exactly my favorite thing to do. To be honest, watching a routine touchdown isn’t terribly exciting. Intellectually interesting — oh my yes — but not as primally exciting as the thrill and danger of a launch. Sometimes the cable TV networks would even break away from the usual news drivel to show the first minute or two… The countdown and ignition still caught the public’s attention. The rest of the mission and landing? Not so much.

I loved every minute minute of it.

NASA’s a pretty easy thing for a geek like me to fall in love with (see #5). It wasn’t always easy to keep up with, though. The online streams often got swamped during a Shuttle mission (only a lucky few got NasaTV on their local cable station). If you knew about them, the sci.space.shuttle and sci.space.history groups on Usenet were great for technical tidbits, and even had an early cryptic hint that there might be something wrong with STS-107.

That morning it became tragically obvious as to just how wrong things were.

I slept through Columbia and her seven crew burning up on reentry. I think I’m glad I missed the immediate confusion over what was happening. But instead I got it all in one lump, when I finally started my day by reading the news on Fark.com. It took a moment to sink in — Fark was a unique blend of news and humor, but the “News Flash!” headline I saw was unusually direct and blunt:

Space shuttle Columbia explodes on re-entry. All on board killed

Oh… no. No.

Things moved quickly from there. The rough outline of what likely happened was publicly known within days (instead of weeks, as NASA was significantly more open than they were in the Challenger era). An accident investigation board was formed, and held regular sessions to update the public on their progress. A report was generated, leading to a NASA Shuttle program that was reformed but also put on a path to shutdown.

If you’re interested in a technical, engineering and systems view of what happened, there is no better resource than the final report from the Columbia Accident Investigation Board. It’s long but also highly readable. A large one-part PDF of volume 1 is available here.

Another retrospective on the Columbia accident can be found on former flight-director Wayne Hale’s blog. I watched it unfold on the Internet, but he was there.

The 1941 poem High Flight is a surprisingly prescient tribute:

Oh! I have slipped the surly bonds of Earth
And danced the skies on laughter-silvered wings;
Sunward I’ve climbed, and joined the tumbling mirth
of sun-split clouds, — and done a hundred things
You have not dreamed of — wheeled and soared and swung
High in the sunlit silence. Hov’ring there,
I’ve chased the shouting wind along, and flung
My eager craft through footless halls of air….

Up, up the long, delirious, burning blue
I’ve topped the wind-swept heights with easy grace.
Where never lark, or even eagle flew —
And, while with silent, lifting mind I’ve trod
The high untrespassed sanctity of space,
– Put out my hand, and touched the face of God.

Posted in PlanetMozilla, Technology | Comments Off

Font politics

There’s a nice blog post up today talking about the typefaces used in the current presidential campaign. (Along with a link to an interesting study about their impact on perception.)

I couldn’t resist making the following:

(References: [1], [2], [3], [4] ;-)

Posted in PlanetMozilla | Comments Off

Demo: Image enhancement with getUserMedia

Enhance 224 to 176. Enhance, stop. Move in, stop. Pull out, track right, stop. Center in, pull back. Stop. Track 45 right. Stop. Center and stop. Enhance 34 to 36. Pan right and pull back. Stop. Enhance 34 to 46. Pull back. Wait a minute, go right, stop. Enhance 57 to 19. Track 45 left. Stop. Enhance 15 to 23. Give me a hard copy right there.

It seems demos of the new WebRTC getUserMedia() are all the rage these days. The bug’s bitten me too, so I took Tim’s green-screen demo and hacked it up to my own ends…

A common technique in photography — especially astrophotography — is “image stacking.” The stuff you DON’T want in your image is transient and random noise, whereas the scene you DO want in your image can be reliably and repeatedly captured. So, the basic idea is to take a bunch of photos, changing as little as possible, and then use image processing to combine/average (“stack”) them together. Once you start thinking about capturing photons this way, it’s possible to capture images that far exceed what one would normally expect.

I’ve implemented a simple-and-dumb version of image stacking using HTML5′s getUserMedia() and canvas. Let me illustrate with some pictures.

First I pointed my super-cheap USB webcam at a thing on my desk — which was dimly lit and quite stationary. Here’s a typical frame of captured video:

Doesn’t look very good; it’s a typical poor-quality webcam image. Next, using my little hack, I then captured 50 frames at 640×480 and averaged them together:

Yum. Much better. The image is overall much cleaner; the random-color “static” is suppressed in favor of flat colors and smooth gradients. (A little too much so, making it look cartoonish. I’m not sure if this is because of my cheap camera, a dumb algorithm, or something else.). But this image isn’t just smoother — it’s also sharper. Lines and edges are now crisp instead of blurry and mottled. Text labels that were barely readable before are now easily readable. This is particularly evident in tiny “◃SCALE▹” and “◃POSITION▹” labels just above them.

The differences are even more obvious if you boost up the brightness of the above images in Photoshop. The already-bright areas are now washed out, but detail in the darker areas is easier to see. In particular, the area from the column of dark buttons to the lower-left corner of the pic is much more detailed than in the single-frame capture:


Now, just point your space telescope at a dark patch of the sky, use similar techniques to stack up 23-days worth of exposure, and you get this. Neat.

If you’d like to play around with this demo yourself, try it out in your browser here. I’m curious if people can find improvements to the averaging (in either speed or quality).

Posted in PlanetMozilla | 5 Comments

Unicorns and Mozilla

Let’s file this under “reasons I love working at Mozilla”. Because, well, that’s true and I can’t think of a better place for it!

Months ago (months!), I ran across an amazing, amazing thing for “Unicorn Poop Cookies”. I’ve had this tab open in my browser since then, and it was time to close it out. So I made some cookies. Oh, yes. And who better to share them with than my awesome coworkers?!

Here’s the recipe I used…

  • 1 cup butter
  • 0.75 cup sugar
  • 1 egg
  • 0.5 teaspoon vanilla extract
  • 0.25 teaspoon lemon extract
  • 2.5 cups flour (bleached — I know — to show color better)
  • 1 teaspoon baking powder
  • 0.25 teaspoon salt
  1. Cream butter and sugar. Add liquids, mix well. Slowly combine in remaining dry ingredients.
  2. Let dough chill. Then divide into portions, add coloring (use gel food coloring for bright colors)
  3. Chill again. Form dough into ropes. Splice in various colors, twist. Spiral into cookie-sized portions. Chill yet again.
  4. Make an egg wash (for shininess and to adhere toppings) with 1 egg + splash of water. Brush on. Sprinkle with decorations. “Disco Dust” is great for that added special sparkle.
  5. Bake at 375°F for no more than 8 minutes. Watch carefully, you want the dough to _just_ set, not become brown and crispy. These will be soft, almost underbaked, cookies about the consistency of PlayDoh.
  6. Once cooled, feed everything to a unicorn and wait for nature to Do Its Magic™.
  7. Serve with assortment of marshmallows other omgfluffy things. Such as more unicorns.

TBH, I’ll probably do it differently next time. I think the cookies turned out fine, but I’d rather use almond flavoring instead of lemon. The lemon extract I used gave a nice subtle(?) “tang” upfront, but also gave a distinct lemon aftertaste that lingered a bit too long. I may also be slightly biased for anything almond-flavored. Hmm, maybe an almond paste center would be interesting.

Special thanks to Jonathan Wilde for letting me borrow his Unicorn for this process! :D

Posted in PlanetFirefox, PlanetMozilla | 1 Comment

A transit of Venus

(or how I learned to stop worrying and love the Sun)

This is going to be a longish post, the ravings of an obsessive-compulsive mind. So here’s the tl;dr… I took a picture using a telescope (indirectly). It’s Venus transiting across the Sun. It took some frantic last-minute work, but it was worth it because it won’t happen again for 105 years. Here is my picture:

The black dot is Venus. The whitish circle is the Sun. Behold, the glory of orbital mechanics!

OK, most of you can safely skip the rest of this post. Geek stuff follows…

The story begins 16 days ago. The annular eclipse of May 20th 2012. These are relatively infrequent (every 2 or 3 years), but what was special about this event was that the optimal centerline-path of the eclipse was only about a 3-hour drive away. So I packed up my gear and hit the road. Yes, I also took a picture then:

I learned a few things from this event. The first was that — damn — these things sneak up on you fast. I’m a science/astronomy geek, and knew this thing was going to happen, but it wasn’t until a few days prior to the event that some random news article reminded me that is was going to happen omgnow. So I had to scramble. The second lesson was that it really helps to do a few dry-runs for your observation. I was prepared with a pinhole projector and pinhead mirror for observing the eclipse, but I built (!) both of them the day of the eclipse and was in a rush. It turned out ok, but I glitched the math on my pinhead mirror focal length and so the image was more blurry than I had been hoping for. No big deal for the eclipse, though, since most of the experience was more atmospheric (pardon the pun)… The relaxing drive, the slowly darkening skies, and the unexpected sights along the way. The saying that “the journey is the reward” was spot-on.

Taking these lessons to heart, I decided to be more prepared for the then-upcoming Transit of Venus. After much armchair research, I figured that the absolute best viewing experience would be with a specialty telescope fitted with an H-alpha filter. The views are astounding, as is the price — it jumps into the $thousands before you can even blink.

So after careful deliberation (especially given the once-in-a-lifetime opportunity), I did what had to be done. Yep. I got a $10 #14 welder’s filter and $5 pair of eclipse glasses. (Looking at others’ expensive pictures? Priceless.) I do have a decent conventional telescope, but it’s a pain to lug around and I was thinking I wouldn’t really need it.

But I found that the eclipse glasses seemed useless for a transit — the naked-eye diameter of the Sun is surprisingly small, and the tiny dot that is Venus would be challenging to see. I also did a test shot of the Sun with my camera thought the #14 filter, and scaled a shot of the 2004 Venus Transit to that size to create a mockup of what I might be able to capture on Transit Day:

Unimpressive. Venus would be about 4 pixels — at best. I’d get better results with a longer zoom lens on my camera (Lumix GF3, 20mm); but I tend to prefer wide-angle shots, thus spending $hundreds for a lens I might not use very often was unappealing. And so I basically left it at that, figuring whatever I might manage to record would be just fine as a token momento. After all, NASA and professional astronomers would capture the event in stunning detail, so why bother trying, right?

Timeline: Tuesday June 5th. 10:30am.

I started off my morning with a weekly meeting with my boss, Johnath. I don’t recall exactly how we got to the topic of astrophotography and Venus, but we did. And something (read: Johnath’s nefarious plan) sparked my brain into thinking that surely it couldn’t be that hard to something with my telescope for the transit. And from that point on I knew my day would have one, intensive, singular focus.

The ideal way to view the Sun through a telescope is with a special H-alpha filter (expensive, as noted) or much cheaper general solar filter. Both basically block 99-point-lots-of-9s of the light entering the telescope, making it safe to look through directly with your eye. Alas, I had neither of these filters. (See above, re: prepare and practice.) Instead I fell back to an idea I had heard about, which involves physically blocking most of the telescope’s aperture except for a small opening. This would reduce, in my case, the light-gathering power of an 8″-diameter Schmidt–Cassegrain ‘scope — which is normally great for viewing dim galaxies and faint nebulae — to a much smaller opening. Say, a half-inch to 2 inches.

First step — measure twice, cut once. I was very precisely cutting a form from foam board (say that four times fast), because I wanted to ensure that it fit snugly and didn’t leak light. A full-aperture telescope pointed directly at the Sun has an overwhelming tendency to do things like cause blindness, burn things, and damage delicate optics. That would be bad. On top of the first foamboard layer would be a sheet of foil (because foamboard isn’t very opaque to light), and then a second layer of foamboard to help protect the foil and sit flush with the outer lip of the telescope body. A little bit of gray fleece on the back and flat-black paint helped cut down on reflections. Ta-da, done.

I also built a holder for the #14 welding glass I have, but didn’t end up using it. It’s too dark to use for projection, and viewing through an eyepiece just didn’t seem to work as well as projecting. I also ended up entirely skipping the creation of some kludgey adapter to attach my camera to the telescope (I have a camera fitting, but it’s for the ancient Pentax-K mount).

Finally, after all that, I set up everything to see if it worked. I got the sun projecting onto a small piece of foamboard, and my first thought was to wonder what I has screwed up to get such a big black dot in the image. Oh, wait. Right. That’s Venus. I wasn’t watching the time, and the transit was already underway. Hooray, it works!

After this I couldn’t directly see the sun from my patio any more, so I headed off to a park near work with an open view of the sky. Matt and Jared helped out with moving equipment and holding the projection surface (again, formboard) while I fiddled with the telescope. This is how we were set up for capturing the photo at the top of this post:

Afterwards, just for fun I took an image from NASA’s SDO satellite and scaled it down to compare with my own contrast-stretched shot. I will be the first to admit their $850 million toy captures a far superior image, but I’m still pleased with my own result. (To be clear, mine is on the left. :)

And that’s how I spent most of Tuesday.

Posted in PlanetMozilla | 8 Comments

Boom goes the dynamite

This weekend bug 758812 landed on mozilla-central. So begins a long, slow process of splitting up browser.js into smaller pieces.

“What’s the deal with browser.js, anyway?”

It’s big. Too damn big. For those unfamiliar with it, browser.js basically contains a bunch of the code for driving the UI in a Firefox window. Anything you click or see changing as you browse probably involves this code. A browser needs to do a surprising amount of stuff to work, and over time browser.js has become an eclectic collection of code. About 13K lines of code, in fact. That’s a lot, and leads to a number of problems… It’s a daunting behemoth for those new to the Mozilla code base. It’s haphazardly organized (at best), so it’s hard to find things unless you already know what you’re looking for. And looking at Mercurial’s history for the whole file doesn’t really give you a clear picture of how specific pieces evolve.

“So what are you going to do about it, punk?”

Break it up! The first step landed, which is just spinning out a few big chunks of related code into #included files (about 2K lines). As time goes on (and we see how changes work out), we’ll likely spin out even more. Some of these pieces may also end up evolving into JSMs, which has modest benefits for improving memory usage and startup time. We might even be able to share some of this code across products (Firefox, Fennec, B2G).

“And the bad news?”

Well, there really isn’t any. If you’re a Firefox user, you won’t see anything change. If you’re an add-on developer, you’re unlikely to be affected by these changes. The cleaving of browser.js is currently just a source-tree change with #includes, so the resulting browser.js that ships in Firefox is mostly the same. Future changes to move code into JSMs will have some impact, but we’ll try to keep change small and approachable. Really, it’s only Firefox front-end developers who are likely to notice the changes, patches to certain code in browser.js may now need to patch code in browser-foo.js instead.

“I’m not seeing any cats in this post so far.”

I am never one to disappoint. Here is my cat wearing a tiara.

Posted in Firefox, PlanetFirefox, PlanetMozilla | 9 Comments

Too long for Twitter

“Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy lies a small unregarded yellow sun. Orbiting this at a distance of roughly ninety-two million miles is an utterly insignificant little blue green planet whose ape-descended life forms are so amazingly primitive that they still think digital photo filters are a pretty neat idea.”

Posted in PlanetFirefox, PlanetMozilla, Technology | 4 Comments

Unowned Reviews

I was feeling a little bit ornery today, and decided to take a look at unowned reviews in Bugzilla (aka patches with a review request “to the wind”, instead of requesting review from some specific person).

After a bit of head scratching to figure out _how_ to get a list of such bugs through the search form, I gave up and use Teh Googlez to get my search query.

When I started there were ~130 requests (in ~110 bugs) across all of Bugzilla. Surprisingly, many of the requests (maybe 2/3rds?) were in bugs that were already resolved fixed/invalid/dupe/wfm, and were thus easily cleared out — along with a comment to take action if there was some non-obvious reason to keep the patch active. (And I use the word “active” loosely as most of these patches were _years_ old.)

For the patches in bugs which were still open, I generally assigned to a reviewer I knew was active in that area (to either close the bug out, perform a review, or reassign to someone else). In a few cases, where patches were really ancient (e.g. 6+ years waiting for a review!) I cleared the review and asked that the patch be updated or bug closed. Reviews of that vintage are simply not useful, and stand in the way of driving this list of reviews to Zarro.

Currently, there are now ~35 unassigned review requests (in ~25 bugs). Most of those are in in Rhino/Tamarin or addons.mozilla.org, and I wasn’t sure what to do with them. I’ll ask around this week.

Progress.

Posted in Firefox, PlanetFirefox, PlanetMozilla | 9 Comments

Firefox flowers

I was at IKEA the other day (for the first time ever!), and juuust as I was about to make it out the door with minimal expense I saw their assortment of fake flowers, and knew what had to be done.

Adds some nice color to my desk at work, when I get bored of it I’ll probably move it so some conference room. :)

Make your own!

1 REKTANGEL vase.
19 SNÄRTIG flowers (5 blue, 1 yellow, 3 yellow-orange, 7 orange, 3 red).
1 red SMYCKA flower.

I had the red and black filler sitting around from some other store, but it’s easily available. (Note symbolism in Firefox being anchored in the rock of Mozilla.)

My cat, Munchkin, is not available for sale. Sorry.

(…i can haz flowers?)

Posted in Firefox, Fuzzy Friends, PlanetFirefox, PlanetMozilla | 2 Comments