« first day (2771 days earlier)      last day (2402 days later) » 

00:02
@abarnert but aren't mods able to see deleted comments? How far does that stretch? In which case, deleted isn't really deleted, it's just filtered out.
@OneRaynyDay So testing files for errors causes a segfault? Sometimes you want EAFP, sometimes you want LBYL, sometimes if you even look back to see if you failed you get turned into a pillar of salt.
@abarnert okay... so heres the story
ahem
We are intercepting many syscalls, one of them being stat. If we use import os, and os.open we are not calling any stat calls. Among the syscalls we intercept, open is one of them. Opening is fine, but stat'ing is not implemented "properly". We point to a random file that always exists and returns whatever return code stat'ing it will return, as well as returning a struct containing things like st_mode, st_size, etc.
So when python calls its builtin open and read() from that abstract file object, it is calling a stat on the file for some reason(which we don't do in os.read(fd, num_bytes))
When it stat's the file it probably finds that the stats are likely invalid for this file, vomitting up an ferror, of which our LD_PRELOAD .so intercepts and says "well, we don't know what to do here, explode please"
and so the explosion happens and I get a migraine
00:21
rbrb
I think usually, all it cares about is that on any platform where fopen works on directories, it didn't just open a directory—which you should be able to fake to its satisfaction, right? But I'm now sure; read the source I linked to.
We must have a canonical question for "Why can't BS4 find this obviously JS-generated div when I download the same URL with requests?" that covers all the usual stuff (Selenium, running V8, reverse engineering what the JS does, checking whether the site has a publushed API they wanted you to use in the first place, etc.)
@abarnert So just to be clear, fopen is fine, read() is not ok. And I see there are a ton of ferror's in read() in your link, thanks for that btw
01:13
cbg
01:33
Folks, should I get rid of the small caps and revert to "Coldspeed" like it was one long ago?
I quite like the small caps but too many users think I'm COLDSPEED or Coldspeed and end up trying to ping someone who doesn't get pinged.
Switch it to Coldspeed!
 
2 hours later…
03:19
Okay... I'll ask again in the morning :P
I like the small caps
@Coldspeed I don't see the problem
wim
wim
Agree with miradulo, switch it to Coldspeed
Could someone help me with some code. I can't ask any more questions on the forums and my questions weren't even that bad...
Why can't you ask, I don't get it?
I've asked questions before that weren't on the forums but because I'm a new coder and they were basic to other people they downvoted and the system auto banned me from asking more intermediate questions
Right now I'm getting a weird effect going on when running a script in idle.
03:33
First, just make sure your question does not already exist
I have, but sometimes the questions were different and I even posted the link to the similar questions.
and they still kicked me for that...
Well... if you got banned it might be that you do have to fix your questions somehow... Still, I'd say yes, but I was heading out
Good luck though
I've got a question about the idle though if you or others could help. When I set a variable equal to a string that has a pathname in it, the python command prompt closes immediately and even with input() statements in it the window closes
@AlB do you like small caps or title case?
What do you mean?
03:36
I have 2 for, 1 against... @AlB will be the decider.
@AlB do you prefer @cᴏʟᴅsᴘᴇᴇᴅ or @Coldspeed?
outta nowhere, the pressure
I understand this is a hard decision, but you must prevail
I like smallcaps
omg
and we've reached dead heat folks
03:38
Do you guys know why idle closes
from my previous question
What about you play import random; random.randint(0, 1) to decide?
Or flip a coin, which ever you like
it still closes
Lol...
If only solving all problems were as simple as flipping a coin
I have an input and then have a variable I'm setting to a string of a path. For some reason if I don't use a path it doesn't close
@AlB have you tried flipping a coin?
03:41
the preface for this meta question is just terrible
It's ok, no?
I don't do MetaSO a lot, I don't know
somebody got the question closed because they didn't like the answer, or the fact that it was self-answered.
I honnestly don't understand the question
I get it, some people like to stay out of the drama
03:47
I like watching the drama, not so much participating :)
I'm bored, people don't ask questions... nights are boring
Meta seems a lot more combative these days in general, IMO
That blog post's been the start of it
Can someone ask an interesting metaclass question or something
Ah right, that
03:51
@AlB was your question metaclass-related?
I don't know the difference of metaclass
or the regular stack overflow
my mental stack is overflowing
If I type this in, the new window that would ask for input closes immediately
a = input("end of program")
MasterFolder = "C:\Users\JahnCena\Desktop"
a = input("end of program")
But if I type this in, the window stays open... a = input("end of program")
MasterFolder = input("Paste MasterDoc Security Location")
a = input("end of program")
and I don't understand why
Any suggestions for how I can improve this answer. I was going to delete it but then he accepted, I think I went too complicated.
I'm afraid he just took it because it solves his issue
Cabbage
@cᴏʟᴅsᴘᴇᴇᴅ I like small caps, but I vote that you switch to plain Coldspeed. The small caps in your username are a PITA if I try to ping you on the main site while I'm using the mobile interface because there's no autocomplete. It doesn't matter here in chat because I can select the message I'm replying to.
04:16
fair enough... be right back
@chrisz I really do not understand OP's logic in that question
He wants the value at each index to be the number of previous values greater than the current value
Oh
People have a hard time wording questions sometimes
@AlB Firstly, SO isn't a forum, so trying to use it like one can lead to trouble. Yes, people can be a bit harsh to newbies, but we were recently asked to try to be more welcoming. However, newbies are expected to read the Help pages so they understand how SO works, and what's expected of them.
People don't downvote merely because you're a new coder, they downvote if they think you haven't done sufficient prior research.
hi
feel like I threw out my old shoes and bought a new pair of the same model
04:24
So if you ask a question that could be answered by reading a decent tutorial or the relevant section of the docs, then expect downvotes. SO can't be a substitute for an actual class or tutorial. We can't teach you stuff from scratch, but we can help to fill in the gaps in your knowledge, and try to fix misunderstandings you may have.
Oh, even went with the lowercase first letter, living on the edge ;)
Gonna have to change that section of your bio now
@coldspeed :) I heartily approve.
the lowercase c on my profile was the same c on my older username too
so people who've been doing @c+TAB to ping me needn't have to change... muscle memory prevails. You're welcome!
Oh wait, @c will also suggest people with uppercase C's as well :|
@AlB That does sound weird. Sorry, I don't have a solution. I never got into using IDLE, I found its quirks too annoying. Which OS are you using? That might be relevant.
04:41
@chrisz It looks ok, but you could be more explicit about how for loops over the list's items, not the indices, since that appears to be one of the OP's points of confusion. Maybe link to an existing answer that goes into details, there are a couple in our collection of Common Questions, IIRC. Maybe mention how enumerate gives you the indices and the items. That should be obvious from your code, but saying it explicitly may be helpful.
I just fired up an AWS instance. If you ask me anything too complicated, I'm likely not going to know what you're talking about. I started the tutorial for WordPress. But what I really want is to run a Flask server on a Linux VM. Is anyone aware of a walk through that describes this?
So I know it might seem like a bit much to handle at first, but deploying flask is extremely easy to AWS if you use Docker, and if you do decide to do docker, I can definitely assist you with that.
Plus, I can point you to some guides that show how to do it as well
Yes please. What guides did you use?
From the horse's mouth
That guide will give you all the tools you need to deploy a docker image, however the docker image created in that guide is going to be massive, around 1.3gb for a simple application. Once you get comfortable with the Docker process, I would look into the Python-alpine docker images, which are much better for production.
05:02
I've found the aws docs are severely lacking in documentation... even the stuff on how to install their own tools is useless.
AWS docs are awful, however, I have been working towards the AWS devops certification, and the study materials are 1000x better than the documentation
I would presume anything is better than the docs
where do you get the study materials?
pay for the course I presume (-:
I will be doing that once I'm closer to being ready, but everything free you can find here: aws.amazon.com/certification/certification-prep
Sweet "We recommend one or more years of hands-on experience using AWS"
I'm almost there
05:12
Yea, I'm really hoping my company switches to Amazon's government cloud, so that I can learn on the job, not just on my personal time
So I registered a new domain www.pirr.cc
I also got a personalized CA license plate PI R R
My branding is near complete
And that super cool license plate is going on a Prius V which maximizes and oozes cool.
05:33
I like the Prius... it makes a nice sound when you hit the gas
05:43
@chrisz BTW, I suspect there's a way to do that in O(n log n), since it's closely related to the problem of counting inversions
It's too late at night to read more than like 3 lines, but I bookmarked it for tomorrow ;) rhbrb all
06:07
rbrb @chrisz
@piRSquared With all that pi stuff going on, I hope you've memorized more than a few digits of pi. ;)
I earned my pi geek badge a while ago. I'm no elephant and those digits are long gone. I know pi to infinite places because it is the irrational ratio of a circle's circumference to its diameter and oh yeah np.pi (-:
I almost always use np.random.seed([3, 1415]) to seed my rng. One of my biggest moments of flattery is when I saw another answerer use the same seed.
I learned 100 digits in my teens, and I still remember them. I tried to learn another 20 or so a few years later, but I'd lost the enthusiasm, and they didn't stick. As for PRNG seeds, I generally use 42.
That's a good one
06:24
I've been thinking of switching to using a string as a random seed, just to show people that random.seed accepts strings.
I know random.seed can use a huge number of bits, but I forget exactly what it does with non-integer seeds, I think it may just hash them to create an integer seed. I'll check the source code when I'm not on my phone.
@piRSquared Just take the natural log of -1 and divide by i. ;)
See! You can appreciate the difference between knowing digits of pi and knowing pi. rbrb all
06:45
Morning cbg
06:56
cbg
07:06
@PM2Ring which log?? ;)
 
