arigato changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | mac OS and Fedora are not Windows
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
Rhy0lite has quit [Quit: Leaving]
altendky has quit [Quit: Connection closed for inactivity]
dddddd has quit [Remote host closed the connection]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
fling has quit [Ping timeout: 258 seconds]
fling has joined #pypy
rindolf has joined #pypy
forgottenone has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
_whitelogger has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
oberstet has joined #pypy
<arigato> an unrelated small puzzle: the playground is a sequence of 0 or 1 with a "current position" n, which evolves in a stepwise fashion following these rules
<arigato> first, we must have seq[n] == 1
<arigato> n evolves into either n + 1 or n - 1, "randomly", i.e. you can't choose that
<arigato> after you know how n evolves you can "compute" (up to) one element of the sequence from the previous one: from some i for which seq[i] == 1, assign 1 to seq[i + 1] (but always i+1, not i-1)
<arigato> the sequence starts with seq[0] == 1 and otherwise all zeroes, and n == 0
<arigato> of course you can just "compute" the next sequence element every step, and that works fast enough for any "random" movement of the current position
<arigato> but now we add a memory constrain: you can forget any number of sequence elements (turn them back from 1 to 0) at any point, and the goal is that there is not too many elements equal to 1
<arigato> e.g. ~O(n), say
<arigato> sorry, ~O(log n)
Masklinn has joined #pypy
rubdos_ has joined #pypy
rubdos has quit [Ping timeout: 272 seconds]
xcm has quit [Read error: Connection reset by peer]
rubdos_ is now known as rubdos
xcm has joined #pypy
<kenaan> arigo py3.6 a3e2d215641c /pypy/interpreter/app_main.py: #3007 More tweak: enable universal newline mode even in -u mode on Windows
forgottenone has quit [Read error: Connection reset by peer]
forgottenone has joined #pypy
xcm has quit [Ping timeout: 244 seconds]
rindolf has quit [Ping timeout: 268 seconds]
xcm has joined #pypy
micisuta has joined #pypy
micisuta has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<cfbolz> arigato: hm, don't quite get it. where is this from?
micisuta has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
<phlebas> arigato: I don't get it - assuming that n must always be >= 0, we initially must "randomly" go to n+1. That one is 0 from the precondition, or was I allowed to "compute" seq[1] == 1 before the first random step takes place? Because if i'm not, this was a short game ;) if I'm allowed, of course, all i have to do is make sure that seq[2] == 1 now, observe the next step, and as we're moving away from either end, I always reset i+2
<phlebas> or i-2 to 0, right?
<phlebas> ah, no, i cannot set seq[i-1] to 1 when i observe n going backwards. I see.
alexband has joined #pypy
antocuni has joined #pypy
ssbr` has quit [Ping timeout: 264 seconds]
ssbr` has joined #pypy
xcm has quit [Remote host closed the connection]
forgottenone has quit [Quit: Konversation terminated!]
xcm has joined #pypy
micisuta_ has joined #pypy
micisuta has quit [Quit: micisuta]
micisuta_ is now known as micisuta
forgottenone has joined #pypy
ssbr` has quit [Ping timeout: 276 seconds]
dddddd has joined #pypy
antocuni has quit [Ping timeout: 245 seconds]
<arigato> yes, you're correct, the first "compute" step is done at the same time as n goes from 0 to 1
<arigato> so when n becomes 1, we are allowed one compute step (which must be seq[1] == 1) and afterwards seq[n] == 1 so it's fine
<arigato> so yes, the goal is to keep some small but clever subset of seq[0:n] to 1, so that if we observe several steps to the left (n => n - 1) we can compute missing values, and forget some of them, so that we still have never more than O(log n) values at 1 at the same time
xcm has quit [Remote host closed the connection]
<arigato> cfbolz: basically, it models anything where you can compute step n+1 from step n, and the user generally asks for the steps in order but sometimes he asks for them backwards
<arigato> cfbolz: so revdb is a typical example, but here I'm thinking about it for a game
xcm has joined #pypy
<arigato> (so far, revdb is implemented by keeping only some fixed seq[f1] == .. == seq[fn] == 1, and doing a step to the left requires computing (n-fi) steps forward)
<cfbolz> ah, I see
<arigato> in case it changes anything, I can allow doing several computation instead of just one, with a fixed upper bound
<arigato> or even O(log n) such computations, that is still fine
forgottenone has quit [Remote host closed the connection]
forgottenone has joined #pypy
xcm is now known as Guest42561
Guest42561 has quit [Ping timeout: 245 seconds]
xcm has joined #pypy
ronan has quit [Quit: Ex-Chat]
alexband has quit [Ping timeout: 268 seconds]
rjarry has quit [Read error: Connection reset by peer]
rjarry has joined #pypy
marky1991 has joined #pypy
forgottenone has quit [Quit: Konversation terminated!]
xcm has quit [Remote host closed the connection]
forgottenone has joined #pypy
xcm has joined #pypy
marky1991 has quit [Ping timeout: 245 seconds]
marky1991 has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
marky1991 has quit [Ping timeout: 245 seconds]
jacob22_ has quit [Quit: Konversation terminated!]
antocuni has joined #pypy
ssbr` has joined #pypy
marky1991 has joined #pypy
marky1991 has quit [Ping timeout: 244 seconds]
forgottenone has quit [Ping timeout: 244 seconds]
adamholmberg has joined #pypy
marky1991 has joined #pypy
forgottenone has joined #pypy
fling has quit [Ping timeout: 268 seconds]
Rhy0lite has joined #pypy
altendky has joined #pypy
alexband has joined #pypy
marky1991 has quit [Ping timeout: 272 seconds]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
adamholmberg has quit [Remote host closed the connection]
forgottenone has quit [Quit: Konversation terminated!]
adamholmberg has joined #pypy
adamholmberg has quit [Read error: Connection reset by peer]
adamholmberg has joined #pypy
forgottenone has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
marky1991 has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
marky1991 has quit [Ping timeout: 245 seconds]
fling has joined #pypy
Masklinn has quit [Ping timeout: 246 seconds]
<tos9> What's the equivalent of ctypes.byref(ctypes.c_void_p()) in CFFI
<tos9> Hrm maybe I'm doing that part correctly actually and this error is elsewhere.
fling has quit [Ping timeout: 268 seconds]
micisuta has quit [Ping timeout: 272 seconds]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
fling has joined #pypy
mikroskeem has quit [Quit: overflow in /dev/null]
oberstet has quit [Remote host closed the connection]
[Arfrever] has quit [Ping timeout: 245 seconds]
micisuta has joined #pypy
antocuni has quit [Ping timeout: 268 seconds]
[Arfrever] has joined #pypy
ssbr` has quit [Ping timeout: 244 seconds]
<tos9> Yeah OK probably I'm doing something really simple wrong./0
mikroskeem has joined #pypy
<tos9> Apologies for as usual I'm sure is just me not knowing C, but what's the right way to call such a function:
<tos9> The 2 things I tried produced either a traceback or a segfault there at the bottom.
ssbr` has joined #pypy
<fijal> tos9: hey hey
<fijal> how's going?
lritter has joined #pypy
<tos9> fijal: hi hi
<tos9> going well
<tos9> trying to go on vacation
<tos9> how goes with you
xcm has quit [Remote host closed the connection]
forgottenone has quit [Read error: Connection reset by peer]
forgottenone has joined #pypy
xcm has joined #pypy
marky1991 has joined #pypy
<fijal> haha, same :-)
<fijal> and how is it working for you tos9?
rubdos has quit [Ping timeout: 264 seconds]
rubdos has joined #pypy
<tos9> fijal: so far not so good... and you guys aren't helping, you should plan a summer sprint :)
<tos9> but *hopefully* I'll get away like next week or week after
marky1991 has quit [Ping timeout: 246 seconds]
forgottenone has quit [Quit: Konversation terminated!]
forgottenone has joined #pypy
alexband_ has joined #pypy
alexband has quit [Ping timeout: 244 seconds]
Rhy0lite has quit [Quit: Leaving]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
dddddd has quit [Ping timeout: 272 seconds]
dddddd has joined #pypy
_whitelogger has joined #pypy
antocuni has joined #pypy
dddddd has quit [Ping timeout: 244 seconds]
dddddd has joined #pypy
marky1991 has joined #pypy
marky1991_2 has joined #pypy
marky1991_2 has quit [Remote host closed the connection]
marky1991_2 has joined #pypy
marky1991 has quit [Ping timeout: 245 seconds]
themsay has joined #pypy
marky1991_2 has quit [Ping timeout: 272 seconds]
micisuta has quit [Ping timeout: 244 seconds]
xcm has quit [Killed (orwell.freenode.net (Nickname regained by services))]
xcm has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
Taggnostr has quit [Ping timeout: 252 seconds]
Taggnostr has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
Taggnostr has quit [Ping timeout: 252 seconds]
Taggnostr has joined #pypy
<RemoteFox> how can you check whether file is closed under rpython? just accessing .closed property doesn't work
<tos9> RemoteFox: It looks like theres a _check_close method on rfile
<tos9> I don't know whether the same privacy rules apply in rlib, but presumably if you're writing an rpython interpreter you'll stay reasonably up to date anyhow
<tos9> You need to know whether it's closed from outside the file?
<tos9> (Probably I'd assume the real right way to do what you want is to carry the state on your language level object, which presumably is how pypy uses the rfile object)
adamholmberg has joined #pypy
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
<RemoteFox> yep
<RemoteFox> hmm
adamholmberg has quit [Ping timeout: 248 seconds]
<RemoteFox> I used just regular result from the open() call until now
<RemoteFox> I'll have to look at the rfile
alexband_ has quit [Remote host closed the connection]
alexband has joined #pypy
alexband has quit [Ping timeout: 245 seconds]