« first day (4069 days earlier)      last day (862 days later) » 

12:00 AM
Hi guys, please anyone help me with python in selenium? I can't to click button i'm not a robot on google captcha
 
Probably because selenium is a robot
 
@Aran-Fey thanks for your help...
 
12:24 AM
@skizo You're asking us to circumvent something specifically designed to stop what you're trying to do. Don't expect help
 
@roganjosh OK then... sorry for my question
 
 
2 hours later…
2:02 AM
Interesting bit of code: pd.read_csv(eval(f"'Data/{b}'"))...
 
 
4 hours later…
5:55 AM
@roganjosh lol sorry, didnt mean it that way
@roganjosh i guess think of dask like a freight ship, while pandas is like a race car. if you take a freight ship to a drag race, youre going to have a bad time.
 
 
2 hours later…
8:01 AM
@JonClements wait, what does the eval does here? I mean even if it's using f string it shouldn't need eval for it as far as I know (unless {b} is a function maybe?)
 
It's stripping away one pair of parentheses. :P
 
hmm, At this point I'm unsure if this is a joke or not, especially knowing stuff people do in golfing
It's funny, I just discovered that time.time can be replaced to 0 in most function for the Xlib module (and i don't think this is documented either)
doesn't seem to have any side effect as far as I can see
ah, nvm...seems like it's because Xlib.X.CurrentTime return 0 for whatever arcane reason ^^' guess this is why...
 
 
1 hour later…
9:25 AM
cbg
I just found a file named sqlobject.py and it imports from sqlobject, I'm surprised that even works
 
9:42 AM
PSA: Don't be DenverCoder9. Say how you fixed the yamming problem.
 
I want to send people the pep8 song :D I think I will the next time I find a try: except: pass
but the 80 char limit seems crazy. I wonder how often that is an issue, sure mobile. But then again mobile is the wrong tool to code and look at code
 
Remember, 10% above the speed char limit is fine.
 
I use a 120 limit
 
IMO the char limit is less about things fitting on your screen and more about things fitting in your brain.
 
Makes sense, but I like to be more verbose then the average coder(because of suffering to have to look trough a bunch of nvidia research(even worse xD) code), thus 120 is probably similar density as 80
 
9:53 AM
Cbg all
 
cbg
 
10:09 AM
Lol pycharms code inspection is weird, it gives me different results depending on if I uncomment an if False: block. Like it's if False, don't consider this for code analysis. I understand that one wants to analyze the block inside it, but the info in that false block leaks out
 
10:26 AM
could you elaborate? what kind of info is leaking out and how?
 
I can't reproduce in a small code example, but in the real code I can, but the gist is this:
class Foo:
    def stop(self):
        print("STOP")


class Bar:
    def stop(self):
        print("STOP")


class Wow:
    def __init__(self, foo_b=True):
        self.x = {}
        self.y = {}
        self.foo_b = foo_b

    def foo(self):
        if self.foo_b:
            self.x["hi"] = Foo()
        else:
            self.x["hi"] = Bar()
        self.y = self.x
        for foo in self.y.values():
            foo.stop()

    def bar(self):
        for foo in self.y.values():
            foo.stop()
Now pycharm warns me about an unresolved reference stop. Even tough all instances of foos have the stop method. Funnily enough if I add if False: self.y = Foo() in the method where the foo is later used it somehow recognizes it that stop exists. I can't explain right now in more detail, gotta get pizza :D Also it's not that interesting :P
 
10:46 AM
PyCharm is quick to infer the Any type when it doesn't get your code. That if False: self.y = Foo() might just be enough to make it give up.
 
11:33 AM
Nono the if part makes it get it, without it it doesn't get it. But anyways, it's an not so interesting oddity of pycharms code analysis
Nice, warnings are slowly showing actual bugs, feels good that cleaning up all this mess is not for nothing
When is a method definitely part of the public interface? Is that the case if it is documented, like _replace: docs.python.org/3/library/… I thought functions starting with _ are private, but that does not always seem to be the case and that brings us back to "the python stdlib is quite unpythonic"
 
