« first day (3849 days earlier)      last day (1323 days later) » 
00:00 - 14:0014:00 - 00:00

00:28
Does this chatroom have a bot?
Screenshot in windows is saved in format of - 'Screenshot 2021-04-21 170625', Can anyone tell me what '170625' from it is?
@12944qwerty We have @AndrasDeak who does it(coded to do) better than a bot ;)
@CoolCloud Seems like it is just microseconds? I guess
@CoolCloud I can't find anything online lol... i'm assuming it's like an "ID" of the image
though that wouldn't really make sense 🤔
maybe ask on superuser
hm... it does seem like a counter/ID type of thing.... ghacks.net/2019/04/27/….
that's not the right format though
00:35
@SuperStormer I'm not 100% sure.... just something I found
it doesn't have to be the right format though....
makes more sense 😂
It is the time.
Okay thanks
though why would they format it without hyphens or colons doesn't make sense
because only colons would go there but colons in filenames are too much even for windows
smartphones use this convention too for photos
00:42
too much as in what?
It almost guarantees uniqueness
@12944qwerty morally unacceptable
ok then-
@12944qwerty Try renaming a file using colons or so. Cant.
oh- never tried that before lol
01:00
cbg
 
6 hours later…
06:45
cbg
07:29
Hey guys just curios heading back to the issue of reading jsonlines files that are too large and taking all the memory to work through due to duplicates... this is the solution I have come up with dpaste.com/33DFSHSK2 is there any more efficient method
instead of json.loads you can directly use json.load and pass the file object?
I may have missed previous discussions @Kwsswart but the purpose of jsonlines is exactly to avoid memory issues.
If you have duplicates throughout the file then you could either use dask and get the entirety of the data into one structure but not totally in memory, or use something like SQLite3 to keep it out of memory for the de-duplication
thats why I have stored the data into jsonlines to be able to work through it individually... essentially the prior discussion was duplicates causing the file to get too large and required filtering but being unable tow ithout loading the entire file hence the jsonlines
In which case, I'd go with SQLite
I'm not a big fan of dask and you can load it into the db in batches
the entire process is to load the data dynamically into aws athena from many different files all with the same format
 
