« first day (3609 days earlier)      last day (1336 days later) » 

12:31 AM
@toonarmycaptain I hadn't thought about it much lately. But the fact that it is virtual means I could probably participate.
 
1:07 AM
@Dodge Probably, and it's free IIUC. I don't know what kind of social aspect will be involved though.
 
 
2 hours later…
2:53 AM
@toonarmycaptain cool, I'll check out the details. Free sounds good.
 
 
3 hours later…
6:05 AM
cbg
 
6:52 AM
@MisterMiyagi Unfortunately ,my kernel is not supporting AF_XDP or PF_XDP ......However ,Address family code for AF_XDP is 44 .kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux/…
 
7:48 AM
I have python 3.8 on my machine (Ubuntu 20 something) im looking for a way to create a virtualenv with python 3.7 , can I select the version of python when creating a virtual env ?
 
python3.7 -m venv /path/to/venv
 
@Amundsen do you actually have python 3.7 on your machine as well?
 
@MisterMiyagi python 3.8 /get this error
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.7'
 
8:12 AM
Well, you must have the Py3.7 interpreter in order to use it.
 
 
1 hour later…
9:26 AM
In python socket module,PACKET_RX_RING is working? but,socket documentation doesn't contain it.....It is important for packetmmap....sites.uclouvain.be/SystInfo/usr/include/linux/if_packet.h.html
however,packet.h contains options for setting circular buffers...
 
Please just try whether the constant is there or not. Modules which are bindings for low-level system calls/constants merely pull in what is available on your platform, there is no cross-platform version-agnostic set of attributes.
In specific, PACKET_* constants seem to depend on the platform and version: docs.python.org/3/library/socket.html#socket.PF_PACKET
 
or is there an another place to learn that things(sockets,ioctl,fcntl)(python documentation doesn't contain all things.)
 
As mentioned, low-level modules are mostly just wrappers around the underlying system library. Refer to the respective man page for details of your platform.
"Many constants of these forms, documented in the Linux documentation, are also defined in the socket module."
 
cbg
Can you think of a more efficient way to write this?
def findFloor(a:str):
return strings[position -2:position].strip()

data['readerdesc'].apply(lambda x: findFloor(x))
 
Please see the formatting guide for posting code in chat
In addition, it's tough to answer if you don't give an MCVE showing some example of the dataframe you're working with. I've got bored trying to imagine such things because apparently I'm not very good at it
 
9:37 AM
As a rule of thumb: A function of a should be using a.
Also mind the equivalence of λx.fx=f
 
?
 
He's talking to rey
 
ok
 
10:26 AM
sqlachemy oracle connection timeout - does anyone know how to set?
 
I thought the timeout was a "global" setting in SQLA
 
i have tried passing args in connection string but it keeps running
can i have my engine object do that for me?
 
In the connection string? What about this?
 
ok what i want to do is...
after a certain timeout i want my engine to throw a timeout error
 
Isn't that what my link would do? When you say "connection string" I'm imagining that you're passing it in db_url (in the case of the answer I linked). I don't know specifically how SQLA deals with that, but I'm suspecting it gets ignored
 
10:33 AM
@roganjosh yes yes, does not work
 
Actually, I'm not sure how it could be ignored even if you did that. Hmm
Let's start with a trivial potential issue. What value did you set for the timeout?
I just want to rule out the possibility that you've specified the timeout in ms when it's actually supposed to be in seconds
 
TypeError: 'connect_timeout' is an invalid keyword argument for this function
 
Ok. You're going to have to show me exactly what code you're using to get that exception
 
@roganjosh no i copy pasted the same thing
i need this for oracle
 
I understand. I'm trying to look into it now
I've bumped into this suggestion a number of times but I'm not too satisfied with it. I suspect I need to know something about Oracle at this point to know whether or not it's going to reject setting a timeout when creating the engine, or it does in fact, require setting some config params on the database itself.
 
10:48 AM
well i dont have control over the db for one...
is this tweaking the connection driver or the oracle db?
 
The last suggestion appears to be changing the settings of the oracle db itself. I'm struggling to pin this one down for you, sorry. It's probably better for me to leave it to someone that knows that specific db at this point rather than me throwing spaghetti at the wall
 
is this tweaking the connection driver or the oracle db?
t = threading.Timer(timeout,conn.cancel)
t.start()
cursor = conn.cursor()
cursor.execute(query)
res =  cursor.fetchall()
t.cancel()
i think i might go with this for now
 
But that isn't a connection timeout?
 
is a connection thread-safe?
 
that will cancel the request and I can return some json & still be able to handle it
@MisterMiyagi I have 0 idea of what that means - i skipped a lot of classes
 
10:55 AM
Well then you're asking for something different. You want a query timeout, not a connection timeout
 
@Aqua4 Whether it is safe to cancel a connection while the connection is performing a query.
 
well that would be for the DB team to worry about - my application wont be unresponsive then..
 
Lol, this has all been fun
 
@Aqua4 I recommend for you to ask the DB team first.
 
yes
 
11:28 AM
The packet switching is not set in your kernel and will stay after reboot. Lol what is it now, will it stay after reboot or not :D First part makes me think not, second makes me think it will :P
 
11:40 AM
Be warned that closing DB connections doesn't always stop the query running on the server. It depends how/whether the DB engine monitors the connection state during execution.
This can leave you with long-running queries orphaned from any client process and ultimately doomed to fail - but not until they start producing data ...
 
12:00 PM
Anyone know of an existing reference/program that: checks if xpath exists in parsed XML file, if it doesn't - creates a given Tag at that xpath position.
Feels like might have been done before
 
12:55 PM
@holdenweb yes but it wont let my application non-responsive
 
@Aqua4 It will if you end up with dead connections hammering the database
 
You can lead a horse to water ...
 
like a DDOS?
 
Similar. The point I think we're making is that there is a concept of "team" and it's not really a great idea just to pass off a problem to another component of your system just because it then becomes their problem and not yours
 
@Aqua4 Consider that your application will be de-facto unresponsive if the DB itself is unresponsive or even corrupted.
While your app won't block, it will fail to provide results in time.
 
1:03 PM
ok how do i check what is causing the issue
 
You might want to start by clarifying what the issue is.
 
ok my app has this sqlalchmey engine - this is working fine most of the times
sometimes though my query gets stuck - like for 80 minutes
 
And what is the usual response time?
 
but I do get the data - response code 200 - ----- but since its a single instance tornado app, none od the users can access it
avg resp time - 500 ms
now i doubt that the DB mgith be locked due to write ops, indexing etc....
but as i cannot communcate with the DB team, not sure whats causing it
 
Perhaps that's the point at which you should ask the DB guys of your team for input.
What prevents you from communicating with the DB team?
Is the database used exclusively by you, or is it shared with other apps?
 
1:09 PM
shared DB & no idea of who the db team is - my boss said you wanna talk gather some facts
 
But there is a DB team at your company/institution/..., yes? I.e. the DB is in-house?
 
What you could do is set up a timer in another thread that captures any query that doesn't complete in 5 seconds so that you can try and investigate what causes the problem in the first place
Particularly, what variables you're passing. 80 mins vs 500ms is a pretty catastrophic failure, so it might be worth assuming that there's a problem with the parameters that you're passing
 
@Aqua4 wow, that sounds annoying
 
I don't think it's too unreasonable. The database tech is pretty battle-hardened so it'd be unusual if it just randomly crashes on a query
 
@Hakaishin yes, some times it is efficient to just ask for help/advice & say please :D
 
1:18 PM
Do you have subqueries?
 
Sorry, I can't believe this, but I would greatly appreciate some google foo help. How can I check which version of easy-rsa? Contrary to it's name it's not easy and doesn't even have a version command easy-rsa help turns up nothing and I already found that some commands exist but are not shown in the help
 
@roganjosh nah all simple queries & mostly one-liners
we have a like query though
 
@Aqua4 makes it even more suspicious :)
 
