« first day (4617 days earlier)      last day (324 days later) » 

12:45 AM
@Thingamabobs the biggest difference is that this tool fully automates this level of horse feces - to the point where humans will just simply burn out from dealing with this - any suggestions to welcome this tool is to effective burn the sites down and have bots talk to each other
 
 
5 hours later…
5:43 AM
@CodyGray-onstrike You wrapping my argument in a different context that I've never mentioned. I never said "this posts can't be moderated", I say the same mods that have complained to be overburdened before AI-generated content was an issue are basically saying "look how many resources we've spent on this issue" and here is "how we believe they are successful.
- I don't want to fight over that point, I believe y'all when you say you do a good job with it, out of personally raised flags and how they was handled.
@metatoaster I agree on this one. However, instead of hanging up to this point and in fact a side-discussion to the (in my view) real issue. I would suggest a different strategy, otherwise I can't see the mods win. That's basically all I'm saying.
 
6:11 AM
I mean, the real issue is that this is a fight between owners and workers, so the solution to this is to basically abolish capitalism
if this is what you are actually saying I will agree with you, otherwise probably not.
 
 
2 hours later…
8:27 AM
cbg all
 
@Thingamabobs Sorry for being unclear. My message (the one you were replying to) was describing the argument being made by staff/admins, not the argument made by you necessarily. You could read it as continuing with the previous message: "...there's been zero evidence provided to us [mods] that suggests otherwise. In fact, their argument is literally FUD..."
 
 
1 hour later…
10:07 AM
How do i downgrade a unique=True back to False in SQLAlchemy with alembic? My --autogenerate creates this:
def downgrade() -> None:
    op.drop_constraint(None, 'User', type_='unique')
Which raises an error when ran:
"sqlalchemy.exc.CompileError: Can't emit DROP CONSTRAINT for constraint UniqueConstraint(); it has no name"
 
10:20 AM
Not meaning to sound like a complete arse - but have you looked at the documentation for op.drop_constraint()?
 
Depending on the RDBMS you might want to add:
from sqlalchemy import MetaData
meta = MetaData(naming_convention={
        "ix": "ix_%(column_0_label)s",
        "uq": "uq_%(table_name)s_%(column_0_name)s",
        "ck": "ck_%(table_name)s_%(column_0_name)s",
        "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s",
        "pk": "pk_%(table_name)s"
      })

Base = declarative_base(metadata=meta)
IIRC, that fixes auto-generated constraint names when running Alembic
 
Handy, thanks for sharing
 
I think that naming convention works with both postgres and SQLite3 (if you're doing quick and dirty local testing). Also, batch updates for SQLite3 won't work without it for any ALTER TABLE equivalents, but it will with that addition
 
10:38 AM
I kinda treat my Alembic migrations like unit testing code - I like to be explicit, and variables are in-line (if possible) for readability purposes. It's an area where I don't enforce DRY
 
I think that's fair enough, and I will curate my autogenerated alembic files before keeping them, but the naming convention gives it a fair stab at autogenerating the "name" parameter for anything like this operation. It's been a while since I looked at the sqlite docs around ALTER TABLE but maybe that specific concern has since been fixed since alembic definitely threw its toys out of the pram without specific naming conventions, even in batch mode
Stuff was changed in 2018 versions. Nowt like programming documentation to show you the crippling speed of the passage of time :/
Although section 8 of the docs suggests it's still an issue, so I'm not just stuck in the past
 
Yeah, I've stopped looking at Django things for good reason. Some of my original hacky workarounds were cited on places like StackOverflow. Was the most popular topics on my blog when I still bothered to have one.
 
@roganjosh thanks, this works.
 
Then when I look at Django it's like: "hey, we're a mature semi-sane framework now. Remember some of the yam that you had to do?"
 
yam*
 
10:47 AM
Sorted, thanks
 
No worries :)
 
11:10 AM
@PythonForEver I decided to refresh my memory of this stuff so, to close the loop, the official docs on why this works are here
 
 
1 hour later…
12:25 PM
Can anyone suggest me online resources to master python
 
1:02 PM
does anyone knows a good source to discover garbage collection in context of threads ? I have produced a weird issue, where gc.collect is seemingly invoke __del__ of a different instance in a different thread. Now I'm puzzled how I even should approach this issue.
 
Do you have an example of that perhaps? instances don't life in threads, so it's not clear what you are describing.
 
Let me try to create a [mre] with tkinter.
 
