« first day (2619 days earlier)      last day (2553 days later) » 

00:01
I think I'm going to read some more stuff on octal and come back later.
thanks
if you understand number bases in general, octal is just a special case, just like hexadecimal and binary
 
3 hours later…
02:46
Which is better r, g, b = value, value, value or r, g, b = [value] * 3 or r = g = b = value?
I'd use the latter
03:06
@EnderLook depends on what value is
an integer
 
2 hours later…
04:59
recbg
05:19
I lost 2 minutes because... "0 duh"
05:33
aww man... today's one was hard
05:46
cbg
Was there a sequence to find for the item next to zero?
@ReblochonMasque I bruteforced
though I feel stupid because,
Yes, me too, sort of... zero never moves, so I only kept track of the item at pos 1
But I thought there might be a progression to this value, but could not find it
05:51
I just used the same code for both cases :D
it took 30 seconds to run :P
Yes, this is what I did @AnttiHaapala... I thought there would be a better way.
wim
wim
06:14
Advent of Modulus
too true
wim
wim
@AnttiHaapala mine finishes in under a second ...
about 0.94s
you must be appending unnecessarily
06:35
@wim of course I am :D
look at my code
it took less time to run it than rethink
@wim this is your fault :D
you wished for less BFS
now we have an Advent of Project Euler.
 
1 hour later…
08:00
anyone have link of python documents on stackoverflow?
1133
Q: Sunsetting Documentation

Jon Ericson We will stop accepting contributions to Documentation on August 8 On behalf of everyone who worked on Documentation, I want to thank all 15,451 users who contributed. We particularly want to acknowledge the 294 people who tested the private beta and the 2,361 who pounded on the public beta in ...

(if SO Documentation is what you meant)
08:13
I meant the same, any other way to get it back on GitHub or any other place on internet?
09:06
How do I view chat flags that I've raised? It isn't on the list of flags on the main profile.
you don't
Huh... okay then, how would I know how they were handled?
 
