home ¦ Archives ¦ Atom ¦ RSS

Apple and Brother Printers

Maybe this will get indexed by Google and save someone else some time.

Today my Brother Printer started giving me an annoying pop-up and refused to print:

Some of the software for the printer is missing.

Gee thanks.

Now my Brother HL-5250DN printer had been working perfectly fine, although I hadn’t used it for a while. This new message alerted me to the fact that there was some new software drivers. However, the Apple downloader inside of System Preferences, for whatever reason, just couldn’t get the job done. Tried Apple Software Updates but it didn’t have any new printer updates. Went to the Brother site and downloaded the latest drivers. Installed them. Didn’t fix the situation.

Finally went straight to the source, Apple. In the support section, there was a recent release on December 13th for Brother Printer Drivers 2.8. Slurped down all 156 MB in a few minutes, it’s good to be on FiOS, installed, and problem solved.

Hope that helps!


Pattern and Waffles

Link parkin: waffles, because I’m now in love with both CLIs and ML.

Waffles seeks to be the world’s most comprehensive collection of command-line tools for machine learning and data mining. Our native tools have minimal dependencies (no interpreter, VM, or runtime environment is necessary), and build cross-platform. If you have a useful data mining tool that meets these criteria, we want it in Waffles.

pattern, because I’m still in love with Python, ML, and information visualization.

Pattern is a web mining module for the Python programming language. It bundles tools for data retrieval (Google + Twitter + Wikipedia API, web spider, HTML DOM parser), text analysis (rule-based shallow parser, WordNet interface, syntactical + semantical n-gram search algorithm, tf-idf + cosine similarity + LSA metrics) and data visualization (graph networks).


Satisfaction

Merry Christmas and happy holidays folks!!

Once you get a moderately complex cron entry and set of bash scripts working there’s a nice sense of satisfaction. You gotta like collecting, archiving, ingesting, and indexing 100’s of megabytes of data in your sleep. On a holiday. If it keeps happening night after night, so much the better.

I’m particularly patting myself on the back because it only took one debug cycle to get things working. Surprised myself there.


mongo-hadoop

Link parkin’: mongo-hadoop. Probably so alpha it hurts, but curious to see what integrating mongodb and Hadoop actually means. Would be very convenient to use mongo as a data source.

Via Russell Jurney


Pycon 2012 Talks

PyCon 2012 Logo Still planning on attending PyCon 2012. Just gotta work out the financing and job schedule.

The conference talks were just announced. Too much good stuff. I’m most attracted to the data swizzling, geospatial processing, and systems hacking themes of the conference.


dangerousmeta 12 years old

Dangerousmeta logo
Gotta give a shout out to Garret P Vreeland’s dangerousmeta weblog, which recently turned 12 years old. As a longtime follower (I go back to the EditThisPage days) I have to say Vreeland is one of the few firehose weblogs I’ve managed to tolerate over the years. That dude can spew! And if I could type 120 WPM, I might crank out as many posts as Vreeland does on a daily basis, although I’m more impressed that he actually reads all the stuff he links to (no retweets here) before posting about it.

I don’t follow through on 10% of what he points to, but I’ve genuinely enjoyed his eclectic mix of culture, politics, technology, and New Mexico. Hopefully he doesn’t mind me cribbing his logo for some visual spice. Shoot me an e-mail if there’s a problem. And here’s hoping to another 12 good blogging years.


Guilt No More

Mission Impossible Udvar Hazy Snap I previously called Mission: Impossible — Ghost Protocol a guilty pleasure. Well now I don’t have to feel so guilty about wanting to see another Tom Cruise mega-action sequel.

First you’ll note the red circle in the screen capture on the right. With The Dark Knight Rises now on the horizon, (witness the latest trailer link to QuickTime), getting 6 minutes of Chris Nolan’s upcoming vision can make just about any movie worthwhile. My guess is that the prologue goes back to some confluence of beginnings for Batman, Ra’s Al Ghul, and Bane. I’ll be interested to see if there are any influences from Frank Miller’s The Dark Knight Returns in The Dark Knight Rises or whether that’s grist for a fourth film.

