Archive for tech

State of the interwebs

There are approximately three sides in the war for the interwebs - which are you on?

  1. Non-participant - “what’s a twitter?” Also found: absorbing rays of sunshine.
  2. Solipsist - “blah blah blah here are way more details of my life than anyone could possibly care about but I’ll keep on going any way because then maybe SOMEONE WILL NOTICE ME AND GIVE A SHIT!!!” Also found: waiting in line for tix to the Alkaline Trio show and thinking of witty adjectives to call him/herself.
  3. Circular referentialist / credit obsessivist - “Check out this sweet link to someone who talks about something in a link from this guy that I found via @ronald http://is.gd/f00” Also found: within the top 5 commenters on random blogs demanding credit for having tweeted the topic 5 seconds before it showed up elsewhere.

I’m straddling the fence of solipsist and non-participant.

Comments (5)

Hot sheep

@scottsorheim shows some amazing sheep antics:

Comments (1)

New jams

My job has nothing to do with this statement:

The Amazon mp3 store rules

The service works really well, the price is almost always right, and the recommendations are really good (way to go, John!). Here’s what I’ve learned about it:

  • Go to the homepage
  • Scroll down to the section for “Today’s Top MP3 Albums, Most $8.99 and Under”
  • Check these out

There seem to be many great deals that rotate in the site over time. I don’t know anything about what’s discounted at any given time, but discounts are a great influencer of popularity, so it seems great albums (or at least great deals) wind up making that list. Here’s what I’ve downloaded today:

I probably wouldn’t have bought all those unless it was super easy, the price was right, and I knew I’d be getting good quality tracks - all of which the Amazon mp3 store does. And obviously I demand that it’s DRM-free, which everything in the Amazon store is. Yay, my company!

Comments (3)

Generation I

Has this been coined yet? It should - I’m probably just behind the times. But with the advent of blogging (um, no irony intended there!), twitter, and facebook we’re increasingly self-obsessed. Those platforms don’t have to be used that way, but I think this is what the “25 things about me” meme or innumerable other ways that people are finally getting soapboxes where they can broadcast the most mundane aspects of their daily life are about.

Here’s the article that inspired this, which is basically a couple hooks you can use to push the music you’re listening to on digital sites into twitter and the like. The question it obviously raises is WHO THE HELL COULD POSSIBLY CARE what song you’re playing every time you listen to music? Are our own lives really that empty that we’re desperate to spy on the routine aspects of the lives of complete strangers? Or even our friends?

Life’s too short to waste on completely uninteresting, uncreative vicarious living - be selective with what you talk about and what you spend your time taking in.

OK, I have to go chase the kids off my lawn now and go eat my prunes.

Comments (2)

DB + emacs = <3

More on “never leave emacs for anything” - emacs is awesome for interacting with databases and I’ve been doing it for years. Here’s how you do it:

  1. have emacs - swear by it for it will never do you wrong
  2. have sql mode - this comes standard in most emacsen these days but it comes from the SqlMode page on the emacswiki
  3. run the appropriate sql mode entry hook for the database backend you’re talking to. I often connect to mySQL databases, so for me, that’s sql-mysql
  4. Give it the credentials to connect to your database (username, password, host, database)
  5. At this point, if it was unable to find the appropriate underlying tools to talk with the database (the mysql executable for mysql, isql.exe/osql.exe/etc. for SQL Server, etc.), it will die - otherwise you’ll have a buffer named *SQL* with the interactive prompt for talking with the database
  6. This is where things start getting useful. Split your emacs to two windows (C-x 2 or C-x 3) and C-x o to switch to that new window. In there, switch to a buffer named test.sql (or whatever you like - C-x b test.sql[enter])
  7. Switch to SQL mode M-x sql-mode
    • This does the normal syntax highlighting for the SQL language and so forth like all emacs modes
    • It also looks for your *SQL* buffer and sets up a hook so that commands issued from test.sql are hooked back to your *SQL* buffer, as you’ll see in a second
  8. Back in test.sql, type some SQL statement, like select * from schema_info; and press C-c C-c (sql-send-paragraph). This will send your SQL statement back over to the associated *SQL* buffer and pump it through the sql interpreter and leave the results in there

Which is all totally rad. Some of the benefits are that

  • you’re in emacs, so all the niceties of syntax highlighting, copy/paste/search are at your disposal (the MySQL query browser doesn’t let you easily select/search/copy output - neither does SQL Server’s Query Analyzer)
  • the output from your commands just keep scrolling through in the *SQL* buffer (so you can see a running history of your commands and their output, save it to disk if you want, etc.)
  • if you save test.sql, you’ve now got a log of your interactions with the SQL backend that are easy to retrieve
  • if you need to interact with another SQL backend in the future, you don’t need to learn a bunch of new client tools. Of course you’ll have the vendor-specific idiosyncrasies and performance issues of doing effective database work - but some things never change :)
  • and you don’t need all the vendor specific client tools - just the minimal command line interface to talk with the database

The drawback is that you don’t have the rich client interface that you’re probably expecting or wanting that lets you browse the database interface, table layouts, etc. You can always fall back on the regular client tools for that. Note that there *is* a construct in sql-mode for what it calls a “data-dictionary”. I’ve looked at the lisp for this and never gotten it to work, but essentially what it does is try to call the SQL functions or inspect the SQL tables which retrieve schema information from the DB and record that in some elisp structures. Then this (in theory) cooperates with the pcomplete mode so that you’d get tab completion and could type (in your test.sql buffer which is talking to the *sql* buffer) “select * from authors.dTAB” and it would cycle through column names in a theoretical authors table for .date_of_birth, .distributor_id, etc.