1 hour later…
10:12
Quite proud of the solution I found for part 2 today.
10:42
Indeed, cool solution @MartijnPieters
How to get subprocess.Popen(["arp-scan", "192.168.0.0:255.255.0.0"], stdout=PIPE) to output in realtime? None of the answers at stackoverflow.com/questions/803265/… seem to work - process finishes in its entirety before first line is read
11:03
We can probably optimise further; I'm sure the next modulus position can be calculated rather than iterated, but I can't be bothered.
11:34
cbg
@AnttiHaapala so true... I don't like it
@wim how do you feel about yesterday's part 2?
it was fun
and I actually figure out how to solve it in time, unlike today's part 2
@Mirac7: if the command buffers the output you're kind of stuck. Unless you make the process believe it's running on a terminal. Depending on the OS there are ways to do that lemme check
wim
wim
@AndrasDeak no particular way, why? Maybe easier puzzle than expected this late in the game.
there's a program like that on windows but can't remember which one and SO search on my answers doesn't work...
@wim my impression is view spoiler
wim
wim
11:44
@MartijnPieters looks like you found the same solution as I had
in which case this is again "solvable by chance"
view spoiler so I got #44
I absolutely bruteforced today, so I should do a smarter solution if I can find the time
I watched my system monitor with dread as the RAM graph started creeping up steadily :D
I brute forced while I was trying to figure out the supposed solution in my text editor.
As it turns out, the top 100 spots were filled before my code finished.
that's not an issue for me #europeanproblems
11:57
why european problems?
because 6 AM is not a time to be awake at
easy, set an alarm, wake up, do it, go back to slee
of course, it's easy to make sacrifices on behalf of others
the existence of alarm clocks doesn't change the fact that our time zones are crippled for AoC
I get that the timing is inconvenient for many people
5 am for me. Not worth it to get up at that time, I can just relax and enjoy the puzzle instead.
11:59
^
Martijnzone has it worst (UMT universal Martijn time?)
but I still think that the pressure and dynamic window really makes Aoc challenges stands out from other sites like project euler where you take a laid back perspective and is thrown into the combat zone where everyone is fierce and you have to start weighing algorithms in terms of minimizing debugging
which is something you don't get to do, like, ever
It starts at 1 pm for me, which is inconvenient but I still stay around to do it
poor thing
so far in december I'm only getting 2 hours of sleep per day because of it but it's worth it
yyyyeah
wim
wim
12:13
@AndrasDeak No, I don't really agree with that
since you use the same instruction set on each iteration, it's going to be cyclic by nature - these are not just random permutations
and the ops are only position swaps (cycles can be ignored)
@wim ignored for what?
wim
wim
I mean the rotation operations
you can more or less ignore them, since the only effect they have is offsetting the indices at which you do an exchange op
12:28
you also need to calculate it since it affects the final output
but the state won't affect the entropy required for tracking state for cycles
wim
wim
@Unihedron why did you stop committing your codez to version control
I forgot
I've just posted them on the megathread and went to sleep
wim
wim
megathread is boring
every man and his dog post their solution even if they don't have any interesting approach to share ... zzzz
yeah I'll add it
I can't remember my ssh key password
wim
wim
it's *******
12:40
recbg
@AndrasDeak Universal Martian Time
@Unihedron my code took only 30 seconds or so to run...
@wim they might still generate new permutations
@AnttiHaapala ruby
it ran for around 12 minutes, I got my updated code done around 11 minutes
I lost positions because I didn't notice the after 0 :F
@wim hunter2, right? :)
13:00
@wim I'd see that reasoning if they were simple permutations. I first tried to apply the first permutation N times. It had a view spoiler, and of course it was wrong because the value-based swaps spice up the permutations. But then I don't naively see why the actual dance (complete with value-based swaps) should still be simple. But then again I haven't thought about it rigorously, just gut feeling
13:27
There might be a cycle every input^2 i/e ~900,000 iterations
for today's puzzle that it
@ReblochonMasque indeed :D
let's test it :P
hmhm
but no
@AnttiHaapala Umm... last night I thought you got back to your original input after 600k moves...
But I was hungry and forgot about it mostly...
13:48
rbrb
@JonClements that's for yesterday; the guys are talking about today :)
I think?
Oh wait... so I'm now 17 days behind!? That's fairly up to date and modern for me... I'm happy :p
the first [lot of] days are a cinch
did we have any Indians present here atm?
jjj
jjj
cbg
Any idea why this was downvoted? Clearly there are some "clarity" issues but isn't that what edits and comments are for?
14:00
no, that's not what they are for
you can downvote and comment, and revoke your comment if the question is no longer crap
it doesn't have an MCVE
a pandas question that asks "why does this not work?" and which starts with "df = pd.read_csv('a_file_on_my_computer')" usually deserves to be downvoted
jjj
jjj
Ok, right.
I just thought it's nice to leave a comment then.
that's fine; you can always do that
jjj
jjj
I just did :) (no, this person is not my friend or anything)
 
3 hours later…
17:33
my teammates on slack are like "The GUI prevents users from doing forbidden things, so I think it's ok if the server assumes all commands are valid"... *deep sigh*
@Rawing it must be awesome to work with a product that's immune to bugs :P
oh, absolutely. Because I'm responsible for writing the tests, so I have an easy time ;)
no mcve (ancient, OP responded after almost exactly 1 year to no avail) stackoverflow.com/questions/41252282/…
18:13
Hello. I have a variable "123456" and I'd like to convert it to "bytes" b'123456'. What should I do?
.encode('ascii') and hope for the best?
possible problems depending on the actual contents of your string are left as an exercise to the reader :)
as long as your string is ascii you'll be fine; if your string is not ascii you couldn't do what you want to do without further thinking about what you're trying to do
Is this OK? bytes(str(number), 'utf-8')
I just want to use the best method :)
@MarcosAguayo python3?
str(number).encode()
if number is an int!
if it happens to be a string, then just .encode()
>>> int!
  File "<stdin>", line 1
    int!
       ^
