« first day (2605 days earlier)      last day (2568 days later) » 

00:01
@Craig Maybe PyQt hasn't caught up to Python 3.6 yet. This looks relevant: stackoverflow.com/questions/42090739/…
@PM2Ring Thank you, though I'm not clear on what 3.6 offers that makes it necessary to use it over 3.4.
I don't use PyQt nor pygame, so I have no idea. But maybe they wrote the pygame stuff separately from the PyQt stuff, and used some Python 3.6 features with pygame, and then when they tried to combine everything they realised that they had a problem.
00:29
I'm getting closer to an answer: dpaste.com/2G9DA0Q
Sorry I forgot to delete num and value
DSM
DSM
00:48
Why do you call int?
To subtract min from max
DSM
DSM
So you need to call int before you can get the right answer from the subtraction operation?
Doesn't give the right answer (in this case it does). It's a string otherwise.
Without: TypeError: unsupported operand type(s) for -: 'str' and 'str'
DSM
DSM
Makes sense. Is subtraction the first operation you perform on the elements of i.split()?
@Simon Here's something to watch for:
DSM
DSM
00:57
@Craig: SPOILERS
So much for my Socratic attempt to get Simon to notice the problem himself. :-/
Sorry. I wan't meaning to interfere.
Problem is max and minseem to reverse. Like a sequence. First they are ok then max becomes the min and next it reverses back.
Iv'e printed out max and min individually and it returns a minus when subtracted.
DSM
DSM
@Craig: ehh, no worries, it doesn't seem to be working. You're welcome to take over.
:)
it was a heroic attempt none the less
DSM
DSM
I suspect Socratic methods work better in person than they do in text.
01:02
I don't think the medium is to blame...
My useless attempt?
DSM's attempt at pulling a Socrates
DSM
DSM
I'm clearly the best teacher because I see I can't teach.
Those who can't do teach, but then what should we do with you?
actually, in Hungarian it goes on with "those who can't teach teach P.E" :D
I'm not quite sure I understand yesterdays comment and how it relates to this.
01:07
I was merely referring to an existing history of communication difficulties with you
Unprepared typing.
DSM
DSM
@Simon: focus on why your minimum is greater than your maximum. You've spotted that's a problem, and you're right, so track down why. Reread the questions I asked and think about their possible relevance.
And now I'm going to go off and start preparing myself for tonight's adventure in Korean cinema. daehwang!
oriental rhubarb to you too
@DSM Thank you and rhubarb.
01:30
Ah-ha I need to convert the list from string to integer.
I just needed to convert the list from a str type to int type. ; )
@Simon :-)
01:46
I'm still curious why I needed to define map() twice. Once didn't work. Oh and I am now moving on to part 2 of the challenge. ;-)
you never defined map, only called it
look at print(c); map(int,c); print(c) and notice that calling map on your list won't affect it
Warning: Communication Problem Alert. : P
Indeed it does not.
this will actually be a huge problem if you don't get used to communicating your intentions and actions clearly
doing one thing and saying another is the recipe to leave you stuck and those around you frustrated
Yes.
Hey. That's my new years resolution (along withother things).
for 2017?
01:50
2018
Does that imply you're not planning to try and focus your communcation efforts until new year?
I've done it again haven't I?
I don't think so
I have, you said 2017. Unclear again. : /
that might have been an attempt at so-called humor on my part
but my question still stands
01:53
Ah you've bought it back. Well I suppose I should start from: 3, 2, 1 Now.
thanks
a dfnjn dasm kdlam kjlk. Right?
No seriously I will work on it.
Looks like my next challenge is going to involve the % modulus operator.
Well I'm not attempting it yet since I've got to go. Happy-rhubarb. : )
rhubarb
 
