« first day (3145 days earlier)      last day (1797 days later) » 
02:00 - 16:0016:00 - 00:00

4:02 PM
Thanks !@PM2Ring and @AndrasDeak
 
no problem
 
courses = {"java":10,
"python":10,
"sql":5,
"unix":5,
"javascript":5,
"framework":10}
user_input = input("Enter courses done in a list")
course_names = user_input.split()
i = sum([courses.get(course,0) for course in course_names])
if i >= 30:
print("eligible since the score is", i)
else:
print("Not eligible since the score is",i)
How does this program work?
In the 9th line (course,0), what does the course mean?
 
ask the person who wrote it stackoverflow.com/a/56328484/5067311
you got two independent responses almost an hour ago
@RajkumarMaurya, Google "python list comprehension" for the first. For the second, try to come up with a Google search string by looking at the type of the argument and the method that was called. While SO is here to help, there is a level of homework that is expected of each of us before asking for other people's time. — Mike 51 mins ago
there's nothing I could add to that ^
It's dict.get and a list comprehension in that line. You need to read tutorials until you understand those.
 
I know, I tried googling it, can't seen to get the info right, in this (course,0) what does the "course" in the bracket point to?
 
@RajkumarMaurya that's part of the list comprehension thing. As I said, look in a tutorial.
I'd expect any decent tutorial to cover list comprehensions soon enough
you can't learn a language by just googling, you also need to find structured information you read thoroughly
 
4:10 PM
Alright, Thanks Andras.
 
good luck
 
Of course, I now have semantic saturation for the word "course", but I suppose that's par for the course.
 
I was going to suggest calling sum on a gen exp rather than a list comp, but I suppose for such a small number of items the list comp is faster. And of course the run time is dominated by the user input.
A radical new insight to quantum physics was unveiled on xkcd a couple of days ago: Negative Quantum Space-Time. The OP first attempted to enlighten us on Physics.SE, and started insulting people when his question was put on hold. He lasted a bit longer on xkcd. That thread's now locked, but it looks like he's started a new one...
 
4:41 PM
Wow, they were really patient with the guy on the xkcd forums
 
On xkcd, we like to give people enough rope so they can hang themselves. ;)
 
smart people, you are
 
4:58 PM
I can't stand crackpots
 
:P
 
5:17 PM
@AndrasDeak I like to see the weird & wonderful ideas that people come up with. And it's relatively safe to do that on the internet. IRL, there's a risk that once you start interacting with them you may not be able to escape. And if you don't support them, they may brand you as an Enemy.
 
everyone speaking for Big Rational is the enemy
 
Today's riddle is titled "In python you can choose your friends and your family":
# Kid has inherited a bad hobby from its Dad. Find a way to remove the Kid's
# hobby - without removing it from the Dad. Hacks that raise AttributeError
# when the hobby is accessed are forbidden.

class Dad:
    hobby = 'drinking'

class Kid(Dad):
    pass

...  # YOUR CODE HERE (not limited to 1 line)

assert not hasattr(Kid, 'hobby'), "You didn't remove the Kid's hobby"
assert 'hobby' not in vars(Kid), "Kid must not have a 'hobby' property"
assert hasattr(Dad, 'hobby'), "Removing the dad's hobby is not allowed"
hmm, let me make that a bit shorter
Disclaimer: This riddle will teach you nothing useful
 
wim
class Kid:
    pass
 
now that's an obvious hack I forgot to account for
 
I was about to ask
 
5:23 PM
though that's pretty annoying to check
 
I was trying to make the obfuscator work
 
I guess I'll just add "Overwriting Kid isn't allowed" to the description
 
You can just say that redefining the class ^ yeah that
if you ask me it should be enough to replace drinking with something healthier
 
Unfortunately the kid's parents are asian - they don't want their kid to have hobbies, they want them to study all day
Here's a hint: I omitted the kid's Mom for brevity, but if I hadn't, the solution would be to help the kid's parents get a divorce.
 
wim
heh, that's an error message I've never seen before
 
5:32 PM
class Mom:
    hobby = 'marrying and divorcing'
 
@wim It's [text](http://url "title")
 
wim
thanks
how long has the sopython.com/spoiler been broken for
 
not sure, but we discovered it about... 2 weeks or so ago, I think? When we started doing these puzzles again
Turns out removing the Mom made the solution a little more difficult... oh well
 
ding dong!
 
wim
5:38 PM
this forces mro recalc .. interesting
 