Even better is that’s a capture from the Udvar-Hazy Theater website. That’s the IMAX(real IMAX) venue right around the corner from me. I’m betting on another fabulous experience seeing a movie there.


Emacs 24

What with the nice coverage that Mastering Emacs is giving to the imminent GNU Emacs 24 release, I’m starting to think it might be time to kick the tires on the new ride. Thankfully, emacsformacosx has me covered with binary builds.


Emacs, DEL, and delete

I’m mildly chuffed that the following issue stumped me for a couple of hours this afternoon. I’ve been using Emacs forever and the solution should have been a no-brainer. Warning, major nerdage ahead.

So I’ve been amping up my Python hacking at work. The last time I was in such a mode, I was using Xemacs. In Python code, when I was at the first character of an indented line and hit delete, it would outdent one level. Very handy and natural for Python editing.

For my current run, I’ve switched back to Emacs 23. For a while, it wasn’t really bugging me, but the outdent didn’t work. A delete would just erase one character backwards.

Finally I got fed up, and the issue turned out to be the following. On modern keyboards, you often get two keys marked with delete. The one in the standard QWERTY position should effectively be a backspace and erase. The other one should be a rightward erase. Emacs is smart enough to figure out the difference, so you can individually bind DEL and delete. It’s all documented right in the Emacs manual. Unfortunately, I could never get the right combination of Google keywords to find a web page to explain this. I had to resort to gasp, Reading The F*! Manual.

The problem is that the latest and greatest Emacs python mode only binds delete to the really useful py-electric-backspace which Does The Right Thing (™). Meanwhile, DEL is left to its normal backwards character erase. Massive irritation for this particular user.

So here’s the fix: [sourcecode language=”text”] (add-hook ‘python-mode-hook ‘(lambda () (define-key py-mode-map “\d” ‘py-electric-backspace))) [/sourcecode]

May this post save another soul some time and effort.


Mushroom Jazz Bundle

If I was a Mark Farina completist, I’d be really tempted by this new Mushroom Jazz Bundle from OM Records.

Oh, wait, I am a Mark Farina completist. So I am tempted. Even though I’ve got every CD in that bundle. Even though I’ve got the tee shirt. Well, I don’t have the poster. So it would boil down to $70 for a signed poster. I guess I could EBay the rest of the bundle to try to break even, but somehow that seems sacrilegious.

So I guess I’ll have to pass. But more like that please OM Records.


Building from CLI

Link parkin’: Luke Wroblewski describes how Bagcheck practices progressive enhancement by developing the product starting from the web API, then constructing command line interface (CLI) tools, and thence to client side interfaces.

From a UNIX perspective, I’ve noticed a CLI is really helpful because you can smoothly tie into standard UNIX scripting tools. This allows for large scale automation which you need more often than not.

Bonus links: The Bagcheck technology stack and Wroblewski’s writings which often include comprehensive notes on interesting conference sessions.


PostgreSQL, Tabs, and COPY

PostgreSQL Logo Learned this the hard way, so maybe posting it will help someone else out.

PostgreSQL supports the SQL COPY statement which is a good way to bulk load a lot of data fast. Think a million tweets in JSON. Each row pulls out some of the key tweet fields into columns and the tweet JSON is also stored in a field just in case. The tricky part is that the bulk load input data, that’s not already dumped from a Postgres DB, has to be in a text format that’s akin to CSV.

This isn’t a big deal if your table fields are relatively simple, but as soon as they become arbitrary strings things get hairy. Escaping special characters and string encoding quickly bite you in the butt.

I was generating a large number of bulk data files, in tab separated format, from a Python script. Thinking the task to be straightforward, I started to handle escaping the record separator using Python’s str.replace. Tab escaping sort of worked, but then I had UTF-8 encoded strings. These strings are a pain to use str.join on and then write to an output file. Pretty much every data file generated would have some kind of import error within the first 100 records.

Too bad I didn’t have a magic tool that knew how to write CSV files and deal with all the escaping issues.

Oh wait. I’m using Python. Batteries Included.