1:21 PM
Not possible to be minimal I guess as I write a different kind of wrapper for tkinter, all I'm sharing now with tkinter is the _tkinter.TkApp. Could you please elaborate what you mean with instances don't life in threads ?
 
I was referring to "a different instance in a different thread", which doesn't make sense to me since instances don't belong to threads. Or did the "in a different thread" refer to "invoke __del__"?
 
I have a class that is imported in the MainThread instances of this class a created in the __init__ method of ThreadOne and ThreadTwo. The __del__ is called on both instances when one thread ends and gc.collect is called as last logical line of that thread. Otherwise it just occasionally happens or in weird combinations when having more instances/threads on this class.
It's either the garbage collector or my threading.local that produces this. Currently not sure how to tackle this.
 
What happens occasionally?
 
That __del__ is called, resulting in root-windows, similar to tk.Tk getting destroyed.
 
Well, is it bound anywhere?
 
1:38 PM
Yes, as attributes in ThreadOne / ThreadTwo etc. so there shouldn't be a refcount of 0.
 
One step back, please. __del__ of what is called? ThreadOne/ThreadTwo/the root-window/ something else?
 
the root-window
 
And that root-window is bound as an attribute to both ThreadOne and ThreadTwo?
 
def dooneevent(self):
    interp = sys.modules['MyTk'].references.interpreter
    interp.tcl_interpreter.dooneevent(self.service_mode)
    try:
        #check wheter there was user events or not
        #self.master.tcl_interpreter.call('update')
        interp.call('tk', 'inactive')
    except tk.TclError as e:
        if str(e) == ("can't invoke "
                      '"tk" command: '
                      'application has been destroyed'):
            #if app has been destroyed in last event
 
Was that supposed to be a "yes" or a "no"?
 
1:50 PM
yes, it is.
gc.collect ensures here that error happens, otherwise it's bad luck.
 
2:08 PM
Is it possible that I have a ref-circle and the GC wrongly assumes that the other instance is garbage as well ? Since python have shared memory across threads ? medium.com/analytics-vidhya/…
 
2:46 PM
Have you tried keeping an explicit reference to the root window in the main thread?
Then if other threads come and go, the refcount won't go to 0
 
3:06 PM
BTW, it's generally not a Good Idea to have more than one Tkinter root window. From stackoverflow.com/a/48045508/4014959 "The best solution 99.9% of the time is to create exactly one instance of Tk that you use for the life of your program"
You can write Tkinter code that uses multiple threads, but the usual way to organise that is to create the root window & TCL interpreter in the main thread. If other threads need their own windows, create them using TopLevel
 
@PaulMcG Not yet, found something different now, that might be related. It will be good for testing purposes but in the end I wouldn't aim for this approach, since the whole purpose of the __del__ is to have garbage collection work with the wrapped tcl entities.
 
Also, there are ways to do stuff in parallel without using threading. Here's a simple demo. gist.github.com/PM2Ring/3b11ea2b6750903e92acdd104c63c769 Use Tkinter's .after method to run several named counters in parallel.
A more complicated example. gist.github.com/PM2Ring/467cf3d1e884ea508efd996f95fd871e A Tkinter viewer for named PIL Images
 
@PM2Ring thank you for your concerns, I'm well aware of the canonical way for writing tkinter applications. I develop a tk-wrapper that aims to give you more as the thin tkinter wrapper does. So my question doesn't really apply to How you do it in tkinter
@PM2Ring the main issue is that you have thread bound variables you need to take care of, I try to fix that here, without complex guidelines while developing your app.
 
3:38 PM
@Thingamabobs Oh, ok. I haven't had such problems with my thread-based Tkinter code. But I wrote that stuff a few years ago, and don't clearly remember the details (and I'm on my phone, so I can't view the code).
 
no worries. Thanks for taking care.
 
 
7 hours later…
10:22 PM
Hi everyone
 
hello
 
Thank goodness, I thought I was alone here
 
I only count as half a person right now, my brain is already asleep
 
So, what's your link to Python?
 
Been using it for... a while
 
10:32 PM
You've been around :p Or at least your other account has been
This is the smurf
 
10:43 PM
I've been around, reinvented a few wheels, and now I'm ready to pick up farming on the countryside :)
 
I can identify with that. I'm the author of borb, a Python library for working with PDF documents. I'm a former employee of iText, another PDF library :p
So yeah, wheel being reinvented :D
 
Fortunately, we do occasionally manage to invent a slightly rounder wheel
And truth be told, a lot of wheels these days are square-shaped...
 

« first day (4617 days earlier)      last day (324 days later) »