« first day (2247 days earlier)      last day (2708 days later) » 
00:00 - 19:0019:00 - 00:00

12:03 AM
I knew I could count on you <3
(but that was sort of my point)
Well, I did assume that decline in interest is actually due to decline in success
which is not necessarily the case, obviously
but damn, this was tough for me:(
 
12:15 AM
wtf I just have to call my recursive solver
so much work for nothing, wonderful:D
100 loops, best of 3: 4.93 ms per loop
 
Westworld Soundtrack is available. I found it on Spotify. Get to it!
 
we started watching it not long ago; it has very characteristic music
 
so many covers too
really awesome
oh my goodness it's a double album
tee heeeeee
 
12:30 AM
OK, time to finally sleep more than 4 hours:D
rhubarb
 
 
1 hour later…
1:55 AM
anyone there?
I need help.
def process_player_choice():
print('What is your choice? Enter 1 for rock, 2 for paper, or 3 for scissors: ',)
choice2 = (input())
while choice2 != 1 and choice2 != 2 and choice2 != 3:
print("ERROR: the choice can only be 1, 2, or 3.")
choice2 = int(input("Please enter a correct choice: "))
 
what did you run into?
 
sorry, please see this:
def process_player_choice():
print('What is your choice? Enter 1 for rock, 2 for paper, or 3 for scissors: ',)
choice2 = int(input())
while choice2 != 1 and choice2 != 2 and choice2 != 3:
print("ERROR: the choice can only be 1, 2, or 3.")
choice2 = int(input("Please enter a correct choice: "))
when I run that code and I enter a non-integer like 'xyz'
I need it to print the error message
so if anything but 1, 2, or 3 is input, it prints the error message
but i am getting invalid literal for int() with base 10: 'xyz'
how can i change this to print the error for 'xyz' and anything that is != 1, 2, or 3
(this is for a homework assignment)
 
Try using isdigit() function
or a try: catch:
 
will that make it print the error message?
while choice2 != 1 and choice2 != 2 and choice2 != 3:
print("ERROR: the choice can only be 1, 2, or 3.")
thats what i need to happen
print('What is your choice? Enter 1 for rock, 2 for paper, or 3 for scissors: ',)
choice2 = int(input())
while choice2 != 1 and choice2 != 2 and choice2 != 3:
print("ERROR: the choice can only be 1, 2, or 3.")
if i input 4,5,6 or any number it prints the error:the only choice can be... message
but if i input a letter
like xyz
i am getting invalid literal for int() with base 10: 'xyz' traceback error
i need it to print the error message for 'xyz' like it does for '4'
anyone?
 
2:57 AM
And I just tried to use with open tests/data/file.csv on the command line
Achievement unlocked! Trying to Python All the Things
 
 
2 hours later…
5:16 AM
wat
 
lol I have no idea what Day10 is asking
A lot of things don't really make sense, have to re-read this thing slowly I guess
 
I am drunk
I solved part 1
I have no idea about part 2
it is just one sentence but I have no f*cking clue what it asks
 
How do you know what-valued chips the bots initially have?
 
they are by the value lines
the initialization is static
 
At least in my input, the value lines do not start or end the lines
 
5:23 AM
they're static
I just read, then act
but I have no fscking clue about part2
I don't understand
part2 question view spoiler
I have no idea about what it asks
I have had 3 ideas about what it means
all of them were wrong
oh well I typoed an answer, 5 minutes
FU
 
5:38 AM
seriously I don't get it at all
I finished part 1 fourth
but I don't understand the part 2 at all,
100 stars gone and I still have no idea what's it asking
 
I still can't get part 1
These instructions are terrible
At no point does a bot hold onto the two chips it's mentioning unless I've misunderstood the init. instructions
 
"value goes to" lines are about initialization
 
I do one pass over the instructions and populate the bots, only noting the value lines
Second pass over the lines to only pay attention to the instructions
 
there should be at least one bot with exactly 2 chips
 
finally
these instructions were totally unclear
 
5:51 AM
so what does the part 2 fscking mean
 
Just output the product of the chips in those three output bins
 
welp, part 2 was easy
 
I don't fscking get what I am doing any more
aha?
so instructions are one-off lol
see...
I programmed it so that it stabilizes on these inputs.
it worked for part 1
how shitty these instructions really are
Because you have guessed incorrectly 7 times on this puzzle, please wait 10 minutes before trying again.
FCK YOU
see this is so totally unclear.
ok now I get it I guess, this stuff is still ordered
argh I am a drunken idiot
 
6:44 AM
cabbage
 
6:57 AM
hello
 
7:18 AM
this one is super annoying
 
7:30 AM
Yeah, really unclear wording on this one
 
I feel like I spend more time on understanding AoC puzzles than writing code to solve them
 
8:28 AM
that one was awful
This is the ugliest one I've had so far. By far.
 
cbg
I wanna start a cool startup
and get super rich
 
 
2 hours later…
10:28 AM
this is the first time in both years that I don't really understand the second part at all
like yes...
but I've become unsure because...
ah no...
 
10:42 AM
my code still doesn't work identically
 
any math geniuses here?
 
not me
but ask
@khajvah you know the room rules
 
nevermind I asked the question in math.se already
 
I really do not understand how my code behaves differently from the other codes
LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO‌​OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO‌​OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO‌​OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO‌​OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO‌​OL
never code drunk
 
11:05 AM
@AnttiHaapala did you overdrink?
 
my code didn't have outputs at all
 
lol wat
 
I managed to get rank 4 in a puzzle coding drunk, but I read only half the instructions :D
 
11:22 AM
@MarcusS I passed you on the leaderboard even though I didn't read instructions correctly :D:D
 
11:46 AM
how is the board decided? on how long it took to finish?
 
Cabbage
 
cabbage @PM2Ring
 
Don't worry, it's already gone. :)
 