Busted out the csv module. Just picked apart my tweet data structure into a tuple, along with the tweet JSON source text. The Python documentation has a convenient example of how to handle the UTF-8 encoding. The ancient, Python 2.3 born, csv module magically handles all the separator and terminator escaping. The csv.Writer.writerow method had no problems writing out a mix of ASCII and Unicode data. And Postgres happily slurped in every data file generated. I’m well on my way to ingesting multiple millions of tweet instances into a table that has 10+ fields.

The moral of the story? If you want to fast bulkload data into Postgres, find a csv compliant library and have it write your rows for you.

Bonus hint: If you’ve got geospatial data as well, maybe you’re using PostGIS, grab the shapely module and get familiar with the wkt attribute of the shape objects. While the PostGIS documentation says WKT is an acceptable load form, I found that EWKT, essentially adding an SRID, was the only way to get a shape loaded. Assuming you have an established SRID this is a piece of cake.


Premature Guilt

Have to say I’m somewhat looking forward to the upcoming releases of Mission Impossible: Ghost Protocol and Sherlock Holmes: A Game of Shadows. Both are clearly guilty pleasures. For Mission Impossible, while I like the action, Paula Patton is an extremely fetching attraction. As to Sherlock Holmes, while the incessant mumbling of Robert Downey Jr. can be irritating, I like the comic chemistry he has with Jude Law.

Now I can see how well the local cinema holds up during holiday season!


PyCon 2012 Tutorials

PyCon 2012 Logo I have a major 2012 resolution to attend PyCon 2012, on my own dime. I need to get out and about in a developer community, independent of the work context. Plus, since PyCon is in Santa Clara, CA, I’ve got a few peeps I can visit and crash with on the cheap.

The tutorials were announced recently. What a juicy slate! I’m definitely doing the Data Analytics I track. After that Data Analytics II looks tempting, but I’m also interested some of the web/DB development À la carte offerings.

Choices, choices.


Plexus Rangers Chronicles: Week 14

PlexusRangers Logo Small So that thud you heard was the final collapse of my poor fantasy football squad. This past weekend encapsulated my many frustrations over this season. To wit

  • The injury bug strikes yet again, mid-game this time. Poor DeMarco Murray goes down in the first quarter with a broken ankle. Felix Jones soaks up the resulting points in a track meet. Meanwhile, Jason Witten gets shut out or shut down, take your pick.
  • Conversely, I play the Cowboy defense which gets smoked by the Giants. Minus two points on the ledger.
  • The opponent went off to the tune of 139 points. Guys like Shonn Greene and Rob Gronkowski had peak weeks of 25+ points.
  • And the guy I was chasing won anyway. His opponent, down in the lower bracket like me, didn’t quite mail it in, but every player in his lineup underperformed their projection.

Just not meant to be this year.

Can’t really get excited about the fact that our league has a consolation playoff bracket. I know you don’t care about my fantasy team, so there’ll only be one more of these posts. I want to go back and compare the hope of the draft versus the season’s results.


RSS Feed Synching

RSS Feed Icon 64x64 A while ago there was a lot of consternation when Google Reader changed its user interface. Along with that Google axed a number of projects. Seeing as it’s not obvious if or how Google Reader generates revenue, people were duly concerned.

The big issue is that Google Reader seems to have become the de facto infrastructure for synching reading lists across devices. Longtime (but now ex) developer of NetNewsWire, Brent Simmons clearly chronicles the issue with Google Reader and synching. Based upon his experience he drills down into some of the key RSS synching technical challenges.

As a computer scientist, I understand the issues. But it seems to me that this is such a classic distributed systems problem, there has to be a clean solution already. To my eye distributed version control systems, like git, have most of the answer. Many differences between distributed files are easily handled, and conflicts have to be resolved by a human. Now obviously that would be a pain for an RSS reader but maybe a few simple resolution policies, designated by a human, could do the trick.

Just thinking out loud, because I heart RSS and feed reading.


Titan Theme

MPR Titan Header

When I converted this blog to WordPress, I looked at a number of themes, finally settling on Blogum. I was never really happy with it though. The title banner was never quite right. While a nice and clean design, the main body font didn’t suit me.