1 hour later…
08:41
Hey is there a name for the convention that when denoting rotations the start in the circle is at the right and we measure counterclockwise?
09:25
@Hakaishin it's the convention...
let the people who ignore that convention come up with a name
great :D Well I'm sure my customer has no clue about it, so I would like to give it a name so they can google it
I don't feel like explaining it in a small UI window
Also I don't feel like making an image which would be the best solution
either "polar coordinate system" in 2d, or if there's reason for a 3d context, that angle is the azimuth
yeah kinda, we already have a graphic for different things, I would need to incorporate it, but angle in polar coordinate system convention is good enough imo
ah interesting, til
didn't know that was a thing, but seems like useful information to keep in mind
So i take it to mean angles in last quadrant would be shown as, say, 300 degress counter clockwise instead of -60 (60 clockwise) also?
@ParitoshSingh no, both are correct
09:32
If so, we've broken this convention many times in school. oops
Ah ok
only thing that matters is that the +x direction is n*360 and it grows counter-clockwise
ahh! yes, gosh that doesn't even come to mind as being under contention, it's so ingrained
Related random musings, I wonder if there's merit in trying to build some kind of repository of conventions we take for granted. Like, i must have been taught this and many other conventions along the way, but i can't for the life of me recall when exactly it happened.
actually now that i think about it, i wonder if such a resource already exists. At least for math conventions i imagine
man some clion update broke my project, super annoying
10:11
Anyone knows any libraries that listen to key events? Like even if I don't have focus to python, I would want to press some combination and then execute a function. Given that the script is running in the bg.
ugh, why is deleting password in google pw manager so annoying. It's either delete 100 pws 1 by 1 or delete all your other data aswell...
pynput, keyboard, ahk. there's a few
"google pw manager" there's your problem.
(though to be fair, i never tried deleting multiple passwords in mine either. ha)
How can we apply one hot encoding to list of dictionaries
Also I have somewhere somehow a memory leak, pretty sure. My pc locks up every 30-60minutes. Any good idea how to find the culprit?
@ParitoshSingh keyboard seems to work
10:16
convert it to something that's not a list of dictionaries
@Hakaishin valgrind
@ParitoshSingh yes, they are called math textbooks ;)
haha, touche
i did actually find a few scattered resources online, but it quickly made me realise how gigantic such a repo would become
@AndrasDeak I mean my whole computer freezes not an application
lots of conventions around symbols specifically.
10:18
weird, for some reason 2 of my cpus have constant 100% utilisation... I wonder if I caught some bitcoin malware
could be possible. explore all possibilities
Also, could be a more innocent thermal throttling too perhaps.
perhaps as an area of investigation, try to recreate the problem synthetically, say using benchmarks
Worst case scenario, there is a RAT
@Hakaishin OS?
i googled rat...
that went about as well as it could have
ubuntu 20.04
10:21
@KomalpreetSingh please don't ask for help here with fresh questions on the main site as per our rules
ok, looks like it's the gps module script which does that
@ParitoshSingh My laptop does some weird stuff, I am not even sure of. Really suspecious
@CoolCloud if you have a rat problem, get a cat.
Pro gamer move
@AndrasDeak oh sorry and thanks for guiding me to the correct group
10:23
ah yes, love me some good while true, sleep 1ms scripts
ok that was it
nice. no memory leak then
hopefully
@KomalpreetSingh I'm sorry to say that's not the correct group; that's our room where we move messages that aren't appropriate here. If you read our rules you'll see that you're welcome to ask for help if you don't get one in 48 hours.
ok ok got it
Sometimes antivirus cannot connect to the internet, which is really weird. So the installation of it fails.
10:28
if your system is already infected, you can always try installing things in safe mode
i wanna say safe mode with wifi is a thing
100% CPU should not lock up a system
of course poor programming might appear elsewhere in the same offending program
I know, I'm not sure if it was that, I will see. But it sure help to have 2 more free cpus than before
yup
But now how will you know where you are?
haha
Hmm weird my memory is already at no usage at 70%
11Gb
10:31
That's actually more common than you'd think.
At least when i first started noticing memory usage, i was very surprised how high it tends to sit. It seems like things dont necessarily get flushed out of memory if there's memory lying around
Not until you run a task that demands that memory
hmm I see
gotta keep an eye on it
@ParitoshSingh Malwarebytes detected connection to a site ~ which when searched seem malicious
i'd trust whatever MBAM says.
@ParitoshSingh They detect advanced systemcare as virus, so....
@BATMAN_2008 hi
Windows own Defender is pretty good nowadays
10:35
@CoolCloud those things dont necessarily do all that good, you know. half the things they touch dont necessarily need touching. just because they make some numbers on your screen go up don't mean they're all that important.
Especially if this tool offers registry cleanups (which i assume it does) i'd advise caution. at best they delete useless stuff. at worst something important can go poof
@ParitoshSingh You mean MBAM? or advanced system care?
advanced systemcare
Hmmmm but my windows defender has been active, if such connections were actually done to a site, wont it atleast block it?
nothing offers 100% coverage and protection, including windows defender
@Aran-Fey Accurate depiction of me trying to play any Vintage deck
In a format where games hinge on correctly identifying the action that is 0.1% better than the other ones you can make, you can be dang sure I'll take my time casting Serum Visions
10:45
All of crypto, assume a secure public key infrastructure, then we can do super fancy stuff. Well failed at step 0
wow, my memory usage goes to 99% when building. So that might be it. It shouldn't crash the system, but well here we are. Time to download some more ram
@ParitoshSingh that should appear under a different category
$ free -m
              total        used        free      shared  buff/cache   available
