Just a couple weeks ago I was wondering how Google made its sparklines for Google Analytics. I was creating a Health Page of sorts for my application (a rudimentary listing of recent performance statistics, like how long it took to get a DB connection). I had designed my stats collection piece to keep track of data over the last 15 minutes or so, hoping to show a chart of recent activity when I hit my health page. I had plugged in the Colt statistics library to perform some calculations on the set of measurements in each minute. I had a lot of data points ready to display.
But I didn’t like how the Java Sparklines library worked, and I couldn’t see an easy way to mimic Google. Then just a short time later, they released their Chart API. So this morning I put my data into their API and the charts came out pretty decent (ignoring the fonts, decimal formatting, and alignment of my other stuff):
I can’t figure out how to get rid of the x and y axes entirely. I mimicked the Analytics chart size of 75×18 (or thereabouts), and it’s close. The Analytics charts also seem to have a minimum 2px buffer of fill along the bottom, so even 0 has some fill below it. They also seem to auto-size so the max measurement it at the top. There are several ways to refine what I’ve started with, but for an admin page that’s full of 80-150 charts, and only viewed by a few people, it’s a decent start.
Please leave a comment if you’ve got any tips on how you use Google’s Chart API to create sparklines.
I’ve registered several domains using Google Apps. Lately I’ve been fiddling with using Jabber with those domains, and I wanted to have a program be able to interact on IM using an account like firstname.lastname@example.org. Furthermore, I wanted to have everything Just Work.
The place to start was with DNS. Google has a help page about how to setup your DNS so that your Google Apps accounts can be federated with other non-Google Jabber communities. The problem is that neither xmpp4r-simple nor iChat simply work if I use email@example.com as my JID. Then I stumbled across this post that connected the dots for me.
Here’s a screenshot of how I setup my SRV records over at eNom:
After that, my simple chat listener worked:
My little “bot” silently accepted new buddy requests, and printed out recent messages every 5 seconds.
UPDATE:Something’s amiss here, I think. I’ll update when I have more details. Guess not. I tried this out on another domain, and thought that things didn’t work right. But I was mistaken. Everything looks good.
Odd as it may seem, the wife of one of the guys on my team got hit with some Exploding Water on Sunday morning. First degree burns on her face; glasses protected her eyes. Didn’t know nuking water in a Pyrex container could be so volatile under just the right conditions. Guess this gives you an excuse not to scrub your dishes too clean.
One of the great things about living and working in Phoenix is the weather in November. All the books say hiking season is October – April, and they’re right. The company picnic was planned for today, but it’s been cancelled since it’s predicted to rain all day. I don’t recall a rainy day this month (but I rarely pay attention to the weather), but it’s a bit funny to me to have something cancelled due to threat of rain in November. Very different from when I lived in Vermont.