and now i have written a python script that will make random queries to DB and log it .....
now my application is stuck on a query but the test script works fine
 
Is there any means to switch on client-side logging for SQLA or whatever driver is behind this?
 
1:23 PM
I agree with your boss that you could be collecting data on your end before raising it with the db team. It's a bit poop that you can't just spin round on your chair and ask the guy behind you, but it's not much different than trying to turn the router off and on again before you have to battle some standardised responses from the admin guys
 
this is the SQLA i have used a measure-time function to log time
 
@roganjosh IME, doing those steps first doesn't change the insistence on doing it again from tech support, even in-house.
 
Sure, but, in my case, it gives me a platform to start gesticulating (even if they can't see it) and enforcing my tone earlier on, if I have the evidence :P
Or, alternatively, you would find that the problem is on your end in the first place and never have to go through the fuss
 
1:46 PM
wow I have the arctic code batch, even though I didn't do anything. I'm kinda happy, but also sad to see it devalued, because the batch is a really cool idea
 
Today's pet-peeve; someone that continually replies to my comments as though I was the OP, even after I tell them that I'm not
 
Is this a sufficient dupe-target for this?
 
2:14 PM
In an ideal world :)
 
@Aqua4 Have you verified that you actually close all database connections? Stabbing about in the dark I wonder if there's any possibility that the number of available DB connections at the server end might be a problem.
 
2:52 PM
@holdenweb no, that may not be the issue
 
It seems pretty a pretty compelling avenue to explore. You've not provided any evidence to the substantiate the "no" so I think we've run out of runway to help you on this one
 
I'm sure it's the network. :P
 
I'd be on to my ISP! (if I currently had one)
 
It's probably due to IPv6. Or quantum.
p-value 0.95
 
That's good, right? <Shoos away the Statisticians - "Do I look like I need help?!">
 
3:03 PM
It's probably good. (Confidence in guess: p-value 0.95)
 
p-value 0.95 - reminds me of the ML course :p
 
Insisting on a p-value seems like the statisticians' version of little kids asking "Why?"
 
thanks for the help guys, will check tomorrow
 
