« first day (4147 days earlier)      last day (802 days later) » 

user16328828
1:28 AM
Python is awesome!
 
user17921218
3:36 AM
Hello. Two days ago I posted a question without receiving an answer. In the comments they gave me that the code is poorly written and should be rewritten from scratch. The question concerns the printing of a result from the textbox of an external window to the textobox of an internal window. Can anyone help me please? Thank you
 
user17921218
0
Q: Print the result obtained from an external window but without opening the window (the selected checkboxes are automatically saved in the database)

Dragomir CroI have an external window (windows_option.py) that correctly prints a result in the textbox after hitting the Print external button. No problem here. Everything is OK! Considering that the external window stores the selected checkboxes in the database (with 0 o 1), I would like to be able to prin...

 
7:01 AM
@DragomirCro I would give the same advice, to rethink your project flow
 
7:48 AM
@DragomirCro It's difficult to give questions like this an answer that doesn't seem discouraging: in effect it seems like you expect the deficiencies of a badly organised program to be simply correctable. It's great that you are attempting to stretch your abilities, but you may have gone beyond the point where you can understand the answers to the questions you ask.
from tkinter import *
from tkinter import ttk
import tkinter as tk
import tkinter.font as tkFont
from tkinter import ttk
The above, in particular, makes it clear your grasp of Python is rudimentary. Nothing wrong with that, we all have to start somewhere, but I would suggest that lowering your level of ambition for the moment will in the long term get you faster, and more reliable, results.
 
 
3 hours later…
10:47 AM
Why is it that when I set out to work on project A, most of my progress is made on project B instead?
 
Oh wow, it's already been 3 weeks since then? I'm slow
 
I've got things I meant to do months ago. Many of them.
 
Same. But I have been working on this for 3 weeks
 
11:35 AM
recbg
 
11:51 AM
Sometimes it seems to me the older I get the more I fall to do. Yet things get done somehow. It's a mystery.
And cabbage.
 
cbg. i think that's called wisdom :P I wouldn't know, i dont have any.
 
 
1 hour later…
1:05 PM
Does someone use Github Actions for tests and allow failures for specific Python versions?
I'm trying to define actions for a Cython build and it (expectedly) fails with PyPy, but I'd like to keep it to see when things are fixed.
And, well, so far I've completely failed to have a sensible notion of "thus is allowed to fail".
 
1:35 PM
@MisterMiyagi can't you skip it for offending python versions?
 
last time I checked github didn't support something as simple as a nice yellow "this action failed but it won't crash your other builds", so I made do with something like this (assuming you configured pypy runs via strategy: matrix: python: ["cpython", "pypy"])
- name: test_pypy
  if: matrix.python == 'pypy3'
  run: pytest || echo "pypy still not working"
- name: test_cpython
  if: matrix.python == 'cpython'
  run: pytest
(no, there is also no else)
 
Ooooh, that looks pleasantly simple!
 
Yaml looks dreadful
 
1:50 PM
Aw man, I (gracefully) failed one of the interview stages for a mid-level position and now my applications for internships and junior positions get rejected as well
Interview cooldowns should be tied to the job level and department IMO
 
CEO internships? :P Sorry to hear that...
 
Haha no, regular software engineering internships, just for a different programming language
 
Would an internship be reasonable for you?
 
@AndrasDeak and I already chose the imo readable style here. it could be so much worse..
 
They should definitely distinguish based on rejection reason. If they didn't find you senior enough they should totally let you try for lower levels.
 
2:02 PM
I quit my mid++ Python job of two years, as I've been meaning to switch to low-level C or C++, or just do more important/interesting things in my life. I interviewed for a mid-level C++ position, but I guess I overestimated my C++ skills, so now I'm open to very junior jobs with up to 60% smaller compensation than I had, as long as the job is interesting
 
I see. Would that be realistic with an internship?
Or just worth a shot
 
I'm not entirely sure, but I hope I won't stay an intern for long
 
Yeah, I guess
 
