« first day (3154 days earlier)      last day (1801 days later) » 
01:00 - 18:0018:00 - 00:00

6:00 PM
@ParitoshSingh it's a flask lib actually
 
oh. i see.
 
@AndrasDeak i don have to create xml to be able to ajax
@DeveshKumarSingh i'll check it out
 
@ParitoshSingh I wouldn't bet it's flask wtforms.readthedocs.io/en/stable/#
 
and a simple google result showed this and flask-wtf
 
Pretty funny that Asynchronous Javascript And XML doesn't use XML
 
6:01 PM
there's flask-wtf
 
it's a tongue in cheek but fairly valid point about having too many packages doing a lot of things in your "solution".
 
u know for csrf is one of the most important features for WTForms
@AndrasDeak @DeveshKumarSingh yes its
 
see you have so many options with python, there must be a flask extension of something you are looking for I am sure
 
"flask" things are usually found under the pallets project
 
i'm not sure if i'm using right tho coz i've created the CSRF token but when I Ajaxed , i Ajaxed only the dataFOrms i needed to send , not sure what i should do with the token
@DeveshKumarSingh yes i love it !
@AndrasDeak i think it's strong
let me show u an example of my ajax
 
6:05 PM
please don't
at least don't show it to me
 
@JRick does this help?
 
@AndrasDeak dont look
    const REQUEST_NAME = new XMLHttpRequest();
      REQUEST_NAME.open('post' , "URL_TO_POST_TO" , true);


      REQUEST_NAME.onload = ()=>{
        let xmlParse = JSON.parse(REQUEST_NAME.responseText);
        //do whatever

      }
      const FormData = new FormData();
      FormData.append('var',var);

      REQUEST_NAME.send(sData);
@DeveshKumarSingh yea i don't use jquery but yea it does make sense , thanks alot
 
I found that with just using the 3 main words in your question and searched on SO, so you can actually find a lot of things you asked for directly answered on SO if u look at the right place
 
AD's ?
 
I mean to say you are in a way mocking Andras by tagging him and saying don't look in your post, I would say avoid doing that to him or any other user of this room
 
6:13 PM
@DeveshKumarSingh yea ofc , i know , that wasn't the main topic tho it just came up
@DeveshKumarSingh lol he asked me not to show him the code , i was trying to be nice lol
 
Okay I will let him decide :)
 
ok :)
anyway thanks a lot i will go do some more coding
appreciated your help tons !!
 
cbg
 
6:21 PM
Well the pushing of data from the scanner was becoming a bit problematic so I've just settled on the barcode scanner writing to a file on the shared network drive. My consideration now is whether "DO NOT TOUCH" being part of the file name makes it more or less likely to be tampered with
 
definitely more
more than anything else, it would be the location of the file that matters i'd imagine
 
Lots of people there have lots of time on their hands, so "accounts" or something in the name would probably be attractive. Maybe "huge, boring inventory file"
Yeah, I will bury it somehow
 
having said that, someone opening the file, would that cause issues?
er, well i suppose that's a dumb question. do you guys use windows?
 
Possibly, I think it would be locked for editing
 
Is that shared drive accessible from the other end
 
6:24 PM
it is.
 
It's accessible from every office PC
 
so now you will read from that file, instead of wrapping the logic around flask like you were planning earlier via a REST api
 
Yeah, scanner is programmed to dump to any file I choose. I chose to make syncing the site with the file a triggered process too
 
BTW . question, I always thought __init__ is the constructor for a class, but seems like it's not, and __new__ is the constructor
 
6:26 PM
well, okay, before implimenting the idea
was the issue with the "Watcher" portion itself?
on the barcode side?
 
I was more concerned about race conditions
 
@roganjosh so you are subscribed to that file and look for any updates made on that
 
@DeveshKumarSingh No, the user clicks "sync"
 
@roganjosh can you not afford any delays whatsoever in the sequence of events?
 