Mem:          15890       10917         539        1631        4432        3030
Swap:         17165         418       16747
so the "free" and "available" are different
oh im assuming windows i should mention. we get a gui :P
maybe there's a cmd way to get this info as well
but the gui is only showing me, like currently im sitting at apparently 7.8gb out of 8
@ParitoshSingh I figured. It should still appear under a different category :P
agreed :D
there is a resource monitor that shows more indepth information, so it might have it there...
ah but that requires admin to open, so never mind.
stackoverflow.com/questions/9097067/… says wmic can tell you some interesting things without a gui
10:58
Can anyone take a look @ Write image to Windows clipboard in python with PIL and win32clipboard?. BMP uses 14 byte, what about PNG? Any idea?
Or do we have to keep converting to BMP always?
Oh the below answer sums it up. 8 it seems, but cant use it for some reason said there
I think the second answer is saying "you can't use an offset of 8 even if you know that's the header size of a png"
Yes? So we cannot save it as a PNG. I guess
I'm not too acquainted with the limitations of the clipboard interface. I usually use PIL.ImageGrab, which Just Works for most of my purposes
But it does not have a feature to save to the clipboard right?
No, it only reads from it. Only half of a solution for some problems, I admit.
"So we cannot save [bitmap data converted to a PIL Image] as a PNG" -- I don't see why not, I'd expect the_image.save("output.png") to work OK
11:09
Hmmm that should. I asked the wrong question I suppose
If you're dead-set on sending a png's unaltered data through the clipboard, I wonder if there's a mode for abritrary bytes... There's like twelve modes so it's possible. It won't interface nicely with any application looking for image data in the clipboard, though, for example MS Paint.
It works after all
👍
@Kevin I see
I was trying to mimic windows snip tool
So far so good
I think copying to clipboard directly is not a good idea. Give them two shortcuts? One for saving the image and one for copying the image.
As a user, I appreciate when an application makes it obvious ahead of time that an action I could take will overwrite my clipboard.
A button that says "copy to clipboard" for example is highly obvious and therefore good
I wag my finger at apps and websites that have seemingly ordinary text boxes that happily chirp "copied to clipboard!" only after I click on them
11:16
So you would not like to press a button called take screenshot and have it copied to clipboard AND give you an option to save, right?
Right, "take screenshot" by itself isn't descriptive enough for my tastes
Cool, I thought.
Logically I was thinking of making it run like a background app, but it seems stupid as it would take up space and al?
Would appreciate if anyone could trial run this -> Windows only
Ctrl + shift + z for save mode and Ctrl + shift + x for copy mode
I don't see much appeal in a background app snipping tool, but then again I don't use snipping tools to begin with. I just use print screen and crop the result in Paint
@Kevin Snipping could save much of the time right?
For users whose only image manipulation programs take 60 seconds to load, absolutely yes. For users with quick access to MS Paint, but who don't have a decade of muscle memory for typical operations, maybe. For me... It's a tough sell :-)
11:25
Kinda :p
for sure shit+printscreen select area is faster, I just wish windows had the same, because currently my workflow is the same as yours and I hate it
Have you tried Win+shift+S?
my two cents, if you don't want the image to show up in a clipboard, but only display it, and give an option to save it, i'd be happy with that as a tool too..especially if i haven't been exposed to windows snip tool beforehand
Also remember that alt-printscreen copies only the active window. In many cases that's exactly the crop I require
For kevin..Snip tool is awesome :D
It allows you to draw arbitrary rectangles on screen and it immediately gets them on clipboard, and also gives the option to save it
So for cases where you need the cropping in paint, you could have been done on the snipping tool itself
11:34
I hear only nice things about it, so I have provisionally tagged my own dislike of it as "personal brain problem???". One of my more commonly used tags.
For cases such as full screenshots or screenshot of the active window, your shortcuts will be better as usual though
Try the shortcut I mentioned, with windows there is option to choose window, rectangle cropping and free form cropping and full screen too. Only on Win10 ig
My potato laptop is also a grandpa laptop, still on Windows 7 :-)
Why though?
well, windows 7 was hands down an excellent OS for sure
(ps. never try windows 8, for your own sanity)
11:37
70% sentimentality, 30% not wanting to spend ~2 hours migrating my stuff
@ParitoshSingh True that
@Kevin Hmmmmm over the past 6+ years, you could've updated once atleast?
I mean the features are worth a shot
eh. i see the appeal. frankly i was an unwilling win 10 user.
I was hyped for Win10, given that I was < 13 maybe 12 years old :p
for starters, i liked my command prompt. i detest how hard it is to find things in the new ones. good thing they only sporadically try forcing me to nagivate the new one, instead of what windows 8 tried doing
@ParitoshSingh What I'm hearing is "instead of using one executable that can crop and save a screenshot, try using this other tool that can crop and save a screenshot". From my point of view, the workflow is identical, so I may as well continue using the tool I already have installed.
11:39
@Kevin yep, i think you're right. i had misassumed you already had snipping tool on your system
snipping tools comes shipped into win 10. i never would have even considered using it otherwise
If I had it installed I would just move the goalpost and say "... Using the tool I already have pinned on my taskbar" :-P
I don't have anything against Windows 10. My work laptop is Windows 10, and it's fine. But again, it's a hard sell to get me to change my tech stack for a result that's mostly the same
Okay how about a very niche use case that i suppose you can't get from paint easily
but because it's so niche, it probably wont ever be an issue
Anyways, here goes: scenarios where you need your mouse to hover or be somewhere specific to get a window to show up, but you don't want the mouse to actually show up in the screenshot itself
11:43
I can think of a hundred things that I can't get from paint easily, but I won't tell what they are and make your job easier ;-)
haha, i wont mind a little help :P
but yeah, that's one area snipping tool can handle
@ParitoshSingh Well, print screen doesn't capture the mouse cursor, so that's the default behavior. But flip around the use case -- what if I do want the cursor to show up in the screenshot? Can't do that with Paint.
oh i didnt even know print screen doesn't capture the mouse
It might be a config option somewhere...
Yea it doesnt.
11:46
yeah, i wont mind a little help at all :P
i think honestly print screen + paint will get you very far. if youre used to it, might as well
as a sidenote, this is making me explore freeform snips, which, i must admit, look very handy in very specific scenarios
On occasion I have needed the cursor to be visible. Usually when I'm guiding somebody through a process and want them to know what I'm clicking on.
alas, i thought the USP of snipping tool was to hide the cursor. i was mistaken
so if theres a way to keep the cursor shown in snipping tool, i dont know of it
ah caches my arch nemesis strikes again. Looks like what the update broke could be fixed by invalidating the caches and reindexing
11:54
@gig Your question is just 30 mins old, please wait for others to notice it. Posts < 48 hours are not allowed to be posted here(asking for help). Read the room rules please sopython.com/chatroom
gig
gig
@CoolCloud ok sorry plz help me out if anyone have some time
@ParitoshSingh It looks like it's not something that Windows' screen capturing API natively supports. stackoverflow.com/questions/1628919/… Describes a way to do it, which is effectively "take the screenshot, then paste in an image of a mouse cursor"
I'm surprised, I figured the cursor would have a HWND or device context or something that you could blit from directly
@Peshal1067 Maybe later. We like to discourage solicitation of new questions in here, because people on the main site might still be looking at it and preparing a solution
Read our chat rules ~ sopython.com/chatroom @Peshal1067 :D
12:10
@CoolCloud I certify this as "works on my machine"
Does it? Windows 7 right? Oh what about the clipboard?
Pastes the result into Paint just fine
Windows 7 yes
@Kevin Nice, thanks for testing it out
12:32
woooow, worst way to write not: if (foo + 1) % 2:
that's actually a clever way to check for numerical types
can you elaborate?
foo = [] # would work with not foo
a clear, obvious error is a lot more helpful
then I'd rather have assert type(foo) == int and then if not foo:
no, that's too many characters
I'm not actually serious, that line is atrocious
12:35
Yeah after the that's too many characters I got that you were messing with me. Yes this is terrible
What I don't understand is that it would even be bad in C...
if foo is guaranteed to be either zero or one, I agree that it's a silly approach. If foo can be, say, 8, and you want that to satisfy the conditional, then I don't advise replacing it with not foo
does that maybe make sense in java?
@Hakaishin foo == 0 should be available in most languages
Looks more like an even/odd test
12:36
but as Kevin says if this it not an implementation of not then it's a different matter
I'm working with the premise that you're right, which can't be compared to your premise that the person who wrote the code was wrong.
yeah it's not you are right. But the +1 throws me off, I'd rather do an even odd check like normal and then add a not instead of a plus +1
I'd do if foo % 2 == 1: if I wanted to test for odds
Agreed
we're back from "atrocious" to "quirky and suboptimal"
12:38
Hakaishin gets bumped down a notch on the reliabie source grade
Perhaps it makes sense in Javascript.
it should be foo % 2 == 0,
My life goal. Get as many starred messages here as Kevin :)
I also prefer foo % 2 == 0 rather than not foo % 2, and foo % 2 == 1 rather than foo % 2, because I don't like implicit bool conversions in my arithmetic, even if they're provably correct
Second goal, write messages without errors on the first try :P
(I'm ambivalent about how either approach treats non-integers, which are not real to me)
12:41
@Kevin yes, it's just more readable
@Hakaishin Our battle will be legendary
... what this line is just something else next condition is and -x < 0... like he forgot there is >
morning cabbages, folks
Impressive levels of "just go with the first thing that works" there
@Hakaishin no, it's a clever way to make use of __lt__ instead of switching to __gt__
12:43
also that line is copy pasted around multiple times...
@AndrasDeak sure ;)
who knows how many of these is implemented for ints
Assuming those are ints...
I really want the senior engineer position here. There will be a stern discussion at the end of the year
Maybe he's using the lexicographically smallest valid approach.
>>> "-x < 0" < "x > 0"
True
anyone here get vaccinated in USA/west_coast yet? I'd love to hear your experience for... a work thing
Is it OK if we move this discussion to the meta room? Nothing wrong with it, but I also don't want to stress anyone who doesn't want to see it
12:48
Fine with me
I'd leave the original query here so people can see there's a question
can you link it? Didn't know there was a python meta room
12 messages moved to MetaPython
@Hakaishin it's primarily for room administration meta things, but this seems like an appropriate middle ground
Please see the inspector's question and see the meta room for data collection and discussion
13:11
cbg
Howdy
Kevin, for your spoiler button, it touches the existing buttons instead of having a margin, just letting yk
"you know". There.
Andras is a big fan of complete words :-)
or a BFOCW if you will
13:16
it's only valid in lowercase
that took me so long to longen? (whats the word)
elongificatify
I'll fix the margins in the next version release (date TBD)
Imma fix it rq rn shrug
frick need to enable snippets
Just wait until chat is redesigned, making the problem go away
13:19
ooh, it's getting redesigned?
Just wait is my favorite solution strategy :)
I'm not very patient long-term
The joke is that they will never redesign it
@12944qwerty I'm not terribly surprised
Patience is for humans that can't make computers solve their problems in 0.01 ms
13:24
I'm only really patient when I'm programming or reading something (unless I've been stuck on the problem for a really long time)
That is helpful in case of novels
I think it's mainly because time flies
🤷‍♂️
conditions should be is_foo_bar_xyz(object) and I can add a not to it if I want. Negative conditions make my brain hurt :P
Yeah I avoid nots where possible, although sometimes it's a tough tradeoff
def a():
    if not cond(): #oh no, a not in my conditional :-(
        do_important_main_case()
    else:
        do_obscure_corner_case()

def b():
    if cond():
        do_obscure_corner_case()
    else:
        do_important_main_case() #oh no, the most essential logic isn't prominently at the top :-(
especially avoid them in identifiers... if not negation_of_expected:
13:31
I've got a couple if not unreticulated: lines sprinkled throughout my projects
which one do you tend to go for in that case you're showing?
I've been there quite often it feels, never sure what option is best
Usually A, but the more complicated cond is, the more likely I am to go for B
Good thing Python 3.10 will safe you from this!
"Put important code at the top" isn't even, like, a widely accepted best practice, so I don't think you need to fret over it too much.
I do anyway because fretting is one of my favorite hobbies
what's happening in 3.10 :O I thought that they were still developing 3.9.*
13:34
def c():
    unless cond():
        do_important_main_case()
    else:
        do_obscure_corner_case()
def c():
    main_case = not cond()
    if main_case:
        do_important_main_case()
    else:
        do_obscure_corner_case()
huh, that might be a pretty decent option
unless.... cool
although darned it will force me to come up with another variable name
@12944qwerty I don't know what 3.9's status is, but the team can work on multiple versions in parallel
13:35
i'll go read about it later
Bob focuses on pattern matching for 3.9, while Steve implements unless for 3.10, that kind of thing
Wait, unless is a thing? You're joking, right?
miyagi is referring to match case statements (also known as pattern matching, or PatMa)
(disclaimer: unless is a joke and there may not be contributors named Bob nor Steve)
13:36
oh
😂
the sad thing is that I wouldn't put it past python's current design directions
@Kevin I was on the docs earlier and it said they were developing 3.9 still... must've read wrong since it doesn't say that anymore
We already have C and java so might as well add perl.
@Kevin Not in PERL
The docs change from time to time, so maybe you read it correctly at the last moment
13:37
die unless hope_to_live;
@MisterMiyagi perl itself is a wonderful joke that also happens to be turing complete. I say this with 100% affection.
don't give me a heart attack like that with unless :D
Ooh nice
13:39
@Kevin No worries, I have enough seething rage against PERL for the three of us.
I'll leave you to it then :-)
better syntax error messages are awesome 🥳
and they're giving suggestions on what you might've meant for Name/AttrErrors
like an IDE :O
SyntaxError: exception group must be parenthesized -- seems a bit silly to raise an error here instead of just... Accepting the syntax and quietly putting parens around it.
Maybe they did that originally because it would be hard to parse, but if they can detect this specific syntax now, well...
they might compile wrong by accident though
I thought that the fancy-shmancy new parser could do anything
13:43
switch statements o.o
(in a way)
switch on steroids
lots and lots of steroids. The entire medicine cabinet even.
I like the error message change. seems like a very common stumbling block for beginners.
didn't see that coming
wait.... so as and := both do the same thing....
@Kevin IIRC it's a leftover from Py2, where except a, b: meant except a as b:
do they? as doesn't really exist on it's own.
13:48
as basically just renames a variable
:= does the same except it creates a variable from any object
Exercise: try writing code that uses as, then rewrite it to use :=, and see how compatible they are
@12944qwerty in most casesas does more than just name binding. E.g. with (a := b): and with b as a: assign a different value to a.
hm
:O
don't have to use typing.Union now o.o
and two more typing.* came
oh i forgot you could do var: int = 0
On second thought, I think the inverse exercise is more interesting: take code that uses := and try to make it use as instead. As a pointlessly silly example, try it on print(sum(x for y in range(100) if (x:=y%5) > 2))
that won't work
with as I mean
13:54
Yes I agree
wait
x=(y%5)
or
(x=y)%5
Hmm I don't actually know what the precedence is. My intention was x:=(y%5), but I didn't verify
wait
then it might work with as
lemme check rq
The output looks x:=(y%5)ish to me
13:58
Yep (x:=y)%5 gives a much larger result
it's (x:=y)%5
oh nvm
kek
00:00 - 14:0014:00 - 00:00

« first day (3849 days earlier)      last day (1323 days later) »