tags:

views:

26900

answers:

88

UPDATE:

hey everyone! sorry it has taken me so long to post pics. the cake was a HUGE success and he enjoyed every bite. but most of all, he loved the "actionscript birthday message" that graced the top of it! i wanted to thank you all for your suggestions. i have printed them and will make many more "coded" cakes as the holidays go by. i really want to do the heart "equation" for valentines day! i took peter toroks idea and tailored it for andrew's birthday cake (i asked a programmer to help me make it fit on the cake!). needless to say, andrew and all of his programmer buddies got a kick out of it and gobbled up the dark chocolate, peanut butter cake that was underneath all that nerdy icing-y goodness! here is proof:

the cake!

alt text

andrew with his cake

alt text

tania (me!) with my creation!

alt text

binary birthday candles!

alt text

so thank you ALL again! i had a lot of fun making the cake and thanks to all of you, he'll never forget it, or this birthday! -tania

+1  A: 

How about spelling "geek" in binary: 01100111 01100101 01100101 01101011

Not sure if you can easily do that with icing, but if you can, I want to see the pic!!!

David Makogon
Or, make things simpler and put his age in binary, using candles.
David Makogon
I like the age in binary idea. I think most programmers would not be able to read binary-encoded ASCII character codes, but `11001` for "25" is pretty clear.
Chuck
those are all great ones!thank you!
penelope
You could make an 8-bit number out of candles and only light the appropriate candles to signify his age... haha... awesome suggestion, @David.
San Jacinto
+5  A: 

The problem you'll find is that generally Happy Birthday isn't very exciting. It will generally look like this:

print ("Happy Birthday");
Rich Bradshaw
Many languages will not even need the parentheses or the semicolon, making this code statement even more dull in cake icing context...
Jørn Schou-Rode
i'm open to other suggestions.thanks!
penelope
+1 or print "Hello Birthday!"
kenny
A: 

There you go - 011010000110000101110000011100000111100100100000 011000100110100101110010011101000110100001100100 0110000101111001 (binary)

or a shorter version: 6861707079206400000000000000 (hex)

You're sweet for doing this in my opinion :)

Daniil
rad!and, thank you!
penelope
+1  A: 

Black & white frosting?

You could put his age in binary, or hex. Just a dumb thought.

Or maybe a smiley.

Mike Dunlavey
cool idea!thanks!
penelope
A: 

Doing something in binary might be fun, and more interesting than some programming code which gives the answer outright in a string.

Here's a text (ASCII)-to-binary converter which you can use to get the code for whatever you enter.

Good luck!

Mike Cialowicz
thank you for the suggestion!
penelope
A: 

I'd recommend 'Happy Birthday' in binary, which is;

01001000011000010111000001110000011110010010000001000010011010010111001001110100
01101000011001000110000101111001

You can create more binary text using http://www.theskull.com/javascript/ascii-binary.html

Let us know how it goes.

Ryan ONeill
very cool. thank you!i'll post pics when i make it and let you know how it went!
penelope
+176  A: 

Try:

 I ♡ U

(The code ♡ is ♡ when rendered in HTML.)

JSBangs
This is a nice idea :)
Daniil
i love it!thank you!
penelope
Doing a quick check on http://www.unicode.org/charts/PDF/U2600.pdf I see that the heart symbol (from card suits) is at code point 0x2665.
David Thornley
@David, there are a few different heart symbols. The one I used is the "open heart", not the one used for the suit of hearts.
JSBangs
@JS Bangs: Sure, just pointing out the Unicode one I found as an additional option.
David Thornley
You can also add `U+FDD0` for extra points for a xkcd reference (http://xkcd.com/380/).
Igor Klimer
ok, but not as creative as some of the others
Paul
@Igor I don't get the xkcd comic. Anyone care to explain?
Pekka
Is he going to "get it," though? Just because he's a programmer doesn't mean he knows HTML ASCII codes...
dclowd9901
@Pekka: from Wikipedia: "Basilisk is a legendary reptile reputed to be king of serpents and said to have the power to cause death with a single glance". Make sure to read the alt-text to fully appreciate the strip (as usualy with xkcd). BTW, I checked and IIRC there's no character by that code ;)
Igor Klimer
@Igor aaaaah, cheers! :)
Pekka
not bad, this is so cool
Nicolas Viennot
I just wanted to point out that this answer got me my first gold badge. *sniff* Thanks, upvoters!
JSBangs
How can you render on the cake? I'd suggest to put in the middle an iPhone with this page opened, so he can see it...
Nava Carmon
I small square U ?
Bratch
One alternate to ensure it explicitly comes across as html is to wrap it in a tag like `<div>I ♡ U</div>`
John K
Alt + 3 on keypad = ♥ (should work in most browsers)
Si
I just got a real one :) http://stackoverflow.com/questions/2420689/surprise-for-a-programmer-on-birthday/2528069#2528069
BalusC
+51  A: 

Spell out "SGFwcHkgYmlydGhkYXkK" in icing and tell him that he'll have to base64 decode it.

Seth
this one is cool, too!thanks!
penelope
Here's a handy Base64 Decoder: http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/Default.aspx
GaiusSensei
Can I spoil it and say it says "Happy birthday"?
Steven
Unccl Oveguqnl!
Mark
That's cumbersome...
Camilo Martin
A: 

Here is a table where you can get all the Decimal (or Octal or Hex) values for the letters: link text

Mark Schultheiss
thank you for the link!
penelope
+14  A: 