What is the MRO of a nuclear family in the US? Now that's a programming question for you.
 
wim
@Aran-Fey I can see some uses actually
it's like a polymorphism hack that will affect existing instances
IIRC the return value of mro() is cached on __mro__, so if such a monkeypatch is is triggering recalc it looks like the datamodel is actively allowing the hack
 
Let's agree that we'd rather not see this used in any real-world code
 
wim
hmmm, I won't promise not to use it.. 😈
 
wim working hard on his job security
 
5:54 PM
*scribbles on notebook* try to avoid reading wim's code
^ that's written right below the crossed-out "rewrite ugly 6-month old code to ugly new code" on my to-do list, btw
 
6:07 PM
What to do if the OP copies your code in the answer, pastes it into his question and updates the question
 
@DeveshKumarSingh Roll it back. Especially if the new version invalidates existing valid answers, or makes the answerers look silly.
If the updated question is just a clarified version of the original question, then you might just need to update your answer slightly. If the OP is attempting to ask a follow-on question, tell them to ask a fresh question.
All of this assumes that the core question is actually worth answering. ;)
 
Instead of asking me in the answer as a comment, the OP pasted my code in his question and mentioned the error there, I have told him the same in the comment
Thanks for the inputs @PM2Ring :)
 
Answers don't belong in questions
 
And neither do follow-up questions
 
Yup. These edits should usually be rolled back.
 
6:18 PM
I did the same (rolled back the edit), I will also look at the meta question thanks @AndrasDeak :)
 
Sam
6:59 PM
guys can you help me? i cant install pyaudio on windows.
C:\Users\super>pip install pyaudio
Collecting pyaudio
  Using cached files.pythonhosted.org/packages/ab/42/…
Installing collected packages: pyaudio
  Running setup.py install for pyaudio ... error
    ERROR: Complete output from command 'c:\users\super\appdata\local\programs\python\python37-32\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\super\\AppData\\Local\\Temp\\pip-install-skiwftjl\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().r
has anyone gotten a fix for this yet?
 
Sam
@AndrasDeak Thanks for the reply, but that is an answer regarding portaudio...
apparently he also thinks python is installed in visualstudio or something?
I am seeing the path visualstudio... i havent used that in over a month now
im sticking to sublime text
so why is this
 
because that's where your C++ compiler is located, I suppose
 
Sam
oh ok
and euhm do you know how to fix this @Aran-Fey
 
nope, but this thread looks somewhat promising
 
Sam
7:08 PM
i am on windows, i dont have access to packet installers
package**
 
@Sam Do you have a C compiler?
 
Sam
The one @Aran-Fey was talking about I guess
@PM2Ring yes ive seen it but didn't know what one to donwload
because i think i have amd64
oh no i get it
i have amd64 so i need to download that one
ok and know? I downloaded it
 
@Sam Ah, right. Visual Studio\VC\Tools\MSVC\ I didn't see that before, it was hiding. Hopefully, the binary from Gohlke will work.
 
Sam
No i didn't mean it that way
i meant it in a way that im not really sure if thats the c++ compiler
afaik the its called gcc?
didnt mean to offend you if i did
 
@Sam No, you didn't offend me. The stuff from Christoph Gohlke is already built, so you don't need a compiler. The instructions on that page say: "Use pip version 9 or newer to install the downloaded .whl files." and there's a link with further info.
 
Sam
7:22 PM
PS C:\Users\super\Desktop\Overig\Files\visualp> "D:\Programmas\Visual Studio\Visual Studio\VC\Tools\MSVC\14.20.27508\bin\HostX86\x86\cl.exe" PyAudio.whl
At line:1 char:94
+ ... Studio\VC\Tools\MSVC\14.20.27508\bin\HostX86\x86\cl.exe" PyAudio.whl
+ ~~~~~~~~~~~
Unexpected token 'PyAudio.whl' in expression or statement.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
Oh ok thanks will try 👍
 
Good luck. I can't offer much more help. I don't use Windows. It's always seemed rather alien to me.
 
@PM2Ring At all?
 
Sam
Yeah im too not very good with windows, with the shitty file paths and stuff, but my school obligates i install some applications that are only available for windows
thanks for your help @PM2Ring
 
This is the issue I have with Windows. People always down it because it's stupid or whatever, but it's actually not half-bad. Windows is extremely user-friendly and simple to use. The issue comes when you involve Windows with programming - that is the bad match.
 