Just thought I'd give nuitka a try. The program print("Hello, world") results in a 563-line C program that runs. Think this one might be worth tracking, does anyone know much about it?
 
2:18 PM
I've read up on it a bit, was quite impressed, then didn't find a usecase for it. :/
 
Our workload isn't CPU-intensive enough to justify using it - most of what we do is form-filling and record-keeping, so we don't really need CPU speed, tbf.
 
Hm, I've just thrown it at my async library and it made the unittests 10% faster.
That's actually pretty neat, considering I've tinkered with Cython for weeks now and didn't get that much...
 
 
1 hour later…
3:50 PM
could someone help me with finding a click-worthy title for my question? stackoverflow.com/questions/71223637/…
yesterday i learned that windows and Linux together scare away people.
i found preciously little on wayland and pynput, too. so that might be just as scary.
@NordineLotfi and you got to run, on linux, even. i wonder why it worked for you.
 
4:33 PM
I got a new job. Everyone, thank you for your advice and support.
27
Especially if the support was like "hey, I have some thoughts/advice I want to share, hit me up" and then I did not hit you up. You were one of the 30 spinning plates that I couldn't keep track of, and I thank you for your sacrifice
 
@Kevin Congrats! :)
 
I'll do my best! [I immediately trip and fall into a canyon like from Road Runner cartoons]
I emerge from the me-shaped crater at the bottom and say "eh, it's a living"
 
5:00 PM
@Kevin woot!
 
I look forward to having health care again. I just know my dental hygenist is going to use the extra stabby tools for my next cleaning, since I canceled the one in January.
 
What a backward land you live in
 
5:16 PM
Yeah, but it's where I keep all my stuff, so I'll stay
 
 
1 hour later…
6:37 PM
Whoa, that's massive code.
 
@DragomirCro is that the same question you posted in this very room a few hours ago?
 
nope maybe
turns out we have two users posting questions for review
@DragomirCro you got feedback the last time you posted that question here, please start from here.
 
user17921218
Yes. Sorry. The other question I posted at an inconvenient time. If you can delete it (the one a few hours ago) please so as to avoid repetition of questions. Thank you
 
user17921218
I see written "removed". Can you confirm that you have deleted my link that I posted a few hours ago? Thank you
 
user17921218
Unfortunately, there is a time difference between the United States and Europe and I published the application link at a time that is inconvenient for many. This is why I wanted to publish it again now, but by first eliminating the question a few hours ago, in order to respect the chat rules to not publish repeated and identical things. Thank you
 
6:48 PM
Dear users in the US: please see chat.stackoverflow.com/transcript/message/54054617#54054617 and discussion thereafter.
 
7:06 PM
@DragomirCro have you taken the official Python tutorial at docs.python.org/3/tutorial ?
 
7:39 PM
Does anyone know a module that can help me convert arbitrary objects to arbitrary types? For example, convert(range(3), set[str]) -> {'0', '1', '2'}
 
user17921218
@WayneWerner Yes
 
Nobody saw that. I know how range works, I swear
 
user17921218
If someone reads this message of mine, can you go up in chat and help me with a question posted a few hours ago please? Thank you :)
 
there's nobody here but us cabbages
@Aran-Fey seems somewhat ill-posed, I'm not even sure if the specification generalises very well
 
@Aran-Fey you mean something besides set(str(x) for x in range(3))?
 
7:49 PM
and grabbing str from set[str].__args__
 
def convert(stuff, t1, t2):
    return t1(t2(thing) for thing in stuff)

convert(range(3), set, str)
I mean, that'd work I'm pretty sure, despite being gross.
 
I imagine the general case is more like set[tuple[int, int, int]]
 
it's hard to say how much more of whatever it would need to be.
 
I just hope the real use case doesn't involve runtime being affected by typing :P
 
@DragomirCro I'm surprised because your code is in rough shape.
I know I've written some unfortunate code in the past, but it looks like you're missing some fundamentals about how to even structure your code
It's not that different from speaking entirely different languages that use the same words for entirely different forms of speech
 
