« first day (3348 days earlier)      last day (1601 days later) » 
00:00 - 20:0020:00 - 00:00

8:00 PM
quick, before the stack goes out of support :P
 
Haha
We do have a plan to move to 3.X, but a plan is all it is for now.
 
Plan is not bad. Try to get someone higher up to write it down, then you can push that forward
 
Oh, it's not an administrative issue, it's more of a "nobody wants to have to do it" issue.
 
you could be the hero
maybe a martyr... ;)
 
Everyone's going to come in one day and run face first into a wall of walruseses [[:=, :=], [:=]]
3
 
wim
8:20 PM
I wonder if Thermidor and Leda share a common root, pardon the pun.
@WayneWerner I don't get it - why are you producing a distribution if the tests haven't already passed?
And if they have already passed, then no point to run them again.
 
@wim Thanks. I'll put that in the list of things I didn't need to read about today. "Poetry about Leda"
 
@wim there are a number of different tests we could run. I mean, yeah, tests against the code pass... but if you're deploying a .whl or sdist, you would want to test the actual artifact, right?
the obvious first step is to just make the version 1.2.3rc1, build the software, install it, and test from there
but... then what? technically, if you change even the __version__ or whatever you use, you're changing the code. Things should go through the entire pipeline again, but what if things break? Is that just an insane situation to be in, and don't worry about it?
 
8:37 PM
Finally solved Friday's part 2:view spoiler
 
glad to hear that :)
 
How bad of a bug is it to __enter__ a file-like object multiple times and then only __exit__ it once?
If nobody says "eh, don't worry about that" soon I'll consider it worth fixing
 
I think files returned by open are
alright, if I can't fix it within 15 minutes I'll just ignore it
 
I wouldn't enter an object multiple times unless I had documentation saying that it's explicitly supported
>>> a = open("main.pyw")
>>> with a as f:
...     with a as g:
...             print(g.read(1))
...     print(f.read(1))
...
i
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
ValueError: I/O operation on closed file.
 
8:48 PM
@AndrasDeak I still have no idea why my original plan of supplying inputs how I had in previous problems wasn't working.
 
... Or are you saying that you have multiple nested withs and each one has its own separate open() call, and some of them have the same argument? I think those will be independent objects, then.
>>> with open("main.pyw") as f:
...     with open("main.pyw") as g:
...             print(g.read(1))
...     print(f.read(1))
...
i
i
>>>
 
@toonarmycaptain perhaps your implementation of the peek was somehow off
 
no, I don't have any withs at all
def frobnicate(file):
    file.__enter__()
    file.__enter__()
    file.__exit__(None, None, None)
 
just...delete the first one? :P
I'm always glad to help
 
>:I
I've been working on fixing this function the whole day, so either it's not so simple to fix or I'm hella stupid :P
 
8:54 PM
It's safe to close any IOBase-compliant file instance more than once, if that helps
"As a convenience, it is allowed to call [close()] more than once; only the first call, however, will have an effect."
 
Pretty sure I'm only __exit__ing once, __enter__ is the problem
 
IObase also guarantees that __exit__ing one will cause it to close, although it doesn't guarantee that it's the only thing it does
 
I bet files returned by open don't even do anything in __enter__
 
I suspect that IOBase.__enter__ simply returns the IOBase instance without doing anything, but I don't see it documented
 
@AndrasDeak I surmised as much, but I couldn't figure out how.
 
8:57 PM
@Aran-Fey I'm talking about the renderer here
I want the API to follow the pattern /api/{appname}/{viewset}/{id?} where id is optional for UD in CRUD
However, the DRF router only supports a flat shallow API
i.e. You have to register /api/asset/table/ as one api and /api/asset/rows/ as another
Instead of registering router /asset/ to router /api/
with /asset/ containing /tables/ and /rows/
Like you can't have an API "tree" it seems only an API flat "array"
 
@Aran-Fey IOBase.__enter__ does nothing other than return self or null (none?). I don't see any references to "enter" in textio.c, so I assume that TextIOWrapper simply inherits IOBase's implementation with no changes
So, in CPython, I'd say it's safe to assume that the object returned by open can be with'd as many times as you want, as long as it's still open.
 
Neat, thanks
 
While I'm in here, I can confirm that IOBase.__exit__ does nothing except close the file, and textio.c seems to inherit that with no changes as well
 