I ran across Mickey Petersen’s survey of new features in Emacs 24. The theme he was using, Titan from The Theme Foundry, looked good to me. So I decided to give it a whirl here. That’s one of the really nice features of WordPress, the ease with which new themes can be installed and experimented with.

Titan looks good to me, so I’ll be keeping it around. I’ll probably even ante up for pro support.


Twitter Favorites Feed

Twitter Bird Small Twitter is great for following the link streams of knowledgeable folks. Snagging interesting tweets for later perusal is also easy, as you can mark a tweet in your timeline as a favorite.

However, I now try to do all of my information aggregation in NetNewsWire. So going to a Twitter client to see my favorites is a bit of a pain.

Enter Twitter RSS feeds: http://twitter.com/favorites/crossjam.rss

Now I can subscribe to the above link and see my favorites stream along with my inflow. The only downside is that NetNewsWire doesn’t auto link the URLs in the tweets. Google Reader is smart enough to do this, but I’m not using GReader on a daily basis. The quick and dirty solution is to pop to the tweet in a browser tab and then follow the, typically shortened, link from there.


Realize

So in my continued possession by Evol Intent’s Us Against the World mix CD, I got captivated by the following, perceived sample:

Did you realize no one can see inside your view? / Did you realize the one inside belongs to you?

You can always distinguish the ethereal Beth Gibbon’s vocals, especially from a great Portishead track like Strangers. But I wanted to be sure I had the correct lyrics, since it’s a little tricky to make out. All I kept finding though was this:

Did you realize no one can see inside your view? / Did you realize for why this sight belongs to you?

spread across a bunch of sites designed to sell ringtones. I wasn’t hearing any of that for why… stuff though which made me suspicious. Turns out that’s from the Portishead Roseland NYC Live version of Strangers.

However, going back to the original Dummy CD, I heard the following:

Did you realize no one can see inside your view? / Did you realize the world inside belongs to you?

With some confirmation from the web, mystery solved. You’re welcome America!


Plexus Rangers Chronicles: Week 13

PlexusRangers Logo Small Back to back, Jack!! Two wins in a row. My only win streak of the year. A nice solid victory, although I had to sweat a little on Monday due to extended gar-bage time.

I have to give credit to an officemate. Even though we’re competing for the final playoff spot in our league, he tipped me off to playing Percy Harvin. You can roll like that when there’s no money on the line.

Even so, I was this close to benching Harvin on Sunday morning. Missing practice for an “illness” is fantasy-speak for “game time inactive” and zero fantasy points. But I rolled the dice and won big with 33.5 on the ledger.

Add in Aaron Rodgers 37.5, along with another inspired gamble on Roy Helu for 20.2, and that’s 90 points in the till. Everybody else on my team underperformed (I’m looking at you DeMarco Murray) but totaled enough to get me to 118.

Per usual my opponent chalked up over 100. I had a 36 point lead going into the Monday game and was feeling confident but slightly nervous. Maurice Jones-Drew was the last player left in the tilt. He hadn’t scored over 20 points all season. Jacksonville has been awful this year. No way he goes for 30+.

Still, it’s been one of those seasons.

Jones-Drew was over 25 by the end of the third quarter. The Chargers were so far ahead, I had visions of them laying down like dogs for a 60 yard touchdown run or something like that. Thankfully, Blaine Gabbert got a lot of throws, Jones-Drew got some rest, and the clock moved quickly.

The playoffs start for me this week, even if I’m not in the playoffs. I win and my buddy loses, and I’m in. We both win or both lose and I need to outscore him by 60 points. Not gonna happen. He wins, I lose, and it’s over. So losing isn’t much of an option.

Here. We. Go.


plv8

Given I’m aware of Python as an embedded procedural language in PostgreSQL, I should have anticipated that someone would stuff JavaScript into PGSQL. Enter plv8:

plv8 is shared library that provides a PostgreSQL procedual language powered by V8 JavaScript Engine. With this program you can write in JavaScript your function that is callable from SQL.

In the context of PostgreSQL, this means you have a surprisingly useful durable document store you didn’t know you had. The previous link focuses on XML in Postgres, but with plv8 there are plenty of JSON tricks you can do inside a sophisticated relational data management system.

