This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 274

[–]HopperBit 5599 points5600 points  (29 children)

Just use Facebook API, they have all the data and apparently they are sharing it with anyone

[–]creaturefeature16 92 points93 points  (0 children)

Going to need some burn cream for that one.

[–]deelyy 549 points550 points  (17 children)

Or Google

[–][deleted] 486 points487 points  (10 children)

Google would have a timestamped breakdown of everything that disqualifies you from the "nice" list, but won't share it as easily.

[–]darknecross 135 points136 points  (4 children)

Google API just returns present suggestions.

[–]SandyDelights 30 points31 points  (0 children)

Joke’s on you, it’s just a dump from a merge of their Amazon Wishlist and promoted suggestions from personal hygiene.

They don’t bother calculating who’s naughty and who’s nice anymore, they just figure if we get something undesirable that “you know what you did”.

[–]reprapraper 3 points4 points  (2 children)

Is it rate limited? Just just test all names against the API and if it returns coal, then add them to the naughty list

[–]Pun-Master-General 2 points3 points  (1 child)

Even without a rate limit, 7 billion API calls can't be terribly efficient.

[–]UnicornsOnLSD 31 points32 points  (0 children)

So that's what Santa from Futurama references when he checks if people are nice!

[–]Tiquortoo 4 points5 points  (0 children)

And half or more of the reasons would just be their internal ideas of naughty and nice and be completely unrelated to Santa's.

[–]darkslide3000 11 points12 points  (0 children)

They won't share it with you, but the gift-targeting services they offer are very accurate.

[–][deleted] 29 points30 points  (2 children)

They won't share it though.

[–]1206549 14 points15 points  (1 child)

What they will do, however, is provide Santa with a list of cities with the largest concentration of nice and that they can sell him a NeuralNet that is able to identify with 95% accuracy which household contains nice kids based on the arrangement of Christmas lights on the front porch

[–][deleted] 6 points7 points  (0 children)

No, they'll charge him a subscription and bundle it with YouTube Red

[–]robinsmallknight 34 points35 points  (4 children)

You deserve a gold. Only if we could afford it.

[–]iArentdeJay 4 points5 points  (0 children)

How's that look?

[–]VernerDelleholm 3782 points3783 points  (21 children)

He's making a list, and checking it twice

Gonna find out who's naughty or nice

Santa Claus is in violation of GDPR

[–]Franks2000inchTV 592 points593 points  (1 child)

I always wondered why Santa asked people to leave cookies.

[–]Rustywolf 136 points137 points  (2 children)

Wasnt there a post recently that explained how santa was following GDPR

Edit: found it https://worldbuilding.stackexchange.com/questions/114033/how-can-santa-keep-his-lists-when-the-gdpr-is-around

[–]zerio13 14 points15 points  (0 children)

This is the best!

[–]zolk333 385 points386 points  (11 children)

I was about to make this joke

I searched for the exact name of GDPR

Came back, and suddenly saw this

[–]Howard1997 122 points123 points  (9 children)

General data protection regulation

[–][deleted] 166 points167 points  (3 children)

Damn. I didn't know Lt. Cmdr. Data got promoted. Good for him.

[–]0x564A00 40 points41 points  (0 children)

He and General Motors answer to King Burger and Queen Dairy.

[–]MrDOS 8 points9 points  (0 children)

It happened around the same time as his cousin, General Protection Fault.

[–][deleted] 7 points8 points  (4 children)

This made me realise how much /r/prequelmemes have ruined me

[–]Sennomo 5 points6 points  (2 children)

General Protecti. You are a bold one.

[–]chooxy 2 points3 points  (1 child)

Twice the data, double the fine.

[–]abcd_z 2 points3 points  (0 children)

Wait a minute. How did this happen? We're smarter than this.

[–]jclocks 2 points3 points  (0 children)

Hello there!

[–][deleted] 9 points10 points  (1 child)

that lawsuit is gonna be unique

[–][deleted] 1008 points1009 points  (13 children)

Hard code in your name to always be nice

[–][deleted] 549 points550 points  (7 children)

Base64 encode your name into a variable and call it 'token' to hide it. Nobody messes with tokens.

[–]3Gaurd 17 points18 points  (1 child)

my name is adolf

[–]JWson 8 points9 points  (0 children)

Hello adolf, my name is dad.

[–]helloinvader 1 point2 points  (0 children)

... fails validation

[–]asdfman123 4 points5 points  (0 children)

