Blogs

Old Man

“No, no, no ... come on old man, just let me back up before you start walking behind me”, I mutter to myself, looking back behind the right side of my rental car. I had a twelve hour drive to get here, and now I need to move my car out of this parking space like the pretty girl at the front desk asked.

Cruiser

The two young men had been drinking in the open field in rural Kentucky most of the night. “Billy Ray”, Jimmy said, “ya know what I’m gonna do? I’m gonna shoot the next damn thing that moves.”

“Includin’ me, Jeemy?”, Billy asked.

“No, a course not you Billy. But anythin’ else, I’m gonna shoot it.” Truth be told, Jimmy knew it was late, and they’d likely just finish their beers and drunk-drive themselves home.

A Christmas Story

From time to time I write little stories that have nothing to do with programming or technology; this is one of those stories. So, if you’re only here for the tech, you’ll want to skip this one.

I’m standing in the kitchen of a friend’s house at a Christmas party, making myself a drink while talking to a friend named Angie. This was nothing unusual; she and I were always talking about something. We met during our last year in high school, and we’ve been talking every since.

A Salsa dancing lesson

From time to time I write little stories that have nothing to do with programming or technology. This is one of those stories, so if you’re only here for the tech, you’ll want to skip this one.

As I stretched in Utthita Parsva Konasana, I took a break from my concentration and indulged in a moment of both reflection and forethought. For five days we drank tequila and sangria, swam in the warm ocean water, and even hiked in a Mexican jungle, but tonight it would be different: we would learn how to dance Salsa.

Converting PDF content to plain text with Scala (or Java)

I recently wrote a little application to convert pages from a PDF to plain text. The GUI portion of the application looks like this:

As you can see, the application just needs the name of a PDF file to convert, along with the page you want to start at and the page you want to end at. There are several ways I could make the application more convenient to use, but since I don't plan to use it that often, I can deal with its limitations.

How to get the IP address of a Linux system from the command line

One way to to get the IP address of a Linux system from the Linux command line is this:

$ hostname -I

That’s the hostname command, followed by a capital letter i as a command line parameter. On my Raspberry Pi system, this command returns its IP address -- and only its IP address -- like this:

10.0.1.9

It’s nice that this command returns only the IP address, because that means I don’t have to pipe together several commands to get what I need.

How to get the default system font in a Java/Swing application

I haven’t tested this with other Java components, but if you want/need to get the “system font”, this code gets the default system font from a JEditorPane component:

val outputArea = new JEditorPane
val fontFamily = outputArea.getFont.getFamily

That code is written in Scala, but as you can see, it converts easily to Java. On Mac OS X 10.10, fontFamily ends up being “Lucida Grande”.

Syndicate content