Awww! That's adorable. There is no code for Happy Birthday, But you could write his age in binary and put a goto before it. It's not real code together, but it gets the message across, e.g.

                                      GOTO
                                     011001

You can use the windows calculator in expert mode for getting the age into binary with a single click. The above is binary for 25 (since you mentioned he'd turn that in a comment).

Gordon
awesome!thank you!
penelope
You're welcome :)
Gordon
+113  A: 

First idea

How about writing his age in hexadecimal? E.g. for a 25 year old,

Happy 19th Birthday!

which looks wrong of course at first - it may take him a while to figure out the trick.

Update: A more obvious version:

Happy 0x19th Birthday!

Another idea

I like it even better (although it is probably too long to fit on a cake... even with shortened getter names):

for (i = 0; i < 4; i++) {
    if (i != 2)
        penelope.sing("Happy Birthday to You");
    else
        penelope.sing("Happy Birthday Dear " + penelope.boyfriend().name());
}
Péter Török
he'll be 25, so that would work.thanks!
penelope
You could also put 0x in front of the number (to make it obvious to _most_ programmers).
Michael Todd
@Michael Todd Yeah, but I think it just adds to the fun if it takes more time to realize the trick :-)
Péter Török
For my wife's birthday, I put number candles showing her age in hex, then in front of each digit four small candles that were red for 1 and white for 0. It did take her a minute or so to get it.
David Thornley
I like the hex idea. It would be especially great for older programmers. This year, I'm going to turn 0x25! Yay!
Jeffrey L Whitledge
@Jeffrey - At the moment, my own vague definition for "older" is "above 0x32"... but it might change in the future ;-)
Péter Török
I'm not sure whether Penelope's boyfriend will be happy about being loaded through `penelope.boyfriend()` though. I mean, that makes him pretty replaceable - not very romantic, is it? But if he's a real pro, he will understand that this is the only architecturally correct way to go.
Pekka
@Pekka Depends on whether Penelope has a public `setBoyfriend()` method or not (provided her 'boyfriend' is private, that is - but I am fairly sure she wants to control access to him by external parties ;-)
Péter Török
you guys crack me up!
penelope
We (advisees) gave something like that to our PhD adviser and she liked it. It was my idea of course. :p
ianalis
Or, hey. "Happy 0o31th birthday!" If you feel like making him feel like an 'old man'.
Marc Bollinger
Always a hit. I do this on co-workers' birthday cards.
Tim
@peter torok - thank you SO much for this idea. i tweaked it a little, but you deserve recognition for it! he LOVED it and all his friends got a kick out of the translation. i truly appreciate the suggestion. full of win!!!
penelope
*If only you and dead people understand hexadecimal, how many people understand hexadecimal?*
tanascius
+38  A: 
10 PRINT "HAPPY BIRTHDAY"
20 GOTO 10
JSBangs
BASIC -- how tacky
James Anderson
No. - He won't be able to stop staring at the case, you'll need to add a counter and a max count condition to the GOTO.
Danny Varod
thank you for another idea!
penelope
@James: Ya, it's pretty tacky. But how many beginners accidentally created an infinite loop like this?
George Edison
DO UNTIL HAPPY = TRUE
Camilo Martin
+170  A: 

One of my favorites: "Roses are #FF0000 violets are #0000FF all my base are belong to you."

PaulG
i love that! i'll do that one for valentines next year!
penelope
isn't it "all my base" little bit erotic :D:D ??
erasmus
@erasmus not one bit, but 8 bits erotic!
Kugel
+ 1 this is nice
Jojo Sardez
He probably saw that already if he visits slashdot.org. By the way, I suggest asking your question there too. :)
ianalis
Haha, I'm laughig my head off! Great answer, great thread :D
mnemosyn
A: 

Is he interested in any video games? Get an image from one of them. You can make a picture cake at most cake shops:

http://www.caketoppers.co.uk/graphics/44056338-item-photo_cake_picture_cake.jpg

Mike Blandford
he is, but i'd really like to "wow" him with a coded cake. thank you!
penelope
+29  A: 
while (true) { 
   print "Happy Birthday!";
   wait(1yr);   // or work/sleep/run
   age++;
}

EDIT : All programmers are immortal but eventually somebody will interrupt with Ctrl-C or throw some kind of OutofLifeException.

fastcodejava
Shouldn't that be while (!dead) {;-}
Bevan
thanks so much!
penelope
@Bevan, I think `while (alive)` would make more sense.
Wallacoloo
Yeah, `while (alive) ...` is less depressing. ;-)
Bevan
@Bevan - All programmers are immortals, see edit.
fastcodejava
sleep(60 * 60 * 24 * 365);
Arthur Kalliokoski
Arthur Kalliokoski: Careful - you miss one day every 4 years unless the year is divisible by 100 and not 400.
Maciej Piechotka
+1 Maciej; all of us with birthdays on Feb 29 say "Thank you".
Bevan
@Arthur Kalliokoski: leap year fail *lol* PS: while(alive) or if(dead) break;
Quandary
@Arthur: This assumes the sleep function doesn't accept milliseconds, or you're dead pretty quick!
George Edison
@fastcodejava -- all programmers are immortal; fastcodejava is immortal; therefore, all programmers are fastcodejava.
JXG
Wait, I think I have a bug somewhere.
JXG
+4  A: 

Do you know what language he uses at work? If you do, you could adapt any of the fantastic examples on this page to write a little program to print out "Happy Birthday!"

If you don't know what programming language he likes best, the C# example below is a pretty solid fallback choice since it has a lot of good programmer gunk in it but it is still very clear what will happen.

