« first day (2251 days earlier)      last day (2922 days later) » 

00:05
sleep postponed shortly, I had an idea
I'm increasingly proud of myself for nailing that heuristic cost as an uneducated guess:D
What did you use?
what you did
but looking at what wim linked, I could've guessed worse
I was actually surprised to get the right answer (rather than an upper bound) for first try
Did you see my reusable astar
no:P I've seen you use it
No I mean I just wrote it into reusabke in the bus
00:10
yes, that's what I figured from your a_star_solve(...) call
Could've used that for the day 11
Hello, I'm running into a weird little bug. I have a folder with my .py file and a text file named timestamps.txt. When doing: f.write("Hello") f = open('times.txt', 'a')
print f.read()
f.close() the text file when manually opened is empty. However, the .read() command prints out "Hello"
Oh my how do I format that
you seem to be writing to f before opening it?
and can you read from a file that is opened for appending?
you're confusing on multiple levels
if you add code in a separate message, ctrl+k will code-format it, that preserves whitespace
and I'd suggest using the context manager form with open(...) as f: ...
that won't help you now, but it's good practice
sorry I wrote that wrong, the open is first
00:19
if at first you don't succeed...
Ive tried many times over :D
Traceback (most recent call last):
  File "asd.py", line 3, in <module>
    print f.read()
IOError: File not open for reading
I meant "... at asking a normal question"
closing this question as: needs MCVE.
@AndrasDeak gotcha
This code writes to a file "times.txt" and when I do .read() it shows up with "Hello" in the shell. However, when I open the text file manually in notepad, I see nothing:
     f = open('times.txt', 'a')
     f.write("Hello")
     print f.read()
     f.close
00:23
ctrl+k
I did
it unindented
edit and ctrl=k again
it works to and fro unless you're screwing up something
now it's code
but it's unindented:P
cool thanks
oh
but it shouldn't be indented, by the looks of it
so it's fine
so, what does the "a" mode do when opening a file and why won't that work for you?
'a': open for writing, appending to the end of the file if it exists
00:27
and what does that say about reading?
idk stupid windows allows you to read from 'a'?
ssssh:P
Yes, I should just be doing this on my Linux install instead
no, you should not try to read from a file opened in append mode
I don't know how file buffers work, but I can imagine that what you "write" to f, then read from it, gets removed from the buffer, so it never gets written to the disk when f.close(), which is why you might see an empty file afterwards </wild speculation>
Ah so I should open it with 'w' and then open again with 'r' to read I guess
00:31
and closing in between, yes
and look at the with open(...) as f: syntax, it's good for you
That did the trick
woo :P
Alright will do, thanks for help
no worries
wim
wim
holy 50.9k rep n00b question
00:34
hahah woah
@wim 40k rep from 1 git answer ignoring rep cap
420 rep from top tag score
hmm, wonder why that top answer doesn't make their tag top tag with high score
nice catch
anyway, 12 tag score for python
wim
wim
ohhh, they have a +4702 answer
rep in itself is meaningless
wim
wim
00:36
gee, it would be nice to get one of those ...
I know a user who has a lot of [matlab]-related rep and asks buttload of useless crap questions
incidentally, their rep comes from a long history of mediocre questions
a few upvotes and a few down give a net plus in the long run easily
and I'm talking 30k rep total
time to ask even more idiotic questions brb
OK, I solved world hunger the problem that's been bugging me for days
2AM rhubarb
 
