« first day (4064 days earlier)      last day (867 days later) » 

7:09 AM
sopython doesn't seem to have a good canonical for "you forgot to .close() your file", my search fu is failing me badly, any suggestions for what to link to?
 
hm. could bypass the issue with a with answer, but im having a hard time finding something specific to "you forgot to close".
 
me too, which is confounding as this must be a very common FAQ
 
something really old that may fit in: essentially it answers "why close" which may be good enough
 
7:29 AM
@ParitoshSingh yup, good enough for me, thanks
 
8:20 AM
cbg
"Couldn't find closest foo. This should never happen. If it did, it's a bug!" What a start into the day :D
 
@MisterMiyagi hmm, a bit obscure to my mind for a canonical, but arguably part of the same cluster of near-duplicates
 
 
3 hours later…
11:07 AM
Just wanted to know from people here, how well you are aware with cudf and cuml ?
 
11:32 AM
I had to google both.
 
Same :D
 
cudf is amazing :O
 
Okay, Miyagi and Siv do you have some experience in machine learning ? Just wanted to know if you guys have experience in ML but not in cudf,cuml
 
11:47 AM
Yes, I have, mostly in NLP field but I haven't had the time to play with GPU ML libraries
 
It's complicated.
 
 
1 hour later…
12:52 PM
Does anyone know if Popen.communicate() can hang if the data exceeds the max size of the pipe?
The stdin pipe, specifically
 
If the subprocess is not prepared to read the data properly, then yes.
But the size is only for the buffer, not the total data. You can send arbitrary much data over stdin, regardless of buffer size.
 
But if I do process.stdin.write(some_data_that_exceeds_the_buffer_size) it will hang, right?
 
It will wait until process has read enough of the stream so that the rest fits into the buffer.
 
1:07 PM
Alright, then my problem is somewhere else
 
Are you sure the process is reading properly? Many programs behave wrong when not attached to a TTY.
 
I'm not sure of anything, really. What I know is this: The program works on my PC, but hangs(?) on someone else's. I also know my PC is significantly faster than theirs, and even mine takes a while to run the program, so... there's a good chance they simply have to wait half an hour for it to complete
 
Rubber Duck says "drink a coffee".
 
1:37 PM
hi
 
I don't suppose you could send the huge data to the subprocess via something other than stdin? For example, perhaps there's a --get_data_from=filename command line argument.
 
I'm specifically writing it directly to stdin to avoid the slow roundtrip via the HDD :P
I'm reasonably sure that the program doesn't really hang, so I'll just focus on speeding it up. It's doing a bunch of image operations without numpy... and OCR on top of that
 
Ah, I wondered whether disk I/O was an issue
Perhaps you could put together an HDD-using prototype just to see if that also hangs(?)
 
image operations in pure python? or what's being used
 
Stuff like looping over a row of a Pil.PixelAccess object to check if any pixels are blue
@Kevin Hmm, that's not a bad idea. I'll do that if the slightly-improved version I sent them turns out to have the same problem
 
1:52 PM
@ParitoshSingh it will take minutes. I did this once for a course, it was awfully slow
 
yeah, i was gonna say, i'd strongly recommend using numpy or opencv or some other imaging library, and resisting the urge to use pure python. it would be a miserable time
 
It is a miserable time. :P
 
I have hand-crafted pixels with PIL in a couple dozen projects, and I'd say "slow" is a valid descriptor
But as the info box at pillow.readthedocs.io/en/stable/reference/… says, sometimes there are faster approaches
 
Welp, I just realized that all the numpy knowledge I've acquired during my last image manipulation project has already evaporated into thin air. Can't even split an image into red + green + blue channels without googling how
 
I forget how PIL works every time, if that consoles you
"ImageDraw is where the drawing stuff is" is the only thing I'm sure of
 
2:11 PM
@Aran-Fey now imagine teaching it. I do it every 6 months, by that time I forgot 90% so I have to prepare every time the same stuff :D
 
I'd rather have a teacher that relearns the material from zero every semester, than one that can recite the textbook backwards and assumes everyone else can too
 
I had a teacher who learned (not *re-*learned) the material during class
 
@Aran-Fey guilty as charged :D
 
I think all of my classmates went on to choose careers outside of the IT field, but I can't say if that's the teacher's fault or just the fickleness of high school students
 
I often experience the teaccher side of that whenever someone in here asks about a library I've never used
 
