Archive for the 'Technology' Category

The status message project

Monday, March 3rd, 2008

I’ve decided that Facebook makes a great stage for little acts of performance art (I’m sure twitter does, too). I’ve starting writing funny but nonsensical status messages. Here are the first three:

Ari is screening lesbian porn with which to indoctrinate Nicole while doing lines of blow off a stripper named ‘Chastity’ and sending good American jobs overseas.
February 28, 2008, 4:50pm

Ari is reverse engineering Pakistani launch codes while watching Macy’s fitting room footage.
February 29, 2008, 2:51 PM

Ari is getting jiggy with your mom while conspiring to bribe a member of congress.
March 2, 2008, 11:21am

UPDATE: nevermind, I’ll just use Twitter.

The Zen of Python

Friday, February 8th, 2008

I found this little note at the end of the python tutorial today:

Zen of Python
Listing of Python design principles and philosophies that are helpful in understanding and using the language. The listing can be found by typing “import this” at the interactive prompt.

Naturally, I was curious. This is what it said:

Python 2.5.1 (r251:54863, Oct 30 2007, 13:45:26)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one– and preferably only one –obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea — let’s do more of those!

AppleScript Snippet: Set spaces shortcut key to ctrl-option

Wednesday, January 30th, 2008

So yes it happened. I switched over to using Apple hardware and OS X on my primary laptop. I’ve been very happy with my iPhone. When my girlfriend decided to buy a new TV, I thought it would be nice to have a media computer of some sort to drive the 1080p display. My good friend Brian was selling a 1st-generation Intel Mac Mini (A Core Solo), so I thought, “What the hell, why not?”

Turns out Leopard is pretty cool. OS X has come a long way since I poked at versions 10.1 and 10.2 while trying to maintain the machines in the SourceForge.net compile farm. After poking around under the hood and getting acquainted with launchd while trying to get openvpn to start on startup, I realized that it really is serious Unix, that Apple has done some really neat stuff, and that it really does have a prettier face than I’ve ever seen on a Unix box.

At that point, I started seriously thinking about buying a Mac. I knew that MacWorld was coming and rumors were flying about a new ultra-light laptop, so I took a wait-and-see-attitude. After seeing that I would only want the Air in a $3000 configuration, I went and bought the MacBook that I’ve wanted since it was released: the black one.

In short: I love it and I’ve been using it enough to start to get annoyed by it. For example, by default, the Spaces preferences allow you to choose a single modifier key for moving around spaces. On Linux, I use Ctrl-Alt-Arrow to move desktops, since nothing else really uses that; it allows application bindings to shine through and continue to work.

So I started fighting with AppleScript to see if I could get it to do what I wanted. It took some frustration (most new languages do), and I will pronounce AppleScript supremely weird if not totally readable. In the end, this was what I wanted:


tell application "System Events"
	tell expose preferences
		tell spaces preferences
			tell arrow key modifiers
				set properties to {key modifiers:{control, option}}
				get properties
			end tell
		end tell
	end tell
end tell

I hope this is useful to someone. Enjoy.

Poor UI

Tuesday, September 11th, 2007

I wonder if they could have made that more confusing.

Software Release: battery_status.py

Tuesday, August 21st, 2007

Annoyed that Fedora 7 doesn’t have the same CLI tools to get battery status, I coded up a little python script last night to do just that. It was a pretty straight-forward project that took me about an hour, but I was pretty happy with the end result. It reads the proper files out of the /proc/acpi/battery hierarchy, does some calculations on that data and the gives you what you really want.

You start with this:

thesis|18:46|~% cat /proc/acpi/battery/BAT0/info
present:                 yes
design capacity:         65520 mWh
last full capacity:      69150 mWh
battery technology:      rechargeable
design voltage:          14400 mV
design capacity warning: 3457 mWh
design capacity low:     200 mWh
capacity granularity 1:  1 mWh
capacity granularity 2:  1 mWh
model number:            42T5229
serial number:           35751
battery type:            LION
OEM info:                SANYO
thesis|18:46|~% cat /proc/acpi/battery/BAT0/state
present:                 yes
capacity state:          ok
charging state:          charging
present rate:            8595 mW
remaining capacity:      66620 mWh
present voltage:         16690 mV

And you get this:

Battery 0: 96.46% (0:17 until charged)

In the spirit of sharing and trying new things, I thought I would register it as Google Code project and give it away under a BSD License. It was about a ten minutes process, start to finish and now the world can have it:

http://code.google.com/p/batterystatus/

Hurray for non-scarce economics!

The Palantir TechBlog

Wednesday, June 6th, 2007
Palantir Logo

