Sunday, May 09, 2010

more iTunes pain

One unfortunate side-effect of purchasing this phone is that it's made me angry at Apple all over again. At this point we're an Apple-only house (well, not counting the Windows work laptops or the Linux Mac Mini quietly cranking 24/7 in the closet) and so I've been using iTunes for everything. Honestly, I think iTunes is a piece of crap, but there was no other piece of software that was easy to use with our iPods and my wife's iPhone. For a little while, it was possible to forget what a huge racket that whole iPod / iPhone / iTunes proprietary shit is, but throw one unsupported device into the mix and you're reminded that Apply designed everything from day 1 to lock out other devices and software apps. I mean, seriously, think about it. Grrrrr.
Unfortunately, there's no good solution - I tried out doubleTwist (which looked promising) but it turned out to be a memory hog to the point where it's unusable on my lowly Mini with 1G of RAM. I found I was able to drag & drop from iTunes to my phone, but that's not very sexy or easy to use.
The solution I ended up making up was less than optimal, but somewhat functional. I already have an iPod that gets everything synced, and I didn't want to mess with it, so I made a playlist in iTunes called "Android" that contains everything I want on my phone. I wrote a Perl script to parse the iTunes XML file to get the info about songs and playlists, and sync the songs in the Android playlist to the phone, then re-write the other playlists with only the songs that are also in the Android playlists and sync those to the phone as well. Overall, it works pretty well, but the fact that I had to spend a few hours doing it is going to bug me for a while...

New phone!

So, I've been totally craving an Android phone ever since Google had the first apps contest - after much waiting and lusting, I finally gave in a bought an HTC Desire. The deciding factor was the ability to sync with Exchange, which (after jumping through some corporate hoops, of course) will give me the ability to drop my Blackberry and only carry one mobile device with me. The idea of playing with a (relatively) open platform was incredibly tempting, plus the devices were starting to get to the point where they were about able to compete with the iPhone on sexiness.
After getting it, I'm falling in love with it pretty quickly. The thing is more like a little computer than a phone - the number of apps it's got, the ability to actually multitask and (for example) listen to music while I study flashcards is pretty nice. I really like the multiple workspaces, which fits my Unix geek heritage nicely (the first time I saw CDE in 1998, I thought to myself "why doesn't every computer have multiple workspaces?") - the only problem is that I feel this compulsion to put _something_ in every workspace, so I've been poking around at what's out there and trying to accept the fact that I may not have every workspace filled up.
Other things that I like are the predictive text - I don't think I'll ever be able to type as fast on this thing as I can on my BB, but with the predictive / correcting text I'm getting reasonably close. Maybe when Swype comes out for real, I'll be able to pick up some speed.
Overall my biggest complaint is that now, for at least a while, I'm going to be terrified that my phone will get lost, stolen, or destroyed.
The bad things:
  • The screen is tough to see in direct sunlight, which was not a problem with my Blackberry. The various widgets, while cool, aren't entirely perfect - for example, there's a "social" widget that combines Facebook, Twitter, and Flickr(?) into one monolithic stream - very cool, except that a lot of the Facebook pieces seem to lose authentication, or for whatever reason just choke - so, for example, I might see that a friend has posted a new photo album, but when I want to look at it, I get the message that there are no photos. Weird.
  • I think that since this is a new phone, and the shiny newest version of Android, some of the apps in the market don't work right - some have oddball issues, some just flat out don't work. For instance, I got a flashcards program that looked really promising, but couldn't find any of the cards I tried to upload (which made it rather useless). It had many users and not one complaint about that issue, which makes me figure it's a specific problem to my hardware.
  • I can't find a nice, clean-looking media player - the one that ships with it is craptacular in terms of interface, so I wanted something a little different. Tried Mixzing, which I really liked but for some reason kept playing the same songs over and over (again, I think it's that whole new phone/OS thing), finally settled on Tunewiki, which is pretty good but at the same time not what I want - truth be told, what I really want is something that looks and feels like an iPod.
  • My biggest gripe - no VOIP apps. Well, there is sipDroid, but that's only useful if you've got similarly geeky friends with SIP phones, or if your Skype friends don't mind accepting calls from unknown users. No Skype app, and no VOIP hooks for Google Voice. Since Google bought Gizmo5, I can only assume that this is in the works, but so far no joy. Man, it would be nice to have a way for folks in the U.S. to reach me without dialing a long-distance number.