2:20 PM
Quick q: Anyone know how to get all the blue guys to the second column? Trying to use subplots.
 
If I'm lucky, I can stay one step ahead of them and maybe set off some land mines while they're outside the blast radius
 
@rb3652 or reorder :P
@rb3652 use zip + flatten :D
then swear when you have 3
 
@AnttiHaapala Yeah, I guess I can just reorder
 
there are good, bad and ugly libraries for Python
 
If I'm unlucky, I'm 1+ steps behind the asker, and all they get is a hearty chuckle at the clown that thinks he can learn fastAPI in five minutes
Fortunately, both epistemology and clownery are among my special interests, so I'm getting good practice in either way
 
2:28 PM
@Kevin learning fastapi in 5 minutes, I do not think anyone knows everything about it
 
I don't need to know everything, I just want people to think I do
 
this was criticism of the FastAPI,
meaning that not even the main author understands how it works (or rather, doesn't)
 
Ah, the old "fast, cheap, good: choose two" trilemma
Perhaps "choose one" instead if the "Fast" in the title is just marketing fluff
 
2:48 PM
Fast at finding out how terribad the choice that was made
 
I got from "library installed" to "Hello World is visible on screen" in about 20 seconds, so I can't be 100% dismissive of it
 
# foo only supported in version 1
if version == 2:
    import foo
and importing foo fails. Who to trust the comment or the code...
 
I'll go with the code
 
Well, technically they agree that it's broken in version 2.
 
"foo is only supported in version 1. Don't believe me? Here, watch, I'll import it in version 2 and you can watch it crash"
Hakaishin forgot to mention that he's inside the unit test that intentionally triggers all known version incompatibilities
 
3:05 PM
@Kevin lol, I wish
@Kevin the question is, do I trust the comment and try to get it to not import or do I trust the code and try to get it to import :D Or 3rd I file an issue and call it a day :)
lol, I just got an email of an app I use sometimes: "We just disabled passwords for convenience. Now you get a login link per email each time you try to login." That seems like the opposite of convenient for me but oh well, I didn't use the service that often anyways
 
If you want to cover your butt by following the public interface to the letter, trust the comment. If you want code that works, trust your observations of the code's actual behavior. If you want a good excuse for why you're playing Tetris at work, tell your boss you can't do anything else until they fix the issue
 
Well said, I tend to do 2 and 3 in an 80/20 ratio :)
this chat being part of 2 and counting as: "staying up to date on current technological developments xD"
 
But seriously, #3 is a valid choice if you replace Tetris with "other, less painful, work"
 
The problem is, our issue tracker has only painful work it goes from horrendous to less horrendous. For every 10 issues there is 1 which is actually solvable, and we have around 30 issues. So it's a few tasks until the horror
 
