« first day (2607 days earlier)      last day (2566 days later) » 

00:00
(-: ok... I'm sure you're right
someone unhammered
someone who's a circle's area
at least do that next time ^
I already added my vote when I saw it pop :)
I was going to just do that. I'm like Baymax.
 
5 hours later…
05:11
:F I woke up at 7:02
damn
I was running my day4 file instead of day5
took too long to figure out the problem, I was trying to fix nonexistent bugs
hurts even more that part 2 was just changing 1 line
rip score
uhh, well that was easy
@Unihedron you're still the top of my leaderboard
well
I'm only #49 in global now :'(
etching farther and farther away from that sweet top 10 ring
Is there a prize?
around two seconds of satisfaction until you realize no one cares and move on
05:17
the best prize!
ugh so unfair... I so had it
If you could craft the sentence that I could say that would make you feel better... what would it be? Just curious, I'm 100% certain that there is a 50% chance I won't say it.
even if you ran the code properly you still won't be in top 10
that ^
Yeah, well that makes sense. Your dwelling on the pitfalls that didn't make the difference.
You see my gif above... that is why I'm not on the leader board
wim
wim
@Unihedron wrong
05:21
^ mean
We were having therapy and I dare to say making progress
wim
wim
haha
I'm not really hurt
wim
wim
pi R u anonymous user #209487?
it's just that I'm the only person in the room who can pretend to feel unsatisfied right now to move our characterization subplots forward
wim
wim
oh
sean smith
05:23
damn it I missed it again :(
I'm Sean Smith
wim
wim
i wonder who is anonymous user #209487
would have had first lmfao
wim
wim
could have would have should have
yeah yeah
05:25
welp
I'm not keeping around these scrap code pieces anymore >:(
I would have had first if I'd only submitted the correct answer before anyone else. damn, just one little thing
@piRSquared HAHA
yes, it's just so simple
why isn't everyone on first right now
5 00:22:10 1405 0 00:22:35 1206 0
Had first part in about a minute
I counted first jump and got penalized 30 seconds
wim
wim
05:27
anyone optimize the loop?
day 3?
oh, sorry
no
I'm working on day 3
@wim anon user is @ReblochonMasque
or which one were you?
there are now 2
grr
stereotypical places 1-3 :D
1) 971 xiaowuc1
2) 834 Robert Xiao (AoC++)
3) 824 sciyoshi
@MarcusAndrews that Jouni K. Seppänen is again at 20th place... crazy guy
I still haven't woken up yet
wim
wim
05:33
I wonder if the puzzle index page is going to be a puzzle at the end
it's starting to look like a maze
it seems randomized just like before so my guess is no
it looks like an engineering circuit, actually
I thought the xmas tree puzzle index page back in 2015 was going to be a pachinko challenge :(
go back and read the 2017 day 1 lore
apparently you're fixing a printer
and stars power it back on
LOL - I showed up to a gunfight with a toothbrush! It took me 10 minuted to get the data in a list! Completely unprepared ze reblochon! :D
05:40
@ReblochonMasque with my helpers it was:
list(map(int, d.lines))
tfw u were "prepared" but performed as good as the guy with a toothbrush
now it is list(d.extract_ints)
I know, I've seen your repo... you are a pro! :D
and my rank: 700+
I am no pro
I'm not getting enough of a head start to stay top for the rest of this
anyone wanna practice by going through 2015 TIMED?
05:42
when A* starts, well I've got mine ready :P
>and my rank: 700+
what was your show-up-for-the-gates rate?
I mean today it was 700+
o
      -------Part 1--------   -------Part 2--------
Day       Time  Rank  Score       Time  Rank  Score
  5   00:07:10   505      0   00:07:59   360      0
I started on day 2, about 8 hours late then ...
wish score would get computed from when you first see the problem or something but too many people would cheat that
05:50
I hate to still be whining but I wish I don't mess up
I wish you didn't mess up either
cbg ^^
I'd feel much better about trailing someone who didn't mess up
I'm top in every private leaderboard I'm in... except my own
man
I want my tiny adventofcode clone :)
but idk how to setup nginx :)
I think a global penalty is effective but it shouldn't penalize so strongly... maybe every 1 hour going by only counts +10 seconds to your submission fallback
If I have a list of tuples, and I want to create a list of objects that use a tuple in its constructor, is there a way to do that with a fancy list trick, or do I need to just use a for loop?
like objects = [NewObject(some_tuple) for some_tuple in list_of_tuples]?
from itertools import starmap

