Mark CF, if you're reading this, shoo!
January 23, 2007 10:27 PM   Subscribe

How do I wish my programming-geek boyfriend "Happy Birthday" and tell him "I love you" using computing code?

My boyfriend's birthday is coming up and I'd like to get him something that would amuse him. We're both geeks, and he loves programming, so I thought I'd get him a message in code. Thing is, I don't program, so I have no idea what and how to code. I remember a website that did "99 Bottles of Beer on the Wall" in as many coding languages as possible, so I'm looking for the romance variant.

He mainly codes in C# (for uni), though he also works a lot with Visual Basic, Javascript, and HTML & CSS. I'm looking for some code that:

* Takes his birthday (Feb 10th 1987) and prints out his age, or does something cool with it

* Tells him "I Love You" and/or "Happy Birthday"

This code will most likely be printed on a card, so it doesn't have to be part of a functioning program. The idea is that he'll work out the message by reading and parsing the code - "Roses are #FF0000, Violets are #0000FF, chown -R you ~/base" worked really well and I'm looking for something like that. Something sexy works too, hahah!

Google isn't helping me, though it's possibly because I don't know what to search for.

any other geeky+romantic+sexy code/pictures/links/comics/ideas etc to share with my boyfriend would be much appreciated too! Thank you!
posted by divabat to Computers & Internet (25 answers total) 32 users marked this as a favorite
"..any other geeky+romantic+sexy code/pictures/links/comics"

XKCD:A webcomic of romance, sarcasm, math, and language. (see things like this and this..or, you know, the massive list)
posted by niles at 10:40 PM on January 23, 2007 [2 favorites]

Binary, via

Happy Birthday - 01001000 01100001 01110000 01110000 01111001 00100000 01000010 01101001 01110010 01110100 01101000 01100100 01100001 01111001

I love you - 01001001 00100000 01101100 01101111 01110110 01100101 00100000 01111001 01101111 01110101

His birthday in pi.
posted by geekyguy at 10:51 PM on January 23, 2007

You could always just write Happy Birthday in Hexadecimal:

48 61 70 70 79 20 42 69 72 74 68 64 61 79

Or Morse Code:

.... .- .--. .--. -.-- -... .. .-. - .... -.. .- -.--

But it might take a bit more translation than you want.
posted by JekPorkins at 10:53 PM on January 23, 2007

You might type in something like, "Happy Birthday, my dear! XOXOXOX" or other gooshy stuff into this Perl obfuscation script.

Into a new text file, enter:

copy and paste the script's output here

Save the file as something like

He would type in perl, for example, to execute the script and get back your message of true love.

The particulars of this may be a bit different for Windows but will work fine under Mac OS X or any form of Linux.
posted by Blazecock Pileon at 10:53 PM on January 23, 2007 [1 favorite]

You could build a little .gif that went line by line through the C# code to output "I Love You" or "Happy Birthday".

Here's a coupla lines that will output text (referred to as a "Hello World" program):
using System;
public class HelloWorld
public static void Main()
Console.WriteLine("HELLO WORLD");
...Where "HELLO WORLD" is your sentiment of choice. At the very end your sentiment 'prints out'.
Caveat: I don't know C#—I copied the code from Hello World In Different Styles.
posted by carsonb at 11:14 PM on January 23, 2007

Response by poster: carsonb's on the right track with what I'm looking for, yay!

Blazecock Pileon: I don't think he'll be anywhere that can execute Perl (i.e. his computer) when he gets the message, but that is an idea worth considering!

Numbers isn't exactly his thing, though the binary/hex might make him laugh.

niles: I've been stockpiling on XKCD for a while now :D any others like it? It's searching through archives that hurts me.

thanks people! keep them coming!
posted by divabat at 11:36 PM on January 23, 2007

Best answer:
ASSERT(You.Birthday() == HAPPY)

posted by null terminated at 11:51 PM on January 23, 2007 [6 favorites]

Best answer: You could also have the birthday candles lit in binary. 34 in binary is 100010. So have six candles, but only light the 6th and 2nd candle. Err...however depending on your perspective, it might also stand for 17.
posted by Cog at 12:09 AM on January 24, 2007 [3 favorites]