8:02 PM
@Aran-Fey I don't think "arbitrary" is possible. But you could roll your own for some types and objects using singledispatch and whatever-is-the-way-to-get-type-args-on-your-preferred-version-today.
 
there are definitely some horrifying things you could do with ast.parse if you were committed.
or maybe should be committed?
 
nice
 
It doesn't necessarily have to work with any and all inputs, I just don't want to write the whole thing myself
 
user17921218
@WayneWerner I know, you're right, but that doesn't mean I don't need help. If you want to help me, I have also set a bounty on the question.

And anyway my code works fine in the external window. I select the checkboxes and print the result. The problem is only in displaying the result in the main window. Basically the reason is that I initially created a single window where you can select the checkboxes and print them, so the code was created this way. Next I thought about making it a secondary window and displaying its result in the main window.
 
8:17 PM
@DragomirCro The point of everyone who's given you feedback wasn't "you don't need help", it was "the help you need isn't an answer to that question of yours on Stack Overflow".
 
@WayneWerner That's far too specific; it only works with iterables. My inputs could be set[str] or int or Union[str, int] or Literal['foo', 'bar'] or...
 
"works fine" is a generous description
 
@Aran-Fey how does a Literal['foo', 'bar'] converter work?
How does a Union[str, int] converter work for that matter?
 
^^same
 
I thought I was weird for not understanding the expected behaviour
 
8:19 PM
@AndrasDeak Ha, good question. I guess it'd throw an error.
 
user17921218
@AndrasDeak I know, because the best thing would be to study more. But being new to Python I still have limitations and I would like to fix the problem in the question. Seeing the solution code would also serve me for educational purposes
 
Union[str, int] is easy; flip a coin, if it lands on heads you convert to str, if tails you convert to int
 
@DragomirCro sure, and I hope you'll find what you're looking for
@Aran-Fey ah yes
 
No but seriously, it doesn't matter. Either make it a str or an int.
 
sure thing :D
 
user17921218
8:21 PM
@AndrasDeak Thanks :) I set a BOUNTY on the question. I am hoping for someone to help me (and then of course I will continue to study Python to improve aid)
 
@DragomirCro an imperfect analogy would be that you're asking how to build a sports car when you're struggling being able to build a birdhouse
 
Isn't every analogy imperfect?
 
It's good to stretch yourself
but there's a difference between stretching and flailing
looking at your code I literally have no clue where to start
That's why I asked if you had gone through the Python tutorial
(I really meant if you had gone through and understood everything in the tutorial)
 
user17921218
@AndrasDeak Funny hahaha, but let's not overdo it because it would be a little offensive. I can get what I want by selecting the checkboxes and printing the result correctly. Everything is OK! The problem is just seeing the result in another window. Don't overdo the analogy please
 
Wrong ping?
 
8:26 PM
because I really can't tell at which point your understanding diverged from foundations that everyone else here has
@AndrasDeak probably ;)
 
FWIW, I don't think the python tutorial would help much. I've only had a quick glance at the question, but it looked like the problem is the program architecture. That's not something the python tutorial teaches you
 
That's true... but I also don't think it discusses defining classes within functions which is legal but...
 
user17921218
As I said before: The reason is that initially I had created a single window where you can select the checkboxes and print them, so the code was built in this way. Later I thought about making it a secondary window and displaying its result in the main window.
 
Side note: if you are new to programming and start on a challenging project, it's normal to make huge mistakes. But at one point it's plausible that you have too much technical debt and you have to rebuild from scratch, wiser.
Not necessary, but I'm not surprised if you end up designing yourself into a corner.
(General "you")
 
user17921218
@AndrasDeak It is not a question of not knowing programming. You are misunderstanding. I know that the architecture of my code is written incorrectly, because I had originally designed the project to be a single window. In fact, I currently print the result correctly with the secondary window. Later I thought about using the window as a secondary window, but by now the code architecture was already written
 
