« first day (3652 days earlier)      last day (1520 days later) » 

04:20
If I wanted to run the following from a setup.py or a requirements.txt, how would I do so?
pip install kivy[base] kivy_examples --pre --extra-index-url https://kivy.org/downloads/simple/
04:57
cbg, a questions says "asked 35 mins ago" in main feed, but when I view the question it is posted Oct 6, how is this possible?
 
2 hours later…
06:28
so much of SO is "please debug my code for me" these days. I don't know why I even bother. 90% of the time I just comment with a link to eric lippert's blog.
Being active on SO nowadays is like being a janitor at a junkyard. There are more productive things you can do with your time... like sleep... or watch paint dry
11
 
1 hour later…
07:41
Hi Anyone up. Need help on getting suggestion, how to access another network shared folder through python!!
07:58
that doesn't sound like a job for Python. More like a job for your OS.
@BožoStojković are you trying to implement flash cards?
08:13
@MisterMiyagi Hmm. I could call them flashcards, yes!
question about jupyter lab / i installed in into a virtual env , importing pandas I get an no module error
jupyter notebook is installed i the same virtual env and i can import pandas there
fixed this , now getting different challenge saying permission error after using os.system('\\server ip\folder\sub folder\etc') . this says permission error: raise ctypes.WinError()
PermissionError: [WinError 5] Access is denied.
@Amundsen try with workon virtualenvname, if that helps
08:38
@ruchiyadav this has nothing to do with Python, I'm afraid. You are trying to execute something you are not allowed to execute. The behaviour would be the same no matter how you execute this something.
Set the proper permissions to allow accessing the target.
09:06
is partial type hinting a bad idea? I feel it would be more readable in places where we're passing abstract classes but not necessary for like int or lists really
 
1 hour later…
10:24
@aadibajpai you might just as well type-hint everything. knowing whether something is supposed to be a plain str, float, bool or int can be very useful.
SO main is full of people mixing up basic types.
 
