« first day (3950 days earlier)      last day (1014 days later) » 

 
1 hour later…
6:57 AM
Has anyone here installed gmpy2 on windows?
pip installing returns error Cannot open include file: 'mpir.h': No such file or directory
I don't know where I'm supposed to place the mpir.h file, it's already in path, does it search somewhere else for include files?
 
Disclaimer: IANAWU
 
Hmm, still getting the same error
tbf the maintainer of gmpy2 did say it would be tricky to make it work on Windows, it's just troubling that it can't even find the file
oh nevermind, I forgot to close and re-open terminal, gotta love windows, now I'm getting the juicy namespace errors
thanks for the help
 
 
1 hour later…
8:13 AM
Can pythons "compiler" optimize this var a out? Leading to shortcuirciting and thus never calling the check function if x is already true after the first iteration?
for i in range(2):
	x = False
	a = check_stuff_and_set_a_value_in_db(i)
	x |= a
also cbg :D
 
No.
It would also not be correct. x |= a might have a side-effect.
 
@MisterMiyagi so it only shortcircuits if it can tell that it doesn't have sideffects?
 
Only the logical operators short-circuit. Any operator that can be overloaded never does.
 
Good to know thanks :)
hmmm kinda worrying that it can shortcircuit things with sideeffects. replacing that with x = x or a doesn't call the function. I think I will leave the extra var in, just in case this shortcircuit behaviour changes at one point
 
8:52 AM
I just did a Python quiz on LinkedIn to see how difficult it would be, 70% of the questions were about OOP
 
9:15 AM
@Hakaishin other way around. what's worrying is that you consider putting things with sideeffects in what "should have been" simple boolean operations. This isn't on python, you should absolutely invoke the code beforehand if you need it to always run.
 
9:31 AM
FWIW, CPython is absolutely pedantic about honouring side-effects. If there is even the remotest chance of side-effects, it's not removed. In practice that means only literals ever get removed.
And all the other implementations (*cough* PyPy *cough*) are pedantic about not noticeably deviating from that. So don't worry.
 
10:23 AM
cbg guys
can anyone tell me how this works?
class MyClass:...

print([id(MyClass()) for _ in range(5)])
print([[o := (MyClass()), print(id(o))][0] for _ in range(5)])
I purposely made it that way, why does the first list comp give the same id, for all 5, but the second one does not
 
Implementation details
 
huh, is there any use to this behavior?
 
In both cases the previous MyClass instance is already garbage collected before the next one is created, so both of them could print the same id 5 times
 
wait
 
10:26 AM
that's an ass expr, won't o hold a reference
 
@ParitoshSingh correct. Once again I just work here excuse :D
 
yeah, I misunderstood that mess
 
yes o is in global scope, also ouch, I said I purposely made it that way :D
 
so yeah, as Aran said, in the first case, the memory is being reclaimed
in the second, it's not, because o holds a reference.
and workings of the GC rarely impact your actual code or design choices, so yeah this is strictly in the realm of implementation details
@Hakaishin haha, that works. :D
 
print([id(o := (MyClass())) for _ in range(5)]), this gives 3 same id's so I guess this is in line what what Aran mentioned earlier
 
10:30 AM
yep. the refcounts (of older objects) are going to 0 because o is being rebound to new objects
 
thanks guys
 
to be fair, if im not mistaken, this isnt even GC doing it
would love to be corrected if wrong, but i think if refcounts go to zero python simply reclaims the memory without having to invoke gc
 
cabbage
 
i dont know much about refcounts and gc, but I would have assumed gc and refcounts worked hand in hand
so "refcounts go to zero python simply reclaims the memory" this to me would seem like the work of gc
 
in CPython, the GC is only for cyclic references, so "refcount goes to zero" is technically not the GC.
 
10:36 AM
hand in hand, yes. but gc actually has the responsibility of figuring out reference cycles
 
how do you guys even know all this :D
 
citogenesis
 