11:56 AM
I would say if _private names are generally not documented in a project, then those that count as public.
There are some libraries that just document everything because reasons...
 
hmm the newest linux kernel seems to not be that stable, the second time time in a few days it crashed my whole pc. Everything freezes up except the mouse this time, last time not even the mouse was movable. So weird that this is still a thing in 2021
 
12:13 PM
Wow, I finally managed to get Gstreamer off the ground on Windows. Time to pre-emptively un-denvercoder some problems
 
12:29 PM
@Hakaishin yeah, I mentioned a while ago here that Pycharm is broken in many instances. Glad I'm not the only one to notice this :)
(that's also why I end up hopping text editors/IDE)
@Aran-Fey I recall Gstreamer is a pain to setup on linux correctly with full support for most codecs too
even on something like Gentoo you'd have to compile in some custom patches because certain codecs don't work together by default there
 
Dunno. I use Gnome, so it's usually set up and ready to go
 
yeah, I meant if you want every possible codecs :) (eg: like ffmpeg does, etc)
 
Hi everyone
 
@Hakaishin that's always a thing when it comes to bleeding edge release (or lastest without further testing)
Hi
 
@NordineLotfi I'm on 20.04, so I wouldn't call it bleeding edge
 
12:34 PM
@Hakaishin I meant for the kernel not the distro :P
 
@NordineLotfi Also it's still the best out there imo, even tough it has potential for improvement
 
yeah, I mean it's widely spreads that new == better. But then again, that depend on your wants/needs too
 
I guess and hope I don't have a dev/beta kernel, but a stable one. I didn't download a new one manually, so it should be ubuntus default one
AttributeError: 'Exception' object has no attribute 'strerror'
Also was this strerror an attribute on exceptions at some point? Maybe python2? I can't find it in the docs and also not in the patch notes that they removed it
 
@Hakaishin found a reference to it there
 
but what happened to it in python3? Is it gone?
 
12:39 PM
Not sure, looking around for other reference
 
reduced to atoms
 
Ah it's a specific attribute of OSError, I see
and another bug prevented :)
 
1:09 PM
Hi everyone, I am running into a MemoryError if I try to read data from multiple parquet files(from a s3 bucket) and concat into a single pandas dataframe. We are trying to pull the data at a daily level but it seems there is a file each day which is the biggest in size and is causing this. What according to you would be the best way to achieve this objective?
The biggest size of the file in parquet is around 20 MB (because of compression) but after getting converted into a pandas dataframe, the memory usage shots up drastically.
 
Do you actually need to concat them all into a single dataframe, or can you work on a stream or chunks instead?
 
@MisterMiyagi We need to have a combined data for each day. So the s3 bucket is divided by days and for each of these days we have around 25 more prefixes(folders basically) representing the files that I talked about above
 
Is it possible that a file exists shown by glob.glob("*.txt")) but when I try to open it is somehow not ready and throws a FileNotFoundError?
 
It could be deleted between discovering and opening it.
 
1:24 PM
Yeah, but that happens only every 3s and there is no other code between the glob and the open. Well it only happens at boot, after deleting all the files, so maybe at the beginning the generator burst creates files and the timing is such that it glob finds the file just before it being deleted
 
1:37 PM
Today I'm in the unusual situation that a bug in my code can cause me physical harm. It's interesting, because it raises the question how much you trust yourself. All I'm doing is writing a volume slider, but my brain is torn between keeping my earphones in as a show of confidence (risking permanent deafness in case something goes wrong), and holding them as far away from my ears as I can like some kind of loser.
Which means that today, maybe for the first time in history, confidence can be measured in centimeters.
 
