Oct 10 2007

Swap styles with multiple name with JS

I had a problem where I wanted to swap the background color of a given div dynamically between two colors (alternating rows in a list) depending on which item was selected. Originally, I was just doing this:

JS:
for(i=1;i<=intNumOfLines;i++){
// turn them all off
document.getElementById(column+i).style.backgroundColor = ‘#CCC’;
}
// turn selected one on
document.getElementById(column+x).style.backgroundColor = ‘#FFF’;

This did what I wanted, but wasn’t very CSS oriented cuz the colors would be set in the javascript. So then I decided to store it at the class level in CSS and just swap the className as needed like this:

Element:
<div class=”lineOn”>Line 1</div>
<div class=”lineOff”>Line 1</div>

CSS:
.lineOn, .lineOff{lots of styles…;background-color:#FFF;}
.lineOff{background-color:#CCC;}

JS:
for(i=1;i<=intNumOfLines;i++){
// turn them all off
document.getElementById(column+i).className = ‘lineOff’;
}
// turn selected one on
document.getElementById(column+x).className = ‘lineOn’;

Now I was happy…. for a while. Then I didn’t like that the colors were stuck in the .lineOn and .lineOff. I wanted to create global color schemes in my CSS files, so I then moved the colors to their own class and then reff’d two separate classes like so:

Element:
<div class=”line colorOn”>Line 1</div>
<div class=”line colorOff”>Line 1</div>

CSS:
.colorOn{background-color:#FFF;}
.colorOff{background-color:#CCC;}
.line{lots of styles…;}

Now I was happy with my CSS design. The problem I ran into was that my javascript to change the className didn’t work when I wanted to swap .colorOn for .colorOff, so it was on to Google to figure something out.

With the help from this article on eVolt.org, I got this code:

JS:
function modCSS(a,o,c1,c2){
// a = action (swap, add, remove, check)
// o = object
// c1 = class1
// c2 = class2

switch (a){
case ‘swap’:
o.className=!modCSS(‘check’,o,c1)?o.className.replace(c2,c1): o.className.replace(c1,c2);
break;
case ‘add’:
if(!modCSS(‘check’,o,c1)){o.className+=o.className?’ ‘+c1:c1;}
break;
case ‘remove’:
var rep=o.className.match(‘ ‘+c1)?’ ‘+c1:c1;
o.className=o.className.replace(rep,”);
break;
case ‘check’:
return new RegExp(‘\\b’+c1+’\\b’).test(o.className)
break;
}
}

// call the function
for(i=1;i<=intNumOfLines;i++){
modCSS(‘remove’,document.getElementById(column+i),’colorOn’);
modCSS(‘add’,document.getElementById(column+i),’colorOff’);
}

// Turn on the requested one
modCSS(‘swap’,document.getElementById(column+i),’colorOff’,'colorOn’);

volia! It worked. Yay =)

! most of this code was written on-the-fly for this post, so there may be type-o’s. This was to give you the idea and methodology that I used to solve my problem


Oct 10 2007

Fog is tastey

Save a $1! Like it really fucking matters. It proof that people will buy
shit that they don’t want or need, just because you tell them to. My
favorite part is when you try to explain it to them. Fucking dolts…
“No, you don’t understand, I’ll save *a dollar*”. . It’s only a fucking dollar! Its like
fucking coupons. Save 30 cents, save 15 cents…ooh ooh 2 for the price
of one! Awesome! Now you can have two of what you don’t want! Fucking
christ people are dense. I’ve figured out what it is. Its television. It
really does keep them in line. Yes, in line…or in the herd. You ever
stand in line, but not “in line”? It really does freak the hell out of
people. They just don’t know what to do. They’ll stare, and even talk
about how your not “in line”. Like it really fucking matters…. Lines
are for fucking cattle and morons. Gee there three people here before
me, is it really that hard to determin when you’re next? “Excuse me, are
you in line?” .. What the hell kind of question is that? No…I’m just
standing here for the hell of it. Obviously, if I’m somewhere in the
vecinity of “the line” to give you that shread of thought, I’m waiting
my fucking turn. Arg…


Oct 10 2007

Overwalkers

Overwalkers piss me off. You know, the people that take a stride in
there step longer than they should and look as if they’re thinking about
running, but really they just walk weird.


Oct 10 2007

Getting on the FDR

I’ve been in a lot of cabs and never been frightened before. Something
just happened that made me think twice about my cabbie. Right before he
goes onto the fdr, he puts on his seatbelt and says, “this is going to
be fun!” now I’m scared.


Oct 10 2007

Band: Daughters

If you gave a bunch of guys that had never played a guitar, made them
listen to a bunch of anal cunt and then threw them on stage and told
them to be as pissed off as possible at their guitars. That’s what they
sound like. Oh, and I think the singer idolizes les claypool but in a
speed metal band. Oh yeah, and Kirk gibson on bass with brand new jean
cutt-offs that are way too short. Overall….I think I like em. Hold on,
the singer is doing a headstand.


Oct 10 2007

Welcome to It’s Just Poison…

I’ve decided to put up a personal blog site to cover all the nerdy / techie stuff that I want to talk about. I know that I already have BodyMod.org running full steam, but I don’t want to pollute it with a bunch of code postings, hacks, and other geek speak.

This idea came about while I’ve been redesigning BodyMod.org into .NET with a CSS framework. Basically, I’ve had to relearn almost everything and I’ve encountered / developed a lot of hacks to get the job done and I wanted to record them so I can find them for later use, and also put them up so others could benefit as well.

I also used to have KissedByJudas.com where I did something similar, but it was waaaay too complicated and involved. Which translates to: Never updated.

This new wordpress blog should work out a lot better since I can just post directly from an app on my laptop without logging in formatting etc. I can also send posts from my phone via email, so I will be a lot more likely to put stuff here cuz of that.

Who knows what’ll happen in the long run. Guess we’ll have to wait and see!

Piece.


Oct 10 2007

If Monk-keys had sardines

Save a $1! Like it really fucking matters. It’s proof that people will buy shit that they don’t want or need, just because you tell them to. My favorite part is when you try to explain it to them. Fucking dolts… “No, you don’t understand, I’ll save *a dollar*”. [insert loud agonizing scream of frustration here]. It’s only a fucking dollar! It’s like fucking coupons. Save 30 cents, save 15 cents…ooh ooh 2 for the price of one! Awesome! Now you can have two of what you don’t want! Fucking christ people are dense. I’ve figured out what it is. It’s television. It really does keep them in line. Yes, in line…or in the herd. You ever stand in line, but not “in line”? It really does freak the hell out of people. They just don’t know what to do. They’ll stare, and even talk about how you’re not “in line”. Like it really fucking matters…. Lines are for fucking cattle and morons. Gee there three people here before me, is it really that hard to determine when you’re next? “Excuse me, are you in line?” What the hell kind of question is that? No…I’m just standing here for the hell of it. Obviously, if I’m somewhere in the vicinity of “the line” to give you that shred of thought, I’m waiting my fucking turn. Arg..


Oct 10 2007

Dunkin Donuts makes great hot chocolate

Yesterday I spent a wonderful 4 hours at LaGuardia airport because of “weather”. My ass. There was an overcast, but nothing bad what so ever. I’ve taken off in horrendous ice storms, so I knew this was nothing. What was it really? Incompetence. The problem with that is that the airlines would have to hook you up if it was their fault, but if you can blame it on the weather, all bets are off. It’s amazing the mentality of these people. If you miss the flight, or the flight is delayed/canceled due to weather, they could give a rat’s ass about you and let you know it. Oh, the airline that I’m referring to here is Northwest…fucking cocks. Now, if they fuck up and overbook a flight (I love that one), all of a sudden they need “volunteers” to give up their seat for a later flight, and they’re oh so nice all of a sudden. Amazing.
One of my favorite experiences was a few months ago I was in Fort Wayne, Indiana. Blech. What a fucking waste of space that city is. Anyway, I was running late and my flight was scheduled to leave at 1pm. I arrived at the ticket agent at 12:31pm. They wouldn’t give me a boarding pass because I didn’t make it there a half hour before departure. Now I would understand if this was JFK and I had to get through 8 miles of security (another fucking joke) and then take a fucking shuttle bus just to get to my gate, but the Ft. Wayne airport only has 3 fucking gates and a staff of about 20. I think my elementary school was larger. So I was put on the 4pm flight. Fuckers. By the time I was done fucking with the inbred fuck at the NWA ticket counter, I went through security and walked about 50 feet to my gate. I arrived at approximately 12:45pm. At 1 they began to board the flight (oh my gosh, they were running late too…amazing!). After everyone was boarded they began to take standby passengers. This is when I began to flip. I asked the lady why I wasn’t allowed on the plane when I had purchased a ticket for this flight, I was here before boarding even began, and now there’s even room on the fucking plane! Nope, the only two people that were there on standby got to board, not me. That would just make too much fucking sense! Fuck Northwest and their dumbass employees. Maybe if they hired people that actually graduated high school, things would work better!
Anyway, back to what I began this for: Retards that fly NWA. Yep, not the staff, but the fuck-knocks that I (and a lot of other sane people) have to deal with when we fly. To make things better, I’ve photographed these fucking morons in all their glory! Yay for cell phone cameras =). Our first subject will be referred to as “Unattended Bag Lady.”

6F6EE96D-6170-4004-99EA-5A31319D9F0E.jpg

This cellulite queen came barging up to the ticket booth to interrupt me and the ticket lady trying to get my ass on the next flight because I got bumped due to “overbooking” to announce that there was an “suspicious unattended bag over there.” Yes, those were the words right out of her mouth EXACTLY. Someone’s been reading one-to-many “There’s a terrorist up your ass right now” posters. She damn near demanded that everyone stop what they’re doing, call the bomb squad and evacuate the airport because there’s a suitcase full of C4 and Anthrax over there. Fucking douche. Turns out, a lady left her bag sitting next to a chair as she stepped away to throw away her lunch. Yep, terrorists hard at work there. God these people are fucking dumb. The “Unattended Bag Lady” even saw the other lady with the bag, and felt that _because_ she left the bag there, it had to be suspicious. SHE SAW THE LADY GET UP TO THROW HER TRASH AWAY AND REPORTED IT! Government brainwashing at it’s best there ladies and gentlemen!
Out next miracle worker is an ordinary “I’m So Cool” guy. This guy is one of those irritating fucks that don’t have a clue what’s going on in the world except for them. The fuck was wearing his sporty blazer, white dress shirt unbuttoned about 3 buttons too low, horrible ass “I sit in a tanning bed everyday, oh yeah!” tan, gold chain (have to have the gold chain, else what’s the point of unbuttoning the shirt?), gel in hair, and horrible bags under his eyes from tweaking out on coke all weekend with $5 hookers from Newark. I think he probably sells Tupperware to single moms.

03F85557-E72C-438F-84B4-5B963AB75A7F.jpg

So, this fuck-tard comes strolling in blabbing as loud as he possibly can without it being considered as yelling, on his cell phone and cuts in front of everyone in line and holds his hand up to me to announce that I should stop talking to the ticket lady, and that once he’s finished laughing about how small his dick is from all the speed he just snorted up, he has something to say. I didn’t even have a chance to bitch-slap him before everyone in line behind me began yelling at him to get at the end (that’s what I have a photo of). Fucking yuppie trash.
Next is “I don’t know how to count / I’m an impatient bastard and I feel that if I get on the plane before everyone else I’ll get to where I’m going quicker, and by interfering with these plans, you irritate me and I will be irate guy.”

243982C2-7486-4054-8414-FD1604D1A6BC.jpg

Let me give you the play-by-play here:
Flight Attendant: “Now pre-boarding all First class passengers only. That’s rows 1-4 only. Thank you.”
Fuck-Tard: Hands ticket
FA: “Sir, we’re pre-boarding First Class only right now, we will being boarding from the back of the plane next, please step aside. Thank you.”
FT: “But I was here first”
FA: “I understand sir, but we board in a specific order according to seat assignment, we will call your row in a few moments, please step aside. Thank you.”
FT: “No. I was here first, so I should get on first. I also have a large 7 inch diameter but plug in my ass right now.” (May not be an exact quote)
…This goes on for about 2 minutes…
FA: “We will now board from the rear of the plane. Now boarding rows 18 through 21″
FT: Hands ticket
FA: “Sir, you’re seated in row 15, we will be seating your section next, we board from the rear of the plane first, please step aside thank you.”
FT: “I have a ticket, it’s right here. Did I mention that there’s a young gerbil behind the butt-plug, and he’s getting feisty?”
FA: “God Dammit, you fucking moron! What the fuck is wrong with you? Move the fuck over until I call your god damned row! Fuck!” (in her mind) “We’re not boarding you yet. Stand there until I point at you”
FT: “I don’t think you understand, THERE IS A GERBIL IN MY ASS AND I LIKE IT!” (I really couldn’t hear them by this point, so I’m just guessing).
So this went on for a while. Quite entertaining to see the many shades of red the flight attendants face was going through.
These last couple of photos are of a group of 3 butt-weasels that seemed to follow me all over the damn waiting area. All I could hear were conversations worse than a group of third-graders. Example conversation:
BW1: Dude, that guy’s eating nuts.
BW2: Oh my god! (insert high squealing laugh…fitting considering he’s wearing a pink shirt and looks like a fat pig =). You said “nuts”! Ha ha ha!
BW3: Yeah, that’s what he said (while laughing like butthead)
BW1: Damn straight!
BW2: You’re not straight! Fag!
BW3: Damn! Fag!
BW2: Dude, you want his nuts, you fucking homo!
BW1: Dude, I’m not gay, you’re gay!
BW3: You totally want his nuts. You’re so gay!

A70E69FB-1981-40A0-8C40-683BD395CA19.jpg
98C34502-376E-44BB-8678-047D4D5F6A05.jpg

This is just a small sample of one topic of conversation that would last for 10 or 15 minutes easily. I got to listen to these studious butt-weasels for well over an hour. Joy. I would also like to point out their fashion attire. Pink collard shirt with green camo’s and flip flops. (I believe they were all wearing sandals of some kind)

I hate people.

I hate flying.

I hate NWA.


Oct 10 2007

I Remember Filamentous

I got pulled over for speeding the other day. I was clocked going 86 in a 65 and was written up for going 5 over. I must say that it was the least stressful police experience I’ve ever had. Normally when you get pulled over, you get a little nervous, and that “you’re busted feeling”. Not this time. While he was running my license I took a little nap and the officer actually had to wake me up when he returned. Finally, not having a car or car insurance pays off =). The moment I saw the lights in my rear view mirror, I knew that the worst that would happen is a $150 ticket. Points don’t matter anymore. Woo Hoo! On a side note, that morning/previous night was an amazing evening that woke up a lot in me. And it all happened on the 9th.
Now on to a more serious note: the chick in Aruba (or that was in Aruba). If you don’t know what I’m talking about, you’ve been living in a deeper hole than myself (which is probably a good thing). A while back (couple months), some chick (18yo) went missing in Aruba. Now she’s all over the news as if it were a national emergency. “Tonight at 7, a new possible lead in the missing chick in Aruba case!” Ok… let me see if I get this right. Some girl is missing in a foreign country and THAT’s news?! Jesus fucking christ! Wake up America! That’s not news! The part that I really love is how the parents still have hope. Give me a break, they have to know that their daughter is dead by now. Most likely shark food. Just call it a day and make a new one.
I understand that the initial missing person in Aruba is something that could make an appearance in the evening news the day it was reported, but headlining every news channel for months? Please! What’s next? Lost chick in Aruba ribbon stickers? You know what I’m talking about. Those retarded ass stickers that everyone has plastered on the back of their cars. They’re stickers that look like ribbons, and they have a different color now for pretty much everything. “I’m supporting our troupes…in my Hummer!”, “I’m supporting breast cancer awareness”, “I’m MADD”. So what the hell do these things really mean? It’s simple. Everyone that puts one of these retarded ass stickers on their car is trying to tell you that they are a better person than you, because “they care”. You know what I have to say to that? Fuck you. That’s such BS. So does that mean that everyone that doesn’t have a sticker is secretly hoping all women suffer from breast cancer and hope to run over a marine’s mom while drunk? Please… All this shows is that people are dumb cattle that will buy anything if they’re told to. You’re not helping anyone! You’re just making someone rich out of your stupidity. I want to have an anti-support sticker. Granted, I don’t have a car, but I could put them on all the cabs I get into =). I want a black and blue sticker that supports the beating of children, a red and white sticker to show my appreciation of the slaughtering of baby seals, or maybe a really special camouflage one that says I support terrorism! Hehe… could you imagine that last one on the back of a cab in NYC? LMAO! By the way, all you tarts out there that bought those dumbass rubber wristbands to support something, you’re equally dumb =)
So, back to missing chick in Aruba. Here’s my opinion (even though it’s right) on what this is all really about: Mass media misdirection (MMM or M3). The media is being told to cover this story. They’re being fed all this crap by a higher power (ie government, shadow government, etc). They’re blowing this waaaay out of proportion so that this is the most important thing in your life and is what you’re going to talk around the water cooler the next day. Think about it for a minute. With all that’s currently going on in the world (war, genocide, national tensions, scientific discoveries, etc) why the hell is this top news? Easy, to get your mind off of what’s really going on. “Yesterday, 5 Navy seals go missing in a covert operation to…wait…this just in! A piece of hair was found in a compost heap on the outskirts of Aruba! It has been taken in for DNA testing to see if it’s missing chicks! We will keep you up to date as it progresses! What do you think Bob?” “It’s just amazing, I can’t believe they actually found what could be a piece of her hair. Simply amazing! You know what else I think? Blah blah blah… and now to Tom with sports.”
Keep this in mind when you watch the news, you’ll see what I’m talking about. Another thing… why the HELL are these dumb fucks giving us THEIR opinion?! It’s called “news”. News doesn’t have an opinion, nor do I want to hear some twits two cents. It’s not a reality show and you’re not special or important. You just give good enough head to your boss so that your ugly mug can appear on TV and because of that you feel important. Well, you’re not. So just tell me what’s going on and move on! Quit it with the opinions and buzz words to make things sound worse than they really are. I was watching Fox News a while back (pure entertainment purposes only, I promise), and the top story was of a cruise ship that was hit by a 70 foot wave and knocked the boat around. Needless to say, it unsettled a lot of people on the boat, so the cruise people decided to give everyone on the boat free drinks for the remainder of the trip (rock!). Now, here’s what the news reporter said, “I was able to interview a few of the survivors from the catastrophe at sea, and many are saying that they will sue for the negligence of their safety.” Towards the end, she mentioned that the injuries involved about for or five people with minor cuts and bruises. Let’s break this down, “a few of the survivors”. For there to be survivors, someone has to die or be damned close to it. A boat getting hit by a wave that results in an 80yo woman falling over and bruising her arm does NOT count. “catastrophe at sea,” first thing that came to my mind was that it happened in the middle of the Atlantic ocean. Last time I checked an ocean and a sea are two different things. I guess this is what happens when you put a cock-knock in front of a camera with a microphone and do everything live. I would love to see how the synapses work in a reporter’s brain. I bet they’re similar to the wiring of a burned out crack house in Detroit. Now for the catastrophe part. A wave hitting a boat doesn’t count. The Titanic hitting that iceberg is a catastrophe. Burning down the entire city of Chicago by a cow knocking over a lantern is a catastrophe. Man, I hope they read this. The last part is how people feel they can sue the cruise line FOR BEING HIT BY A WAVE! Let’s see, you’re in a boat, in the middle of the OCEAN, what’s most likely to happen? A) Cows (on fire) rain from the sky and pummel people to death that were unfortunate enough to be on deck. B) The Loch Ness monster makes a States-side visit and disguises him(her)self as a tourist and devours all the first born. C) The boat gets hit by a wave (heavens no!)? While seeing flaming cows fall from the sky would be a site to see, and I’m always down for anything that devours first born, I’m going to have to go with C. Fucking people, I swear…