1 hour later…
02:00
zzz
02:11
recbg
I have slept exactly 2 hours before my PDE exam. Sometimes I wonder why a freaking JS developer needs partial differential equations in his life. Why am I doing this to myself?
02:27
are you in uni?
02:38
@khajvah Problem solving skills
cbg, btw ;-)
talking about problem solving...I need to do some of my own.
YUNOCALLload_tests?
Hm. Looks like we may have computed the graph. 16.3% of the Pi's RAM
Running in tandem on my macbook... though the pi had a couple hours head start
What day is that for? The most recent one?
11
the bane of existence
this is still part 1 :(
02:54
Day 7 is my bane. I was hoping to solve at least two puzzles today but I still haven't finished this one.
I'm running into some problems with unittest. I think I finally have a MCVE to illustrate the problem.
oh. I liked day 7 :P
The first part wasn't too bad.
apparently my graph-based internal abstractions suck, while my text-processing ones are skookum
I thought I finished part 2 earlier today, but I got the wrong answer. DSM and Andras gave me a few tests cases that I'm trying to use, but I'm hitting my head against the unittest wall.
I like graph theory. I'll have to do day 11 next, me thinks.
unless I go back to day 3 to regain some confidence.
lol
11 is worse than 13
03:06
@Code-Apprentice JS devs need Google skills only
@khajvah what part of the world are you in?
copy from stack overflow skill only
@WayneWerner At first I wanted to write that but I generalized :D
@Code-Apprentice Nothing that I wrote today(not only) in this chat was serious :D
I guessed as much
gist.github.com/codeguru42/d74bd0397bd33b3d8b84b949f6e37349 WTF is the difference between paramaterized.py and mytests.py? The former runs fine. The later gives an error.
hmmm...parameterized.py has one argument for __init__() but mytests.py has two...
DSM
DSM
03:27
Why are you overriding __init__ in the first place, if you don't mind my asking?
I'm trying to parameterize some tests
maybe I'm doing it the hard way ;-(
I read that I can use nose, but I'm not quite ready to add another dependency.
hmm...looks like the unittest framework calls __init__() with the names of the test methods in the class.
I was kind of following this answer. I am learning why they declared __init__() that way now.
@DSM I'm taking the list you gave me earlier and running tests with it.
DSM
DSM
Hope it helps; I tried to choose them to cover several distinct cases. Anyway, if you want to parameterize things you can use subTest, I think (but then I use py.test and so my unittest-fu is weak.)
hmm...maybe that will work, too
I kind of figured out how to fix what I was already doing. But the default output isn't very helpful to help me determine which inputs failed.
DSM
DSM
@MarcusS: is this your repeated comment problem from before? Every few hours you say "zzz"?
03:41
Nope, I'm just that sleepy
Predictions for day14?
DSM
DSM
Day 10 and 12 were "follow instructions" Qs. Day 11 and 13 were graph problems. I'm anticipating another command-based Q today, 'cause 14 % 2 == 0.
Although I have to be at work super-early tomorrow so I think I'm going to have to wait until tomorrow afternoon to find out if I was right..
03:59
okay...I think I got the tests to work.
DSM
DSM
To work, or to pass?
to run
two of your examples fail with my code
DSM
DSM
50% cheers, then. :-)
yah, it's a big step from the frustration I was experiencing 5 hours ago
hey, at least I'm learning more about Python, right?
subTests() kind of does what I want. Not sure how to run just one version, though...
with one of the parameters, I mean.
DSM
DSM
Hmm. Which ones fail? There was a bit of a controversy on that day about the interpretation, and I don't want to lead you astray.
04:04
eyunqqdlsaasqfbhwpc[fpmanqdfvhrosxaptp]aeyfdxouzzuuuxteclt[ganxlwtfygldvdhoquf]‌​paymaxgcegdvovaqxya[ylnriprhjdnkuntzp]oqfodnpayolcntvpo
Is this for part 1 or part 2?
Looking at my debugging output it seems more like the results are for part 1.
DSM
DSM
I think it was intended to be for part 2, but if I mixed up tls and ssl that wouldn't shock me. Give me a sec.
.. oops. Looks like I did give you part1 output -- since I randomize things it wasn't the same output I gave idjaw so I didn't notice. :-( My apologies.
no worries
DSM
DSM
Try this instead, and I just double-checked the SSL output with a different code too. :-)
I already encoutnered that with Andras example earlier, so I was thinking about it.
@DSM well, I pass all those tests
DSM
DSM
04:22
Huh. Is your code still the same as that posted in your repo?
I think so. To be sure, look at the d7p2/dsm branch
I just double-checked. The master branch is up to date.
as far as the solution code. The branches only have testing code.
DSM
DSM
'bcbdc[adadc]adaed' is True for me but seems to be False for you.
okay, thanks
oic...I probably get false because the []'s has both "ada" and "dad"
DSM
DSM
Similarly ('aba[abab]ad', True, False), I think.
yup, same pattern
found a couple examples in Andras' output, but didn't figure out why yet.
04:35
Does anyone know Kevin's data for 11?
@DSM Yay! I know where my logic error is now. hasBAB() stops on the first match.
DSM
DSM
@Code-Apprentice: excellent news!
Good luck rhubarb for everyone!
@DSM rhubarb.
aww...my tests all pass and I'm still too low ;-(
time to check with Andras' examples again
05:49
idk why I get this worng again
one off or two off for example input :(
ah
:'(
I am too sleepy
06:06
Kitten really doesn't want me typing any more... i.imgur.com/TrJxUd9.jpg
10
06:47
stupid me
wim
wim
07:08
@AnttiHaapala your code has a bug , and you are lucky that your data didn't reveal it
(minor spoiler): stopping here is wrong
07:56
@wim why is it wrong?
I am trying to rubberduck it here but I still don't get why it would be wrong
Can someone help this guy out: stackoverflow.com/q/41136146/2844164
Perhaps a mod can make a chat for this question
honestly I am at my wit's end.
cbg
08:14
@wim aah now I see :D
@wim did your input do this?
What was the bug?
I considered d approach but I felt it'd have way more string searches
08:32
Not quite sure I understand the bug (but might be because it's late and I'm sleepy)
@MarcusS I slept 4 hours :D
@Quirk just downvote and vail out
@MarcusS yes it is, I did it backwards for speed...
General approach: view spoiler
ahh
I am not at my sharpest after 4 hours of sleep :D
speaking of which -- heading to bed now
night
cbg
hey @randomhopeful
I would need your help
user6568562
08:52
@AndyK Hey Andy, how can I help you [ : ?
not-doing-the-AoC morning cabbage to you
user6568562
Cbg holden [ :
Working on getting the build system to build itself (versioned) today. My brain is already in a knot
I need to discuss that with you in another room than here
user6568562
@AndyK I understand, I can't open any, but if you do, I'll join
08:55
I'm trying to fix something here
I'll give you an update
user6568562
@AndyK Did you get it ?
Cabbage
user6568562
Cbg [ :
Is there a "rule" about the broadness in a code segment on a question/answer?
For example: http://stackoverflow.com/a/1594484/1824579

I have a 27" monitor and in my opinion it would be better when you do two comment lines in the first code segment (# Notice we don't use parentheses: ...) instead of only one and you have to scroll to the right.
Hmm, I'm getting downvotes here stackoverflow.com/a/40332461/4099593. Is there any issue with the answer, or, is it because of it's brevity?
Can anyone take a look at that?
09:10
@randomhopeful what do you meanµµ?
@randomhopeful I'll create a room
it will be easier
I have too many mails
user6568562
I understand, hit me up when you need, then
09:38
@BhargavRao there is a very major mistake with your code
... namely, it doesn't work.
hmm it works :D
Ah, Gotcha. I'll just delete it. Thanks
@BhargavRao don't
it works :D
Err, I deleted it
I'll undelete it :D
add more code. You should say "maketrans" is needed to make a translation table for the str.translate
Furthermore i think he is very new to Python.
09:40
make it to full-contained answer: "here is the code that works"
and put the translation table outside the function...
"this can be precalculated"
and I think I am rather going to cast a cv for MCVE
@AnttiHaapala Gotcha, I'll do that once I'm done with the mod queue. Thanks :)
note that the question just prints the after...
Cabbage!
cbg poke
09:47
morning
@manuzi1 Feels like PEP8 guideline of 79 chars would make sense, particularly in a question answering python
And beyond that, those are probably more suited to block comments broken over several lines.
The code window shows about ~90 characters
@poke Yes, but my question was to split it. As above shown its pretty weird. Especially when their are comments.
10:04
it's pretty horrible having to scroll horiztonally
10:38
Cabbage
cbg PM
@manuzi1 If you want to edit that gigantic post to eliminate the horizontal scrolling, please do so. Let us know when you've finished & we'll approve your edit.
Hmmm. The Chat server seems to be misbehaving. Again.
10:54
\o\
11:06
brief cbg
I screwed up today's AoC twice by not reading the instructions right.
Awwww @MarcusS has a cute felid
@AndrasDeak I got the right answer from wrong solution, as always
Hi I'm using pytest. I was wondering where to put fixtures that you define by yourself and want to reuse across multiple modules ? are they supposed to go conftest.py ?
@AnttiHaapala heh
that's weird
they're all beasts, blood-thirsty predators
they are, but cute while eating your face
11:09
@EagerNoob yes
(continuing where I left off) Because they be imported any other way.
thanks vaultah
Hey, Im trying to create an instance of a class inside of a worker process while using pathos.multiprocessing. Im getting a: "global variable [class-name] not defined" error. Ive posted a question, but after many views, no answer. Is this the place to look for help?
11:27
FWIW, I've just put my bitcount_speed_tests.py on Gist. It now runs on Python 2 or 3, and conditionally imports popcount from GMPY. The docstring contains typical output from running the script on Python 3.6 on my 2GHz single-core machine.
cbg!
@AndrasDeak "If cats looked like frogs we'd realize what nasty, cruel little bastards they are. Style. That's what people remember". — Granny Weatherwax, from Lords and Ladies by Terry Pratchett.
I guessed the book from the quote;)
btw cbg
in C, 2 mins ago, by Peter Varo
no real conclusions, no solutions what-so-ever, yet I think it is a lovely article for the morning which can bring the two sides together to agree on some basic things, that is, devided by a common syntax means there are (at least) two types of philosophies out there, and therefore there are (at least) two types of programmers out there.. we cannot agree on everything, deal with it :)
@PeterVaro Nice article.
11:43
'tis, isn't it? finally something that is not rude or harsh -- it is a good way to start the day :)
@AndrasDeak @PeterVaro 2 investigating journalists just resigned from our national broadcaster YLE, said they were restrained when they wanted to investigate the business/investments of the PM and the relatives. A MP from the Finns party says that "he'd rather prefer that these cases wouldn't be handled publicly. Likewise the MPs Finns party and our agrarian corruption party "continue to trust in the leadership of YLE". Everyone is now comparing us to some other country...
haha:D
we've just quit from an international anti-corruption committe, because...they were being mean to Hungary:(
my home country became the boogeyman
11:45
> I'll create my own anti-corruption committee! With blackjack! And my best friends in charge! And forget the blackjack!
@AndrasDeak not because of that, more likely because they wanted us to leave anyway and we prevented this to happen by leaving in our own will
@holdenweb I guess it might be a good idea to report the name of the selected log_path.
"How dare you criticize our politicians! They're the best politicians that money can buy!"
@PeterVaro why did they want us to leave?:D
@AndrasDeak you have three guesses.. :P
@PM2Ring LOL
pushed day 14 \o/
I'm so 2008
11:51
@AnttiHaapala "he'd rather prefer that these cases wouldn't be handled publicly" That's actually reasonable: trial by media sucks, especially if you end up being innocent. But for that to work you must have an independent body that has the power to investigate corruption allegations properly.
@PM2Ring that is, the underlings brought to the public attention that they're being repressed by the management and they're not allowed to publish their findings because "they would affect negatively the national broadcaster"
the problem is that the independent body is the non-partisan governing council set by the parliament...
IOW, the independent body isn't as independent as it ought to be.
whistleblowing in Hungary implies that you're going to have a whistle thrust down your throat shortly:P
Have to go now, Bisy Backson
@AndrasDeak your whistleblowers are true deep throats :D
11:56
there you have your answer why hungary so good at making porn :P
It's reasonable for a journalist or any other citizen to blow the whistle, but then the actual investigation needs to be conducted by proper investigators. Otherwise it turns into a media circus and innocent people can be unfairly smeared.
We've lost some good politicians in this country due to allegations that were later proven false. The allegations make the headlines, but the fact that they were later found innocent doesn't get anywhere near the same publicity, and once you've had your name smeared with mud it's very difficult to undo the damage.
@PM2Ring this is the corruption party of Finland...
In Finland we have one party that runs pretty much every rural municipality.
There is a joke that when they're filling offices there, they'd sometimes say: "As there is no applicant who's a known member of the Centre party, we should instead choose the most competent."
@PM2Ring I will do it in the next few days, today I have no time. But generally I wanted to know if there is a "rule" for this. ;)
Our current federal government party is a long-standing coalition of the Liberal Party and the National Party. The Nationals were formerly known as the Country Party, and are very strong in the rural regions, especially at the municipal level, where they and their buddies tend to be major landowners... So I know what you mean. :)
@PM2Ring and in this case they asked the PM to deliver a comment, PM refused, so they published it anyway, citing other media about what the PM had said (denied all knowledge), after which the PM started bombarding the journalists and their superiors with emails.
yeah :D
but at least now their representation is quite small I see from wikipedia.
@PM2Ring and the reason why this all started to escalate was because one of the journalists published the emails that the PM had bombarded her with.
12:07
@manuzi1 The rule is: if you can improve the formatting of a post, go for it! If others disagree they will reject your edit. When you have sufficient rep, you can make edits without approval, but if others disagree with what you've done they can revert your edit: the system keeps a history of changes to posts, so that's very easy to do.
Ok, ty. ;)
@manuzi1 but do not reformat code in questions unless you're sure you're not hiding the bug :D
@PM2Ring one of the resigned journalists was a member of the The Council for Mass Media
"Its task is to interpret good professional practice and defend the freedom of speech and publication. CMM does not exercise legal jurisdiction. The journalists and other personnel engaged in media who have affiliated to the CMM have, ipso facto, committed themselves to advancing and upholding the ethical principles of the profession."
@AnttiHaapala Ok. People can reasonably expect their private correspondence to be kept private. OTOH, a PM emailing a journalist should have enough brains to realise that the journo will use that information. :)
@PM2Ring it wasn't correspondence
If the PM was spamming / harassing the journo, then the PM only has himself to blame.
@AnttiHaapala Good point, but manuzi1 is talking about re-formatting code comments in a community wiki answer. Some of those comments are 3 screens wide on my ancient 1024 x 768 monitor.
12:13
yeah
that is perfectly ok
80 chars should be the absolute minimum
.... and you need to stop using that CRT :D
Hey, this is my 2nd LCD monitor. :) Yes, it's ancient, but I'm not complaining because it cost me nothing. OTOH, I do miss the superior colour on the old CRTs.
12:40
2nd lcd monitor :D
srsly?!
I jumped from 15" CRT with that res straight to 22 inch 1680x1050 and then full-hd.
and only thing about the CRT that was superior was its radiance in the X-ray spectrum... :D
@AnttiHaapala Yes. And my first one was free too. A friend on an old forum that no longer exists took pity on me when my last CRT was dying, and he sent me a LCD monitor.
it is so funny, I was a cheapskate student that rather bought whisky than a new monitor...
then one day I was like "oh shit... this is 14 years old"
if I tuned its pixel clock in X11 carefully, it could almost do 75 Hz
Of course, in my early days of programming, most of the machines I used didn't have monitors, just line printers. The exception was a machine that I learned APL on. It had a vector graphics monitor, with a light-pen. Bitmapped display was still a very expensive luxury back them, mostly due to the cost of the RAM that was needed to store a bitmap.
but you're ancient
True. :)
12:48
my first computer did have a monitor, a 14" tv <3
I don’t remember how big my C64’s TV was..
i.e. the TV we were using for it.

« first day (2251 days earlier)      last day (2922 days later) »