Archive

Archive for February, 2009

The Straight-Through-In-Alpha-Order-Music-Listening Experiment Update, Volume 4

February 26th, 2009 View Comments

Well it is nearly the end of February so it must be time to provide an update on the music experiment I’m running.  Yes, I’m still running it.

Here’s where we stand now:
dream theater images and words cover art

  • Current Artist – Album – Song:  Dream Theater – Images and Words – Metropolis, Pt. 1: The Miracle and the Sleeper
  • Songs listened to:  2055
  • Total songs:  9544
  • Percentage complete:  21.53%
  • Estimated completion:  May 2010

Well, May 2010 is still a long ways off, but it is much closer than October.  Apparently I’ve picked up the pace a bit.  Also, I removed some more songs that inadvertently had found their way into my playlist from my wife’s playlist.  I mean – Faith Hill – seriously?!  Nah, that’s my wife’s stuff.

This month has been pretty awesome so far – Dokken and Dream Theater in particular have been very awesome, and Dishwalla was a good surprise – that was a band I had in there on recommendation from someone else, and I hadn’t really listened to them before.  Listening to all of Dragonforce was also interesting, although I have to admit that stuff can make you feel tired just listening to it.  Also I started a contest on Facebook for people to try to guess the next band.  This has been interesting, mostly due to the large volume of people who don’t seem to understand alphabetical order (“Hmm, he’s listening to Dokken – my guess for the next band is… Abba!”) or who don’t seem to understand me (“My guess is… Barry Manilow.”).  Nobody has actually won yet – even when I gave a totally obvious hint on my last “Essential Albums” post.  Still, the contest continues.  The winner will get a very excellent SuperPoke and notoriety beyond their wildest dreams, so I’m sure this contest is only going to get more and more popular.

We should be to the E’s pretty soon, and with a bit of luck we could possibly finish the E’s before the next update.  The E’s are looking a bit sparse, but there’s some ELO, a good sampling of Eric Johnson, and a smattering of Enya in there which should make it a good listen.  Yes, Enya.  I like Enya.  Sorry to disappoint.

(See?  Did you see the other totally obvious hints?  Did you see that guessing any band starting with F before April is probably not a smart strategy?  Did you see that guessing “Extreme” right now is probably not the best strategy either, since it comes at the end of the E’s and I already named three bands before that one?  I’m just sayin’.)

Image credit: amazon.com
Categories: Music Tags:

A Fake Business Proposition by Synergy

February 21st, 2009 View Comments

It’s been a long time since I had a confrontation with the Synergy wackos who pretend to conduct a legitimate business next door to us Mozy people.  But in alternate-reality land, anything is possible.

So, needing adventure and excitement in my life, I ventured into alternate-reality land.  And if you’re working at Mozy, on the first floor, in alternate-reality land, going to the restroom is always a tricky proposition because the Synergys are out there.  But I couldn’t wiat any longer so I ventured out.

No sooner had I left the safety of our office space when I was assaulted by an eager Synergist.

Synergist:  ”Hey!  Have you got a second for me to talk with you about a fantastic new business opportunity?”

Me:  ”Uh, I really have to go to the bathroom, in case you couldn’t tell.  See, here I am, walking into the bathroom.

Synergist:  ”Oh!  Okay, I’ll wait for you!”

Me:  ”Don’t bother.”  But perhaps he didn’t hear me say this because the door was closing behind me.

I took my seat, then pulled out my phone and started playing games.  I figured I’d outlast him.  When my battery died I stood up, waited for the pins to subside, then walked out.  He was waiting right outside the door.

There’s only one way to deal with these guys, I thought.

Actually, that’s a lie.  There’s a lot of ways to deal with them.  Firearms work, although that’s technically illegal.  Mixed martial arts works well also.  If you are fluent in an obscure foreign language, you can also refuse to reply to them in any other language other than the foreign language, in hopes that they come to believe that you don’t speak English.

Well, I wouldn’t actually take another person’s life, even in alternate-reality land, even if that person is an MLMer.  I love MMA but don’t actually know any sweet moves.  And unfortunately I already replied to the guy in English, so he knows I speak English.

At this point my only hope is to predict his sales tactic and thwart it.  Fortunately, these guys are predictable.  They will try to use the “get the customer saying ‘Yes’” tactic.  So I just have to say “No,” even if I have to lie to do it.

Synergist:  ”Listen.  Would you like to have more money, more freedom, and more time to spend with your family?”

Me:  ”No.”

Synergist:  ”That what I … uh, what?”