my true python moment would be asking a question here and not getting an answer ;)
I could also do that with no MCVE's but thats the easy way
 
No problem. Just ask a sufficiently boring question.
 
What is the question to life, universe and everything, given the answer is 42.......oh, uh, in python.
 
10:42 AM
I guess a good chunk of questions I have asked here has no real world significance but at least they werent boring I presume
 
@ParitoshSingh What's the product of the primes smaller than 10, excluding 5?
 
the mice won't like that question, im afraid.
 
2*3*7 right? or is this some PhD level math that I dont seem to find?
:D tbh 9 was in my list too, just had to check
 
you saw nothing :D
 
These are not the comments you were looking for. *waves hand*
 
10:47 AM
ohh wait, 2*3*7 is 42
god I feel dumb
 
this reminds me I'm throwing away all my books while moving again. I wonder if people in the future will even have physical copies of books. I loved my dads library, but I hate moving my books and I'm never reading them again, so I'm giving them away or trashing them. Kinda sad to think that I won't have books, but not sad enough to actually keep em :P
 
@ParitoshSingh I've got two fluffy murderbeasts that are available for negotiations. :P
 
@Hakaishin I think I'll buy some physical books when I move in, feels better to me than a 300+ pages PDF
 
Ah, in that case.. :P
 
@AlexandreMarcq new ones or some you have already read?
 
10:54 AM
To me, nothing can replace the joy of a proper physical book in my hands.
So i don't think physical copies will ever truly go away
 
@Hakaishin New one, about IT stuff
 
yeah new I get, but once you read a book I never felt the urge to reread it. Ofc if it's technical it can serve as a reference but otherwise they just take up space and I have to move them every now and then :D
 
Some O'Reilly's for example
 
besides the exceptional one or two books I read twice
 
oh yeah, there's absolutely no denying that digital books are a lot more convenient for storage and even when travelling for example
 
11:46 AM
Well, I've been pretty unhappy to realise the box with my PTerry books is gone. :P
The pages just had the right amount of grease and dog-ears...
 
@MisterMiyagi ufff, dogears are my nightmare.
 
@MisterMiyagi :(
Say what you will, it's jut not the same to swat a wasp with a kindle.
 
A shelf full of kindles does not look as good
 
Depends on the amount of grease and dogears...
 
12:34 PM
cbg
 
Books won't go away entirely, much in the same way horse-drawn carriages and renaissance-era glassblowing techniques haven't gone away entirely
 
I can only extrapolate from pottery, but I guess glassblowing is more fun than making books...
 
1:20 PM
Oh I'm not afraid that books go out of fashion completely. I'm more sad that I can only have pareto optimality instead of complete optimality in my life.
 
Sounds like one too many economy books in your life
 
1:35 PM
Simply become a utility monster, so that it becomes pareto optimal to force everybody to use paper books even though they like digital books slightly more
Your desire for paper books is one googolplex larger than any one person's desire for digital books, so it would be silly to satisfy a mere seven(ish) billion normal people and dissatisfy you
 
one smbc comic too much. I would really like to meet the writer of them, I'm not sure why, but I somehow imagine him quite depressed
 
And of course your various servants (which you have because your desire to have them is very great) will take care of moving the books from one house to the other, and so forth
 
@Kevin getting closer :)
 
smbc can get quite cynical, and its early entries can be downright angry and mean, so I can't imagine the author as a ray of sunshine. On the other hand, making a webcomic for over a decade requires a degree of discipline that isn't compatible with the "typical" symptoms of depression, e.g. lack of motivation
 
good point, it's more like functional depression, like functional alcoholism. Which is a mind boggling illness to me. First time I put these two ideas next to each other, I wonder if functional depression is a thing in psychology
a quick search tells me there is no exact such thing, but something in that direction
 
1:50 PM
Based on zero information, I'm guessing there's no DSM entry for Functional Depression, but perhaps "being functional despite depression" may be a target that psychologists (et al) aim for with their patients
 