tups = [(1, 2, 3), (4, 5, 6)]
FeuxObj = lambda a, b, c: a + b + c

list(starmap(FeuxObj, tups))
starmap unpacks the tuples for you and passes them to the callable
unless that isn't what you were getting after
Or without starmap
tups = [(1, 2, 3), (4, 5, 6)]
FeuxObj = lambda a, b, c: a + b + c

list(map(lambda tup: FeuxObj(*tup), tups))
Sweet, nailed it
You guys are so fancy
time to make some competitive programming-oriented templates to feel raise my self esteem
what do you call the queue / problem-solving approach that takes elements, runs them in a size-limited stack in parallel, and free up the corresponding queue slot when a task is done (reaches zero)?
a simulation?
I know there are tricks like "simulate multiple ticks based on smallest ticks remaining" but I can't narrow them down
06:55
hey
lol, I liked Day 5. I had to add 19 characters to my function to do part 2 :D I may not be competitive with on the global leaderboard, but I'm still having fun.
can anybody suggest me with a webiste or something? so that i can learn python
we're all playing adventofcode. use it to get directions on something to learn
like i know the basics but its been a long time cuz i have been working on android/java recently
06:56
My goal for problem 1 each day is to write something that will make problem 2 be only a small fix. So today it worked out great. Day 3 was awful in that regard xD
I bet google knows a bunch of them
tbh, that's all I would do to give a suggestion.
yeah, keeping your brain open for part 2 is really important if you want to fight for a top spot as well
quick hacks will penalize you if you are forced to rewrite your code
I think this is where Aoc shines over other quickcode platforms, in that it's less about knowing tricks and more about employing tricks
Lol, I am not going to bother pre-writing code. I even manually rewrite the input parsing stuff each time, even though it's pretty standard.

I agree.
>manually rewrite the input parsing stuff each time
yeah
now i know what you guys are talking about
07:00
this is why I'm using ruby for these type rush questions - input is as simple as $< and gets
after a while these minor drawbacks destroy themselves tho
microoptimization does not pay off past the midgame
If I really cared I'd have a script pull down and parse the input automagically... but I don't... not even close xD
tnx budddy @piRSquared
woah, someone already has a module for that. neat xD
I wrote an AI to not only pull down the input at +1 second after being available but also to parse the puzzle and solve it... problem is... I did a horrible job at it.
and by someone I mean wim... I shouldn't be surprised
It only has to succeed on one problem for you to be famous/accused of hacking :)
07:04
@piRSquared sounds like a good plot for a stand-up comedy show
well tbh, it just drops 42 in the answer box and submits /crossfingers
wanna make a comedy show?
I play Poly Bridge and there are solutions that are like 1/50th the cost of going from A to B because they use some physics glitch to spaz to the finish line.
@Unihedron I'm really good at making one person laugh and that would be me.
@TemporalWolf By physics glitch do you mean quantum tunnelling?
although that one is less glitch and more physics
07:11
But not very efficient to spend $72 for every car that needs to pass
Not to mention the dent that needs fixing
and the risk... don't forget the risk
the casualty rate is going to be through the roof (pun intended)
Before I saw those videos I thought these people must have been hackers... but I was very, very wrong
That's pretty funny
rbrb
07:57
Cabbage
This reviewer doesn't understand what NAA means. Sure, it's technically a poor answer, but it's still an answer. (10k+ only) stackoverflow.com/a/47633121/4014959
08:16
cbg
08:47
` Device=""
Value=""
for key, value in row.items():
print(row.items())
if key == 'Time':
Zeitvalue = value
print(Zeitvalue)
Device = key
Value = value
print("Dev",Device, "Val:", Value)
doc = {'Device':Device, 'Measure':Value , 'Time':Zeitvalue , 'Sourcefile':filename, 'properties':data}
print(' doc: ', doc)
es.index(index=PWbox_name, doc_type='trends', body=doc)`
hello i want to use Zeitvalue in doc but i get an error that the variable Zeitvalue is not defined.
because it is in locale variable in if loop. How can i make it globale
thanks for the Help
@AhmyOhlin If you want to format code in a post, press ctrl+k, or see the code formatting guide for more info: chat.stackoverflow.com/transcript/message/40291589#40291589
Because right now your post is one giant syntax error, so no way we could even try to help you
Hi guys, why does this simple code (Python 3.6.3 on Windows)