Me:  ”I have so much money, I really don’t want any more.  I already have way too much.  I keep trying to give it way, but I earn it so fast that I can’t give it away fast enough.  The last thing I want is more money.  As for freedom, I hate freedom.  Too much pressure.  What I wouldn’t give for someone telling me what to do, say, and think all the time.  Me having to choose for myself is really bringing me down.  And more time with my family?  Give me a break!  I can’t stand my family!  Even thinking about my family is starting to make me sick to my stomach.”

Synergist:  ”Uh.  Hm.  Huh.”

Me:  ”Yeah, I don’t think you can help me.”

Categories: Humor Tags: ,

The Joke That Is NASCAR

February 20th, 2009 View Comments

The Daytona 500 took place this past weekend, at least most of it.  I generally watch the Daytona 500 each year, and maybe the Talladega 500.  That’s about all the NASCAR I can stand each year.  This is an odd thing for someone like me who is really into racing in general.

This is worth exploring.

NASCAR stands for National Association for Stock Car Auto Racing.  The key word in there is “stock.”  Originally, stock car racing was about cars that resembled something you could actually buy at a car dealership.  Manufacturers would presumably compete, in part to make their cars better, and in part to encourage sales (the old “what wins on Sunday sells on Monday” adage).

Consider, this same formula is used within other professional racing series, like AMA Motocross and Supercross, and World Superbike.  True, those bikes are modified forms of stock, but at least there is a resemblance to something I can buy.  Yamaha can’t run EFI on James Stewart’s YZ450F, and the only reason is because they don’t sell a fuel injected YZ450F.  And in series like AMA Superstock, the bikes are bone-stock.

Of course, there’s another way this can work.  You can ignore stock altogether and race pure racing prototypes.  This is the method used by Formula One and MotoGP, which is also awesome.

What is not awesome is what NASCAR does – pretend their cars are stock when they are not.  This started some 20 or 25 years ago.  I don’t know if it was the first one, but I remember wondering how Ford could race their Ford Taurus in NASCAR when it was a front-wheel-drive V6, but NASCAR races 350ci V8 engines driving the rear wheels.  Of course it started long before this, where teams were building their own cars in their own shops instead of starting off by acquiring a stock version and building from that.

Now, they are racing the Car of the Future, whatever that is.  So what you have out there are Fords, Chevys, Dodges, and Toyotas that all have the same body style.  Even the front grilles are the same on each car, the only thing different being the stickers that are made to look like front grilles.

Since they have run out of ways to mess up the car, they’ve started trying to mess up the program.  Last week’s race had at least one hour of preliminary garbage before the race actually began, including:

  • Interviews with every single driver and crew chief
  • A detailed explanation of the sport, the cars, the rules, etc.
  • A country music concert
  • Some famous person singing the national anthem
  • A prayer, wherein an appeal was made so that all the participants would compete safely, despite the fact that they were participating of their own free will in a dangerous sport on a Sunday instead of going to church
  • About twenty parade laps

Hey, I’m totally fine with the national anthem, and I’m a religious person so I guess I’m okay with the prayer also, although I think God has much bigger things to worry about than a NASCAR race.  But I think we could skip a lot of that stuff and just get to the race already.

But then I find out they are planning to have a “competition yellow” around lap 25, whatever that means.  It’s bad enough that they throw a caution flag anytime they have the slightest inkling that there might possibly be a hint of something unsafe on the track.  Now they are throwing yellow flags for no reason?  And then, they end the race early, because it rains?

What is going on here?  I mean, we’re treating these guys like NFL quarterbacks!

In Formula One, for example, they don’t have four hours to figure out how to win – they have somewhere between 90 and 120 minutes.  If it rains, they run anyway.  If there is oil on the track, they run anyway.  The best car wins – not the one that just so happens to be able to slingshot to the lead on the back straight on the last lap.  And the drivers need to know how to turn right as well as left.

And a fat slob like Tony Stewart in F1?  Please – he’d pass out from exhaustion after one lap.

Now the Daytona Motorsports Group is going to manage AMA Racing.  Considering what they’ve done with NASCAR, I can hardly wait to see how they ruin the AMA.

Categories: Sports Tags: , ,

Essential Albums: Dream Theater “Six Degrees of Inner Turbulence”

February 17th, 2009 View Comments

six degrees of inner turbulence coverArtist:  Dream Theater
Album:  Six Degrees of Inner Turbulence
Best Song You’ve Probably Heard:  Yeah, right.
Best Song You Might Not Have Heard:  Blind Faith