12:01 PM
@khajvah Well, he does say his math skills are bad. But at least he's got nice Latex formulas. :)
no mcve stackoverflow.com/questions/41075143/… In fact, the OP's code is conspicuous by its total absence. :)
After reading all the stuff in the transcript about unclear instructions for some of the recent AoC puzzles I'm kinda glad I decided not to participate. I hate ambiguous or otherwise poorly-specified problem descriptions.
 
I don't like those kind of Olympiad problems
 
12:20 PM
@khajvah yes
@PM2Ring there wasn't anything unclear in the code above, only I didn't read half the instructions :D
the problem descriptions are not really ambiguous either... rather, the thing is: you've got input, and the problem description and you're to write an algorithm that solves the problem using the description and the given input
you are supposed to inspect the input too
wat
is > a special character in regular expressions
 
12:44 PM
@AnttiHaapala Sort of. > is used in named groups and lookbehind assertions. But you shouldn't need to escape it.
import re
pat = re.compile('>{2}')
print(pat.findall('> >> >>> >>>>'))
#output
['>>', '>>', '>>', '>>']
 
haha yet more speed trick coming
one of the inputs is: "bot 141 gives low to bot 172 and high to bot 1"
so, how to write parser for this asap:
     gives = Parser('bot <int> gives low to <> <int> and high to <> <int>')
     ....

     if gives(line):
         botno, lowtype, lowno, hightype, highno = gives
this is damn ugly but who cares :D
it works
 
12:59 PM
I just picked up a cool 55 points by quoting the docs. :) stackoverflow.com/a/41075516/4014959
 
1:11 PM
Because saying RTFM in a polite way is quite rewarding :D
 
1:24 PM
It appears to be. :)
 
1:46 PM
Well, I don't see count defined anywhere in your code, so it seems like that's a valid error. — Wayne Werner 16 secs ago
I love the smell of Snarky in the morning
@AnttiHaapala I can beat that. _, _, _, low_or_high, _, where_one, where_one_id, _, _, _, where_two, where_two_id = instruction
Guess who gave up caring what his gorram code looked like at 2:30AM?
 
hello
 
Interestingly enough, I discovered view spoiler, at least with my dataset
cabbage, @IsabelCariod
 
does anyone have experience with bottle?
 
@IsabelCariod you may want to read the room rules to the top left :) --->
1
Q: Sending an image over a socket as bytes

DAVIDBALAS1I want to send a screenshot of the server to the client, in order to do this, I want to send the image as bytes, and split it to parts, each part in length of 1024. First, the program does multiple things, it sends also files, the time etc.. so the client needs to tell the server he/(it)? wants ...

A surprisingly decent question
 
@WayneWerner <-- left
 
1:52 PM
yes, right. I was up late last night -_-
 