1 hour later…
08:22
@AndrasDeak Yeah, ok. Take either of the logs closest to zero, and then find its magnitude. Or look at the whole family, which forms an arithmetic progression, and determine the common difference. Then divide that common difference by 2i.
jpp
jpp
cbg
I have a pretty basic question. when you use zip / enumerate with a C-level function, does a Python-level tuple get created internally? e.g. Counter(zip(a, b)) or dict(enumerate(a, b))
it's clear when you iterate for val1, val2 in zip(a, b) & for idx, val in enumerate(a, b) you get tuples back. but I'm not sure whether that's the case when it's fed into an optimized function.
I'd be surprised if such an optimization took place. Like, how would you even optimize the tuple away?
jpp
jpp
08:38
I guess if the values get sent directly to C to create & use a tuple there?
instead of creating a tuple in Python and then sending it to lower-level code?
Morning cbg
I'm not sure I understand the "in python" thing. enumerate is written in C, dict is written in C, and tuples are also written in C. There is no python code involved in the execution of dict(enumerate(a, b)), but the tuples are still normal "python" tuples
(obligatory "I don't really know anything about the CPython internals and everything I say is based on my limited understanding of the same" disclaimer)
jpp
jpp
I see, I get you.. so C can read a Python tuple and vice versa without manipulation, they're the same thing.
just the Python API is more lax, you don't need to define type explicitly etc
I agree with what Aran-Fey said. But it'd be nice to get confirmation from someone more familiar with that stuff, like Martijn, Antti, or abarnert.
jpp
jpp
Yeh, I did do some research, had a look at the C code for builtins.c, then got lost.
08:48
@jpp All the built-in types are actually C structures.
jpp
jpp
So that's the bit I think I was missing. there's no "transformation" going on because they are C structures.
I suppose it's kind of ironic to build the objects of an OOP language in C. :) FWIW, my first exposure to OOP concepts was via C: a lot of Amiga stuff was OOP-ish, even though it was all written in C.
jpp
jpp
Fyi, my question is on the back of this answer, which probably deserves more credit than it currently has.
I'd consider upvoting it if my attention span wasn't too short to even read the question and answer in full :^)
jpp
jpp
@Aran-Fey, Haha, that's ok, there are sometimes hidden gems (like also abarnert's answer which cs posted a bounty for)
09:03
check if index is out of range or catch IndexError?
what's best practice
@MartijnPieters you finally got one!!! :D
@Neoares It depends. :) If the index is usually in range and is only out of range no more than around 5-10% of the time, it will be faster to catch IndexError.
it will be out of range more like 95% of the times
1-(1/batch_size) times
where batch_size is usually 16, 32 or 64
@Neoares In that case, LBYL will definitely be faster than EAFP. Python exceptions are faster than equivalent if code when the exception isn't actually raised, but they're quite a bit slower when the exception is raised.
BUT
when it's out of range, I just break the loop, so in any case it will be out of range 1 time
except IndexError:
    break
