Archive for August, 2013

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32
class="post-2578 post type-post status-publish format-standard hentry category-local tag-dolores-park tag-fog tag-fogust tag-photos tag-san-francisco">

Fogust descends on Dolores Park

August 14th, 2013

Fogust at Dolores Park

This is the time of year when a lot of us take time off for vacation. The season of summer needs time off as well, which is why we have the month of Fogust.

A strange thing happens as the fog engulfs the city; the area around Dolores Park is shielded from the fog by Twin Peaks, leaving a big sunny patch. One has to wonder if a certain Junipero Serra took this heavenly parting as a sign for where he should start construction when he arrived here in Fogust of 1776 (Okay, June 29th, but close enough.)

And perhaps one day in the distant future, archeologists will stumble on this sunny spot in the foggy ruins of our city. And maybe they’ll figure out why San Franciscans spent so much time fighting over building things that — most of the time — nobody could even see.

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32
class="post-2574 post type-post status-publish format-standard hentry category-local tag-16thmission tag-clarionalley tag-san-francisco tag-simpsons tag-streetart">

Blurry Simpsons

August 13th, 2013

Blurry Simpsons

Finally, a street art mural of the Simpsons that’s as blurry as my memories of a time when the show was still funny.

UPDATE: The Simpsons have now come into focus.

(Spotted in Clarion Alley.)

Warning: Use of undefined constant archives - assumed 'archives' (this will throw an Error in a future version of PHP) in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32

Warning: Use of undefined constant page - assumed 'page' (this will throw an Error in a future version of PHP) in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32

Warning: A non-numeric value encountered in /home/public/blog/wp-content/themes/eric-cordobo-green-park-2/archive.php on line 32
class="post-2550 post type-post status-publish format-standard hentry category-technology tag-c tag-music">

Song lyrics in C++

August 13th, 2013

The other day while hacking away on some C++ code and listening to music, something occurred to me: if I’m programming in C++, shouldn’t the music I’m listening to be in the same language?

So I took a few verses from various random songs and coded up C++ translations of the lyrics. Here’s what I was able to hack together.

 
2Pac – Dear Mama

English:

When I was young me and my mama had beef
Seventeen years old kicked out on the streets
Though back at the time, I never thought I’d see her face
Ain’t a woman alive that could take my mama’s place

C++:

// When I was young me and my mama had beef
if (this->young()) {
    this->append(new Beef());
    mama.append(new Beef());
}

// Seventeen years old kicked out on the streets
// Though back at the time, I never thought I'd see her face
if (this->getAge() == 17) {
    this->remove(getShelter());
    this->seeFace(false);
}

// Ain't a woman alive that could take my mama's place
mama.replacement = NULL;

 
 
The Beatles – Hey Jude

English:

Hey Jude, don’t make it bad
Take a sad song and make it better
Remember to let her into your heart
Then you can start to make it better

C++:

// Hey Jude, don't make it bad
jude.it->make(!JudeState::BAD);

// Take a sad song and make it better
sadSong.improve();

// Remember to let her into your heart
jude.setReminder(new Event(JudeState::ENTER, jude.getHeart()));

// Then you can start to make it better
jude.it->make(JudeState::BETTER);

 
 
David Bowie – Man Who Sold The World

English:

Oh no, not me
I never lost control
You’re face to face
With The Man Who Sold The World

C++:

// Oh no, not me
// I never lost control
assert(this->control != NULL);

// You're face to face
// With The Man Who Sold The World
Man m;
m.sell(world);
you->setFacing(&m);
m.setFacing(you);

 
 
Lady Gaga – Born This Way

English:

Don’t hide yourself in regret
Just love yourself and you’re set
I’m on the right track, baby
I was born this way

C++:

// Don't hide yourself in regret
if (!you->visible && you->regret)
    you->visible = true;

// Just love yourself and you're set
you->love(you);

// I'm on the right track, baby
getTrack(Track::RIGHT)->set(this);

// I was born this way
assert(this->state == this->creationState);

 
 
The Police – Every Breath You Take

English:

Every breath you take
Every move you make
Every bond you break
I’ll be watching you

C++:

while(true) {
    switch(you->getEvent()) {

    // Every breath you take
    case BREATH:

    // Every move you make
    case MOVE:

    // Every bond you break
    case BOND_BREAK:

    // Every step you take
    case STEP:

        // I'll be watching you
        this->watch(you);
        break;

    default:
        assert(false);
    }
}

 
 
Kanye West – Power

English:

No one man should have all that power
The clocks tickin’ I just count the hours
Stop trippin’ I’m tripping off the power
Till then, fuck that the world’s ours

C++:

// No one man should have all that power
for(int i = 0; i < men.size(); i++) {
    Man* man = men.get(i);
    if (man->has(allThatPower))
        man->remove(allThatPower);
}

// The clocks tickin' I just count the hours
setTimer(1, &countHours);

// Stop trippin' I'm tripping off the power
you->tripping = false;
bool power = true;
this->tripping = power;

// Till then, fuck that the world's ours
if (getCurrentTime() != then) {
    that->fuck();
    world.setOwner(this);
}