« first day (2915 days earlier)      last day (2026 days later) » 
04:00 - 16:0016:00 - 00:00

4:05 AM
cbg
 
 
1 hour later…
5:17 AM
@wim This test case here: ("123456", 4, 2, [("1", "2", "3", "4"), ("3", "4", "5", "6")]) is wrong, isn't it? Shouldn't it yield another chunk with 2 elements ("5", "6") at the end?
 
cbg-ning
 
wim
5:52 AM
@Aran-Fey Hmm. Yep, I guess that would make more sense.
merged! thx :)
 
np
 
wim
v0.6 tagged and pushed to PyPI.
 
am I an open source contributor now?
 
6:24 AM
@wim Python 3.6+ you should perhaps __set_name__ in cached property to make it maximally useful
 
wim
@Aran-Fey yes, I guess. I do actually use chunks in some production code (this change would be deployed to literally thousands of machines all over the world at approx 4:30pm tomorrow, assuming it doesn't break any integration tests)
@AnttiHaapala hm, but what happen on 2.7, it just sits there and doesn't get called?
 
yes :/
first world problems.
I mean, I needed to have a generic lazy property decorator/descriptor for use with property = somethingsomething(ArgumentsThatAreNotAFunctionNameOrAnythingSuch)
the one you have is still correct for a function decorator ofc.
the bad thing is that someone might think that it works properly in the generic case
it works but doesn't cache ;)
 
wim
everywhere I use it is decorator form and I only need the default name, but I'll keep it in mind
also wimpy needs to stay cross-compat for now - it might be worse to having a diverging behaviour, than to just not use the feature at all.
 
yes
it happened to me pre-__set_name__
I had a lazy property decorator that tried to find out the name of the property and cache it on the instance the first time it was used...
... and failed, but it "worked" :D
 
6:50 AM
hey guys, little help here, have a look on my code below

<table>
{% for i in crop_pic: %}
<tr>
<td>
<img src="data:image/png;base64,{{ i }}">
</td>
{% for name in names: %}
<td>
{{ name }}
</td>
{% endfor %}
</tr>
{% endfor %}
</table> Current output

| image1 | ['name1','name2','name3'] |
| image2 | ['name1','name2','name3'] |
| image3 | ['name1','name2','name3'] |
Expecting output

| image1 | name1 |
| image2 | name2 |
| image3 | name3 |
I think it's a small mistake
 
Looks like names is a list of lists? Like [ ['name1','name2','name3'] ]
 
@Aran-Fey it's just a 'list '
 
Huh. That surprises me, but then again I've never used jinja
 
7:18 AM
In retrospect, I probably could've come up with a more interesting puzzle about that mechanic.
 
7:52 AM
recbg
 
8:45 AM
@Aran-Fey "your code here" can redefine the builtin_classes
 
I know, but I can't make it 100% bulletproof without some exec shenanigans, so... everything that's not covered by the assertions is based on the honor system :D
 
The what now?! :P
 
meta-puzzle: Find a way to cheat in this version of the puzzle. I'm sure there's a way to do it ¯\_(ツ)_/¯
 
9:32 AM
Hmm, the latest python3 on Ubuntu is built with an "experimental" GCC. I hope that's not related to my leaks.

Python 3.6.6 (default, Sep 12 2018, 18:26:19)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
 
the experiment failed
 
@OrangeDog not mine... hmm...
ah
behind in updates
 
9:54 AM
@AnttiHaapala what version is your package?
 
you're correct:
Python 3.6.6 (default, Sep 12 2018, 18:26:19)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
now that I ran upgrade :F
let's see...
I wonder how to reproduce
@OrangeDog you might want to try downgrade.
though I doubt it is about the GCC version but it can be something about Python version however.
 
I was trying to downgrade, but the only older package I see is 3.6.5-3, which says the same thing.
Guess I'll build it myself
 
jpp
cbg
 
Hmm, also odd that the package 3.6.5 says it's python 3.6.6
 
jpp
I'm looking for advice on an answer I wrote: stackoverflow.com/a/52693367/9209546. In it, I compare what I believe are "O(n)" and "O(m*n)" solutions. Am I right, or have I got my terminology wrong? There is someone commenting who believes that they are both O(n) and comparable.
 
9:59 AM
my previous was 3.6.5 built with GCC 720
 
@AnttiHaapala but you don't know what the ubuntu package version was?
@AnttiHaapala does apt list -a python3 show it?
 
Hey, lets say I have a class name Car and two child classes named Door and Engine. Is it posible to do something like this: Car.door.open() or Car.engine.start()
(In one line I mean)
 
@jpp you're correct. Unless ofc they happen to have the exact same keys.
 
jpp
@AnttiHaapala, Sure, I'm only talking of the general case. Just wanted to check, I don't have a CS background so I sometimes get terminology stuff wrong. But clearly there's a "1 pass" versus "1 pass times x" thing happening.
 
@AnttiHaapala Aren't both solutions O(n*m)? The defaultdict solution still has 2 loops, so it can't be O(n).
 
10:04 AM
@jpp though, you're correct only with n being the sum(len(d) for d in dicts)
 
jpp
@AnttiHaapala, Exactly, that's my logic
 
hmmhm
the other doesn't actually have n :P
that's the problem :D
 
@Aran-Fey O(2n) == O(n)
 
The only difference I see is that the defaultdict solution's m is the average number of keys in the dics, whereas the dict comprehension's m is the maximum number of keys in the union
 
jpp
Maybe I need to explain it more explicitly. I'm thinking that you are iterate all dicts only once in the first solution. In the second you iterate all dictionaries m times, where m is the number of unique keys.
 
10:07 AM
the thing is there are 3 variables: n is the sum of sizes of dictionaries, m is the size of the set of keys, and k the number of dictionaries.
 
@jpp a list of unique keys is not an input though
 
jpp
I see, so is that where I'm going wrong. Complexity can only be calculated from raw inputs?
 
the defaultdict solution is O(n) and the other solution is O(mk). However it is so that n <= mk.
 
@jpp Well, that's not wrong, but you're confusing yourself because the loops are swapped in the two solutions. The first solution only iterates over the dicts once, yes, but it still does m operations per dict.
 
jpp
I can I believe say, "One solution requires iterating all dictionaries once. The second requires iterating all dictionaries for x number of times, where x is the length of union of keys."
 
10:09 AM
Basically the first solution is like n*m whereas the 2nd one is m*n
 
@Aran-Fey you're incorrect.
 
jpp
OK, I'm thinking my explanation will nail it and I can remove all reference to complexity
 
you can use the complexity but you must define what the names mean
you cannot take n and n and define them differently.
also number of dictionaries does not matter one single bit to the actual complexity in the first case, so it is not the relevant variable there
 
huh? Then what is the relevant variable?
 
In complexity notation n is the size of "the input". Unless you can demonstrate that you have multiple unrelated inputs that can grow independently, then don't try adding multiple variables.
 
10:11 AM
(weil it does, in degenerate cases but no one is interested)
@Aran-Fey number of elements
 
@AnttiHaapala I'm interested. Go on.
 
@AndrasDeak if you merge 100000000000000 empty dictionaries say.
if you're interested in the behaviour with 1000000000000000 empty dictionaries then you're an idiot.
 
Indeed, you probably jyst need to look at O(n) where n is the total number of elements in all the dictionaries being merged.
 
but that's the point
 
@AnttiHaapala I do that all the time
 
10:13 AM
in the other part there is no n
 
@AnttiHaapala But if you define n as "number of elements" then you can't compare the two solutions at all. "number of elements" is not a factor in the dict comprehension solution
 
@AndrasDeak you mean "am that" :D
 
Hehe
 
@Aran-Fey of course I can
5 mins ago, by Antti Haapala
the defaultdict solution is O(n) and the other solution is O(mk). However it is so that n <= mk.
now you need to prove why n<= mk
 
Ok, fair enough
 
10:14 AM
without further constraints that's inconclusive
If n«mk the former is less complex, otherwise same complexity
 
of course it is not inconclusive
 
jpp
There's a lot of confusion here, surely this has come up on CS SE or similar? I think ,more than anything, it's a terminology thing.. (we all understand what's being iterated), but in a way terminology is important to avoid misinterpretation.
 
the number of unique keys multiplied by number of dictionaries must be greater or equal to the number of keys in total.
 
One is O(1) for the number of dictionaries, the other is O(1) for the number of elements.
 
each dictionary has unique keys only.
 
10:16 AM
"Which is better" is not a question of complexity at all.
 
so the smallest case is that each dictionary has duplicate keys with each other.
and then you get n == mk
 
@AnttiHaapala that's fine, but O(n) with prefactor 10 vs O(mk) with prefactor 1 when n=mk/2, etc
 
yes... that's a different thing.
 
It's not
 
it is.
 
10:17 AM
Such a high level discussion going on here :D
 
We can only argue complexity, and right now they seem equally complex unless n«mk
 
in there defaultdict solution wins by a) being clearer, b) having lower factors.
and that in addition to it always being smaller or equal complexity
 