public class HelloWorld
{
    static int Main()
    {
        System.Console.WriteLine("Happy Birthday!");
    }
}
Clueless
C# boilerplate is not "good programmer gunk"
Joe Koberg
i don't, but i'm sure i could find out.thanks!
penelope
+1 for "good programmer gunk"
mcrumley
Heh! Reminds me of the Boo language manifesto, "The guys who came up with “public static void main” were probably kidding, the problem is that most people didn't get it was a joke. "
kenny
Well. If you mean that to explain meaning of every keyword in the example takes several chapters (Objects, Static methods etc.) in most programming books (at least it did when I learned Java in Junior High School)...
Maciej Piechotka
Heh, by "good programmer gunk" I mean the stuff that no one wants but everyone recognizes and deals with. Lines like "protected override IEnumerable<HappyBirthdayMessage> greetings() { ... };" should make any programmer groan.
Clueless
+3  A: 

Thanks everyone! There are some great ideas so far. I did google ideas for the cake, but wanted to come straight to the source and see if you guys had anything fresh. Keep them coming! I love the binary ideas - thank you for the link to the text creator.

Oh, and I am not using my real name here, in case he checks this! Shhhhhh!

:)

penelope
If he comes here I'm curious to know if he finds this question. Tell him to respond so we can hear the reaction =) It'd be hilarious if he got upvoted a lot for his own cake!
The Jug
i'll make sure to do so!
penelope
But you did use your picture...
JustSmith
Of course she did :) I still skeptic it's a she. I think it's a student trying to prove that programmers are lonely geeks that react like horny hounds to the concept of a girl paying them attention :)
Shaihi
Who cares if it is a guy? This is a question plenty of people would probably want to know an answer to. It could easily go the other way of the guy is getting his girlfriend/fiancee/wife a geeky cake. I'd understand the angle if he was faking a girl just to get a bigger reaction. Truth be told, more people are willing to help out women then men, regardless of the social group. I'm sure there's some study out there about that.
The Jug
Could you also mark the suggestion you finally use as the accepted answer (click the tick under the up/down vote counter). Also, a picture of the cake would be brilliant.
Grant Peters
A: 

Draw a schematic for a "flip flop" on the cake.

See http://images.google.com/images?source=ig&amp;hl=en&amp;rlz=&amp;=&amp;q=flip%20flop%20schematic or http://en.wikipedia.org/wiki/Flip-flop_%28electronics%29

It's not code, but it is the electronic circuit that stores 1 bit of memory. A programmer might appreciate it, and it would look cool on a cake.

That, and if he doesn't recognize it you can feel smart when you explain it to him >:)

scrapdog
that's rad!thanks!
penelope
+83  A: 

How about making the icing flash on the top of the cake?

<blink>Happy Birthday!</blink>

should do it for an older model cake. Otherwise you'll need to use this

<style type="text/css">
<!--
p#blinking {text-decoration: blink;}
-->
</style>

with

<p id="blinking">Happy Birthday!</p>
Cruachan
that is awesome! is second job is teaching a flash design class, to that would work!thanks!!!
penelope
"older model cake". Brilliant.
fbrereto
@Penelope - oh it's not flash as in Flash, it's a joke because back when the web was young you could make text flash on and off like that, but then because it was widely abused the feature was removed and to make text flash on and off you have to do it the second way now - and it doesn't work in all browsers.
Cruachan
@cruachan - see why i need your help??!! d'oh!
penelope
Ahh, blink tag...so many uses :)
Adam Neal
+1 I think this is the only time I will recommend using the blink tag *ever* :)
Igor Klimer
Downvote because I just haaaate the blink tag xD
Camilo Martin
@Camilo: you cannot be serious. I'll let you into a little secret: if you use HTML on a cake it doesn't actually work ;-)
Cruachan
I know but if I see the blink tag my brain will start parsing it into blinking text lol
Camilo Martin
@Camilo: Of course we're playing on a long tradtion - http://www.myfreewallpapers.net/artistic/wallpapers/magritte-pipe.jpg
Cruachan
@Cruachan: link down?
Camilo Martin
@camilio: hmm, well I was simply linking to Magrite's well know surrealist painting of the pipe with the words 'this is not a pipe' underneath it.
Cruachan
+9  A: 
while(DateTime.Today()==You.Birthday){
  Cake.Eat(You,"nom nom nom");
}

or...

Person You=World.People["boyfriend's name"];
while(DateTime.Today()==You.Birthday){
  You.Eat(Cake); //Nom nom nom
}
Earlz
i LOVE It!thank you!
penelope
Wait...so the first example has the `Cake` eating `You`? :)
Jonathan Sampson
@Jon Well, it would be defined as `public void Eat(Person consumer,string soundfx)`
Earlz
Is that not what cakes normally do :S
Thqr
In Soviet Russia, cake eats you!
fudgey
@fudgey: perfect!
Paul
@Jon -- you know programmers eat way too much regular cake to be any good at eating that kind -- computers are easy, but that meal is just too complicated... makes lobster look easy ;)
Hardryv
+14  A: 
if(isBirthday()){
     if(age > 16)
     {
         ALL_NIGHT = true;
     }else{
         PECK_ON_CHEEK = true;
     }
     System.out.println("Happy " + age + ", Birthday boy!");
}else{
    System.out.println("Nice try!");
}
day_trader
i'm assuming this alludes to what the lucky birthday boy may or may not get (from me) on his birthday?cheeky. i love it!
penelope
+20  A: 