Generally what would you do it if you were iterating over a list and wanted to grab the next 3 items each time? Would you use enumerate or something else?
 
I mean, the OP has some questionable code and clearly doesn't grok the whole strings v. bytes thing... but it's actually not a bad question
 
@Programmer I'm on mobile, so can't link easily, but look up "split a list in to evenly sized chunks". YOu'll have your answer
 
@Programmer I might use range with a step size of 3. If I was feeling clever I might create a zip(*[iter(thing]*3)
 
^^ that's pretty
 
1:55 PM
alternatively..
iterthing = iter(thing)
for first in iterthing:
    second = next(iterthing)
    third = next(iterthing)
 
Well I meant Say I have ['a', 'b', 'c', 'd', 'e'], I'd want a, b, c, d on first iteration, then b, c, d, e. If I use next, doesn't that remove the item from the iterable?
 
though that will raise a StopIteration if your sequence isn't exactly divisible by 3
Oh. That's something different
 
Yeah, I think I worded it wrong. My bad
 
@WayneWerner Yeah, I had a brief look at it, but decided it was a massive time sink.
 
yeah you want to just iterate for start in range(len(data)):
then you do stuff = data[start:start+4]
Though if you only want to b,c,d,e then you're going to want range(len(data)-4)
 
1:59 PM
Ahh, that looks better than using enumerate. I'll play around with that. Thanks
 
enumerate is when you actually want the element and the index
in your case the element is superfluous. You don't want the element by itself, you want it as a collection of this+next3
 
I think AoC is causing me to think things are harder than they really are so I'm searching for elaborate solutions for no reason. :P
 
2:22 PM
Heh.
 
> dmsg.log contains all the information about the boot of OS. Thus your task requires to write a map reduce program that will find out the status of a log file (for example boot issues in the log file)
defuq, my homework
 
user6568562
2:40 PM
@WayneWerner Nice :D
 
user6568562
Cbg !
 
cbg @randomhopeful
if you're using map reduce to search a logfile, it better be a few terabyte logfile
 
@WayneWerner damn, that's creepy
 
IKR?
I can't stop looking at it
It's better worse better than that weird plant with holes
 
2:44 PM
cabbage @SimeonAleksov
 
How you doing
 
dpomg we;;. ks I love it when my fingers are off by one and I don't notice
Doing well
trying to shift my salt server
 
Ugh, is there a way to write this into single line?
        if d is not None:
            return d+1
        else:
            pass
I'm not sure for the else part
 
if d is not None: return d+1
alternatively... return None if d is None else d+1
you could do return d if d is None else d+1, but it seems like the return None... is slightly more explicit
 
Yeah, I don't want to return None :)
Hmm
 
2:48 PM
Ah. Well... I probably wouldn't be randomly returning in the middle of a function like that anyway if you can help it
 
Oh, I forgot it's in loop...
 
Hey guys! I make chat app with flask and websockets. Which solutions for websockets you can recommend?
 
def dN(p, d):
    if p == d: return 0
    for ch in c(p):
        d = dN(ch, d)
        if d is not None: return d + 1
Hmm
 
3:07 PM
@SimeonAleksov Very hmm. Depending on what c(p) returns, that may endlessly recurse, until Python raises RecursionError.
@WayneWerner Yeah. It's just a bit too creepy. I'm going to move it.
 
I figured it out, it's k
 
Oh good.
 
nevertheless it returns the value of the given key of dict
 
Rhubarb
 
Cya PM
 
3:25 PM
@khajvah I like math, if you still have a question
 
cabbage
today's AoC was fun:)
 
cbg
Yeah, heard that earlier
 
I finally did some OOP spoiler
 
@MarcusS It's a question about von Noumann stability analysis. It's in math.SE
 
*Neumann
(German name, but dude was Hungarian)
 
3:42 PM
More like Austrian, since he was born in the Austria-Hungarian empire.
 
cbg all
 
cabbage
 
@RomanLuštrik what if I told you that Austrians, Hungarians, and a bunch of other nationalities lived in the Habsburg Monarchy?:P
cbg
 
@AndrasDeak As far as I know, that's the same thing? :)
 
what is?
 
3:47 PM
And you are forgetting a few other nations. :P
 
my point was that you probably wouldn't consider Jaroslav Hašek an Austrian, would you?:D
oops, you're in Slovenia
no, I probably don't know any of your famous countrymen:D
wait, where are you from?
 
Neither do I. :P
Close to Ljubljana.
 
Are you Slovenian?
 
Yepp.
That's what my SO bio says. :P
 
no, it says you're in Slovenia:D
I didn't know that Å¡ was also in the Slovenian alphabet, sorry
 
3:54 PM
Hey hey
Which linux should I use?
 
are you unix-virgin?
Because in that case, ubuntu. It's the gateway drug.
 
ubuntu. on a chromebook. this is the only way. =P
 
Not quite, I have some expirience
 
if you're comfortable with ubuntu, then debian:P
says the guy with debian
some of the arch guys here will say arch
 
3:56 PM
only if you really want to learn Linux. And how to ask good questions
 
It's confusing, I can't find the right version
 
"right" version how?
 
Nevermind
 
@AndrasDeak WAT! You don't know Melania is from Slovenia?
 
what's a Melania?
 
4:10 PM
She'll soon be one of the most powerful women on earth.
 
ooooh, right, Mrs Trump
 
Wait, @Roman, She's from Slovenia, right?
I remember reading that somewhere
 
Even if I remembered, I wouldn't want to offend @Roman by reminding him of her
 
It's hard to offend me. :) Go ahead.
 
4:12 PM
Melania is Slovenian
there
 
Perhaps the Slovenian part would offend him more.
They're called Slovenes.
 
really?
multiple-cultural-ignorance sorry from me
rhubarb for now
 
Nope, still can't be offended. :)
 
@AndrasDeak Welp, I know that coz Roman and myself are co-owners of another room. ;)
 
I'm a scientist, so take your best shot.
 
4:14 PM
Rhubarb Andras.
The only Slovenian I know are all from that pizda @Roman's tweets. :D
 
Nailed it. :D
 
4:54 PM
Day 10 was pretty fun. I made my solution nice and reusable this time: bitbucket.org/davidism/advent2016/src/default/day10.py
@AndrasDeak @WayneWerner yay, more bot class solutions :-)
 
5:41 PM
@WayneWerner but you're not verifying the rest of the message
that's what bit me :D
I didn't realize there were outputs at all :D
 
6:01 PM
hey guys!
 
heyhey
 
rhubarb, Gotta leave.
 
rbrb @BhargavRao
 
6:07 PM
Late to AoC today. Reminded me of one of the puzzles of last year, and solving it was easier than I expected.
 
last night I got all set up to catch up on AoC...poured myself some wine...opened my laptop....read the question.....four hours later my wife woke me up...still had a full glass of wine on the side table
I guess I was tired
:P
 
yeah, it took me 4 hours to solve the blasted thing, too ;)
Well, it took me four hours of typing things in my sleep-drunk state anyway
 
@WayneWerner it took me 10 minutes to solve the part 1...
 
it took me 0....
didn't even do it yet
 
6:18 PM
I think I was entirely too tired to work on anything. I should've just gone to sleep and done it when I woke up
 
as for part 2 I needed to sleep, read several published solutions, 7 submit attempts, checking what is the correct solution using other's programs, attempting several techniques and realizing ...
 
I don't think it would have been any different
 
I just started day 8 part 1
 
that ... I had ignored half the instructions when doing part 1
and that's why part2 didn't work :D
 
@AnttiHaapala are you talking about day 8?
 
6:19 PM
day 10
 
oh ok
 
@idjaw I was 4th in part 1, 630th in part 2 :D
 
It took me forever to realize that view spoiler
@AnttiHaapala That's funny. Apparently I beat you to the finish line. Slow and steady wins the race :D
 
@WayneWerner I have assertions for that
 
I have a question for day 8 view spoiler
 
6:20 PM
@idjaw ... they don't...
 
ok perfect
then don't ahve to worry about that case
 
... you're supposed to handle whole row, col
 
I mean.. if it did, it doesn't matter.
 
at one go... as I said on ereyesterday
 
I was thinking of what happens when loop back when you reach the limit
 
6:21 PM
... wat
 
nevermind....I barely started coding this
I'm thinking too far ahead 😀
I'm just going to continue
 
'ABC' can have 3 rotations: ABC, BCA, CAB...
 
[0, 0, 1] rshift(1) => [1, 0, 0]
 