and...
 
Whether n«mk is irrelevant to complexity. They are both O(n). Which one is better has nothing to do with complexity.
 
10:18 AM
in addition, if you really cared about the complexity you'd not be using dictionaries whasoever
@OrangeDog but they're not.
 
jpp
@OrangeDog, OK, so it's one-pass versus multiple-pass? Is that better wording?
 
@AnttiHaapala but they are, unless one of m and k is dependent on the other, in which case that one's O(n^2)
complexity tells you nothing about how fast something is, only how its resource usage grows as the input tends to infinity
 
@OrangeDog you're completely wrong.
% python foop.py
0.005053043365478516
1.8899145126342773
 
@AnttiHaapala how so?
 
10:22 AM
how so^ the numbers above.
one is N and other is MK. And I chose them so that N << MK.
 
jpp
I agree complexity is not performance. It's possible for O(n**2) to beat O(n) if your O(n) process is much less efficient.
 
namely
 
and how does that prove anything about complexity?
 
list_of_dictionaries = [{} for i in range(10000)]
list_of_dictionaries.append(dict.fromkeys(range(10000)))
 
@OrangeDog if n=O((mk)^l) with l<1 it matters
 
10:24 AM
sec :P
 
It all depends on what what your asymptotics are like
 
@jpp or if the n for one is 1 and is 10000 for the other
 