4 hours later…
07:37
Anyone familiar with the Blender API? How do I select a group in the outliner?
came for adventofcode :) not using python though :/
@AnttiHaapala Nah, I'm traveling -- won't be competing/racing, but will still log in from time to time
@Unihedron Aww, you bumped me down one ;-(
sorry :( you gotta redeem yourself on the next one ;)
07:48
well, I have to sleep on part 2. I'm stumped.
@Unihedron I still haven't solved Part 2...
yeah ^^ good luck!
I actually slipped pretty hard today. The math struck me and failed guesses were too penalizing. I was at the level of waiting 5 minutes between each answer...
I don't remember how points are computed
Also fancy seeing you here Uni
hello
@MarcusAndrews SELECT max_score = count(*), max_score - (ranking - 1) AS score FROM board GROUP BY star
first to clear star in a leaderboard gets full points, second gets full points - 1, etc down to minimum of 1
mm, I'm at a measly 56 for starting so late
i'm in a different time zone, have to figure out what time this translates to
just look at the grey countdown in the calendar and try to figure out by the hour offset
It's 1 pm in my time
public boards has a max score of 100 (gotta be in top 100 to get points for global) and private boards takes user count for it so it scales on new / leaving users, the order stays somewhat consistent
07:54
unfortunately I won't be at a computer when these things go live XD
I'm on the public leaderboards but having slipped up so badly on day 3 I'm surprised I'm not getting punished for it ;)
I work at home, so that helps.
day 3 part b depends a great deal on how you went about part a
(in terms of whether you finish quickly)
is the case for most of these problems, anyway
yes. short-sighted approaches will be punished. the design is lovely in that you have to decide for yourself - take risks and do the hack job, or predict what the full task is gonna be?
sometimes it depends on how far into the problem set you are -- for instance if this were a later problem, i would have predicted that part b would just ask for a huge number, preventing iterative approaches
(would prob. end up being wrong anyway, but my usual strategy is just to hack-job part A and try not to be too clever)
I read on the (SPOILERS WARNING: DO NOT READ THIS IF YOU HAVEN'T DONE DAY 3 OK) solution megathread that people just looked up the sequence on OEIC
I didn't cheat though. I generated the spiral by hand.
I am, however, not proud of it.
07:59
I generated it too -- figured that he wasn't going to enforce a tough math problem so early on, so it was probably going to involve iteration
I'm doing this for fun. Figuring it out is the fun!
i wonder if there will be an overabundance of BFS-style problems like last year
hopefully not
Have fun ^^
@MarcusAndrews I hope yes
was my one main gripe with last year
08:00
The field I'm most worried about is "interpret a program" stuff like the 2015 input -> output wiring and 2016's "machine code"...
If you have a nice A* implementation then it adapts quickly enough to most of those graph problems
no way I can hold the leaderboard against hungry wolves with contest experience who are all about those logic gates...
IIRC most of those are just if-statement soups
@Unihedron too many failed guesses and you have to wait before submitting another one?
@Code-Apprentice 2nd guess is free. 3rd wrong guess costs you a minute. 5 minutes from there on.
08:02
For part 1, I implemented a recursive solution to generate the coordinates for a given number with 1 at the origin.
That is a smart idea, I was caught in the trap of maths. I noticed that (SPOILERS) corners are square numbers, so I wrote one line to get next square after gets.to_i and tried working it out on paper.
center: 1
bottom right corner value: h
bottom left corner value: h-u
left top corner value: h-u-u
right top corner value: h-u-u-u
to find the answer: no clue mate
after drawing what would likely be considered offensive to the people who built the pyramid, I constructed the spiral manually. Turns out I reused a big part of it for part 2.
we have a similar problem over at PE projecteuler.net/problem=58
@MarcusAndrews Click on the "Ordering" link on the leaderboard page. It explains points.
@MarcusAndrews you a PE fan?
@Code-Apprentice he a PE problem moderator
@Code-Apprentice I'm on the team there
08:06
cool, been a very long time since I solved any PE problems.
surprisingly my password is saved on this computer. Didn't know I had even logged in that recently.
I have really fond memories of solving certain problems during december months prior to joining the team
in particular 344 and 361
Looks like I've solved 75 of the problems.
I found PE pretty late. I think there were around 300 when I first started them.
Very interesting problem! I think the essence is to generalize figuring out the numbers in the diagonals for depth N. since you could reuse most data from previous rounds (N-1) the spiral is a nice abstraction to diegetically supply a sequence.
are you talking about the aoc problem today?
yeah problem 3
08:11
The linked PE. It's very similar to today's Aoc
what I did in part 2 was...
I saw that. Looks like I solved PE58 already. Don't even remember how I did it.
NO SPOILERS!
If you want to know what I did, look at the solutions megathread. I highly recommend figuring it out beforehand for yourself, because it is not only a well put exercise but also really fun to work out.
Looks like I've solved 33 puzzles on PE. That's a lot for how little time I spend there... Usually someone links a problem, I see and solve it, then I exit the site and it vanishes from my life for another few months.
hmm...I solved PE58, but I don't have it in my git repo
all of yours are in the first 100 too -- the problem set changes quite a bit in style over time
08:13
I must have never pushed the branch I did it on nor merged it into master ;-(
anyhow I've gtg -- good luck with AoC, everyone
@MarcusAndrews yah, I have looked at later problems and attempted some of them
oh there's a F# repo on the wiki
Time to head to bed...past time even. I'll have to work on Part 2 more tomorrow.
rest well!
08:19
DAMN
my msg too long :F
@Unihedron I see you joined spoiled my leaderboard, too =p
Somehow your spoilers aren't linking
multiline messages don't trigger markdown
yes
@Code-Apprentice well, I thought of drop a greeting as well, but turns out I don't have room access
no it is again that if one double-clicks on the spoiler page in the text box, one gets that link with 4 spaces prepended
08:21
I searched for "advent of code" in the SO chat search engine
also, use that as motivation to overtake me :D My only strength is typing speed, I lack real contest experience for the later problems, so try to beat me with my headstart :p
@Unihedron yah, Android has been like that since almost the beginning. Early on they had a problem with help vampires completely taking over the room and had to make some drastic decisions to fix it.
I appreciate the competition. I remember from last year that later problems get more challenging.
I will spend an hour or two on them every day. Might not solve all of them in the alotted time, though.
okay...rbrb for reals now
08:50
I made a repo and linked it in the wiki. It's not very pretty code but it's quite the remains of a battlefield.
09:27
@Unihedron you can clean it afterwards!
09:39
The more I look at other people's code the unhappier I am with the way I handled the 2nd challenge :I
noooooo, don't make me look at another solution that's better than mine :(
That's cheating, all the heavy lifting is done by code from a different file :P
I actually derped really hard in the 2nd puzzle, but on the bright side, I think my solution for the first part has the best time complexity out of all the solutions I've looked at
10:05
Cabbage
There was a C + Python question yesterday where the OP discovered that he can mutate a bytes object that's been passed using ctypes to C code. I found that a little surprising.
10:23
Looks like I missed some "fun" yesterday...
@PM2Ring Why's that?
@JonClements Well, bytes is an immutable type, and so I expected that would be honoured by the Python-C interface, and if you want mutable bytes you should be using a bytearray.
Oh - was it actually using the Python C functions to mutate it? Not just copying memory/about or other stuff?
I don't imagine it'd take large amount of trickery to get it do what you want, but if you're calling something on it that's supposed to not do it and it does - that's a little confusing...
@JonClements Well, it was using ctypes to make it available to a C DLL. I guess it's up to the C code in the DLL to declare it as const. But then when you inspect it from the Python side the original bytes object has changed. I think. :) Give me a minute & I'll try to find the question.
Note that str behaves like it's supposed to.
10:40
Ahh... was thinking char* c looks a little odd for the function there and looks like Mark's explained it...
Mark Tolonen hadn't written that answer last time I looked at that question. And now I remember reading that warning in the docs.
11:00
@ReblochonMasque I think that code might be a little confusing because it has both a global & a local diceOutput, and it's not clear that they're two separate names.
11:37
Day3 is looking more interesting.
I enjoyed it
@PM2Ring ok, I see your point - I removed the global variable and renamed the local one. Thank you
cbg
@ReblochonMasque No worries.
11:43
air is cold today. Went for some biking...brrrhhh
can someone pls quickly tell me why this syntax is wrong?
if group.name == 'Boom' or group.name = 'Outrigger':
also can't I do || inseatd of or in python?
No
And please read over your code again, the solution is simple.
Read both statements either side of the or
Iolz thx..did't see that one^^
thx
if robots_kill_humans = True:
stop the robot
if robots_kill_humans == True
stop the robot
... not the same outcome!
in one scenario, we all die... the other scenario, we might live
11:51
Yes!
@ReblochonMasque That sort of thing has caused so much grief in other languages that Python just doesn't let you do it.
Yes, the examples I saw were in java.
 
1 hour later…
13:19
I'm not sure whether to give up with Advent of Code or not.
@Simon why would you?
which problem?
It's likely that if I continue I'll be on here asking questions every days until the 24th
Today's and yesterdays.
and? :D
you don't need to ask, you just see :D
I don't want to waste everyone's time with useless codes.
Take my conversation yesterday for example. It's going to be like that every day.
Yeah I give up.
13:32
hello
Im new to django framework. can anybody tell me what is the best way to develop apps using django. I mean is it ok to use mod wsgi all the time or its better practice if I configure an nginx webserver ?
If you help me with the pros and cons Ill be glad
develop != deploy
Yeah I know. But in php I'd rather use apache or nginx even for development since I'm using linux machine
But I want the standard for django. I mean what people usually do
are there any limits if you use wsgi all the time ?
the django development server works way better
easier to restart
Couldn't reuse my sweet mathy solution for the second part of problem 3 :(
13:49
Well, yeah, it wasn't so sweet...
however ...
@vaultah view spoiler
14:10
Finally got to AoC today. I solved the first challenge with pencil, paper and a calculator.
I wrote a generator for the second.
And I'm doing the whole AoC in Jupyter, just to see what that is like.
Hm, only 3.5k people have solved todays puzzle, not feeling so bad for being so late now.
14:26
Yeah today was difficult unless you saw the integer sequences "trick"
well, it wasn't necessarily difficult, just inelegant
Well yeah.
Python 3.5 to 3.6 performance improvement is quite significant! Didn't expect it to be as much as ~50%
Can be bruteforced with some work, but a bit nasty
Simply upgraded docker production from python:3.5 to python:3.6 and free performance :D
Avg. perf improv maybe around 15-20% but landing page is what matters (which gave ~50%)
14:36
that reminded me to push my solution for today
14:49
@Ffisegydd @AndrasDeak look at mine :P
I'm looking for a good dupe target for this. I found stackoverflow.com/questions/10262920/… but I was hoping for something more to the point, and with more depth.
For the last time Antti, I don't want to look at it.
Stop asking.
@Ffisegydd pfft!
@Ffisegydd He's a Finn, he can't help it. I blame all of that time they spend in saunas. ;)
I initially did what you did on line 16, but then I realized it's semantically more correct to use the vanilla type
14:55
That's a nice solution though.
And I'm definitely going to steal your helpers lib
15:10
Anyone know of the new way of setting up pypi modules? Much easier than the "normal" way in that you define an rc file
Hey guys, I am getting tired of moving my arm every time I need to search something on google. Is there a shortcut for choosing the first (maybe 2. and 3. too?) on the google result page?
It seems like there once was a shortcut for it, but it somehow vanished?
One way could be to press tab like 7 times or something, but that is quite ineffecient.
Anyone else with the same pain?
Here is some background: quora.com/…
What does that have to do with Python?
@Ffisegydd you mean creating a package?
I don't think anything's changed about packages or PyPI recently.
15:32
@davidism no there's something new that's come out that's made it much easier now.
I think it's even labelled as the "official" way now, but all the docs are out of date
Which part of it? Building, uploading to PyPI, installing?
You basically create a yaml file and then in your setup.py it's just from setuptools import setup.; setup(use="magical_lib_i_cant_remember")
You can put most of the arguments to setup in setup.cfg now, if that's what you mean, but I don't think it's documented very well yet.
And there's a pep about configuring the build system with toml, but I don't think it's accepted yet.
This is driving me nuts. I've used it at work >.<
Today's AoC problem probably has a really clever algorithm but the only observation I've made so far is the bottom right corners are odd square numbers.
Cool. setuptools must have responded to that, because now you can do that configuration without installing pbr.
Ah even nicer
I have no idea where that's documented though. I know I've seen it somewhere.
Yeah I'm struggling to find it
15:46
Nice. There's a few extra things that pbr does, though not sure it's as worth it now
automatic dependency installation based on requirements.txt
automatic documentation building and generation using Sphinx
automatic generation of AUTHORS and ChangeLog files based on git history
automatic creation of the list of files to include using git
version management based on git tags
16:19
Myself and @glassesattached are announcing that #everyframeapainting has officially ended. Here's the script to the final unmade video https://medium.com/@tonyszhou/postmortem-1b338537fabc
16:52
Cbg
wim
wim
17:07
@davidism google for "ulam spiral"
I pretty much had it pre-solved from earlier project euler work
17:18
@wim which project Euler?
Somebody mentioned 58 last night (this morning) and I checked it out. It was similar but my solution for the pe problem couldn’t have helped me for the aoc day 3. That killed me looking for some semblance of a closed form solution before I brute forced it
wim
wim
17:40
^visualization of distribution of primes in the spiral
it's a well-studied area by mathematicians, because you end up with all these crazy long diagonals of prime numbers somehow
Who was talking about pbr?
and the [metadata] requires-python tag does not seem to work.
the Requires Python tag on PyPI did not get filled out pypi.python.org/pypi/logging-tz/0.1.0
which means pip tries to download the sdist even when it shouldn't :(
compare and contrast with pypi.python.org/pypi/pynapple where Requires Python is correctly filled. That's from pure setuptools --> github.com/wimglenn/pynapple/blob/master/setup.py
Someone mentioned 58 so I go look. I have fun with that then start from beginning and work my way through 10. That was my late night relaxation.
wim
wim
@davidism do you have any pbr project? do they do the right thing with Requires Python and if so can you share the working setup.py / setup.cfg ?
I think Fizzy was the one with pbr
However I ended up just iterating over corners and checking primality. The convolution for aoc problem required me to keep track of all positions. At least as far as I could tell
wim
wim
17:50
ping @Ffisegydd
wim
wim
Do you have experience using pbr because I've had issues with it in the past
I've used it but not for any use cases that were very complicated
wim
wim
seems not correctly respecting the python_requires metadata
And not tried python_requires out :/
wim
wim
17:53
ok thx
I like the idea in principle, but the execution seems a bit hacky
the direction pypa guys are heading with toml looks to be better
Hi I want to know how can I use exception handling while using with open()?
@AmmarSabirCheema the same way as anything else.
though you'd also probably wrap it with with clause
I have read at places that exception handling is similar to using with open() is it write?
think of it like this: the freshest summer breeze is like a bucket of potatoes
18:05
Heh
@AnttiHaapala is this code write for doing this from __future__ import with_statement

try:
with open( "a.txt" ) as f :
print f.readlines()
except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available
print 'oops'
@AmmarSabirCheema from __future__ import with_statement is needed in 2.5.. which no one uses
and you should be using Python 3 :D
yes something like that. On Python 3 it is easier, because there are fine-grained exceptions such as
@AnttiHaapala and this is also used in python3 ?
from future import division
or not ?
yes, from __future__ import division is a must. It is not needed in Python 3, but it is needed in Python 2 for / to not be completely retarded, and thus compatible with Python 3.
future imports are only needed to use python 3 features in python 2
18:14
or Python 3 features in Python 3 :P
I was wondering about that but decided otherwise :P
thanks
i.e. every sane person would use a) python 3 if possible, b) python 3 even if not really possible, c) at least python 2.7.14 with absolute_import, print_function, division...
@AndrasDeak what @vaultah has said ?
Tell him Andras
and if you use Python 3 syntax features, the __future__ imports can be taken for granted - i.e. your program wouldn't run if it wasn't on Python 3.
18:16
@AnttiHaapala ok so
try:
with open( "a.txt" ) as f :
print f.readlines()
except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available
print 'oops'
it is write know?
*now
@MartijnPieters could you rerepin the formatting guide again ? :D
@vaultah lol :D
I wish we could future import f-strings (and with the same performant result)
I'm sad that the fancy new firefox starts to fall apart if you have extensions like noscript
well mine does :(
I just spent 30 seconds waiting for firefox to unfreeze after opening PEP479
then I got an XSS warning popup
also noscript's option page (is useless and) terminally breaks the GUI and I need to restart firefox afterwards
but every extension has had useless/non-existent option pages, so I'm starting to suspect this is a problem on the side of firefox :/
perhaps they've yet to port them properly into the new engine
18:25
Part b can be improved
Will add more later gtg
18:36
@MarcusAndrews you've got a closed form for part 2? :D
 
3 hours later…
21:09
"Since I am working with Python I think that saving a reference is not possible" - wat. — Stefan Pochmann 1 min ago
 
1 hour later…
22:36
hey guys, i have people who are going to be entering drafts on a django page. How can I store their data so that I can do a git-like revision control with their submissions.
like every other data that you'd save
22:55
@AnttiHaapala what?
i mean so I'll have a server with a database of their submissions, and i want to do revision control
23:12
@AnttiHaapala I can't, the bug still applies.
I believe Martijn has just found a sustainable way to gain stars
truly just as SO company imagined :|
Can I try, Can I try? /shakeshead
cbg everyone
something something the famous Elizabethan philosopher, William Shakeshead
23:19
i chuckled

« first day (2605 days earlier)      last day (2568 days later) »