One day some twelve years ago or so, I was at work discussing one of my favorite bands, Queensrÿche, with a co-worker of mine.  He suggested Dream Theater, the absolute kings of progressive metal.  Well, I didn’t know that then.  But I tried them out, bought a couple of albums, and found a new favorite band.

Then I kind of stopped following them for some unknown reason.  It was around this time that “Six Degrees” came out.  Eventually I bought it, because it was a Dream Theater album.  But I never really listened to it much.

Thus it went for a number of years, until one day at work when I created an “All Dream Theater” playlist and started listening to it.  These really, really amazing songs kept coming up that I realized I hadn’t heard.  After checking I realized that they were coming off of “Six Degrees.”

“Six Degrees of Inner Turbulence” is two discs of pure awesome.  The title track occupies one entire disc in eight movements.  It’s pretty good stuff, very technical pure Dream Theater.  But the best stuff is on the other disc.  It is absolutely incredible.

I said “Yeah, right” on the “Best Song You’ve Probably Heard” item above because, in all honesty, either you’ve heard the whole album because you own it, or you haven’t heard any of it.  There’s a lot of great songs, but “Blind Faith” is my favorite.  In a band full of amazing talent, Mike Portnoy might be the most talented at his position of them all.  In fact, he might be the best drummer around today, really.  And “Blind Faith” is a fantastic showcase for Mike’s drumming ability.

If you’re looking for a new band to expand your horizons, try Dream Theater.  ”Six Degrees” is a good place to start.  Give it a listen, then again, and again.  My bet is after three times through you’ll be completely and hopelessly hooked.

Categories: Music Tags: ,

Popping Threadsafe Containers

February 17th, 2009 View Comments

After spending a bit of time last week dealing with thread safety issues and a queue in C++, it only seems appropriate to blog a bit about it.  (Obviously, the information below would also apply to a stack or probably any other container type.)

Suppose you have a very common multiprocessing scenario:  two threads, one of which is producing work to be done, and another which is consuming the work to be done and performing the work.  You can accomplish this in a pretty straightforward fashion with:

  • A queue
  • Mutexes to prevent concurrent queue access
  • A condition variable to tell the consumer when there is work to do

Originally I thought about creating my own container class for this.  Then part of my brain resisted.  “Quiet, engineering part of Matt’s brain!” it exclaimed.  “You’re just trying to do that because it seems Interesting!”  So I shut down that idea and pushed on trying to use a standard STL queue.  However, after I had to deal with some concurrency issues over and over, I realized that, at least this time, the engineering part of my brain was right.

So I set out to create a threadsafe queue.  The idea was that it would feel a lot like an STL queue, and would implement thread safety under the covers for you – so, for example, a simple call to q.empty() would automatically lock the mutex for you, see if the underlying queue was empty, then unlock and return the result.  So, essentially an STL queue wrapper class with automatic mutex locking, right?  It should be easy!

Well, you’d think so, until you get to an implementation of pop().

To see why this matters, first we should establish what we expect out of a threadsafe queue in C++:

  • It should feel like an STL queue.  This means that it should have similar semantics and API if possible, and also, it should be a template.
  • You get out what you put in.  Not a handle to what you put in; exactly what you put in is what you get out.
  • Thread safety should be handled automatically – the user shouldn’t have to deal with thread safety.

An STL queue “pop()” isn’t as simple as it sounds.  The concept of “pop” is actually performed like this:

    std::queue q;
    ...
    if (! q.empty()) {
        int v = q.front();
        q.pop();
    }

Popping an empty queue has strange consequences; in fact, on my machine, it segfaults.  You’d think the queue would be resilient to that behavior but it isn’t.  Also, you have to get the item off the front in a separate operation from actually removing the item.  This is so you can store anything in the queue – pointers, reference objects, etc. – and obtain the item in the front of the queue and know it will survive long enough for you to do something with it.  You pop() the queue after you are finished with the item.

That’s all fine but it makes our threadsafe queue a bit of a problem.  Suppose we decide to follow strictly the STL queue API.  In that case, we’d perform an “if not q.empty(), then q.front() and q.pop()” dance.  We have to assume that each of those three actions is legal on its own though, and we surely can’t release the lock after each one.  So that would mean that the user has to obtain a lock on their own, to be used outside of the whole three-step dance, which breaks one of our rules, namely, that the user shouldn’t have to deal with thread safety.

