Skip to content

Instantly share code, notes, and snippets.

@klange klange/_.md
Last active Nov 15, 2019

Embed
What would you like to do?
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at least...) support both of these features in their default configurations.
  • Since it's been mentioned by multiple people, I used timestamps instead of building struct tms as a stylistic choice.
  • As a final reminder, this is a joke.
#include <stdio.h>
#include <time.h>
typedef struct {
union {
const char * company;
const char * school;
const char * project;
};
union {
const char * location;
const char * url;
};
union {
const char * title;
const char * program;
};
time_t started;
time_t left;
const char * description[];
} thing_t;
typedef thing_t job_t;
typedef thing_t school_t;
typedef thing_t project_t;
#define CURRENT 0 /* I wasn't alive at the Unix epoch, so that'll work */
/* Contact Information */
const char * name = "K. Lange";
const char * email = "klange@toaruos.org";
const char * address = "3-5-19-903 Kotobashi, Sumida\n"
"Tokyo, Japan 130-0022";
/* Education */
school_t uiuc = {
.school = "University of Illinois at Urbana-Champaign",
.location = "Urbana, IL",
.program = "BS Computer Science",
.started = 1251158400,
.left = 1336608000,
.description = {
"Minor in International Studies in Engineering, Japan",
"Focused on systems software courses",
NULL
}
};
school_t hit = {
.school = "Hiroshima Institute of Technology",
.location = "Hiroshima, Japan",
.program = "Study Abroad",
.started = 1274745600,
.left = 1278288000,
.description = {
"Cultural exchange program",
"Intensive language course",
NULL
}
};
school_t * schools[] = {
&uiuc,
&hit,
NULL
};
/* Projects */
project_t compiz = {
.project = "Compiz Window Manager",
.url = "http://compiz.org",
.title = "Developer",
.started = 1201392000,
.left = 1264291200,
.description = {
"Minor plugin contributor",
"Various research projects",
NULL
}
};
project_t toaruos = {
.project = "ToAruOS",
.url = "https://github.com/klange/toaruos",
.title = "Lead",
.started = 1295049600,
.left = CURRENT,
.description = {
"Hobby x86 Unix-like kernel and userspace",
"Advanced in-house GUI with compositing window manager",
NULL
}
};
project_t * projects[] = {
&toaruos,
&compiz,
NULL
};
/* Employment History */
job_t yelp = {
.company = "Yelp, Inc.",
.location = "San Francisco, CA",
.title = "Software Engineer, i18n",
.started = 1339977600,
.left = CURRENT,
.description = {
"Developed several internal tools and libraries",
"Provided critical input and design work for Yelp's launch in Japan",
NULL
}
};
job_t apple_internship = {
.company = "Apple Inc.",
.location = "Cupertino, CA",
.title = "Software Engineering Intern",
.started = 1306886400,
.left = 1314662400,
.description = {
"Built software framework for testing and verification of desktop retina display modes",
"Assisted other interns with Unix fundamentals",
NULL
}
};
job_t * jobs[] = {
&yelp,
&apple_internship,
NULL
};
void print_thing(thing_t * thing) {
char started[100];
char left[100];
struct tm * ti;
printf("%s at %s - %s\n", thing->title, thing->company, thing->location);
ti = localtime(&thing->started);
strftime(started, sizeof(started), "%B %d, %Y", ti);
if (thing->left == CURRENT) {
printf("%s to now\n", started);
} else {
ti = localtime(&thing->left);
strftime(left, sizeof(left), "%B %d, %Y", ti);
printf("%s to %s\n", started, left);
}
const char ** desc;
for (desc = thing->description; *desc; desc++) {
printf("- %s\n", *desc);
}
puts("");
}
int main(int argc, char ** argv) {
school_t ** s;
job_t ** j;
project_t ** p;
printf("%s\n%s\n%s\n\n", name, email, address);
puts("Education\n");
for (s = schools; *s; s++) {
print_thing(*s);
}
puts("Employment\n");
for (j = jobs; *j; j++) {
print_thing(*j);
}
puts("Projects\n");
for (p = projects; *p; p++) {
print_thing(*p);
}
return 0;
}
@soundarmoorthy

This comment has been minimized.

Copy link

soundarmoorthy commented Mar 17, 2015

interesting. Good level of consciousness in aligning assignments, choosing identifier names.

@alebaffa

This comment has been minimized.

Copy link

alebaffa commented Mar 17, 2015

genius!

@shroukkhan

This comment has been minimized.

Copy link

shroukkhan commented Mar 17, 2015

nice !!

@tzuryby