Other than that, loving it - this will definitely keep me geeking out for a while.

Saturday, April 17, 2010

Travel decisions

So, as everyone knows, most of Europe is closed to air travel and the ground-based travel options are overflowing trying to compensate. As it happens, my flight is broken into two pieces; Lisbon and Munich. Right now flights to Lisbon are still going, but Lisbon is understandably a zoo since it's one of the few mainland European cities that you can still fly to from the Americas.
So, what to do - take the flight to Lisbon then go through what is sure to be a very unpleasant experience getting from there to Munich? Or just wait it out?
Since I'm in Rio I think I'll be going with the second option. Really, really wish I'd brought my laptop to Brazil with me, though...

Tuesday, March 30, 2010

Die Ärtzte

One of the best ways to learn a foreign language is to try to get into local music. Germany doesn't have a ton of great music, but there are some gems. My buddy and countryman Steve gave me the "Bäst of die Ärtzte" CD for my birthday last year and I'm actually really getting into them - lots of fun and really my kind of music, also of course it helps me learn German.
One of my favorites, below, partly because it's one of the first ones I understood (more or less):



Anybody else think these guys looks awfully dour considering the happiness of the song? Then again, that's another reason I like this song so much; it's so out of character for this band.
Another one of my faves, which is more typical of them:



I'm learning German!

Monday, March 29, 2010

Brazil in t-minus...

So Clau's in Chicago, attending some bigwig corporate thing - she's going to be there at least 3 times this year, including for our anniversary (sniff). She also got to go to NY, which makes me very jealous indeed.
Heading for Brazil on Thurs morn, Clau has a meeting there so we figure it's a chance to see her family for half-price. Plus, some friends are getting married, and hey, while we're down there, may as well. Plus, I finally get to see the south!
Down to 85kg, just in time to pig out on churrasco, caipirinhas, escondidinhos, and whatever specialties they have in the south. Not like I've been working all that hard lately, but I'm totally ready to relax.

Thursday, March 11, 2010

Latest public service / safety campaign

So it seems there's always at least one PSA-type message being pushed in the city at any given time - I mean, in Bavaria there's always some "do you have a drinking problem? Call XXX"-type messages, but then again it's Bavaria, where until pretty recently it was socially acceptable to drink beer with breakfast.
So, the latest? "Know your limit!". My favorite one of these:



For the two kids on the left, it says: Tonight she loses all her inhibitions...and later he posts her naked on the Net.
I like it how that ad would never fly in the U.S., because it would imply that when a drunk girl's naked picture is posted on the Internet, the girl herself might share some of the blame for posing naked for a guy who would post the pictures on the Net. Although, to be fair, the Germans may be interpreting it as "he gets so drunk, he actually posted that girl's naked pictures on the Net!".
The others are more somber, but thankfully this is the one that's posted all around my neighborhood.

Oh, and another one that amused me - this one an ad for a newspaper insert with parenting tips:



(Translation: "What now, dear parents?")
I'm guessing that one might also face some opposition in my home country.
Gots to love Germany....

Sunday, January 17, 2010

Stupid Mac Mini

The hard drive died in my mini this week, I ended up spending almost the entire day Sunday replacing it. The physical replacement took a couple of hours (not particularly difficult, just tedious getting around all the screws and crap), then the process of rebuilding and restoring took even longer than that. I couldn't get a decent rescue disk to boot on the Mini for some reason, so I ended up doing it the hard way: installed Linux fresh on it, then added the dump/restore utilities and moved the latest dumpfiles over to the O.S. disk, then booted on the live Ubuntu disk and did a full restore from there. While I was at it I updated the O.S. since it had been about a year since the last time I did any updates (when you have no KVM you tend to develop a "if it ain't broke..." kind of attitude).
Given the relatively low crunching power of the mini (and the even lower amount of power I require), it's probably
So, kind of a wasted day - after replacing the HD I made some stew. Clau and I have both been fighting various ailments since we got back from Brazil, plus we both packed on some serious pounds over there, so we're going for light soups.

Sunday, January 03, 2010

