« first day (4003 days earlier)      last day (935 days later) » 

5:12 AM
"Quora+ is a subscription to the best of Quora."
 
I have a very not important question
why does print ('something') work?
space between function name and parentheses doesn't make any error
 
5:41 AM
that space is simply ignored. this isnt limited to functions btw, python ignores space in the line with a lot of things. operators, dot accessors and so on.
`42.0 . is_integer()` is valid python for example.
if you ever write code like that it's going to frustrate a lot of people, including yourself though :P
 
cabbage
 
6:10 AM
Making less errors is good I think
 
user16278360
How to get particular data from fast API via reactjs GET request
 
6:31 AM
@PIngu best of abysmal is still bad right?
 
7:29 AM
they are apparently hiding 'some' answers behind a paywall
and displaying a notice "Unlock this answer and browse ad‑free by joining Quora+".
but it defeats the purpose because "on the floor" answers are coming in.
 
8:11 AM
q-a sites business models are very much difficult indeed to fabricate.
 
 
2 hours later…
10:04 AM
Hello, how can I check the trues and falses for a list matching a value? [4, 3] == 4 gives False.
 
What result would you have expected/wanted instead?
 
[True, False]
 
then you're actually comparing each value inside the list one by one (think loops). you can write a list comprehension for that if you want.
your_list = [4 , 3]
value_to_match = 4
result = [item == value_to_match for item in your_list]
 
10:21 AM
Thank you
 
 
1 hour later…
11:21 AM
Haven't seen a question worth answering in weeks
 
12:05 PM
Relatable
But do not weep for SO, because their mission all along* was to answer every good question once. They must be succeeding, if good questions are rarer than before.
(*subject to interpretation)
 
So you're saying it's a feature not a bug ;)
 
1:08 PM
All according to plan
 
Jun 25 '20 at 15:29, by Kevin
I'm more of a This Is Fine Dog kind of guy
 
1:24 PM
Jun 21 '19 at 17:26, by Kevin
Accept the fact that we're all living in a broken system and come cavort in the ruins with me
 
Yes, my Lord!
 
There are no hierarchies in the post-apocalypse, so strictly speaking I'm nobody's lord. But this also means you can call anybody "my Lord" if you feel like it. No rules, just right
 
Right-o.
Also, I apologise for messing up a WC3 quote D:
 
1:42 PM
hello all happy coding
 
I'm quite happy today because my neighbor cut down his very ugly tree
I'd like to say that I'm an enlightened thinker and can see the beauty in all things, but ya'll this was one ugly tree
 
it must have been very ugly, because that word rarely applies to trees, they are mostly pretty
 
There must be some ugly trees, or else there would be no ugly sticks
 
2:32 PM
is there a way to diff .whl files in version control? or at least know that it was modified.
 
@pyeR_biz checksum for the second question
 
aahhh...all those times I've been ignoring that checksum part of documentation. Wow -- that would mean I can put some automated rules around this. Thanks!
 
If a file isn't human-readable, I think carefully about whether it belongs in version control
If the wheel is available on pypi, then you should probably just put its name in your requirements.txt
 
2:56 PM
What do you think how many characters we see each day? 10million?
 
There's about 1.5k characters on my screen right now, and let's say I see ten pages of chat a day, so that's 15k right there. And if I'm hunting through a lot of source files to find a bug in my project, then that's like ten times as much data as chat. Still a couple orders of magnitude short of 10 million though.
Probably my highest rate of characters per second is when I grep for something and it outputs a ton as data as quickly as stdout will allow
 
@pyeR_biz Why do you have wheels in VCS in the first place?
 
3:16 PM
I have a similar problem at my workplace. We have a folder full of .dll files that are necessary for the project to run. They're not available on .NET's pypi equivalent, and some of them are no longer made available to the public by the authors. So it would be impossible to set up a makefile that says "go download X library from Y source".
Googling around for best practices, I see a couple opinions. Some say "see if your build tool has a repository that specializes in binary files". Some say "set up a secure server that knows how to respond to npm/nuget/pypi requests". Some say "those are both a pain in the butt. Check them into source control and be done with it"
On the bright side, abandonware dlls aren't too expensive to store in source control, because their contents will almost never change. No need to worry about your repo's file size getting super bloated with a million inefficient diffs
 