@Aran-Fey the nice thing about most real world situations are that there is no penalty for not trusting yourself :P Just hold them far away and get closer over time I guess :D
 
@Aran-Fey phrasing!
 
Get your mind out of the gutter :P
 
but it's a very deep gutter with really steep walls...
 
You can probably measure the depth in centimetres...
 
1:42 PM
hehe
 
Update: It turns out my confidence must be measured in decimeters.
 
now the sasquatch can sneak up on you for 3 days until you get your hearing back
 
Now you have a sonic gun against those pesky sasquatsches!
 
Das Quatsch
oh, it's even meaningful, nice
(give or take misgendering)
 
Wow, volume sliders are crazy. Slider all the way at the top = 1.0 volume multiplier. Slider at 90% = 0.5 volume multiplier. Slider at 50% = 0.06 volume multiplier.
 
1:50 PM
logarithm?
 
Confidence can be measured in decibels as well!
 
@AndrasDeak To the power of 4!
 
...do you mean 24?
 
No, in this case the exclamation mark only indicates my excitement
^4 is apparently called "quartic". Who knew?
 
I just sorta knew that.
we call them "<nth>-order" so I always have to think hard when I talk about these in English
 
1:57 PM
@Aran-Fey on windows, there a way to go over 100% with the stock volume slider, but sadly don't remember how (I think it's handled by whatever sounds driver that is used)
technically you can do it even if your hardware doesn't support it (eg: like you can do so on audacity, etc)
 
@NordineLotfi that's the most non sequiturest message this week
 
@AndrasDeak I don't understand; is what I'm saying false to you or?
I don't mind either way
 
no, it's just multiply irrelevant in context, from what I can tell
 
@AndrasDeak it isn't though..if you look at the message I linked what I said to, it talk about the same thing, albeit, in a slightly different context
 
2:13 PM
Hmm, some random dude who made a knowledgeable-looking website (it has graphs and everything) about volume controls recommends a quartic or even quintic formula. Meanwhile, GStreamer recommends a cubic one. Who do I trust? Decisions, decisions.
 
Are you trying to figure out how one works, or how you should implement your own?
 
Trying to decide how to implement my own. Of course, I could just try both and pick whichever I like more. But that's unprofessional. A study with a sample size of 1? Laughable
 
I was going to recommend whichever more closely resembles an exponential (due to decibels), but you want 0 to give you 0 and that won't work with an exponential.
 
@Hakaishin Can't let such a minor thing as marriage get in the way of science!
 
2:20 PM
Here's a blog with some interesting takes on volume sliders.
 
@Aran-Fey I forgot about the rest of the panel, I just remembered it because of the last panel with the graph and you saying it has graphs and everything :D
 
2:35 PM
does anyone know how the thing is called where you see squares with In: ... and Out: ...
 
ipython
 
thanks
 
I'm a bit surprised. I expected at least 3 people to swoop in and say "actually, X has this feature too"
 
well jupyter notebooks have that too :P
 
2:51 PM
There we go, that's better
 
@AndrasDeak I wanted to say they are the same no, but then I found a blog about the big split, interesting read
 
Yeah, they started as ipython notebooks which is why I don't really consider them to be distinct.
 
@Hakaishin Is that just notebooks supporting multiple kernels, or is there something more?
 
"notebooks" doesn't distinguish the two
 
jupyter
but I don't like the whole concept due to git merge hell with notebooks and the need for special tools to use them with git
and git is well, GIT
 
3:03 PM
@roganjosh IIRC, it worked when I tried it with sqlite3. YMMV for other dbs.
 
3:25 PM
I like the idea of "literate programming" but it seems that troubleshooters like us get the short end of the stick by making it twice as hard to coax an MCVE out of the asker that doesn't have "..." at the beginning of each line
In a perfect world, jupyter would magically know when you're about to copy-paste your notebook into SO, and quietly remove the cruft for you
 