but yeah, it's good to know the generic answer
had to search what LBYL and EAFP are
@Neoares Ok. So run some tests on typical data to see which way is faster. :)
09:11
you mean in my context?
@Neoares ANd now you'll remember for next time. ;)
I don't think I'll see any difference in my code
@Neoares Indeed. Depending on what your code is actually doing it may be simple to determine mathematically how long the loop will run on average before it hits the break. But often it's simpler just to run some tests.
I feel slightly dirty. I just showed a newbie how to create a Singleton in Python. :) stackoverflow.com/questions/50370744/…
09:26
shame on you
@PM2Ring I remember answering one like this
When did Martijn start using typing in his answers? I'm not comfortable with this development... stackoverflow.com/a/50407959/4014959
@PM2Ring slap :D
@Neoares «looks like "P" palette format is very common for gifs.» Well, yes, because GIF is a palette-based image format, so all GIF files contain at least one palette, GIF anims can contain a single palette, but they may contain a separate palette for each frame.
@PM2Ring that is called software engineering
09:36
@AnttiHaapala You better be prepared to slap DSM too. He's not a fan of type hints either.
@PM2Ring TIL
@DSM slap you too
@PM2Ring much better ;)
no rebecca? disappointed
09:38
We may soon be able to use keywords as variable names by prefixing them with \ 🙌
@vaultah as in \in = 3??
nooooooo
why is that better than _in = 3 which looks normal in python?
this seems madness to me
I'm with the Deak.
09:44
> First they introduced type hinting and I did not speak out
But we did! @DSM tell him we did :D
@Neoares Please don't do that.
oh, yeah ^ I missed that
09:45
was that an attempted rickroll?
no
it was a SO question
don't lie to me
@Neoares No it wasn't. "stackoverfiow" != "stackoverflow"
That was a beautiful piece of JS room culture
I was only going to give a fair warning
@vaultah Closed, and deletable.
Thanks, voted
cbg
10:22
@MartijnPieters Now I'm curious whether float(b'5') is faster than int(b'5');)
@PM2Ring :-P
I'm curious if that's Martijn's shortest answer ever :p
I can't remember how I got there, but I just read Martijn's answer to "Why is float() faster than int()?" in the last day or so.
@Aran-Fey The OP updated this, but it's still pretty unclear. Hopefully they'll understand & respond to my comment…
10:50
that hardly even counts as an update
I'm like 85% sure that the problem is somewhere in the missing body of that function
What missing body? I didn't see anything
CBG
Need you help guys
Can you please tell me that how powerful WMI library is?
"i cant copy and paste my code here cuz im to lazy to read the rules but please tell me an easy way to implamate a background in a python game" OP is also too lazy to use shift or punctuation. stackoverflow.com/questions/50409443/… 10k+ only
10:57
I am wokring on a tool.
Which is based on Django framework and I am trying to use python only for the whole tool.
Now I want to access multiple machine from the main machine and execute some programs their and even monitor them
So WMI is a suitable library for it?
Or should I use something else?
there*
@AndrasDeak Ah, the OP has added 1 line of code to the function. Still, I think the error is hiding in the code that's been replaced with that #parsing it place holder
sorry, I was trying to make an organized crime pun
also I can't today
Oh. That one flew under my radar :p
I won't blame you for that one
I've been refraining from posting an image of a wok ring. ;)
11:01
apparently staying up late grading mid-terms and getting up early for work are detrimental to one's cognitive abilities
"detrimental" should implicitly imply "mental" if there's no other context
I am really sorry to disturb you but this is really important for me. Please help me with this one.
You're not disturbing, and asking here is fine :) I personally don't even know what WMI is so I can't help you, and perhaps the others who are here right now are in a similar situation
Is here anybody who knows Scrapy?
11:16
You can ask your question without a preamble, unless it's about the question that you've just posted on main site
@AndrasDeak Thanks for replying. Can you tell me what is the best way to execute some program remotely?
no idea, sorry
Thank you so much @AndrasDeak I will try to ask some specific questions from next time.
There was nothing wrong with your question, it's just that I don't know the answer
well, your second one may have been too broad, I don't know
Ok then my research is still continue I suppose.
Some times its really hard to decide what fits best for your purpose.
11:30
yup
From a quick look at the documentation it looks like it might be simple enough for you to set up some quick test-cases
@roganjosh Actually I did performed some test cases and everything is working fine on a small scale.
But I am worried about keeping it for larger volume of usage.
Actually its just that I am not feeling confident about this library.
There's also a C++ wrapper you could look into github.com/cloudbase/PyMI
But I have never used WMI so I can't give any assurances over the quality of either library
Ohh great. finally something worth to look upon.
Thank you so much
too broad. At first glance, it looks like the OP has done a fair bit of work, but then he admits he found the code he posted. stackoverflow.com/questions/50410465/…
12:16
Just gonna try this
[test-tag]
Please test chat markup in dedicated rooms such as Sandbox.
Poor Rakesh is getting chameleoned… stackoverflow.com/questions/50410975/…
Such is the fate of those who answer bad questions
jpp
jpp
@PM2Ring, I do feel sorry for Rakesh. Being FGITW is a great feeling, but if that's the only thing you do, life gets boring.
12:36
cbg
I don't mind people FGITWing. I do mind speed at the expense of quality. It's just too easy to mis-read / misunderstand the question if you go too fast. And you're unlikely to come up with the best solution if you code the first thing that occurs to you. And IME Rakesh is often guilty of one or more of those things.
jpp
jpp
@PM2Ring, Yeh I don't mind it either (well, I wouldn't, would I). It's a "feature" of SO. But after a while, on its own, I can imagine it can get boring.
jjj
jjj
cbgall
@jpp *annoying
jpp
jpp
12:56
I noticed the other day the top 2 rep-earners are (by far) data analysis users (Gordon Linoff, jezrael). It's no coincidence, you can have a [slightly smaller than] infinite number of combinations of merge / join / concat / count / etc etc.
if we were to be strict and closed anything that's a dup of <=3 isolated functions, not sure there'll be a huge amount left.
IMO, the only true value we can add is to investigate / learn from what's the best option when you have multiple options.
jjj
jjj
I need to pass arbitrary lists of key=values pairs to my cli program. So I've implemented a custom action (we are talking about argparse here) which allows for such a behavior. Unfortunately I need the types of values to vary. What approach should I take here? I could implement the custom action in different flavours for different types of args but this seems ugly. Any ideas?
@jpp problem with Pandas and SQL is that the people asking the questions have a difficult time generalizing canonical concepts. That is why it is a rich area for rep farming. Often it is too difficult to search for an adequate generalizable dupe target and it's simply easier to answer the question again. Even when you find a dupe that can work, an argument can almost always be made that it is slightly different.
I've made a few attempts to provide massive canonicals. I'm not sure how helpful it's been.
jpp
jpp
@piRSquared, You are right, and of course there are many parameters for each of these functions. Which is why I say almost infinite. The problem is the canonicals aren't searchable. Indexing ability would be amazing
@piRSquared In that sort of situation it's valid to write a short specific answer but then hammer to the more generalised answer. I've seen Martijn do that.
@PM2Ring that is a good idea
jpp
jpp
13:03
@PM2Ring, That's an excellent idea. Do you suggest we are obliged to turn our answer into a community wiki too? In that past, I've had users say, "Why did you answer if it's a dup..."
Sometimes you can just hammer, and give adequate hints to the OP in a comment.
@jpp That's not strictly necessary, but it does reduce the tendency for people to get upset by someone answering and hammering.
Also frustrating is that in tags whose questions are asked by people who are new to programming in general (Pandas) they are likely to choose the first answer or even the easier answer rather than the best answer. This is where rep comes into play. OP will tend to accept an answer from a higher rep answerer because they trust it more.

