379

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

310

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.

181

Try:

 I ♡ U

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

173

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

165
--yearsLeftToLive;
116 accepted

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());
}
98
HAI
CAN HAS CAKE?
KTHXBYE
86

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>
79

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.

 ^  ^        ^
 |  |  |  |  |
 |  |  |  |  |
 |  |  |  |  |
52

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

46

How about a simple

Happy ++age

38
10 PRINT "HAPPY BIRTHDAY"
20 GOTO 10
33

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.

31
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.

21

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).

21

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.

19

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.

16

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.

15
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!");
}
15

"Happy Birthday!", in ascii: 48 61 70 70 79 20 42 69 72 74 68 64 61 79 21

If he doesn't have the ascii codes memorized (as all good programmers do :P ), you can show him http://www.asciitable.com/ and let him decode the message himself.

14

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).

11

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

10

Today was my b'day and guess what?

alt text

10

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

9
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
}
8

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

8
|   |_ () \/ [-   `/ () |_|
8

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);}
8

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

Cake Best Practices

6

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

6

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

5

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

print ("Happy Birthday");
5

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

5

xkcd birthday cake

4

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!");
    }
}
4
this.Cake.Label = "Happy Birthday!";
foreach(var Candle in Cake.GetCandles())
   Penelope.Kiss(Mike);
4

The cake is a Pi! :-)

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

4

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

4

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

4
Happy Initialized Day !
3

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!

:)

3

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];
3
sudo shout 'Happy Birthday!'
3

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

3

What about BrainF-ck?

[-]>[-]<>++++++++[<++++++++>-]<++++++++.>+++++[<+++++>-]<.>++++[<++++>-]<-..>+++[<+++>-]<.>+++++++++[<--------->-]<--------.>++++++[<++++++>-]<--.>++++++[<++++++>-]<+++.>+++[<+++>-]<.++.>+++[<--->-]<---.----.---.>+++++[<+++++>-]<-.
3

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"

2
if ( u_has_birthday_and_u_know_it() )
{
  while ( !is_full() )
    aquire_cake();
}
2

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

2

Happy Birthday

2

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

2

I would suggest:

void Person::birthday()
{
    if( ++age == LIFE_EXPECTANCY)
        death();
    else
        party_on();
}
2
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));
2

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

2

Try

while(happy) { ++kissme; }

2

Or you can write this:

Wising your code always remain bug free

2

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.")

1

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!!!

1

Black & white frosting?

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

Or maybe a smiley.

1

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);
        }      
  }
1

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!

1

How about some scripting language code?

do
    me.eatSlice(cakeLib.getBirthdayCake())
while not full and (me.CanSee(codeOnCake))
1

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-------]
1

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.

1

Just type the following on the cake:

010010000110000101110000011100000111100100100000 010000100110100101110010011101000110100001100100 0110000101111001

It means Happy Birthday!

1

How about you just send him a virtual cake?

code cake

1
<cake text="Happy Birthday">
    <ingredients.../>
</cake>
1

C++ perhaps?

#include <person.h>
#include <time.h>

int main(int argc, char **argv)
{
    Person *you = new Person("Boyfriend's name");
    Person *me = new Person("Your name");

    Time tonight = new Time("20:00");
    you->makeLove(me, tonight);

    return you->getHappiness();
}
1

Just give him a BJ.

I don't care how geeky we claim to be - that would beat any nerdy gimmick.

0

There you go - 011010000110000101110000011100000111100100100000 011000100110100101110010011101000110100001100100 0110000101111001 (binary)

or a shorter version: 6861707079206400000000000000 (hex)

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

0

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!

0

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.

0

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

0

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

0

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

See http://images.google.com/images?source=ig&hl=en&rlz=&=&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 >:)

0

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.

0
 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);
    }      
}
0

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

0

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???

0
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.

0

Boyfriend.Age++;

0

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

0

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!");

0

Try something like this

0

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

0

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));
0

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!");}
           }
       }
    }  
0

'(HAPPY BIRTHDAY!)

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

0

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?

0

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

Baring my Heart

0

alt text

Linux User :)

-2
my $birthday="04/26/1984";
if(now()==$birthday)
{print "Happy Birthday!";}
else
{print "hello world";}
exit;
-4

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=)

-4

alt text