Okay, so what if we abandon the need for strict adherence to the STL queue semantics, and instead just implement a pop() method that does everything?  Now we can hide the thread safety management from the user.  But now we have a different problem.  How do we know whether the value we get back from pop() is a legal value?  How do we know whether it came from the queue or whether the queue was empty and there was nothing to pop()?  We need some way to check to see whether the value coming back is valid, i.e., whether there was something in the queue to pop beforehand.

There’s a couple of ways to do this, but none I like.

  • If the return value were a pointer (or an iterator), we could check for NULL (or end()).  However, we don’t necessarily know that.  If the class is a template, and if we always get back what we put in, we can’t know whether the return value is a pointer or a value or a reference.  True, we could cast the return value to a pointer type – but then, not only are we not returning what we put in, but we are getting into a rather scary situation where the user is required to massage the data before it can be used properly.  And we lose type safety.
  • We could return a std::pair<bool, t> where t is the type used to populate the queue.  Not as scary as the casting solution before, but still with the problem where the user has to massage the data, and the return value isn’t strictly what was put in (although it is contained in the pair).
  • We could throw an exception if the container is empty, but an empty container isn’t exactly an exceptional case and is probably not a good ethical candidate for throwing an exception.
  • We could stop using the STL queue and create our own queue with more reasonable semantics.  However, although I’m not necessarily in love with the STL queue, I’m also not convinced I can do it better, at least not convinced enough that I want to spend the time to do something that already exists.
  • We could do away with making the wrapper class a template and instead make it implementation-specific.

Since I don’t know for sure that I will need my threadsafe queue for anything other than a very specific data type I have in mind right now, I chose the last option.  This is the agile way – I’ll meet today’s requirements today, and trust that I can refactor the code to meet future requirements when they show up.

So now everything works great, except doing the wait on the condition variable, which normally looks something like this:

    mutex m;
    condvar cv;
    m.lock();
    if (q.empty()) cv.wait(m);
    v = q.pop();

Yeah, here I am, managing thread safety outside of the queue again.  I really should put this into my threadsafe queue also; except I would need a method something like waitThenDo(action) where action is a function pointer or some other callable.  I hate how that makes my code look though.  And at this point, with the waiting done as shown above (roughly), my code is working, so I’ve stopped caring.

But if you have a great solution to this problem, I’d love to hear it.

Categories: Technology Tags: ,

Defining My Own Self

February 10th, 2009 View Comments

We spent last weekend in Roosevelt, where I grew up, and where my family still lives.  For example, my brother lives there.  He can live there and enjoy it, because he is a cool person.  He was cool in high school.  He was cool growing up.  He has this aura of coolness about him, bestowed upon him by the Rooseveltians.  Thus, he can live in Roosevelt his whole life and be the person he wishes to be – because of his coolness, the Rooseveltians have granted him this right.

So, we went there to visit.  It was a good visit.  My brother has a pretty awesome home theater in his house, because he is coolness.  So I took my Queensrÿche Operation:Livecrime DVD with me on the trip, and we rocked that puppy.  Yeah, that was very much how I remember it, having experienced it myself during the Promised Land tour in 1995, I think, which was my first ever concert, and basically spoiled me for life.  It seems to me that they played Mindcrime all the way through start to finish and it was beyond incredible.

So now, I have the DVD, and I can experience a watered-down version of it myself, on my low-def TV at home with crappy speakers, or on my car’s awesome stereo with no video.  Or I can experience it again at my brother’s house, which was Awesome.

Going home to visit is often interesting.  My wife and I usually end up having some sort of conversation on the way back on the topic of Under What Conditions Might We Consider Moving To Roosevelt.  See, since she gets along well with my brother’s wife, and I get along well with my brother, it might be fun, right?  So, for example, maybe we would consider it!  If I was independently wealthy, because I wouldn’t be able to get a decent job there in my profession.  And if we could afford to come to the Wasatch Front every so often, because, you know, sushi.  No sushi in Roosevelt – they have not heard of this yet.  Oh, and the weather.  And nothing to do.

But seriously, I’ve never felt comfortable about this.  And I think I finally figured out why.  It has to do with the gifts of the Rooseveltians, or lack thereof.  They bestowed the gift of coolness upon my brother.  Now he can be whomever he likes.  As for me, contrariwise, well, they never bestowed this gift upon me.  There is a certain persona I’m required to fill by the Rooseveltians, which I really don’t like.  I realized after I left that place that I didn’t like that person, the person they convinced me I was when I lived there.

That’s why I don’t want to move back. I don’t tolerate other people telling me what or who I am anymore. I define myself.