3:32 PM
@MisterMiyagi I don't want it in vcs (its not), I should have just said - to be able to track whl files are modified locally. I should have said CI/CD (I am trying to build ci/cd in my project). I have around 40 packages in this repo, I don't want to wheel up all packages every time I have to repackage 3-4 packages locally.
I might need to think about my problem more. If I change the source code of 1-2 packages, I want automation CI to only wheel up those files, and I want to write a shell script that does something similar locally, automatically.
 
Sounds like you need a makefile.
but if the wheels are not in version control then I don't see how CI/CD (which usually lives on someone else's computer) can install your stuff without building said wheels
 
when I am testing locally, I make wheel files and test them in a pipeline setup. Once I have all the wheels deployed locally, I can do something to only build wheels for changed packages.
 
Locally, a makefile should suffice. Make tools know out of the box to only run what has changed dependencies.
(unless the target is phony)
 
3:57 PM
These make files are really custom right? There no guideline as such. It's about the project and project only.
 
I'm still not quite following what you are trying to optimise here. If you want to compare whether the wheels changed, you still have to build them first.
 
@MisterMiyagi I think they just want a simple way to say "now build everything except what hasn't changed since last build"
@pyeR_biz yes, they are only constrained by the capabilities of the make tool you are targetting (GNU make, cmake etc.)
you can set up things like an "all" (phony) target that depends on all of your wheel files, and all of your wheel files depend on their respective source files, so if you say make all then it will check all wheel files, and if there's one has unchanged dependencies since its creation, it won't rebuild it
but I admit what you're asking is not entirely clear (but it scores high enough on my crystal ball that I venture a guess)
 
Some may find this mildly amusing. From LessWrong, a recent short conversation with a GPT-3 based Elon Musk chatbot talking about the Simulation Hypothesis
 
4:13 PM
Plot twist: We're all part of a bad attempt at an MRE.
"Does your universe actually need those squishy bits over there to run?" "I don't know, they were already part of the code base when I started here."
 
One of the pitfalls for AIs running simulations: The Simulation Epiphany Problem
 
@AndrasDeak yes that's it.
 
 
3 hours later…
7:30 PM
>>> import re
>>> t = re.compile(r"[ \t]*")
>>> f = re.compile(r"\s*")
>>> t == f
False

What is difference b/w these two regular expressions?
 
Do you understand what they each mean?
 
I am not really sure. I am looking for some help in understanding how they differ.
 
Do you know regex?
 
Look up what \s means and that should tell you everything you need to know
 
also, both of those patterns will literally match anything, but only because they are useless
First try to understand how they differ if you replace the asterisks with +, and once you understand that, try to understand why the original two patterns match anything
 
7:34 PM
They don't match anything, that's not true. Yes, you'll get a result back no matter what string you use them on, but that's not the same thing as matching the string
 
fair enough
I was looking for an example that's matched by one and not the other, and that primed my thought process
 
"Yes, you'll get a result back no matter what string you use them on, but that's not the same thing as matching the string" <regex-anxiety intensifies>
 
@roganjosh he just means that the "match" refers to the result that fits the regex. Non-empty matches might differ between the two.
What I was saying is that there's no string s such that t.match(s) ^ f.match(s) is truthy. What Aran's saying is that there's a string s such that t.match(s) != f.match(s).
 
Ahh ok, that's more sane than what I was imagining :)
 
Or, maybe not. What he was saying is that there's a string s such that t.match(s).group() != s and likewise for f.
Either way the conclusion is that my phrasing was sloppy.
 
7:49 PM
@AndrasDeak Yes, that's what I meant. What it essentially boils down to is that when we say "this regex matches this string", we usually mean the whole string. But re.match will return a result as long as the regex matches at the start of the string.
For example, you wouldn't say that the regex fo+ matches the string "foobar", but:
>>> re.match('fo+', 'foobar')
<re.Match object; span=(0, 3), match='foo'>
 
I suspect that is more useful for me than Andras, but that does actually make this seem more tractable as an outsider, so thank you for that
 
8:09 PM
So I have a set of strings whose order changes if I enable or disable pdb
AMA
 
like a set set?
 
basically I have a series of labels that I extract which are unique, then I write them to text
so Set[str]
now if I have import pdb; pdb.set_trace() the order of list(my_set) changes
 
pdb probably disables set/dict hash randomization for the sake of reproducability
 
sets shouldnt be relied on for order, makes sense.
 