Resolutions

So, just for the record, NY resolutions this year:
1) Better health. I say this almost every year, but this year I mean it. I've put on about 10 pounds since we move to Germany and I want to get back to my pre-move weight. Ideally, I'd actually get into shape to the point where I'd be happy taking diving photos of myself in my swimsuit, but I'll settle for losing 10 pounds.
2) Practice more German - I haven't formed much of a relationship with my German colleagues, mostly due to the isolation of my office and my inability to speak German. Now that I can speak some more German, I want to make an effort to reach out to them and make some more / better connections at work.

Let's see how it works out...

Enjoying Rio

So, Clau and I are here for another week or so - it's been really great to actually have some time to just relax as well as see all the family and friends. Brazil, and Rio in particular, is really changing rapidly before our eyes. For one thing, there's an obvious explosive growth in the middle class, and the number of really, really impoverished people is decreasing. Everything is now considerably more expensive, especially considering the exchange rate, and you can just sort of see the place becoming more prosperous. The mayor and governor of Rio seem to be collaborating on cleaning up the city, and they seem to be taking a page out of Giuliani's book, in particular by focusing on some smaller-level crime. There are endless police checkpoints to make sure folks are wearing seatbelts, and checkpoints for drunk driving. The police have lots of shiny new equipment and kevlar. There are a slew of new laws (and old laws which are finally being enforced) regarding the beaches designed to make them more sterile and tourist-friendly (no umbrellas with beer labels, no glass, no dogs, etc etc. It's actually quite nice.

Wednesday, December 02, 2009

Germans are weird

Had a friend over for dinner last night, she turned us on to this popular German viral video. I mean, I find it pretty amusing, but she really really seemed to enjoy it (even after having seen it many times). The funny thing is, she's got a pretty good sense of humor, but I think there's some other level of humor that strikes a chord with Germans.




The words are something like:
baby shark, doo doo, doodoo doodoo, baby shark, doo doo...
little shark.....
big shark.....
white shark....
girl swims....
shark sees....
girl sees....
shark attacks....
girl swims....
shark attacks....
girl screams...
shark eats, yum yum....
bad shark!

Yes, my German classes are really paying off.

But lest you think that only lame things come out of Germany, remember that somewhere in this country lives the awesomeness that is the Techno Viking.

Monday, November 30, 2009

The Google Phone

So, apparently Google is going to come out with their own phone - personally I've seen this coming for a while now, and I've got some ideas as to how it would work.
Actually, I can't say I really predicted Google coming out with their own device - I figured that they would only come out with their own phone if they couldn't get partners to agree to supporting their vision on the Android platform; since Google's building their own device, I'm guessing they couldn't.
So, how will it work? From a user perspective, here's how I think it'll go.
I want to talk to my friend, John Doe, and I'll just dial "John Doe" on my phone. The GPhone will automatically see if he's on Google Chat / Voice, and if so directly connect me to him that way - entirely via IP - if I'm on a wifi point then it'll use that, otherwise it'll use my data carrier. If John isn't on some kind of IP-enabled system, then it'll dial him by regular old phone, but of course doing it in a Skype / Calling-Card kind of way, using VOIP to get to the closest POTS switch and then dialing from there. If I want to dial a phone number directly without going through this username mumbo-jumbo, then I'll just dial it like a normal phone - the difference is that I'll be paying for that, either as a direct payment or by using up minutes in my plan. My guess is that Google will make calls to a persons Google ID free of charge, even if they're really doing some Google Voice mumbo-jumbo behind the scenes.
From a receiving standpoint, the phone will do the same thing - I'll have a Google Voice phone number, which will be tied into my Google ID - when someone calls my number or my ID, that'll get piped to my phone. I don't know if Google will charge for minutes when someone calls my number instead of my ID, but I suspect they might in order to further persuade folks to keep it all within the Google IP universe.
This phone's going to mark yet another change in the way we view communications, one that I think we're ready for. Not that long ago, we had to remember (or write down) people's phone numbers. Once cell phones came along, we slowly adjusted to not needing to remember numbers - I don't know about everyone else, but I haven't memorized a phone number in quite a few years (with the exception of my own or my wife's, and that's just so I can give it to people quickly). Over time, the association of numbers to people has even started to fade; I mean, if I think about it, I know that a person's entry in my phone is tied to a number, but I don't actually _think_ about it - if I send an SMS, I just send it to that person. I think part of Google's vision is to capitalize on this thought trend, and get people to stop caring about phone numbers entirely. If you get a person's phone number, you can call their phone; get their Google ID and you can IM (GTalk), send them email (GMail), see their public calendar (GCal), see where they physically are (Latitude), and, or course, call them on the phone - why would you ever bother to get a phone number again?
The only think that I wonder is where Google will find a carrier who is willing to support this device - after all, voice calls are the bread-and-butter of mobile telecoms, and SMS is the icing on the cake - the Google phone would destroy all of that. In order for this to work, Google needs to partner with a carrier that's willing to give folks a pure data plan that's going to have a _lot_ of bytes shoved through it, for a price that more than competes with a traditional plan - what carrier in the U.S. is going to willingly sign up for that? I'm guessing not Verizon, or else this would already be standard on the Droid (OK, maybe not "standard", but the phone would at least have some apps to replicate the functionality I'm talking about). Or, maybe Google has some plan to shift most of the data burden to something else that they control? Only time will tell, but expect we're going to find out RSN.