ohh, and then the scanner pushes the updates to the file in one go
 
6:28 PM
Which takes all of about 0.3 seconds to parse out properly and leave me a pretty good bet that there isn't a race condition
@ParitoshSingh I don't care so much about delays, I care more about the fact that I'm the only one who knows how it works and I'm a contractor
So it should really be as stable as possible
 
but there has to be a file? Can it be a in-memory queue or something, or a database
 
@roganjosh okay, so here's an idea. feel free to shoot it down if you wish to. barcode scanner dumps a file locally. watcher picks up changes on that file and updates to an sqlite db in shared location
no one can easily open the sqlite db, and you can keep things managed still via the shared drive
 
is the watcher a while True loop which polls constantly?
 
@ParitoshSingh actually, that makes quite a lot of sense. The watcher could be really simple too so maybe it's not such a concern to have a middle-man process
Wait, no, cos the watcher either watches a text file on the shared drive (same problem), or we go back to the initial idea which involves having another process running on the PC in stores. That's not great if they change the PC 6 months down the line and if I'm not there
 
yes, this watcher would be on the barcode side of things
essentially the store pcs
 
6:32 PM
btw how many files are we talking about here? Is it one file per store pc, and I assume lot of store pcs?
 
ok, in that case
perhaps a simpler and cleaner, but more "annoying" route..
 
since I am thinking a barcode scanner at every checkout reception
 
do you have an it department? can you get a read only folder on the share drive?
give write accesses to the store PCs
 
I think I'm reasonably happy with what I have and if there is uptake, I'll have a few months more work anyway so I'll be able to see what any real issues arise. So far I'm just sorta catastrophising I guess, nothing may come to pass
 
IT department is notorious for ignoring full time employees, maybe rogan has to jump a lot of hoops to get this done :) I am a contractor myself and I know what it takes
 
6:34 PM
IT will shut me down immediately if they know about the system
 
rofl
i see!
 
@roganjosh and so I thought :)
 
whelp, security through obscurity i suppose. you have control over the filename? name it something stupid like a .dat file
 
@ParitoshSingh watch this when you have time, you'll know what I am talking about
 
@ParitoshSingh if the scanner doesn't throw a hissy fit writing to that extension, that's the winner
 
6:35 PM
how about virus.exe
 
laurel, i'd definitely click that.
from a coworker's unattended pc ofcourse. innocent
 
wim
@cs95 me too, except the pitch is kind of diamond shaped and they always seem to forget to set up the wickets
 
(no i wouldn't, but i'd imagine someone would)
 
@wim baseball :)
 
wim
@piRSquared if you watch it in fast-forward sometimes you can see the players move
4
 
6:37 PM
cubs finally won it in '17
 
laurel
 
As an Englishman, I feel obligated to defend our sport. But I can't; have at it.
 
does that stance change if England wins this time around?
 
In absolutely no way
 
poor guys. :P they shouldn't have switched off of BBC.
 
6:40 PM
they actually can make it this time, atleast to the semis, they have improved a lot under morgan
 
Although, I used to play in the Manchester Softball league multiple times a week as a teenager (it's actually relatively popular) and my dad took my to a baseball game when we were in America. It was one of the more boring experiences of my life. So I guess I don't really like watching sport.
 
@roganjosh "cricket colonized half the world. What did your sport do?"
how's that for shots fired
 
wim
@Aran-Fey you still use XMLHttpRequest though
 
The sport I watch is basketball but I'm horrible at. The sports I played/participated in and was rather good at was volleyball and skateboarding.
 
wim
it's a continuation of the joke that javascript has nothing to do with java
@DeveshKumarSingh there is not really any good analogy for "constructor" that is baggage from other language
 
@cs95 I feel like you've self-elected as my representative in a trial by combat. I wish you well.
 
@wim baggage from another language? I thought constructor are native to OOP, be it any language
 
I mean, they do have the totally inclusive World Series
 
@roganjosh @cs95 God speed Oberyn
 
@roganjosh this never gets old :)
 