@Kevin hey, found something yesterday and thought I would ask for your reaction/input/etc (since I recall you would probably like that kind of stuff, and I wager other might too)
I was actively searching how to do this and turn out someone else had the same idea :D
(there a SO post related at the end of the readme btw)
 
Programmers that modify ASTs are brave souls and I salute them
 
it's a bit sad his SO post gathered more downvotes than you would think it should, but I guess there some solace in the fact the answer was well received in the end
then again, votes aren't really the only metric worth taking into account
 
This seems like it could be a useful tool... It sort of fills a niche in between the stdlib debugging tools and writing your own domain-specific debug hooks
 
yep, it's basically the thing I have been searching for a long time, except I don't have to make it from scratch or figuring it out how It could be made
 
3:35 PM
Kevin, I believe I faintly remember you trying to create a video player? Did you ever get that done?
 
I still don't get why somebody would need that, but I also don't know what a de Bruijn sequence is, and it's mentioned a few times, so that's that
 
At least the test case the github repo mentions makes surprisingly much sense.
 
I like to think of it as a better trace. It would also be useful when you don't know/care about C/Cython but want to know how a particular code work 100%, and they end up using frozen import or C bindings
 
Very odd that the first thing after the definition about them is that they somehow were already mentioned in the vedas :O
 
@Hakaishin If I'm reading Wikipedia right, a De Brujin sequence guarantees that you can place a sliding window of size N over it, and you will see all possible combinations of characters in that window in one pass
 
3:41 PM
Neat you can use it to hack locks
haha we have about the same reading speed :D
 
For example 00010111 is a De Brujin sequence with N=3 because it contains 000 and 001 and 010 and 011 and ... etc... and 111
And it's considerably shorter than simply generating all 8 combinations and concatenating them together
 
@Kevin wait, so that's how this representation is called? I thought about a project that used this kind of thing and never knew it already existed...
 
(Maybe I should say "cartesian product" rather than "combination", but meh)
@NordineLotfi And now you do know, and your power has increased
 
Hehe :-) One of the reasons my projects don't have many third-party dependencies is, the more research I do the more likely I'll discover I'm reinventing the wheel
 
3:49 PM
sounds like me
 
Even if I'm 99.99% sure I'm reinventing the wheel, I'm happy to continue, as long as I'm blissfully ignorant of the specifics
 
yeah. And I mean, technically everyone is reinventing the wheel, it's just sometimes built or seen differently. If it make more sense/is better or help understanding things, why not?
 
@Aran-Fey The last thing I remember is getting mad at the third party library's dubiously documented API
 
that sounds like pretty much every existing API's docs
 
This one was double dubious, then :-d
 
3:53 PM
ah, that's double sad then
 
Git blame is so awesome, except if you realize it's your code from 5 years ago and you are not sure if you should just delete it all or try to get the tests to work again :P
Man I can't imagine how hard it must be to support software products for multiple decades, it sounds impossible
 
if that's hard, imagine what the companies who still have to support py2.X have to take care of. shudder
 
@NordineLotfi Imagines dinosaur stuck in tarpit slowly sinking :D
 
Ideally, if your tests worked 5 years ago, they should still work today
 
@Hakaishin should be the default one in chrome :P
 
4:00 PM
@Kevin sure xD
 
My recommendation is to go back in time 5 years and kick the metaphorical tires to assess its resistance to bit rot
 
@Kevin yeah, but what about all the cool stuff and bug fix that 3.X get? :/ I would be sad if I were in their shoes (or in the ones of whoever have to take care of this)
 
Not only did Hardware, OS, OS Version, Language version change, but the actual physical location of the office :D I know that is the least important change of all this, but it kinda shows just how much changed^^
 
Employees of companies that still support Python 2 should demand to be properly compensated accordingly
I would not be sad if I were in their shoes, as long as I was getting a fat bonus for my specialized and valuable labor
 