it's not half-bad, it's whole-bad
 
7:30 PM
As a general statement, your programming experience will be better if you work on Windows. That's why I have a Windows computer and many Linux virtual machines.
 
to each their own
 
@Sam which wheel did you download? Also, is there cross-over between the suggestion to install the whl and the error (In terms of the ordering of chat)?
 
@connectyourcharger Not in recent years. I've occasionally been in situations where I had to use Windows, but I didn't enjoy it very much.
FWIW, I was programming for almost a decade before I owned a computer. And it was at least another decade before I had much contact with Windows or Microsoft DOS.
I have spent a little bit of time using Windows 95, 2000, and XP machines. I never tried doing serious programming on them, but I did learn a bit about writing batch files on Win2k, although I've mostly forgotten that. As I said, it always seemed alien to me, and I felt like an outsider who'd never be able to get into the Windows way of doing stuff.
 
8:01 PM
There are some clear issues with compiling some libraries like numpy on Windows, but it's not quite as handicapped as it might seem. I transfer all of my code to Debian and make almost 0 changes when transferring over to my server
A lot of leg-work has gone into making it a decent environment to program in, in general. I don't do any Windows-specific work really, so I don't have to think too much about the OS. As you go lower-level from Python I guess the burden changes, but for Python, in general, it's not too bad
 
Hello! I am trying upload my code to Bitbucket repo, but whenever I type "git push -u origin master" command (which is the last step) I get this error: "fatal: protocol 'git@https' is not supported". Any hints?
I have researched on it, but in vain.
 
Sounds like your origin URL is b0rked. Try git remote get-url origin
And then git remote set-url origin <correct url>
 
OK thank you!
@Aran-Fey I ran this 1st command and got "git@bitbucket.org/1h_mmm/hello-project/src";
 
8:20 PM
Where are you getting this git@https:// thing from?
 
@Aran-Fey And afterwards I typed 2nd command and instead of <correct url> pasted "git@bitbucket.org/1h_mmm/hello-project/src"; have I done rightly?
@Aran-Fey From here: "https://bitbucket.org/1h_mmm/hello-world/src"
 
That's neither a valid URL nor a valid ssh identifier
I don't see any git@ stuff there, though
 
Hmm...
@Aran-Fey I got it from here:
 
And the https:// magically appeared out of nowhere?
 
@Aran-Fey No-no, I just dragged down the SSH button.
:46333311
 
8:29 PM
Can you see both git and https? I see either-or.
why not use either of the URLs that you've seen rather than inventing a broken one yourself?
 
Let's just be happy that the problem is solved
 
...it's solved?
 
as far as I'm concerned? Yeah
 
haha
now that I've seen their username, same here
@Anti-AmericanAnti-Zionist you might want to change your username to something less edgelordy
 
never heard edgelordy used in a sentence.
 
@AndrasDeak Can't change my username on chat, despite "Save changes to all communities".
 
Andras often verbs unusual words
Usernames take a while to update in chat
 
As with profile pics and chat permissions
They usually take about half an hour from my experience
 
8:48 PM
@Aran-Fey "edgelordy" is an adjective. The adverbial form "edgelordly" is possibly more likely from a native speaker.
 
Oops. Ah well, close enough. Verb or adjective, it's basically the same thing
 
well one is for action and the other is for a noun
we should strive for perfection in our verbiage, otherwise, it's just balderdash
 
in the end they're all strings ¯\_(ツ)_/¯
 
wim
 
when it comes to English I usually err on the side of practicality than purity, especially since English is as pure as a cribhouse yam
 
9:05 PM
A huge proportion of English speakers would probably never have heard of "edgelord" so "edgelordy" probably would be taken as a decent attempt to describe the behaviour. I'd go so far as to to say it's more English to do that than to know that "edgelordly" was a word
 
Ardour should be balanced by perspicuity.
 
We're getting into the realms of words that you're unsure whether the other person will even understand, so there's some deference in making up "edgelord-y". There's more to language than a statement of facts. If they know the word, it's a minor correction. If they don't, it makes it sound like you're not totally positive on the word yourself. Safe ground.
 
does anyone know how to build a system that scales
 
I heard mongodb is web-scale
 
MongoDB won't scale on its own. it's not considered a solution in and of it's self
maybe in combination with other systems
 
9:26 PM
@Rick is this a serious question or a reference I've missed?
 
9:47 PM
@roganjosh it was a serious question
 