This comment has been minimized.

Copy link

tzuryby commented Mar 17, 2015

C.

@walkingtospace

This comment has been minimized.

Copy link

walkingtospace commented Mar 17, 2015

brilliant!

@KyleSanderson

This comment has been minimized.

Copy link

KyleSanderson commented Mar 17, 2015

Not to be that guy, but if we're bringing up alignment, time_t should most likely be at the top 😄

@Niranjans-kachhawa

This comment has been minimized.

Copy link

Niranjans-kachhawa commented Mar 17, 2015

Good Work 😃

@stefanilie

This comment has been minimized.

Copy link

stefanilie commented Mar 17, 2015

It's like a huge middle finger shown to non technical HR people hiring IT staff.

@amitkumar94

This comment has been minimized.

Copy link

amitkumar94 commented Mar 17, 2015

nice !! don't forget to add a README file on how to compile the program. :P

@AldoMX

This comment has been minimized.

Copy link

AldoMX commented Mar 17, 2015

Just copy/paste it in an online compiler like ideone:

http://ideone.com/Tr7oiN

@neuro-sys

This comment has been minimized.

Copy link

neuro-sys commented Mar 17, 2015

Hah, I did something similar a while ago.

https://gist.github.com/neuro-sys/a813cbf6f3a50c50c5e1

Likewise, I think it's easier to embed dates in code like this:

struct tm date_of_birth = {
    .tm_mday = 13, .tm_mon = 12 - 1, .tm_year = 1986,
};

So that even your average HR would be able to make out the dates, and readability would be complete.

@thesp0nge

This comment has been minimized.

Copy link

thesp0nge commented Mar 17, 2015

I love this!

@MikeWeller

This comment has been minimized.

Copy link

MikeWeller commented Mar 17, 2015

You duplicate the 100 for the buffer size in your strftime calls, rather than passing, e.g. sizeof(buffer).

@joamag

This comment has been minimized.

Copy link

joamag commented Mar 17, 2015

Really good !!!

@metacritical

This comment has been minimized.

Copy link

metacritical commented Mar 17, 2015

Interesting, i did a similar thing in ruby long back .... When i just learnt Ruby and had no experience in rails https://github.com/pankajdoharey/mycv

@ch-hristov

This comment has been minimized.

Copy link

ch-hristov commented Mar 17, 2015

@stefanilie i think this is readable by any human

@rhengles

This comment has been minimized.

Copy link

rhengles commented Mar 17, 2015

I actually distribute my resume as a JSON structure, with HTTP headers... 😛

@AndreasOM

This comment has been minimized.

Copy link

AndreasOM commented Mar 17, 2015

If your actual code looks like this ...
you are fired.

@ztamimi

This comment has been minimized.

Copy link

ztamimi commented Mar 17, 2015

😀 funny and clever
thanks, you've made my day

@oogali

This comment has been minimized.

Copy link

oogali commented Mar 17, 2015

👍

@zyzo

This comment has been minimized.

Copy link

zyzo commented Mar 17, 2015