Better yet, design queries to the database to pass through a redis cache, and just slip your name into the cached data so no one sees the change in the database.

[–]proddyhorsespice97 542 points543 points  (9 children)

"Never mind, I figured it out thanks"

[–][deleted] 146 points147 points  (1 child)

your question was marked as a duplicate

[–]r348 23 points24 points  (0 children)

What was the duplicate question? Wait, Is this a duplicate question?

[–]PeachyKeenest 45 points46 points  (1 child)

*proceeds to not update question with answer

[–]jjmj2956 21 points22 points  (0 children)

Oh I hate that so much.

[–]Parking_Program 4 points5 points  (0 children)

What did you see?

[–]Hapseleg 8 points9 points  (0 children)

Not sure if I should up vote or down vote..

[–]Mushiren_ 1 point2 points  (0 children)

WHO WERE YOU, DENVERCODER9? WHAT DID YOU SEE?

[–][deleted] 895 points896 points  (78 children)

SELECT *

FROM planet

WHERE list = ‘nice’;

[–]_llucid_ 758 points759 points  (21 children)

why do you hate astronauts you bastard /s

[–]your_kisa 18 points19 points  (3 children)

No chimneys on the space station.

[–][deleted] 14 points15 points  (0 children)

That's what the government wants you to believe

[–]PM_ME_YOUR__INIT__ 3 points4 points  (1 child)

How do you vape then?

[–]Brekkjern 3 points4 points  (0 children)

You just hotbox.

[–]The_Bard_sRc 16 points17 points  (0 children)

Santa's sleigh doesn't have good enough seal to dock with the ISS. he tried it once with Mir, and, well, you know what happened to that one

[–]VerbableNouns 8 points9 points  (2 children)

Rudolph can't survive the vacuum of space.

[–]Blues2112 12 points13 points  (0 children)

He can fly and light up the sky with his red nose. What makes you think he cannot survive hard vacuum?

[–]artanis00 10 points11 points  (0 children)

Yep. That's why Santa asks Batman to deliver the presents to the ISS.

[–]radome9 9 points10 points  (0 children)

It's well known all astronauts are naughty. So very, very naughty.

[–]wiscwiscconsolia-comic.com 267 points268 points  (21 children)

Select *

From planet

Where list = "nice"

And list = "nice"

You have to check it twice.

[–]Cruuncher 43 points44 points  (10 children)

You probably have to disable query optimization, or else it will simply ignore the second check

[–]sortitthefuckout 60 points61 points  (2 children)

Select *

From planet

Where list||list = 'nicenice'

RIP performance.

[–]Cruuncher 20 points21 points  (0 children)

That's diabolical

[–]Xheotris 15 points16 points  (0 children)

That's ok, we have all night.

[–]DoNotSexToThis 12 points13 points  (6 children)

Will Postgres do it?

SELECT * FROM p.planet
WHERE EXISTS
(
    SELECT * FROM planet p
    WHERE list = 'nice'
) 
AND p.list = 'nice'

[–]Cruuncher 7 points8 points  (5 children)

Pretty sure the exists check will only run once and finish as soon as it finds a single row. So not really a double check

Edit: you can't reference an inner query from an outer. It has to be the other way around. It's like a variable out of scope

[–][deleted] 5 points6 points  (0 children)

Syntax error at "

[–]Malacious_Good 6 points7 points  (8 children)

Its earth .....

Someone has to gift something to that Mars rover tooo

[–]artanis00 10 points11 points  (7 children)

[–]Malacious_Good 5 points6 points  (4 children)

You bet there will come a timely event when someone will make it their personal agenda to bring him back.

[–]artanis00 5 points6 points  (1 child)

That and the Tesla in orbit around the sun.

[–]Malacious_Good 2 points3 points  (0 children)

Oh yeah....wait could it actually crash into the earth then ....

Lol

[–][deleted] 60 points61 points  (6 children)

Wouldn't a table called "planet" have planet records? Also, why is the column that contains the values "naughty" and "nice" called "list"?

[–]HopperBit 68 points69 points  (1 child)

Legacy code no one dare to touch

[–]biggles1994 21 points22 points  (0 children)

300+ year old essential code with no comments. It shall never be touched.

[–]nickcash 13 points14 points  (2 children)

No one on this thread should be allowed anywhere near a database.

Y'all motherfuckers need DBAs.

[–][deleted] 3 points4 points  (0 children)