SO is great, but not perfect. As users of SO, I think it is a responsibility to upvote quality answers. I tend to upvote a lot, but I try to be discerning.
jpp
jpp
Yep, the classic one-liner we get is just use df[col].apply(lambda blah blah blah) - fast to type but not really leveraging pandas.
jpp
jpp
and of course it's easy to understand, so OP accepts
13:10
zactly
I can see both sides. I still like the idea.
@jpp You can counteract that to a degree by adding more explanation to the complicated answer, explaining how it works, and why it's superior to the one-liner. People want solutions that work, and which they understand enough to use confidently and reuse. If they don't really get why the complicated answer is superior they may use it, especially if the answerer has high rep, but they won't really be learning much.
does fb work for you guys?
Nope
13:15
No, that's why I don't use it. (Rereading my post, I realized that my humor was not at all obvious... I was trying to make a joke)
Sorry, something went wrong.

We're working on it and we'll get it fixed as soon as we can.

Go Back
Facebook © 2018 · Help Center
and broken pic link <3
@AnttiHaapala I get a login page. But it tells me to update my browser, like lots of sites do these days. :)
yay
@PM2Ring so I guess just a local edge location then :)
back up
\o cbg
13:21
thanks @IMCoins glad its appreciated
I believe the 100+ upvotes show the appreciation though. :P
In fact, i was just contacted about a authoring opportunity. I'm not sure if I'm ready to go down that rabbit hole. Anyone here authored stuff that can warn me away from the idea?
@piRSquared I yell at people?
@abarnert I think on most such matters black's judgement is better than mine :)
@holdenweb I over dramatize "discourage" as yelling chat.stackoverflow.com/transcript/message/42583003#42583003
13:37
I believe authoring stuff might be very very time consuming.
@IMCoins I think holdenweb would probably agree. :D
jpp
jpp
@PM2Ring, done
phew! My rep was just at 123,666 and was save by an upvote.
Was it on the pivot df upvote ?
no, that's what did it. Coincidentally, it was an answer/hammer acceptance and upvote that saved me stackoverflow.com/a/50403843/2336654 (-:
13:49
What do you mean by hammer acceptance ?
jpp
jpp
Yeh, I think that meta post didn't consider data analysis questions as a separate entity. It's fair to say the vast majority of these questions can be dup'd to a canonical. But OP needs guidance to understand why.
cbg! Why the "?"
13:54
because I'm not sure if I've to get some more sleep:D
Or he's unsure if he's come across some cauliflower
I'm not one for early rising
For how long have you all been into programming in general, and python specifically ?
since yesterday?!
@IMCoins ~8 years, 7 years respectively. A few others here are at least triple that.

« first day (2771 days earlier)      last day (2402 days later) »