wim
6:51 PM
I used to enjoy basketball but now it is extremely tedious with all the fouls and somehow the last 1 minute of the game takes 20 mins
 
I haven't had time to watch much past few seasons. Not to mention I'm a Lakers fan and yeah, that's painful.
 
wim
NBA games these days .. they should just set the clocks to 5 mins remaining and put the scoreboard to 100 - 100 and go from there. save us all some trouble.
 
well u got lebron now in lakers right?
 
/sigh ... yes
 
wim
now the team strategy will be "pass the ball to lebron james"
 
7:00 PM
@MisterMiyagi No, type hints need to be written out literally in order to be parsed. You can't even fetch them from a dict, the only way you can alias them is as simple variables
IntFunc = Callable[[], Awaitable[int]]
StrFunc = Callable[[], Awaitable[str]]
...
it's lame, but python typing really is an afterthought
 
so is typing only usable to the reader of the code, unless used with other python tools which do static code analysis?
 
bingo
unless you write funky code that reads out __annotations__ during runtime and does something with it
 
7:16 PM
@DeveshKumarSingh closed.
 
thanks :)
 
wasn't me, someone whacked it hard :P
 
a gold-badger :)
 
wim
 
The only possible improvement would be if it had a brass knuckle design =D
smack! -- closed as duplicate
 
7:26 PM
@wim is your display pic a badger? or a skunk?
 
The only line I remember from Family Guy; "... so help me god, I'll hit you with my ring hand"
 
@DeveshKumarSingh how the heck does @wim's profile look like a "skunk"?
badger, badger, badger, snake, quick!?
 
mushroom mushroom
 
@JonClements I meant the profile pic, also they look kinda similar, white stripes and all?
 
badger, badger, badger...
@Devesh err... a badger really doesn't look like a skunk at all... (except the colouring)
 
7:33 PM
@JonClements aah so this is where the GIF is from :)
 
yup :)
 
that confirms it's a badger, I take my words back
 
wonder if rathergood still exists - they had some fun stuff there
 
wim
want pie now
 
7:56 PM
good luck... I'm still promised sausage rolls from @rogan :)
umm... aren't the rest of "The Cranberries" releasing a final album this month?
 
I'm interested in programming an m,n,k game. If I represent the board state as a numpy array with 0s (empty), 1s (first player pieces), and 2s (second player pieces), what's the fastest way to check whether there are k stones of the same color in a row?
 
sum over boolean arrays with the correct conditions should be fast enough
 
What do you mean?
Like masks?
 
well, you can call them masks if you want to, sure. but given your array, you can take yourarray == 2 to make a boolean array out of it for player 2
 
Yeah
That reduces the problem to finding k Trues in a row, column, or diagonal
I guess I can convolve (sliding window) a row of k Trues, a column of k Trues, and a diagonal of k Trues over the array and check if I get all True for any window.
 
8:06 PM
ah, i see a slight issue with sums, i misinterpreted row.
there probably is a better approach than a sliding window
 
wim
why can't I ever spell git commit --amend correctly?!
@JonClements mod question ..
 
wim
is it worth mod flagging if you suspect someone is serially downvoting you and is clever enough to do it just once or twice a day to not get the votes auto-reversed
do community mod even have enough privilege to actually check for evidence?
I've apparently upset someone because I'm getting DV on every other answer recently even when I'm confident it's correct. No comments left from DV'er, and oftentimes upvote appears on other answer at same instant when other answer is bogus/not working at all
 
8:26 PM
Actually, I have a better idea.
 
@wim perhaps this will help.
 
@user76284 np.bincount?
 
@AndrasDeak That counts non-consecutive elements right
 
although it doesn't have an axis kwarg
@user76284 yeah, order doesn't matter
 
Yeah that won't work for this
 