The DSM-5 (the newest version of the manual clinicians use to see if patients meet the criteria for a specific mental illnesses) includes a condition called persistent depressive disorder. Newly added as I understand
Is it weird to talk about your feelings to strangers on the internet?
 
I sprinkle it into my messages from time to time
 
I had a bad weekend. Objectively everything was awesome(did sports, met a good old friend), but the low of a recent break up is starting to hit me, more and more on the weekends now. I stopped over occupying myself and now the loneliness is getting to me, even if I meet people and do things.
Also the place were I meditate daily has closed for 2 weeks because of holidays which is also getting to me. I'm really happy it opens up again tomorrow
 
Hmm, relatable
 
2:08 PM
I'm told many people are feeling lonelier thanks to These Unprecedented Times. Usually when I'm told this, the speaker quickly goes on to say "not to trivialize your own experiences or anything!". Perhaps I'm subconsciously giving them a death glare and this prompts them to try another approach
 
:D that must be it. I would hate to hear that, since it has nothing to do with covid
There is the breakup, but then there is also the fact that I work less than most friends and thus got an additional day in the week where I don't have many people to hang out with. Plus this horrendous weather is at least 30% responsible for my mood. Switzerland didn't have a single sunny week since August 2020
 
Yeah, it's cold comfort when I hear "you'll feel better once this all blows over!" because I was having trouble pre-pandemic too
 
on unrelated news the newest two kernel updates break my system. It's just a black screen and a frozen mouse. I'm pretty sure it's because I'm using nvidia drivers instead of nouveau, but nouveau got a bug with 4screens so I had to switch, now many ros applications don't work anymore because of having an old kernel. This is so annoying
 
I think I will partially blame the ambiguity of language here because "you'll feel better" can mean either "you'll completely recover to normal health" or "you will become less ill". The former is almost certainly false, the latter is fairly plausible.
 
Good observation
 
2:24 PM
I've experienced an annoying update myself -- firefox now flickers black rectangles all over the screen whenever I have youtube playing in an inactive tab. It only happens on my Windows 7 dinosaur, so I imagine the problem isn't at the top of mozilla's critical fix list
 
2:45 PM
I also have that problem, but I don't think it's related to youtube O.o
 
why would you still be on 7? they gave everyone a free update to 10
 
Must have gotten lost in the mail.
 
laurel, if you are working with legacy apps I guess that would make sense
unless you have win 7 in your home laptop
 
It's possible that I was once prompted to update, and I noticed that it required a download that would take up 125% of my remaining available drive space, so I declined. Possibly thinking "I'll get around to this once I clean some crud out of my file system". I'm still getting around to it.
 
windows 7 was splendid, so there was also no real need to update
 
2:52 PM
one year back most games were still getting unofficial fan patches to make it run on win 7
 
error messages with uncopiable text are the worst, how is this still a thing in 2021
I can't switch to open source x.org nouveau drivers because I have an old kernel, I can't use the newer kernel because I have nvidia drivers, nice loop I've gotten here...
google ai frame challenges question, why learn how to do x if you could do y...
 
Bad UX will continue to be a thing long after best practices have been decided upon, because most developers don't know what the best practices are.
That includes me -- I recently tried doing a little research into mobile-friendly web design, and came away with little more than "test the page on your phone to make sure it looks OK"
 
You probably already know this, Kevin, but you can select different mobile resolutions in the F12 panel of Chrome (at least. I imagine Firefox will allow it too). I've found them to be accurate when I've then tested on the actual phone model
I can vouch for it on Bootstrap 4, I've not tried other responsive frameworks
 
Let's see. Yep, Firefox has a "responsive design mode" with adjustable resolution.
Not too surprising that chat doesn't have flawless responsive design, given its track record
 
It works in Chrome: imgur.com/hcXrWCA
 
3:07 PM
That reminds me, "test with more than one browser" is another common nugget of wisdom
 
It doesn't look like chat uses bootstrap, but I'm not sure quite what they use
 
"it works on my browser"
 