@Aqua4 That may explain why you've discarded holdenweb's suggestion without evidence. I think it's the best suggestion so far
 
I feel like there ought to be a way to terminate unresponsive queries without using a thread timer. Does pymysql (or whatever db library you're using) not have native timeout control?
 
3:09 PM
They're using Oracle
 
Oracle is terrible in all ways, so that's compelling evidence that they didn't think to implement timeouts in their api
 
Hm, does someone know if there is a general term for algorithms that do not recurse into self-recursive input?
E.g. repr(a) for a = a[0] = [1]?
 
.. sane?
 
I realise now that technically I was asking for that. :P
 
checking out right away, I got nothing except lame jokes on this topic
 
3:21 PM
Reason I'm asking is that I know the problem is decently-hard for parsing left-recursive grammars, and just stumbled over a similar issue with solving type constraints of recursive types.
 
I've had an open issue on the KevinScript repo for a year or two for the exact problem of [[...]] recursing forever if you print it
 
Did you solve it with SCIENCE!!!?
 
I believe CPython solves this with a global-ish stack of "objects that are calling repr right now", and if an object appears twice in the stack, it skips calling it a second time and just returns "..."
When I get around to solving it in KS, I'll probably do the same thing
In any case I don't know if there's a general term for this kind of problem
 
3:42 PM
github.com/python/cpython/blob/… is where the "..." replacement occurs
(For tuples)
 
Of course, the well-known Py_ReprEnter algorithm...
Also, challenge accepted. "This should only be possible within a type."
 
Hmm, I wonder if it's possible to view the contents of PyThreadState_GetDict() from inside a Python program... It would be fun to see the repr object stack
 
I assume it is what underlies threading.local. Not sure if you can force a key clash.
 
... And TIL that reprlib is a thing if you too wish to guard against infinite recursion in your own custom classes' reprs
Too bad I can't hook this directly up to the KS type hierarchy ;_;
I can write one myself easily enough... But first I have to implement a dict type
Before I do that, I have to implement a hashing algorithm... I'm remembering why I neglected this issue for two years.
 
3:58 PM
FWIW, for many cases a linear search is faster than a proper hashtable. So implementing a dict based on two aligned arrays should be feasible.
 
My brain does not react well to problems with a variety of solutions whose quality scales logarithmicly with the time invested
I could spend an hour making a janky yet serviceable hash algo... Or, I could devote my entire life to the task, and make one that's twice as efficient as that
Two aligned arrays would be a cromulent approach. If I'm dying to implement some cool feature but I have to knock out dicts first, I'll probably go with that
 
 
1 hour later…
5:03 PM
@Kevin reprlib! Who knew??!! I may be able to delete dozens of lines from pyparsing
 
What a savings!
 
It's a linesaver!
 
5:29 PM
The ones I have in mind are especially ugly, so its about quality not quantity. (Actually, if I need to subclass reprlib.Repr it may not be a net reduction, but I am still hopeful for an overall improvement.)
 
5:45 PM
@PaulMcG The easiest code to maintain is code that's been deleted.
6
 
 
2 hours later…
7:19 PM
 
13 lines collapsed down to 7, using reprlib.recursive_repr decorator for the Forward class. (Could have been just 3 lines, but black reformatted my return statement to span 5 lines instead of just 1.) Turns out the original code wasn't that ugly, much of the real ugly parts (like assignment to self.__class__ to deflect infinite recursion) was already refactored out a couple of months ago.
 
8:04 PM
Hello, is there a nicer alterntative to b'%d'%i or str(i).encode() where i is an int?
 
There's using "{}".format(i).encode() or f"{i}".encode(), but what else did you have in mind? (Btw, not putting spaces around '%' in your first option makes it surprisingly difficult to read - please don't skimp on whitespace for readability.)
In fact, isn't there something like bf"{i}" to do an f-string with bytes?
No, I'm thinking of rf"..." raw f-strings.
Testing, 1, 2... Is this thing on?
@purefanatic were you actually interested in getting help on this?
 
8:25 PM
I normally don't ask just to annoy people so yes ;-)
 
Well, there you go with two more options. As I asked before, was there something specific you had in mind?
 
There are no bf"" strings I think (which is regrettable). I just wanted to know if there is a simpler way or if not, what would be the most preferred. My specific case is actually a little different, I have str((1,2,3)).encode()
 
Well, f-strings are the new hotness, so you will not find many to complain if you used them. I personally am more of a "".format() guy. But just using str(something).encode() seems pretty straightforward. There is not much point to doing "{}".format(some_var) when you can just do str(some_var).
 
8:47 PM
"new" ;) (3.5 years old)
 
Ok I think I'll just use str(i).encode(), it's probably the nicest. Thanks!
 
@AndrasDeak ...and next month, in 4 versions of python.
 
 
2 hours later…
user13949481
10:44 PM
Hey everyone thought chat might help
 
user13949481
So Im stuck in this for like 12 days and still no solution
 
user13949481
Can anyone help me out here: stackoverflow.com/questions/63513587/…
 

« first day (3609 days earlier)      last day (1336 days later) »