September 13, 2010 5:41 PM   Subscribe

How do I say yes to a wedding invite in some form of code or scripting language?

I've been invited to the geekiest wedding ever. Two gamers, with a wedding cake based on an xkcd comic, one of them works with me and is responsible for coding a lot of the backend for our website, if that gives an indication for how geeky. I want to accept the wedding invite, and say so on the invite card in some kind of programming code or script, but fairly succinctly.

IMPORTANT: MAKE IT PERFECT. If I get this wrong, I will never hear the end of it. Assume (correctly) that I know nothing about code.
posted by shmegegge to Human Relations (35 answers total) 6 users marked this as a favorite
Best answer: Going by yourself? wedding.attending["shmegegge"] = True; or wedding.attendees++; could work.
posted by lantius at 5:45 PM on September 13, 2010 [1 favorite]

Best answer: $ join /bride /groom | tee | yes
posted by Blazecock Pileon at 5:48 PM on September 13, 2010 [1 favorite]

cat mysunday.plans > /dev/null
posted by Jimbob at 5:49 PM on September 13, 2010

I'm always a little confused with these requests... do you just want something that looks like code, and that includes the words "I cordially accept your invitation"? Or, do you want something really, decidedly clever that they have to actually compile and run to understand?

The former is trivial, and painfully boring for anybody who reads code. The second is, perhaps, overly complicated just for saying "yeah, I'll be there"... and maybe they don't program (that particular language), and so won't be able to make hide nor hair of it.

For the first one, it's as boringly simple as: printf("I cordially accept your invitation.");

For the second one... well, how many lines/characters do we have to work with?
posted by Netzapper at 5:51 PM on September 13, 2010

Response by poster: something rather like lantius, BP and Jimbob's answers is basically perfect. Figure the most commonly known coding languages as the best bet. He knows a few, but I couldn't name which. sorry.
posted by shmegegge at 6:08 PM on September 13, 2010


posted by antiquark at 6:19 PM on September 13, 2010 [4 favorites]

I love BP's.
posted by deezil at 6:20 PM on September 13, 2010

One of my favorite code snippets, actually used when debugging:
if (true) return true;
This code says yes the first time and every time it is called.
posted by bigbigdog at 6:24 PM on September 13, 2010 [1 favorite]

Best answer: In SQL Code:

INSERT INTO wedding_guests (first_name, last_name) VALUES ('your first name', 'your last name');

Substitute your first and last name in the italicized parts. The single-quotes are mandatory. If you have a guest, you can do this:

INSERT INTO wedding_guests (first_name, last_name) VALUES ('your first name', 'your last name'), ('your guest's first name', 'your guest's last name');
posted by mhum at 6:25 PM on September 13, 2010 [4 favorites]

OK its really tough to put code in here... so I used the pastebin method, and created a VERY basic javascript example:

With props to
posted by Admira at 6:29 PM on September 13, 2010 [1 favorite]

I'd draw a Venn Diagram. The union could be labeled "Attending X's Wedding." The left and right circles would be plays on how you know each other, interact with each other, or some other interests you share or don't share with each other.
posted by ifandonlyif at 6:37 PM on September 13, 2010

Okay, given your conditions, I'd vote for mhum's SQL.

As clever as Blazecock's solution is, neither /bride nor /groom are standard unix files. And that rankles.
posted by Netzapper at 6:40 PM on September 13, 2010 [1 favorite]

