Saturday, February 27, 2010

Ubuntu Camera Drivers, revisited

I am trying to get rid of some old speakers, so I used my digital camera to take a picture of them, to increase the chances that someone on craigslist will come to my apartment and give me $5.

Then came the daunting task of copying the pictures off of my camera and onto my linux computer. Linux used to be awesome. In fact, all you had to do was plug it in and type something like this:

cp /media/disk-2/DCIM/whatever/*JPG ./`date +%Y-%m-%d`

Thats called a one liner. I am including it here, as a monument, to the good old days (about 5 years ago). I'm sure that I could make my Linux distribution do that--all I would have to do is spend 10 hours learning how linux camera drivers work and patching my kernel and probably tweaking about 10 poorly explained settings which might also totally screw up my system. 10 hours is equivalent to about 500 instances of me downloading photos.

Downloading pictures on mondern-ish ubuntu
I had to search my own blog to figure out how to do this, only to realize that last time I didn't write down the instructions, I just complained about it. These instructions are for anyone else that was dumb enough to upgrade ubuntu to the latest version. Whatever that is. My "uname -a" says Linux sonic 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 19:49:51 UTC 2009 i686 GNU/Linux

Step 1: plug in camera and turn on. Then forget everything you know about linux, good software design and HCI. This is going to be worse than using Windows.
Step 2: Two instances of some crap camera downloading software called F-Spot will run because ubuntu thinks you plugged in 2 cameras. open one. The best camera downloading software ever is not an option anymore.
Step 3: dont ignore the dialog box that pops up--select the second USB address (I love how they write all this bullshit software to make things easier, and the proverbial dumb user ends up staring at USB addresses anyway. retards)
Step 4: You have to select a location to copy the photos to, but the normal Gnome file selection dialog makes this extremely difficult. Open a terminal and use mkdir to create the folder for your pictures. Then select "other location" and the dialog morphs into a second, slightly more usable dialog, so then select the folder you just made.

The entire retarded process looks something like this:

It took me about 10 minutes to figure out (had to plug in my camera twice), and then I wasted like 10 more writing this.

Ah, F-Spot photo crapware just downloaded all of the images on my camera except for the one I just took. Which was the reason for this miserable exercise in the first place.



[Edit] -- Ubuntu, Supplemental

I got the picture off my camera finally. I don't want to talk about it.

Today I decided I needed to extract an audio track from a movie file. Why? I have a music video and I want to play just the audio file on my ps3. You know, if I had friends and a party or something. The If You Build It They Will Drink approach.

There is some program called ffmpeg. If you run it with -i and only specify the input file, it will print info about the file:

dave@sonic:/media/disk-1/Nightwish$ ffmpeg -i GhostLoveScoreLOTR.mp4

Seems stream 1 codec frame rate differs from container frame rate: 50.00 (24998/500) -> 25.00 (25/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GhostLoveScoreLOTR.mp4':
Duration: 00:09:57.75, start: 0.000000, bitrate: 356 kb/s
Stream #0.0(und): Audio: aac, 44100 Hz, stereo, s16
Stream #0.1(und): Video: h264, yuv420p, 320x256, 25 tbr, 25 tbn, 50 tbc
At least one output file must be specified


If you add an output file, like GhostLoveScore.aac, it will rip out the audio. How nice!

Except it doesnt support aac. Hm, what is that, some mac format? Is that more of the dreaded nonfree that keeps GNU nerds up at night? Oh look, I have an aac library already installed on my system. And I have some other library that I need for ffmpeg to use aac. Why doesn't it work? Oh, because on Ubuntu, ffmpeg is compiled to not use aac, whether you have the library or not.

You know what I've been doing on my Ubuntu computer lately? Browsing the web, watching movies, listening to music, and playing my crappy campaign for The Battle for Wesnoth over and over again. I can do all of that on a windows computer.

Anyway, for now I'm going to have to setup another computer just to extract that audio file. I think installing a different distribution of linux will take less time than figuring out how to recompile ffmpeg to stop being a little bastard.

Thursday, February 25, 2010

Aaaaaahhhhh <- happy sigh

For years, now, firefox has done something strange when I tried to middle click on a link (to open a new tab) too fast, and missed, instead middle-clicking somewhere on the page. When this happened, firefox would suddenly try to navigate to a completely invalid URL. The text in the invalid URL occasionally looked somewhat familiar, though it was often blank. Eventually I began to suspect that firefox was trying to navigate to the information in the clipboard. To what point and purpose, I did not guess.

Until today. I'm not going to explain why it took so long. Maybe it didn't happen that often. Maybe I'm so used to all of the other stupid features "they" keep adding to my favorite open source programs that I just rolled with the program. But no longer. I did a little search for firefox middle click behavior and look what popped up. Based on that thread, it seems the people who made firefox thought it would be really handy to copy a url into the clipboard and middle click to navigate to it. Maybe they didn't know you can click on URLs. Maybe they didn't know you can hold the control key down, press L,V and hit enter to accomplish the same thing in the time it takes for your right hand to get halfway to your mouse. Maybe these are the kind of people that use mouse gestures. Whatever the cause, its not important.

What is important, is you can turn it off. Navigate to about:config and set middlemouse.contentLoadURL to false. I can middle click all day now and firefox doesn't get call screwed up from trying to navigate to "background: #333;"

I have a feeling I am the only person I know who cares about this. Kind of like when Y100 went off the air because of those inhumane slimy bastards at radio one, and I was the only person I knew who cared. Maybe, one day, I'll maybe my own distro of Linux with custom versions of Firefox. I'll call it "F***Gnu/Linux" for correctness, of course, and the power icon will actually turn off the computer, and stray mouse clicks won't make software flip out, and I'll be able to plug in my camera and copy videos off of it, and I could ask myself questions about it without the pre-requisite hour of fruitless searching on the internet that open source people expect, and it would come with 3d drivers from the company that actually made the card, and, oh, and a fresh installation will play my damn mp3s without me having to ignore another paragraph about "non free" software. I tried reading slashdot and fighting the good fight in the self-righteous wars against patents. You know what I got? A bunch of ogg vorbis songs from Russia that won't play on the Ipod my last girlfriend gave me just before dumping me because I didn't like her dog enough, and an A in computer ethics class. I'm done with all that.

I think what I really want is a linux version of windows. Or a windows version of linux. Like, imagine if Red Hat made a version of Windows. Or if all the people who insist it should be called "gnu/linux" were accidentally teleported to mars in a freak accident.

Tuesday, February 23, 2010

Distractions of the Moment

[Salsa]
My desire to go, or continue going, to my salsa class fluctuates like a sine wave. Tonight I didn't learn anything that I can take directly to the [social] dance floor, but I did learn some stuff that will help me sort of derive my own moves better. And I remembered to take an actually camera, which unlike my cellphone, doesn't fail at taking video.

Tonight, also, the teacher had a new girl assistants. This guy uses female assistants, and they seem change regularly. I am hoping the new one is permanent and not just a substitute for today, because she is cute, friendly, and started talking to me after class. This counts as me talking to her because I made eye contact. I think I even half smiled. Anyway. There are these parties or whatever every week at the studio. I may have to go to one just to see if she's there. Think its friday. I don't know what her name is. I could have learned it, because she was like three feet away introducing herself to a bunch of people, but I wasn't paying attention.

And this time, I'll make sure she's not dating the instructor. Its really awkward to have to interact with someone who doesn't realize you hate them, who you can't openly hate because the--well lets just leave that in the past.


[Volleyball]
I posted an ad on craigslist asking if there were any pickup games, or if this city was infested with leagues only. Two girls responded yesterday with excellent information, and one guy emailed me the same outdated list of phone numbers that I didn't want to call when I found the page with my own google search. There have been a few responses since. The gender ratio of the responses is 4:1 in the good way.



[Wesnoth]
I have begun creating a custom campaign for The Battle of Wesnoth, a turn based strategy game. I hightly recommend it for anyone else who has used linux for the past 7 years and has been waiting that long for people to start making games for--oh yeah I'm the only one who did that.

My addiction to creating user content, specifically levels, of games, dates all the way back to Duke Nukem 3D and the build editor. This was back in the day when you could run a 200mhz pentium without the heatsink briefly and it would feel pretty warm afterwards. My creations with the build engine were atriocious, and my friends never wanted to play them again after they tried one. But I kept on doing it anyway, because I loved it. Eventually I moved onto UnrealEdit, or whatever it was called, for Unreal Tournament Classic, and this time the levels I made were actually playable, culminating in my greatest achievement: a level people enjoyed playing at the lan parties. Except for this other Dave and Chris' little sister, but that was because they kept falling in the bottomless pit in the center. Not my fault.

Anyway, my addiction is currently pretty bad. Except for the social plans I make, I run home, work on my Wesnoth campaign until after I should have gone to bed, go to sleep, go to work, and then come home to repeat. Not something someone trying to make friends should be doing. However today at work I realized why I kept doing this: what if making levels for games could be my actual job? A job I liked so much I would do it for 12 hours a day because it was ridiculously fun. Every job I've worked at I've struggled to work the full 8 or whatever hours every day, to put my full time in. When I'm level editing, I can go for 18 hours at a time without realizing it--except for the hunger pangs, which I usually solve by running to the fridge and eating cheese slices or pickles, etc. You could say my interest in level editing is like a scaled down version of how much I like Legos.

My current goal is to create a webpage showcasing levels/maps/campaigns/etc that I have created for various games. When thats complete...I will then figure out how to use such a webpage to get me work in the game design world.

Oh, and this is the real reason I'm writing about this: this wesnoth game has its own special language called WML, which stands for Wesnoth Markup Language. The name implies that it is just a simple (poorly designed) markup language like HTML. As in, not a real programming language. If you have, for example, a hot girlfriend named Katie who does web design work with HTML, I wouldn't tell her to her face that she's not a real programmer. But its true. Anyway.

Parts of this stupid WML thing are, I suspect, turing complete. This bothers me a lot, perhaps becaused its called a "markup language" and perhaps because the people using it rely heavily on these retarded macros, which, as their are implemented, cannot support any kind of functional programming. I think I am going to try to write some WML that proves turing completeness, but based on my fading memory of Programming Language Concepts, that is usually done by making something that can execute turing machines, which I don't feel like doing.

So instead, I think I'm always going to solve 3Sat. I've always been impressed by people who could reduce things to 3Sat, mostly because I didn't take the algorithms track as an undergrad and didn't fully understand the problem myself until I was a grad student. Don't judge me.

Anyway, I'm pretty sure lots of other computer people don't understand 3Sat either, but have heard of it, and if I put a wesnoth level that can solve 3sat problems of up to K expressions (where K is probably going to be like 30) on my webpage, I think that would make a lot of non-computer scientists think I am really smart. Would this translate into a job offer to finish Duke Forever? I don't know.

Oh, and my assumption here is that if a language can solve an NP-Complete problem (who knows, maybe I'll try an NP-Hard version--like minimum true values) then it must be turing complete. I could be wrong though. Maybe you can solve 3sat with standards-compliant HTML and CSS. I mean, I don't know. <-fake humility

[Guitar]
I haven't worked on it in a while, but I want to start practicing again soon. I want to finally get around to recording my special version of Love Story, and I ordered a Linkin Park songbook, which I hope will satisfy my urge to just turn overdrive on and play something really loud for an hour (as best I can tell, my neighbors don't hate me yet).

I think I've nearly confirmed that an inordinate amount of people out here hate Creed and Nickelback. I've never understood why it happens to be those two bands that get picked on (and not crap hop, or all the pop songs I hear on the radio) and since I like Nickelback and am completely indifferent to Creed, I have a nascent desire to learn a bunch of Creed and Nickelback songs and torture people with them. Actually, I have no desire to learn any Creed songs. But I could do nickelback. I wonder if opening my windows and turning my speakers up and just playing the chords loud, every day, for three hours, would be enough to drive people crazy. The first overplayed song of their was probably the "this is how you remind me" song. I think that would cause the most pain.

[In Other News]
I did not even try to spellcheck or otherwise proofread this post. You probably figured that out by now.

Saturday, February 20, 2010

Back in the Saddle

I flew again, after my frustrating weather and sickness hiatus. Out of habit, as I was gathering the twenty random articles I always have to take with me (logbook, medical certificate, fuel strainer, sectional.....) I started getting nervous out of pure habit. It was a brilliant, blue day, perfect for flying, with no known adverse conditions or flight restrictions in the area. I did call flight service to ask about the Olympics flight restriction, and the briefer made it clear to me that he didn't want to read a 30 page document over the phone, and the Olympic thing wouldn't affect me.

I was out on the ramp preflighting my favorite Cessna, '49S, when a big jet roared off the big runway, immersing the entire airport in the sound of its engines at the moment of liftoff. I turned around to watch the landing gear fold in to the belly as it rose at an incredibly steep angle and suddenly remembered why I love flying.

I did three takeoffs and landings to a full stop. They were a bit sloppy, but good enough to convince me that I haven't forgotten to much. Again. As soon as I can I'm gonna try to fly over to Bremerton and eat at the diner there. After Bremerton...my next goal is getting to Hoquiam, and then a day trip to Portland.

I'm not sure why I care. None of this is helping me meet people. And I have yet to find a recreational volleyball thing where you can just show up and play some volleyball. People in this area seem obsessed with "leagues" where you are part of a set team and are probably supposed to show up with some regularity. I don't want to make a commitment to drive to some gym every week. I want to show up somewhere and spike a little white ball and meet volleyball girls. I am starting to suspect all of these volleyball leagues are just ways to force people to join a gym. There's a gym in my apartment. I kind of wish it was a volleyball court.

Friday, February 19, 2010

Vertical Development

I had to write this idea down somewhere. I was thinking about airspace, and about how in reality it is unusually flat. For example, Class B (cool people pronounce it "class bravo") airspace typically extends from the surface (cool people write "SFC") up to 10 thousand feet MSL. In diagrams, this is usually pictured as this enormous shape extending far into the air. Its actually not that high though. The big runway at Boeing field is ten thousand feet long. Thats fairly long, but really not that big when you look at it (thats what she said). Stand that runway up vertically, and thats how high class B airspace really gooes.

I have enourmous nagivation maps taped to my wall. They cover about 1/5 to 1/4 of the United States, because I was planning to put enough maps up to depict the entire upper half of the United States, but before I could complete the maps I realized that A) a Cessna won't make it to Philly and B) having giant maps like that on the wall is a little weird. I've been too lazy to take what I have down though.

ANYWAY, so I was looking at this map one day, and then I measured how long The Big Runway is at Boeing Field, and then I tried to hold the point of a pencil about that far away from the surface of the map. It was ridiculously close. Kind of boggled my mind. Going thirty, even sixty thousand feet up (roughly the max operating altitude of many airplanes) was still ridiculously low compared to how big the map was--and this map was just the top left part of the United States. You know, Washington...Montana, Idaho...Michigan...some other states in their I don't think about. Maybe some Dakotas, idk.

You can try this at home, by the way. Buy a VFR World map, or WAC, and spread it out on the table, look at the legend to get a sense of scale, and then place something on the map that scales to 10 thousand feet high. I think you'll be surprised how low that is. Then, since 10 thousand feet probably doesn't mean much to you, put something on the map that is about 3 or 4 times as high--thats how high you are when you fly commercially.

Anyway, this post is actually about Legos. I wrote all of that so I could explain that I was thinking about my maps like ten minutes ago (when I started writing this post) and jumped to the sudden realization that I could build legos up my wall. Vertically. Like terraces and stuff. And mountain people. That could be pretty cool. It would still break from physical impacts if I had a bunch of drunk people in my apartment and they fell into it, but it wouldn't take up much space. I would need a ton of those specialized mountain bricks though. Or at least a lot of gray bricks. Oh man, I could have like a castle entrance...and a steep path winding down to...something else. And those glow-in-the-dark ghosts. And like horses and crap. And dragons. And barrels. I love those tiny little Lego barrels. You can stack them up. Or put them side by side, perhaps next to a little Lego wall. You can put little Lego barral covers (brown 2x2 rounded plate) on them. You can put little Lego swords, pistols and rifles in them. You can even put little Lego gold pieces of eight in them. In fact, now that I'm older and wiser, I just realized that you can store tiny little Lego hats in them as well. I wonder why I never thought of that. Maybe because my Lego men were always wearing their hats. Cause they had style.

Thursday, February 18, 2010

Not as fun in real life

I am currently reading a book called Stones into Schools, which is about building schools in Pakistan and Afghanistan. The book keeps me up at night; this real story is actually more thrilling than most of the fictional ones I've read. I originally thought the title referred to people throwing stones into the schools they were building, but it actually refers to taking stones, and turning them into schools, which I understand is not metaphorical. One of the events described in this saga is the print of an erroneous article by a global publication, which described a perceived insult to a certain major religion, and caused waves of rioting and violence. My first thoughts when reading about this incident were negative and directed towards the author of that article, however upon further reflection he is no more responsible than all of the people whose beliefs involve reacting to alleged insults by destroying things and killing people. For now, though, lets blame the author, because it contrasts better when I say that I'm glad my job does not involve life or death considerations. When I screw up, a big internet company loses some money. No one torches the building.

It does, however, now, involve interacting with people. Yes, it involved this before, but previously most of the people I interacted with were on my team, and we, united by our common goals, had disagreements only over the best, optimal, and/or correct way to do things. That changed when my boss left the company and my new boss, who is awesome by the way, took an interest in my...development, as an employee, and gave me more responsibility. You see being a programmer, I mean, developer, at this company, is a little like being in an RPG game. Right now I'm level 1 (its not actually called that). For me to get to level 2 (not called that either) I need to do a bunch of stuff including coordinating projects across teams. The word for this category of skill is cross-functional, which in my opinion means something different and far more useful than emails and meetings. I am actually in no hurry to reach this level 2, since I still often find myself lost among tangles of homegrown software that I don't particularly like. I don't really have the option to not progress. Its pretty much a part of my responsibilities.

So now I am in charge of managing one of our systems. This particular system is a--well who cares what it does. The important part is now I have to regularly talk to people on other teams. People whose goals don't necessarily align with mine. After not needing to interact with people, except to ask lots of questions, go to lunch, and reminisce about visual basic, for so long, I have noticed an acute difference between computers and people.

Lets say you are working with a computer, using a command line program. For those of you non-computer people, a command line program interacts with you by printing some words on the screen, and you type some words back. It is brilliantly simple and easy, and hollywood usually replaces such real systems with retarded graphical monstrosities that show things blinking or zooming around. But I digress. Lets say in the middle of using some program, while you are in fact typing your response--in the middle of a word, even, you walk away from the computer. You just leave it there, running, waiting for you to talk to it. You know what will happen? The dumb little box will just keep on waiting. In fact, it will basically forget it was even talking to you, thanks to things called interrupts and context switches. The computer will sit there, patiently waiting (not that it really cares) for you to return to it, for seconds, minutes, hours, days, even years, until its moving parts start breaking down, and the hard drives fail or the fans fail and the cpu melts or the power supply commits suicide and fries the whole system.

The computer won't be calling you, or emailing you, or filing tickets on you, or setting up meetings, or finding your office, or calling you and them putting you on speakerphone with a manager. People, on the other hand, do all of those things. I don't like it. When someone wants me to take care of something, because, say, their entire team depends on me doing something for them, and then I just sort of drop what I'm doing with them and don't respond for a few days (or gasp--hours), it makes them (and their managers) really cranky. They also don't like being told no, even if this "no" stems from my desire to not f...break my teams software.

I'm not one of those programmers that wants to be locked away in a basement to program alone with only fluorescent lighting and a bag of Doritos to keep me company. However I also don't want to be regularly dealing with politics. Today I actually asked people to double check my responses before I sent them. I haven't done that since I worked at Drexel and the person I was emailing was responsible for a giant chunk of our funding. I think what I really want, is to be the only male programmer on a team of ex-model superhero female programmers (who are all capable of articulating the difference between NP-Complete and NP-Hard), working for a company whose goal is to both solve world hunger and finish the game Duke Nukem Forever. I would specialize in level design, artificial intelligence, and a few things that have nothing to do with programming. Yes. Yes I think that might be my dream job. Well, I suppose my dream job would also involve flying F-14 Tomcats, and changing the angle of the wing sweep every 5 seconds, just like I did with my toy F-14 as a child. Working with hot, brilliant female programmers is my ideal job, and I maybe never forgive our culture for the extremely low likelihood of such employment ever being within my grasp.

In other news, it turns out that I probably didn't lose %25 of my body weight. I definitely lost a lot, because I've had to keep my belt a notch tighter, which makes my pants look funny and regresses my fashion sense by about 5 years, but the scale said I was 149.2 today, so its unlikely that I lost 40 pounds in three weeks and then gained 30 in another two. Also, I don't have aids. Yeah, they actually tested for that because it is apparently not normal to get sick all of the time. I didn't tell them about the tires or my moldy sink--which I have since fixed. I don't know if you know this, but spraying chlorox on stuff and then scrubbing...I mean, wow. My sink looks at clean as it did when I moved in. I wonder if chlorox can get rid of everything I don't like. Maybe I'll take a bottle to my meeting tomorrow.

Thursday, February 11, 2010

Plot Twist

I got sick again. Maybe a complication from the antibiotics called thrush. Maybe just some virus. The doctors at the ER weren't sure. Maybe it was related to the mold I think I found in my sink. Maybe it was related to the dirty tires I had in my apartment for months. I don't know.

What I do know: I was sick for over a week, lost even more of my scarce vacation days, and lost 25% of my body weight. I used to weigh 160. Now I weigh 120. This is mostly my fault: I waited too long to see a doctor (hence the ER visit) and I ran out of food in my apartment and the medicine they gave me at the ER caused light nausea. On the bright side, I learned that someone of my age can have a sustained heart rate of 120 BPM for days and its not a problem. I also learned that tylenol hangovers suck.

I don't know the full medical ramifications of being so light now, but I am weaker and prone to lightheadedness. So far, I have managed to avoid any more blacking out in front of stores that call paramedics, although I did have a close call. I saved myself by chugging some gatorade as soon as I bought it. I am so skinny now that the jeans that I spent so long to find (because it was hard to find jeans for a skinny person like me) are now too big. I don't even want new jeans. I don't want to find how few stores carry jeans that fit my new stick figure.

I've been stuck at home for way to long--so long I actually hate coming home at night--the only reason I do is I hate working late even more. I can't go climbing or play volleyball or half of the other stuff I wanted to do. I started a new salsa class session thing at the place across the street. So far I haven't learned any moves I can actually use social dancing.

More bad news: Mardi Gras, the celebration of drunken debauchery that I wanted to experience, is coming early this year, and I probably won't make it. There was only one person I really wanted to go with anyway, Adam, and he can't afford it either.

However, on the bright side, I went to Century Ballroom tonight for a little salsa. It was overrun by way too many men snatching up the girls as soon as a song changed, but I still got some good dances in, as well as one crappy one, and one dance that I thought was good but the girl never smiled. One of the good dances was with a hot girl in a green dress named Katie who smiled a lot. I was planning to stay all night and dance with her a few more times and find out if she was interested in some combination of ice cream downstairs, drinks at some bar, or microphone-less rock band at my place...but my legs started to hurt so I left. I felt pretty good about the night though. My moves are starting to come back, from whatever deep part of my memory they were buried under. Most of them I still can't do, but at least I remember them. And I did bring back this one move we called the "philly favorite." The only thing you, as a reader, need to know about this move is it involves spinning a girl from her hip. And that is awesome. I also brought back the double hair caress into an inside turn from her hips. That one involves even more hip touching. Also a lot of the girls there were hot. I don't remember there being that many hot girls at Century. Maybe tonight I got lucky--relatively. There were still a ton of men. Boo men. I am still seeking an experience to rival the time I showed up to Brasils (a salsa nightclub in philly) and there were at least five super attractive girls that could dance, and almost no men in the place to dance with them. There was a dearth of male dancers, you could say. I basically had a queue of girls waiting to dance with me. That was the night I had to leave to go celebrate this girl Sarah's birthday in a pseudo Irish pub. I kind of wish I had stayed a little bit longer. Perhaps, though, a night like that could happen here.

So...despite a sort of major setback, I can still dance, and dancing is not a bad way to meet people. In fact, back in philly it was how I met Danielle, who started throwing monster parties with tons of people, at one of which two girls gave me their business cards, which I gave back because I was so incredibly oblivious. However that, and a bunch of other embarassing moments I just remembered, won't happen again. Like the girl at Kevin's party, or the girl at the pizza shop in Camden...ugh.

Also, I've been without a motorcycle for so long that my hatred of rain has faded. In fact, its actually quite pleasant. I will, of course, loathe rain as soon as I start riding again, but we don't know when that will be. Oh man and those girls in the car that started talking to me at that traffic light...why didn't I offer one a ride? I miss philly.