8:36 PM
OK :)
@wim yes x 2
Mods don't see votes per se but "voting patterns", whatever that means. They are pretty good at honing in on voting fraud.
 
I think I have a good partial solution.
def check_cols(board, k):
    x = board[0:board.shape[0]-k+1]
    for i in range(k - 1):
        x &= board[k-i:board.shape[0]-i]
    return x.any()

def check_rows(board, k):
    return check_cols(board.T, k)
Basically it's and'ing the board with shifted versions of itself, for all shifts from 0 to k-1.
Still have to deal with diagonals though.
 
wim
thanks. I guess Jon got distracted by a cat in the shrubs or something.
 
ah, I didn't even notice you addressing him
 
@wim yes, I had exactly the same issue and most got removed
 
wim
Brad Larson answer looks promising
 
8:48 PM
Brad is one hard-core defrauder, hence "larsoning"
 
I reported it, got told they couldn't see the pattern but to report if it happened again. It happened the next day, so I flagged again and got attention on the issue
 
for complicated cases mods can probably escalate to CMs who can look at actual votes
getting a consistent stream of downvotes on ancient non-active posts is always a good sign
 
Sam
What's a CM?
 
community manager, as in SO employee
 
Sam
Ah, my follow up was are they payed until your edit ;D
 
8:51 PM
it can be a bit confusing because moderators are officially called community moderators which would also abbreviate to CM, but when someone says CM it almost always means staff
some employees can access the vote DB but everything is logged meticulously to prevent any kind of abuse
 
@wim He found a sparring partner
 
Sam
How involved are SO staff in the community in terms of moderation? It would be good to know how self-sustaining the site is based on the community alone
 
As far as I know almost all work is done by elected moderators and the CMs only supervise them and handle extreme cases. But this is half just an impression.
 
Sam
If that is the case then they have an extremely good model
 
We have a looot of mods. But you'll see much fewer actually doing things.
As for staff, I occasionally bump into things closed by animuson
But much more often you'll see mods
 
Sam
8:59 PM
And are there perks to being a mod? I was actually trying to have a look around the web to see how to make these kinds of self sustaining communities
 
Yeah, they get paid triple compared to regular users
3
 
i heard it was 42 times (aah)
 
The paid SO staff are very busy in meeting about how we need to change the font colour of the hot meta questions, or min-reprex issues. The big stuff.
 
It's a linear combination of power hunger, narcissism and altruism. Varies by person.
 
Sam
@roganjosh Surely those kind of decisions mean meeting(s)
 
9:01 PM
@Sam having actual mod elections is key
 
BTW the altruistic are less likely to taut their attributes.. thus less of them are elected.
 
Not necessarily
 
Doesn't have to be necessarily, just generally.
 
the baseline is "crazy person addicted to SO" ;)
 
Sam
@AndrasDeak I know a lot of SO employees write blogs. I wonder if this kind of thing is ever written about.
 
9:04 PM
I'd try Jeff Atwood (no longer employee)
 
Sam
I follow Nick Craver and he's either writing about debugging a .NET package or knocking down walls in his house for faster broadband
 
He mused a lot about these when Joel and he started SO
"Coding Horror" is the name
 
Sam
I'll check it out
 
I think they flew by the seat of their pants. You can find posts about introducing suspensions, for instance.
 
What's a pythonic way of setting up a thread in the init of a class but then sending arguments to the thread's target once it's called?
 
9:14 PM
none
 
wim
^
 
I can't visualise what you're trying to do. I think you need to elaborate
 
why do you want to start the thread before you can pass it its arguments? What's the point of that?
 
It's for two separate document printing functions in a PyQt app. I know of QThreads but they complicate this further. I have to be able to bind these printing functions to their respective buttons as well as pass an argument to them with the data to be printed.
Right now it works by binding a partial() function to the button with the function target and the argument to send.
Afaik you can't start a thread inside the function to be threaded.
 
So the argument is already known at the time when the button is created? Then partial() sounds like a reasonable solution
 