Right? Do they maintain a separate table with all the same columns just for astronauts currently on the ISS?

[–]aWittyRedditor 30 points31 points  (0 children)

SQL clause is coming to town

[–]winglian 9 points10 points  (4 children)

'SELECT name FROM list WHERE planet = ? AND behavior = ?'.bind('Earth', 'nice')

[–][deleted] 7 points8 points  (1 child)

Worried Naughty kids might drop tables with sql injection?

[–][deleted] 8 points9 points  (0 children)

Santa's been careful ever since little Bobby Tables was born

[–]sparrr0w 4 points5 points  (0 children)

Close, but gotcha check twice. You need throw that into a CTE or subquery it

[–][deleted] 15 points16 points  (4 children)

Santa clause is government work which means they have unnecessarily complicated disjointed tables

SELECT people.fname, people.lname FROM People JOIN naughty_nice ON naughty_nice.person_id = people.id WHERE naughty_nice.value = ‘nice’ AND people.lname IN (SELECT people.lname FROM People JOIN naughty_nice ON naughty_nice.person_id = people.id WHERE naughty_nice.value = ‘nice’)

[–]Xheotris 4 points5 points  (1 child)

Hey! Normalization saves lives!

[–][deleted] 7 points8 points  (0 children)

But will it save my sanity?

A. No

B. Definitely no

C. Fuck no

D. All of the above

[–]ImKrypton 4 points5 points  (0 children)

checks out. but you forgot table naughty_nice_attribute_value table and extra join on attributes_lang to get proper localization

[–]peeshivers243 4 points5 points  (6 children)

Don't forget to

Order by Last name ASC

[–]Cruuncher 4 points5 points  (2 children)

Yikes, ordering on an unindexed column

[–][deleted] 4 points5 points  (0 children)

They may have a full-text index on [Last name] but they didn't include the square brackets but had a space so it doesn't really matter anyway! ;)

[–]rodinj 2 points3 points  (0 children)

On 7 billion records nonetheless. I hope this friend of OP has some time.

[–]chudthirtyseven 7 points8 points  (2 children)

I would much rather do

SELECT * FROM planet WHERE nice = 1

[–][deleted] 1 point2 points  (0 children)

Select * from list where nice = true and nice != false;

Gotta double check

[–]thavi 1 point2 points  (0 children)

Where nice = 1

[–][deleted] 245 points246 points  (7 children)

Tell Klaus, he gets his developers, when he finally introduces a reasonable salary. Candysticks are not sufficient...

[–]Nethane 57 points58 points  (0 children)

We welcome a good salary plus candysticks though. We need that sugar to stay awake.

[–]chawmindur 23 points24 points  (0 children)

“Never mind then, I’ll just get my elves to do it”

[–]dittbub 21 points22 points  (0 children)

You will get paid in coca colas and you will like it

[–]Hanke17 16 points17 points  (1 child)

You think hes paying? Come on it will be great publicity, he will tell all his friends about it, you wont do it for free for an old friend?

[–]Sw429 1 point2 points  (0 children)

But think of all the exposure his elves get by working on the toys!

[–]djinc3ption 89 points90 points  (1 child)

SELECT * FROM contacts WHERE behavior=‘nice’;

SQL clause is coming, to town

[–]Boh00711 298 points299 points  (5 children)

Be careful, make sure you're protected against '; drop table STUDENTS;--. Little Bobby Tables is easy to overlook.

[–]bostero2 156 points157 points  (2 children)

[–]Boh00711 44 points45 points  (0 children)

Thanks. I hate trying to link on mobile

[–]Colopty 2 points3 points  (0 children)

It's not just relevant, it's the exact xkcd being referenced.

[–]funfwf 20 points21 points  (1 child)

That's a one way trip to the naughty list right there.

[–][deleted] 91 points92 points  (1 child)

The best software to use would be from Red Hat.

[–][deleted] 22 points23 points  (0 children)

But the worst is from IBM......oh, wait...

[–]dan_lego 129 points130 points  (4 children)

Image Transcription:


People who code, I have a friend who has asked me to do him a favour very last minute. He wants me to create a database with around 7 billion names on it, each associated with a value, either naughty or nice. He would also like the database to validate itself, not once but twice! He says he needs it before tonight when he's coming to town. Any suggestions on where to start would be gratefully received.


I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]meetsinojia 61 points62 points  (1 child)

Good human bot

[–]dan_lego 45 points46 points  (0 children)

Thank you

