Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Mad Jaqk
Jun 2, 2013

FoiledAgain posted:

I love grading student assignments...

code:
{'end': word[-1]  if len(word)>3 else word[2:4] if len(word)>2 else word[1:3] if len(word)>1 else word[0:2] if len(word)>0 else word[0],
'endgram1': word[-2:]  if len(word)>2 else word[-1]  if len(word)>3 else word[2:4] if len(word)>2 else word[1:3] if len(word)>1 else word[0:2] if len(word)>0 else word[0],
'endgram2': word[-3:-1] if len(word)>1 else word[-2:]  if len(word)>2 else word[-1]  if len(word)>3 else word[2:4] if len(word)>2 else word[1:3] if len(word)>1 else word[0:2] if len(word)>0 else word[0],
'endgram3': word[-4:-2] if len(word)>0 else word[-3:-1] if len(word)>1 else word[-2:]  if len(word)>2 else word[-1]  if len(word)>3 else word[2:4] if len(word)>2 else word[1:3] if len(word)>1 else word[0:2] if len(word)>0 else word[0]}

Beyond anything else, I'm pretty sure word[0] of an empty string is an IndexError in Python.

Adbot
ADBOT LOVES YOU

Jeb Bush 2012
Apr 4, 2007

A mathematician, like a painter or poet, is a maker of patterns. If his patterns are more permanent than theirs, it is because they are made with ideas.
I know names are harder than anyone expects but I am still amazed that anyone would be stupid enough to think that "10 letters, no special characters" would be a reasonable restriction on a field that is required to contain someone's (exact, legally specified) name

hailthefish
Oct 24, 2010

For the full name? Or just the first name?

Either way it's stupid, but if it's the full name, there's a HUGE number of incredibly boring whitebread names that wouldn't be able to be represented...

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe
My legal first name is quite common in the USA, and longer than 10 letters.

hailthefish
Oct 24, 2010

Oh, yeah, definitely, like I said, it's dumb both ways, the difference is "a substantial chunk of peoples' names not working" vs "almost nobody's name working"

Jeb Bush 2012
Apr 4, 2007

A mathematician, like a painter or poet, is a maker of patterns. If his patterns are more permanent than theirs, it is because they are made with ideas.

hailthefish posted:

For the full name? Or just the first name?

Either way it's stupid, but if it's the full name, there's a HUGE number of incredibly boring whitebread names that wouldn't be able to be represented...

Middle name, as it happens. The "first name" field accepts arbitrary strings. (but then strips them of spaces)

Khorne
May 1, 2002

Jeb Bush 2012 posted:

I know names are harder than anyone expects but I am still amazed that anyone would be stupid enough to think that "10 letters, no special characters" would be a reasonable restriction on a field that is required to contain someone's (exact, legally specified) name
One time at an airport, I overheard someone with no last name try to get onto a flight. His passport had a blank space in the last name field. He had put "LNU" on the online form because it required characters for a last name and wouldn't accept a space. FNU is standard convention for no first name, but it's usually on the passport. Lots of times people will write "NA" or "not applicable" when forced, but boy that airline employee was not having any of it because his last name clearly wasn't Lnu on his passport. Which was what the website automatically converted LNU to.

edit: Yeah, you usually see First: FNU, Last: their name. I have no idea why this guy's passport was like that, but he ended up getting on the plane anyway.

Khorne fucked around with this message at 02:04 on Aug 13, 2018

hobbesmaster
Jan 28, 2008

Khorne posted:

One time at an airport, I overheard someone with no last name try to get onto a flight. His passport had a blank space in the last name field. He had put "LNU" on the online form because it required characters for a last name and wouldn't accept a space. FNU is standard convention for no first name, but it's usually on the passport. Lots of times people will write "NA" or "not applicable" when forced, but boy that airline employee was not having any of it because his last name clearly wasn't Lnu on his passport. Which was what the website automatically converted LNU to.

Interesting, I thought the international standards for passports and the like recognized people with only one name as having a last name but not a first name.

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

TooMuchAbstraction posted:

My legal first name is quite common in the USA, and longer than 10 letters.
I, too, am an Englefargenarbleblorg.

redleader
Aug 18, 2005

Engage according to operational parameters

hobbesmaster posted:

Interesting, I thought the international standards for passports and the like recognized people with only one name as having a last name but not a first name.

I asked someone I know who makes passports and yep, this is what the ICAO passport standards say.

Xerophyte
Mar 17, 2008

This space intentionally left blank

Jeb Bush 2012 posted:

Middle name, as it happens. The "first name" field accepts arbitrary strings. (but then strips them of spaces)

