Category: Programming
Posted by: pfisher42
JavaScript loose comparison has "falsey" values (false, '', '0', 0, []), "truey" values (true, '1', 1), and "nully" values (null and undefined). NaN matches nothing: (NaN == NaN) is false. Objects are tested for identity: ({} == {}) is false. Strings, numbers and arrays are tested by casting to a string, so these are true: ('5' == 5), (5.0 == '5'), ([5] == 5), and ([5,6] == '5,6').
Category: Programming
Posted by: pfisher42
Hard tabs don't render consistently, and part of code readability is its formatting. So we want to use spaces for all our indentation. But Eclipse insists on using tabs. Even after I changed that setting! What gives? Well, it turns out to be surprisingly involved to banish the tab completely. To spare you the trouble I went through, here's my handy guide to using spaces instead of tabs in Eclipse:

For the default text editor:

  • General > Editors > Text Editors > Insert spaces for tabs (check it)

For PHP:

  • PHP > Code Style > Formatter > Tab policy (choose "spaces")
  • PHP > Code Style > Formatter > Indentation size (set to 4)

For CSS:

  • Web > CSS > Editor > Indent using spaces (select it)
  • Web > CSS > Editor > Indentation size (set to 4)

For HTML:

  • Web > HTML > Editor > Indent using spaces (select it)
  • Web > HTML > Editor > Indentation size (set to 4)

For XML:

  • XML > XML Files > Editor > Indent using spaces (select it)
  • XML > XML Files > Editor > Indentation size (set to 4)

For Javascript:

  • Javascript > Preferences > Code Style > Formatter > Edit > Indentation (choose "spaces only")
  • Rename the formatter settings profile to save it

For Java:

  • Java > Preferences > Code Style > Formatter > Edit > Indentation (choose "spaces only")
  • Rename the formatter settings profile to save it

And there you have it! You'll (almost) never get a tab again.