1000
5.76019287109375e-07
2.7431488037109374e-05
10000
6.260156631469727e-07
0.000199550199508667
one scales constant(ish) with n, the other doesn't.
 
jpp
@OrangeDog, Or vice versa :)
 
@AnttiHaapala you're using different ns
 
10:26 AM
no.
 
One is O(n) number of elements, the other is O(n) number of dictionaries
 
I am using the same n. Here n is displayed. and n == m == k :P
 
You need a whole lot more than 2 datapoints to distinguish
 
of course I don't
 
of course you do - how can you possibly distinguish "constantish" from 0.0002n with two points?
 
10:29 AM
1
7.152557373046875e-06
6.9141387939453125e-06
10
1.0251998901367187e-06
1.430511474609375e-06
100
6.580352783203124e-07
3.7860870361328127e-06
1000
5.445480346679687e-07
2.648162841796875e-05
that's interesting that which happens at 10, I can't explain that :D
 
Random noise, because you're measuring such tiny intervals
 
yes. that's true.
100
0.000000581741
0.000003461838
1000
0.000000575304
0.000025741100
10000
0.000000443530
0.000201890540
what a work to convince one stubborn dog :D
 
Why does the first one get faster as the n increases...?
 
come back when you've got them up to 100 seconds
 
idk... :D
@OrangeDog it is normalized time per n you stubborn dog.
 
10:33 AM
Because you're increasing the wrong n, and it gets faster due to branch prediction etc?
 
ok I am out.
you win.
 
You just can't prove complexity with a few numbers, especially if nobody audits your code. You prove complexity with formal logic.
 
Branch prediction in Python?
When did it become a thing
 
Branch prediction is in the CPU
 
this disproves the
19 mins ago, by OrangeDog
Whether n«mk is irrelevant to complexity. They are both O(n). Which one is better has nothing to do with complexity.
 
10:38 AM
can't argue with Luke
 
that's how you got those timing results? Now the strange output doesn't surprise me any more...
 
Yeah, that's really bad code
 
oh it's not even timeit :D
how about perf_counter at least?
 
I am lazy
can't bother firing pycharm
the problem is just that I actually needed to write the code to prove my formal analysis.
 