9:23 PM
The argument is known but the data it holds is dynamic.
Really the issue is threading these prints so they don't block the GUI.
I just don't know if I should create threading functions for each or put them into a class with a thread spawned for each one ready to be start()ed.
 
def run_in_thread(func, *args, **kwargs):
    Thread(target=func, args=args, kwargs=kwargs).start()

button = Button(command=run_in_thread, args=(print_func, data))
I'd do something like ^ that
probably
 
PyQt makes everything impossible. So the way it looks right now is
```
```
self.orderwindow.printlabel.clicked.connect(
partial(self.print_worker.print_order_label, order))
```
oh I'm in chat. Triple ticks don't work lol...
 
Recbg
 
wim
hey antti
 
Re: triple ticks, gotta write to meta
 
wim
9:30 PM
check this out #1, #2, #3
 
Opinionated is technically correct. But still..
 
and somehow they ended up rescinding his commit privileges
 
@AndrasDeak not only paid triple but they are expected to work sixfold
 
maybe not, the repo is tagged kennethreitz
 
@wim 1 yr ago?
Or is it my phone
 
9:34 PM
@JonClements excuse me
Jun 2 at 17:51, by roganjosh
Have 6 right now! I've had them couriered over, special delivery
 
@AnttiHaapala yup, May 2018
 
wim
Yes, there was a big chr(0x1f4a9) show on reddit about pipenv
 
Well, he's as expected
 
I've just come back from a slightly disastrous pub quiz in which we had to have a tie-break for top spot
 
wim
and I expect these commits might be, errr, psychological fall-out from that.
 
9:39 PM
I do remember that Patrick Stewart show
 
wim
@AndrasDeak No. That was from requests.
 
We had to nominate a person from each team to answer the question. The closest to the correct value wins. "How tall is the Eiffel Tower in metres?"... our nominee "1700"
 
Ah, right, I just vaguely remembered that it was one of his brand projects. Thanks.
@roganjosh "what are meters?" :D
 
@Aran-Fey This looks like it'll work but Python is telling me I'm sending two positional arguments now.
    def label_thread(*args):
        thread = threading.Thread(target=print_order_label, args=args).start()


    def form_thread(*args):
        thread = threading.Thread(target=print_order_form, args=args).start()
 
@AndrasDeak oops, but slightly less ridiculous than our tie-break :P
 
9:42 PM
self.orderwindow.printlabel.clicked.connect(partial(label_thread, order))
self.orderwindow.printform.clicked.connect(partial(form_thread, order))
 
Someone restar that codeformatting pls
 
@smallpants apart from the fact that .start() doesn't return anything and your thread variable will be set to None, I don't see anything wrong with that
 
On phone now
 
Why do we still have a "downvote that to hell" post pinned?
 
wim
 
9:43 PM
@Aran-Fey I'm not sure why it says I'm passing two arguments. Lemme debug and see what's passing.
 
wim
@roganjosh JFF-shaming
 
I assumed as much. Do pinned posts have to live for a certain amount of time?
 
wim
I don't think so
 
@Aran-Fey The second argument being passed is a False of unknown origin.
 
wim
the pinned stars lifetime seem to follow patterns similar to the radioactive decay of isotope phosphorus-32
 
9:48 PM
Does QT send a boolean argument to the click event handler?
 
@wim wow I went and looked at the question and ops answer... And downvoted the answer to -1
 
@wim Surely the slight fading of the text would be a priority to improve the experience of the chat room users?
 
Question asks why is water wet, answer says aurora borealis are caused by cosmic radiation
One thing I don't understand: now that it has been pointed out to you that your answer is wrong (it does not answer the OP's question at all), why don't you remove it? — Marc Glisse Aug 24 '15 at 18:38
 
    @Aran-Fey it doesn't say that it does anywhere but interestingly enough, changing it to
        thread = threading.Thread(target=print_order_label, args=args[0])
        thread.start()

says its now passing 30 arguments...
 
Try args=(args[0],)
 
9:54 PM
This formatting thing is wild in chat.
 
yeah it really is
 
wim
yep. smallpants is a good username.
 
You'll get used to it. We should still be campaigning for a half-life for the clarity of text for pinned posts
 
wim
@AnttiHaapala +11/-12 is still +86
I really hate this vote weight thing. up/downvote should be symmetrical, +10 and -10.
anything else means people gaming the system
 
@wim it's a lifelong nickname. I'm short.
@Aran-Fey that fix seems to have worked but I don't really get why
 
9:57 PM
args is supposed to be an argument tuple... and args[0] isn't a tuple
 
so we're putting it back into a tuple of only one item
 
Anyone here into SDN, I'm learning Python with the end goal of using for SDN and network programability. Just trying to connect with anyone who may already be in the arena for advice and chat regarding Python and SDN.
 
@wim thanks was going to ask about the votes, stupid mobile interface
 
if you temporarily go full mode (link at bottom) you can view the votes...
Sep 11 '17 at 11:38, by Andras Deak
don't fix what ain't broken has a workaround
 
@smallpants the same issue happens a lot in SQL. args here expects an iterable sequence, which a string is. So unless you put your single, string, argument into an iterable container, it will instead just iterate though each individual character of the string
 
10:01 PM
I see now. I've seen *args and **kwargs before but never actually had to use them.
 
this doesn't seem to be either case?
 
But yes, this has definitely worked. It's no longer blocking my GUI. Thanks for the help.
@AndrasDeak I needed *args in the function which starts my print thread.
 
wim
that fix seems to have worked but I don't really get why is the catchphrase of stackoverflow-based-development
 
I only apply that to JS; is that ok?
 
10:09 PM
Yes, because by the time you'd learn it proper the framework would already be obsolete.
 
Well, it's mostly with JQuery and it's the best. It can do everything.
Despite all the upheaval, jQuery keeps its 2nd place only beyond Jon Skeet on the meme thread meta.stackexchange.com/a/19492/347110
 
only until it's deemed offensive to JS developers
 
"i'm an angular dev and i find your claim that "jquery solves everything" to be offensive"
 
^ it's.... probably gonna happen at some point
 
10:34 PM
@wim :) It'd be good if there were an article like this one that used Python rather than C#
I'm not implying that smallpants is a cargo-cult coder, but one of our frequent visitors almost certainly is...
 
In relation to Flask?
 
@roganjosh Funny you should mention Flask. ;)
 
I'm biting my tongue to stick with my throwing-in-the-towel but I've seen the discussion again since. It's frustrating to see more people go through it :/
 
cabbage
 
cbg
 
10:44 PM
Of course, everybody does a little bit of cargo-culting from time to time when they're learning new stuff, especially when dealing with a large framework. But a non-cargo-culter will go back & try to figure out what the copied code is actually doing. We take it apart, modify it, etc, until we're familiar with it and can explain it to ourselves, or our colleagues. The cargo-culter doesn't do that. They're too busy looking for the next chunk of magic code to add to their collection.
 
I have an odd problem where I load a jupyter notebook file on my home computer and run it without errors, but when i run it on my remote computer (at school) it throws an error for returning a print statement
I have no idea why this is happening....
 
@VictorNogueira you will need to be more specific about the error
 
syntax error
` return (print("Successful right swipe"))
^
SyntaxError: invalid syntax`
 
@PM2Ring the records will show that I have tried. They are not receptive to the advice.
 
@VictorNogueira missing closing parenthesis or bracket or something on previous line, but otherwise you're returning None (a semantic error)
 
10:46 PM
def right(self):
    actions = ActionChains(self.driver)
    actions.send_keys(Keys.ARROW_RIGHT).perform()
    return (print("Successful right swipe"))
am i?
 
Maybe not. Python 2 then?
 
That's going to return None in any case
 
@roganjosh yeah but that's semantics
 
oh darn, you know what I bet that's it, when i installed PIL i saw it installing python 2.7
Thank you @AndrasDeak
 
no problem
 
10:48 PM
@AndrasDeak Sure, but we're progressing to a "please provide a mix-reprex" conclusion here :)
 
@roganjosh You've tried hard. But they are out of their depth, and are mostly just interested in learning how to glue the magic code blocks together.
 
@roganjosh seems like a callback which doesn't have to return anything
in which case ^ @VictorNogueira, the return is superfluous. print always returns None.
 
indeed it is, but I like to return the print statement rather than have it in the function definition
 
Why?
 
What do you mean "rather than have it in the function definition"?
that's literally just a very confusing
print("Successful right swipe")
return
in which case the return is pretty much implied anyway (so is the None)
 
10:53 PM
Is that better styling?
Versus returning the pring statement?
 
Definitely don't return the print function call. And I'd omit the return entirely, but I never write callbacks.
 
essentially the two options would be


def right(self):
actions = ActionChains(self.driver)
actions.send_keys(Keys.ARROW_RIGHT).perform()
return print("Successful right swipe")`