PS: My last suggestion is basically a database update which adds your name (and your guest's name) to the table called "wedding_guests".

As clever as Blazecock's solution is, neither /bride nor /groom are standard unix files. And that rankles.

I personally didn't mind that part (you can put it as /var/bride and /var/groom or /usr/bride and /usr/groom, if you like). Personally, I noticed that yes ignores input so it doesn't really make sense to put it at the end of a pipe.
posted by mhum at 6:46 PM on September 13, 2010

$ sudo cat '<guest><firstname>foo</firstname><lastname>bar</lastname></guest>' >> ~/wedding_stuff/guests.xml
Replace foo with your first name and bar with your last.
posted by advicepig at 7:00 PM on September 13, 2010 [1 favorite]

advicepig - you probably don't need sudo when the file is within your ~ (and xml is evil).

I vote mhum's SQL but since they probably already have a table containing all the invitees you just need to UPDATE wedding_guests SET wedding_guests.attending = TRUE WHERE wedding_guests.firstname = 'your first name' AND wedding_guests.lastname = 'your last name' ... I'm not sure how to handle +1s... Probably need to add a wedding_guests record and track the host's ID with a wedding_guests.guest_of INT -- that way when if the original invitee cancels you can cancel their +1 as well.
posted by ChrisHartley at 7:10 PM on September 13, 2010 [1 favorite]

True, you shouldn't need sudo in your home directory, but I was trying to sneak in a reference to

I suppose you could change the file location to somewhere more fitting...
posted by advicepig at 7:16 PM on September 13, 2010

I'm sorry, but if you're going to do SQL, you'll have to work in a JOIN in there, somewhere.
posted by adipocere at 7:19 PM on September 13, 2010 [1 favorite]

Here's a bit of obfuscated perl:

perl -e '$0=~/-(.)/;$_.=chr($=+$=+1).$1;lc($~)=~/^(.)/;$_.=$1.$/;print;'

This should print "yes" to the screen under a UNIX-ish environment. I don't know what it does under Windows.

And, yes, it can be argued that any perl is obfuscated perl.
posted by mhum at 7:20 PM on September 13, 2010 [2 favorites]

As clever as Blazecock's solution is, neither /bride nor /groom are standard unix files. And that rankles.

Yep. My answer is a bit less perfect than what you need, probably.
posted by Blazecock Pileon at 8:03 PM on September 13, 2010

How about add an XBOX portion, like this.

Though I'm liking the SQL version myself. Maybe combine them?

Another thought, maybe unix sysadminish?

# usermod -G weddingattendees shmegegge

Or another thought:
<script type="text/matrimonyscript">
var d = new Date();
if (d.getFullYear() === 2010 && d.getMonth() === 0 && d.getDate() === 5) {
	shmegegge.location = BOB_AND_JANE_WEDDING.location;
Now, the JavaScript idiom there is real JavaScript, that date being tested would be January 5, 2010 because getMonth() returns 0 to 11, and getDate() gets you the day of the month. Since it's matrimonyscript you can make it what you want and use getYear(), getMonth(), and getDay() which would be a nicer syntax.
posted by artlung at 8:10 PM on September 13, 2010

I'd go with the SQL, as if he/she's a webdev, they'll definitely understand it.
posted by signal at 8:15 PM on September 13, 2010

I use to write poetry with C code and I always took liberties with the code to make it more readable for non-geeks and I think makes it a little more romantic but still with a geeky flavor. I always found real language syntax to be a bit restricting. Perhaps I wasn't a good enough coder!

while he says I do
and while she says I do {
myRSVP = true;


union {
bride Lisa;
groom Peter;
love eternal;
} myRSVP = true;
posted by acheekymonkey at 8:27 PM on September 13, 2010 [3 favorites]

Don't reply; unix programs return zero on success.
posted by mhoye at 8:38 PM on September 13, 2010 [7 favorites]

Mhum has given a pretty sweet answer that I'm sure a database/backend coder would get a kick out of figuring out. I'd go with that personally.
posted by irishcoffee at 9:28 PM on September 13, 2010

This entire thread is a perfect example of why replying geekily but not naturally doesn't really work. What are you (asker) geeky about?

Failing that, here's what I'd suggest: don't try to turn your response (data) into code, just turn it into geekier data. Programmers don't typically express data as code. Take something like "I cordially accept your invitation" and uuencode it to be old-school:
begin 644 response.txt
or, even better, send him the MD5 hash of "yes":
(He'll recognize that as an MD5 hash, I'm sure. And if it doesn't immediately come to him what it might be, it looks up in the first few Google hits for "md5 lookup" or "reverse md5".)
posted by mendel at 9:59 PM on September 13, 2010 [2 favorites]

Note that if you go with mhum's suggestion it's essential that if you have a name like O'Holleran with an apostrophe in it that you properly escape the quote. As to including a JOIN, that seems extraneous to me because you don't generally join on anything when doing an UPDATE or INSERT, although you could come up with a convoluted example where it would be necessary but I think that would just be making it needlessly complicated.
posted by Rhomboid at 5:32 AM on September 14, 2010

assert (happilyEverAfter)

... but I like mhoye's answer as well
posted by Triton at 5:42 AM on September 14, 2010

I suggest posting a http request to his invite acceptance form. Using cURL from the command line, for example:
 curl -d 'guest_name=Shmegegge+Mefite&num_attending=2'
If you sent him that line surrounded by backticks (`curl ... accept`), it might indicate to him the sense you are running it. Or it might make it imperfect.
posted by and hosted from Uranus at 9:36 AM on September 14, 2010

Response by poster: you guys are fantastic. I'm gonna take some time to figure out which one I'll end up using, but these are some elegant and creative solutions and I love you all.

out of curiosity: I just sneakily determined what the groom spends most of his time coding in. (read: I asked him point blank "what code do you write in most of the time for work?") He said "php."

any php related code that would do this? It's not a necessity, as the provided answers will absolutely work. I will probably link him this thread for his amusement once I mail the RSVP card. You guys rock.
posted by shmegegge at 10:23 AM on September 14, 2010

To go in another direction. You could create a web page that simply says "shmegegge accepts your invitation." And on the reply card just print out a QR code that points to that site. Or, heck, just points to this thread.
posted by Morydd at 10:29 AM on September 14, 2010

Best answer: If you wanted to combine the SQL idea with some PHP you could write

$res = mysql_query("INSERT INTO wedding_guests (first_name, last_name) VALUES ('your first name', 'your last name')");
posted by Rhomboid at 10:37 AM on September 14, 2010

Best answer: <?php array_push($guests['attending'], "shmegegge", "shmegegge's friend"); ?>
posted by and hosted from Uranus at 11:00 AM on September 14, 2010

Best answer:
	require_once 'class.Wedding.php';
	$Wedding = new Wedding('Bob', 'Jane');
	$Wedding->addRSVP('schmegegge\'s date');

posted by artlung at 11:41 AM on September 14, 2010

Oh well, this silly PHP should probably run (though it requires a relationship.php first, as I couldn't be bothered to stub out classes for Relationship, Individual, etc)

require 'relationship.php';

class WeddingError extends Exception {};

class Wedding extends Relationship {

  protected $partners = array();
  public $objections = array();

  public function __construct() {
    $this->partners = func_get_args();
    if (count($this->partners) > 2) {
      throw new WeddingError('Monogamy!');
    if (count($this->partners) < 2) {
      throw new WeddingError('Everybody needs somebody to love!');

  public function attending($rsvp, $guest1, $guest2=NULL) {
    printf("%s, I (%s)", ($rsvp === True ? 'Yes' : 'No'), $guest1);
    if (!is_null($guest2)) {
      printf(" and %s", $guest2);
    printf(" will %s attending\n", ($rsvp === True ? 'be' : 'not be'));

  public function vows() {
    $partner1, $partner2 = list($this->partners);
    $question = "Do you, %s, take %s, in sickness & health, to be your lawfully wedded partner?\nI do";
    printf($question, $partner1, $partner2);
    printf($question, $partner2, $partner1);

  public function raise_objections() {
    if (count($this->partners) < 2 || count($this->objections) > 0) {
      throw new WeddingError('Objection!');

  public function pronounce() {
    printf("by the power vested in me, I now pronounce you man & wife");

  public function honeymoon() {
    exit('On honeymoon, brb');

$marriage = new Wedding('Partner 1', 'Partner 2');
$marriage->attending(True, "Your Name", "Guest's name");

* the following is hopefully an emulation of the day

You have the option of accepting (True/False), and having a guest. The rest should just run through whats going to happen on the day. Feel free to add $marriage->objections if you so wish. Oh, and I think I got an Ace Attorney reference in there.

Note: I couldn't be bothered to figure out how to handle polygamy, hence a wedding error if more than 2 participants are involved.
posted by Smoosh Faced Lion at 12:13 PM on September 14, 2010 [1 favorite]

Response by poster: update: I went with artlung's answer, here, and the response was enthusiastically positive. The couple in question were extremely pleased, and when I showed them this thread they were incredibly impressed with all the answers and the community in general. thanks everybody!
posted by shmegegge at 2:44 PM on September 21, 2010

« Older Do you know this movie from these few details?   |   Name this film Newer »
This thread is closed to new comments.