In that case, I think you have to be more specific. You've not said anything about the application or what kind of scale you need. There are plenty of ways to over-engineer a solution too, which would be just as bad (and probably more costly) than a simple system.
 
well, I need it to be over-engineered. As over-engineered as possible. Someone asked me how to build an Amazon-like system
 
Do you think that Amazon operates with its old codebase?
 
I mentioned a lot of things but I'm not sure if I was correct .
 
"Over"-engineering always implies a comparison to the actual problem. Building a dam to supply a county with electricity is not over-engineering, it's engineering.
 
9:56 PM
@roganjosh well this is not really a codebase type of question more of a technology type of question. like how would you structure the types of databases and which ones would you use.
 
@Rick what point is the company at?
 
just planning stages
 
Then Postgres, probably. It's pointless to plan beyond that unless you expect 100,000 users in the next 6 months
 
Postgres is not a solution on its own. This is systems architectures
Postgres is a tool in the architecture but not a solution in and of it's self
 
... and we can't really talk about that side without any idea of what the idea actually is.
 
10:02 PM
The idea is Amazon, the same thing that they do online market place
 
Before we go further, do you have an NDA?
 
yessiree, 23 pairs of chromosomes in each cell
 
nope no NDA, there is nothing NDA
 
If you don't, that says something about the idea. And, in any case, they (Amazon) will slaughter you
If the idea has a chance to undermine Amazon then for sure there would be an NDA on the idea that would get an edge
 
NDA means nothing in California, and this is a general discussion if what you suggest is valid
this is more exploratory to see if there are ideas out there I have not explored.
 
10:07 PM
mmm. Ok, well maybe it wouldn't be the same term in Canada as in the UK, but there must be an equivalent mechanism
Whatever you say in this room now; what stops us steeling it if it's a fantastic idea? You've already told me that you're in a planning stage and don't yet even know how to build it
 
I don't care if you steal it.if you can execute on it then you probably deserve it.
 
That's ridiculous
If you have an idea that you think is novel then you guys own the idea
As soon as you release it, then you're in serious trouble
Don't under-value yourself. You need to be a bit coy in what you ask
 
oh god! you do know system design is a thing. It's not some secret. A lot of companies openly publish their underlying systems architectures
 
Then I'm completely lost. You want to launch something, presumably open-source, and you're asking in Python chat whether anyone had experience in scaling.... which is exactly the point of AWS
 
umm AWS is not an all in one solution, they are just servers. what you deploy how you tie everything together is up to you.
why am I having to explain all of this
 
10:21 PM
Because it makes no sense
You want to take on Amazon. Have you researched their servers?
 
Not that I don't enjoy this escalator of a discussion built in the middle of the plains, but I don't think they've said they want to take on Amazon. Just copy their model of whatever.
 
Sure, and I don't wanna be harsh so I'll drop this discussion
<I didn't intend to sound harsh> is a better explanation, sorry. I'm not an authority on ideas, but I'm not able to help the idea go forwards
 
@roganjosh You could just say, "I am not familiar with system design and systems of scale." This is not a wrestling contest, I am not trying to wrestle you
 
How do you know he isn't?
 
I'm also not trying to wrestle with you, but I've also worked in companies with 500,000 employees. Systems that sustain that size aren't pre-packed, it takes evolution
 
10:30 PM
@AndrasDeak that's a good point.
 
11:04 PM
@Rick 'system' is way too vague, I think you said 'online marketplace'. More detail is useful. Are you building both the frontend and backend? What is the buy-vs-build justification against using off-the-shelf or standard open-source offerings? Python + Flask + SQLAlchemy + Postgres is one common choice that's free, well-known and scaleable.
@Rick That's the whole Peter Thiel/ John Doerr/ Paul Graham philosophy, but whatever. In this case there are 10,000 online marketplaces out there, it's not novel.
Python + Flask + SQLAlchemy + (some templating package) + Postgres
 
@smci Yes we are building both. There is a preference for open-source. There is no buy vs build justification. Everything needs to be built, but building off opensource is ideal. The main concern is scalability with respect to cash architectures and replication
we need to maximize for response times
caching*
 
@Rick: I do agree with the others that if it's just yet another general-purpose online marketplace, Amazon will slaughter you, unless you have an unreasonably good niche. 12 years ago, I had a friend who lost his shirt in a company building custom PHP-based storefronts for FB sellers, then guess what, Facebook Marketplace came out and killed all the little guys. And that was 12 years ago already....
...At least their company got acquihired, so he kept his job (even though the product got shut down), but his vested shares were near-worthless... and in today's market they would just go to the wall, with a major splat.
 