Final comment: this also works really well with one of my other favorite emacs features: registers. You can have multiple of these sql sessions rolling. Once test.sql is associated with its *SQL* buffer, you can rename the *SQL* buffer (e.g. to *SQL-databasename*) and fire up sql-ms to connect to a Microsoft SQL Server. This will create a new *SQL* buffer and then you can create a separate composition buffer to talk with it named, say, test-ms.sql. But now you have a bunch of associated window configurations and buffers for talking with different databases, so if you use emacs’ window-configuration-to-register and jump-to-register, you can store and restore those layouts to get back to the session you were working with (or jump between SQL modes, development, dired, your shell, gnus/email, and everything else you’re doing).

Comments (2)

The audacity…

From the Linux Keyboard and console HOWTO:

People often complain `my backspace key does not work’, as if this key had a built-in function `delete previous character’.

Can you imagine? What idiot n00b would make such a ridiculous assumption! These are probably the same people who assume that the button labeled “start” will make their microwave leap into action in some prescribed fashion when all it does is send a waveform through some copper wires and maybe a PCB. Obviously you’ve got to wade through a bunch of arcane config files to make that happen. I mean, duh!

Comments

Android good, android bad

So I got a G1 almost a month ago and I’m basically very happy with it, but I have a couple key gripes:

  • The Market - the market is this awesome integrated software distribution system. I’m pretty sure this is like the iPhone store or something, but Windows Mobile didn’t have anything like this and BlackBerry didn’t really, either. Actually, there was basically no interesting software for blackberry, which was one of its biggest drawbacks. Anyway - the market is great. Except the rating system. Geez louise is this a disaster. Users have the ability to rate applications 1-5 stars and add comments. Every single application that shows up now has, as its first ~10 ratings, various lam3rs claiming “first” and putting in some default 1-5 star rating. This completely throws off the weighting of the reviews of any software in the market and makes the review functionality in the market basically useless. IMO, Google should immediately block any client who ever posts a review “first” in the first 10 messages from ever contributing feedback to the store again. That may seem heavy handed but they’re ruining the market.
  • A2DP - this is just a gripe. The G1 doesn’t have a standard headphone jack and T-Mobile is allegedly now shipping the phone with a 3.5mm adapter so you can use regular headphones. I figured I wouldn’t care about this because I’d just use my bluetooth headphones and hook them up via A2DP but I was wrong because the G1 bluetooth stack doesn’t support A2DP right now. Huh? Please fix this, Google. I’m assuming this is fixable. I’m going to be very, very sad if I find that the hardware can’t support A2DP.
  • GPS - this works splendidly but the google maps application really should be better. It doesn’t track you (which is just stupid) so if you’re using it to navigate, you need to scroll the screen as you go, and it doesn’t work along the route to give you turn-by-turn directions. I’m guessing something in the market will do this but there are a gajillion alpha-quality mapping applications that do the same thing and I haven’t bothered trying to sift through them to find something really useful (that content issue is another problem with the market…)

Otherwise it’s pretty much roses!

Comments

What makes Firefox suck?

I reliably have the following experience. I’ve experienced this on multiple Windows machines and in Linux and with 2.* and 3.*

  • Adopt Firefox rather than previous/default browser
  • be happy
  • Between 1 and several months pass
  • Things deteriorate to the point where it sucks. Opening or closing tabs takes forever. Browsing between pages (forward/back - same tab) with large amounts of content (which previously would render with pipelined speedy hotness) is painful. Actually *starting* the browser also takes forever (in the past I used to say how I’d originally switched to Firefox because I could literally start it, browse to page X, and have page X render all in the time it would take IE to render page X).

So what’s the deal? I’m guessing I’ve hit some data limit and now my form MRU, or history, or some random cache is now rearing a very ugly unoptimized critical path head. Or something? This is so not the future.

Comments (4)

SQL time aggregate functions

Here’s some thinking out loud.

How do I construct a SQL aggregate function over time to measure wall clock hours? Say I work in corporate security and I have information about employees entering and leaving a building so I know how long Jim and Pam were in the building individually and I want to know how many minutes *anybody* was in the building? A security log might look like this:

Person Enter Exit aggregate minutes
Jim 7:00AM 11:30AM 270
Pam 8:00AM 9:00AM 60
Pam 10:00AM 11:45AM 105

From such a log, I’ve got a total of 285 minutes when someone was in the building. In a standard language like C or perl this might not be too hard to solve by iterating over the records and a bit array for minutes of the day which could be set “on” when people are present, or by iterating through records (sort by start time and duration and compute overlaps and do some counting) but right now I’m not sure how to do it in SQL.

More thinking out loud to come as I make progress or get increasingly frustrated with this…

Update: I think I figured out the right way to approach this. As far as I know, no DB server implementation offers such a time aggregate facility so that’s probably not the right tool to throw at this job. This is data I have (and need this computation performed on) is in a database built on a Ruby on Rails web application and the simpler way to handle this will probably to recalculate that aggregate value as records are entered or modified from the web UI and then retrieve that value directly from the database rather than trying to compute it from the constituent records. Design-wise I’m not sure which approach I prefer. This is a pivot on DB data and feels best performed in some post-processing context (with the flexibility to pivot in different ways and see “minutes in the office [by day|by people in a department|by hour|etc]”) but I also know there is only one axis this will ever be pivoted on, so there’s a fine case for removing that business logic from the database. And since I don’t know how to do it in SQL, that’s the way I’ll probably go :)

Comments (5)

Chrome wins…

…the browser wars. In Chrome, navigate to about:internets. Enjoy.

Update: according to Nick, this is way yesterday. Sorry. Also: doesn’t work in Vista.

Comments

« Previous entries