And yes, you're using the same n for each algorithm, instead of the one they're actually O(n) for.
 
10:40 AM
of course I am using the same n.
 
I'm with Antti on this one; you can't compare complexity with respect to different ns
 
what do you want me to use, mk, same result.
 
at least assuming that complexities are to be compared
 
well I already said that if n is number of elements, one is O(n) and the other is O(1)
 
(except that the per mk is of course different but doesn't change the fact that one is better w.r.t. that)
number of what? :D
 
10:42 AM
unless there's a common parameter to check scaling by we're just comparing apples and oranges
 
this all started from the fact that jpp was using n for 2 different things, and I said that there are parameters n, m and k, and no matter what, n <= mk and the other's complexity is O(mk) instead of O(n).
 
if someone says the complexity of an algorithm is O(n) that means n is whatever variable causes it to grow the fastest
so both are O(n) algorithms, which is true
 
argh.
that's bs.
 
and their relative performance has nothing to do with their complexity, which is also true
so obsessing over trying to compare them with a single complexity class (as was the original question) is pointless
 
jpp
Can we agree on one thing without talking about complexity / performance.. defaultdict solution iterates all dictionaries once; dict comprehension iterates all dictionaries a certain number of times >= 1 ?
 
10:45 AM
@jpp we can agree that is a description of what they do, which is relevant to their performance. Just don't mention big-O complexity.
 
I'm sure we can agree on that, but that information is pretty useless
 
I can say "Sorting with timsort is O(n) since I define n as the (m log(2))/W(m log(2)) wolframalpha.com/input/?i=inverse+of+(n+*+log2(n)) where m is the number of elements.
 
jpp
@Aran-Fey, That information is useless. how so?
 
@AnttiHaapala no you cannot, because n has to be the input size, not a value derived from the input size
 
OMNEG.
 
10:48 AM
though, that does complicate a lot of traditional complexity questions, because you have to work out whether the "input size" for a number is its value, or the number of bits to represent it.
 
@jpp Just because the dictionaries are being iterated exactly once, that doesn't mean your time complexity is O(n). You're forgetting to account for everything that happens inside that loop. Basically the first solution is like this:
for dic in dictionaries:
    for x in something_else:
        ...
And the comprehension is like this:
for x in something_else:
    for dic in dictionaries:
        ...
The complexity is the same in both, even though the first one only iterates over the dictionaries once
 
@Aran-Fey ... which was established a long time ago.
 
in TM questions it's the number of bits (so you have a log in there), but for actual computers the size on an int is fixed, so you'd usually use its value instead
 
except the latter...
36 mins ago, by Antti Haapala
5 mins ago, by Antti Haapala
the defaultdict solution is O(n) and the other solution is O(mk). However it is so that n <= mk.
 
That's different. Our n here is the number of dictionaries.
 
10:50 AM
@Aran-Fey no it isn't.
that's not where the complexity comes from
 
I know, I get it. But I think jpp is misunderstanding it, and I'm trying to explain
 
jpp
@Aran-Fey, Ok, I get what you're saying now
it's not a complexity thing.. you're iterating in a different order. fine.. I still disagree that the description of what's happening is irrelevant.
 
Well, it's missing an important piece of information, so you can't really draw any conclusions
 
n = sum(map(len, list_of_dictionaries))
m = len(set().union(*list_of_dictionaries))
k = len(list_of_dictionaries)
 
jpp
Iterating views (which is implied by iterating all dictionaries once, in this case), is better than extracting keys sequentially from each dict.
 
10:55 AM
these are the variables. If you think in the terms of k, and say that both are O(k) that too has been disproved.
because then it must not matter what is in the dictionaries!
 
The number of dictionaries in the same in both cases. And in the dict comprehension case, you had a secondary variable: "a certain number of times >= 1". But that variable is missing in your "the dicts are only iterated once" statement.
 
@jpp ^given those variables above, one is O(n) and the other is O(mk) with mk >= n always.
but mk !====== n.
 
That's a lot of =s and only one !. I guess that means they're nearly identical? :P
 
hehe
 
one algorithm's behaviour is explained in terms of n and the other's in terms of mk.
 
jpp
10:58 AM
@AnttiHaapala, OK, I agree with that analysis, it makes sense. If all dictionaries have the same keys, then mk = n.
 
yes
of course this kind of assumes that there are any keys in any of the dictionaries to begin with :D
hence my degenerate case of m being 0...
but naturally we're interested in the case of these growing towards the infinity...
 
Change of topic, but can someone explain wty is happening here? (Notice the super(object, self))
class Demo(object):
    def __getattr__(self, attr):
        return 3

    def __getattribute__(self, item):
        return super(object, self).__getattribute__(item)

obj1 = Demo()
print(obj1.x)  # prints 3
How does super(object, self).__getattribute__(item) end up calling __getattr__?
 
<method-wrapper '__getattribute__' of super object at 0x7f040b0eb588>
 
super(object, self).__getattribute__(item) raises an AttributeError -> __getattr__ called?
 
Ooooh. So simple...
I think this OP is asking the same question now, so maybe you want to post an answer there
 
11:11 AM
class Demo(object):
    def __getattr__(self, attr):
        return 3

    def __getattribute__(self, item):
        raise AttributeError
 
The question doesn't seem to use the odd super(object, ...) anymore.
 
it does
below
 
@AnttiHaapala this is how you measure elapsed time ;)
https://stackoverflow.com/a/47637891/476716
 