1 hour later…
11:44
@GitauHarrison and that's precisely why I suggested adding the models to the question. The SQL for the migration doesn't match the class you've shown. I think there's too much going on in that question, it's feeling too broad to me
My semi-serious suggestion (if you can afford it) is to throw your migrations folder away and start the flask db init and the migrations again
Certainly easier than for me to try and unpick my way through all the stages shown in your question :P
What are bit hacks ?
i = 0x5f3759df - ( i >> 1 )
Any source?
Google is your friend. These arcane incantations should not be used lightly before paying a tribute of effort, tears and sweat.
it is equal to i=1597463007 - ( i //2 )
11:59
yeah, he should've used a few & and ^ in there
Are there benefits of using them ? performance ?
street cred
not if you are asking in the Python channel, no
oh ok
In generally in programming ?
Did you ask Google yet?
12:08
not asking google first is also a performance improvement
Is... is that actually a zero?
I got it in C++
may be
\x00
How did we go from bit hacks to null bytes?
I think it was a humour
12:22
Let me just ask my friend Google what that means...
make sure you switch off "German" first
12:38
I cannot self-Germanate.
morning cabbages, folks
I am still searching programming hacks .... but,got nothing in python....
12:59
@Janith why not search for bit hacks if that's what you want to know?
Google is good but not that good
13:11
I did ....and I got about it..but,it also is under performance engineering.... but,I want to find more of that kind of hacks .....
13:30
about a flask route I try to get a post request to that function and return a get request
but get no GET Request, is this the correct way to do it or should the route redirect to another route ?
I don't understand what that means
@roganjosh okay thank you
cbg, anyone here installed 3.9 via brew? brew install [email protected] is this the right one? I get "[email protected] is keg-only, which means it was not symlinked into /usr/local" can I still use it like normal python? I only use brew for python
13:58
my two cents' worth: if you're going to use multiple python versions, I'd recommend pyenv (pipenv is also an acceptable solution for this, though I haven't used it myself)
tbh I messed up all the whole thing :/
I had 3.8 and wanted to switch to 3.9, I dont want two versions, there is already a system python3
now I deleted the whole brew python and I still cant get python3 --version to point at 3.9.0
pyenv looks cool, I dont need multiple python versions, but for those who need it is useful
What are people's opinions on realpython.com? It's always showing up in my Google searches, but I tend to defer to SO and the official docs, so I haven't read too much on it. They don't seem to have dates on their articles, so sometimes it's kind of hard to know what's recent and what isn't. Thoughts?
14:16
I use that when I dont really know anything about a module, sockets and threading articles were good for me before heading to the docs
the decorator one was also good, but these are the three that comes to my mind right now
Yeah, I was actually just skimming the threading article
@MattDMo I've found their stuff useful before, but I don't know how often they update articles. I generally see a pattern, library, or feature and look it up in multiple places anyway, particularly to get an idea of conventional usage (eg SO/docs). Realpython tends to have half decent explanation with example usage though, or comparisons of different ways to solve a problem (eg paths, dbs).
@MattDMo personally, I've grown to mistrust everything that isn't on python.org and stackoverflow.com
Why is that?
@MattDMo I have also found their stuff quite useful as well. The way those articles are written is pretty nice. but again I don't know if they tend to update their content as much as we expect them to. They do keep adding new content. I am eventually subscribed to their PyTricks newsletter series. which sometimes is very nice. Often it gives info which I already know. So it's worth givin' it a shot surely.
14:24
@MattDMo I find the articles pretty useful if I'm starting a whole new topic. But I have linked to an article here before and I seem to remember Aran finding some shortcomings/incorrect info
Yeah, I faintly remember that. There was some bad advice mixed in, if I remember correctly
OK, so they're often at or near the top of searches for real reasons, not just SEO, but like everything, take it with a grain of salt. Good to know. Thanks, everyone!
this in one of thread tutorials I read quantstart.com/articles/… threading.Thread(target=list_append(size, i, out_list))clearly calls the function :/, so I consider real python a lot better source
Tempted to one-up Andras by saying I've grown to mistrust everything but the CPython source
It's a half-truth -- I trust the official docs, but I've been hurt in the past when it misled, omitted, or lied
14:40
@MisterMiyagi Did you have any suggestions in mind? I might be approaching this from the wrong angle, as I said. But I'm not sure anymore.
@MattDMo That goes for most sources, including the python docs, really (just because some of them are older, not so much for inaccuracy).
As a simple example, IIRC assignment expressions were in the language for about a year before they got around to updating the full grammar specification with them
Call it six months if you measure it starting from the first 3.8.0 public release rather than its alpha
@MattDMo I've seen some articles that included misleading and/or outright wrong information. For a learning/information resource, that is a big no-no for me.
@MisterMiyagi Do you remember offhand what kinds of wrong info they had?
And just this week we were puzzling over why the docs recommend not using named parameters for random.randrange, since it omitted any explanation. Had to delve into the bug tracker to find a hint for that one.
14:54
@MattDMo realpython.com/python-lambda is outright atrocious from the get go.
> Notes: You’ll see some code examples using lambda that seem to blatantly ignore Python style best practices. This is only intended to illustrate lambda calculus concepts or to highlight the capabilities of Python lambda.
like this?
boy, that's a lot of text about lambda functions
Reminds me of when I sent a flame letter to W3schools because the title of their list tutorial was "Python arrays". I believe all they did was add a little note to the bottom saying "note: in Python, arrays are called lists"
I literally mean from the get go. Even mentioning "Lambda Calculus" with regard to lambda should be a crime. The article is quite frankly full of made-up bullyam.
@Kevin ...that makes it even more confusing, wow
15:03
Really puts my complaints about random.randrange into perspective
@Kevin Ah, so it's you we have to thank for a nice little caveat they added at the top? :P
There's a big difference between "our site is imperfect because our time and energy are finite, despite our wishes" and "our site is imperfect because we already got our ad money from you, loser"
It did make me chuckle when I first saw it. "NB: We know we're using the wrong terminology but we cba doing find/replace so live with it"
To put the RP λ article into perspective: It is like writing several pages on how awesome raw strings are compared to those pesky standard strings.
Now I understand how people get stuck in tutorial hell
15:11
An unrelated tale --
management: we want the site's 'export data' button to produce something other than xml. Something excel can read natively. How about xlsx?
Me: that's a bit tricky. How about csv instead?
management: ok, fine with us.
[three months pass]
Me: Ok, I've finally gotten around to updating the exporter.
management: great! Transitioning from xml to xlsx was such a good idea. Looking forward to seeing your work in action.
What is this impending doom I'm sensing
Surely it can't be terribly difficult to convert csv to xlsx
I can't remember whether I had a very good reason to reject xlsx, or if I just didn't feel like learning the API for it
I've only ever read xlsx files, but I'm fairly sure there's a python module that can write them
Would they even notice before saving?
Just pandas it. read_csv --> write_excel.
15:16
I have a vague recollection of telling management that our data has some particular quirk that makes it hard to represent in xlsx. Something about nested tables? But it's not as if csv can nest tables easily... Hmm
But aren't you the creator of the file since it's an export from your site?
I very much doubt that csv files can do something better than xlsx files
My predecessor is the creator of the file, I'm just moving things around
15:31
He implemented a quite clever SerializableProperty decorator which means I haven't had to trawl through the guts of the data to figure out its inner workings. I just needed to bridge the csv lib to the SerializablePropertiesSerializer interface.
Just don't forget that last little x in the extension, lest you run into an embarrassing situation where records start getting cut off. Eh, what am I saying, nobody in the industry could be silly enough to do that
Which explains my vagueness about whether the data is nested or not. I haven't actually looked at every field >_>
@roganjosh Wouldn't be the first or last time that I missed a keystroke and produced subtly wrong results
I assume you heard about our little "incident" over the pond? That was no typo, that was by design
The thing about the health data spreadsheet running out of columns? Yeah
I have a bit of sympathy for whoever designed that, because they probably went with the first thing that worked, and it continued to work fabulously for the first 1,400 cases. It's hard to justify a code redesign when to all appearances it's working fine
Especially if you're not a master techie like us and know ahead of time that Excel doesn't give you an infinite number of columns
No response to my "it's in csv right now, actually" email to management. Either they're paralyzed with apoplexy, or they don't care at all.
they're preparing the paperwork required to sack you
15:46
I've anticipated this move by changing my middle name to '); DROP TABLE EMPLOYEES; --
anyone remember how to compute propagation of measurement error? If I measure x with 0 decimal places of precision to be 2 cabbages (measurement error = 0.5 cabbages), then x^2 would be 4 ± <what?>. My intuition says it's x^2 is somewhere between 1.5^2 and 2.5^2, but the internet disagrees with me... and I can't fully reconcile the difference
The "Use of Significant Figures for Simple Propagation of Uncertainty" effectively suggests that when multiplying figures, the result should have the same precision as the least precise operand
So the error would be... Still 0.5 cabbages? I can't decide if that matches my intuition
It actually was one of my favorites in Physics alongside dynamics. Sadly I don't remember most of it now.
Maybe I'm incorrectly conflating significant figures and precision.
I've decided that 4 ± 0.5 doesn't match my intuition, because it doesn't include 1.5^2 and 2.5^2. Just as you said.
@Kevin This seems somewhat similar to Kevin's uncertainty between precision & significance.
16:01
The "simple" in the title is probably pertinent here. Maybe taking the operand's precision is good for a rough approximation of precision, but it doesn't give a perfect answer in all scenarios.
is asking a homework question allowed if I have shown effort? its a reasoning question, python obviously
@python_learner Yeah
@python_learner it should be.
A "good enough" approximation is perhaps sufficient in real world applications, because you can't put hard limits on the error range anyway. You've got to slice the long tail of outliers somewhere and the choice is somewhat arbitrary
so this is the question and the 3 line snippet pastebin.com/PesXUw8C
Would "the values inside the list are being mutated, not the list itself" be a suitable answer?
I had a fair idea how this worked but this question makes me question my understanding
16:06
@PSSolanki ooh! this is interesting. Thank you
you're welcome :)
@python_learner Hmm, I think you've got it precisely backwards. The list mutates, the objects in the list don't
@python_learner shouldn't the last line be data[j] *= factor?
yeah it must be, the copy paste didnt copy *= I had to manually type that in
@MattDMo I'm assuming that's a typo as it's mentioned in code comments.
16:08
@Kevin thanks for clarifying, I knew something was off,
The Internet tells me that if your real world measurement's error resembles a normal distribution, then it's conventional to use a 95% confidence interval for your precision -- in other words, choose the first standard deviation of the distribution
16:23
On an unrelated topic, I'm having troubles installing PyAudio. It tells me to install Visual C++ 14. (I already have Visual C++ 15 I guess - I don't even understand why it's relevant to a python library).
But based on some suggested solution in this thread, I have tried everything except installing Visual Studio build tools (I don't have enough storage/internet/courage/wish to install it for no reason). I tried installing pre-compiled wheels(both from PyPi project and Here ) but no wheels available for my Py3.7. Upgrading setuptools didn't help either. Any work around ?
I guess some modules need the C compiler, I am not exactly sure but scrappy I guess also asks for the same
also I did not install the whole 4gb + option, I did a minimum install, around 1 gb
it does. But scrappy at least has binary wheels to be installed after download.
I can only guess the need of Visual C++ build tools because it makes use of some sorta '_Port Audio' thingy. I don't have faintest of idea what that is.
@python_learner the 4GB option is a complete install of VS. The build tools are around 1.5 (I didn't verify it though ). It's still a lot to download when it doesn't really serve a significant purpose. The PyAudio source itself is about some KBs :| .
16:45
@inspectorG4dget web.archive.org/web/20161213135602/http://… says that "fractional uncertainties add in quadrature". I interpret this to mean that, when multiplying two values that have error, the new error is equal to sqrt(old_error_1 ^ 2 + old_error_2 ^ 2). Since you're multiplying a value with itself, old_error_1 == old_error_2, so new_error == old_error * sqrt(2).
Hey guys
Any opinions on this question?
@Kevin that's what I found on UNC's physics error measurement guide as well. But I don't understand why "fractional uncertainties add in quadrature"
So your result would be 4 ± 0.7. This matches my intuition about what the answer should be -- it doesn't include the extreme possibilities of 4 - (0.5^2) or 4 + (0.5^2), because both of those are less than 5% likely to occur
The both got moved farther down the long tails and they don't fit in the standard deviation any more
I understand the arithmetic about how ± 0.5 and square root of sum of squares yields 0.7. But do you have any intuition as to why this quadrature is the case? Is it a "normal distribution" thing (in which case, what happens if I'm working with a uniform distribution?)?
@PSSolanki you can download ubuntu 16 or older for the same size :p, that comes with all that is needed, but yeah I used windows mostly so its a lot
16:53
@python_learner :D
@inspectorG4dget I'm pretty sure it's a normal distribution thing, yeah.
ok that makes way more sense. Thank you
I don't think uniform distributions have uncertainty, by definition
oh lol! touche. Clearly I mistranslated the problem space. Still very helpful. Many melons :)
Currently bending my brain around the question of "what if you're certain that the distribution is uniform, but you're uncertain what its boundaries are?"
17:00
@inspectorG4dget This PDF seems to address the question as to why.... with (a lot of) distribution images. the addressing is on page 25. Though I couldn't find a satisfactory explanation (or maybe I couldn't understand what they have shown there - more likely), I believe it might be worth taking a look if you can understand that stuff. I definitely can't :D.
@Kevin as an oversimplified example: I want to compute the are of <this> rectangle. I have a ruler that has no sub-centimeter measurements, so my "(rounding) error" is 0.5cm in any measurement I make. So let's say I measure 2±0.5 cm x 3±0.5 cm. Then, I'd imagine the area is in [1.5x2.5, 2.5x3.5]cm^2. But at that point, I think the definition of "error" diverges a little, because we're no longer talking about precision over multiple measurements, rather accuracy of a single measurement
(I may have used "precision" and "accuracy" imprecisely... or inaccurately. I always get those two mixed up)
Ok, good example.
@Kevin If that has anything to do with outliers, just for a fact, someone from math.stackexchange had told me that outliers usually result in quadratic penalties. Be it in errors, precisions, standard deviations and of course variance.
sprouts for the confusion in my original problem description
@PSSolanki I'm bookmarking this. It's very handy
17:07
TFW an if condition evaluates to 'False' and it doesn't skip to the else clause.
Taking a geometric approach, I would expect the error of the area measurement to be equal to the area of this green section here.
So it would be 2cm * 3.5cm + 3cm * 2.5cm - 1cm*1cm
@inspectorG4dget Oh I hope it is. I couldn't follow much in the PDF. I definitely miss my part of brain which was able to understand those a few years back :D
Or in other words, width_mean * (height_mean + height_error) + height_mean * (width_mean + width_error) - (2*width_error*2*height_error)
Which probably simplifies down to something nicer
@Kevin ok super! That lines up with my intuition. I think I was confused by improperly differentiating between precision and accuracy
@Kevin umm... 1cm * 3.5cm + 1cm * 2.5cm - 1cm*1cm, perhaps?
@PSSolanki oh friggity frack! I needed all sorts of prosthetic limbs to carry me through stats
Hi, does someone have experiences on how to manage private files in Django?
17:14
@inspectorG4dget :D I usually had troubles with distributions. Differentials and gradients were my friends (they still are upto some extent at least)
oh calculus is fun (my gf hates it every time I say that)
I'm a bit worried that I'm mixing up two possible definitions for error here, because the green area encompasses all the possible real dimensions of the rectangle, but the error of each 1d measurement only comprises half of the possible values of that dimension
@inspectorG4dget it sure is.
In other words, the x measurement, 3 cm +/- .5 cm has an error of .5, but the full range of values has a width of 1
I think my confusion goes away if I define error as twice the value of the bit appearing after +/-. So my formula would have a couple more "/2"s thrown in
Doesn't the image above takes care of it by extending the green area to both sides of the actual measure. I mean shouldn't +/- 0.5 automatically interpret to a possible error of 1.
17:20
Hmm... Maybe??? Man, reinventing math from the ground up is a lot uglier than reading proofs in a textbook
user image
5
yeah. sometimes even proving those theorems is a chaotic task. Re-inventing math from scratch is more chaotic when things get counter-intuitive.
Semi-related puzzle: find the dimensions of a rectangle that cuts the green area into halves of equal area, and has the same 2/3 height-width ratio of the black rectangle
(disclaimer: I don't know the answer to this one, or how hard/easy it is)
hmm. I'm on it. with absolutely no assurance of an answer.
(I doubt if I'd even get close to it)
I think you can do it with just algebra, although there may be some painful square roots involved
@Kevin no. the ±0.5 is measurement error, while the 1.0 is that measurement error propagated. So the error in the computed area can be different
17:30
Hmm, I see, kinda
@Kevin Yeah. I'm trying to figure out the possible combinations of height-width which satisfy the condition of a 2/3 ratio. (Python to the rescue here, and I hope there aren't too many of those). I do doubt that I'ma get nowhere with this approach as I'll just be left wandering with hella combinations.
The answer might be irrational, so it's going to be rough iterating through all of those :-p
At least the rational numbers have the decency to be countable
Well, python tells me that an exact combination is - 2.9999999999999996 1.9999999999999996 . I believe others are just lost somewhere in the sea of irrational numbers.
I mean, there certainly are other rational ones. For example, 1 and 1.5.
The answer is that the height += math.sqrt(height**2 - height) - height
17:37
That matches my intuition of "a little bit larger than the black rectangle" so I award you the bronze quatloo
I seem to have deleted function definition contained in my jupyter notebook cell. The function object is still in memory -- however unable to recover definition via undo/ipynb_checkpoints. I tried this but didn't work: Edit: stackoverflow.com/questions/1562759/…
Or, hmm, math.sqrt(height**2 - height) - height is negative, isn't it? so it's the opposite of my intuition.
For some reason, python doesn't think so. (or maybe I'm just making it do some crappy calculation which don't make sense). More interestingly--- trying 100 iterations gets me one result, where as trying 1000 or more don't get even a single one.

I'd assume I'm making a mess of python's calculation abilities.
@inspectorG4dget Ah, I think I misunderstood which height we were talking about. Now it makes more sense.
17:41
... or I messed up some basic algebra
@Kevin woohoo! Do I get to keep my quatloo?
@inspectorG4dget That, too, is always a possibility :-)
I would have let you keep the quatloo in any case. It's very heavy, so arranging for the shipping to return it to me would cost more than its resale value.
Frankly I'm just happy to get it off my lawn, it's killing my grass
well that was some interesting discussion. I'm well over my new sleep time. Take care everyone :)
I shall heat it up and sculpt it to look like your identicon. I'll polish it up and put it on the spare bar stool and pour out a drink for you
@PSSolanki catch many chr(90)s!
I've always said there should be more statues of me.
:D I will.

@Kevin Why not forge one. It might be tough but it'll be worth it. :p
17:51
🤔
^closed
wasso wasso wassup
18:27
@Werner if you want to be here and not just troll please start communicating normally
ok sorry
@inspectorG4dget I might be stupid, but where did that -3 go at step 5?
@BožoStojković hammer space
Hmm? I'm not familiar with that term
@AndrasDeak Ohhh laurel
18:58
@BožoStojković it went into the infinite void which would have otherwise contained a measureable amount of intelligence (translation: I dirp'd)
Does someone know how to add non-model fields to DRF ModelSerializer?
@inspectorG4dget Ahh ok. Thought I was missing something.
Happens to the best of us :)
19:12
:). I still don't get that answer though. I'll have to whiteboard it out later.
Laurel. I have absolutely no clue what is going on there
19:27
@roganjosh Thank you. I will try doing that
19:38
@inspectorG4dget mistakes always look better on a whiteboard
@AndrasDeak zomg! I once spent several hours trying to sort out a proof that I was oblivious to have started off with 1 + 2 = 4. It wasn't until a colleague in the lab pointed it out (way at the top/start) that I decided I needed to walk away fro some coffee before I returned to the thing
19:52
you returned to wipe it all off, I gather
yeah, catching that one error turned out to solve the whole thing
20:08
Closed
thank you sir
I think. I actually don't know your gender...
Supreme Overlord... or just him/he/sir. I'll let you off.
@GitauHarrison what I told you is not sustainable advice btw. Sometimes it makes sense to "bump" migrations but you need to focus on how your migrations got so out-of-sync with your models
Since it looks like you're just starting out, it didn't seem a particularly odious suggestion, though

« first day (3652 days earlier)      last day (1520 days later) »