Oct 10 2007

Explacing Porcupines

Last night was supposed to be low key. Supposed to be a recovery night from the previous couple of nights. Four days ago I was at a fetish party and was introduced / hung out with Phil Anselmo (rock!) and got wasted out of my mind. I also smoke a little pot. Apparently a little goes a long way with me =). Three days ago I went to a surprise Eye Hate God concert at CBGBs where Phil was guest appearing and played guitar for the entire set. Got my tooth chipped in the pit. Totally worth it. We then hung out with Phil for a while after the show. Two days ago, I got to pick up my new leather pants from Martha. They feel fucking awesome! So I spent all that night just walking around the city in them breaking them in. Yesterday the elevator was out in my work building, so every time I wanted to go outside it was a fun 5th floor walkup hike…yay. After work I walked over to 10th ave. and bouldered at a rock gym. It was a lot of fun, a good work out, and I got a great blood blister on my finger from it =). When I got home, Frances was sitting on my couch. That was a pleasant surprise since I haven’t seen her in a long time. We ordered some Japanese food and watched the new(er) Harry Potter movie (sucked). Then Dan came home and told us that Paul (Booth) and everyone from the shop were going out for some drinks because they had some friends in from Belgium. I saw this as a perfect opportunity to don my new pants =). So we all got ready and headed over to Paul’s to meet up with everyone else. Our first stop was to Ace Bar. It’s the closest and we figured there wouldn’t be as many annoying ass people there. We were right, but too much so. There wasn’t anyone there… So we finished out drinks and headed over to Lit to check out what was going on over there. On our way over, Dan and I make a pit stop at the bar across the street because we can get a quick free drink. The crowd there was scary beyond all reason. Almost not worth the free drink…almost. With the drinks gone, we left to meet up with everyone at Lit. On the way there Dan gets a call from a friend to meet them at Mars Bar for a quick shot. Ok… Mars Bar is the most ghetto bar you will ever walk into, and the people that hang out there fit the place perfectly. I like dive bars, but this place is just bad. So we get there and of course there’s a fat goth chick. So I figured I could just play the “I’m gay” card and play it safe, but then I looked to my right and there was this blonde Swedish guy dressed very “normal” (which in that bar means very gay) and was staring at me in the weirdest way. I wasn’t sure if he wanted to make out with me, slice my throat and play with my blood, or maybe both…I dunno. Either way, I knew that the “gay card” was out of the question and as long as I was in that bar I couldn’t look right. I begged Dan to just do the shots and leave, but nooooo. We had to hang out. Enter the gutter-punks. I love these guys. You can smell them before they enter the door and you’re pretty much guaranteed a fight of some kind because you’re not one of them. Finally we do our free shots, me – Jager, Dan – Tequila, and we bolt. Immediately after we left Dan realizes that Tequila was not a good choice. Off to Lit. We arrive and head downstairs. First thing that I notice is that I don’t know either of the bartenders…fuck. The second thing I notice is that the place is dead…dead, dead, dead. After about 2 Jack and Cokes and 20 minutes of everyone sitting on the couches trying to persuade Dan to pole dance we decide to leave. Everyone wants to go home, I feel like I was just starting the night. When we get outside the guitarist from Chimera runs into Paul and then invites us to come uptown and chill on the bus with them for some drinken and old fashion hanging-out. Of course we bite and grab a couple cabs. Enter the bus…ahhhh, air conditioning and grey goose. What a great combination =). We just hung out drinking screwdrivers and bullshitting about tattoo stories. We also got to see their new video the MTV won’t play because it’s “too violent”. Their response was “fuck em, Fuse is going to play it” lol. Awesome! At about 5 they have to jet to Connecticut, so we jump bus say out good byes and hop in the cabs back to Pauls. We headed upstairs and I collapsed on the floor with a nice glass of Jager and ice. Relaxed with some Bad Boy Bubby playing on the big screen and just listened to some great stories about traveling around the world and the various experiences that Paul and his Belgian friends had. It was an Amazing time. At about 6:30 I headed home and passed out in my bed with my leather pants still on. They were so comfy =). Around 11 I get woken up by Frances entering my room freaking out that she was late for something. That’s when I realized that I was supposed to be at work over an hour ago. Then I heard my phone beep…new message from “Her”, “My days basically suck real bad without you here…” Great way to start the day =) Fuck… what a night!