hilarious ! I myself might produce something similar, but in much less geek way (even if it's in black background and green font color !) :
http://danghaian.com/cv-geek.html

@RRanddom

This comment has been minimized.

Copy link

RRanddom commented Mar 17, 2015

Great

@beiller

This comment has been minimized.

Copy link

beiller commented Mar 17, 2015

Creative resume but your employment history is a little short on details 😄

@anil884

This comment has been minimized.

Copy link

anil884 commented Mar 17, 2015

awsome ..loved it ....

@noname007

This comment has been minimized.

Copy link

noname007 commented Mar 17, 2015

i love it,great idea

@AUmrysh

This comment has been minimized.

Copy link

AUmrysh commented Mar 17, 2015

I think you're missing a comma on line 59.

@cyberis

This comment has been minimized.

Copy link

cyberis commented Mar 17, 2015

Very creative. Clean style. I'd probably hire you.

@gravitino

This comment has been minimized.

Copy link

gravitino commented Mar 17, 2015

@AndreasOM We don't take advice from Ruby programmers.

@napolux

This comment has been minimized.

Copy link

napolux commented Mar 17, 2015

Nice CV! 💫

@warmwaffles

This comment has been minimized.

Copy link

warmwaffles commented Mar 17, 2015

Love it

@enthouan

This comment has been minimized.

Copy link

enthouan commented Mar 17, 2015

Very funny.

It would be perfect if the global variables and the print_thing were static.

@Ham5ter

This comment has been minimized.

Copy link

Ham5ter commented Mar 17, 2015

I realy Like this Idea! 😃

@manvscode

This comment has been minimized.

Copy link

manvscode commented Mar 17, 2015

Beautiful! I would love to see a recruiter's face when given the source code. Unfortunately, you probably won't get a lot of offers since HR and staffing firms are the gate keepers. This is a problem all of us need to get behind and solve.

@pcreech

This comment has been minimized.

Copy link

pcreech commented Mar 17, 2015

Awesome.

@gabrielfalcao

This comment has been minimized.

Copy link

gabrielfalcao commented Mar 17, 2015

beautiful code

@lethalman

This comment has been minimized.

Copy link

lethalman commented Mar 17, 2015

Too serious... really. I expected some nice horizontal ruler, some ascii art... vote 3/10.

@helloweishi

This comment has been minimized.

Copy link

helloweishi commented Mar 18, 2015

nice C

@overtrue

This comment has been minimized.

Copy link

overtrue commented Mar 18, 2015

👍

@smaquois123

This comment has been minimized.

Copy link

smaquois123 commented Mar 18, 2015

And all this time I've been sending out my resume in assembly.

@brainix

This comment has been minimized.

Copy link

brainix commented Mar 18, 2015

Code Golf / IOCCC it and force the recruiter to compile and run it to see what it says?

@gansidui

This comment has been minimized.

Copy link

gansidui commented Mar 18, 2015

niubility

@jLukeC

This comment has been minimized.

Copy link

jLukeC commented Mar 18, 2015

Pretty great project. I tried to replicate something similar in OCaml here

@youran1024

This comment has been minimized.

Copy link

youran1024 commented Mar 19, 2015

wonderful~

@ameizi

This comment has been minimized.

Copy link

ameizi commented Mar 19, 2015

Cool~

@hoangddt

This comment has been minimized.

Copy link

hoangddt commented Mar 19, 2015

Beauty!

@michals

This comment has been minimized.

Copy link

michals commented Mar 19, 2015

I wrote similar cv.c nine years ago when starting in Lucent-Technologies. HR person was bit confused but technical folks liked it.

@sillykelvin

This comment has been minimized.

Copy link

sillykelvin commented Mar 19, 2015

Nice job, but failed to compile(gcc resume.c), gcc version:

gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-4)

error:

resume.c:39: error: unknown field 'school' specified in initializer
resume.c:40: error: unknown field 'location' specified in initializer
resume.c:41: error: unknown field 'program' specified in initializer
resume.c:52: error: unknown field 'school' specified in initializer
resume.c:53: error: unknown field 'location' specified in initializer
resume.c:54: error: unknown field 'program' specified in initializer
resume.c:72: error: unknown field 'project' specified in initializer
resume.c:73: error: unknown field 'url' specified in initializer
resume.c:74: error: unknown field 'title' specified in initializer
resume.c:85: error: unknown field 'project' specified in initializer
resume.c:86: error: unknown field 'url' specified in initializer
resume.c:87: error: unknown field 'title' specified in initializer
resume.c:106: error: unknown field 'company' specified in initializer
resume.c:107: error: unknown field 'location' specified in initializer
resume.c:108: error: unknown field 'title' specified in initializer
resume.c:119: error: unknown field 'company' specified in initializer
resume.c:120: error: unknown field 'location' specified in initializer
resume.c:121: error: unknown field 'title' specified in initializer

I missed something?

@Anye

This comment has been minimized.

Copy link

Anye commented Mar 19, 2015

Thanks HR doesn't give up this wonderful resume.

@cplusProgrammer

This comment has been minimized.

Copy link

cplusProgrammer commented Mar 20, 2015

nice :)

@pravinkerai212

This comment has been minimized.

Copy link

pravinkerai212 commented Mar 21, 2015

mind blowing!!

@lichengwu

This comment has been minimized.

Copy link

lichengwu commented Mar 22, 2015

good!

@luftreich

This comment has been minimized.

Copy link

luftreich commented Apr 3, 2015

nice !

@zabesangary

This comment has been minimized.

Copy link

zabesangary commented Jun 22, 2015

Troll!

@ghost

This comment has been minimized.

Copy link

ghost commented Jan 6, 2016

void print_thing(thing_t * thing) {
char started[100];
char left[100]
...
}

That stack looks gigantic. What if you make those arrays static?

Beautiful code btw. I'm curious about the puts("") at the end of print_thing though, what's it for?

@YouthLin

This comment has been minimized.

Copy link

YouthLin commented Jan 10, 2016

amazing.可怕。

@ssdr

This comment has been minimized.

Copy link

ssdr commented Feb 4, 2016

good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.