wim
@AndrasDeak did you try doing the np.triu in aoc part 2? blew out my RAM ... LOL
is there any view spoiler
although I guess since slicing doesn't copy, I'm fine with the latter
@WayneWerner your initial test should test the actual artifact in the first place. If you're testing against the cloned directory, fix that first.
 
9:13 PM
But what about when it comes time to release? There's still the issue of either a) the artifact being built as an rc or b) building like 35 1.2.3 versions of your software
 
wim
@WayneWerner so, the pattern that I've used here is that a release isn't tagged and pushed anywhere unless the tag is non-existing
so, you can still test the whole pipeline but the very final step (tagging and publishing) is a no-op if the __version__ didn't get bumped
 
Sure - but that's the git tag, not the artifact, right?
 
wim
so this is effectively b) , but it's a non-issue
yes you might build v1.2.3 a 35 times, but only the first time it actually got published
 
so you have the published build of v1.2.3, and then you have a bunch more commits to your codebase that get built as v1.2.3
but they're never released, since v1.2.3 already has been
 
wim
yep
 
9:17 PM
it's not until you change the tag to v1.2.4 that they actually get released?
 
wim
you can add tooling that makes all those get built as say v1.2.3.dev35 if you want, but I don't bother
@WayneWerner right , or v1.3.0 , v2.0.0 , depending on what exactly you're changing.
 
natch
 
wim
And you keep a file like CHANGELOG.md
any time you make a change that doesn't modify the __version__, you mention it in the v?.?.? (UNRELEASED) section at the top of the changelog
then the commit that actually bumps up __version__ should also put a proper date and version number on that CHANGELOG.md file, and create a new section above for (UNRELEASED).
 
/me loves keepachangelog
 
wim
This is not the only way to do it (bigger projects with many contributors may want to manage CHANGES.rst in an automated way using the commit messages) I'm just describing what's worked OK for me on smaller projects.
 
9:22 PM
Wow, looking at the reddit threat for day 13, some of those solutions are wild. Like infinite lives cheatcode wild.
 
Yeah, I think I'm really just struggling with the philosophical/practical difference(s) between building rc1 and a final release.

Like, I'm entirely OK with the process of building `rc` candidates, and actually releasing them as such. I guess that ultimately the test suite /deploy pipeline should give one enough confidence that changing the __version__ should still be a non-event
like... if I create an 1.2.3rc1 python version via bdist_wheel, and 1.2.3, even if the only change is in the setup.py code, I will be generating two entirely different wheel files with different hashes
 
@wim nope, I eyeballed the sizes and didn't even try. But in any case I run AoC in a shell with 2 GB RAM ulimit
@wim and not that I know of
 
but if my pipeline is flaky enough that I can test and build N different times and break in different ways, that's a larger problem to address
 
I was very frustrated by the way we had to solve part 2 :( I spent hours trying to view spoiler
 
And then of course, tagging is the final step - presumably right after pushing the built, then tested release artifacts
 
wim
9:40 PM
@WayneWerner Yep. So what, though?
nobody promised that an rc should hash the same as the actual release, afaik
@AndrasDeak what means "right" to you? do you mean working even if view spoiler
they did make it seem like view spoiler and I also spent hours trying to do that, before finding the trick
fake fourier transform!!
 
@wim isn't it more like view spoiler
 
wim
@AndrasDeak to be fair, it is very clear when and when the view spoiler approach will and won't work. it depends only on view spoiler
so, if you want to be "right" you just raise exception if you see otherwise
no hope required :)
 
yeah, I have an assertion for that. It's still a dirty hack and I found it unsatisfying (and the time wasted annoying)
 
wim
yeah, I understand that. There was a problem in an earlier year where I felt similar ...
 
I remember
I even had the wife trying to come up with something proper before I realized the intended solution :D
 
wim
9:48 PM
now I am a bit more prepared for expecting that he would require dirty hack
the inputs are handcrafted to ensure it
 
barely spoiler: simulation of 10-length code repeated 100 times, phases grow from top to bottom
there are some pretty surprising patterns in there if you zoom in, some very-Sierpiński-like triangles seemingly out of nowhere
and of course view spoiler
 
wim
10:09 PM
I also noticed the triangles when I was trying to solve this
do they disappear if the input signal is not periodic?
 
yeah, I forgot to do that first and it looked like random noise
 
wim
the problem description is vaguely fourier transform-like
i.e. convolution with a bunch of square waves of different wavelengths
they don't "sum up" convolution over the frequency spectrum though!
 
the problem is that it would need view spoiler
 