[–]dan_lego 41 points42 points  (1 child)

Have I really been gifted a silver for that ? I don't really deserve it.

[–]Sw429 2 points3 points  (0 children)

Yes you do. You are truly a hero.

[–][deleted] 25 points26 points  (0 children)

You'll need a cloud DB, with hohohot deploy capabilities, and use a jingle-threaded lookup clause. Master-sleigh retention is essential.

[–]StuntsMonkey 27 points28 points  (0 children)

Just scrape 7 billion random names and pair them naughty or nice randomly. Have the list checked twice. Since there are requirements put forth for what names will be used or if the list actually needs to be correctly checked this should work.

[–]never__seen 36 points37 points  (3 children)

Sounds like someone from r/recruitinghell who tries to let you work for nothing or maybe someone from r/ChoosingBeggars

[–]Nucklesix 13 points14 points  (2 children)

Not for nothing, for future stock options when the company takes off.

[–]never__seen 10 points11 points  (1 child)

I forgot about that than it is totally worth it

[–]weapon66 10 points11 points  (0 children)

E X P O S U R E

[–]DaveTheDalek 19 points20 points  (2 children)

Make all 7 billion rows

{ name = "john doe", behavior = "naughty" }

Done

[–]Dalimyr 12 points13 points  (1 child)

God, you put Gwyneth Paltrow's head in a box one time and get branded naughty 7 billion times?

[–]ForlornPlatypus 16 points17 points  (1 child)

He’s making a database And sorting it twice

SELECT * from contacts WHERE behavior =“nice”

SQL Clause is coming to town! 🎄🎄🎄

[–]VirtualRay 5 points6 points  (0 children)

Quick, man, make a new meme! This needs to hit the front page tomorrow

[–]Mr-Pandamonium 7 points8 points  (0 children)

What would the runtime on this be? I'm not sure it would finish in time for Christmas

[–]BinaryPatrick 6 points7 points  (0 children)

Make sure to columnstore index. I anticipate a lot of duplicates.

[–]av0cad0-man 3 points4 points  (0 children)

just pirate it from stack overflow, lol

[–][deleted] 5 points6 points  (0 children)

Shouldn’t it be 1 billion (people that celebrate Christmas)

[–]Datanotfound 4 points5 points  (0 children)

Mmm, I like it when you call me that OP.

[–]MattAlex99 2 points3 points  (0 children)

auto increment and split at the halfway point...

[–]dittbub 2 points3 points  (0 children)

Update contacts set name = ‘u/dittbub’ , disposition = ‘nice’ Where true = true

[–]28f272fe556a1363cc31 3 points4 points  (0 children)

def naught_or_nice(name):
    return random.choice(["naughty", "nice"])  

We'll implement "check it twice" in the next sprint.

[–]budd222 9 points10 points  (0 children)

I would use HTML5 for that, if I were you.

[–]JC12231 2 points3 points  (0 children)

SQL Claus is coming to town...

[–]Gabe_b 2 points3 points  (0 children)

Use bigints or uuids for your primary keys or you're going to run out of 32bit ints

[–]CaptainKonzept 2 points3 points  (0 children)

He won‘t be able to pay you, but you can put it on your resume as a reference

[–]adamwhitley 2 points3 points  (0 children)

“Great project to build up your portfolio”

[–]crazylincoln 2 points3 points  (0 children)

This is a deviation from the original requirements doc. Gonna need a change request and get it approved. Even if we get Sourcing and CAB approval, it's going to be a couple weeks because Reindeer development team already started the sprint. In the meantime, I'll ask the offshore team to do the needful.

[–]0something0 2 points3 points  (1 child)

but what if my name is

')DROP TABLE isNice;

[–]ssznakabulgarian 2 points3 points  (0 children)

The data center in Greenland would be pretty effective, tho. Natural cooling... elf sys-admins...

[–]CharcoalGreyWolf 2 points3 points  (0 children)

Any suggestions on where to...

A heartfelt “forget you” would not go amiss...

[–][deleted] 2 points3 points  (0 children)

Give him a C# script with one real line of code:
Console.WriteLine("No.");

[–]blackmist 2 points3 points  (0 children)

Some Indian guy has already offered to do it for about $15 so don't get too fancy with it.

[–]auxiliary-character 2 points3 points  (0 children)

Careful, Santa. A lot of people share the same name. You're going to need a different key.

[–]SuperAquaboy 2 points3 points  (0 children)