test = ["John",[["Doe",123],[],[],[],["Jane",432]]]
remaining_tiles = [x for x in test [1] if x]
for k in remaining_tiles:
print(k)
remaining_tiles.remove(k)
remaining_tiles = [x for x in remaining_tiles if x]
print(remaining_tiles)
print(len(remaining_tiles))

gives me:
['Doe', 123]
[['Jane', 432]]
1
instead of:
['Doe', 123]
['Jane', 432]
[]
0thank you in advance
hit ctrl + k and got this. now I feel dumb
Other question. Why do you guys not post questions on StackOverflow? The chat is intended for .. chatting, not so much q/a
Yes, pls ask your questions in the main board
I stored one list into file. When I read the text file it's type comes 'str'. Using json.loads() I tried to convert str to json and parse list content. But no luck. Any suggestion
08:58
ok
@MartijnPieters hats off for your helping nature and rep. man (y) seen your avatar long hai :D (y)
09:26
Yay! I just managed to beat one of the worst rep-farmers on SE.mathematics with a nice little trig question. :) math.stackexchange.com/questions/2551921/…
@AhmyOhlin Who is öe?
Woohoo, and now it is upvoted too @PM2Ring
@AhmyOhlin You aren't new here. You should be familiar with the room rules by now. Don't ask here for answers to your fresh questions. And don't post unformatted code.
Thanks, mystery upvoter. :)
it was anonymoususer 209487
@ArneRecknagel Questions are permitted here, and we even accept questions that may not be suitable for the main site, but we still expect people to present the question properly. Questions should be clear & concise, and code should be a MVCE, (with the code on an external site if it's more than a dozen lines or so).
We do allow people to ask "meta" questions about new questions, if they need help fixing a question that's attracting unexpected downvotes. That's different to asking for an actual answer to the fresh question, which is not permitted.
09:48
@PM2Ring Thanks for the clarification, I will keep it in mind.
cbg
do you accept AoC questions here?
If they are spoiler free
hm...
like, not posting an answer
You can use sopython.com/spoiler to hide relevant stuff
I can not use tabs nor spaces there
09:59
anybody here knows a thing or two about jupyter notebook ?
me probably
I had a question about the Jupyter Notebook's installation package. May I ?
yes
well idk
I guess
btw, the question is related to 1st part of 4th day of AoC
for some reason the answer is not correct, and it seems ok to me
there's something stupid I'm missing
input length is 512 lines so I assume it's ok
Hi
@Neoares hint: when VALID when INVALID
10:14
[django] I need to send every 48 hours emails to users never logged in with a reminder. Should I use custom management command and cron or celery periodic_task?
celery periodic task is fine
Celery is fine. But there is a chance of queueing the task
thanks, so I'll use Celery
@Neoares What exactly is the case when you increment the counter?
years, months, days, hours, minutes thise values accessed from a dict. now i want to create a string like "years = 12 months= 1" if there is only years and months. Consider a case only minutes and second . then the string should be " minutes=1 seconds= 1" . how can i do this in an effective way??
10:28
@ArneRecknagel when count > 0
which means I have duplicate words in that line
o wait
lol
mfw my hint tho
xDDD I said it was stupid thing, because code looked nice
@Ananthu maybe smth like that
@Unihedron yes, nice hint xD
d = OrderedDict([('years', 2), ('months', 0), ('days', 0), ('hours', 2)])
' '.join('{}={}'.format(k, v) for k, v in d.items() if v > 0)
10:45
cbg
11:30
How could people — how could I!? – live with the old nav?
saw your comments
grab popcorn and watch the post's timeline meta.stackoverflow.com/posts/359643/timeline
last night was -21 in a few hours
it's getting milder today; I'm afraid the question won't go into the negatives :(
heh
I've already heard remarks along the lines of "they shouldn't have fired the devs who knew how new nav worked" :D
haha
also, Mortensen left a comment on the question back in November about Sklivvz being ex-SO now; perhaps he's a human after all
(Mortensen I mean)
11:38
ooooh no! thanks
I'm still unsure what Shog's stance is...his answer seems to be a very verbose no-op
I think it’s a big warning not to mess up
11:55
I think it's more of trying to outline the importance, like "that time didn't work good enough, gotta do better"
I think nav 2 worked good enough except they never finished it...
I really liked nav 2. the problem was that I'm not an active SO user to begin with so I never used them a lot, but when I was on the site it helps me
I hope nav 3 will be a success
12:34
recbg
13:03
hi guys
with x = [3,6,8,1]
and than x.max() I get 8
how can I get the index of this 8?
x[2] I need to get know that the max is on the 2
x.index(max(x))
@JonClements o\
someone dropped that book's reference in the French Python IRC -> scaling-python.com
@AndyK did you come bearing milkshake!? :p
/me looks hopeful...
@JonClements welll ... no ...
soz
lol
13:15
aww shucks... gosh darnit and all that
but if we happen meet IRL, I buy you 2 milshakes
@Suisse lists don't have a max method, but then if you actually have a numpy array (MCVE!) you can use .argmax
Hi guys.
@AndyK I have that on public record - so I'll hold you to that :)
13:22
@JonClements my words are my deeds and vice versa, at least trying my best
you left a loophole that doesn't specify the size and type of milkshake youtube.com/watch?v=zoJAc_aSM7E
@Suisse as well as what @Andras has mentioned that you appear to be dealing with a numpy array and not a list - have you also considered what should happen if there's identical max values?
@Andras or a massive loophole that I'm not even sure what a "milshake" is and whether I'd want one let alone two? :p
How to execute task every 48 hours? - docs.celeryproject.org/en/latest/userguide/… Will crontab(hour=48) work fine?
whatever it is, it probably brings all the boys to the yard regardless
13:26
schedule.every(48).hours.do(function)
@paolo
Someone can help me on a regex case? I am unfortunately not good in this
regex?
splendid
just ask ;)
:) wait pls a mom.
here is my nested shit of jsons, strings.. and so on: paste2.org/72LmCn2P
I have build an regex like this: (],[)(?!IC)
13:31
regex has nothing to do with this because python's regex doesn't support recursion
use eval()
DON'T use eval
ever
and don't suggest using eval
re-cbg
when it would be safe to use, use ast.literal_eval or some specific parser
if it's unsafe to use, don't yamming use it
@madik_atma can't you change your input to something sane?
13:33
Uhhh, why not just json.load?
@AndrasDeak what kind of sane?
@Rawing does that handle null?
@Rawing its not working..
@madik_atma valid json?
note that I don't know what null is
Well, almost never. Sometimes you do need eval, and even if it's evaluating user input that may be perfectly fine if it's running on the user's computer. What does it matter if they trash their own hard drive via eval, or via a direct shell command?
13:35
@AndrasDeak No, its a http respond in a unvalid form of json. the firefox quantum can however show this like a JSON but I cannot transform this http respond to a json in python
my knee-jerk reaction from a non-python person suggesting eval in the python room is to say no :P
can you tell what's invalid about it?
FWIW, I used eval in an answer the other day: stackoverflow.com/questions/47613061/…
>non-python person
@AndrasDeak It does, null is converted to None
13:36
@madik_atma its valid json
@ArneRecknagel @marxin, How can I handle this json in a useful case?
there are no names to the keys, also not a valid form of key:value situation, or not?
json is not only an object
these are lists
and its still valid json
using eval is fine if you know what you're doing, which suggests that suggesting the use of eval is never OK on Stack Overflow
I'm going into segmentation fault in today's aoc
I'm doing it recursively
@marxin can you show me an simple approach how to use this kind of json lists?
*a simple
13:38
@Neoares unroll it into a loop
why Q_Q
it is soooo cool :'(
the result is larger than stack depth of most languages
so sad u.u
@madik_atma The only thing invalid about that JSON is that the text wasn't encoded correctly, so it has stuff like "N�rnberg" in it.
@Neoares I used to implement all my flood fills with recursion because of how neat it looks. then I got big inputs
13:41
trains = json.loads(data)
for train in trains[0]:
   name = train[00
   for point in train[-1]:
      print point
it's code porn :v
for example
@PM2Ring the encoding is not a big issue, but I am new at python and dont know, how to parse this information from this json e.g. in to a dictionary. I miss the approach for this
i dont know what your data represent
the data presents a transport log of trains and their target citys
its open data
13:43
@Unihedron I'm forced to change recursion to while True and break statements
I feel so dirty
yes, I find that recursion is best to combine with dynamic programming problems, not so much with search and simulation due to the depth we often hit
thanks @madik_atma
what what's happening internally?
I mean, it's not a memory overflow
@madik_atma You load it from an open file using json.load or from a string using json.loads, which will create a Python list, and that list will contain lists and dictionaries.
I have 32GB and the python process doesn't even fill a 1%
13:45
@madik_atma you need to figure out the schema of this json, what means what, and then just iterate and extract data you need
how to correctly name variable like this two_days = timezone.now() - datetime.timedelta(2)? :D
two_days_ago
@PM2Ring I get the data like this: data = json.loads(response.read().decode('utf-8', 'ignore'))
@mar
looks good, thanks @marxin !
python's engine is implemented as a stack engine similar to java's. recursion requires allocating to a new stack (which is why previous scoped variables are still kept) and these languages tend to keep track of recursion-allocated depths and halt before it's enough to indicate danger.
13:46
@marxin you mean I should iterate in to the nested lists? Or how can I understand your example
often most recursion algorithms can just be unrolled into a stack / queue and repeating until the stack / queue is done.
as I first thing, try to understand what schema is being used in this json, then parsing it will be easier
@Rawing I see, thanks
@Neoares sys.setrecursionlimit(100000)
or do it without recursion :)
13:49
@ArneRecknagel I increased it to 150k or so
did it work?
no
I'm gonna try with 150M xD
@madik_atma Ok. So that data list object will have your data. But as marxin said, to use or interpret that data you will need to find out the scheme it uses: what the positions of the items in the sublists mean, and what those cryptic dictionary keys mean. The JSON alone doesn't tell you that.
wait
1M is enough
not part 2 tho that needs 100M
no way
segmentation fault
same as with 150K
(core dumped) it says
13:52
@Neoares you shouldn't have seen a segfault
umm
good luck im gonna sleep to wake up in time for AoC
What the others are talking about is a "maximum recursion limit exceeded" error
me too
@PM2Ring @marxin Yes I unterstand the approach, but I dont know how to unterstand the data without the keys of the values? I mean If I want to create a dictionary for every route or train, I need for the dictionaries the keys. And in this data the keys are not to be seen
13:53
but if I raise the recursion limit, I get segmentation fault
that's us yes
@Neoares I'm not doing AoC, so I don't know what you're trying to do. But you may be able to reduce the recursion depth by caching. You may be able to use functools.lru_cache, but your args have to be hashable.
So why keep talking about segfaults?
Ah.
If you're talking about day 5, you don't need recursion. I'm not even sure how you'd do it with recursion.
@PM2Ring state changes through a naive "implement new cell" requirement after every cell, this isn't a dynamic programming problem but one with loops
13:54
That's probably why the recursion limit is there :P
@davidism cause it's so cool
def do_step(maze, index=0, counter=0)
etc
gonna give up on recursion yet?
That didn't clarify anything.
I'm doing it with a loop
@davidism it clarifies that it's cool
But...recursion!
13:55
@Unihedron Oh, ok.
I follow a simple strategy
keep it simple, stupid
the good ol' kiss
@madik_atma if you don't understand this data then we wont either :) it looks like CSV data but there are no headers. if you can download this data in other format, try it and then cross reference. or try to find it in documentation / ask data provider
yea recursion is a tool and this isn't the time to wield it :)
in most common approach trains in your data would be objects but they are lists and each index has its meaning
13:57
@Neoares Recursion in Python is cool when you don't have better options. Of course, some problems are naturally approached using recursion, like processing recursive data structures. But otherwise you should try to avoid recursion, since Python can't optimize it.
posted a 6-digit answer, says it's too low xDDD
Day 5 was boring.
@PM2Ring I remember something called @memo

« first day (2607 days earlier)      last day (2566 days later) »