SyntaxError: invalid syntax
pfft
I've run out of downvotes
18:21
you can't downvote in chat anyway
18:50
Any code ready for a decent GUI menu with buttons that looks good?
Just started programming a menu with tkinter, but it takes forever and looks like shit
19:27
Hello, I was looking at github.com/python/cpython/blob/…, but I could not find sys.py in the same repo. Where is sys coming from?
@vaultah - how does sys map to sysmodule.c?
Cbg.
I've understood why yesterday's octal was not working as expected.
good job
The 123 + 12 part. Damn obvious really.
19:41
wasn't 12 but OK :P
9 wasn't it?
it was 9 which should've been 7
@flow2k it's a built-in module, probably through some internal lookup table
@AndrasDeak That's it.
@vaultah I see. I was interested in the fork() function actually, which is called in os.py. I presume fork() came from sysmodule.c, but couldn't find it there...
Okay, but how is that C function "brought into" os.py?
Right, I know fork() is a syscall
I wasn't sure how it got called in cpython
@AndrasDeak 123 + 9 = 134 because it's working in base 8 not 10.
So 123 + 8 = 133, 133 + 1 = 134. Am I correct?
134 checks out as '\' which is the value I got so it looks correct.
20:12
@vaultah Ah okay. Thanks. Although, there is one thing I haven't figured out. The function docs.python.org/3/library/os.html#os.fork doesn't seem to be defined in os.py. There is no def fork..., like there is for some of the other functions like def getenv. Why is that?
not everything is implemented in python.
I mean, os.fork() is a python function
Just because it can be called from python doesn't mean it's written in python
So the name, at least, must be defined in a python module, right?
Yes, but not necessarily in a .py file
20:15
I see.
C/C++ extensions are generally the most widely used .pyc or .so depending on the OS
@vaultah Why the :(?
Am I wrong?
Interesting. So if I see module.function(), the code for the function() doesn't necessarily exist in the code for module. It might even not be available, as it's been compiled to bytecode.
@Simon yes, but writing it like that, using base-10 numbers is overall confusing, because then 137+1==140
Thanks vaultah
Going on a tangent - it just occurred to me the Linux syscalls are all documented in C. So that means, whichever language (Python, Java, Perl) I use, to use functionality that involve syscalls (like print to stdout), it eventually have to integrate with C code in Linux. Am I understanding that right?
@AndrasDeak Are you referring to the 123 + 9 method I was trying to do yesterday?
I'm referring to what I'm saying
what I wrote 2 messages above was just an example
20:27
OK I understand.
and it might be confusing to try to work these out in non-decimal bases; it might be more helpful to you if you first convert everything to decimal
83_10 + 7_10 = 90_10 # decimal
123_8 + 7_8 = 132_8 # octal
where _base denotes a number written in the given base
Yes that might be a good idea. Arithmetic would be much easier.
1010011_2 + 111_2 = 1011010_2 # etc
n years of elementary school equipped you to add numbers in decimal
I just can't do it enough :p
But it all works the same way actually. Look at the octal case: 123_8 + 7_8 => one,two,"ten" in octal => that's one,two,two and carry the one => 132_8
20:35
Can I come back later to discuss this? I actually need to go out.
I worked out your last message by the way.
I'm on and off all night, you can try anyway
(and I won't be willing to teach you the basics of integer arithmetic in arbitrary bases; that's what school is for :P)
I can help with specific questions
What's 2 + 2?
You're slow. I'll ask my calculator instead.
O'Brien says 5
*googles O'Brien*
google "O'Brien 1984" ;)
unless you haven't read it in which case don't google it but read the book first
20:43
too late, already found a bunch of spoilers. So far, no information about this O'Brien's math skills though
Hmm, yeah, I think freedom is more than just that.
read the book :P
it's one of my favourites, actually
Oh, there are actually free ebooks of this O.o
oh, it was published some 60+ years ago.
yup, written in '49 IIRC
20:53
Looks like I have something to do during tomorrow's boring lectures now \o/
see also this meme
(meme in the proper sense)
haha, I know that one. I have a rough idea of what the book's about at least.
21:27
How do I print chess unicode characters in python 3? en.wikipedia.org/wiki/Chess_symbols_in_Unicode
print('♔')?
then i get UnicodeEncodeError: 'charmap' codec can't encode character '\u2654' in position 0: character maps to <undefined>
if you know their unicode names, you can use '\N{name_of_char}'
ah, windows.
ah, "ah, windows"
21:29
the problem isn't python, the problem is that your terminal can't display those characters
@AndrasDeak then i get SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-7: unknown Unicode character name
@Rawing and how can i solve that?
some possible solutions / workarounds can be found here
more drastic workarounds are available here and here ;P
@AndrasDeak I wouldn't expect you to teach me anyway. It's more fun if I work it out myself :)
more fun for us all :P

« first day (2619 days earlier)      last day (2553 days later) »