So blogging has now been part of my day job for about six months. It’s not very high volume, but it’s very technical: Palantir TechBlog
, where my coworkers and I write technical articles about the work we do. I’m quite proud of my most recent piece, “XML Pull Parsing and Enums: like chocolate and peanut butter“, a tutorial on XML processing.

Occasionally, I get to write some pieces that are a little less technical and more about the vision of Palantir as a company. My favorite to date is: “Palantir: embodying a 50-year old vision of the future?“.

Digital Ethnography

Saturday, February 24th, 2007

A neat short on digital enthography and how Web 2.0 is changing our relation to information. This comes from an one Michael Wesch, at the Kansas State University’s Digital Ethnography Program. Their blog has some interesting video response to the above video.

The Transparent Generation

Friday, February 23rd, 2007

There’s a really great article up at New York Magazine, entitled “Say Everything,” about the way that the newest generations are growing up with a new set of conventions about privacy, transparency, and the role of public media in modern life.

Kitty

One night at Two Boots pizza, I meet some tourists visiting from Kansas City: Kent Gasaway, his daughter Hannah, and two of her friends. The girls are 15. They have identical shiny hair and Ugg boots, and they answer my questions in a tangle of upspeak. Everyone has a Facebook, they tell me. Everyone used to have a Xanga (“So seventh grade!”). They got computers in third grade. Yes, they post party pictures. Yes, they use “away messages.” When I ask them why they’d like to appear on a reality show, they explain, “It’s the fame and the—well, not the fame, just the whole, ‘Oh, my God, weren’t you on TV?’?”

After a few minutes of this, I turn to Gasaway and ask if he has a Web page. He seems baffled by the question. “I don’t know why I would,” he says, speaking slowly. “I like my privacy.” He’s never seen Hannah’s Facebook profile. “I haven’t gone on it. I don’t know how to get into it!” I ask him if he takes pictures when he attends parties, and he looks at me like I have three heads. “There are a lot of weirdos out there,” he emphasizes. “There are a lot of strangers out there.”

Jacob

Shirky describes this generational shift in terms of pidgin versus Creole. “Do you know that distinction? Pidgin is what gets spoken when people patch things together from different languages, so it serves well enough to communicate. But Creole is what the children speak, the children of pidgin speakers. They impose rules and structure, which makes the Creole language completely coherent and expressive, on par with any language. What we are witnessing is the Creolization of media.”

That’s a cool metaphor, I respond. “I actually don’t think it’s a metaphor,” he says. “I think there may actually be real neurological changes involved.”

Xiyin

Right now the big question for anyone of my generation seems to be, endlessly, “Why would anyone do that?” This is not a meaningful question for a 16-year-old. The benefits are obvious: The public life is fun. It’s creative. It’s where their friends are. It’s theater, but it’s also community: In this linked, logged world, you have a place to think out loud and be listened to, to meet strangers and go deeper with friends. And, yes, there are all sorts of crappy side effects: the passive-aggressive drama (“you know who you are!”), the shaming outbursts, the chill a person can feel in cyberspace on a particularly bad day. There are lousy side effects of most social changes (see feminism, democracy, the creation of the interstate highway system). But the real question is, as with any revolution, which side are you on?

Bluetooth Retro Handset

Friday, October 27th, 2006

USB Bluetooth Handset

Ok, it’s an old-school phone headset (you know, the comfortable ones?), but it’s wireless and Bluetooth. Strangely reminds me of Serato Scratch, DJing software that uses vinyl records on turntables as their input mechanisms. I use Serato and it’s pretty wonderful.

Java debugger back to full speed in Linux

Thursday, September 14th, 2006

When I started this job at unamed company, it was my return the Java development world after a hiatus of about seven years.

In my day, we used xemacs, xterms, and Netscape Communicator and we liked it!But seriously, when I last seriously wrote Java, there were some not-so-useful proto-IDEs out there. My short return in 2002 didn’t show that the world was much better.

But in 2006, Eclipse is king. And since I spent most of time in Eclipse, cranking out the objects, I didn’t mind too terribly to be working on Windows. But those who know me know that I prefer to use Linux and my 10-year old FVWM config (ported a few years back to fvwm2) to get “real work” done.

So after 6 months on Windows, I switched to Linux (Fedora Core 5, for the curious… I’m a total Red Hat whore). Eclipse is pretty much the same. The only problem was that the debugger seemed to run painfully slow. I’ve lived with this for like 3 months. And finally, FINALLY, I have a remedy:

Small JDWP packets with the socket transport causes slow debugging on linux 2.6.15 kernel and newer

I installed jdk-1.5.0_08 and suddenly the sun is shining, the birds are singing, and the debugger is responsive again!

What was the problem? Evidently, the debugger was behaving badly, but this was masked by some behavior in the Linux kernel that was fixed in version 2.6.15:

Java remote debugging is slow due to apparent networking bug

Hallelujah!