Friday, November 20, 2009

yay new meme!

I don't know why this didn't become an Internet pastime sooner. Start with the self portrait of 18th-Centure painter Joseph Ducreux:



Man that's a pimpin' pose? Why not slap some modern pimpin' lyrics on top, such as "I got 99 problems but a bitch ain't one". Or, even better:



Loving it! Check here for the whole shebang.
And, of course, some folks just have to cross the streams, thus creating a delightful meme mashup:

Dumbing down my poker

I've been on a very bad run of poker lately. It's been impossible to get a read on anybody. Every time I get some playable cards, I encounter raises and re-raises and re-re-raises. Every time I have a monster, everyone folks to my modest raise. My bluffs fail: I go through a lot of trouble to set up a tight image, but then everyone calls my raises, no matter how infrequent they are. Every bet / semi-bluff / bluff I make gets called or raised, despite my telling a beautiful, well-crafted story about exactly what I have. Nobody else's bets make sense; they're folding good hands and pushing all-in with nothing. Add to this a general card-deadness and lack of hitting draws, and you have the recipe for a very bad losing streak.
After about a month of failing, I read this post, which gave me a moment of clarity: I'm thinking too deeply. I'm trying to represent a particular hand or image to folks who aren't even paying attention. When I make that check-call with two hearts on the board, then bet big after the third heart comes in, folks aren't paying attention. Conversely, when I over-bet the pot on a board with two to a flush, folks are calling it with flush draws. Basically, I'm giving everyone too much credit. I mean, in a sense, I knew this already, but it hadn't really registered. So, now I'm back to basics: tight play, sit around and watch the other folks until I get a really good sense of what level they're thinking on. The only problem with this is that the donkeys' money tends to go to other folks who are willing to make questionable calls earlier on in the game. Since making this adjustment, things are going much better. Oddly enough, I now seem to also be getting better cards in better positions - or, maybe now I'm just calling at the right time, after taking the time to carefully analyze how my opponents are playing. At any rate, I'm enjoying it again, and that's what's important. Seriously considering heading down to Salzburg or up to the Spielbanken casino one of these weekends for a session.

The bank / tax debacle