compile this, ignore the warning:

#define h int
#define a main() {

#define pp printf (
#define yb "I "
#define i "l"
#define r "ov"
#define t "e y"
#define hd "o"
#define ay "u\n"); }

h a pp yb i r t hd ay
posted by aberrant at 12:13 AM on January 24, 2007 [7 favorites]

Best answer: 10 PRINT "I LOVE YOU"
20 GOTO 10

He'll laugh.
posted by Simon! at 12:27 AM on January 24, 2007 [8 favorites]

Best answer: Javascript:

window.onload = function () {
var you = document.getElementById("myLove");
you.addEventListener("birthday", happy);
posted by cheerleaders_to_your_funeral at 1:05 AM on January 24, 2007 [1 favorite]

Oh, you definitely should put candles on his cake for his age - in binary. Mine would have six candles, but only 2 lit.
100100 = 36, light the 1's, leave the 0's unlit.
Easier to blow out, too.
posted by ctmf at 1:10 AM on January 24, 2007

Best answer: Head over to the Perl Monks poetry page and see if there's anything that takes your fancy, such as:

package Love;

sub desire {
my $Life = shift;
return bless
my $silence = sub {
print "My only love - ",
shift, "!\n"
}, $Life

$me = Love->desire, $me->('Reni')
posted by Ritchie at 4:25 AM on January 24, 2007

Hey, aberrant's is pretty good!
posted by intermod at 4:51 AM on January 24, 2007

Too long to print on a card, but I can't resist posting this IOCCC classic:
	double time, me= !0XFACE,
	not; int rested,   get, out;
	main(ly, die) char ly, **die ;{
	    signed char lotte,

dear; (char)lotte--;
	for(get= !me;; not){
	1 -  out & out ;lie;{
	char lotte, my= dear,
	**let= !!me *!not+ ++die;

"The gloves are OFF this time, I detest you, snot\n\0sed GEEK!");
	do {not= *lie++ & 0xF00L* !me;
	#define love (char*)lie -
	love 1s *!(not= atoi(let
	[get -me?

(char)lotte: my- *love -
	'I'  -  *love -  'U' -
	'I'  -  (long)  - 4 - 'U' ])- !!
	(time  =out=  'a'));} while( my - dear
	&& 'I'-1l  -get-  'a'); break;}}

(char)*lie++, (char)*lie++; hell:0, (char)*lie;
	get *out* (short)ly   -0-'R'-  get- 'a'^rested;
	do {auto*eroticism,
	that; puts(*( out
	    - 'c'
-('P'-'S') +die+ -2 ));}while(!"you're at it");

for (*((char*)&lotte)^=
	(char)lotte; (love ly) [(char)++lotte+
	!!0xBABE];){ if ('I' -lie[ 2 +(char)lotte]){ 'I'-1l ***die; }
	else{ if ('I' * get *out* ('I'-1l **die[ 2 ])) *((char*)&lotte) -=
	'4' - ('I'-1l); not; for(get=!

get; !out; (char)*lie  &  0xD0- !not) return!!

	do{ not* putchar(lie [out
	*!not* !!me +(char)lotte]);
	not; for(;!'a';);}while(
	    love (char*)lie);{

register this; switch( (char)lie
	[(char)lotte] -1s *!out) {
	char*les, get= 0xFF, my; case' ':
	*((char*)&lotte) += 15; !not +(char)*lie*'s';
	this +1s+ not; default: 0xF +(char*)lie;}}}
	get - !out;
	if (not--)
	goto hell;
	    exit( (char)lotte);}

posted by Khalad at 11:56 AM on January 24, 2007 [4 favorites]

Just say what you want to say; but obfuscate it so that he has to manually type it in.

On the front of the card:


On the back of the card:

sed '/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/.//;s/[^a-eh-ik-lo-prt-wy]//g;s/[ck]/ /g'

(make sure you copy it exactly as shown; you might want to get techie help, or paste it into an e-card)

That should do it.

for the unix-challenged: echo "znjufgomyjjqscqejmmvxfqojlgnkxsfnjqigksyjadhfmtriqgbjcqgypfpmjjaghn" | sed '/\n/!G;s/\(.\)\(.*\n\)/&\2\1/;//D;s/.//;s/[^a-eh-ik-lo-prt-wy]//g;s/[ck]/ /g' generates the text happy birthday i love you
posted by davejay at 1:11 PM on January 24, 2007

One possible variation to make it more personal, is to take the idea of code and spin it around its head.

Something like this, for example:

public static void MessageGreeting()
* I so wanted do to learn C#,
* And all I can make do is this lousy crap.
* Roses are #FF0000, Violets are #0000FF
* All I want to say: Happy Birthday to You!

(The above verse was just an example. I fully expect you to write something better.)

Then again, in my experience in these matters (which isn't much, admittedly), girls dig silly poetry more than guys do, so YMMV.

Hey, one possible idea: if your bf accesses some piece of code on a regular basis, perhaps through some version control or something, might be an idea to introduce this into actual code he's likely to see. Would be quite an interesting surprise for him if you can. The caveat, though, is that if you put it, and he misses seeing it, then it wouldn't be so cool.

(Yes, that's correct: I write most of my comments in my code at work in verse. Or, failing which, they have Shakespearean/ sci-fi references. In short, kids, do NOT give your methods names such as ReturnOfTheJedi(). It may be fun, but it is not professional. )
posted by the cydonian at 7:05 AM on January 25, 2007

function r(c){var a=~c; return Math.floor(~a-1/(Math.floor(~(a|32)/13)*2-11)*13);}function r13(s){ var a = s.split('); for (var i=0; i  a[i] = r(a[i].charCodeAt(0)); return String.fromCharCode.apply(null,a);}alert(r13('Unccl Oveguqnl. V ybir lbh.'));
You can also tell him there is a bug in the code and ask him to fix it.
See here to construct different rot-13 messages.
posted by MonkeySaltedNuts at 1:16 PM on January 25, 2007

Response by poster: the cydonian: I'd like to insert something in his code, but we're long distance at the moment and I have no access to his computer, so that won't work.

The "idea of code" thing works, though, like Ritchie's poem.

I know HTML and CSS and some BASIC, and that's it. I wouldn't know how to compile things. I don't know if he knows Perl, he doesn't work with it all that much. This code will need to be something he can understand just by reading it, because I don't think he'll have access to a server or a computer that lets him decode stuff.

thanks, keep them coming!
posted by divabat at 4:31 PM on January 25, 2007

For my dear computer smart friend, I did the birthday cake candles in binary...he was turning 29 I think, and I put 8 candles:

. . . * * * . *
| | | | | | | |

The ones with "*"s are lit. That's 29 in binary, equivalent to 00011101. I didn't explain it, but he got it right away.

(If you need help converting his age to binary, let us know -- I'm sure someone here can help. If he is over 255, god bless!)
posted by TonyRobots at 6:56 PM on January 25, 2007

Divabat: Sorry, should have been clearer. What I meant to say was, if you're finding the whole business of poetry using code a bit troublesome, you could look at doing poetry within a code-like structure. Just an idea. Best of luck!
posted by the cydonian at 6:57 PM on January 25, 2007

Response by poster: I just noticed this got sidebarred. Thank you mathowie!

I'll report back on which worked after the birthday :)
posted by divabat at 8:08 PM on January 28, 2007

Khalad, what is that supposed to do? It segfaults when I try to compile it (after changing all instances of 1s to 1).
posted by grouse at 12:21 PM on January 29, 2007

Response by poster: UPDATE:

Birthday went over very well! I was a surprise, so I suppose that was a big factor, but he did enjoy the card. I used null terminated's idea, and it took a little while for him to get it but he understood - he even explained to me what it meant! I showed him this thread; he also liked the BASIC one, and had a chuckle over the binary.

Thank you everyone!
posted by divabat at 1:57 PM on February 12, 2007 [2 favorites]

Thanks for updating! I often wonder what happens to all the askme questioners...
posted by serazin at 11:36 AM on February 23, 2007

« Older Where has my hard drive space gone?   |   Where does Adium store the photos it takes with... Newer »
This thread is closed to new comments.