Don’t know how mature plv8 is, but I have a few big piles of Tweet data in JSON format that might be subject to the extension’s charms.

Hat tip to Hacker News


Full Metal Jacket

Full Metal Jacket Peace Pin Just dropped dead in the middle off Stanley Kubrick’s Full Metal Jacket, (unfortunately on IFC). Despite the commercials, forgot how damn good, and twisted, a film it is. Apocalypse Now, Redux best captures what I know (being of the generation after) the fucked-upness of the Vientam war. And it’s just a better movie.

But Full Metal Jacket is a straight up mind fuck. War is hell. Must be that Jungian thing.


wikistream

Wikipedia Logo Link parkin’: wikistream, an experiment in real-time display of Wikipedia edits using node.js and redis. Neat interface within the browser page.

Mainly stashing to note that Wikimedia recent changes are streamed using IRC. I always thought monitoring Wikipedia would be a great sensor for various goings on in the world. Should do a literature search for any uses of the real time stream and then see about the potential for future advances.


PGSQL FDW

PostgreSQL Logo Link parkin’: PostgreSQL Foreign Data Wrappers.

When this link first started kicking around, I thought it was just a gimmicky way to pull data into Postgres (PGSQL), destined to be slow and finicky. Boy was I wrong! Turns out Foreign Data Wrappers (FDW) are an SQL standard that the latest version of Postgres, 9.1, heavily supports. Turns out there are all sorts of interesting uses for FDWs. Turns out that Multicorn makes writing the wrappers in Python relatively straightforward.

At work, I’ve got some hairy data ingest challenges for Postgres. Maybe FDWs can help solve them.

Hat tip, Ben Lorica’s Big Data Twitter stream


MapReduce Workshop

Hadoop Logo A long time ago, I called Google’s MapReduce distributed programming model, a force multiplier. Some, admittedly self-interested, parties are projecting a billion a year Hadoop industry. Some are just projecting that 2012 will be a big year for Hadoop. Given that Hadoop is the open source version of MapReduce, I might actually be on target with that prediction.

But enough self-congratulation. I found myself recently wondering what’s next on the MapReduce frontier. Should have known there’s an academic MapReduce workshop for that. Third edition no less.


Streaking

I’m definitely down with meta is murder, but small doses aren’t fatal.

Stupidly forgot to post yesterday, ending my 60+ day streak. Simply had a lot of stuff going on at work and home and lost track of time. Adam Fast recently posted on why he was blogging every day and I greatly sympathize. Which is why I take keeping posting streaks going seriously.

No big deal though, just get back on the horse and start a new streak!


Plexus Ranger Chronicles: Week 12

PlexusRangers Logo Small Victory! By the thinnest of margins no less, 0.23 fantasy points. I’m still barely alive for a playoff spot. Maybe The Fantasy Gods are starting to smile on me.

I say that because most of my guys underperformed. DeMarco Murray went over by a point or so. Meanwhile, Rob Bironas, my kicker, exceeded expectations by 5 points. It’s a sad day when your kicker is essential to a win.

My opponent’s team was equally bad, except for one player, Jimmy Graham of New Orleans. Going into Monday night, when the Saints played, my lead was a tick over 23 points. Graham’s been having a good year, in a high powered offense, so 23+ was not out of the question. Given the year I’ve been having, I anticipated this happening. By the 4th quarter, Graham had 22.9 points, I assumed a loss, and I went to bed early. Graham almost had one more catch but got busted up on the play.

And I woke up the next morning with the closest fantasy victory I’ve ever had. Keep hope alive!


ESPN’S Downfall?

ESPN Logo Previously, I had pondered what could bring down ESPN’s, the self-proclaimed Worldwide Leader in Sports, virtual programming hegemony. My creativity wasn’t too far off, as Comcast is retooling the Comcast Sports Network plus Versus, into the NBC Sports Network. But it remains to be seen if this can really be a viable alternative.

My thoughts didn’t stray to that most American of disruptors: scandal. For the longest, I’ve wondered how the sports media industry in general, and ESPN in particular, could never “break” the Major League Baseball steroids story. Given the amount of coverage of baseball, and the porous revolving door between “journalistic” organizations and the baseball franchises, some intrepid reporter should have been able to find at least one smoking gun. It’s odd that it took Jose Canseco going rogue in a bitter snit to bring that house of cards crashing down.

