Gapless Playback + Scrobbling = <3
So, I listen to music a lot. And I listen to a lot of music. A couple of my favorite artists track for gapless playback (two albums I'm queuing up right now include Colors by Between the Buried and Me and The Incident by Porcupine Tree). I got fed up trying to find a media player for Linux (I have CentOS at work) that doesn't suck majorly at everything, and I really would like to scrobble what I listen to.
If you read my blog (haha), you'll have noticed a previous post about mplayer. I went out and googled, and came up with the following.
You'll want to get http://www.update.uu.se/~zrajm/programs/mplayer-lastfm/mplayer-lastfm-0.2.2 (if it disappears, send me an email). This is a perl script that parses mplayer output and scrobbles it to last.fm. It requires Digest::MD5 and LWP::UserAgent. In addition to obviously needing mplayer, you'll also need taginfo from http://grecni.com/software/taginfo/taginfo-1.2.tar.bz2 (which in turn needs taglib).
After this, create an .mplayer-lastfmrc file containing the lines:
user = [your username]
pass = [your password]
Once you've done this, follow these helpful steps (from http://snipplr.com/view/18353/gapless-playback-for-mplayer-linux/):
mkfifo aufifo
aplay -t raw -c 2 -f S16_LE -r 44100 aufifo &> /tmp/aplayfifo.log &
After that, simply run:
./mplayer-lastfm-0.2.2 -ao pcm:nowaveheader:file=aufifo path/to/*.mp3
Once mplayer-lastfm quits, though, you'll have to re-create your fifo. Perhaps I'll make a script for that. :)
Enjoy!
--dho
Friday, October 23, 2009
Tuesday, June 23, 2009
[Insert Title Here]
[Insert Section 1 Header Here]
So, here I am, blogging. It's been another couple months (and nobody reads this thing anyway, so I don't know why I even bother) and I've not updated. Things have been rather interesting recently. Perhaps the most shocking of happenings is that the tires and alloy rims were stolen from Alicia's 2008 Honda Fit right outside our apartment while we slept. This has me rather upset, because we moved into this complex thinking that it was a nice area. Since we've moved in, the following events have taken place:
My uncle has invited us on a trip to Austria with him in September. I'm looking forward to the possibility of that. I've considered visiting Holland, but I don't think that's happening anytime soon. The novelty of it has died at this point; it's impractical to go as often as I have wanted to go (and thus I've only been able to make it there once since I left), and my Dutch is so poor now that I doubt anybody would speak to me in Dutch anyway. I honestly spent about 30 minutes writing Margriet a rather short paragraph on the Loesje card I emailed for her birthday last month.
Anyway: Austria. I've been there before, but this was literally about 15 years ago (I can't believe how long ago things are getting...) and I remember very little other than it was in general a rather good time. It's a beautiful place, from what I recall, with some rather amazing history.
Work's going well. Not much new on that front.
Plan 9 Google Summer of Code is going well. I'm doing a lot more organizational / administrative work than I initially anticipated doing, but it's been vital.
[Insert Section 2 Header Here]
Not much new elsewhere. The music front has been relatively static. I'm listening to Marilyn Manson right now (old shit: Cake and Sodomy); next on the queue is Porcupine Tree, and then perhaps some Tool before I head home.
We have been working out quite a bit. I'm trying to lose the gut that I seem to have put on since I moved here (being able to afford a lot of delicious food isn't such a good thing for me, apparently... perhaps I should request a salary decrease? ;). In fact, I apparently weigh around 190 pounds right now, which is absolutely ridiculous. I remember being 160-ish and looking rather in-shape. (In fact, there's a picture on my Facebook page illustrating just that).
I've been doing mostly nautilus weights, doing a couple reps of 21s for my biceps, but not noticing much difference. Putting on the weight is a lot easier than getting it off, unfortunately.
Feeling somewhat uninspired at the moment, so I'll just end this posting before I end up rambling. I've got more work to do anyway.
So, here I am, blogging. It's been another couple months (and nobody reads this thing anyway, so I don't know why I even bother) and I've not updated. Things have been rather interesting recently. Perhaps the most shocking of happenings is that the tires and alloy rims were stolen from Alicia's 2008 Honda Fit right outside our apartment while we slept. This has me rather upset, because we moved into this complex thinking that it was a nice area. Since we've moved in, the following events have taken place:
- I called the police after witnessing a man punch his girlfriend in the face several times and push her down a hill.
- Alicia's tires and rims were stolen (this is going to end up costing us around $700).
- I was solicited this morning for money in our parking lot.
- I've been solicited at the door multiple times for various products or services. (Not to mention the ridiculous number of pamphlet solicitations I've received that do nothing but increase U.S. paper consumption numbers.)
- Our washing machine broke. We called once, it was ``fixed.'' It was still broken. We called again, and it was ``fixed.'' It was still broken. The third time we called, they replaced it.
- We've had a similar experience with our HVAC, which seems to be leaking freon or something because it craps out a day after they fix it, without fail.
- We're on the 3rd floor with a (usually) very clean apartment, and we still get ants.
My uncle has invited us on a trip to Austria with him in September. I'm looking forward to the possibility of that. I've considered visiting Holland, but I don't think that's happening anytime soon. The novelty of it has died at this point; it's impractical to go as often as I have wanted to go (and thus I've only been able to make it there once since I left), and my Dutch is so poor now that I doubt anybody would speak to me in Dutch anyway. I honestly spent about 30 minutes writing Margriet a rather short paragraph on the Loesje card I emailed for her birthday last month.
Anyway: Austria. I've been there before, but this was literally about 15 years ago (I can't believe how long ago things are getting...) and I remember very little other than it was in general a rather good time. It's a beautiful place, from what I recall, with some rather amazing history.
Work's going well. Not much new on that front.
Plan 9 Google Summer of Code is going well. I'm doing a lot more organizational / administrative work than I initially anticipated doing, but it's been vital.
[Insert Section 2 Header Here]
Not much new elsewhere. The music front has been relatively static. I'm listening to Marilyn Manson right now (old shit: Cake and Sodomy); next on the queue is Porcupine Tree, and then perhaps some Tool before I head home.
We have been working out quite a bit. I'm trying to lose the gut that I seem to have put on since I moved here (being able to afford a lot of delicious food isn't such a good thing for me, apparently... perhaps I should request a salary decrease? ;). In fact, I apparently weigh around 190 pounds right now, which is absolutely ridiculous. I remember being 160-ish and looking rather in-shape. (In fact, there's a picture on my Facebook page illustrating just that).
I've been doing mostly nautilus weights, doing a couple reps of 21s for my biceps, but not noticing much difference. Putting on the weight is a lot easier than getting it off, unfortunately.
Feeling somewhat uninspired at the moment, so I'll just end this posting before I end up rambling. I've got more work to do anyway.
Labels:
happenings,
holland,
music,
whatever,
work,
working out
Monday, April 13, 2009
Updates and such.
Intro
I wanted to continue updating my 9vx.org blog, but I seem to have screwed up the lighttpd configuration, and I don't really feel like figuring out what's wrong with it. I'm really just more interested in getting a blog out, since I haven't done this in quite some time now (not that it really matters much, since nobody reads this damn thing).
Currently listening to a bunch of music out of my nostalgic Holland days. It gets me thinking quite a bit about the ``back then.'' 'Twas quite the fun, care-free time. It also seems like it was forever ago. I've been back in the US for almost 4 years now, which seems like quite a long time. My Dutch has become somewhat poor -- I can still type it, but my pronunciation is extremely poor, I've forgotten the gender of most nouns (which consequently has screwed up my grammar quite a bit), and I really have no way to practice it. It saddens me a bit; I really don't have anything else from that time to hold on to, except perhaps the music. Listening to Air, right now, which is right out of that `era.'
Work
So here I am at work (not really slacking off, configuring a virtual machine to do some work, that's running in the background, and I've been here since about 8 AM). It's a fun job, and I've got a rather interesting role (at the moment). Currently, I work as a sort of intermediate between the front- and back- ends of our product, which is an enterprise SMTP server (it rocks, by the way -- my VMware instances can easily push around 3 million mails per hour in testing on a single node). The front end serves largely as a convenience for viewing metrics and configuring the system.
Since we've just released a new version of the product, Delivery Manager 3.0, I've spent a ton of hours fixing bugs, testing stuff, and adding new features (working both Saturday and Sunday for the past couple weekends -- I think I put in around 60 hours last week, if not more). One of the coolest things we've added to the product is a web user interface for creating policies and rules for alerts. This is implemented as an AJAX interface to a back-end that generates code in Lua. I could continue to explain how it works, but a picture is worth a thousand words:

Very cool stuff. I don't do the interface -- I'm really not that person. My part in this was designing the interface between the front- and back-end (a.k.a. ``architecting''), and implementing the back-end handlers for loading and saving scripts. It's a very powerful interface, and very minimal as well. I'm really pleased with how it turned out. It's looking like I'll be working on more of the back-back-end stuff (i.e. the core product) sometime soon, which will transition me into working primarily in C (as opposed to primarily PHP with a bit of C).
Today, I'm working on some bugs in the web console for the 2.2 maintenance release we've got coming up in the next week (or whenever that's actually supposed to hit the market).
Home
Home life is well. Alicia and I have a kitten (whose official name, I think, is just ``purr'', but I prefer to use ``Sir Purrgelot'' as his full name) -- he's quite the little terror, though if traumatized enough, he turns into a softie. We took him with us in the car up to New York this weekend; he slept in my lap all the way up, and all the way back. I don't think he likes the car much.
We've got a ton of DVDs. (Or what I consider to be a ton, anyway.) We've got 2 DVD shelves that claim to be able to hold 88 DVDs per shelf, and they're both filled. We're going to get 2 more this week.
As if travelling up to New York for Easter weekend wasn't enough, this weekend we will be travelling to Virginia Beach for a vacation weekend (my penance for throwing a huge party that probably got way out of hand a couple weeks ago). Looking forward to that; it'll be nice to relax. Hopefully the beach weather is nice, but I'm guessing the water will be too cold to really enjoy.
Plan 9
My bad habit. I'm serving as a mentor for this year's Google Summer of Code for Plan 9. It's looking like we'll get 7 students this year; I'm hoping that we'll pull in the project that I want to mentor, which would get Plan 9 NAT support and a stateful packet classifier (and thus a modern firewall as well). Definitely looking forward to that. It's a fun endeavor.
The strangest thing for me serving as a mentor for a student is that I never went to college. All the knowledge I have about these things is self-taught (or learned from others out of my own interest and pursuit). This year, I'd have a masters student. He's a bright guy, so I don't expect I'll need to do all that much outside of motivation and answering the occasional question about best practices and architecture.
Outro
I suppose that's about it for now. The VM is finally installed and configured, and I should really focus on getting these bugs squashed, as opposed to working on this blog post any more. Thanks for reading.
I wanted to continue updating my 9vx.org blog, but I seem to have screwed up the lighttpd configuration, and I don't really feel like figuring out what's wrong with it. I'm really just more interested in getting a blog out, since I haven't done this in quite some time now (not that it really matters much, since nobody reads this damn thing).
Currently listening to a bunch of music out of my nostalgic Holland days. It gets me thinking quite a bit about the ``back then.'' 'Twas quite the fun, care-free time. It also seems like it was forever ago. I've been back in the US for almost 4 years now, which seems like quite a long time. My Dutch has become somewhat poor -- I can still type it, but my pronunciation is extremely poor, I've forgotten the gender of most nouns (which consequently has screwed up my grammar quite a bit), and I really have no way to practice it. It saddens me a bit; I really don't have anything else from that time to hold on to, except perhaps the music. Listening to Air, right now, which is right out of that `era.'
Work
So here I am at work (not really slacking off, configuring a virtual machine to do some work, that's running in the background, and I've been here since about 8 AM). It's a fun job, and I've got a rather interesting role (at the moment). Currently, I work as a sort of intermediate between the front- and back- ends of our product, which is an enterprise SMTP server (it rocks, by the way -- my VMware instances can easily push around 3 million mails per hour in testing on a single node). The front end serves largely as a convenience for viewing metrics and configuring the system.
Since we've just released a new version of the product, Delivery Manager 3.0, I've spent a ton of hours fixing bugs, testing stuff, and adding new features (working both Saturday and Sunday for the past couple weekends -- I think I put in around 60 hours last week, if not more). One of the coolest things we've added to the product is a web user interface for creating policies and rules for alerts. This is implemented as an AJAX interface to a back-end that generates code in Lua. I could continue to explain how it works, but a picture is worth a thousand words:

Very cool stuff. I don't do the interface -- I'm really not that person. My part in this was designing the interface between the front- and back-end (a.k.a. ``architecting''), and implementing the back-end handlers for loading and saving scripts. It's a very powerful interface, and very minimal as well. I'm really pleased with how it turned out. It's looking like I'll be working on more of the back-back-end stuff (i.e. the core product) sometime soon, which will transition me into working primarily in C (as opposed to primarily PHP with a bit of C).
Today, I'm working on some bugs in the web console for the 2.2 maintenance release we've got coming up in the next week (or whenever that's actually supposed to hit the market).
Home
Home life is well. Alicia and I have a kitten (whose official name, I think, is just ``purr'', but I prefer to use ``Sir Purrgelot'' as his full name) -- he's quite the little terror, though if traumatized enough, he turns into a softie. We took him with us in the car up to New York this weekend; he slept in my lap all the way up, and all the way back. I don't think he likes the car much.
We've got a ton of DVDs. (Or what I consider to be a ton, anyway.) We've got 2 DVD shelves that claim to be able to hold 88 DVDs per shelf, and they're both filled. We're going to get 2 more this week.
As if travelling up to New York for Easter weekend wasn't enough, this weekend we will be travelling to Virginia Beach for a vacation weekend (my penance for throwing a huge party that probably got way out of hand a couple weeks ago). Looking forward to that; it'll be nice to relax. Hopefully the beach weather is nice, but I'm guessing the water will be too cold to really enjoy.
Plan 9
My bad habit. I'm serving as a mentor for this year's Google Summer of Code for Plan 9. It's looking like we'll get 7 students this year; I'm hoping that we'll pull in the project that I want to mentor, which would get Plan 9 NAT support and a stateful packet classifier (and thus a modern firewall as well). Definitely looking forward to that. It's a fun endeavor.
The strangest thing for me serving as a mentor for a student is that I never went to college. All the knowledge I have about these things is self-taught (or learned from others out of my own interest and pursuit). This year, I'd have a masters student. He's a bright guy, so I don't expect I'll need to do all that much outside of motivation and answering the occasional question about best practices and architecture.
Outro
I suppose that's about it for now. The VM is finally installed and configured, and I should really focus on getting these bugs squashed, as opposed to working on this blog post any more. Thanks for reading.
Monday, December 29, 2008
Technical Posts
Though I've typically used this blog for technical posts, those will be moving to http://konijntje.9vx.org/blog/ -- please refer there for more technical posts. This blog will become more of a personal reflections area, though who knows how often I'll update it.
--dho
--dho
Tuesday, November 4, 2008
Why Obama's Tax Plan is Superior: Politics and Socioeconomics
I wrote this essay in hopes that I could illustrate my view on why Obama's tax plan is superior to McCain's, and why McCain's plan is devilishly appealing, although nobody below the $603,000 income bracket can deny Obama's plan affects them terribly negatively.
This is a collection of responses / comments on a portion of a note posted by of one of my friends. His note states:
This struck me, and I decided that I would try to figure out why a family earning $250,000 per year would be more apt to vote for a McCain plan than an Obama plan that would barely affect them (increasing their tax by an average of $12 per year). It turns out that American fiscal responsibility is complete shit. This family cannot possibly afford 3 houses on that income. Perhaps if they lived in Kansas -- but this seems to be in the Newport News, VA area.
The crux is, our socioeconomic model of the past 20 years has been one pushing towards lending and spending. So it appears this family can afford the houses and their lifestyle... but they really can't. Let me break this down for you; here is my spliced together series of comments on Shane's note (edited to fix a couple of consistency errors I amended and noted in later notes -- those amendment notices are also removed):
------
Hey, Shane. I decided to look up some of this stuff on income tax levels. Your friend whose family has a $250,000 income -- assuming they filed a married joint income tax return, their monthly income would be $15,691.66.
That isn't quite right, because we don't figure in state taxes. For Virginia, it seems that number is $15,095/year. This brings monthly income down to $14433.75. I'm assuming they also have a family insurance policy. The monthly rate for a family insurance policy from my provider is $949. That takes the monthly income to $13,484.75. Factor in Social Security and Medicare taxes, which end up being $1,593.75 a month, and this number is down to $11,891. Now we're not factoring in ANY savings yet, so say we want to put away $500/mo into a company matched 401(k) for retirement (this is a ridiculously small number for someone with that income and is less than the amount I will be contributing monthly on $80,000.) Down to $11,391. There's not enough to contribute 10% monthly income to any other form of savings, but I think a family with 3 houses would know that savings other than a 401(k) are vital (the current economic situation proves that). Say we put away $300/mo into a high yield savings account. We're at $11,091. This number is probably about accurate because, while they may have more deductions, they also likely have more taxable assets. We'll assume for their sake that the number is low, and give them $11,591 a month, for $500 in credits -- that's $6,000/yr in tax credit.
Well, now we know they have $10,000 in bills on the three houses they own (for fairness' sake, I'm going to assume this includes gas / electric / water / garbage / other household-related bills). This brings their family monthly income down to $1,591. Assuming a 3-person family, that apportions $530/mo per individual for everything else. This includes food, transportation, and fun.
Assuming they own their cars and have no other payments, and assuming they have reasonably fuel-efficient vehicles, and assuming they have an average commute to work each day -- average commute is about 25 minutes. We'll equate that to 25 miles, since it's about the same given standard gas mileages for city/highway use. That's 50 miles a day -- we'll assume a tank a week with additional driving adding an additional 100 miles or so. Say they can do that on a 10 gallon tank. Currently, that's costing about $26/week, for about $104/mo per vehicle. Down to $1,383/mo.
Food is expensive. For myself, I can go through about $100 in food a week. A family of three gets to consolidate a bit better because they're going to be planning their meals, so say they spend 3/4 as much as I do on food -- that's going to be about $300 a month. Down to $1,083/mo.
Leisure costs add up. You don't realize it, but impulse buys really, really add up. Spending $1.50 on the candy bar, going out to the movies a couple times a month, going out to eat every 2 weeks, buying the new bestseller... these costs add up. I give myself about $400/mo for this; let's be conservative and say they spend $200/mo per person on leisure costs. Down to $483/mo.
I'll be nice and say their credit cards are only costing them about $200/mo. $283 left over.
Stuff comes up. School field trip for the kid (or books or mom send money if the kid's in college), you end up with a little money for last minute stuff that comes up here and there. Honestly, for me, that can end up being anywhere from $100 to $600 in a given month (car needs fixing, oil changes, that kind of stuff). We'll hope theirs averages $100/mo, and they put the rest in an accessible savings fund for the months that this last minute expense adds up to more.
And that, my friend, is how a family living on $250,000 per year can live paycheck to paycheck. They can't really afford what they have (I realized before I even finished the costs that I had to give them a $6,000 tax credit for them to afford it). We yell at these people (or their lenders) who got loans on $300,000 homes that they couldn't afford.
This is the same principle. This family has loans they're paying off on these houses, and if the shit hits the fan for 6 months in a row in those last-minute expenses that you need to take care of so you can continue to get to work and continue to earn money and live healthily (hell, I forgot insurance copays on any medications, while we're on that note), you can be pretty easily (to put it bluntly) fucked.
So it's not just these lower income people with houses they can't afford who are foreclosing. It's people, across the board, who are living beyond their means. This $250,000 family would be able to decrease their monthly expenditure and live MUCH more healthily getting rid of just one house costing them $3,000/mo in bills and taxes. I can see them owning two houses and living comfortably.
To put things in perspective: I have an $80,000/year salary. Because I don't want to calculate everything a second time, let's just say that after insurance, 401(k), taxes, and whatnot, I bring in $48,000 a year. That's $4,000 per month that I have for rent, bills, transportation, and the like. After all that is done, I can easily have significantly more than $1,591 left over.
I haven't clearly illustrated the political point, yet. From the tax code changes proposed by both candidates that I posted yesterday:
If you make 227-603K a year:
Obama: +12.00
McCain: -$7,871
Well, if you look at the numbers as an outsider, you might think, ``Shmeh, $12.00, that's not much of an increase. Go Obama!'' But as a person (or family) who is unable to afford your lifestyle and falling into this income tax bracket, you already can't afford the tax you're already paying to maintain the lifestyle you're living. A McCain administration promises you about $656/mo more available income per month, while Obama is costing you $1/mo.
This is a very scary thing, conceptually, because it means that people voting selfishly (for a candidate who fixes the problems THEY are facing -- in this case due to their own irresponsibility) are more likely to vote McCain than Obama. Not because Obama's plan is bad -- Obama's plan isn't bad, and responsible families in this bracket will easily afford $12/year in tax increases. They're more likely to vote because McCain's plan will help them maintain their lifestyle of living beyond their means.
Unfortunately, from a sociological standpoint, we are living in a society that encourages spending, so I find it highly unlikely that this extra $656 per month will actually become helpful to such an irresponsible household.
This socioeconomic point has the side-effect of causing them to continue borrowing, which will end up screwing our economy more, since our lenders are already broke. Thus, looked at in a macro scale, McCain's plan will end up keeping us in a rut as a country economically, while Obama's plan forces those with more money to become more responsible with that money: they have to give some of it to the government. That's not a bill that one can easily avoid.
While both tax plans alleviate stress for the lower incomes, Obama's does more help. McCain's alleviates stress across the board, but can't cope with the socioeconomic desire of the country to spend more and more. Obama's plan encourages increased fiscal responsibility amongst the people paying most of our country's taxes -- that's why you levy the tax against them, it has a higher yield and lower overall socioeconomic impact as far as their economic class and lifestyle -- and because it actually brings in more money, it provides a means out of this economic crisis we find ourselves in where our lenders are broke and so are we.
This is a collection of responses / comments on a portion of a note posted by of one of my friends. His note states:
``I asked a friend today, I said hey, if I have a family member who makes 50 something thousand a year, and his household lives comfortably, although with not too much room to just spend, then why is somebody with $250,000 not able to give up an extra thousand or so, so that somebody who works just as hard, if not harder, but was not given as great of an opportunity, able to live more comfortably?
The response: Well his family has an income, and after what they pay, barely have any money left over to spend on what they want. Apparently they pay 10,000 dollars a month in bills. $10,000. On what, I ask? Well, they own 3 houses.''
This struck me, and I decided that I would try to figure out why a family earning $250,000 per year would be more apt to vote for a McCain plan than an Obama plan that would barely affect them (increasing their tax by an average of $12 per year). It turns out that American fiscal responsibility is complete shit. This family cannot possibly afford 3 houses on that income. Perhaps if they lived in Kansas -- but this seems to be in the Newport News, VA area.
The crux is, our socioeconomic model of the past 20 years has been one pushing towards lending and spending. So it appears this family can afford the houses and their lifestyle... but they really can't. Let me break this down for you; here is my spliced together series of comments on Shane's note (edited to fix a couple of consistency errors I amended and noted in later notes -- those amendment notices are also removed):
------
Hey, Shane. I decided to look up some of this stuff on income tax levels. Your friend whose family has a $250,000 income -- assuming they filed a married joint income tax return, their monthly income would be $15,691.66.
That isn't quite right, because we don't figure in state taxes. For Virginia, it seems that number is $15,095/year. This brings monthly income down to $14433.75. I'm assuming they also have a family insurance policy. The monthly rate for a family insurance policy from my provider is $949. That takes the monthly income to $13,484.75. Factor in Social Security and Medicare taxes, which end up being $1,593.75 a month, and this number is down to $11,891. Now we're not factoring in ANY savings yet, so say we want to put away $500/mo into a company matched 401(k) for retirement (this is a ridiculously small number for someone with that income and is less than the amount I will be contributing monthly on $80,000.) Down to $11,391. There's not enough to contribute 10% monthly income to any other form of savings, but I think a family with 3 houses would know that savings other than a 401(k) are vital (the current economic situation proves that). Say we put away $300/mo into a high yield savings account. We're at $11,091. This number is probably about accurate because, while they may have more deductions, they also likely have more taxable assets. We'll assume for their sake that the number is low, and give them $11,591 a month, for $500 in credits -- that's $6,000/yr in tax credit.
Well, now we know they have $10,000 in bills on the three houses they own (for fairness' sake, I'm going to assume this includes gas / electric / water / garbage / other household-related bills). This brings their family monthly income down to $1,591. Assuming a 3-person family, that apportions $530/mo per individual for everything else. This includes food, transportation, and fun.
Assuming they own their cars and have no other payments, and assuming they have reasonably fuel-efficient vehicles, and assuming they have an average commute to work each day -- average commute is about 25 minutes. We'll equate that to 25 miles, since it's about the same given standard gas mileages for city/highway use. That's 50 miles a day -- we'll assume a tank a week with additional driving adding an additional 100 miles or so. Say they can do that on a 10 gallon tank. Currently, that's costing about $26/week, for about $104/mo per vehicle. Down to $1,383/mo.
Food is expensive. For myself, I can go through about $100 in food a week. A family of three gets to consolidate a bit better because they're going to be planning their meals, so say they spend 3/4 as much as I do on food -- that's going to be about $300 a month. Down to $1,083/mo.
Leisure costs add up. You don't realize it, but impulse buys really, really add up. Spending $1.50 on the candy bar, going out to the movies a couple times a month, going out to eat every 2 weeks, buying the new bestseller... these costs add up. I give myself about $400/mo for this; let's be conservative and say they spend $200/mo per person on leisure costs. Down to $483/mo.
I'll be nice and say their credit cards are only costing them about $200/mo. $283 left over.
Stuff comes up. School field trip for the kid (or books or mom send money if the kid's in college), you end up with a little money for last minute stuff that comes up here and there. Honestly, for me, that can end up being anywhere from $100 to $600 in a given month (car needs fixing, oil changes, that kind of stuff). We'll hope theirs averages $100/mo, and they put the rest in an accessible savings fund for the months that this last minute expense adds up to more.
And that, my friend, is how a family living on $250,000 per year can live paycheck to paycheck. They can't really afford what they have (I realized before I even finished the costs that I had to give them a $6,000 tax credit for them to afford it). We yell at these people (or their lenders) who got loans on $300,000 homes that they couldn't afford.
This is the same principle. This family has loans they're paying off on these houses, and if the shit hits the fan for 6 months in a row in those last-minute expenses that you need to take care of so you can continue to get to work and continue to earn money and live healthily (hell, I forgot insurance copays on any medications, while we're on that note), you can be pretty easily (to put it bluntly) fucked.
So it's not just these lower income people with houses they can't afford who are foreclosing. It's people, across the board, who are living beyond their means. This $250,000 family would be able to decrease their monthly expenditure and live MUCH more healthily getting rid of just one house costing them $3,000/mo in bills and taxes. I can see them owning two houses and living comfortably.
To put things in perspective: I have an $80,000/year salary. Because I don't want to calculate everything a second time, let's just say that after insurance, 401(k), taxes, and whatnot, I bring in $48,000 a year. That's $4,000 per month that I have for rent, bills, transportation, and the like. After all that is done, I can easily have significantly more than $1,591 left over.
I haven't clearly illustrated the political point, yet. From the tax code changes proposed by both candidates that I posted yesterday:
If you make 227-603K a year:
Obama: +12.00
McCain: -$7,871
Well, if you look at the numbers as an outsider, you might think, ``Shmeh, $12.00, that's not much of an increase. Go Obama!'' But as a person (or family) who is unable to afford your lifestyle and falling into this income tax bracket, you already can't afford the tax you're already paying to maintain the lifestyle you're living. A McCain administration promises you about $656/mo more available income per month, while Obama is costing you $1/mo.
This is a very scary thing, conceptually, because it means that people voting selfishly (for a candidate who fixes the problems THEY are facing -- in this case due to their own irresponsibility) are more likely to vote McCain than Obama. Not because Obama's plan is bad -- Obama's plan isn't bad, and responsible families in this bracket will easily afford $12/year in tax increases. They're more likely to vote because McCain's plan will help them maintain their lifestyle of living beyond their means.
Unfortunately, from a sociological standpoint, we are living in a society that encourages spending, so I find it highly unlikely that this extra $656 per month will actually become helpful to such an irresponsible household.
This socioeconomic point has the side-effect of causing them to continue borrowing, which will end up screwing our economy more, since our lenders are already broke. Thus, looked at in a macro scale, McCain's plan will end up keeping us in a rut as a country economically, while Obama's plan forces those with more money to become more responsible with that money: they have to give some of it to the government. That's not a bill that one can easily avoid.
While both tax plans alleviate stress for the lower incomes, Obama's does more help. McCain's alleviates stress across the board, but can't cope with the socioeconomic desire of the country to spend more and more. Obama's plan encourages increased fiscal responsibility amongst the people paying most of our country's taxes -- that's why you levy the tax against them, it has a higher yield and lower overall socioeconomic impact as far as their economic class and lifestyle -- and because it actually brings in more money, it provides a means out of this economic crisis we find ourselves in where our lenders are broke and so are we.
Tuesday, October 21, 2008
How Not To Implement a Linked List Insert *and:* Fun with Amtrak
Intro
Yesterday, I took a trip down to Columbia, MD for a job interview. Columbia is a great little area (at least from the parts I saw and the reviews I have read, that seem to continually rank it among the United States' top 10 best places to live.) The actual trip was quite a disaster, but the interview went rather well. We'll see what happens; I've got my fingers crossed.
How Not to Implement a Linked List
I'm sure everyone who would be interested in reading this would also be smart enough to not do this, but you never know. I thought I was smart enough to not do this. Please don't laugh too hard.
So here I am, interviewing, thinking everything is going well, and then it's time for the whiteboard implementation of a linked list insert routine. I seriously wrote this:
struct list {
int data; /* whatever payload our list is carrying */
struct list *next;
};
void list_insert(struct list *head, int payload) {
struct list *tmp, *tmp2;
tmp = head;
while (tmp && tmp->next != NULL) {
tmp = tmp->next;
}
tmp2 = malloc(sizeof (struct list));
/* err... yeah, skipping out on error checking here */
tmp2->data = payload;
tmp2->next = NULL;
tmp->next = tmp2;
}
Yeah, it works, but that's not the point. It doesn't work well. Comments are things I mentioned amidst writing it out. But I also, while writing while on the whiteboard, had my brain kick in. Well, halfway. My brain said, ``Oh hello there, jolly ol' chap. That's not optimal. But I'll be damned if I'm telling you why!'' So here I am, with while (tmp && tmp- written up there, saying, ``Yeah, uh. This is by no means any kind of optimal.''But I couldn't figure out why.
Other than that, the interview went well, and I had a lot of fun. (Except for the travel, which was a nightmare, but an acceptable one.)
So I'm back on the train, heading up to New York, and all of a sudden it hits me. ``He said implement a linked list insert, not append.'' D'oh. Of course append *does* insert, but unless you're sorting or whatever... it's really useless.
Except I didn't have any way to do the quick post-interview email. I had just brought a book for the train, and I certainly wasn't going to ask any of these weird businessey-salesy-markety guys to borrow their laptop with its nifty 3G PCMCIA card. (``Why not,'' you may ask. Because my train was delayed for an hour, I wasn't going to be getting home until 2AM at the earliest, and I simply wasn't in the mood to interact at that point.)
Anyway, at the point that I did get home (at about 1:45AM, no less), I hopped on the computer and fired off an email. (I mean, seriously, who implements an O(n) linked list insert?) Instead, what you are supposed to do is insert at the head of the list:
struct list {
int data; /* whatever payload our list is carrying */
struct list *next;
};
void list_insert(struct list **head, int payload) {
struct list *tmp;
tmp = malloc(sizeof (struct list));
tmp->data = payload;
tmp->next = *head;
*head = tmp;
}
So, yeah. Go go brainiac me. Oh well, at least I was still awake enough to realize I needed the pointer to pointer to be able to change the list head.Fun with Amtrak
I quite possibly could have named this section Worst Train Ride in the History of Man, or possibly something a little less exaggerated, but less sarcastic. In that case, I'd simply modify the title to [I Did Not Have Any] Fun with Amtrak. Let me explain.
The actual travel itself was not so bad. In fact, I rather enjoy trains. I used to hop on them all the time when living in Holland, and so it's nice to see this manner of public transportation still have viable use here in the States. No, the travel itself was fine. But Amtrak has absolutely GOT to do something about their schedules.
Clocks, guys. Fix your Clocks
Amtrak's clocks are broken. Before you tell me that my clocks are broken, I'd like to remind you that I'm a geek, and I'm nutty about time. I'm the kind of asshole that ignores pastes including timestamps if it's somehow obvious that the timestamp is incorrect. By any verifiable amount of time. Not only that: if the timestamp includes a seconds part (my client doesn't show seconds), I'll go run date and determine whether that user actually is off by seconds.
So it should serve as no surprise for you to understand that when I walked into Amtrak at 4:55AM, and they said the 5:10 train had left, and their clock showed 5:12, I was pissed. Yeah, I can understand a car clock being off by a couple of minutes, since it's not the type of thing you look at fixing daily. But how the HELL do you get 15 minutes of drift?
Changing Tickets
Apparently when you change your tickets, any discounts applied to your old ticket doesn't apply to your new ticket. So the company interviewing me had purchased my ticket, and they put the AAA discount on the thing. Apparently they don't copy that over to any further transactions to make on your itinerary. So I paid $10 to change the couple tickets over to take the next train to NY Penn station, and then the train from there to Baltimore. And I took the next train, which was about an hour later, and got me in two hours later than I was originally going to be arriving.
Taxi Drivers in Baltimore are lol
They might know Baltimore, but ask them to go 10 miles out of it and they get lost. Having never been to the offices of this company, *I* had to guide the taxi driver. What a noob.
FIX YOUR GODDAMN TRAINS
Yeah, so... Amtrak? You remember how I said to fix your clocks? Fix your trains too, while you're at it please.
I get to the BWI station, and I was going to need to change over one of my tickets to make the 4:23 train at BWI (instead of the 4:34 train at Baltimore Penn) so that I could interview a few minutes longer and make it to the station on time. I got to the station on time, and I go in to change my tickets. But I'm in line, and I notice it hits 4:23, and there's no train.
Yeah. The 4:23 train was delayed an hour and a half. So instead of being able to take that train, I had to take the 5:33 train up to New York Penn. My connecting train up to Albany left at 8:34 or something. The 5:33 train would get me there at 8:37. (Seriously, what the fuck?) Oh, the best part: the next train to Albany after *that* left at 10:45 and didn't get to Albany until 1:15AM.
So, whatever. In the end, I ended up getting out at NY Penn, calling my girlfriend and she came and picked me up in the city. We got home at around 1:45AM, which was still sooner than we would have gotten home if I had taken the train up to Albany (though I suppose I should place that part of the blame on the fact that both of us live in the middle of nowhere.)
Labels:
algorithms,
amtrak,
baltimore,
c,
data structures,
Interviews,
linked list,
new york,
penn station,
travel
Sunday, October 19, 2008
I'm Awful At Updating My Blog.
Intro
Real Life
I've been super busy with everything recently and haven't had a chance to update my blog in forever. (That also might be because I haven't actually done much software / sysadmin related stuff in quite some time -- not entirely true, but we'll get into that later). Where've I been? Caught up in projects and real life. Between working on SocialGamer, attempting to pick up some random contracts here and there, and my recent real life adventures, there's not been much time left over for blogging or the Internet at all (outside of what I've been doing; read further).
Real Life
So I finally got a life. This is partially attributed to me finally taking steps to doing fun real life stuff and partially due to having a girlfriend now who actually likes doing fun real life stuff. We've gone on more hiking / rock climbing / random drives around abandoned towns in the past two weeks than I've been on in the past three years. It's quite fun, and makes me realize how much I've missed in the past few years since I've been back in the US. This past weekend, we drove out to Sam's Point in Ellenville, but the trails were so packed (and you have to pay to get in) that we decided we'd try to find something else. On the way back down the mountain, we saw some random place marked for hiking, so we pulled over and walked down a bit, but it turned out there really wasn't any kind of trail.
So we continued our drive out to the middle of nowhere, trying to find some house on the top of a mountain. We never found the house, but we found the weirdest community I've ever seen anywhere. There was this mix of Jewish communities (which were all fenced in and run down, which was odd to see, since it reminded me a lot of Nazi-style ghettos), (probably) million dollar estates (most were for sale, so perhaps they're no longer of such value) and trailer parks. There were burned down / abandoned community centers that had remnants of swimming pools, basketball courts, and tennis courts... and then half a mile down the road, there'd be this shoddy community with an outdoor basketball court that looked better maintained than any of the houses surrounding it. Crazy.
Down one of these roads, we found a `general purpose' nature area. Upon walking down the `trail' (or what may more aptly be described as `area that looked most walked over' since there was no trail to speak of), immediately apparent were an empty mini-keg of Heineken, a bucket and beer bottles, all shattered and riddled with bulletholes, as well as some empty 12 gauge shotgun cartridges. We walked farther into the woods, finding some spectacularly colored leaves on the ground. We found this stone wall running through the middle of the woods. Apparently these sorts of constructions exist all over the place in this area; I'd never really seen them before, and I still wonder the stories behind the walls. What were they marking? When were they built? Who built them?
After walking for perhaps a quarter of a mile into the woods, we thought it best to continue back to the car since:
Projects
So we continued our drive out to the middle of nowhere, trying to find some house on the top of a mountain. We never found the house, but we found the weirdest community I've ever seen anywhere. There was this mix of Jewish communities (which were all fenced in and run down, which was odd to see, since it reminded me a lot of Nazi-style ghettos), (probably) million dollar estates (most were for sale, so perhaps they're no longer of such value) and trailer parks. There were burned down / abandoned community centers that had remnants of swimming pools, basketball courts, and tennis courts... and then half a mile down the road, there'd be this shoddy community with an outdoor basketball court that looked better maintained than any of the houses surrounding it. Crazy.
Down one of these roads, we found a `general purpose' nature area. Upon walking down the `trail' (or what may more aptly be described as `area that looked most walked over' since there was no trail to speak of), immediately apparent were an empty mini-keg of Heineken, a bucket and beer bottles, all shattered and riddled with bulletholes, as well as some empty 12 gauge shotgun cartridges. We walked farther into the woods, finding some spectacularly colored leaves on the ground. We found this stone wall running through the middle of the woods. Apparently these sorts of constructions exist all over the place in this area; I'd never really seen them before, and I still wonder the stories behind the walls. What were they marking? When were they built? Who built them?
After walking for perhaps a quarter of a mile into the woods, we thought it best to continue back to the car since:
- There was no trail and we'd probably get lost if we went too much further, and
- The area was so skeevy, we didn't really trust the car being left alone for too long.
Projects
I've been working the last couple months pretty much non-stop on promoting a website I created called SocialGamer. The idea is to have a social networking community for gamers of all types, be they video gamers, board gamers, or active gamers (paintball, footbag (Hacky Sack), frisbee) or otherwise. This is difficult because I've run out of money to piddle around with a website for 80 hours a week. We're trying to get the site migrated over to Django, which would be cool, because that would make it much easier to maintain most of the content on the site, as well as to extend the site in the future. I'm pessimistic about the amount of time I'm going to be able to put into the site in the upcoming month or two (or even in the long term). This is disappointing, because many people love the site. I may hold a fundraiser for it starting in November, but I'm not sure that much is going to come out of that. Either way, that's not going to give me any more time to work on it given I have two upcoming job interviews, will likely have to move for both of the jobs if I get them, and I also have an upcoming contract.
The contract is to develop a browser plugin for an x264 encoder that can stream via RTMP to a Flash Media Server. This plugin must work on FireFox, Internet Explorer, Safari, and Opera and must target Windows XP, Windows Vista, and Mac OS X (10.5). The funny thing about this is that the Mac port looks like the easiest. Quicktime can open cameras and capture devices and encode into x264 natively. So we looked at DirectShow. What a hassle that is!
DirectShow requires you to open a DirectShow device, assemble a bunch of filters for it, and then do whatever with audio / video. In the end, it looks doable, but it's going to be a lot more work than the OS X version which gives you a single, encoded A/V stream. The DirectShow version, we're going to have to do our own A/V syncing! (Why it cannot do this for us is beyond my imagination).
On top of that, it's going to be interesting to code up an NPAPI plugin for two different operating systems and STILL have to code up an ActiveX plugin for Windows. Why in the world did MS remove NPAPI support from MSIE? *Sigh*.
I'll post more about DirectShow weirdness as I get past various issues, I'm sure.
Outro
The contract is to develop a browser plugin for an x264 encoder that can stream via RTMP to a Flash Media Server. This plugin must work on FireFox, Internet Explorer, Safari, and Opera and must target Windows XP, Windows Vista, and Mac OS X (10.5). The funny thing about this is that the Mac port looks like the easiest. Quicktime can open cameras and capture devices and encode into x264 natively. So we looked at DirectShow. What a hassle that is!
DirectShow requires you to open a DirectShow device, assemble a bunch of filters for it, and then do whatever with audio / video. In the end, it looks doable, but it's going to be a lot more work than the OS X version which gives you a single, encoded A/V stream. The DirectShow version, we're going to have to do our own A/V syncing! (Why it cannot do this for us is beyond my imagination).
On top of that, it's going to be interesting to code up an NPAPI plugin for two different operating systems and STILL have to code up an ActiveX plugin for Windows. Why in the world did MS remove NPAPI support from MSIE? *Sigh*.
I'll post more about DirectShow weirdness as I get past various issues, I'm sure.
Outro
That's about it, but it's enough to keep anybody busy 168 hours per week. To put my case in point a little better, I set up some water to boil for some noodles midway through this blog entry. I then spent 15 minutes forgetting that it was boiling. Off to fix my noodles and continue on with my various stuff. Gotta prepare for that big interview tomorrow!
Labels:
activex,
directshow,
django,
npapi,
os x,
real life,
socialgamer,
windows
Subscribe to:
Posts (Atom)