Heh. I have two legal first names, as is common in Sweden, and the first name field on my passport and other identifying papers says something like "John Bob". I usually enter both names, with the second as a middle name if I can but as two first names if I can't. The two first names are on my US visa papers and other official identification, which this has been varyingly effective. My ID card and social security card says "John Bob" so clearly the space is in there somewhere, but I am "Johnbob" on about half the documentation I receive. Most annoyingly, the travel vendor my employer is using keeps booking all my drat flights as "Johnbob Smith" and it's a dice roll on every airport security check if someone complains about it.

When I heard the joke that naming things was hard I didn't think they meant actual name datafields, but apparently those too.

Bongo Bill
Jan 17, 2012

Falsehoods Programmers Believe about Names

hobbesmaster
Jan 28, 2008


I mean, the formatting of passports and the like is set by treaty.

FoiledAgain
May 6, 2007

Mad Jaqk posted:

Beyond anything else, I'm pretty sure word[0] of an empty string is an IndexError in Python.

That's true. One thing I actually just learned is that slices with non-existent indexes don't raise an IndexError.

code:
>>> word = 'hello'
>>> word[3:9001]
'lo'
>>> word[60:90]
''

RobertKerans
Aug 25, 2006

There is a heppy lend
Fur, fur aw-a-a-ay.
Sometimes beginners produce stuff that is just bafflingly complex. Just trying to explain that a set of tests are a baseline to make sure that what they've written works, and when they complain that most of the tests don't work and the exercise must be buggy, that they're not supposed to just write something to make a single test pass. It gets frustrating after a while

JavaScript code:

function reverse(str) {
  let input = [];
  let result = [];
  input = [...str.split("")];
  result.push(input.pop());
  result.push(input.pop());
  result.push(input.pop());
  result.push(input.pop());
  result.push(input.pop());
  str = res2.join('');
  return str;
 }

Edit: that's beginners and it's a bit harsh to say it's a horror (it is but they'll get better 🤞) but was trying to help some kid with basic HTML stuff and this guy pops up in the thread to say his site excellent-programming.com explains how everything works. And well, it's really something, it seems to have involved a lot of effort on the part of Mr Excellent Programmer:

http://excellent-programming.com/programming-concepts/tableofcontents.php

RobertKerans fucked around with this message at 10:42 on Aug 13, 2018

Woodsy Owl
Oct 27, 2004
About SO copy-pasting, SO is good for for finding solutions you weren’t able to come up with yourself, or as a speingboard for searching for proper documentation (e.g., finding an example and working your way back to documentation). Copy-pasting blocks of code suggests that you may not understand the solution enough to implement it yourself, or that you didn’t actually track down the official documentation for a more complete understanding. Also, it’s possible that the answer lifted from SO isn’t the most appropriate or even relevant.

I’ve seen so-called seniors copy-paste blocks from SO without even removing or editing inline documentation that is a dead giveaway that the code is intended for a completely different purpose. As if they didn’t even read through the code and attempt to understand it, let alone use it as a starting point to search for the proper documentation. When confronted, this sr didn’t t have a clue how the code worked, just that it more or less did. They completely missed the oppportunity to actually learn something.. Copy-pasting is lazy and sloppy. Copy-pasting just to get things done is doing yourself and your team a huge disservice. If you commit it, you should be able to explain how and why it works. Your teammates and employer expect this of you.

Volte
Oct 4, 2004

woosh woosh

hobbesmaster posted:

I mean, the formatting of passports and the like is set by treaty.
Falsehoods Programmers Believe About Treaties

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer

Volte posted:

Falsehoods Programmers Believe About Treaties

It turns out programmers don't have a monopoly on creating insufficiently generic validation rules.

They have, however, cornered the market.

redleader
Aug 18, 2005

Engage according to operational parameters
I often copy/paste from SO because I can't be bothered to try to remember the magical series of functions and objects needed to accomplish ${thing I've done occasionally before}.

Ola
Jul 19, 2004

redleader posted:

I often copy/paste from SO because I can't be bothered to try to remember the magical series of functions and objects needed to accomplish ${thing I've done occasionally before}.

Just create an SO parrot account, ask a question, answer it with your own code and then you can copy/paste it later while retaining ownership.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION
I don't think I've ever found anything that I could comfortably copy-paste without some kind of tweaking.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Xerophyte posted:

I saw their presentation at last year's siggraph and Sadeghi was there running parts of the real-time demo that supposedly used his hair tech (it's this one). He had to know that the photo-to-avatar part was fake if that's the case. Assuming he's telling the truth he at least went along with the scheme, including presenting it to a few thousand people, until they fired him. It isn't a great look.