I mean, I guess, but imagine if they ask you to port a popular library to py2 in less than X months. Maybe not sad, but "frustrated" is a better fit if well compensated
 
4:05 PM
I wish I could tell Pycharm that _replace is in general part of the public API
 
Oh undoubtedly I would be frustrated. I'd set aside some of my fat bonus for some soothing aroma candles and whalesong playlists
It won't return me to my default level of tranquility, but that's capitalism
 
4:27 PM
@Kevin I see. I remembered correctly though. I've made some progress on my Gtk-based video player (overcame one of multiple big hurdles), so I figured you might be interested. I'll let you know if I manage to cobble together something reasonably useful
Gtk is a bit tricky to set up on Windows though, so there's that
 
@Aran-Fey :o I would love to know too when you ever upload it to (I wanted to do a similar thing although not necessarily a media player but close enough)
for me it's mostly a magnifier, but with gtk/qt+opencv/Pillow
 
Alright. Now I can continue working on it with this mental note, reinforced enthusiasm, and additional pressure :D
 
good luck :)
 
4:42 PM
I am interested, at precisely the magnitude that neither adds pressure nor removes enthusiasm from you
 
How convenient (:
 
I am witness to your efforts, but in like a casual way
It is as if we both take the same bus in the evening, and we're strangers, but I see you often enough to recognize you, and I'm not entirely sure what you do for a living, but sometimes you get on the bus a little scratched up, and one time your duffel bag wasn't zipped all the way and I'm pretty sure I saw a luchador mask inside,
4
 
With phdcomics I finally have enough comics to last me trough the day, nice :) Have a nice evening folks
 
I, uh... That was a regular face mask, I swear!
 
4:57 PM
And occasionally I distantly wonder how your masked wrestling matches are going, and I like to think you have more wins than losses, and one day I see you have new authentic traditionally crafted high quality Mexican boots, and I nod to myself, and think you must be doing alright
 
hey guys came across this on google docs and trying to understand this content variable and why it has 3 double inverted commas. Any specific reason perhaps.
content = """{
  \"url\": \"http://example.com/jobs/42\",
  \"type\": \"URL_UPDATED\"
}"""
 
Is he walking a little taller today? Or do the boots have thick soles? Perhaps both
 
and why so many slashes \ everywhere
 
I'm pretty sure those slashes are unnecessary. Strings inside triple-quotes don't need to escape single quote characters.
 
The backslashes are pointless, but triple quotes are the easiest way to create multi-line strings
 
5:00 PM
Agreed
Perhaps the coder wasn't confident in his understanding of Python's string escaping rules, and decided better safe than sorry
 
@S.Code inverted commas? :p
 
Handwritten JSON! What craftsmanship!
 