see no letter goes on top of another
@idjaw also, numpy is perfect for this.
 
I think day 10 needs to be reworded completely, lol. 80% of its challenge is understanding the goals / constraints! (the code itself is easy once you know what's being asked)
 
6:22 PM
zomg I know, right?
 
@AnttiHaapala I never used numpy....I want to stick to el-classico
@AnttiHaapala btw...I was referring to this case: Pixels that would fall off the right end appear at the left end of the row.
 
I think 90% of my effort was spent figuring out what it was asking me to do -_-
 
@MarcusS as I said, my problems came from the fact that I completely ignored the whole "output" thing...
 
but I realize that the case I thought would come up...can't come up
 
god Java is ugly
 
6:23 PM
hahah. Yes.
 
@AnttiHaapala How did you approach part 2 without any output bins?
 
that's where I had difficulties :D
 
haha
 
I was like "ok part 1 solution is right, but what are these outputs" :D
"ah I know, one bot gives a chip to another - that's an output right?"
 
It's interesting to me that we all had different stumbling parts.
 
6:26 PM
hopefully day 11 is better
 
I think I've gotten a bit more used to the fact that the wording for the problems is tricksy business. Typically it's not that problem is hard, it's that wording is apocryphal.
 
@MarcusS python 3 yet?
 
Yeah
 
6:28 PM
clap clap :D
 
Somewhat annoyed that the OCR stuff didn't pan out though for day 8: github.com/MarcusStuhr/Advent-Of-Code-2016/tree/master/Day08
took me a bit of effort to get everything working in Python 3
 
Probably need better training data
@MarcusS that's the approach that I tried to take first. I was just way too tired to get it to work properly. Plus I don't use defaultdict... and I was reticent to use re, for some weird reason.
 
@MarcusS
tesseract -psm 8 your_file.png stdout ;echo $?
uanFLacEz
doesn't work too well... my word is UPOJFLBCEZ
 
tesseract your_file.png stdout -c tessedit_char_whitelist=ABCDEFGHIJKLMNOPQRSTUVWXYZ -psm 7
UFHJFLBEEI
better :D
but still useless :P
@Ffisegydd The biggest syntax change that I don't like in Python 3 is actually the removal of the "print" statement--it's just easier to type "print x"!
WAT
 
6:41 PM
Antti just found a reason to be an assassin
 
the fact that I can use *starargs with print easily trumps "no-parentheses"
 
@Ffisegydd suck an honorable quest
 
hmm how come that has 3 pinstars but ...
I cannot add mine :D
 
> The biggest syntax change that I don't like in Python 3 is actually the removal of the "print" statement--it's just easier to type "print x"!
I actually vastly prefer the print function...
 
@WayneWerner ^
 
6:53 PM
> And the majority of Python code written does not run under any of the 3.x interpreters. This makes it harder for its users to be productive.
lolno
 
well, it is true.
majority of python code written *does not run under any of the 3.x interpreters"
the question is ... does it matter?
 
Not a vast majority of the code. The codebases maybe sure. Probably at least 75% of python code would execute on a Python interpreter just fine.
but like you suggest - why does that even matter? It only matters if I need to use it.
 
DSM
Early afternoon cabbage.
 
And I haven't found a single library that I've needed that doesn't exist on Python3
 
no, majority wouldn't execute
because of print...
we're talking about code written
 
6:56 PM
I doubt a majority of the code written is print statements... Maybe ;)
 
I am not talking about print lines, but whether a file works like that in python 3
quite a portion would work after 2to3 out of box
 
I was talking about individual lines of code. Not collectively the sum of all python code ever written :P
Probably a surprising amount of that wouldn't work on Python 2.7, either
 
yes, but an individual line of code isn't important...
 
> For many people who have ported their code to Python 3, that may well be, although empirically the companies and people that still use Python 2 don't seem to think so.
 
actually, I guess most of the 2.2 codebase would work in 2.7
 
6:59 PM
if anyone doesn't mind can I ask a quick question?
Theano or TensorFlow?
 
lol. So what you're saying is that the people who don't think porting code to python3 don't think porting to python3 is a worthwhile endeavor? Sure. And 1 == 1.
 
00:00 - 19:0019:00 - 00:00

« first day (2247 days earlier)      last day (2708 days later) »