Relatable :-(
Come to think of it, I haven't seen my workplace's eternally reocurring task, "can we make the database faster?", in a while.
 
3:22 PM
ah yes, make x faster is an all time lowest prio task :D Funnily enough it's one of the more doable ones probably and one which I will tackle soon
 
"Let me check... Nope, science still hasn't invented an O(log(N)) algorithm for sorting a list, so let's push this back another month"
 
@Kevin Depends on the list (rather, the data type stored in the list).
 
I can shave off a couple milliseconds here and there by grepping for "//this could be more efficient, but the schedule is too tight right now" but that won't do anything to the biggest of my big O complexities
 
And also I suppose what's considered an "operation" for your O() measurement.
 
For the sake of the argument, I'll say that any occurrence of the_list[some_index] counts as an operation. Regardless of whether it's on the left hand side of an assignment statement, or anywhere else
 
3:28 PM
At least looking at each element will be O(n) total, so...
 
I'm curious what data types you have in mind that could have neat optimizations. Maybe something with finite-sized unsigned ints...
 
If you're sorting something like integers, and your operation is "compare two integers from the list", you can get a O(0) by using a dictionary of integer:count, and spitting out the list by iterating the range and outputting the number of instances of each int. Counting array read/writes, that's O(2N)
If you're feeling a bit snarky, you can swap 'iterate the range' with 'sort the keys' :-)
 
"Iterate the range" is a valid approach, that's what I had in mind when I mentioned finite sized integers. Won't work on Python's unlimited-size integers, but nobody said it had to
 
You can find the maximum value in O(n) as well, so in principle it's all O(n)'ish.
 
in the worst case scenario, "sort the keys" is as expensive as sorting the original list, plus a bit of overhead that doesn't influence the final big O result
 
3:35 PM
Just ignore the O(k) part where k is the maximum value.
 
I can't see you all the way up there, I was thinking more of remove sleeps which somebody forgot to take out after testing something silly :D
And don't foozle stuff to 5steps later unfoozle it :D
 
Hard mode: make it work for numbers of an uncountable set, like the reals.
 
@Kevin Just get me infinite time and space, then I'll be all set.
 
Keeping in mind that floats are a countable set wearing a cheap "real number" costume from Spirit of Halloween
I think you'd need not just infinite time, but uncountably infinite time, which is perhaps even harder for me to give you
 
When every range, no matter how small, still contains an infinity of numbers, you're in trouble.
 
3:48 PM
You could sort* a list of rationals, since rationals have the same cardinality as integers. (*as long as your ordering criteria is derived from a rational-to-integer bijection)
I don't think there's any bijection that preserves the ordinary relative order of rationals, so the result won't be pretty. But it will be consistent!
 
In general, I don't think so either. For a given set of rationals, you could just find the LCM of the denominators and multiply it out into integers, but at that point you're better off with just using Quicksort or Timsort or something.
 
Yeah I don't think I can unseat those kings easily
 
Is poetry any good? jetbrains just send me an email mentioning it. Also is there some mechanism which prevents somebody gobbling up the whole pypi namespace?
 
I work with poetry everyday, it's great. I had no issues using it. You can also specify private repository if don't want to use pypi.
 
4:03 PM
I know for sure that pypi's EULA says they reserve the right to remove your project and/or blacklist you. So any gobbling that might occur can be reversed, eventually.
 
hey guys anybody know how I can convert a string like this `Full-time` to this 'Full_time' in Django?
I want to use the Django built-in templates and filters
 
@Kevin I assumed so, but I guess there is no automatism then
@S.Code 1. Change it in the backend if it comes from there, 2. change it in the html, 3. use djangos translations feature
I would not recommend using filters for this, but you have to elaborate a bit more on your use case
 
That's what I'm trying to figure out now. I've never done it before, but I think registering a name on pypi is automatic. So you could, in principle, gobble up some fraction of the pypi namespace before someone/something notices you're being naughty
It might take a while if pypi has a "one register action per account per day" limit that I don't know about, though
 
yeah, poetry publish foo seems very simple, Run that in a for loop and you got your simple dos. It sounds too easy to be true
@Kevin must have, otherwise we would have already read about it on the news
 
Well, fire up ten proxies and a puppet account, and see how far you can get :-P
 
4:10 PM
@Hakaishin do you know what the translator could look like or if you know any built-in template for this?
 
I know nothing about Django, but it's pretty easy to convert hyphens into underscores with regular string operations, such as x = x.replace("-", "_")
Perhaps you already know this, but you're working inside some kind of environment where you can't use arbitrary Python expressions. For example, I'm guessing the Django template language doesn't give you full Python power.
 
 
3 hours later…
6:47 PM
My experiments with recursive curves continues.
I'm approaching things from the other end this time, starting with an obviously not recursive function f, and then defining a series of functions that converges towards my goal. The shape is approximately right, in the neighborhood of "a symmetrical bump with maximum Y value 1ish at X value 0". I think the final result won't be as fat as these.
I've been pushing the b slider around for 20 minutes, trying to see if there's a value that's more "interesting" than the others. If I go above 1.17 or so, then the lower generations appear to develop a little indent at the peak. So maybe there is some unique value of b where no indent forms, even in the one billionth generation.
I was hoping it would be at phi or sqrt(2) or something, but 1.17 doesn't look like any well-known constant that I'm familiar with
 
7:17 PM
I also thought it would be interesting to pick a value of b so that c = b, but I'm 65% sure there's no real solution to b^2 - b + 1 = 0
 
7:35 PM
@Kevin yes, discriminant is 1 - 4 = -3 < 0
that implies that the roots 1/2 +- sqrt(-3)/2 are imaginary
 
I'll add "extend graph into imaginary z plane?" to my wall of red string and sticky notes
 
8:26 PM
It's hard to tell whether I'm lost when I don't know where I'm trying to go
 

« first day (4064 days earlier)      last day (867 days later) »