Yeah I now but it was of a category of fairly annoying bugs
Honestly not sure why they decide to randomize the set
for example in languages like C++ the set order won't change unless you change the underlying data structure (which is compile time anyways)
thing is that they fixed this madness for dict in python 3.7
but not for set
womp womp womp
womp
 
8:16 PM
dicts and sets are internally a lot more different than you think
and it wasnt "fixed" for dicts, it was actually a side effect of changing the dict implementation, not the actual aim to make them ordered.
as for why sets are unordered, i presume it's something to do with performance probably, but i dont know to be honest. (ie making sets ordered would come at a performance hit for it's most common use case - memebership tests)
 
@Mikhail so that breaks a contract, right? Is it something to rely on when other parts of the program can edit the set ordering?
 
8:35 PM
Basically the madness is that python set orders can change at runtime depending on if you have pdb enabled or not. So if you're generating data with python you are liable to get different things if you're entering pdb...
I'm "okay" with getting an unknown order but not that happy when the same program under the same program version yields something different...
 
the only time where that affects you is if you've already committed a sin - relying on order from a structure that you shouldn't rely on. At the same time, during debugging i suppose there's an expectation that things shouldn't change just because you're debugging... im not quite sure how i feel about this overall.
 
@Mikhail as far as I know it's a consequence of randomising hash, which is a safety feature to help prevent hash collision attacks or something like that
@Mikhail you should be. Being a C(++?) programmer as well you should know that UB means all bets are off :P
 
yeah so I don't suck and I don't get UB
bah humbug
 
What I meant is that "set order is random" implies that you should not expect "the same program uner the same program version" to yield something consistent.
I understand how this might hinder debugging, but that doesn't imply that the feature itself is inherently wrong. There are upsides and downsides to most things.
 
8:50 PM
Yeah and what I ment to say is that implies that you should not expect "the same program uner the same program version" to yield something consistent. is absolutely nutts. So in two places list(foo) and list(foo) give ya different things. Do we really want to live in this world :-)
 
In a given interpreter instance list(foo) will always give you the same thing.
 
nope, not if its between a import pdb; pdb.set_trace()...
 
"between" how?
 
list(foo);import pdb;pdb.set_trace();list(foo)
where foo is a Set[str]
 
OK, that's not how I understood your premise. I agree that is confusing.
Now I wonder if we can change PYTHONHASHSEED on the fly
(I suspect "not without black magic")
 
9:08 PM
I wrote an answer about this: stackoverflow.com/a/51578541/4014959
The upshot of all this is that you can have two sets containing identical strings but when you convert them to lists they can compare unequal. Or they may not. ;) Here's some code that demonstrates this.
OTOH, converting the same set to a list twice (with no intervening insertions or deletions) should give you 2 identical lists.
 
@Kevin never knew how much I missed Kevin and his infinite wisdom until now
 
@PM2Ring "The upshot of all this is that you can have two sets containing identical strings but when you convert them to lists they can compare unequal." Why is that an upshot, sorry?
Ignore me. Colloquially, I think I've come to understand "upshot" as a positive outcome, but apparently that's not the meaning of the word
 
9:31 PM
Up and down are always confusing down under...
 
WOAH, they unpinned accepted answers from the top of the pile!
 
Apparently I don't understand my own language. That's baggage I've been carrying around :(
Then again, "upshot" often comes in phrases that you can nod and smile at, or congratulate someone for. I got away with it for 33 years
 
you are forgiven
 
1530s, from up (adj.) + shot (n.); originally, the final shot in an archery match, hence the figurative sense of "result, issue, conclusion" (c. 1600).
 
9:37 PM
woa, that's kinda ancient :)
 
9:49 PM
In two hundred years people won't know why the penny drops. (Who am I kidding; I bet most kids don't know today.)
 
10:00 PM
🪙⬇️
That's part of my side project on making transcripts intelligible to future generations.
 
👏
 
10:14 PM
by making them intelligible you mean a dictionary?
when does the OED become public domain?
 
10:31 PM
There is no dictionary. You can see exactly what I was trying to say, right? All my emotion can be bundled into 2 images; it's super efficient!
They apparently did re-write Shakespeare in txt spk, but I can't find a good reference. "2 b or not 2 b" crap. Now I wonder whether that was a media storm
 
11:03 PM
@roganjosh I remember this too
 

« first day (4003 days earlier)      last day (935 days later) »