Vs.

def right(self):
actions = ActionChains(self.driver)
actions.send_keys(Keys.ARROW_RIGHT).perform()
print("Successful right swipe")
return
 
Code formatting in chat is a mess. Please check out sopython.com/wiki/… for a few tips.
@VictorNogueira and I'm saying the former is not an option.
 
What is this code actually doing? Where is print directed? It has very little use in actual programs
 
@roganjosh probably just debug/MCVE
 
10:56 PM
But it's for them to answer, no for us to speculate
 
no, it's for me to speculate, thank you very much
 
:P
 
It is just a confirmation that the function ran successfully
:P
 
# what I'd do:
def right(self):
    actions = ActionChains(self.driver)
    actions.send_keys(Keys.ARROW_RIGHT).perform()
    print("Successful right swipe")
 
So you would omit a return altogether?
 
10:57 PM
3 mins ago, by Andras Deak
Definitely don't return the print function call. And I'd omit the return entirely, but I never write callbacks.
 
Hmm I suppose I just got used to using return's, even when they are not needed
 
what do you think? :P
I think leaving bare returns can be defended as well (as long as every return in the function is bare).
 
Thank you so much for the help @AndrasDeak you were spot on with the use of python 2.7, I would have never thought of that. Gonna run to the gym for a bit RHB
<3
 