11:35 AM
Cabbage
 
Cabbage
 
hmm my original code didn't have any keys in the other dictionaries.
I changed it so that the others have 1:1
 
Built my own Python 3.6.5 - no observed difference in this leak
 
cabbage
 
been running for the other case for 4 minutes now
n = 200000, m = 100000, k = 100001, km = 10000100000

defaultdict
time per n: 0.000000296766
time per km: 0.000000000006

comprehension
time per n: 0.001433675124
time per km: 0.000000028673
so defaultdict code took 'bout 0.05 seconds and the other 286 seconds.
 
I'm a bit skeptical when I see 0.000000000006 in any context
 
@AndrasDeak it doesn't matter. I am right.
 
as always :D
 
12:05 PM
@AnttiHaapala This looks interesting. I guess I better catch up on the transcripts to see what you're actually timing...
 
12:22 PM
@AnttiHaapala Thanks.
 
Just came upon a topic on a non-SO message board where a user asks an interesting technical question, followed by "edit: never mind, {other_user} explained it to me in a private message".
If I had anything more than a mild interest in the topic, my jimmies would be considerably rustled
 
FWIW, using .setdefault is marginally faster than using defaultdict(list) for n == 200, and a little slower for the larger tests. And of course they both wipe the floor with that nested comprehension. :)
    plaind = {}
    for d in list_of_dictionaries:
        for k, v in d.items():
            plaind.setdefault(k, []).append(v)
 
It really looks like it's these frozensets that are using up all the memory. I've checked the RSS before and after the line that creates them. However, I've tried tracking them with a WeakSet and the only one left alive at the end is an empty one, which I assume is process-level singleton.
 
@Kevin That's just as bad as The Wisdom of the Ancients. Or worse.
 
12:38 PM
Perhaps somewhere else they're used to init another frozenset, and that takes ownership of the memory?
 
They didn't actually use the phrase "private message" so the transcript of the explanation might be accessible to me through some obscure channel. an IRC whose address is buried fifty pages into a rules thread, for example.
 
Ah, right. Still, it's useless if you can't find it.
 
The glimmer of a possibility of finding it makes it even crueler, if you ask me. Like dangling a strand of spider silk into Hell and saying "here you go sinners, climb up"
 
@Kevin I've been playing with cubic Bezier curves again. I thought of a simple scheme for creating tracks. Let o-x-x-o be the 4 control points of a cubic Bezier. For a track composed of multiple Bezier segments we want the o-x of one segment to have the same slope as the x-o of the previous segment.
So just generate a path of x's, then pop an o into the middle of every second section: x-o-x-x-o-x-x-o-x-x-o-x Etc. In my simple tests the o's are the midpoints of the neighbouring x's, but they could be anywhere within the section.
 
I had a similar approach for generating quadratic bezier curves. Instead of every second section, I inserted o's into every section. This implies that you can extend this pattern to bezier curves of arbitrary degree N by inserting O's between every Nth X.
 