And remember, kids, ^(.*?)[\t ]+$ is your friend! (For those who don't speak regex, this trims trailing whitespace.)

Find this post useful? Vote for this answer on StackOverflow!

02/02/11: Happy Music

Category: Music
Posted by: pfisher42
Here's my list of happy, upbeat, feel good songs for my new Pandora station:

Angels & Airwaves - The Adventure
B.J. Thomas - Raindrops Keep Fallin' On My Head
Barenaked Ladies - If I Had $1000000
Barenaked Ladies - Pinch Me
Bob Marley - Three Little Birds
Bobby McFerrin - Don't Worry, Be Happy
Cheap Trick - I Want You To Want Me (Live)
Cornershop - Brimful Of Asha
Cornershop - Good Shit
Cornershop - Sleep On The Left Side
Dave Matthews Band - Tripping Billies
Dexy's Midnight Runners - Come On Eileen
Eve 6 - Open Road Song
Feist - 1 2 3 4
Harry Belafonte - Jump In The Line
Harry Nilsson - Everybody's Talkin'
Herman's Hermits - I'm Into Something Good
Herman's Hermits - I'm Henry The VIII I Am
Israel 'IZ' Kamakawiwo'ole - Somewhere Over The Rainbow / What A Wonderful World
Jack Johnson - Banana Pancakes
Jack Johnson - Bubble Toes
Jason Mraz - I'm Yours
Jimmy Buffett - Volcano
Jimmy Cliff - I Can See Clearly Now
Jimmy Eat World - The Middle
Jimmy Soul - If You Wanna Be Happy
JoBoxers - Just Got Lucky
Johnny Nash - I Can See Clearly Now
Katrina & The Waves - Walking On Sunshine
Len - Steal My Sunshine
Lesley Gore - Sunshine, Lollipops and Rainbows
Lily Allen - Smile
Melanie - Brand New Key
Michael Bublé - Haven't Met You Yet
Michael Franti & Spearhead - Say Hey (I Love You)
Mika - Love Today
Mika - Big Girl (You Are Beautiful)
Mika - Good Gone Girl
Music Explosion - Little Bit O' Soul
New Radicals - You Get What You Give
Nine Days - Absolutely (Story Of A Girl)
Paul Oakenfold - Starry Eyed Surprise
Paul Simon - Gumboots
Paul Simon - I Know What I Know
Paul Simon - Late In The Evening
Paul Simon - You Can Call Me Al
Perez Prado - Mambo No.8
Romantics - What I Like About You
Save Ferris - Come On Eileen
Simon & Garfunkel - The 59th Street Bridge Song (Feelin' Groovy)
Sixpence None The Richer - There She Goes
Sixpence None The Richer - Kiss Me
Stevie Wonder - Uptight (Everything's Alright)
Straight No Chaser - I'm Yours / Somewhere Over The Rainbow
Sugar Ray - Every Morning
Supergrass - Alright
Talking Heads - Once In A Lifetime
The Allman Brothers Band - Jessica
The Aquabats - Super Rad!
The Beatles - Here Comes The Sun
The Grateful Dead - Touch Of Grey
The Isley Brothers - Twist & Shout
The Lovin' Spoonful - Daydream
The Monkees - I'm A Believer
The Presidents Of The United States Of America - Back Porch
The Proclaimers - I'm Gonna Be (500 Miles)
The Rembrandts - I'll Be There For You
The White Stripes - We're Going To Be Friends
Third Eye Blind - Semi-Charmed Life
Three Dog Night - Joy To The World
Toni Basil - Mickey
Train - Hey, Soul Sister
Vampire Weekend - A Punk
Vampire Weekend - Cousins
Vampire Weekend - Holiday
Vampire Weekend - Run
Van Morrison - Brown Eyed Girl
Wham! - Wake Me Up Before You Go Go
Willie Nelson - On The Road Again


Didn't quite make the cut:
A-Ha - Take On Me
Aqua - Doctor Jones
Black Eyed Peas - I Gotta Feeling
Ernie Maresca - Shout! Shout! (Knock Yourself Out)
Harry Nilsson - Coconut
Jason Mraz - Lucky
The Beach Boys - Good Vibrations
The Monkees - Daydream Believer
The Monkees - (Theme From) The Monkees
The Rascals - A Beautiful Morning
Toploader - Dancing In The Moonlight
U2 - Beautiful Day


Not in the Pandora library:
Haysi Fantayzee - Shiny Shiny
Judy Garland - Somewhere Over The Rainbow
The Aquabats - Playdough
The Sorrows - Teenage Letter


Yikes. After compiling this, I feel the need for something really dark.
Category: Funny Stuff
Posted by: pfisher42
20 year high school reunion.

I have a hot wife. I wax maudlin and say, "I wouldn't be here if it weren't for this woman. She is the reason I am here today." Kind souls think she "saved my life". This is not what I mean by it. I am here to show her off.

I do not have a hot wife. I feel obliged to attend that I may tip my hat to those who do. I may skip out.
Category: Music
Posted by: pfisher42
Like Picasso, she mastered the classical forms before taking her own direction.

Vintage Lady Gaga Live at NYU - Captivated & Electric Kiss





Stefani Germanotta, now known as Lady Gaga, performing at Ultraviolet Live, NYU's annual talent show. She ended up coming in 3rd place. She's AMAZING. First song is Captivated, second one is Electric Kiss. Make sure to stick around and hear which contemporary artist the final judge compares her to. Awesomeness.

Captivated

One look and I'm done. One glance from your eyes and I'm captivated.
The taste of your skin, the warmth of your hungry lips has me so taken.

And I love the way you can make me dance from miles away.
When I'm with you, I'm so sedated; I'm captivated by you.

You're just like the wind 'cause everything moves when you're around it.
The sun is just like the sound of your voice in the morning when you light my world up.

And I love the way you can make me dance from miles away.
When I'm with you, I'm never jaded; I'm captivated.

I'll never stop believing in this crazy love we're leading.
Sugar, hold me close and make me sweeter; I need you, I love you.

So, please, show me that smile. Make me laugh for just a little while.
Then breathe me one breath: I only need one to fill the emptiness.

And I love the way you can make me dance from miles away.
It's been so long but now I've waited and I'm captivated.

Electric Kiss

We are a generation twisted by a myth.
Confused and ludicrous, holding onto love.
Consumed by all the pleasures in our midst.
Alive with all the lips we've kissed and losing all control.

Were gonna start a resistance. We want independence.
We're gonna give the world some of this
Electric kiss

I'm gonna change the world with my lips.
One voice forever, we'll live together
In peace, love, solitude and happiness
Electric kiss

Fame is our felony; we're so in love with it.
Some superstars and masochists who don't know where to go.
But the poets and the fighters of our time
Put down their weapons, end their rounds and know what they must do.

They're gonna start a resistance. They want independence.
They're gonna give the world some of this.
Electric kiss

I'm gonna change the world with my lips.
One voice forever, we'll live together
In peace, love, solitude and happiness.
Electric kiss

I'm gonna change the world with my lips.
One voice forever, we'll live together
In peace, love, solitude and happiness.
Electric kiss

[I love the subtlety of the message that poets are the ones with weapons to put down.]

Stefani Germanotta band live at The Bitter End 1/20/06-Hollywood





Hollywood

Listen, I've got the sickest ambition.
Deep in the mirror I am scared,
Don't know who the hell is there.
Yeah, I'm losing my reflection.

Obsession

The thing it's our new religion.
Each model and celebrity
Changes how I look at me.
Oh, don't tell me, don't tell me
I'll never be

A superstar 'cause I know I could
Look like a girl in Hollywood.
Hollywood, Hollywood
In Hollywood, In Hollywood

Women, let's talk about our condition.
How beauty's a commodity,
Women don't get the best things,
Battered liver though, with poison.

I am the bill.
In the world without me, this vision.
Sure Hollywood's commercially amorous
But naturally, me? Quite ugly as hell.
Tell me I'm not sixteen!

Like a superstar, yeah I know I could
Look like a girl in Hollywood.
Hollywood, Hollywood
Hollywood, Hollywood

Within a year I know I could
Look like a girl in Hollywood.
Like a superstar, yeah I know I could
Look like a girl in Hollywood.

Within the year I know I could
Look like a girl in Hollywood.
Like superstars, yeah I know I could
Look like a girl in Hollywood.
In Hollywood, Hollywood
Hollywood, Hollywood
Category: Music
Posted by: pfisher42

02/02/10: Bookmarklets

Category: General
Posted by: pfisher42
A nice alternative to resource-hungry extensions, bookmarklets are surprisingly useful. Just drag them to your bookmark toolbar.

Del.icio.us: Tag this page.

Twitter: create a new Tweet.

Dictionary.com: search Dictionary for the selected word.

Tumblr.com: create new Tumblr tumblelog entry.
Category: General
Posted by: pfisher42
Category: Music
Posted by: pfisher42

10/21/09: Tickle, tickle

Category: Funny Stuff
Posted by: pfisher42