when you're looking at a callback it's pretty much a given that it returns None
have fun, rhubarb
 
@AndrasDeak True, but it depends on the framework. In GTK, callbacks for event handlers can return a bool to indicate whether they successfully handled the event. If the event wasn't successfully handled, the event gets passed up to the parent widget.
 
11:04 PM
huh!
 
So eg, if you hit a key that the widget with focus doesn't understand, the frame containing the widget may be able to use it, or the window containing the frame may understand it.
 
I've never heard of that, thanks
 
It's quite similar to how exceptions bubble up until they get caught by something that knows how to deal with them.
 
yeah, it makes sense
 
And of course each widget in the chain might respond to the event, but allow it to bubble up anyway.
 
11:14 PM
is it appropriate to raise a flag asking a moderator to fix a typo in a comment that is too old to be edited?
 
I don't think so, they'll just delete the comment :P
 
that seems counter productive :/ I'll just ask jon when he's around sometime
 
@cs95 Did you write the comment?
 
yes in this case, I did
 
So just copy & paste, and delete the original.
 
11:19 PM
I forgot to add a preposition. This comment has a lot of upvotes under a popular answer, so reposting will lose its visibility
(before you ask, it isn't an advertisement)
 
Oh, ok.
 
we all know minor annoyances are the bane of our existence
but i'll try and forget about it
 
01:00 - 18:0018:00 - 00:00

« first day (3154 days earlier)      last day (1801 days later) »