wim
you still have some faint patterns on the left-hand-side of the halfway point, which is interesting!
 
Well the generating matrix is very patterned. Have you looked at that?
 
wim
10:13 PM
yes
you mean this thing? dpaste.com/2083S6R
 
and of course view spoiler
@wim yeah, though I drew it
 
wim
yeah why was that an abs instead of a mod
I think the patterns probably would have been nicer if -7 wrapped to 3 instead of truncating to 7
 
@wim but then I'd have tried linear algebraing it up :)
 
wim
oh man that looks like an album cover
cool
 
if it weren't for the abs you'd have view spoiler
 
wim
10:18 PM
@AndrasDeak I did try ... you can cumsum halfway up and then you can actually get some way further by iteratively subtracting the tail as you continue past halfway point
but eventually it all turns to crap
 
yeah...
 
wim
what does the **2 of the matrix look like?
can you make an animation for A**t ?
 
I did a manual looping "animation", and it starts to concentrate values into the top right
the problem is that the matrix values start growing
 
wim
ah
interesting
if it's not too much trouble, could you generate that one again using a mod rule instead of the abs rule
 
in a bit, I'm trying to hack together a gif with the powers
(give or take int overflow)
@wim surprisingly little visual change from afar i.stack.imgur.com/a0vQ8.png
the overall texture is the same
 
wim
10:40 PM
disappointing
I thought it would have more juice in it
 
perhaps it was only there to break linear algebra
 
wim
I don't think you need that abs
everything there should be positive already
 
Yeah, you're right, thanks. That was after hours of banging my head at the nearest wall
 
wim
at least, my code very similar github.com/wimglenn/advent-of-code-wim/blob/…
 
I'm not happy at all with today's puzzle. My favourite so far is probably yesterday's where I enjoyed the puzzle and I'm quite happy with my solution
oh, and the one before that
that's probably part of why this one hit me so hard :D
 
wim
11:25 PM
hahah you're just annoyed cos you got nerd sniped
 
Except with a proper nerd snipe there's no silly shortcut
Day 14 with the fuel recipe was great, because I was initially terrified that some hard-core graphing would be necessary, especially for part 2, and then it turned out that I could manage with something straightforward just fine. Not trivial, but straightforward. I like straightforward.
(and no, "happens to work because magic input" does not automatically qualify as "thinking outside the box")
@wim so if there was a difficult but correct solution for today's that finished in half an hour, I'd say sure.
 
wim
day 14 has magic input too though
if it was a general digraph and not a DAG then most people would have been screwed with their greedy approaches
 
I didn't investigate it too much. Yeah, I figured it has to be a DAG. But that's a straightforward assumption. Even if it ends up being wrong.
 
wim
I mistook day 14 for a search problem and wasted hours there
so for me that one was more annoying than day 16
 
that was one of my fears when I read part 2
I envisioned reweighting vertices on a transition graph and whatnot...
 
wim
11:35 PM
it's kind of annoying that stdlib bisect expects a subscriptable input and not a callable input
 
I didn't even know that exists. I mean yeah, now that you mention it, I've heard of it before, but never used it, and the next time I'll need it I won't remember.
 
wim
it's been there since Python 2.1
 
fortunately I had to implement it once in fortran, so I could throw it together fast in python
 
wim
works great! probably hasn't changed since Python 2.1 either.
 
well it's not rocket surgery
 
wim
11:37 PM
and I think it has a fast C impl with a python fallback, which might explain the subscription assumption some way
 
it would probably take longer for me to figure out how to apply it to my use case than reinventing the wheel
 
wim
>>> import _bisect
>>> _bisect.__file__
'/usr/local/lib/python3.8/lib-dynload/_bisect.cpython-38-x86_64-linux-gnu.so'
ah yep there it is
used it originally, but since wrote my own one with logging and automatic bounds discovery, which is a bit more AoC friendly.
the next thing I really need to write is a proper BFS
I've been limping along with an A* + null heuristic
I've got fast subset sum and coin change impl ready to go, waiting to scoop my global leaderboard position, but he hasn't put one of those since AoC 2015! 😒
 
@wim I wrote one for the orbit search, and essentially one for the oxygen robot (albeit the latter without a graph). This part worked at first attempt which is huge for me.
I know you mean a generic solver though
 
wim
11:57 PM
yep
ideally one should only need state0, target state, and the transition function
 
00:00 - 20:0020:00 - 00:00

« first day (3348 days earlier)      last day (1601 days later) »