these things """
 
They're called quotes. ;)
 
Double inverted! So , -> ' -> ,
 
5:03 PM
ah okay hahaha
 
The official Unicode name for the character of ordinal value 34 is "QUOTATION MARK". I ask that everybody use this term going forward, capitalization included
I have been informed that I have no authority to make such a request, and that the actual authorities ask that you ignore me completely
 
@MisterMiyagi that's what a lot of bash-centric people do when they are too stubborn to do it in another langs
 
so I created this, should this work?
content = """{
            "url": f"http://example.com/jobs/{project_id}",
            "type": "URL_UPDATED"
}"""
 
Did you try it?
 
Certainly I expect that line to run without generating a SyntaxError...
 
5:07 PM
Did you look at it in an IDE or any other editor providing syntax highlighting?
 
yeah the line was generating over-indented syntax error and but it was the line above this so no more syntax error
should the f string work?
 
I believe a better question to ask would have been "Why doesn't this work?"
 
I don't see an f string here ;-) I see a string with an f character inside it, and a quote mark character next to the f, but those are just regular old letters in that context
 
It would be even better if it included an explanation of what "work" means, but it's a step in the right direction at least
 
@NordineLotfi Well said! A toast to bash-centric people! 🍻
 
5:09 PM
@Aran-Fey ah, it seems I'm not as verbose as Kevin :D Sorry if I put any kind of pressure on you!
 
i am rubbish at asking questions but I got this sick task i am doing and if i can pull this off i will feel really proud developers.google.com/search/apis/indexing-api/v3/prereqs
 
@MisterMiyagi I can't believe I said this either (since I used to be more bash-centric before) cheers :p
 
Don't try this at home, kids. I'm a cautionary tale about the dangers of verbosity
Anyway, in hopes of clarifying issues, I offer the following example:
>>> project_id = 23
>>> print("""foo f"{project_id}" bar""")
foo f"{project_id}" bar
>>> print(f"""foo "{project_id}" bar""")
foo "23" bar
 
Kevin is what happens when god passes too many --verbose flags
 
Hard mode: make print(f"""{foo "{project_id}" bar}""") work
Humanity is the universe observing itself, and I am the D-list celebrity narrator
 
5:19 PM
kevin if i don't want the project_id to be a string then what i sent should be fine right?
i have this basically
"url": f"http://example.com/jobs/{project_id}",
i am not sure why you are trying to do the id in a string but if you are just giving an example then got you, thank you guys
 
Hmm, something is amiss
From my point of view it's me that's not sure why you are trying to do the id in a string. Your code creates a string filled with JSON-like data, and assigns it to content.
 
By the way, @S.Code, do you actually intend to create JSON with that code?
 
I am not sure man, this is what google is showing me and I just want to index some of our projects
on google jobs
if you go end of this link you will see what I am trying to achieve
https://developers.google.com/search/apis/indexing-api/v3/prereqs
 
Here is a small example. Run this and observe how the output of a and b differs. Your content = """...""" code is equivalent to the b object. pastebin.com/S1rRwQjb
 
5:28 PM
ah yes, google + python... a recipe for disaster
I don't think a single person in that entire company can write good python
 
Do you guys think it would be unsporting if I said "I'll drop the cryptic socratic act and give you the exact code you need if you send me a dollar on ko-fi" right now
 
As long as you don't do it for free I don't mind :P
 
@Aran-Fey that's funny considering they hired the creator of Python back then (now working at MS AFAIK)
 
Hypothetically speaking because I don't have a ko-fi or indeed any way for people to give me any object of value
 
@S.Code Please use the json module for creating JSON data.
Seriously.
 
5:32 PM
Perhaps even better: requests. Or aiohttp.
 
yeah i need the json.dumps here
ngl i had that before and then i saw this json code and I thought its google so i should trust them
 
Never trust google, not with your code and especially not with your data
 
It doesn't matter who is telling you to write JSON yourself. Don't trust them. They're trying to get you. Run Forest, run!
 
@Kevin I actually like your usual cryptic socratic act and think of it as a nice bonus when getting input/advice/help :)
 
I trust that the code in the example does what the article says it does. The problem is that it's hard to modify it to do something else
 
5:35 PM
yeah okay fair enough so I have this now hopefully that works
content = json.dumps(
{
"url": f"https://example.com/projects/{project_id}",
"type": "URL_UPDATED",
}
)
 
@Kevin I'm still undecided on whether Cargo Cultists should be shown the error of their ways, or sacked to the last penny.
Present company excluded, of course.
 
(Disclaimer: I was trying to be humorously cynical before, but I really truly believe that my cryptic act is good brain exercise for help-seekers, and will benefit them in the long term)
 
the bigger issue is i don't know what I am doing and I can't test it but hopefully my senior developer tomorrow should be able to see my progress and give me points for that and then also show me how to actually make the whole thing work haha
 
good brain food is good food
 
If this were the Twilight Zone, Kevin would be secretly plotting the Zombie Apocalypse by making brains tastier.
 
5:37 PM
@MisterMiyagi Well, let's properly evaluate all the options... There's also "give Cargo Cultists exactly what they want, and as their work crumbles and collapses, it generates more and better-paying jobs for us"
 
@MisterMiyagi I see you're cultured as well ;)
 
I recall the story of the rat hunters of a big city, who started breeding rats so they could meet their quotas more easily
 
Cargo cultist...are you telling it's those people who drag rusty Cargo off the shore to make cult meeting inside them or is it rust programmers?
@Kevin I remember the one with the electric pole and the disappearing plane
 
@Kevin I certainly owe many hours of payed work to the Cult of Cargo, no denying that.
 
@NordineLotfi It doesn't have to be rusty :-) in the classic formulation, the cargo is in good condition, and contains useful items, when it is gifted to the natives of the island by the visiting American air force.
 
5:41 PM
@Kevin There's usually an Aesop about that being a stupid thing, isn't there?
@NordineLotfi Borrow Checker Cultists just doesn't roll of the tongue as nicely. :/
 
@Kevin :o I see, fair enough
 
The natives are grateful, and when the Americans depart, they try to replicate the ritual the soldiers used to summon planes, by building a traffic control tower out of wood, and waving glowing torches on the runway. But alas, this cargo cult will gain nothing from their attempts.
 
@MisterMiyagi literally the first match on duckduckgo: nypost.com/2021/11/13/are-stock-cultists-pumping-amc-shares visible confusion
 
@MisterMiyagi Quite possibly, and likewise there's Goodhart's Law: "When a measure becomes a target, it ceases to be a good measure". (paraphrased)
Who knows how many managers scratch their heads and think "weird, this guy aced his FizzBuzz implementation in our take-home interview, but his productivity drops to zero whenever he doesn't have Internet access"
 
That's the Cargo Cult Cult, isn't it? Wondering how deep one can go...
 
5:52 PM
@S.Code not being able to test it is the #1 obstacle here, in my opinion. I wonder if Google has any kind of placeholder credentials you can use just so devs can confirm that their requests are properly formed. I've seen other companies do it, for example Twitter.
 
oh now I see what you all meant by Cargo Cult...
 
Even if not, you can do some preliminary testing without sending any requests to google. Just by printing content and seeing if it looks right, and confirming its type() is what you expect, etc
It won't quite give you the same confidence as actually sending the request and getting a successful response, but it makes for a nice starting point for when your coding partner comes in tomorrow
 
yeah, I guess they could also look into project that try to access the same url/api endpoint on github and such, and see how they handle it
there a lot of those especially when it comes to google api (both official and unofficial ones)
 
"Ah, forget this," says the village chief. "Let's just row twenty miles to the mainland and pick up some cargo there. The quality is better anyway"
 
6:11 PM
ah, a question I wanted to ask for some time but: how could I make a for loop work on some string, like say ctrl+x+z where it would be split by the + sign (that part is already figured out) but check if each "key" is pressed, dynamically, so I don't need to make multiple nested if condition manually if there X number of keys (instead of 3).
here it does it for 3 key press but I want to do this on any number of keypress, without having to manually write it as if the, etc Nth times
(here I'm using "keys" as examples but what I ask for can then be used for anything else of course)
 
Generally, if you want to check the same condition for multiple things all and a generator are a good starting point.
E.g. all(key.pressed for key in keys)
 
any example? I know how to check on every elements of all but what I want is to both check for each N element of something and do the next check eg: the next if condition, without having to actually write it
 
@NordineLotfi You start with the example of your problem.
one that explains how all doesn't work for you, since you know how to check on every elements with it
 
If you're up to something as linked where each condition is checked in a different way, you won't get around defining each separate way at some point.
 
one could arguably gather pairs of attribute names and values and getattr them
 
6:21 PM
@AndrasDeak that's an interesting idea :o
 
I'm full of interesting ideas
 
Only now am I noticing the bitmask wizardry in there; that's not going to generalise well. That's probably what Miyagi meant.
Then again you said that keypresses are just an example... so I shan't worry about this for a second.
 
basically let's say I have all the key set up in a dict all, and as mentioned and linked, I already know how to check on each successive key press manually using nested if condition, but what if I don't want to manually do the nested if condition or even support arbitrary number of successive key press (eg: more than 3 like in the two example above)
I don't have any more code example than what I linked/described by the way, because what I'm asking for isn't known in my head, aside from the manual way with nested if block...
 
If you have a dict all then you don't know how to use all.
 
6:24 PM
if it's a dict, I think I do? I mean I can just iterate over it with a for loop
 
@NordineLotfi come back when you have a real problem. This is not the first time you're asking imaginary confused questions. Questions should be at worst imaginary XOR confused, not both.
Put together a working "manual way with nested if block" that works for, I don't know, 5 keys. Then we can do business improving that.
 
it's not imaginary :/ I just sometimes don't want to have code as help but just pure advice, like last time when I got recommended asyncio for making what I mistakenly called blocking loop...but I guess I'll follow your advice
 
thank you
I would also note that your "blocking loop" was confusing exactly because you didn't have a specific example, just some very vague handwaving combined with confusing terms.
the moment you started to explain a specific scenario it got gradually more clear that you needed some kind of concurrency
 
yeah, you're right. If I used the last example with the input() function, I would probably have come off as less confused ^^'
it's hard to know concept or come up with some that already exist but you don't know the name or even how to do them/search for them
 
yup
 
6:32 PM
Welp, that's our xmas party gone on Thursday. I'm glad they told us this afternoon, I almost had to do.... clothes shopping tomorrow!
 
Will they remotify it?
 
They're going to do the quiz portion and then move everything else to next year
 
ah, yes, the quiz, the holiest part of christmas
 
They're also trying to plan a company-wide trip to Montreux for Jan, and they're going to clarify that on Thurs. There's no chance that's going ahead, surely
 
that's a peculiar name to have in the UK... :P
 
6:37 PM
It might be the one on Switzerland :P
 
sorry about that, there's no way for January, yeah
 
It's based on our latest funding round, but flying 200 people in Europe is... not a great idea
 
6:57 PM
@AndrasDeak good news, I think I found a possible solution, although it's not ready to use and mostly just inspiration, but this looks like what I had in mind: github.com/sqohapoe/stenokey/blob/main/src/…
 
excellent
 
the trick was (at least one of them) to just compare an incremented variable with the length of the key combo, I guess? I wouldn't be surprised if there other way to do this, but at least this works :)
@AndrasDeak Thanks for your advice btw, I feel this was in part to it that I was inspired and found this
 
even excellenter
 
On a side note about place names... it still always throw me walking past the local bus stop and seeing buses available to Canterbury and Dunkirk... Turns out there's a Dunkirk in Kent - I just tend to think of the one in Northern France...
 
@JonClements You can drive from Greece to Russia in about 2.5 hours, if you're in New York State.
 
7:13 PM
interesting... :p
 
And apparently it's only an hour and a half to drive from Russia to Mexico...
 
no wonder a large percentage of the US don't bother with passports :)
 
Hi everyone! I'm just passing by asking if anyone here is familiarized with scipy and binned_statistic... I'm trying to calculate a binned mean handling NaNs but apparently statistic=np.nanmean is not working anymore... Could someone please shed some light on this?
I've posted a question related to the issue (stackoverflow.com/questions/70249711/…) but I've also find that an edit has been made to the package so I'm very confused about it
 
Hmm, a bit outside my depth I'm afraid. But I must compliment your diligence, looking at github issues and source changes etc
 
7:33 PM
@Kevin Thanks :-) I try to have enthusiasm when it's about learning
 
I'm gradually spinning up my creaky prob/stat memories from school... I remember doing things with bins
 

« first day (4069 days earlier)      last day (862 days later) »