12:54 PM
I've got some Tkinter code that lets you compose such tracks, and watch an animated circle follow the track at constant speed. It uses Simpson's rule integration to do the constant speed stuff. The program isn't exactly elegant, but it's mostly readable. :) I'll put it into a Gist.
 
@OrangeDog have you disabled gc?
 
@AnttiHaapala no, I am also running gc.collect() before inspecting my WeakSet
 
post-canada-turkey-day cbg
 
Pretty slick :-)
 
1:00 PM
@Kevin Thanks! The constant speed calculation uses way more precision than what it needs, so you can improve the speed a little by reducing stuff like err_max.
But just in case you do need constant arclengths with precision better than 1/1000000 pixels, that's one way to do it. :D
 
Gotta be ready for when Apple releases a phone with subsubsubsubsubpixel precision
 
It's fun to modify the track while the animated spot is traveling over it. It mostly keeps up with changes, unless the changes affect the current segment it's on. If you press the Clear button while its animating it will keep going on the now-invisible track, but I consider that a feature, not a bug. :)
 
gc.DEBUG_UNCOLLECTABLE finds nothing
 
Perhaps you could course-correct the spot from the old curve to the new one by moving it along some kind of curve with definable slope and end points... Hmm :-P
 
@Kevin Well, it will "catch up" to the new track when it finishes traversing the current segment, so it's not really a problem.
@AndrasDeak AFAIK, Fredrik Lundh originally created Tkinter as a 3rd-party lib. (He's also the author of PIL, and I think one of the XML modules like ElementTree). Tkinter is now part of the standard lib, but it wasn't written by the Python core devs; that's what I meant by saying it's been adopted.
Plenty of other Python features have been adopted like that over the years, and even re uses a 3rd-party engine. And IIRC, sets were also a 3rd-party feature before becoming part of the core language.
 
1:13 PM
Yeah it's not so much a "solution" to a "problem" as it is "making things 10 times more complicated as an excuse to do more math"
 
I've definitely used Python 2 installations that didn't have Tkinter, both on Linux & on Windows (although admittedly my Windows experience is very limited). I'm pretty sure that Python 2.4 on this machine had Tkinter, but when I upgraded the OS, it had 2.5 with no Tkinter. A later Python upgrade got me 2.6, and it has Tkinter. I might have installed it manually, but if I did so I didn't use pip.
 
@MooingRawr I really hope you watched that game over the weekend
 
@Kevin Agreed. The program is mostly just a framework for testing various ways to do the constant speed stuff, it's not intended to be a general purpose Bezier animation program. I had some thoughts about making it possible to slide the white dots around, but decided it was too tricky without rewriting half the program. :)
 
Understandable. Drag and drop is a little painful even when it doesn't require you to redesign anything else.
 
I suppose it might be handy to give it a way to save and load tracks. That's simple enough. But I must resist the temptation to turn it into a Bezier drawing program. :)
 
1:24 PM
The circuit diagram thing that I prototyped a while back had dragging, and it depended on more global state than I would have liked
Globals are perhaps more permissible in GUIs compared to other situations, since there's exactly one window containing exactly one canvas, which contains items that you want to drag exactly one of
 
cbg \o
 
Python-minimal doesn't have tkinter in Ubuntu...
 
@idjaw which one the slugfest or the mini slugfest? :D either one I watched it and both were entertaining. Sad about the first one but my god our forwards are strong, who need defense when we have POWER! If history has taught me anything, if you have massive resources just add power to solve your problems. (half joking)
 
The minimal distro would be at least doubled by inclusion of tkinter with its dependencies
 
@MooingRawr Matthews vs Kane one
beautiful
 
1:29 PM
Happy Post Thanksgiving to my fellow Northern brothers and sisters, and to the south happy Columbus day
 
I occasionally see "how come my fresh install of modern Python crashes when I try to import tkinter?" on the main site. Troubleshooting that tends to be non-straightforward.
 
@idjaw JT's first hat trick as a leafs T.T so beautiful (I need tea be back in a few)
 
@Kevin My program doesn't exactly use globals, but quite a few of its objects are de facto globals that are attributes of the GUI object. So the design is just as messy as if I were just using plain old globals. :)
 
@MooingRawr that game was looaaaaded
 
At least it looks non-straightforward in the five seconds I spend skimming the post before pulling my ejector lever, catapulting myself to a more fun question
 
1:30 PM
@OrangeDog perhaps it is a c library that's leaking memory. Sbrk heap cannot be compacted
 
Note I just left my self in code... let's see if I'm not staring at it in 5 years: "This all needs to be cleaned up. It looks like hot garbage!"
 
@AnttiHaapala I can imagine! Not only do you have all the GUI bits & pieces, you also have the Tcl interpreter.
 
And X...
 
Round the decay // of that colossal comment, boundless and bare // the lone and level blame stretches far away
 
@AnttiHaapala Oh dear, I forgot about that. I guess the X <-> native windows layer could be pretty large on non X windows systems.
 
1:40 PM
@AnttiHaapala perhaps, but whoosh doesn't have any C dependencies as far as I can see
 
Some of the unit tests on my work project were failing because they depended on an external data file that wasn't there. I put a couple hours into reverse-engineering a new copy, but I've just now found the original, one directory removed from where it was supposed to be.
There should be a word for "the simultaneous relief and regret felt when you discover that you can stop laboring on a hard task, and that the labor you already expended was fruitless"
 
@Kevin my mirror neurons made me share in the pain of that moment. thanks brain, I hated it.
 
It's like when you think "I should write a script to do this", so you spend an hour or two writing it. Then you think of a better name for the script, and realise that you already have a script of that name, which does almost exactly what the new script does.
 
1:56 PM
Don't cry for me. I think I have a higher-than-average tolerance for reinventing the wheel. It's like a coding kata.
It is written, "I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times"
Not pictured: the man that wrote for _ in range(10000): kick.practice() and took an early lunch while it ran
 
2:31 PM
I think I'm going to give up on working out why this memory is leaked. Optimizing the index removes all the deleted documents, and then these frozensets are all empty. Just have to do that regularly enough.
 
cabbage
 
cbg davidism
 
I had the day off yesterday, told myself I was going to work on my talk slides, played Nier Automata instead. :-/
 
The other day my friend asked me if Nier Automata was any good and I told him "My internet friend liked the soundtrack?" and that convinced him to get it. Your (inadvertent?) evangelization is a success!
 
Liked is such a mild word.
But cool.
The orchestral arrangement box arrived last week. The only CD player I have is in my car.
 
2:48 PM
It's awkward that the most popular physical storage medium for audio is becoming increasingly harder to read. Floppy disks had the courtesy to become obscure pretty much across-the-board, as I recall.
 
I don't know Jupyter (or ipython). Should questions regarding problems running code in a Jupyter Notebook be tagged [Jupyter] or [Jupyter-notebook]? stackoverflow.com/questions/52723511/…
 
I tried to help this guy out. My edit got re-edited by OP stackoverflow.com/q/52723681/2336654
 
@Kevin I've got a couple of old 78RPM records that belonged to my grandma. One of my nephews has a turntable, but I don't know if he has a stylus that's compatible with the old shellac records.
 
lol @Kevin
 
Hmm, I tried to roll back but I think I clicked the wrong button.
Fencepost errors abound when "rollback" could be interpreted to mean either "revert all edits occurring after this one" or "revert all edits occurring after this one, and also this one"
Now one of you will say "Actually, every programmer other than you knows which of those is correct, since it's been standard terminology since a week after source control was invented by James Source Control in 1970"
 
2:59 PM
So there's this incredibly popular question about splitting a string by commas, and it's either a) a brainfart because the OP didn't split on commas or b) a question about reading csv files, but in either case it's not a string splitting question. Problem is, I'm not sure how to deal with it. Would any tears be shed if we closed it as a brainfart and deleted it?
 