user17921218
8:38 PM
So since I was just starting out with Python, I tried to "force" the architecture a little bit knowing that it wasn't very correct.
 
user17921218
@AndrasDeak If you don't want to help me, don't help me, but it is useless for you to take the time to say that I don't know programming. If you are familiar with programming I don't think you post more questions on StackOverflow. People post question precisely why they need help and not being told they don't know programming
 
I must have misunderstood something you wrote, sorry
 
Let me get this straight: Andras posted some advice aimed at someone who's new to programming, and you re-interpreted "new to programming" to mean "bad at programming", and then you complained about this even though Andras never said that, and you've also completely ignored the advice he gave?
 
@Kevin No need to thank me, I was dimly aware you'd said you were looking and 100% confident of your ability to find a position. Congratulations!
 
@Aran-Fey nah, the issue seems to be that Dragomir is new to Python, not programming. And then the advice was completely ignored.
 
8:53 PM
Oh, ok, my bad then.
 
You all appear to be trying to convey the same message I was. I don't think we're getting through.
 
Stoppable force meets immovable object
 
9:12 PM
heh
 
9:43 PM
Scratch that
 
I don't see anything inherently wrong with nested functions, especially for thin wrappers.
apropos of nothing
 
Thanks
 
Whenever I do curve fitting or similar optimisation I usually have a function that could be a lambda, but I also want to reuse it after optimisation to plot the raw data along with the fitted curve. In these cases I always just define a proper (nested) function right before I need it.
 
For reference, this is the code I was asking about (deleted because I messed up the arguments):
async def outer():
    with tqdm(...) as tracker:
        async def _wrapper(argument):
            await coro(argument)
            tracker.update(argument)

        await asyncio.gather(*(_wrapper(i) for i in range(10)))
I use this pattern quite frequently in my project, but the recent discussion got me worried about how it could be perceived by others. Good to know it's not strictly frowned upon :)
 
If I said "I use nested functions all the time", would that make you feel better or worse?
 
9:56 PM
I would first ask "how often do you find yourself writing nested functions that are 10+ lines long?"
:P
 
@vaultah I mean I'm not even a real dev but glad I could help :D
 
Maybe... 50% of the time?
 
Then that makes me feel understood
 
In good weird company
 
I clung on to that simulation I'd built that took 20 hours to run for yet another week, then threw the towel in today, ripped all the pandas stuff out of the solver loop and got each iteration down from ~60 secs to ~0.5 secs by just using dicts. I really wish I wasn't so stubborn sometimes :/
At least I won't be tempted by all the complex joins I keep stumbling across when wandering github for solvers. It just looks fancy but, my word, the overhead...
 
10:19 PM
Have you tried polars? I'm curious how it compares to pandas
 
I haven't, but it's definitely on my radar, especially since I've been dabbling in Rust and I've got quite a bit more proficient at at least reading it recently
So, scanning the code base, so much of the cruft in pandas is gone (in polars) and I feel like I could get on top of exactly what's going on. In this instance, I just thought I'd try my hand at trying with this join-based solution approach I keep seeing others use, on the off-chance it was exploiting nogil in Cython or something. But it's just a bloated mess (unless I did things terribly wrong)
To be fair to the pandas approach I was trying, I could probably have cut quite a lot of overhead out by using np.searchsorted for indexing in some places, but then it was so much more bookkeeping on top that I was just painting myself into a corner
 
@roganjosh me too!
 
Things would be boring otherwise!
I tried my hand at multiprocessing with shared memory (why the hell not? Ok, don't answer that) and found some strangeness there. Like this answer using mparr = mp.Array(ctypes.c_double, df.values.reshape(-1)) and then just converting types back. Not only does that silently drop np.nan but I can't convince myself that there's not all sorts of hidden problems in just blanket ctypes.c_double
I'll see if I can segfault that at some point, but curiosity shall have to wait
 

« first day (4147 days earlier)      last day (802 days later) »