Enter the Bernie Fine fiasco at Syracuse and ESPN dubiously spiking its own foray into the story as ably chronicled by Sports By Brooks. Makes me start to ponder what else the news side of ESPN has decided wasn’t newsworthy or verifiable over the years. Considering all the insider connections that a lot of the on-air talent brings to the table, how is it that ESPN can’t confirm anything that goes on in the sports world?

Right now, since the Bernie Fine/ESPN affair is mostly percolating in the blogosphere, it’s really only a “smoldering” gun. But chain a few of these incidents together, continue the theme of particular odious crimes, sprinkle in a few higher profile reporters, and cracks could start to show in the Worldwide Leader’s foundation.

Who knows, maybe this theme will catch the eye of another (jealous?) major news organization that runs with it. However, we know there’s at least one such crew that’s right out.

Hat tip to the The LaVar Arrington and Chad Dukes show (warning overdone Flash site).

Proper curly quotes courtesy of admonishment from Brent Simmons and Tim Bray.


Discogs API Redux

Discogs Logo Way back in January of 2009, I noted that Discogs.com had a REST API. It’s been awhile (at least since I last looked) and Discogs has updated their API for the modern era. Bonus! They now have monthly data dumps!!

Hat tip Paul Lamere


Sans Laptop

WordPress Logo Since noonish last Tuesday until 5PM today, I’ve been on the road for the Thanksgiving holiday. The wife’s side of the family is all from Chicago, and I lived and worked there for close to 9 years. Unfortunately, my mother-in-law is a bit technophobic so doesn’t have Internet at her house. Heck, she just upgraded to cable this summer and I was lucky enough to finally have a full slate of turkey day sports for once.

This of course makes regular blogging a challenge. More after the break. Really!So I decided to give the WordPress for iOS app, a serious test drive on my iPhone. I cheated a little, but I’m giving it a thumbs up. With relatively minimal extra effort, I managed to successfully post the last 5 days, without using my laptop. In fact, I only once had to drag myself to a Starbucks and crack the laptop simply to check the time and numbers for a potential Monday telecom. Come to think of it, I probably could have gotten away with a text to deal with that situation.

How’d I cheat? I built up a backlog of mostly cooked posts, that needed minimal editing. These were then posted to my WordPress site with draft status. Then the WordPress iOS app was used for some light editing and clean up, before adjusting the publish date and switching the status to published.

I did however, do one full post completely in the iOS app. This wasn’t too bad, although the on-screen keyboard is obviously quite a bit slower than a real keyboard. So longer posts seem somewhat prohibitive. My main observation is that collecting and adding links definitely has high friction. On the desktop, you can multitask and fast switch between the browser, to look up stuff, and your favorite blog post editor, MarsEdit for me. Doesn’t work quite so well on the iPhone, although maybe that’s something I need to work on. I’ll also start thinking about the types of posts that make sense for a combo of an iPhone and WordPress. For example, impromptu photo posting feels like it would be quite natural, as opposed to my longer form text entries.


Infochimps Geocoding

Link Parkin’: infochimps now provides a geocoding API to translate textual geographical references into lat/long coordinates. Also includes a confidence score.


Plexus Rangers Chronicles: Week 11

PlexusRangers Logo Small Sigh. Another disappointing loss that pretty much puts me out of the fantasy playoffs in my league.

The opponent yet again scored over 100 fantasy points against me. That makes 10 out of 11 weeks. I only really had one disappointing performer, Denarius Moore for 1.9 points. That was enough damage though, especially when facing two big scorers like Victor Cruz and Ray Rice.

The injury bug strikes yet again. Fred Jackson goes down for the season with a broken leg. Criminy! I didn’t even play the guy this past week. The Fantasy Gods are really out to get me.

Now I have to win out my last three games, and get a big dose of help against the fourth place team in my league. The Rangers will compete until the bitter end though!


Simple Tools