So just take the ten resolutions you've been testing, and multiply those across five browsers. You don't mind a thirty minute task becoming a two and a half hour one, I'm sure
 
With the factory dashboard, I just made IT go round and install Chrome on all the ancient PCs
It was easier than getting it to work on IE (it was ultra-depressing the first time I viewed it on a factory PC. Way worse than the screenshot you've shared)
 
@roganjosh That's super nifty, didn't know about that feature. I always dragged the whole window to a smaller size :D It aint pretty but it kinda works
 
3:14 PM
I vaguely recall seeing a testing framework that could automatically verify some visual properties of one's web page, such as "main content and sidebar don't overlap". But nobody replied to my glib comment with "just use {tool_name}, duh", so I'm guessing it's not a beloved industry standard
 
@Hakaishin I still use that too because I still find the bootstrap grid system confusing to remember. It's important to know at what point a row of cards will become stacked, for example, and whether that matches your expectation. You won't get that by loading a fixed resolution in one go - rather you can do it by slowly narrowing the browser
 
@Kevin to be fair, it's all chromium now, except firefox that's still trying to hold on
so i imagine most browsers now render just about exactly as chrome would
under normal circumstances, one default standard should be celebrated. with browsers, considering this is google we are talking about, this development terrifies me.
 
Don't forget about Edge. It's just biding its time
One day Edge will be a star
 
edge's chromium too
 
Oh lol. Guess I can't go cap-in-hand to Microsoft to get my commission
 
3:19 PM
hehe, afraid not
 
@ParitoshSingh I wonder if you read the same article I did: theregister.com/2021/08/05/google_chrome_iframe
 
oh, i haven't read that one yet. let's see..
 
TLDR: Google (partially?) disabled alert() in Chrome, and a lot of developers were angry
 
According to Wiki: "Microsoft stopped releasing security patches for Edge Legacy from March 9, 2021, and released a security update on April 13, 2021, which replaced Edge Legacy with Chromium-based Edge." so it's relatively recent. I feel less- bad about not knowing that now
 
> The product owners at Chrome are smart, but they're careless and constantly break the web because they don't seem to have enough of a sense of gravitas or caution about what they're doing
 
3:23 PM
@roganjosh oh, yes. in the grand scheme of things this is a very recent development
"This is peak Chrome; what seems to be a reasonably good idea that's hampered because it was pushed out thoughtlessly without putting any serious effort into notifying the people affected" this nailed it. This is a good idea actually
but yeah, the quotes sound like horror stories for those devs
 
Normally I'd joke that we should abandon HTML and migrate to IRC, but freenode had a big civil war a couple weeks back concerning an alleged hostile takeover by corporate interests, so it seems nothing is safe
 
3:41 PM
At least in that case the unhappy developers were able to go off and found a new IRC network. It's not so easy to go off and found a new Internet.
 
3:51 PM
laughs in firefox
Ok, somehow my driver problems all fixed themselves by rebooting many times. Computers are magic
 
I'm pleased that firefox is stubbornly doing its own thing, even if the user experience has a bunch of flickering black rectangles. Thanks to barriers to entry, it's easier for Firefox to keep being Firefox than for some up-and-comer to become the new Firefox
 
they are lagging behind in some areas, but overall it's still an amazing browser
 
Merely existing is probably good for the internet ecosystem, being an actually good browser is just a nice bonus
 
actually, lately it seems like firefox might be onto something truly revolutionary
 
I read the theory that Firefox is only allowed to exist by google so that anti monopoly laws don't break up chrome
 
3:56 PM
im almost willing to bet they're going to replace a big chunk of the browser stack with rust within the next 2 years. Im actually willing to bet on it
 
But not too revolutionary, since we can't even remove alert() from chrome without a chorus of screams
 
oh yeah, mostly behind the scenes work
their latest changes in reducing input lag make for a fun read for example
 
assimp is the funniest name of a library I have come accross
 
I went looking for list_ass_split in CPython recently but was unable to locate it. I don't know whether I was misusing github search, though
 
Law proposal: if two companies have a duopoly on a market, and the bigger one tells the smaller one "I allow you to exist", then you can go ahead and apply anti-monopoly laws to the big one.
 
3:59 PM
Maybe the assimp magically concealed it
 
is list_ass_split a real thing in the codebase?
 
It certainly was at one point, even if it's not in the latest release
 
oh, haha
 
xD
 
4:17 PM
@roganjosh Perhaps list_ass_slice
 
Ah, you're correct!
 
Times like these I'm glad I have a local copy of the CPython source, so I don't have to deal with page load times and a persnickety search engine that doesn't understand regex
 
 
1 hour later…
5:47 PM
if I am using docs.python.org/3/library/… this and the callback is changing a global variable, can I assume there wont be any race conditions?
"Added callables are called in the order that they were added and are always called in a thread belonging to the process that added them." so the last callback will change the global variable as last right?
 
@Kevin firefox (mozilla) seems to be going the way of the stack exchange, though
 
I mean, the last change done to the global variable will be from the last future that executes this callback right
 
Doesn't sound like that's guaranteed. There might be multiple threads executing the callback at the same time, no?
 
ok that makes sense now that you say it
context, need to do threaded requests get calls inside a while loop, the condition for this while loop depends on the api results
saw this stackoverflow.com/questions/41274394/… but that while loop condition is not what I want
 
6:08 PM
so the task is inherently sequential isnt it? if i understand correctly
 
so think of the api as a google search page, where you have page results 1 - 10
 
oh
go on.
 
1 page can give you 10 results, I need all results in any order, so 10 page * 10 results per page = 100 data
but sometimes some results would have lets say 5 pages, in which case my api response would have a "total_page" key which would only be 5, so I stop at 5 pages, makes sense?
 
sure. but that seems trivial to me. the threads should be formed "after" the total pages has been determined, no?
 
ok, so the condition I am looking for to stop is basically a None for a key, which I will only recieve after x amount of pages
 
6:12 PM
do you keep loading the next 10 pages from a lot of paginated results, and trying to catch the end?
 
do you not know the exact number of results up front?
 
yes, I keep loading to catch the end
and no I dont know the number of results I can get, if I knew that I could just use a for loop I guess
some guy wrote this in a single thread and it takes two hours to run
 
Don't you wait for a page to end before loading the next page? Does a thread get 1 page or 1 result?
 
so in the current single thread, once he gets a response, which has a list of data we need, this is the "result", then this has a key which I should pass with the next request to get new lists, this is the "page"
if this key is None the while loop breaks, that is now it is now
 
OK, but I'm asking about your future design that you're asking about
If you have 10 threads, are there working on 1 list item on the same page, or each thread gets a full page each?
 
6:17 PM
each thread gets a full page
 
Sounds like your problem is mostly in the latter case, when you want to spawn 10 threads for 10 new pages when there are only 2 pages left
 
I need someway to signify to my ThreadPool that I dont have to spawn any more threads and stop
 
Can the main thread peek at the page results when it spawns a new thread? Then you can delay the creation of each thread a bit, and only keep spawning if there are results on page n + 1
I.e. spawn threads one by one rather than in batches
Does this make sense? I don't do threads nor web...
 
yeah, that is why I wanted to use a callback which mutates a global variable, but like Aran said many callbacks can be running at the same time
what you said makes sense
 
Is list.append thread-safe? Perhaps if you keep a flag from each thread you can check if all are OK
 
6:21 PM
ok I will check on the thread safety of that method, thanks
I wonder if I should use explicit locks for this
 
I'm sure there are also dedicated tools making interthread communication easier
 
that didnt even occur to me, threading libraries
thanks for the suggestions guys, I will sleep on this and see how it turns out tomorrow
rbrb
 
rbrb
 
 
1 hour later…
7:28 PM
@python_user 2 hours?
FWIW I'd probably paginate my own requests. Is this really calling a Google service?
 

« first day (3950 days earlier)      last day (1014 days later) »