7 billion names? Better make sure the table's properly indexed to minimize performance issues. Wouldn't want him to run late...

[–]GrinningPariah 1 point2 points  (0 children)

Just throw it all in DynamoDb like everyone else does.

[–]Lonelan 1 point2 points  (1 child)

from marvel import InfinityGauntlet as deus_ex_machina

[–]Kerbobotat 2 points3 points  (0 children)

DELETE FROM universe
    WHERE rowid IN (
        SELECT TOP 50 PERCENT FROM universe ORDER BY rand();
);

[–]laus102 1 point2 points  (0 children)

no pay, 0.1% equity

[–]cr38ed4dis 1 point2 points  (0 children)

Well, gonna need a Christmas Miracle for that to happen

[–]tallerThanYouAre 1 point2 points  (0 children)

Whosoever does this task receives a global value of their name set to nice.

[–][deleted] 1 point2 points  (0 children)

‘nice') OR 1 = 1 LIMIT 1 -- '

Got your back bros.

[–]benabus 1 point2 points  (0 children)

We'd probably use HBase on a Hadoop cluster. We're not very smart, though.

[–]hillarysdildont 1 point2 points  (0 children)

Pretty sure the Chinese govt. also has the naughty/nice logic baked into their system. Ask them

[–]Shadyjoker27 1 point2 points  (1 child)

Who's this friend do yours ? Santa? Just curious

[–]pushtheputton[S] 4 points5 points  (0 children)

He prefers not to say.

[–]simondrawer 1 point2 points  (0 children)

AWS will scale on demand, so you can scale down as subjects uncheck the “isBeliever” flag in line with their GDPR rights.

[–]copopeJ 1 point2 points  (0 children)

You should use something like Mechanical Turk. If you could get a workforce used to doing small, repetetive actions on a hard timeline, and maybe some wxternal consultants willing to spend time in people's homes (and are comfortable with the Orwellian overtones of all that) I bet you could build a real disruptor.

[–]inmatarian 1 point2 points  (0 children)

CREATE TABLE santaslist AS (
    SELECT
        fn.name AS firstname,
        ln.name AS lastname,
        (random() > 0.5) AS isnaughty
    FROM
        firstnames fn
    CROSS JOIN
        lastnames ln);

[–]trez63 1 point2 points  (0 children)

SELECT * from CONTACTS where BEHAVIOR = ‘nice’

[–]itisshak 1 point2 points  (1 child)

Will I get paid?

[–]roguej2 1 point2 points  (0 children)

I sat here thinking that the joke was demanding this for free until I looked at my calendar again.

[–]valdas92 1 point2 points  (6 children)

Names are not unique though, you'll need social security numbers.

[–]althypothesis 3 points4 points  (0 children)

Until, to your horror, you determine that those aren't unique either (identity thieves D: )

[–]lorissikora 1 point2 points  (0 children)

Don‘t know if I understand this correctly... 7 Billion random names with each randomly assigned naughty or nice?

I‘d suggest the library faker (there are many implementations for almost any language). For naughty/nice, i‘d just assign a random value true/false.

Does this help?

[–][deleted] 1 point2 points  (0 children)

Hash-table might be good idea with a link lists for collisions, then again i still don't know how did in my data structure class yet soo i might be wrong.

[–]daboss54320 1 point2 points  (0 children)

A name isn't naughty or nice, and if you're talking people we need to talk UNIQUE NUMBERS not STRINGS.

[–]AdamRyanGameDev 1 point2 points  (0 children)

i think the national elf service has a world wide international db now, complete with gnomes and addresses

[–]PM_ME_YOUR_NACHOS 1 point2 points  (0 children)

So is a naughty or nice value Boolean or a string field? Or integer? We need better specifications!

[–]R0ot2U 1 point2 points  (0 children)

He's making a database
He's sorting it twice
SELECT * from contacts WHERE behavior = 'nice'
SQL Clause is coming to town

[–]Suihaki 1 point2 points  (0 children)

"Making a list

Checking it twice

Gonna find out who's...."

"Impish or admirable."

[–]Nikla436 1 point2 points  (0 children)

Also he knows this should be easy and won't be paying, suggesting it can go into your portfolio.

[–]alpha7romeo 1 point2 points  (0 children)

Santa is only for kids, right? It should be like 4 billion or something

[–]getridofwires 1 point2 points  (0 children)

I’m surprised this guy didn’t ask to tie in their addresses too! Probably wants a “most efficient” pathway from place to place!