Just applying the cake metaphor to the programming domain:


          candles      !   !   !   !   !      IDE? bugs?
 decorative icing   ~~~~~~~~~~~~~~~~~~~~~~~   source code
   top cake layer   |||||||||||||||||||||||   compiled source
     filler icing   -----------------------   runtime
bottom cake layer   |||||||||||||||||||||||   machine code
          platter  =========================  hardware

May include exterior coating (GUI).

harpo
very, very cute idea! thank you!
penelope
whoa! the birthday OS :D
N 1.1
+4  A: 
this.Cake.Label = "Happy Birthday!";
foreach(var Candle in Cake.GetCandles())
   Penelope.Kiss(Mike);
Serdel
but wait...who am i kissing?;)
penelope
+1  A: 

How about writing a blinking ' Happy birth day' like this

class Program
  {       
        static void Main(string[] args)
        {
            makeTextBlink("************* Happy Birth Day ***************!", 500);
            Console.Clear();
            Console.WriteLine("Here is you birth day cake.Enjoy");
            Thread.Sleep(2000);    
        }

        static void makeTextBlink(string text, int delay)
        {
            for (int i = 0; i < 10; i++)
            {
                writeBlinkingText(text, delay, true);
                writeBlinkingText(text, 500, false);
            }
        }

        private static void writeBlinkingText(string text, int delay, bool visible)
        {
            if (visible)
                Console.Write(text);
            else
                for (int i = 0; i < text.Length; i++)
                    Console.Write(" ");
            Console.CursorLeft -= text.Length;
            Thread.Sleep(delay);
        }      
  }
Wonde
another great idea. thank you!
penelope
That wouldn't fix on a cake?
Shervin
@Shervin Just means you need a bigger cake. Everyone wins!
Smalltown2000
@Shervin.How about now.
Wonde
+1  A: 

Adapted from here:

The following (when executed in a Linux shell)

echo pTaalqbirtARTlqtoqloyhqATaalqbirtARTlqtoqloy\
hqATaalqbirtARTlqRXTrqbolurieVRhqATaalqbir\
tARTlqtoqloy\!|tr fTaplbiqMthRtoyhDAmXsInxzurV RapHybi\ rthdtou,zhDeAmcsnfrn

prints out:

Happy birthday to you, happy birthday to you, happy birthday dear boyfriend, happy birthday to you!

ChristopheD
i love it!!!! thank you so much!
penelope
Can i ask how this works? echo simply prints what is fed as an arg right? I'm not too familiar with the Linux shell.
Quicksilver
`echo` indeed simply prints the string, but note that after the exclamation mark `!` this is piped (`|`) into `tr` which is a tool which takes two strings (like a 'translation table' if you will)...
ChristopheD
+32  A: 

Put a bug inside of the cake to make it more realistic. That, or in the writing you can mangle the code of your choice so that it doesn't compile correctly. To be very devious you can make it compile but throw runtime errors or even -- gasp -- no apparent compile or runtime errors at all but flawed logic that will force him wake up in the middle of the night to "debug" the cake.

RenderIn
hahaha! love it!
penelope
Just to clarify, I'm suggesting you put an actual insect inside of the cake as well as some bugs in the code.
RenderIn
@RI - ew. i was hoping a plastic one would work ;)
penelope
gummy bugs, maybe?
Mark
+2  A: 
if ( u_has_birthday_and_u_know_it() )
{
  while ( !is_full() )
    aquire_cake();
}
Maister
these keep getting more and more awesome! thank you!
penelope
LOL, this is refering to multithreading, especially mutexes.
the_drow
+304  A: 

If he is somewhat mathematically inclined, write the following in icing on the cake.

    sin(t) √|cos(t)|
r = __________________  - 2 sin(t) + 2
    sin(t) + 7/5

If he doesn't get it at first, tease him with saying that it is obvious that he should take the polar plot of it. If he still doesn't get it, tell him to enter it in WolframAlpha, that should yield the result:

alt text

You can also do the 3D version.

BioGeek
he IS and that is so cool! thanks!
penelope
nice idea Jeroen! but I think this would be too much of an icing on the cake? (0:
KMan
Brilliant ! :) ... I don't know about the cake .... but the this function will surely go to my blogspot/twitter !
Arkapravo
That's cool and an excellent idea :)
Daniil
@Kman, you can get edible ink/paper to put on top of the cake.
Greg
That's just brilliant :-)
Mike Kingscott
very cool advice, appreciate it..... :D
erasmus
Actually, in wolfram alpha, you need to enter this:r =(sin(t) √|cos(t)| ) / ( sin(t) + 7/5) - 2 sin(t) + 2 polar plot Mathematica plaintext:PolarPlot[{2 - 2 Sin[t] + (Sqrt[Abs[Cos[t]]] Sin[t])/(7/5 + Sin[t])}, {t, -Pi, Pi}]
Quandary
Too easy. I gave my non-geek ex-girlfriend the equations of a cardioid for Valentine's and... nevermind :)
ianalis
Best of all, the 3D heart is given by a *sextic* equation
Dancrumb
I'm definitely using this function as a pick-up line
Martin
Oh, yes, because all programmers can resolve a maths equation like that instantly and plot its graph.
Beau Martínez
Don't render it upside down or it starts to look like anatomy. Or maybe yes depending on the situation.
John K
shouldn't `t` be a theta?
rlbond
Sweet ! Beautiful
Trefex
Love it. That's gold.
WOPR
+96  A: 
HAI
CAN HAS CAKE?
KTHXBYE
Paul Ruane
cute idea! thanks!!
penelope
Want to up vote this more. MOAR.
Kirschstein
haha, best idea. sorry i can upvote only once
Faisal
@Penelope, in case you didn't know, this is a real programming language called LOLCODE: http://lolcode.com/
Vicky
For his birthday, it surely should be CAN HAS CAKE!
peterchen
IM IN YR ANSWER, CLIKING YR UPVOTES
Christian Hayter
OK, this one is the BEST, by far !! But he has to know lolcats
Matthieu
LOL this one is very creative!!
Camilo Martin
+15  A: 