cbg
stackoverflow.com/questions/52723511/… unclear. The OP doesn't appear to be able to add any further clarification.
 
The comma splitting Q could conceivably be closed as Needs MCVE.
Editing it so it has an MCVE still wouldn't give you a good question. "Help me parse my specific data format" Qs are usually too narrow. OTOH, there are at least 14 people that found it useful, so maybe it's not that narrow.
When the specific data format happens to be csv, you'll get a broader audience than usual
 
@PM2Ring I would go jupyter-notebook. Not only is it more precise in regards to what the OP is using, but it has over double the traffic too
 
Even if you edit it into a decent question, we probably already have a better question about the same topic, so I really don't see any value in it
 
On the gripping hand, since it's csv, giving ad-hoc parsing solutions is as useful as handing out loaded footguns
 
3:09 PM
@Aran-Fey That question has multiple issues: splitting with .split() instead of .split(','); not converting the numeric strings to float; trying to parse a CSV manually instead of using the csv module. And the code has all that mgParamso it's not a MCVE. All in all, it's not very useful for future readers, which is reflected in the +1/0 question vote count. OTOH, it has almost 36k views; I guess that means almost 36k disappointed viewers. ;)
 
@PM2Ring either way I suspect it will be closed shortly anyway so it wouldn't be a contribution to either tag :)
 
Huh, Git was created in 2005. I would have guessed it to be older than that.
 
@roganjosh Ok. I'll remember that for future reference. I retagged it, but I also just gave it the 5th close vote, since the OP is incapable of providing adequate info.
 
Yep, it was only gonna keep going down the same route of "evry code"
 
Ironically, en.wikipedia.org/wiki/Version_control has no direct record of the history of version control. There's en.wikipedia.org/wiki/…, but it's not chronological.
 
3:15 PM
I struggle to even understand what Jupyter is properly these days. I think it basically got cut out into jupyterlab and jupyter-notebook leaving "jupyter" in either some legacy place or a catch-all tag
 
@PM2Ring 35k - 14 disappointed viewers :D
 
This is the one topic where you'd really expect there to be timestamps for every significant event. The first thing you do with source control v0.1 is save it to source control v0.1.
 
@roganjosh Hammered. That target isn't an exact match, but I guess it gives the OP the info they need.
 
Cheers
 
@Kevin I agree that is somewhat ironic.
@Aran-Fey I'm not totally comfortable as CV'ing it as a typo / brainfart, but I guess that it qualifies since the main part of the question is that the OP is expecting .split() to do what .split(',') does. But I CV'ed it anyway. Two more votes to go...
 
3:29 PM
@Kevin at least it's got this en.wikipedia.org/w/…
 
I voted typo, but now I'm not so sure. It falls more into the category of "How do I do X? I know you'll downvote if I don't show any effort, so here is some code that does unrelated thing Y" than the category of "I thought this code would do X, but it's doing Y, what's the deal?"
 
Alternative close reasons include "too broad" for "you want to parse csv without the csv module?!" :)
 
Theory: the history of source control is forever lost because the second thing you do with source control v0.1 is inadvertently add bugs that irreversibly mangle the files that were storing its history.
Only the developers that wisely kept copies in a series of directories like "source control v0.1 (new) (new) (new) 2" are safe
 
I guess we could've just hammered it as dupe before deleting it, but I really don't want to mark junk as duplicate...
 
TIL that you can pass multiple iterables to map -> [*map(lambda x, y, z: x * y * z, *[range(10)] * 3)]
 
3:39 PM
Tragically, if your map call requires multiple arguments, it's probably complicated enough to merit replacing it with a list comp. This fun feature doesn't get much chance to shine ;_;
 
@piRSquared So many asterisks! Took me a second to parse that code in my brain...
 
@piRSquared Also see itertools.starmap, for when you have pre-zipped args.
Earlier today (when refactoring that Bezier code) I decided to inline some function calls in a function that gets called heavily in a loop. So I mindlessly edited some lines of the form x, y = midpoint(x0, y0, x1, y1) to x, y = (x0+y0)/2, (x1+y1)/2. That didn't work out so well. :)
 
@PM2Ring jupyter notebook == (dun dun dunnn)
 
Any map call that has a lambda as the function arg should be re-written as a list comp. The list comp's easier to read, and doesn't have the overhead of a slow Python function call on every iteration. If the function already exists, it's tolerable, but really map should be reserved for functions that run at C speed.
@AndrasDeak Fair enough. :) I just didn't know if it was the convention to use the specific tag or the more generic one.
 
Most [jupyter] is probably notebook-related...
 
04:00 - 16:0016:00 - 00:00

« first day (2915 days earlier)      last day (2026 days later) »