Curl logo Even though I’ve been using UNIX for over 20 years, there are some simple, elegant, tools that I’m really now coming to appreciate:

  • cron and crontab for automatically running things at scheduled times, especially the GNU extension that supports @reboot allowing normal users to run scripts at machine startup
  • logrotate lets me keep dumping data into a single file, but break it into smaller, more manageable chunks. Combined with crontab I can easily collect gigabytes of data in a straightforward manner, but have the results in well organized, compressed multi-megabyte units. That expedition with Python and argparse? That was driven by usage of logrotate.
  • curl for grabbing anything off the Web. Okay, it’s simple and elegant like a Swiss Army Chainsaw, but it always works, never crashes, and can be configured six ways to Sunday.

Giving Thanks

When people ask, “How ya doing?” my stock response now is, “Oh I can’t complain.” And if they tell me, “Yeah, you can,” I say “No I can’t. No one would care and it would make me look ungrateful for all that I’ve been given.”

Which usually gets a thoughtful pause.

So in the spirit of the day here’s why no-one should catch me complaining.

  1. Family. My Little Guy (™) and the wonderful wife I’ve been granted with. Not to mention relatively healthy parents, lovable in-laws, a spry 85 year old grandmother, and an overachieving kid sister.

  2. Friends. I don’t have a big gaggle of ‘em, and I don’t keep in touch as much as I should, but boy are they an interesting and successful lot. From going up in the Space Shuttle to doing startups to just grinding away for one company for 20+ years. I’m glad for each and every one of them.

  3. Work. I’ve got a job. It doesn’t completely suck. The tasking is often quite interesting and there’s a decent bit of creative latitude. It pays well. The people are mostly smart. My boss likes me. His boss likes me. Other high muckety mucks seem to like what I’ve done.

  4. Health. Okay, so I can’t really play Ultimate anymore, but with any luck I’ll be able to at least fake my way through a pickup game this upcoming summer. Maybe even play summer league. And thanks to my job, I can afford a Cadillac health plan, which I have definitely been using. Every time I go to the doctor, they tell me nothing’s wrong and the reimbursement coordinator gawks at how little I have to pay.

  5. Finances. No personal debt. No mortgage. No auto loan. A sizable emergency fund. A decent, if not great, retirement account.

Now if I could only get back on a roll with a hobby hacking project and read more books, life would be pretty close to complete.


Python, argparse, append

Python logo This is a little Python conundrum that I had to solve at work. Hopefully it’ll save someone else some time.

Python’s argparse is the fabulous, back ported, standard, built-in Python 2.7 module for parsing command line arguments. Very helpful for building scripts that are a little too complex for bash. One thing you can do with argparse is specify that an argument is supposed to be an output (or input) file like so:

[sourcecode language=”python”] parser.add_argument(‘—log’, type=argparse.FileType(‘w’), default=’-‘) [/sourcecode]

argparse has built-in knowledge of the UNIX convention that - represents standard input or output as appropriate. The above basically defaults to assigning stdout as the logging target unless a filename is supplied on the command line. Unfortunately, this always overwrites the target file, which is not quite what you want for log files. You really want to just append any new output, not wipe out the old stuff.

But! The following, natural correction, doesn’t quite work, with argparse throwing an error:

[sourcecode language=”python”] parser.add_argument(‘—log’, type=argparse.FileType(‘a’), default=’-‘) [/sourcecode]

Turns out the argparse.FileType is hardwired to throw an exception for appending to the - pseudo-file.

However, there is a solution. You can supply a Python file object for the default, like so:

[sourcecode language=”python”] parser.add_argument(‘—log’, type=argparse.FileType(‘a’), default=sys.stdout) [/sourcecode]

Works great. Defaults correctly, but appends to existing files if specified. Happy hacking!

Also, my first trial with WordPress’ programming language shortcodes. So far so good.


2000 Calories

Food Politics Logo About mid-October, I started to seriously focus on losing a little weight. Through a combination of portion control, quality control, and some cardio work I’ve managed to shave off a few. I also think I’ve got a sustainable plan to keep it off and keep going in the right direction.

Per usual, in the course of doing something like this, you start to pay attention to food labels. They’re all baselined to a 2000 calorie diet. This got me wondering. Why 2000 calories? Based on what reasoning?