Use a QRCode -- then you can encode any message, website, etc. He should already have the application to read it in his smartphone with camera.

mobibob
You have seen this, right? http://www.flickr.com/photos/janetmck/sets/72157617783414773/Recursive QR Code Cake!
Vicky
that is so cool!thank you!
penelope
Hi Vicky,No, I have not seen that flickr posting for recursive QR code cake -- that is hilarious. I am just interested in the application of QRCodes and my suggestion was completely off the top of my head.
mobibob
+8  A: 

Since I saw your guy does stuff with Flash, he might appreciate decorations around the side of your "layer cake" with this familiar interface (the layers and timeline panels):

There's a few cheeky things you could do, like name the layers for yourselves or make as many layers as there are in the actual cake, or putting the "keyframe" (the red line and dot) at his age. (instead of frame 1)

alt text

Jeff Meatball Yang
Lol would be complicated but awesome idea! - (around the base of the cake that is)
Thqr
how neat! i am so glad i came to this site - you guys all rock!thanks!
penelope
This one's definitely a job for that transfer-paper stuff they use to put pictures on cakes.
Hugh Brackett
A: 

Assuming his name is John, and it's his 25th birthday:

john.age++;
assert(john.
  age == 25);

Short enough for a cake, and it depicts the event.

Pavel Shved
another good one.thanks!
penelope
+2  A: 

Simply take him to one Good Restaurant for candle light dinner and say "Happy Birthday Sweetheart".

