« first day (2900 days earlier)      last day (2273 days later) » 
05:00 - 19:0019:00 - 00:00

05:33
Hi guys
anyone here is working with PyQt
 
1 hour later…
07:01
cbg-ning
07:31
cabbage
cbg
07:57
hi
08:28
cbg
no English here
Sorry?
finally someone reply
i need some help with python
We're pretty attentive to what people are asking in here. If nobody has responded it's probably because they're not familiar with PyQt. I'm certainly not.
Don't take silence as a sign nobody is reading your question :)
If you have a more general question, I may be able to help
first : thanks a lot for your response
second i'm trying to use python to send data over the COM port
i could list all the serial ports on my Pc
i could select one port and open it
but i can't send data
08:37
What library are you using?
Pyserial
Do you have a minimal example? What exactly happens when you run your code? Do you get an exception?
no , it works , but i receive nothing on the other side
import serial
import serial.tools.list_ports as port_list
ser = serial.Serial()
ser.baudrate = 9600
this is how i start it
ser.write(constant.START_BYTE)
and this is how i send the byte
I'm not familiar with this library, but don't you need to set a port?
i already set the port in between
let me give you how i set it
08:44
And you need to open it?
    if ser.is_open == False:
        ser.open()
I'm not sure what to suggest sorry, the closest I've come to this is Modbus. Without experience with the library, I think I'm at a dead end
anyway , thanks for your disscuession
09:04
Apologies for the screenshot, I'm on a remote connection and copy/paste isn't working. But how it is possible to get a traceback that doesn't report a single line of my own code? Even following through the other exceptions, I can't see my calling code postimg.cc/K3rrJHzX
Good question
It looks like requests is using a thread pool and somehow it seems to be detached from my calling code. Unfortunately, I make multiple requests in that script and I don't know which one is failing
mmm, looks like it's being thrown by a ReadTimeout and I hadn't handled that case, the traceback in that case is a bit wonky but at least I can now fix it :)
09:38
Is there a way to generate a requirements.txt from an uninstalled wheel?
All the tools i run into seem to assume that the thing is installed and do little more than just pip freeze
10:05
hei! hello, I have a problem with Numpy: I have a z=np.ndarray((500,10)) and I have a numpy array i of shape (500,) that I want to use as indices for the rows of z. In particular, I want to access the first row of z with the first element of i, the second row of z with the second element of i and so on. Then I want to set those element to 0. Do you know the correct expression?
@francescop z[np.arange(z.shape[0]), i]
or just range instead of np.arange
ok I try it :)
I'm not 100% sure so do let me know if it's wrong
yes that's correct @AndrasDeak
great :)
10:07
thank you :)
no problem
So I'm supposed to come up with a project using Django for a software development course in Universe(2 month Project). I'm not sure as to what to go about doing. Look for ideas. Could anyone give me a few good suggestions?
Do you have Django experience?
No
That's what makes it harder to decide.
It also means it needs to be scoped sensibly because Django is pretty huge
10:13
Houston, we've had a problem here
however, no matter the input error in the data I am giving it, the error in the result stays the same
experience with that?
my code is:
the data I am reading in is this:
10:32
solved it, needed: "absolute_sigma=True"
10:53
stackoverflow.com/questions/52477564/… too broad or anything. 12 downvotes, one silly answer but still not closed :/
Huh, it descended into a swearing and slagging match
11:27
*waves black hand*
I don't know if there are now-deleted comments but the top one doesn't have the right tone as first comment
I got to use our shiny new flags :)
It's interesting that the instigator has on their profile that their startup failed due to public relations issuee
unless my math is off they're 20 years old
And yup, the comments were deleted almost immediately after I flagged them
@AndrasDeak you've got an off-by-ten error there nvm, I'm going back to bed
>>> 2018 - 1998
20
it's not just me
hehe
11:34
good night
sleep tight
11:50
Another LPTHW: stackoverflow.com/questions/52478662/… - although admittedly it doesn't quite seem as "strange" as a lot of exercises...
So... I went for a full scale test due to a peculiar annoying bug I had: where an application on a server (backgrounprocess) would just hang after running for 3-5 days. Without any error nor large memory footprint, yet kept using (very little) cpu and just sitting there. (If I didn't know better I would think this is due to a race condition).
Now after more than a week testing the same application, with the only difference it being not ran inside alpine linux but just ubuntu works smoothly without any problem at all.
Th reason I didn't test on alpine linux is due to the lack of debugging tools there.
How was the process run? Properly disowned from the originating shell?
odds are chat.stackexchange.com/rooms/info/118/root-access or some similar generic programming chat can be more helpful
from a nodejs server process
then JS room? :P
it's the python process, the nodejs runs just fine
12:14
I've got an ordered list of floats, and a single float x. I'd like to find the float in the list that is closest to x. I can do this with bisection, but is there a more efficient solution?
Perhaps you could try running it in pdb? Then check on it after those 3-5 days and see where it's sitting
@Kevin more efficient than O(ln(n)) or what is it?
Maybe if I pre-prepare the list in some way... The list's data stays constant throughout the execution of the program, but x will have ~1500 different values
I don't think I can beat O(ln(n)) for a single lookup, but maybe there's some amortization magic I can invoke over multiple lookups
hmm, can't you do *waves hand* hashing?
I don't undertand how dicts work so fast so I imagine hashing works for everything, from removing oil stains to fixing up deflated tyres
perhaps you could make use of np.searchsorted which isn't really an answer to your question about algorithms, unless "use vectorization" is acceptable
Hmm, maybe
I assume searchsorted basically iterates over a and v in tandem, resulting in O(a+v) time. That might be better than my current approach's O(log(a)*v).
This function is a faster version of the builtin python `bisect.bisect_left`
(``side='left'``) and `bisect.bisect_right` (``side='right'``) functions,
which is also vectorized in the `v` argument.
12:23
Maybe you could split your sorted list into multiple smaller sorted lists with specific bounds? Like one list for all floats between 0 and 10, another list for all floats between 10 and 20, etc. You can instantly find the correct bin for each float with a floor division, and then you only need to bisect the numbers in that specific bin
Ok, then I don't know what its efficiency is.
Oooh something with a nice data structure? Binary search tree or something?
A sorted list is essentially a binary search tree, isn't it?
second case of "I know these things exist but I don't know how they work" in 10 minutes, somewhat discouraging
All of my floats are between 0 and 1, so I can definitely bin them. But I don't expect it to be much faster, since then I'm switching out binary search for N-ary search, where N is the number of bins.
12:25
@Kevin some links in the online doc docs.scipy.org/doc/numpy/reference/generated/…
OK, I wasn't being completely unreasonable en.wikipedia.org/wiki/…
does pdb work in alpine linux?
using the generic "gdb" didn't give me any information at all, since it couldn't read anything.
@AndrasDeak That it is small, but I've found that lots of packages are not available (like python3 debug symbols for dbg).
> You can use GDB to debug programs written in C, C++, and Modula-2. Fortran support will be added when a GNU Fortran compiler is ready.
I'm not very surprised that gdb couldn't work with your python code
12:47
In order to populate my model, I have to parse 17 different Excel files. They've just given me the data for next year and they've changed the format of all the different sheets. At this point I just want to sit in a corner and cry.
Don't cry. Just find a new job.
I'm too invested now, it's the biggest project I've ever built by far. But this lack of database is crippling.
"The database is crippling" alright. As in "the database that is roganjosh is crippling" :P
AI-driven logistics
Well, either create a standard excel format and ask them to adhere to that, or propose a database solution.
Hmm, I guess it's not artificial. NI?
12:51
(It might not be as easy, but sometimes doesn't hurt to ask)
It's a nightmare, I'm trying to get them to acknowledge just how bad this situation is going to be when the main systems guy retires
Literally one person who knows how a 30 yr old system works, and runs literally the entire company
What could go wrong?
Everything.
:-p
Cabbage
cbg Paul, long time no see
12:53
I almost burst out laughing when I first saw them using the system on a projector. "This can't be happening".
Life is slowly returning to normal, post-house remodel + extended vacation
That is, we remodeled our house, and now we are post-that; we didn't remodel a post-house...
Talking about everything going wrong, I came across this a couple of days back - twitter.com/MalwareJake/status/1042904367299547137
> This is one of the most eggregious data breaches ever and highlights #supplyChain risk. Vendor stops paying rent, warehouse seizes servers and sells them (with data) unaltered. Millions of records, including plaintext passwords, already sold. Wow.
all that to be able to tell your users "your password is too similar to your previous password"
This is the exact Cloudera use case, I believe
@PaulMcG nice, glad to hear you're post now
13:11
Just about got pyparsing moved over from SF to GitHub - only took me 18 months of nailbiting before getting help - sometimes you can be dependent on the kindness of strangers
One interesting insight I got was in some critique of my unit tests, which were described as overly complex, as the user was looking for some pretty basic API call-response tests.
Then I realized he was actually looking at them from an instructional perspective, as an alternative to wading through my unorganized examples directory.
"Unit tests as intro docs" was something I'd not thought of before
So rather than rewrite/replace my current complicated unit tests, I started a second script: github.com/pyparsing/pyparsing/blob/master/simple_unit_tests.py
Anyone with more db-related eloquence than me might like to take a minute to explain to the OP of How to Force Python 3 to Output String Using Single Quotes? that he should not be executing statements by writing them to a file first
Something of the form "why not just use [straightforward query-executing function]?" would work
\o cbg
Chrome updated and now I feel the browser might be displaying pages a bit brighter. Not 100% certain though, maybe I'm going crazy
13:40
cbg
@vaultah yeah, that's making the rounds on our office slack this morning
stackoverflow.com/questions/52480706/… no repro: OP failed to convert days to years correctly.
14:08
On a recent question, I asked for an MCVE despite my crystal ball showing me a very clear picture of what the problem was, and which turned out to be right. I probably would have gotten more points if I had shot from the hip.
@Kevin Heads up: That OP is the proud owner of multiple user accounts and their question is sitting at a score of -1, so your answer and your rep may disappear at any moment
Conversely, I was asked for an MCVE just yesterday, when I felt that my post of what I had tried (in the absence of a fully runnable example) was sufficient to describe my question.
@roganjosh closed
Oh well. In any case, I have acquired a piece of knowledge that I did not have before. Namely, that calling namedtuple twice with identical arguments won't produce identical types.
In the sense that you can't use those values interchangeably in an isinstance call and expect the same result for both
@shad0w_wa1k3r thanks, shame a needless answer got through within the 10 minute grace but at least we've stopped it getting more :)
14:13
I mean, I probably would have guessed that to be the case anyway, but at least I know for certain now
Probably no different than defining class A, creating an instance a1, then defining class A again, and then testing isinstance(a1, A)
Yeah
namedtuple is figuring prominently in my simple_unit_tests test specification pattern, btw - I'm liking the use of defaults to fill in noop parts of a test.
I like the idea of lightweight declaration of plain-old-data classes, but in practice I just use dicts
Currently annoyed by Python : Operator with pair of values for skip because the behavior of slicing is entirely implementation-dependent and OP didn't mention what the object's type was
I'm off to compose my own Matrix class that deletes your hard drive if you pass it a tuple containing a slice object
14:31
The iris library is built on NumPy so I'd say it's a good shout that it's a numpy array but I don't know why they didn't think to clarify
My first wish from this magic lamp is that all questions about numpy actually get tagged properly
It seems to be getting more common that numpy is just considered base Python and not tagged. At least Pandas stands out a bit more if it's missing the tag
pandas only stands out because if you don't tag pandas on a pandas question, it is unlikely someone will know the answer. :p
untagged numpy questions can, will, and must be destroyed
14:40
i've seen matplotlib related questions only tagged with Python too :p
Followed immediately by numpy answers to general Python questions when csv is sufficient
Answers which dump Pandas in purely for read_csv is something I find distressing
3
"... is something I find de-stressing." IFTFY
Answers with read_csv are fine as long as I can post the exact same answer, except without read_csv, and get exactly as many points
14:56
@PaulMcG long time no see - how goes it?
@piRSquared I don't think pandas purely for reading a csv file is de-stressing -_-
@JonClements - fine thanks, life returning to normalcy
> we will be restoring normality just as soon as we are sure what is normal anyway
DSM
DSM
15:20
Morning cabbage for all.
DSM
DSM
Years ago I tossed off one of those "act on contiguous groups in numpy by using cumulative/diff tricks" answers. We've all done a million of them, and there are a dozen variations of the same basic tricks. Answered it and never thought about it again, because I typically use pandas and not bare numpy, where we have groupby to play with and so things are usually a little easier.
I certainly didn't expect someone would write up a Youtube tutorial on the answer. (?!)
So what's it like to be internet famous?
The inadvertent YouTube star... :)
15:28
DSM this is your ticket to early retirement! :D
Demand a cut of the advertisement profits. You could make dozens of fractions of a cent!
DSM
DSM
Since the Youtuber in question is also using pandas I think he's just making things harder for himself than it needs to be, but I admire the spirit. Plus it's kind of interesting to see how a non-expert looks at the sort of vectorization tricks numpy users do as a matter of course.
He presents it in err.... an "interesting" way :)
15:47
How did you discover that your answer was being used as an example?
DSM knows all that happens on the web, you can thank the many minions DSM "employs"
We could all very well be YouTube mega stars
DSM
DSM
I was trying to find an old answer and Google works better than SO search. It was the second result.
But we'd never know cos we wouldn't be searching those topics because we wrote the answer one them
DSM
DSM
If he hadn't put "DSM" in the title it wouldn't have shown up, so I lucked out there. I have to admit I then spent fifteen minutes trying to see if there were any others, but couldn't find any.
15:49
btw happy Mid-Autumn (Moon) festival for those who are celebrating.
DSM
DSM
mooncakes for everybody!
@DSM I'm pretty sure the rest of us would, too :D
@DSM as long as they're more delicious than the incorrectly named moon pies
which do not hold to the proof
16:06
@DSM Yeah... pretty much the only reason I use SO's search is when looking for deleted posts/urls...
The only times I've intentionally used SO's search just confirmed that I made a mistake.
I will either a) start to ask a question, or b) ask google with site:stackoverflow.com
morning cabbage
Isn't this what type annotations are for
... I can't see the code formatting option in the answer editor from my phone. It's gone from being difficult to impossible to answer :/
I don't see how that's opinionated. Why would you ever verify the arguments outside when you could do it inside? Is code duplication a good thing now?
Maybe not opinionated, but yeah, definitely more about code design. Anyway, being unsure now, I retracted my CV.
In my opinion, you shouldn't do type checking at all
16:42
Well, sometimes "Hey, foo should be a string, not a float" is a more useful error message than "cannot concatenate float to string" or whatever
DSM
DSM
Have I made my prediction that it's going to be only X years before we have standard optional runtime typechecking in CPython?
> chances are is you're guessing
Someone didn't test their article properly before posting :^)
too broad, OP made a mess of the question - stackoverflow.com/questions/52475270/…
How do I say "cull the weak by intentionally emitting confusing error messages" without sounding elitist
17:04
I think that might be the definition of elitist
I'm in packaging hell right now. I'm attempting to build a distribution to be installed via a conda channel. As I run conda-build I run up against name_of_my_module cannot depend on itself I've been looking all through this thing and cannot find where or what is making this happen. Just throwing this out there in the hopes someone as seen something like this.
Listen, just because I think a select group of people with a certain intrinsic quality, high intellect, special skills, or experience are more likely to be constructive to society as a whole, and therefore deserve influence or authority greater than that of others, doesn't mean I'm elitist
a sound plan
DSM
DSM
17:21
Today's lunch: steak marinated in butter chicken sauce. Because it's what I had at hand. Still tasty, though!
Oh, cbg, idjaw!
cbg DSM!
^ the Indian version of chicken fried steak
I need to sports share for a moment, because this is funny in general
@DSM @MooingRawr will appreciate this -> twitter.com/penguins/status/1044256119508660224
It's always a good time when Pennsylvania rivals can laugh at the other.
DSM
DSM
Heh
and this is deserving of a laugh
17:24
Head swimming, I restarted with a fresh environment and problems have evaporated... /sigh
rb folks
long day
Anyone make a cool html5 clock for fun?
o/ @AndyK
DSM
DSM
Rhubarb for AK
@piRSquared hey man
cheers @dsm
many things to learn
got to finish my radio column
see ya tomo
17:38
cbg
If I'm working on a QA, and I post and delete it, will I be able to continue editing it? Do I have to worry about it going away?
no, it will stay (hidden from main Q queue)
I forget the conditions for permadeletion, but I'd expect it to take days
^ ah, I forgot about perma deletion
> Self-deleted posts can be viewed and undeleted by their original authors. However, self-deleted questions cannot be edited by their authors unless undeleted first for spam prevention reasons. Self-deleted answers can be edited by the author without undeleting.
So... If you want to work on and revise a question but don't want it to be public yet, use Notepad.
> Deleted posts are usually not physically deleted (that is, removed from the system); they're just hidden (AKA soft-deleted).
I guess permadeletion only occurs in truly exceptional circumstances, then
17:50
yup
Hmm, bummer that I can't edit, but thanks for the info!
even spam is kept around, the only instance of hard-deletion that I know of is the redaction of sensitive data
meta.stackexchange.com/questions/296101/… explains that if editing-while-deleted were possible, spammers could post a question, delete it, wait for it to fall off the new questions queue, edit it into spam, and undelete it.
Seems a shame that we're denying privileges to good users in order to prevent bad users from having them too
make the suggestion that you've gotta have some amount of rep? 100+ maybe?
spammers might actually get that rep
17:56
I see a lot of upvotes on comments asking "Why not simply have the undelete event bump the question?", which appear to have fallen on deaf ears
I also wonder how prevalent this would be. Do spammers really sit around thinking "how do I make sure that my spam gets the least amount of attention possible?"?
there's a huge amount of spam hitting the network, so some spammers probably will
(yeah, yeah, "they're actually asking 'what's the most amount of attention I can get without drawing the attention of people with the power to remove my post?'". You know what I mean.)
18:13
@idjaw :D ahahahaha I like the comments afterwards "no one will sleep tonight"
Only 1 more week (plus a few days) Oh boy... Vegas has us to win the cup this year! ( I don't think I recall a time that this has happen to us )
Yep, there was definitely a pressing need for a self-answered question about numpy append to empty arrays :/
Why not? Oh right, because it's not actually a good question :P
It's also really inefficient :(
Quick, let me ask a question: "How can I evaluate arbitrary python code in my application?"
it's an anti-pattern
18:24
Self answer: "Use eval"
That's when you learn that SO doesn't let you downvote your own question :D
@AndrasDeak it's a precursor to code bowling :P
How do you code bowl a perfect game?
I really need to learn chat tools beyond mashing my hands at a keyboard to spout opinions :/ Andras will have to find his code bowling example. Trigger warning: it is scary
why hadn't I heard about this before
The gist of the conversation is that Room 6 code golf must obey PEP8, so we're calling that code croquet. Then Andras suggested code bowling
18:29
Mar 8 '14 at 13:41, by thefourtheye
http://meta.wikimedia.org/wiki/Cunningham%27s_Law
thefourtheye ahead of the curve
Hmm how could we get Nedbat here :P
wim
wim
PEP8 gets way more respect than it deserves
@AnttiHaapala Because you're one of today's Lucky 10k?
Cunning ham's law: the cunning ham escapes the sandwich
I don't know if I agree with even half of PEP 8, but I prefer mediocre consistency over the diversity of a million codebases with bold new ideas about what looks good
DSM
DSM
18:33
@AndrasDeak: I step back into the room only to read that
Hmmm, I didn't know there were ill feelings about PEP8
@wim I guess you've never programmed in Javascript, huh? :D
PEP8 is a lovely shade to paint ones bikeshed, FWIW
It becomes an absolute PITA with Pandas
That's just because Pandas is designed for science and science is verbose
until it isn't
and then you wish it was
DSM
DSM
@poke: I'm watching you. ;-)
18:52
anyone have a handy link for problem + regex == two problems?
Or better yet, anyone want to weigh in on:
Thanks, is there any advantage to using the non-regex version vs the regex version? — Alhpa Delta 2 mins ago
unit-test-writing-mood-cabbage
^ as in: Your current state of unit-test-writing is defining your mood? Or: you are in the mood to write unit tests?
he's in the mood that one gets after spending all day writing unit tests
productive and cheerful ;)
hahaha, exactly ;)
wim will tell you that tests are life
I've come to the opinion that regexes are good for a certain category of problem whose complexity lies between "actually, you can do this with ordinary string methods" and "actually, you need to write a full parser"
The "now you have two problems" gag might still apply if you're bad at identifying where those borders are though
they are likely only good for problems involving regularity
18:57
and expressions in which said regularity resides
05:00 - 19:0019:00 - 00:00

« first day (2900 days earlier)      last day (2273 days later) »