Turning to Google, I landed on Marion Nestle’s blog Food Politics. She’s got a pretty substantive post on where the 2000 calorie diet came from. Interestingly, 2000 calories is 20% below the low end of the scientifically determined average caloric requirement for males. Which means if you’re a guy, calorie counting with food labels, probably leaves you with quite a bit of wiggle room. I’m not particularly fastidious about counts, but I’m trying to stay away from the some of the sneakier high calorie items that are easy to get hooked on. I’m looking at you Starbucks Banana Nut Loaf. An extra yogurt or two, won’t bust the budget though.

Nestle closes with the following advice about caloric intake:

As to how many calories you personally need, I think they are too difficult for most people to count accurately to bother. The bottom line: If you are eating too many, you will be gaining weight.

The best advice I can give is to get a scale and use it. If your weight starts creeping up, you have to eat less.

I’ve already taken her advice and it’s working to good effect.

Oh yeah, Nestle’s got a good bit of credibility on the subject. Go Bears!!


brutuscat’s googlereader

A few years ago, I had an automated script that would backup my starred items in Google Reader. It got busted when Google Reader made some changes to its unofficial API.

Luckily a few other folks have updated the old pyrfeed module, and put the results up on GitHub. Mauro (brutuscat) Asprea’s googlereader fork seems to be the most recent.

Gave it a quick test drive against my starred items feed and seemed to do what it says on the tin. Interestingly, you can get the results out in JSON, which means another potential application of MongoDB.


offlineimap

For the longest time, I’ve been keeping an eye out for a good GMail backup solution. I’ve stashed a lot of links, but never really cottoned to any of the potential applications. However, thanks to Mike Johnson, I might finally have something that fits my tastes.

Johnson describes how to use offlineimap to download your GMail contents using of course the IMAP protocol. offlineimap is written in Python, so it should work on both Linux and MacOS.

Offlineimap is meant to take an IMAP folder offline for later reading by copying the contents of the IMAP server to a MailDir folder, which is an older Unix standard that organizes emails into local mail folders. Once copied locally, the mail folder can be read by any number of email programs. At it turns out, this is also awesome for making backups.

There are a couple of great things that fall out if this actually works

  • The backup procedure can be hosted on my own home Linux box or better yet my Linode VPS. No lockin to a particular vendor.
  • cron can be used to run the backup process automatically. I won’t forget to do it.
  • offlineimap allows you to select specific folders. So I finally might have a convenient way to download my @Notes folder locally to my MacBook for indexing by Spotlight. Alternatively, I can use my own full text search engine.

Django Chartit

Link parkin’: Django Chartit, for leveraging Django to create nice front ends to lots of data.

With Django-Chartit you can create interactive charts effortlessly. Charts are rendered using Highcharts JS library and jQuery.


Rediscovered Treasure

Scott Hardkiss Cover One of the tracks on DJ Heather’s Tangerine that really stands out is DJD’s Shake It For Me. Probably the top track of the mix, highly memorable.

I’d like to think it was some serendipitous hand of a deity that made me dial up Scott Hardkiss’ United DJ’s of America, v17 entry this week, but it was probably just randomness. I hadn’t listened to this mix in over a year according to iTunes. The only reason I carry it on my iPhone is that I’m a completist for the United DJ’s series. Imagine my surprise when Shake It For Me hits the headphones.

But I was even more surprised at how solid end-to-end the entire mix is. Discogs.com classifies the CD style as: “progressive house, house, disco,” and it’s damn hard to pigeonhole. Shake It For Me isn’t even the best track, transcended for me by Static Revenger’s Happy People, the whacky Disco Rockin’ by Plastic vs Conga Squad, C-Mos’s 6-2 Young, Boozy + Swan’s Don’t Touch That, and Armand Van Helden’s Full Moon featuring a guest appearance by Common.

Shake It For Me definitely kicks off a great run off tracks, and I’m glad that I rediscovered this treasure. Definitely in the rotation for the near future.

© 2008-2024 C. Ross Jam. Built using Pelican. Theme based upon Giulio Fidente’s original svbhack, and slightly modified by crossjam.