The problem with not writing for a long time is that after awhile so many things build up that you have no idea where to start. There's life developments, job developments, tech developments, poker developments. I guess I may as well start with the life developments, then see what else happens.
So, let's start with my latest FML moment. A bit of backstory:
After I transferred to Munich, someone forgot to mention to payroll that I was no longer working in the U.S. As a result, I was getting paid in both the U.S. and in Germany. I figured this out pretty quickly and did the appropriate thing: I notified H.R. I pestered H.R. after each U.S. paycheck until they told me (nicely): it's being dealt with, don't worry, now piss off. A month after that, I told my boss, who really set off the alarms and fixed the issue.
Since I'm a responsible person, I figured that my employer would eventually figure out the mistake and ask for the money back. The money had been going into a bank account in California, which had remained our principal bank account even after moving to New York, and had been used to pay all our bills / mortgage / etc in the U.S. After moving to Germany, the bank account never got used, so I kept the money in it (along with some savings that was there before the debacle started), untouched, waiting for my employer to ask for it back. See how responsible I am? I didn't get any indication from them, but then again it's a very large company, and I assumed - no, I KNEW - that someone, eventually, would notice, and I wanted to be able to say I did the right thing and even tell them "just take it right back from the same bank account". Flash forward to 6 months later...
Right before taking our vacation to the U.S., we (Clau and I) realized that there was a potential problem with our ATM cards for our bank in New York. As a backup procedure, I grabbed the ATM card for the California bank and went online to transfer some money from the savings account to the checking account (again, to avoid touching the mistaken payment money). To my horror, I discovered that both the checking and savings accounts were empty. Heart racing, I called up the CA bank and asked what had happened. After quite a few phone transfers, it was determined that the great state of California had seized ALL my money for reasons unknown.
Some phone calls later to the CA FTB (franchise tax board), I was told that I had not filed a CA tax return for 2005, which was the year we sold our house in CA, after a year of renting it out and deciding it wasn't worth it. Apparently, if you sell a house in CA, you are required to file a CA tax return for that year, regardless of your state of residence for the year. Ironically, Clau and I filed our taxes with H&R block that year for that EXACT reason: we didn't know what we were required / supposed to do, and we wanted to make sure there were no screwups.
(Side note: H&R block are a bunch of idiots, set up for people who are too stupid / lazy to fill out a 1040. Don't give them anything more complicated than that or they WILL screw it up. They supposedly offer a warantee that will reimburse you if you get audited and found wanting; I'd be curious to see if that warantee has EVER been successfully used. Also, their "rapid refund" service is just a patently evil scheme designed to further screw folks in need to the wall. In retrospect, I should have just fronted the cash and time and gone to a real accountant. Lesson learned.)
Getting back to the story, apparently someone in cash-strapped California had noticed the house sale from 2005 and decided that CA was entitled to taxes on the SALE PRICE of the house, which of course added up to a boatload of money. So, they took all the money from my bank account (for which the bank charged ME $100, but they were at least kind enough to subtract that from the bank accounts before giving the remainder to the CA FTB).
The folks at the CA FTB were surprisingly nice, and cheerfully told me that all I had to do was file a retroactive tax return for 2005, and they would happily send me a reimbursement to my address (in Germany!) after receiving my return. Needless to say, I filed the return post-haste and sent it certified receipt mail from CA while I was there.
What the CA FTB failed to mention is that they take their sweet time with retroactive returns; I've called once every two weeks and each time the response is "we haven't even opened it yet. Check back in a month." Somehow, I have a feeling that if there had been a check enclosed in the return, they might have gotten to it sooner.
I really don't like this, of course, but then again, the money was just sitting there waiting for my employer to eventually ask for it, so in this case I'll survive. Of course, imagine if that wasn't the case? What if that were still my main bank account, as it was when Clau and I lived in New York? We would be all kinds of screwed - Clau's salary wasn't enough to cover all the bills - we wouldn't have been able to make our mortgage payment (ironically to the same bank that couldn't hand our money to the FTP fast enough). All our family and friends would be receiving candy bars for Christmas gifts. Seriously - how can the CA FTB do that and get away with it? Particularly when everyone agrees that I ultimately should be receiving the money back?
So, that was bad enough: here comes the kicker. A week or so ago I get an email from one of our neighbors in our old apartment building in NY, saying that a FedEx package had come for me. Turns out that my employer had, after all, figured out quite a while ago that they had been paying me twice, and had been sending letters to my OLD address (despite my having updated my address in all applicable areas in my company) asking for the money back. The FedEx envelope contained a "final warning before collections" letter. And now, of course, the money is not there. F.M.L.
For those who might be concerned, it's all gonna work out OK. My company's payroll dept has been really nice about the whole thing, especially after confirming that they had, in fact, been sending the letters to the wrong address. I was also quick to point out that, had they sent the original notices to the correct address, or via email, or given me a phone call (I still have the same extension), they would have received the money. Now, they just have to wait. It has, however, cost me a lot of time, which fortunately I have an abundance of lately. More on that in subsequent posts.

Monday, October 19, 2009

CPAN Module

You may recall my earlier post complaining that Amazon has not created a Perl module to sign AWS REST queries, so I ended up writing my own. It was a good exercise for many reasons; writing your own module gives you a better overall understanding of how the whole process works, and of course helps much later on if you need to debug something. Also, I'm ashamed to say this, but I was never a big fan of OO programming before - generally if I wrote a module, it was going to export functions, because I was just used to my way of thinking (just write functions, export them, and use them with arguments when required). Since I'm not a trained developer, I saw no reason to force a paradigm shift upon myself. Writing a module, of course, forced me re-write my AWS code in an OO way, and now I see the light, or at least I see how for many things that's a better way to go.
Anyway, I wrote this thing a couple of months ago, and I figured it was only a matter of time until Amazon released an official mod to sign requests, but they never did. When I was in NY, Matt encouraged me to submit it to CPAN - if nothing else, it's a resume-builder, plus I'm so dependent on CPAN for everything, it would be nice to give something back. So, I cleaned it up, added a method to create SOAP signatures (since I figured that at least some people would want that), and submitted it to CPAN. Actually getting that module into CPAN, however, was a lot of work: besides creating an account, I had to submit an official request to have the module added, then I had to make sure it was stable and portable, plus I had to write it the "right" way and have it vetted by the CPAN testers. I had no idea it was so much work! But, at the end of the day, I got it in, and until Amazon decides to write their own, I guess I'm the official owner of the Net::Amazon::AWSSign mod. W00t!

Updates

First things first - the vacation was awesome, albeit brief. Clau and I spent as much time as we could enjoying New York, I went to California and Nevada and Clau went to Canada to visit Tatiz. Got to see Adrian, Dottie, and Alistair in Berkeley, then Ted and I went to Reno for two debaucherous days - I had a really, really bad day at the poker table, and although a little voice in my head kept saying "Just leave the table, already" I couldn't really let it go, since I only had two days there. So, not a good gambling time, but nonetheless we still had a great time. After that, went back to Oakland, spent a couple of days seeing Dad, Ania, Neil, and Cora, then back to NYC. Sam had a b-day party with a "white" theme - white clothes, white food, white sangria, white russians, white-themed music. Overall I'd say it was a tremendous success, and also an opportunity to see all the lawyers and other awesome folks that Sam and Matt are friends with. After that, saw our old neighbors in Chelsea and wandered around, then on Monday we flew back. Like I said, far too short, but very sweet. Matt and Sam were wonderful hosts, and hopefully it will be less than another year before we see them again.
Since we got back, I've been having some serious jet lag - can't seem to get my body back to Germany time. I haven't been able to get to sleep until 3am most nights, and waking up at 8 is a bit rough. Slept in till noon on Saturday before getting up to run errands, which in retrospect was probably a good thing, since we went out to Bootie Munich that night. We had a fantastic time, but I have to say the DJs and mashups were not as good as I had hoped. The DJs were all German, which meant that there were lots of mashups with bits of popular German songs, which I actually dug, but they seemed to all be keen on playing lots of recent stuff from German mashup artists. As Pete (the guy who turned me on to Bootie Munich) said "I've got nothing against the new stuff, but I also want to hear the good stuff."
On the work front, we recently had a bit of an organizational shake-up, and the new man in charge of my area (who I like and respect a lot) is doing a re-org, but is taking a little while to get a more detailed picture of what everybody does and how some other folks can better work together. So, right now we're in a holding pattern: no new projects, and since we didn't have anything we were currently working on, it means that we're all taking the time to do documentation and close loose ends.
In semi-related news, I authored my first CPAN module. For the sake of separation of tech- and life-related posts, I'll make that a separate post.

Wednesday, September 23, 2009

Busy week

One of Clau's friends visited us last weekend, we walked all over the friggin' place showing him Munich, and on Sunday we went to Oktoberfest. Wow, is that a lot of people and stuff, huuuuuge tents crammed shoulder-to-shoulder with drunk smoking Europeans. I can, however, make a few observations about Oktoberfest:

  • The Dirndl is a remarkably flattering item - seriously, just about every girl looks really good in them.
  • Oktoberfest beer is really, really tasty and also quite strong.
  • Extra-salty fried chicken is one of the best drunk foods ever.
  • Germans have a tremendous amount of songs that they bust out for Wiesn, and never listen to for the rest of the year. Certain songs, like "Country Roads" (yes, the one by John Denver) seem to never go out of style, whilst others may fade over time. The one that I keep hearing over and over is "So a schöener Tag" (a relative newcomer), which is very catchy the first ten or so times you hear it, but loses its charm over the course of the event. As far as I can tell it was a children's song that someone did a more pop-centric remake of, and is now played incessantly - seriously, if you spend more than an hour in a tent, you're going to hear it. Ditto for "Ein Prosit". But at least "Ein Prosit" is short.
Check it out:


You can stop once you hit about 1:45 because it's ALL THE SAME after that.

So anyway, what else this week: I started a German class on Monday - I have class 2x/week, so hopefully I will learn and practice - I still end up in situations where I understand absolutely NOTHING but I can occasionally have basic conversations. My ideal plan is to speak relatively well by the time we decide to leave (or one of our companies makes us an offer we can't refuse to move somewhere else). We'll see how that goes.
Yesterday I went to football match - it's generally fun to see FC Bayern, but they were playing some podunk team in a smaller division, and it was pretty sad. Still, glad I got to go since the FC Bayern games are generally sold out months in advance.
Today, another German lesson.
Tomorrow, TWO Oktoberfest dates - one for my work and one that we bought tickets for ages ago - not sure which one I'm going to go to - or, theoretically, I may end up trying to do both, which would probably be a VERY bad idea. But, knowing me, after a couple of Maß I might decide it's a good idea.
Friday we head to Madrid to see our friends Alexis and Luis, who are there on vacation. Yeah, we're totally busting in on someone else's vacation - that's how we roll.

And, of course, in early October it's off to NYC, Reno, Oakland, NYC, back home! Woohoo! Can't wait.

Tuesday, August 18, 2009

Amazon gripe

OK, let me start by saying that I'm a total Amazon fanboy, or to be more specific I'm a total AWS fanboy. They've got some great services out there (queue manager, SDB, S3, EC2) with excellent documentation, and they also have a _lot_ of functionality in their APIs for their store, along with pretty good documentation - my only complaint about the documentation is that sometimes it's pretty tough to find what you need.
Amongst many, many other APIs, AWS has an API to get info for a particular ASIN. Every item in Amazon has an ASIN, which is a unique identifier for that specific product. You can actually just enter it in the search bar if you want to find something quick and you happen to know its ASIN (like, for example, if you want to see the info for "Wang Dang Doodle" by Livin' Blues, just pop B000008652 into the Amazon search field).
Combine this with Musicbrainz's XML Webservice (which often has the ASIN for an album as part of its metadata) and a lot of elbow grease, and you theoretically have a relatively quick way to look up all those one-hit tracks that you ripped or downloaded 10 years ago, before people were concerned about tagging or filename conventions or any of those nuisances.
There are other uses, too; unless the album is quite rare (or the song was only released as a single, as often happens with older tracks), Amazon will probably have a decent-quality picture of the album art. I use iTunes for everything, and one irritating thing about iTunes for me is that when you use iTunes to rip a CD, then get the album art, the album art is stored in iTunes and not in the files themselves. So, if you migrate those albums somewhere else, or (as I have done once or twice), screw up something to the point where you have to delete your whole iTunes DB and rebuild it, the album art is gone. Unacceptable! I want my album art embedded in my files dammit!
So, anyway, I've written a lot of scripts to search and tag songs / albums based on what's available in Musicbrainz and / or Amazon. I've gotten past all the easy ones, and now I'm onto the really weird, hard stuff like Hoots Mon and am having to manually search Amazon / Wikipedia / whatever for just about everything.
Anyway, I digress (seriously!). The point is that I'm a huge fan of AWS, but I'll get to the gripe. AWS recently added a requirement that all queries to AWS be digitally signed with your AWS account secret. I received warning emails for about 2 months before they made the official switch, so I can't say I wasn't warned, although when I skimmed the emails I thought it was only for advertising calls, which makes sense (to prevent abuse).
Now, the process of signing a REST query isn't very difficult, but it's a really big pain in the ass; you have to deconstruct the query, add a timestamp, sanitize it, re-order it, build a hash from it and your secret, base64 the hash, add the hash to the arguments, and re-order it again. Not rocket science, but it still took me a good 2 hours to write subroutines to do it. Which makes me wonder - why on earth doesn't Amazon distribute modules for the main languages (Perl, PHP, Ruby, Java, maybe Python, and whatever the IIS folks are using nowadays), or at least C source or Java byte code to do this? Pretty much every developer who works against Amazon APIs has had to do the exact same thing that I have, and if Amazon changes the signing process, then all of us are going to need to re-write our code. That's ridiculous!
Anyway, I'm writing my own damn Perl module (already have the subroutines, just need to clean it up and make it OO), and if I end up having sufficient free time I'll submit it to CPAN. Even though my code will be crap, maybe someone will use it as a jumping point to make it better. But, I ask again, why the hell hasn't Amazon done this?

Friday, August 14, 2009

Combo locks

I had a few old Master combination locks lying around and decided to retrieve the combinations as described here. Being a geek, I wrote a script to help me keep track. Using this I was able to get all combos at less than 10 minutes per lock. Of course, it took me a good 20-30 minutes to write the script, but that was more fun than spinning a combination lock.
Also, this is far from an advanced shell script, but the nice thing about it is that it's quick, dirty, and easy. You can actually do a lot with bash very quickly once you get to know it, and one nice thing about bash vs. Perl is that it's really easy to get a gut feeling when bash isn't going to cut it and Perl is the way to go, for example when you need to parse a huge amount of data or do some really complicated regex work.
Anyway, if this helps you, then great, if not then at least it's documented somewhere...

[Edit: sorry if feed readers got this multiple times, I had to fix a couple of typos...]

##########START#############
#!/bin/bash

# Bash script to print out all likely combos for a master combo lock. Rough and ready but it works
# Written by Nate Aiman-Smith (http://staunchtech.blogspot.com). To be run as-is by a non-priviliged user.

## Variables
# One argument - the last number.
# See http://www.fusor.us/lockpick.html for a simple explanation on how to get it
thirdnum=$1

# File to keep track of tried combos. Replace with your preferred place if required
trackfile="/tmp/triednums_$thirdnum"

# Difference between first and second numbers that we'll print out - more than 24 is, in my very limited experience, unlikely.
# With more practice could probably get a better number.
fastdistance=24

## Functions

verify_nums() {
num=$mod
while [ $num -lt 40 ]
do
if [ $num=$thirdnum ]
then return 0
fi
num=`expr $num '+' 4`
done
return 1
}

print_valid_firstnums() {
num=$mod
while [ $num -lt 40 ]
do
echo -n "$num "
num=`expr $num '+' 4`
done
echo
}

print_combos() {
mod=`expr $firstnum '%' 4`
mod=`expr $mod '+' 2`
mod=`expr $mod '%' 4`
num=$mod
while [ $num -lt 40 ]
do
# Swap the two lines if you want to get the _unlikely_ combos...
if check_distance
#if ! check_distance
then echo "$firstnum $num $thirdnum"
fi
num=`expr $num '+' 4`
done
}

# To facilitate, let's try to stick to second numbers that are
# less than $fastdistance away from the first
check_distance() {
secondnum=$num
# Equal numbers always fail
if [ $secondnum -eq $firstnum ]
then return 1
elif [ $secondnum -lt $firstnum ]
then
secondnum=`expr $secondnum '+' 40`
fi
diff=`expr $secondnum '-' $firstnum`
if [ $diff -gt $fastdistance ]
then
return 1
fi
return 0
}

##Main

if [ ! $thirdnum -lt 40 ]
then
echo "invalid number"
exit 1
fi

if [ -f $trackfile ]
then
echo "Found tracking file $trackfile - hit ctrl-C, delete the file, and start over if you want to start fresh"
fi

mod=`expr $thirdnum '%' 4`
for valid in `print_valid_firstnums`
do
if ! grep "^$valid" $trackfile &> /dev/null
then
echo "Combinations for $valid:"
firstnum=$valid
print_combos
echo "Press return when done, hit ctrl-C if you bail"
read blankline
echo $valid >> $trackfile
fi
done
############END################