Amazon is not really important, think you are getting hung up on a detail that's of no significance. but thanks I have a better idea of where to go from here.
 
@Rick Local server, not cloud I presume. Have you looked into Python + Flask + SQLAlchemy + (some templating package) + Postgres, there are 12K hits on Google, tutorials, how-we-built-it, business studies etc.
 
Python and flask is an implementation detail, why not GO instead
 
11:19 PM
@Rick Strongly recommend you go 100% open-source, nothing proprietary. You don't want your toolstack to be a liability or cost center or dependency, especially as there's no reason to.
 
so why Python and not Go lang
 
Why is that a question for us?
 
@Rick Based on the collective wisdom of smart people I know (several of whom are Python package developers or authors), Golang doesn't yet have the rich package environment of Python; I've only heard of it being used for faster performant multithreaded webservers, no heavy transactional database stuff. But may have changed a little in last 2 years. Again, look how many companies have successfully built an online marketplace in Go... browse tech skills listed in job ads on LinkedIn/indeed.
You need to a little more due diligence yourself... let us know what you find on Golang vs Python for transactional database stuff
 
Golang is faster for serverside. it's also multi-threaded
Python is good for math but maybe R is better
no real reason to go with python at all, maybe machine learning but R has a richer selection of statistical methods to choose from.
 
That's a series of statements. I gave my opinion, smci gave a perfect anecdote and some good advice. Why are you responding with statements that talk you out of Python in the Python room?
There's nothing stopping you from trying to match up Golang with R
 
11:33 PM
@Rick Yes this discussion is kind of edgelording. I don't know which SE network is onsite (SoftwareEng on e-commerce is seriously useless), but it ain't SO , unless you (say) ask for a side-by-side performance and scaleabilty comparison of Golang vs Python transactional DB backends
 
@Rick can you not see the absurdity in asking "how do I build scalable tech; python is an implementation detail" in the python room? This is ignoring all the other wounds this endeavour is bleeding from.
 
@AndrasDeak ...that was quite poetic... and also Monty-Python
 
It's just a Hungarianism
 
@AndrasDeak Ah. These days in the US it might need a trigger-warning...
 
How so?
Or do you just mean that it's a graphic notion?
 
11:40 PM
@AndrasDeak sorry @AndrasDeak that was more of a Jab at them and their line of reasoning. Python was an unintended casualty :P
 
I don't care what you think about python. I care how you treat people you're trying to ask for help from.
If multiple independent (and frankly, quite different) people think you're making little sense then maybe, just maybe, you're doing something wrong.
 
@AndrasDeak my bad I'll be more considerate next time.
 
please do
 
@Rick (This is offtopic in the Python room) but I googled for "Golang "transactional database" backends" for you and got 2.7K hits... why don't you skim them then get back to us with any specific Golang-vs-Python questions? Also, site:news.ycombinator.com +Golang is a fast way to get the wisdom of the startup crowd, and detect BS or hype.
 
@smci so are you saying Golang is all hype and no substance?
 
11:48 PM
It could be that Golang is to Python today as Python is to PHP, and PHP was to PERL... but that depends on the specific area. Scientific and ML users of Python have not migrated to Golang much at all, AFAIK; e.g. if they really want performant multithreaded visualization servers they to go JS.
@Rick No and will you please stop trolling. Everyone here has tried hard to be helpful to you, me included, even though you've been offtopic, and not asked specific answerable questions (in any language, not just Python). I don't know how to constructively speak to someone like that. I'm getting back to my project stuff now.
 
@smci sorry it came across that way. it was a sincere question
 
@Rick I'm saying for specific application areas (such as example I gave, scientific programming), Golang has been all hype and no substance. Hence Golang is not a Python replacement. Hence it has a small community of users, developer talent-pool, and its libraries maybe not production-ready as Python. (Why it's not suitable for scientific programming is outside my knowledge, but it probably centers on maturity of C/C++ wrappers, exception handling etc.... there is no Numpy/Scipy for Go)
But for your application area, you need to go do your homework. Not keep asking us "Why can't I use Golang/XYZ?"
 
02:00 - 16:0016:00 - 00:00

« first day (3145 days earlier)      last day (1797 days later) »