Still, I can buy that his main motivation is not wanting to lose his job. Li seems like an irredeemable scumbag if at least half the screenshots are non-doctored, in comparison.

I really should have known better than to think that (apparently) slavedriving asshat would let someone go in vacation during a big conference like thatat all

Doom Mathematic
Sep 2, 2008

Ola posted:

Just create an SO parrot account, ask a question, answer it with your own code and then you can copy/paste it later while retaining ownership.

I have actually done this. But you don't need to create a parrot account. You can just answer your own question.

Mad Jaqk
Jun 2, 2013
Answering your own question isn't even necessarily poor form. If you ask a question on SO, then solve the problem yourself independently, I believe you're supposed to leave an answer documenting it for when someone Googles the same issue.

Factor Mystic
Mar 20, 2006

Baby's First Post-Apocalyptic Fiction

Mad Jaqk posted:

Answering your own question isn't even necessarily poor form.

It is explicitly encouraged

CPColin
Sep 9, 2003

Big ol' smile.
While I was working at Experts Exchange, we added the ability for askers to accept their own comments as the solution and the community flipped their poo poo. Of course, they did that over any change, but still.

1337JiveTurkey
Feb 17, 2005

Look, I'm not inherently opposed to better handling of names but at some point the If-Christ-had-not-died-for-thee-thou-hadst-been-damneds of the world need to meet us in the middle.

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003

i stopped caring around #11... if the characters in your name can't be mapped to unicode code points (or any other character set) then how exactly are you typing it on a computer? what does this guy want, a blank canvas where i can put whatever arbitrary squiggles i feel like?

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
i think he's talkin about really really obscure kanji in that specific instance

so given the usual modern phone input for kanji and chinese and hanja, answer may be yes

JawnV6
Jul 4, 2004

So hot ...

DELETE CASCADE posted:

i stopped caring around #11... if the characters in your name can't be mapped to unicode code points (or any other character set) then how exactly are you typing it on a computer? what does this guy want, a blank canvas where i can put whatever arbitrary squiggles i feel like?
what if... there was a pre-existing world before computers

redleader
Aug 18, 2005

Engage according to operational parameters
And like everything that existed pre-computers, the problem is impossible to handle well in all (or even most) cases.

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

JawnV6 posted:

what if... there was a pre-existing world before computers

It's not like the name on your passport was allowed to be a picture of a thundercloud before computers hosed everything up.

MrMoo
Sep 14, 2000

bob dobbs is dead posted:

i think he's talkin about really really obscure kanji in that specific instance

so given the usual modern phone input for kanji and chinese and hanja, answer may be yes

In China by law your child's name has to be able to be entered into the local police computer system otherwise it will be rejected and you must pick a different name :lol:

JawnV6
Jul 4, 2004

So hot ...

DaTroof posted:

It's not like the name on your passport was allowed to be a picture of a thundercloud before computers hosed everything up.

what if... there was a pre-existing world before typewriters

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

MrMoo posted:

In China by law your child's name has to be able to be entered into the local police computer system otherwise it will be rejected and you must pick a different name :lol:

they added that law in 1987 for naming and 20 years later for the computerization

so there's still peeps born before

https://www.nytimes.com/2009/04/21/world/asia/21china.html

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

JawnV6 posted:

what if... there was a pre-existing world before typewriters

Falsehoods Phoenicians Believe about Names

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

DaTroof posted:

Falsehoods Phoenicians Believe about Names

what if.. there was a pre-existing world before human language

redleader
Aug 18, 2005

Engage according to operational parameters

MrMoo posted:

In China by law your child's name has to be able to be entered into the local police computer system otherwise it will be rejected and you must pick a different name :lol:

is this really such a bad thing (assuming the local police computer can interoperate with others successfully)? given how the world runs off of computers, seems like a reasonable option

hobbesmaster
Jan 28, 2008

^^ yes but imagine if your name was suddenly considered invalid

DaTroof posted:

It's not like the name on your passport was allowed to be a picture of a thundercloud before computers hosed everything up.

With hand written Kanji that basically was allowed.

Adbot
ADBOT LOVES YOU

MrMoo
Sep 14, 2000

From that article:

quote:

The bureau’s computers, however, are programmed to read only 32,252 of the roughly 55,000 Chinese characters, according to a 2006 government report.

I've rewritten the Reuters support for Chinese a few times and know it's at least 154,000 known characters for Traditional Chinese, the majority of which are snowflake names, so :lol:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply