« first day (2411 days earlier)      last day (2538 days later) » 
07:00 - 20:0020:00 - 00:00

7:18 AM
Hey fellas, silly question
Where can I find packages I've installed with pip install --user on Windows?
(Trying to get thefuck running on Windows)
 
Does pip show thefuck not tell you?
 
@MadaraUchiha lol nice
 
(not a Windows user, but for me that shows a Location: field)
 
Let me try that (demonstrating my superior Python knowledge here, no doubt)
 
cbg-ning
 
7:25 AM
@ZeroPiraeus Hmm, yes, looks good
Now to find the actual executable...
 
Hurrah!
 
pip install didn't add it to my path automatically, so I need to do it manually for now
There's no executable in that directory :(
Is bash expected to be able to run python files natively?
 
it didn't work for me either
I am on Ubuntu
ImportError: No module named 'thefuck'
 
@khajvah On Ubuntu you should be able to just install using apt
 
there is program called Fuck
that's just plain ... AMAZING
 
7:29 AM
guys, we had this professionalism rule
where we are not allowed to say words like Fuck
but it's a program name so it's fine
 
I'm only calling the name of the program ... :DDD
omg. some people are just born troll. lol
 
I wonder what we call BrainFuck
brainf*
there are 92 contributors
open source is amazing
 
Yeah, I have no idea how to run it XD
If anyone comes up with a way to run it on Git Bash, I'd be happy to hear
For now, back to work
 
7:45 AM
recbg
 
cbg @AnttiHaapala
 
cbg
Is there a way to play a gif animation inside tkinter frame while it loads a page ?
I tried doing it, but instead of animating ...GIF freezes to its first frame and then animation continues when the page loading is finished.
 
 
1 hour later…
9:02 AM
Cabbage!
new to python so dont know how — JD SANDERSON 5 mins ago
Then pick up some tutorials, manuals or books. — poke 1 min ago
i am in school so i cant, only 10 mins left — JD SANDERSON 35 secs ago
Made my day.
 
@MadaraUchiha Git Bash uses the Windows PATH, so if you have a python executable in your PATH, .py files should be executable if they have a proper shebang. Note that an explicit versioned shebang (e.g. #!/usr/bin/env python3) would require you to set up a symlinks for the executables first
In general, you can modify the bashrc in C:\Program Files\Git\etc\bash.bashrc and add links to C:\Program Files\Git\usr\bin for this to work
You can also use the Windows Python launcher py which should already be in your PATH anyway. It is able to detect shebangs on itself and choose the correct Python installation correctly. You would need to call py explicitly then though since even though it is the default .py file handler on Windows, running a .py file on Git Bash will use the bash mechanism and check the shebang before passing it to any default OS handler.
 
 
1 hour later…
10:26 AM
First package uploaded to PyPi \o/
 
congrats
what is it?
 
HTTP (REST) API client generator, from class definitions.
 
well done @IljaEverilä
 
is it on GH?
 
Very much WIP.
 
10:28 AM
@poke I do have a .bash_profile with some aliases already
 
that's cool
 
I don't have python or python3 in my path though
And I have no idea what's supposed to be executed when I call thefuck from the command line
I'm guessing it's supposed to map to some .py file somewhere, which would be run with python, but I have no idea what or where.
 
When you call thefuck, then bash would look for an executable called thefuck
If that executable is a thefuck.py, then it would still run that with bash, see its shebang and use the shebang’s interpreter to run the file
 
if it doesn't find thefuck it will complain that no fucks were found
 
But the best thing is probably to do the npm way and providing thefuck.cmd and thefuck (shell script) files
That way, you have compatibility in and outside of Git bash
 
10:46 AM
@khajvah replies like this :D :D
 
 
1 hour later…
11:55 AM
32 responses by Community editing https into my posts, sheesh what a pedant
cbg
@Madara I assume you've looked at windows-related issues such as this one and git bash is too different from the magical ubuntubashwindows?
 
@AndrasDeak Yes
 
as a linux user I imagine both of those entities to be magic
Hmmmm...apparently git bash has find. So if you're looking for thefuck, it could help
 
12:47 PM
why do i suck so much at doing animations?
 
You're looking at it all wrong. Perhaps you suck so much at everything, but it's animations that you happen to be doing right now. Better? ;)
have you tried perching on busts in weird forest cabins?
 
morning-post-Pycon cabbage
I shared unicodesnake.sopython.com with her :D
It was a good talk. Any talk that involves snoots for booping is a good talk.
 
1:10 PM
cbg
 
The 3D illusions of Kokichi Sugihara, an engineering professor at the Meiji Institute for Advanced Study of Mathema… https://twitter.com/i/web/status/864543509486870528
that's fun
 
missing long weekend cbg \o
@WayneWerner how was PyCon?
 
1:29 PM
Fantastic! It was my first one
 
Oh nice, so I'm assuming you will be going to the future ones (if you had a chance)? Did you get to meet David?
 
not clicking on those link, cause it might ruin my mental image of you guys :D I believe you though.
 
cool and good
 
:(
 
1:34 PM
@khajvah what's wrong ?
 
Well, if your mental image is different than my avatar, then it might be ruined. Otherwise... well, I pretty much look the same :D
 
@MooingRawr I wanna be in pycon too
 
Aaron Hall and Wim were also there. Wim looks distinctly less badger-ish than I expected
 
@khajvah :( I know that feeling. I'm going to Miss PyCan this year
 
1:35 PM
@WayneWerner That I don't believe :D (The badger comment)
 
@khajvah PyCon 2018 & 2019 will be in Cleveland OH next year
 
I am actively looking for a job in USA
 
@MooingRawr IKR? There was a distinct lack of black and white fur. It was very disorienting.
 
hopefully will be able to attend enxt time
 
@WayneWerner are you sure the badger wasn't cosplaying as a human ?
 
1:36 PM
@MooingRawr That's an interesting take. I'm not at all sure, TBH
Apparently you have multicolored relations
 
that's racist
 
magpies are very common here
lot of crows and magpies and pigeons
they look great, and make funny noises
but they're cleptomaniacs and aggressive towards other birds, robbing nests and occasionally killing birds
 
isn't that where the term "magpie developer" came from?
 
Hello, guys!
 
hello
 
1:50 PM
@corvid can't say I've ever heard that expression :P
 
Need some help! What condition I need to write to output Mike's place in 1 line: repl.it/INJE/0
 
@RuslanDoronichev 'Mike' : ['London'], put his places in a list like you did with the first two
 
Can my dictionary contain lists and key:value at the same time?
 
your code is expecting a list, yet 'Mike' is only returning a string value instead of a list of strings
 
the key is 'Mike', the value is a list
 
1:52 PM
^ kevin'd :D
 
@AndrasDeak Basically, when a developer is attracted to shiny new things
 
ah, then yes, surely:)
 
I am explaining it wrong. What I meant was: " Am I allowed to store lists in a dictionary together with non list items"
 
Sure you can
 
@RuslanDoronichev that's what you're doing right now
 
1:54 PM
but it's not a good idea... unless you want differentiate the values based on the key names by pre fix or some suffix...
 
what Mooing is telling you is to store only lists
then there's no semantic difference between values for different keys
 
Ok, so if I store lists in a dictionary - I need to make sure that I have lists ONLY inside. Am I right?
 
Dictionaries are basically just boxes with labels on them, you can put whatever you want in it (those are the values), and the labels are the keys, so you know which box to look in. you can have a box within a box (a dictionary in a dictionary, it doesn't care)
 
@RuslanDoronichev it only depends on what you're doing with them later :P
it doesn't cause any errors if your values are mixed in type, but then you have to handle this whenever you access something in your dict
we're talking about design
 
yes and no, if you have lists in a dictionary and then you have strings in the same dictionary, later in your code you need to know what is what when you try to retrieve it. Ie if you get a value back that is a string, but your code treats it as a list, you will run into issues, like what you are doing right now
 
1:57 PM
RIP James Bond
 
@Code-Apprentice ?
 
Do people get paid for traveling for a company? e.g., if I take a 4 hour flight, is it technically considered part of the work day?
 
depends on your contract, I guess
it should be
 
@MooingRawr ^
 
1:59 PM
@AndrasDeak Ok. How can I make Mike's place be printed in a single line, except defining it as list? I am just curious
 
I want to reply to stackoverflow.com/q/44136727/953482 with "in relativistic physics, whether two events at different points in space happen 'at the same time' will vary from observer to observer" but I'm not sure if that's actually true.
 
@Code-Apprentice oh that's sad :(
 
@RuslanDoronichev what do you mean? Site how you want the output? What is stored in the list?
 
@RuslanDoronichev I wasn't replying to your original question, I was trying to help explain what Mooing was talking about.
 
I got out a cocktail napkin and I drew "point A" and "point B" and a spaceship with ".9c" over it, but that's as far as I've gotten
 
2:00 PM
@corvid it should be
 
@Kevin that's exactly how it is
 
@RuslanDoronichev You could change your code to check if the key == 'Mike' and then just print the value
 
@Kevin yes, Einstein challenged simultenaeity
 
@MooingRawr Can I make a check like : if the value != list print value
 
@Kevin how far apart are points A and B from each other and from the spaceship?
 
2:02 PM
@RuslanDoronichev repl.it/INJE/1 is one way you can do it, another way is like you said check the typing: repl.it/INJE/2
 
@RuslanDoronichev what you mean is not isinstance(value,list) ..., but instead I'd use lists all the way, and handle len(value)==1 separately
 
Threads in Python are actually not executed concurrently: the interpreter works single-threaded, so only one thread is active at the same time. — Willem Van Onsem 12 mins ago
 
@Code-Apprentice A and B are two cores of a multicore processor, so, like, 1 cm apart? And the spaceship is in space, so let's say exactly 100 km straight up.
 
Is that true? Even if there is a processor/core available?
 
Moving in whichever direction makes the math easiest, other than "directly towards Earth" because that would vaporize the problem
Also we're in a hypothetical universe where threading in Python actually uses multiple cores simultaneously
 
2:05 PM
That might be the true reason why spacecraft use ancient hardware; no need to worry about the true nature of reality this way
 
no GIL no fun
 
@Kevin at that distance, relativistic effects are negligible. You would need them to be .9 light years apart, or on that order
 
@AndrasDeak Yes! I was looking for that function! Thank you!
 
I'm happy with any result that's less negligible than a planck second
 
@MooingRawr Thank you! That is a nice solution as well!
 
2:08 PM
Note the second way is more scale-able, you don't have to type out all the key values that has a single response, The purpose of the first example is to show the concept of solution. Use the second one, if possible.
 
@Kevin that is where you draw the line? Anything greater must be accounted for?
 
not being theoretically-impossible-to-measure-based-on-our-current-understanding is a straightforward initial requirement
 
Yeah all I really want is a time difference that can't be handwaved away with "0.001 planck seconds may as well be simultaneous for all the difference it makes"
You're not allowed to handwave 1 or more planck seconds that way. It's science law.
You'll go to science jail with all the people that tried to make a perpetual motion machine
 
2:26 PM
don't forget the flat earthers
 
what you mean by flat earthers?
 
oh ho ho
you're welcome
 
> This video is no longer available because the YouTube account associated with this video has been terminated.
 
hehe:D
haven't watched any others but you can search youtube for "flat earth"
 
I'm still interested in finding a way to prove the Earth is round using only 50$ worth of materials and high school trigonometry, and which can be carried out by a single person
 
2:29 PM
one might say that the shape of our planet is a less fundamental issue than conservation of energy, but gravity is a pretty strong counterargument to this notion
 
"Measure the angle of the light streaming down two wells a hundred miles apart" costs two rulers and a phone call, but a skeptical flat Earther will claim the person on the other end of the call is lying about his measurement
Also when the experiment ends, the flat Earther is stuck down a well, which may or may not be undesirable
 
@Kevin don't forget the cost of the well
 
"The axis of movement of a free-swinging pendulum rotates once every twenty four hours" might work if you can find a windless environment which the flat earther has confirmed is free from hidden magnets or similar
Although since it takes 24 hours he might say "you obviously just spun the axis while I was sleeping"
 
2:36 PM
Or they'll just say "this only proves that the Earth rotates, which does not contradict my model of a rotating flat disc Earth"
 
that would be the same on a flat earth
actually, it does
that effect is ~due to the Coriolis force, and it disappears on the Equator
 
"We can't get a view of Australia with buildings upside down"
 
a flat Earth will produce that rotation everywhere
 
Hmm, how expensive is it to make a pendulum that swings for 24 hours?
 
none at all
and I think the rotation frequency depends on the latitude on Fake Round Earth, while it's neatly 2 rotations per 24h on a flat one
 
2:39 PM
I feel like if you just use twine and a baseball from your garage, it will eventually come to a halt before you can observe anything useful
 
DSM
Tuesday cabbage for all.
 
cbg
and rbrb for me for a while
@Kevin long and heavy, small friction...yeah
twine and baseball lose too much due to dissipation
 
There's a reason the pendulum at the Franklin Institute is like a thousand pounds and three stories tall.
Whoops it's 176 pounds. Whatever, I'm still within an order of magnitude.
... Barely
In any case this experiment works only if you're a 50$ bus ride from the equator
 
I don't know much about flat earthers, but do they at least agree where the "edges" are located?
 
I think they usually place the north pole at the center of the disc.
 
2:46 PM
@Kevin sometimes I feel like using a ~150lb weight hanging from a noose would cost less than your stipulated $50. That IS within an order of magnitude.
@Programmer I imagine to topographical tricks to explain all the different flight paths planes take, and shipping routes (that appear to be straight lines..) within a flat-earth cosmology are pretty interesting.
 
Experimental procedure:
- Hide noose in forest
- Flat earther comes along and gets snagged by the ankle and suspended upside down
- experimenters go into town for extended lunch break
 
I'll peer review. You could publish that ;)
 
DSM
Aaargh, Friday run had a bug I thought I'd fixed, and it didn't give nice error output like it was supposed to. What new mischief is this?!
 
It's the long weekend curse :D \o cbg DSM
 
I am stuck with a classical task. I need to loop through a nested dictionary. I don't have a problem with getting keys, but I don't know how to loop through the values which are dictionaries. Can you give me some hint?
https://repl.it/INJE/3
 
2:55 PM
@RuslanDoronichev repl.it/INJE/5
 
DSM
Ha! The number proves my priority! repl.it/INJE/4
 
Foiled again!
 
info.items() is equal to a dictionary value?
 
DSM
info is the dictionary. info.items() gives you key, value pairs.
 
I agree with DSM.
 
DSM
2:56 PM
And by "the dictionary", I mean that in sequence it's all the subdictionaries (which are values of the "top" dictionary associated with a city key.)
 
Omg, I feel so dumb every time I realize that there is an easy solution for a problem. Thank you guys again!
 
DSM
Things are easy when you look at them in the right way, and sometimes really hard when you don't. Play with your example, experimenting with .keys() and .values() and .items() until you see that you can guess what everything will do.
 
Oh and if A is dictionary, and B = A.items(), evetytime you modify A, B will also be changed.
so no need to call .items() several times.
 
3:13 PM
Y'all are so appreciated! I'm not needing this right now, but I've saved it for, like, next week, when I assume I will!
 
DSM
3:26 PM
Lovely. The code works fine on my machine and not on theirs. :-/ Going to be that kind of day.
 
Ask them to update to the latest version of WoW?
...might not solve the problem, but might distract them for a few hours ;)
 
Convince them that World of Warcraft is a sophisticated 3d operating system and that the files they desire are a rare drop from the endgame boss
 
4:13 PM
That should give you until after Independence Day, surely?
 
@davidism I'm two months late, but I just watched Blame!. It's uncannily like Knights of Sidonia in both aesthetics and plot. If you like CGI depictions of a ragtag tribe struggling against a cryptic and indomitable enemy for so long that nobody in living memory has ever experienced peace in their industrialpunk style home, until a mysterious stranger with remarkable combat prowess appears to prevent their otherwise inexorable decline...
... Then you'll like this.
 
DSM
Speaking of animated stories: Samurai Jack. :'-(
 
@Kevin it's by the same guy :-)
 
Yep, I watched the last ep of SJ just yesterday.
 
He's got a common theme
I didn't know Blame was out on Netflix yet.
 
4:18 PM
Keep beating that cyberhorse, Tsutomu Nihei. It's not dead yet thanks to its powerful regenerative capabilities.
But seriously, there's nothing wrong with adhering to a theme.
@DSM Now to wait for the greenlight of the next season, which will fill in the fifty year gap between episodes 52 and XCII.
 
DSM
I hope they don't, TBH. The first time there was no ending; this time, we have one. I'm not saying there couldn't be interesting stories set in that period worth telling, only that I think the story is complete now.
 
Oh yeah, the story's finished. I'm sated on that front. I just want to see somebody slice up robot assassins with a million dollar per episode budget.
We went four seasons where the only plot progression was "he meets a scotsman and they become best bros" so I don't think it would be a violation of the spirit of the show to have another thirteen episodes that have no impact on the storyline
... Although I wouldn't mind a little more resolution for view spoiler
 
DSM
4:36 PM
I guessed wrong, FWIW. view spoiler
 
4:51 PM
Before the final episode a lot of people speculated that view spoiler
And now people are speculating that view spoiler
Which is a nice "have your cake and eat it too" situation where you get view spoiler
I'm not sure the time travel model supports the idea, though. I need to watch the chalkboard scenes from Back to the Future again.
 
5:08 PM
Hmm, how long has stackoverflow used https?
I suspect it's recent because I only noticed just now that my "share button extender" userscript stopped working because it's only configured to run on http://stackoverflow.com/questions/*
 
It's recent. They made an announcement about it a few days ago.
 
they had some problems originally because cross domains and HTTPS != fun
 
Finally I can post answers without fear of the FBI intercepting my http requests and changing my submission to "have you tried using jquery?" to destroy my reputation
 
May 22, 2017: "As of today, Stack Overflow now deploys HTTPS by default on StackOverflow.com — as well as the hundreds of Q&A communities that make up our Stack Exchange network. We now redirect all traffic to https://, and Google links will change over the next few weeks."
 
Radical.
 
5:12 PM
noice
 
Tubular. Fetch. Way past cool. Bae.
 
@Kevin destroy your rep? Ye gods, man, jquery would catapult you almost to Jon Skeet heights!
 
Jon Skeet has a sophisticated lens array prepared to melt the wings of any that would dare rise to his heights
 
He wrote it in C#. But he re-implemented jQuery in C# so that he could use jQuery.
 
Wow, EXIF has a lot more info in it than I'd expected. Lens serial number?
Where does it even get the lens serial number?
 
5:20 PM
that's how lenstag helps you recover lenses. With Canon F mounts, it's a digital connection, so...
 
Hehehe Jon Skeet facts
 
5:38 PM
Oops I garnered some ire by answering a question with code only before editing in an explanation.
Maybe next time I'll do explanation first, then code.
 
lol
FGITW got shot at
 
DSM
Martijn gets away with it, but mostly because it only takes thirty seconds for him. :-P
 
it's because he's a DNN
 
Mine was more like a minute.
A recent question uses the code for each in seq:. I've seen this around here and there, and I can't say I'm fond of it.
"It makes it look more like regular English", says the author hypothetically, as he goes on to write the perfectly English looking line print(each)
 
that's dorky
 
5:45 PM
Or, no, an overzealous desire to approximate plain language isn't what bothers me. What bothers me is that it's no more descriptive than for x in seq:
 
maybe if you did something like....
for each in tribbles:
    tribble = each
 
Unless your algorithm executes in a truly type-agnostic fashion, one ought to make some effort to choose a variable name that indicates what the value is
Or, is that really what bothers me about it? I'm having difficulty introspecting today.
 
5:58 PM
what bothers me is that it's a bit misguided
 
I have decided that I'm allowed to be bothered by anything for any reason or no reason.
 
6:13 PM
It's got a repl.it MCVE so you don't even need to open your own editor
 
Not sure if the professor just stup^Wtired or trolling me there: stackoverflow.com/a/44141190/770830
 
Hey Guys. I want to learn python. I am a beginner(I know about list,tuples,etc.) Can anyone suggest good tutorial series that cover up everything? Thanks
 
I think we've got a link for that somewhere.
Let's see... Was it in the wiki? idk
 
@MaulikSolanki The official tutorial is good, for one: docs.python.org/3/tutorial/index.html
 
6:25 PM
Thank you @IljaEverilä @Kevin
Anyone has previous experience in machine learning/data science using python ?
 
6:41 PM
cbg
 
cabbage @Sundararajan
 
I'm making a billing software using tkinter, I just want to display entries in a large number till the user finish entering the billing items, how do i do it
 
for _ in range(1000): Entry(root).pack()
This creates a large number of entries.
 
@Kevin Is it possible to set the scrollbar too since 1000 rows would be large to display in window screen
I also want to make it save inside sqlite3 database I'm pretty confused where to start
 
6:49 PM
@Kevin melon. would look into it
 
@Sundararajan I'd start by googling, "How to save data in a sqlite3 database"
 
I would help more extensively but after 2:30 I'm in hibernate mode
 
DSM
I hate it when you miss an interesting question, have a solution you think is better than anyone else's, but everyone's already all voted out. :-(
 
Once or twice I posted an answer considerably after everyone else and still got a couple points for it.
 
6:53 PM
note that when you do activity (vote, post, comment) on a post, it pops back up in the newest stuff list
 
Possibly from the "people keeping the question open for a long time with the intention of possibly writing an answer despite not striking while the iron is hot" demographic that had just a little less initiative than me
 
@WayneWerner yes I did it and i got some stuffs working on that :)
 
DSM
Once or twice a late answer of mine fought its way to the top, but pretty rarely.
 
@Sundararajan so then the next step, if that doesn't solve your problem, would be to describe what you've already done to try and solve the problem, and where you're getting stuck.
typically accompanied by an MCVE
so you might say something like
> I can connect to a sqlite database, but I keep getting syntaxerrors when I try to create a table. Here's what I'm doing... <code goes here>
 
DSM
> <complete copy of error output goes here>
 
6:55 PM
Sometimes you have to write an answer for the purely selfish desire to leave a mark on the world, regardless of whether it will ever be seen
 
@DSM I notice that if the first answer is code/text only and then I take the time to actually explain, that usually helps
 
DSM
Once I remember being gunned on a question where the winner used a method that I'd implemented in the library. Thought that took a lot of gall. :-P
 
Did they cite you?
 
DSM
They had no way to know, so admittedly they can't really be held responsible, but still..,
 
I've answered at least one "how do I get this itertools behavior without importing itertools?" question by copy-pasting the implementation straight from the documentation
 
7:01 PM
@WayneWerner It's not that i don't google. I usually do it. but when it comes to some suggestion its better to ask someone who already experienced that. that's my personal thought, sorry If its wrong
I would ping if i have some trouble. Thank you guys for your help
 
@Sundararajan It's fine to ask for advice, but if you ask for general advice you're going to get general answers. Or no answer.
When you're starting out there are plenty of points where you'll think to yourself, "There must be a better way!" and there probably is...
but if you don't say, "This <exact thing> is what I'm doing but I feel awkward when I'm doing it, is there a better way?" then it's a lot of effort on our part to figure out what you know already and what you're already doing
most of us don't have the time or inclination
that's hard work that we could be spending answering questions by people who have given their question a lot of effort
 
recbg
re: late answers fighting to the top: I'm still waiting for an answer of mine that I posted 1 day after someone else's half-complete answer to skyrocket
so far it seems to me that not even crickets have seen my post
 
giyf! then you can say "I found such and such but have this issue" or "I found xyz but don't understand it"
 
@WayneWerner Got It. will follow the same
melon
 
@Sundararajan @toonarmycaptain has it right. If you find it you've gotta tell people what you found
we're not psychics... usually ;)
 
7:15 PM
Except Wayne
 
just observant ;)
 
all of us working on that badge
 
I'm trying to implement a custom protocol/interface server in Django, but there doesn't seem to be much in the way of documentation about that.
Does anyone here have experience with Django and can give me some advice about how to do this?
(This is using the channels/ASGI stuff)
 
@AndrasDeak It's pretty clever how all the questions don't show up unless you do have psychic powers.
 
7:32 PM
I'm playing with while loops, and trying to do tests on user input. I keep getting value errors. Is there a better way than conditional == int: I see errors when no input and when letter in input (eg I want letters, so testing if int). Is there a better way, or a way to escape this?
 
== int: is not suitable for testing whether something is an int.
>>> 1 == int
False
 
name = ''
while str(name) != 'your name':
if int(name):
print('Numbers are not names')
continue
print('Please type your name.')
name = input()
and I tried putting the if after name = input() to avoid the automatic empty error
 
if int(name) doesn't test whether something is an int.
 
To determine whether a string contains only digits, use isdigit.
>>> "1".isdigit()
True
 
7:34 PM
"Contains only digits" isn't the right test.
 
Note, however, that it will not return True for strings that contain both digits and nondigits.
>>> "1a".isdigit()
False
 
'-1'.isdigit(), for example.
 
DSM
Or for neg.. aargh, Kevin'd by @user2357112 against Kevin!
 
Also note that John Smith the 3rd is going to be annoyed when you tell him his name isn't a name.
 
So isdigit() would return False for John Smith the 3rd, but True for say, 17
And I think that's what I'm aiming for (I was just playing around with the while loop given in Automate)
 
DSM
7:39 PM
But False for 17 with a space after it, etc. A little too finicky.
 
@Kevin So how the **** does anyone write any code that deals with names in a meaningful organisational fashion? Pretty sure the school software I use just deals with the exceptions and accepts that it can't display every name perfectly all the time, at least for people operating from within the system/behind the scenes
 
Mildly surprised that the falsehoods list doesn't have "people's names do not have trailing whitespace". Hello my name is Kevin\u200B, nice to meet you
 
I'm also assuming, for summation, that anytime I look up something that takes user input for something like this IRL, I'm gonna see at minimum, a dozen lines of code, rather than just
`name = (input('Enter name')
#code actually making use of name other than checking input
I'm sure I could just forward this q to someone at the IRS or SS, since I'm sure someone has tried such methods to avoid
 
Well I expect the majority of applications that are interested in your name are going to be native GUIs or web pages, so you won't see those using input specifically
 
Fair enough
 
7:50 PM
I'm guessing the approach that the Falsehoods author is advocating is: Have one field for the user's name. Let the user enter whatever they want. When displaying it, don't mangle it any more than is necessary for security purposes (see Bobby Drop Tables). Since it's all one field, just live with the inconvenience of not knowing whether John Jacob Smith's last name is "Jacob Smith", or if his first name is "John Jacob", or whether his middle name is "Jacob"
 
That doesn't help me searching 15k students when I have a first name, or last name, and narrowing from there by other details (such as class, school, health conditions, grade etc).
Not to mention when a classroom teacher needs to call students in alphabetical order by last name..
You know, explicit real world functions I've needed to implement in the last few hours..
 
candidates = [student for student in students if student.name.endswith("Smith") and student.name.startswith("John") and student.class == FRESHMAN and "peanuts" in student.allergies]
 
True I guess you could split, but that probably sometimes needs a little more accuracy than I have when guessing a 1st grader's name by sounding out the first few letters from the last name, and going letter by letter until only a couple of students are in the list and I can ask them their first name for a yes/no response.
 
Not all students will have a last name. It's certainly possible that your school has only ever had students with last names, but you can't guarantee that it will be the case for all time
 
^ This. I was (legally) just Zero for a few years.
 
7:56 PM
I'm kind of playing devil's advocate here, though.
 
That is true. I think that if I was the person in charge, I would enforce an "X" policy for blank last names, such as when people signed their name with an "X" because they couldn't write.
 
Wait, is Zero Piraeus your real name?
 
Yes.
 
Huh. I thought it was just a screen name.
 
My true position is closer to "it's probably fine to separate first and last name in your database, if the program is highly likely to be geographically constrained within the boundaries of a relatively homogeneous culture where having a first and last name is a strictly enforced norm"
 
7:57 PM
Also, almost everyone I ever meet face to face has two last names. and the lexical ordering rule is not the one you'd immediately assume without knowing the culture.
 
DSM
Jul 24 '14 at 16:27, by DSM
Even in the Python community, there's Aahz. I think he's used a second name on some published work, but I'm pretty sure he said once that's his legal name.
 
Yup. I have two, in the UK, but one by statutory declaration in Australia, and one legally in the US
 
Plus "if there's a cultural upheaval and this sleepy Wyoming elementary school suddenly has a lot of mono-names, then we can rewrite the program"
 
(So I comprehend the cultural complexity somewhat)
Issue tertiary is person has two or hyphenated last name, but goes by the second of the hyphenated names, ie John Jones-Smith tells me name is John Smith....but typing in last names I will never see his name by typing s-m-i-t-h
 
07:00 - 20:0020:00 - 00:00

« first day (2411 days earlier)      last day (2538 days later) »