raaz
i don't get it...
echo
i want to say human emotion do not need any programing language to express your love.Be simple and be honest to express your emotion and love.
raaz
raaz - it's a great idea! i plan on doing that, too. but wanted to make him an awesome cake as well!
penelope
If money is no problem, and he doesn't mind time travel, you should have your dinner at Milliways. That's guaranteed to impress him!
Jørn Schou-Rode
+8  A: 
|   |_ () \/ [-   `/ () |_|
Anantha Kumaran
simple and cool! thanks!
penelope
+45  A: 

How about a simple

Happy ++age

ammoQ
So that would be happy 24th, then he would turn 25? :)
RCIX
You'd do better to say Happy ++age;
Sorpigal
I agree with both of you, and have edited my answer accordingly.
ammoQ
thank you for another cool idea!
penelope
Don't let him read it twice!
Strilanc
+3  A: 

Or do it in Objective-C if he likes Macs and stuff ;p


- (Party)birthday:(Person)person age:(NSInteger *)age {
    Party *yours = [Party initWithPerson:person];
    [yours celebrate];
    return yours;
}

/* call party */
[[self birthday:john age:25] eatCake];
Luuk van Rens
Thanks for voting down my first post :< Would you like to share what's wrong with it?
Luuk van Rens
he does like macs.thanks!
penelope
objective-c haters? don't take it personally :p +1 from me, even if that does look like a hideous language :D
Mark
+6  A: 

This is a variant of the "iconic" hello world program, that is more or less the first program anyone would write when learning a new programming langague. When compiled and the executed, it would print the string "Happy birthday."

Well, far from awesome but I think I would appreciate it. Bonus for texting with a typewriter-like style and the coloring :-)

Old school C (original K&R )

main( )
{
    printf("happy birthday!\n");
}

Standard-conforming, maybe not as iconic, and perhaps too long on a cake.

#include <stdio.h>

int main(void)
{
    printf("Happy birthday!\n");
    return 0;
}

Or in the style of the famous anonymous ioccc entry:

int i;main(){for(;i["]<i;++i){--i;}"];read('-'-'-',i+++"Happ\ 
y Birthday\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);}
KarlP
Earlz
thank you for the idea and the explanation!
penelope
+1  A: 

How about some scripting language code?

do
    me.eatSlice(cakeLib.getBirthdayCake())
while not full and (me.CanSee(codeOnCake))
RCIX
thank you for the idea!
penelope
comes with a free 'do me' at the front!
Hardryv
+4  A: 

The cake is a Pi! :-)

http://www.instructables.com/id/Pi-Cake/

ChrisV
Pi are squared? Pi are not squared, pi are round. Cornbread are squared.
mpez0
HARHARHAR. +1 HAR.
Mark
cute! thanks!!!
penelope
+154  A: 
--yearsLeftToLive;
moogs
Wow, morbid. But as I am evil, +1, it made me laugh.
Smalltown2000
this should really be optimized to --yearsLeftToLive;
BarrettJ
What is the value of `yearsLeftToLive` initialized to?
fastcodejava
@fastcodejava: You don't know until it hits 0.
Mark
The older you are, the longer you're likely to live, statistically speaking.
Ya but it could wrap if it hits 0 and it's unsigned. Otherwise you have a negative age. Don't know what that means.
George Edison
maybe i'll make that one for him when he hits the big 3-0!
penelope
That is too sad!
Camilo Martin
`++yearsYoung;` would make me feel better
dotjoe
+6  A: 

The Cake is a lie The Cake is a lie The Cake is a lie

A nice reference to the game "Portal" and the UK-Series "The IT-Crowd" :D

Example: http://u.nu/6m9n7

gewuerzwiesel
ha ha! great show!
penelope
Better yet..... give him a big cupcake or pie and write on it, "The cake was a lie"
Mark
A: 
 static void Main(string[] args)
    {
        Console.ForegroundColor = ConsoleColor.Yellow;
        makeTextBlink("Happy Birth Day  !", 500);         
    }

    static void makeTextBlink(string text, int delay)
    {
        for (int i = 0; i < 10; i++)
        {
            writeBlinkingText(text, delay, true);
            writeBlinkingText(text, 500, false);
        }
    }

    private static void writeBlinkingText(string text, int delay, bool visible)
    {
        if (visible)
            Console.Write(text);
        else
            for (int i = 0; i < text.Length; i++)
                Console.Write(" ");
        Console.CursorLeft -= text.Length;
        Thread.Sleep(delay);
    }      
}
Varun Kumar
i am going to need a HUGE cake for this one!
penelope
+1  A: 

Animated!

<Marquee>Happy <b/>day

With proper wrong markup to test his standards skills.

Or in Enterprise application Tiers written on the sides!

   i  i  i  i  i  i  
[----Presentation----]
[---Infrastructure---]
[----Persistence-----]
[-------Domain-------]
F.Aquino
ok, now THAT Is really sweet!
penelope
+6  A: 

If he likes lolcats, forget the cake and just give him a note saying “I MADE YOU A CAKE BUT I EATED IT :(”

Paul D. Waite
ha ha! maybe another year!i can haz cake nows?
penelope
very good jokes
4thpage
+76  A: 

In combination with these any of these answers, you could put just five candles on the cake. Light the first two, leave the next two unlit, and then light the last one. This is the binary representation of 25. Besides being geeky, it will leave more space on the cake for your writing/drawing too.

 ^  ^        ^
 |  |  |  |  |
 |  |  |  |  |
 |  |  |  |  |
Josh
i absolutely LOVE this idea. he will, too!thanks!
penelope
that, and it will baffle him for quite awhile (why didn't you light the other 2?! why are there only 5 candles?!) 'course..he has to look at it from the right side too... it's 19 the other way around :D (10011)
Mark
From the other side, it would look like 19... yet 0x19 is the hexadecimal of 25. Double win!
Jeff Meatball Yang
(don’t forget to indicate which one is the least significant candle!)
Timwi
A: 

Why not to write something shorter in Assembly? It is classier to me :)

frbry
thank you for the suggestion :)
penelope
methinks that'd be quite a feat for her to learn assembly just to make a cake out of it ;)
Mark
+3  A: 
sudo shout 'Happy Birthday!'
n002213f
but why do we need sudo?
Mark
you need privileged access to do this, they are an item.
n002213f
If the relationship lasts, there's going to be a lot more sudoing for him.. ;)
Marcus Lindblom
LOL, isn't this the norm rather the exception.
n002213f
oh goodness - now sudo stands for something dirty these days?thanks for another cute idea!
penelope
Is this a reference to http://xkcd.com/149/ ?
Andrew Grimm
A: 

I see a couple of people have had the lolcat idea. I was thinking of something a little different:

  • Cat face and paws posessively across the top

  • I cn haz cake???

Hugh Brackett
very cute idea!thank you!
penelope
A: 
If My.Birthday > lastBirthday Then
    Response.Write("Happy Birthday")
Else
    Response.Write("The cake is a lie")
End if

Simple and probably wrong, but combines Portal and programming.

Liam
i love how "the cake is a lie" seems to be a recurring theme!thanks!
penelope
@penelope: “the cake is a lie” is a plot detail from a popular video game called “Portal” (the player character is promised cake if she solves the puzzles in the game). If your boyfriend doesn’t know it then this joke is going to be lost on him.
Konrad Rudolph
+21  A: 

Give him an un-iced cake and tell him that, due to a last minute critical bug, you had to pull the icing feature to make your deadline.

Greg
LOL!i bet he would get a kick out of that!
penelope
Or you could ice the sides but "miss" the top. In programming missing the end by 1 is called fencepost error. For a better-looking cake you could "miss" the bottom half inch.
Hugh Brackett
what a rad idea! thanks, hugh!
penelope
@Hugh: Or ice the plate as well, #@!#@!# icing overflow! (The fencepost error, on the other side: one too many.)
derobert
lol, I wish my programs threw icing overflows. But then I'd probably end up looking (more) like this guy: http://fuzzybuzz.wordpress.com/2009/06/25/
Greg
+2  A: 

Happy Birthday

William McVey
i'm going to assume that that is something awesome and thank you!
penelope
That is a special type of 2d barcode. It can encode a lot more info than the standard type. I'm sure there are decoders somewhere. William McVey could have included an explanation.
TRiG
QR codes are awesome!
James Brooks
A: 

Boyfriend.Age++;

Wallbasher
thank you for your suggestion :)
penelope
+10  A: 

You should put a Unix timestamp on the cake with seconds passed since he was born. That's all my creative mind has got. :(

Joe Majewski
it's definitely something to think about!thanks!
penelope
Something like "Happy time_t = xxxxxx !"
Graphics Noob
A: 

You might get a good answer here:
http://www.perlmonks.org/

Max E.
thanks for the suggestion :)
penelope
+1  A: 

I saw you said he teaches Flash..

maybe something like this:

gotoAndPlay("bedroom");

in Flash gotoAndPlay() used to be a way to send the play head to a particular frame in the timeline where "bedroom" would be the frame label.

John Isaacks
clever idea!thank you!
penelope
A: 

If he's familiar with JavaScript, maybe packer will be some alternative

eval(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[e]}];e=function(){return'\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('4("0 3 1 2!");',5,5,'Happy|to|you|birthday|alert'.split('|'),0,{}))

That's packed JavaScript code that will return:

alert("Happy birthday to you!");

apis17
that is quite a lot to put on a cake, but a great suggestion, nonetheless. thanks!
penelope
:) maybe can base64_encode.
apis17
+1  A: 

Just type the following on the cake:

010010000110000101110000011100000111100100100000 010000100110100101110010011101000110100001100100 0110000101111001

It means Happy Birthday!

azamsharp
binary birthday. love it! thanks!
penelope
How do you type on a cake?
Tim Post
A: 

Try something like this

hallie
i'm proposing now? oh geez! i thought i was just making a cake!;)
penelope
+2  A: 

Chocolate frosting with green icing. Unix prompt for extra points!

markdorison
i love these added touches you guys keep sending me. thanks!
penelope
A: 

The comments on Flash made me think of this flash drive USB cake

Maggie
i *heart* cakewrecks! one of my favorite sites!
penelope
A: 

what about this.

string str = "yadhtribyppah";            
char[] charArray = str.ToCharArray();
int len = str.Length - 1;            
for (int i = 0; i < len; i++, len--)
{
    charArray[i] ^= charArray[len];
    charArray[len] ^= charArray[i];
    charArray[i] ^= charArray[len];
}
Console.WriteLine(new string(charArray));
Adeel
thank you - would you mind explaining to the noob just what it says?
penelope
what if he hates hungarian naming?
Behrooz
+2  A: 

I would suggest:

void Person::birthday()
{
    if( ++age == LIFE_EXPECTANCY)
        death();
    else
        party_on();
}
Quicksilver
pff... I plan on outliving my expectancy thank you very much.
Mark
"party on" is my favorite part!thanks!
penelope
+3  A: 
string str = "yadhtribyppah";                        
char[] charArray = new char[str.Length];
int len = str.Length - 1;
for (int i = 0; i <= len; i++)
    charArray[i] = str[len - i];            
Console.WriteLine(new string(charArray));
Adeel
and what does it say?
penelope
it reverse the string. For Example if string is 123 initially it convert into 321. so it will reverse the string yadhtribyppah to happybirthday. The same thing is happening in my other answer but with different reverse logic.
Adeel
that is so cool!thanks!
penelope
+5  A: 

If he's also a gamer, just have a plate with the note 'There is no cake' - he'll get it.

YogoZuno
this seems to be a favorite here.thanks!
penelope
+2  A: 

Thanks guys. I'm turning 30 today, and I got THIS cake from my colleagues at work (not my girlfriend though)! It's my best cake ever (huge fan of LOLCODE!) http://www.salomonsson.se/LOLCAKE.jpg

/Tommy

happy birthday!
penelope
+1  A: 

What about the following?

    using System.Love;
    using System.Birthday;

    namespace YourCake 
    {
        public class HappyBirthday : ILoveable
       {
           void SayMillionTimes()
           {
              for (int i=0;i<1000000;i++)
              {System.Console.WriteLine("Happy Birthday!");}
           }
       }
    }  
M.H
awesome idea.thank you!
penelope
+1  A: 

How about you just send him a virtual cake?

code cake

Brian Scott
i could, but they don't taste nearly as good as the cakes i bake from scratch!
penelope
Why using an anonymous function?
M28
Because the message generator would only take so many characters :-)
Brian Scott
+2  A: 

Try

while(happy) { ++kissme; }

jaderanderson
cute stuff!thanks!
penelope
Be careful. Realize that once you enter this loop, there's no escaping, as nothing inside the loop will ever change "happy" to a non-true value.
Wallacoloo
+4  A: 

What about <blink>Happy Birthday!</blink> ?

thank you for the idea!
penelope
+4  A: 

Mmmm ... make cup-cakes with alternate black/white icing such that black represents 1, and white represents 0. Then arrange them to represent the binary equivalent of 'Happy Birthday'

01001000011000010111000001110000011110010010000001000010011010010111001001110100
01101000011001000110000101111001

Would be one bunch of cup-cakes to bake though ... or you might even use empty cups to represent the 0s

For what it's worth, it's thoughtful of you

Everyone
that is a cute idea, too! it would be great for a party.thank you for the idea and the compliment!
penelope
+8  A: 

If he's a fan of best practices you could serve up a more modular cake:

Cake Best Practices

walpolea
this is another great idea!thanks!
penelope
just so long as it's not "half-baked" in.
San Jacinto
previousAge, newAge, birthYear, so redundant :P
Wallacoloo
+1  A: 

Or you can write this:

Wising your code always remain bug free

Nnp
another cute idea.thanks!
penelope
A: 

'(HAPPY BIRTHDAY!)

(works best if you have a lisp, maybe?)

JXG
short and sweet!thanks!
penelope
+1  A: 

Model the Tower of Hanoi problem: Have three small cakes of various heights, and stick a gingerbread stick through the center of each cake.

(I knew a computer science grad student named Adam who did something like this at a party for a prospective grad students. He called it "Hanoi Surprise.")

Winston C. Yang
ingenious!thanks!
penelope
A: 

Every programmer, while he/she is a beginner, almost always write a program that just prints "Hello World".

Just like:

int main()
{
    printf("Hello World");
    return 0;
}

Why not write Hello World on the cake?

neverend
another great idea!thank you!
penelope
+1  A: 
<cake text="Happy Birthday">
    <ingredients.../>
</cake>
benPearce
awesome idea!thank you!
penelope
+4  A: 
Happy Initialized Day !
NAVEED
i like it!thanks!
penelope
+18  A: 

Give him flour, eggs, sugar, etc .. a recipe and tell him its open source, sorry ... he has to configure and build it himself.

Then ask for patches.

Tim Post
as hilarious as that would be, it would make me feel terrible!
penelope
@penelope: Well, you have an entire evening :) Thanks for a chance to express a little humor and have some fun.
Tim Post
@penelope: The ingredients could come before the _real_ cake, too :)
Tim Post
that's true! i could do that and then whip out a fully exeucted cake later on in the night and say that i put in some overtime. and, you're welcome! i'm glad the majority of you guys are having fun with this. but more to the point, thank YOU for your suggestion!
penelope
What would be the best configure options? `--enable-shared --enable-cocoa --enable-peanut-butter.jar`? He'll definitely want `--disable-dependency-tracking` which "speeds up one-time build" :)
Daniel Trebbien
+3  A: 

As to the other Portal references, promise him a cake, send him through many tasks to get this cake, then only show him a picture.

He'll cherish the thought more than the cake that way :D

James Brooks
i don't think he plays portal, but he knows what it is and as funny as that would be, he'd miss out on one of my delicious cakes!
penelope
That is very true! If your cakes are as delicious as you say they are, send me a nom nom please :D?
James Brooks
A: 

Does he still remember his birtday? If I were you I made a cake which like a computer. And I wrote its screen "today is your birtday still remember this?":P But I'm surprising not the only programmer that has a girlfriend but also his girlfriend loves him=) And also his girlfriend is a human being =). You should be sure you love enough to make him happy=)

ibrahimyilmaz
lol - yeah, he has a gf and i just so happen to be human!
penelope
A: 

It's more of a Math thing but I would like it ^^

Baring my Heart

Helper Method
that's hilarious!!!
penelope
+2  A: 

What about BrainF-ck?

[-]>[-]<>++++++++[<++++++++>-]<++++++++.>+++++[<+++++>-]<.>++++[<++++>-]<-..>+++[<+++>-]<.>+++++++++[<--------->-]<--------.>++++++[<++++++>-]<--.>++++++[<++++++>-]<+++.>+++[<+++>-]<.++.>+++[<--->-]<---.----.---.>+++++[<+++++>-]<-.
Matt S.
you can run it in here http://koti.mbnet.fi/villes/php/bf.php
Moak
well, it's certainly different!
penelope
+3  A: 

Well, programmers are almost always constrained by deadlines. More often than not it is not met ;).

So your cake could say "Congrats - Milestone 25 reached on time"

stackoverflow
i like it!thanks!
penelope
A: 
my $birthday="04/26/1984";
if(now()==$birthday)
{print "Happy Birthday!";}
else
{print "hello world";}
exit;
CheeseConQueso
very cool!thanks!
penelope
Assuming that the `now` subroutine always returns the current date in "mm/dd/yyyy" format, wouldn't you need to use the string equality operator `eq` instead of the numeric equality operator `==`?
Daniel Trebbien
@daniel - if i got really, really, really serious about it, yes i might need `eq`
CheeseConQueso
+4  A: 

xkcd birthday cake

Mike Howard
i saw this one online! cool!
penelope
You...must do this. I force you to do this.
Martín Fixman
A: 

alt text

ohho
he actually doesn't want one
penelope
did he say why? ;-)
ohho
he said it doesn't do all the things he'd like it to
penelope
be warned, he's not ready into marriage ;-)
ohho
It doesn't do a lot of things it should
Jeff Davis
+9  A: 

Today was my b'day and guess what?

alt text

BalusC
Happy Birthday!mmmm. moist, delicious cake...
Hugh Brackett
happy birthday! awesome surprise!
penelope
Thank you :) My wife saw your topic here, ordered it at Baskin Robbins (cake with Hokey Pokey ice cream). They failed for 2 times though. First they didn't get the characters right, the ampersand became an `e` and the semicolon became a `j`. In a second attempt they put the semicolon at the wrong line (which has been corrected as you can see at the picture). So, be warned whenever you order a cake with "weird" characters! ;)
BalusC
+9  A: 

The cake was a HUGE success and he enjoyed every bite. But most of all, he loved the "actionscript birthday message" that graced the top of it! I wanted to thank you all for your suggestions. I have printed them and will make many more "coded" cakes as the holidays go by. I really want to do the heart "equation" for valentines day! I took Péter Török's idea and tailored it for Andrew's birthday cake (I asked a programmer to help me make it fit on the cake!). Needless to say, Andrew and all of his programmer buddies got a kick out of it and gobbled up the dark chocolate, peanut butter cake that was underneath all that nerdy icing-y goodness! Here is proof:

The cake! alt text

Andrew with his cake! alt text

Tania (me!) with my creation! alt text

Binary candles! alt text

So thank you ALL again! I had a lot of fun making the cake and thanks to all of you, he'll never forget it, or this birthday! -Tania

penelope
win!! you should update the original question with this, otherwise no one's going to see it
just did it! thank you for the suggestion!
penelope
nice one an a good idea for me..
kc rajput