« first day (1880 days earlier)      last day (3292 days later) » 
00:00 - 17:0017:00 - 00:00

17:01
@DSM I had to explain to the client why their math for working out asset reservations made no sense, and it took 8 hours for them to finally be able to explain what their currently manual process actually did.
Guys, multi-tasking is the worst :|
@corvid did you type that while doing something else?
Unless it's drinking while coding
DSM
DSM
@davidism: my client gave me rates which are two orders of magnitude off the population mean, so I can prove mathematically that their sample can only be representative of at most ~1% of the total population. A more biased result than I typically see..
Finally got day 7! Dear god that was annoying.
17:12
No sympathy Mr 'Solve everything with exec'
Actually wait... have you seen #8? It's actually a legit excuse to use that stuff.
The issue was that I forgot to remove is, as, etc.
@QuestionC Yeah, that's why I started doing it.
One day you're going to accidentally try codegolf/exec stuff in a technical interview.
@QuestionC Maybe they'll be impressed by my out of the box thinking!
You like have a love doing things in the most F'd up way man.
Or they'll just think I'm insane. Probably that.
Now I have to learn graph theory for this next problem. :/
I don't think I can work exec into this one.
17:18
#9? It's kind of hard for me too. I recognize the problem and know a bit about it through programmer osmosis but I never actually did any problems like this.
You don't really need to know travelling salesman, just be like "NP Hard yo" anyone asks you about it and pretend coding it is beneath you.
Is there a link to question 9?
Thanks, I haven't been following this.
More and more tempted to cave and just use networkx, even though that's not the point.
shortest_path(Graph(weighted_edges), edge1, edge2)
Eh. Tools are meant to be used.
I'd argue that having to learn a 3rd party lib is not non beneficial.
DSM
DSM
17:26
I figure people can use it as a springboard for whatever's the most fun. I saw a guy trying to solve everything with sed (just because he could.)
Can we make adventofcode.com a sticky star? Everyone's gonna be talking about it for the next month.
user559633
i like to not use networkx as i have more fun learning how to implement thing
After it's over, I was going to implement my solutions in rust or elm to get familiar with a new language, but using extra libraries just means more work then
@davidism Are you familiar with this type of problem?
What, shortest path? Yes.
Although the last time I actually implemented it was in college.
17:30
I'm sure there's some guy out there using Brainf**k or Whitespace for these challenges
@QuestionC Sure.
Q: I keep seeing Xmas themed puzzles being discussed. Where are they from? A: Advent of Code. Come play along!
16
Good shout
#9 Done. I'm now qualified as a Sophomore-year CS student.
I just re-did 7 using proper tree traversal, but I'm a little unsatisfied because it might give "maximum recursion depth exceeded" for wires with particularly long dependency chains.
It doesn't crash for my input, but it's the principle of the thing.
http://stackoverflow.com/questions/34185394/getting-n-elements-of-a-‌​list-at-a-time dup in comment
17:44
At some point, in some memory structure, you need to keep a list of the dependency chain though right? Even if your stack overruns, the solutions is to just do the exact same thing, not on the stack right?
Yeah I'm now considering doing something with an actual stack data structure, rather than making the call stack handle things.
My function isn't tail-call recursive unfortunately, which makes it not totally trivial.
NOT b -> a
NOT c -> b
NOT d -> c
....
@RNar you're probably right, but they way the op's describing it they want chunks of cpu_count at a time, not cpu_count total chunks.
actually, I think the dupe covers both cases
I also have to keep in mind an efficient way to evaluate, e.g.
a AND a -> b
b AND b -> c
...
y AND y -> z

without evaluating `a` 2^26 times.
yeah the dupe is about creating a chunk generator
17:49
Kevin did you Alpha-sort it for your original #7 soln?
No, I did an O(N^2) brute-force.
:-D
That's the programming version of chaining an ATM to your truck and driving away.
That's why I'm trying to write a "proper" solution now.
17:52
The "We'll stop getting Key Errors eventually" solution.
Hmm, maybe some kind of reverse BFS search...
My first attempt was O(N^?). It traversed the list a lot of times and I can't remember how to calculate O.
9
that describes my experience with O notation
I would be interested in seeing worse-than-N**2 solutions to that problem.
bogo_evaluator
> exec
Yup. :D
What is the O on that. I literally have no idea how to calculate that stuff.
It looks worst-case N**2.
Oh. :/
Hmmm, time to be more inefficient!
I mean, you just count the loops, and try to recognize the pattern. You're going to loop over each of the N instructions, and each time you're gonna solve at least one more out of N values, so it's N * N.
What's the complexity of inserting at the beginning of a list in python?
Maybe you just graduated to N**3 =D
18:04
@QuestionC Awww, yes!
@QuestionC I think it's amortized O(1)?
DSM
DSM
Appending to a list is amortized O(1) I think. Insertion at the start isn't.
Yea, instructions.insert(0, instruction) is O(N) and you're doing it O(N**2) times, and there's nothing logarithmic-looking in there so it's gonna be O(N**3)
You could consider using a deque
Does ftplib support sftp? I can't find anything one way or the other.
5
Q: sftp using ftplib

Abruzzo Forte e GentileHi All I need to download a file from a host using sFTP. Do you know if is it possible to do that using python ftplib? I saw an example here, but when I try to connect I receive EOFError. I tried this code: import ftplib ftp = ftplib.FTP() ftp.connect( "1.2.3.4", "22" ) This method returns w...

Thanks.
Wait, sorry, I actually need FTPS. (I hate that those are different things).
Is that just FTP_TLS?
I've never heard of FTPS
It's FTP on port 990 with SSL.
It's an old protocol, but it checks out.
7
18:15
Oh, I used SCP, recently.
Yeah, I'm dealing with a large bank, so I'd be amazed if they used any technology from the last 10 years.
They use elegant technology, from a more civilized age.
user559633
I wish I worked at a place that used 10 year old tech like Python or C++.
@tristan Go work at a bank, you get to learn COBOL.
I would hate to see their databases.
18:24
Whoops I guess BFS only works if each dependency appears only once.
diamond dependencies have foiled my scheme.
user559633
@MorganThrapp You can't spell COBOL without BLCOO
DSM
DSM
Now that was weird. All of a sudden my mouse was moving the pointer at 1/10th the rate but only in the vertical direction. O.o
Stray [pet] hair?
DSM
DSM
I'm at the office, where we don't have any pets, more's the pity. I wouldn't mind an office cat.
@DSM We have an office dog, it's nice.
Sometimes there's even 2 or 3.
DSM
DSM
18:33
I just brought up the idea with the firm's director and he reminded me that (very briefly) we had an office parrot, and I didn't enjoy the experience.
Eugh, Kahn's algorithm for topological sort would require me to keep track of parent nodes...
How do I spoiler? I can't find it in the FAQ
[hover for spoilers](http://www.example.com "insert spoiler text here")
I was gonna suggest something, but I realized you need to keep a parent list to deal with diamond dependencies, so it's probably Kahn's algorithm.
@tristan why's that?
Not enough enterprise BLCOO at your current work?
18:42
I'm fairly sure the input pattern is a simple tree, but if you want your solution to be general, you need some way to detect cycles, which means some level of bookkeeping.
Analyzing the runtime is actually a pretty interesting challenge
Well it's a confusing mess but I finally got #7 in O(N)
I really wish there was a way to run MSSQL on Linux. I'd love to install it on our server and off-load the disk IO. :/
@Kevin but @poke already got it in O(Sublime Text).
@QuestionC Mine isn't: I have both e AND f -> h and e OR f -> g.
18:51
You could also solve it in O(lame log N) by binary searching the answer form on the site
Well a binary search on the solution space depends on the bit size of ints, rather than the size of the circuit. So W.R.T. circuit size, it's O(1). The best possible solution!!!
(Never mind that the constant multiplier is enormous because you have to wait a full minute between submissions)
O(2**16) should be good enough for anyone.
But that's what multiprocessing is for, I guess. Just need 65535 separate computers / ip addresses / accounts :-P
You can reduce the multiplier to the load time of the page if you have 16 computers, but that's not parallel enough
I wonder if people will resort to that method if the problems become difficult enough
BruteForce@Home
18:58
They just need the solution space to be (0, 2^(60*3)) and suddenly binary search won't be so attractive
user559633
@shuttle87 More interesting to write C or C++ than fight with node or react or whatever library of the week
Wait, never mind, you can't cheat with parallelization because each user's input is different. duh.
At 2^63 it would take an hour (~62 minutes) of binary searching to get any answer in the worst case
Each user has different soln's?
2^(60*3), 3 hours, etc.
19:01
@tristan yeah I totally understand that. I mostly work in such an environment, I notice the times when I do have to do some web dev stuff I feel like I get buried by the sheer number of libraries and frameworks that everyone is using.
Yeah I picked that number because who's going to churn numbers for three hours to solve a programming problem?
It could be automated
Yeah but it will slow down your computer so you can't watch Netflix in the meantime :-P
The clear solution is to watch everything on Netflix before attempting this method
Also O(1) WRT circuit size. A good choice.
19:07
If you're going that route, just invent the quantum computers to solve the problem.
Not sure if revolutionizing the computers industry is O(1) or not.
It certainly takes more time than watching Netflix
WRT circuit size it is.
Wait, 9 is just TSP. How did I not realise that?
What if the only way to become prestigious enough to revolutionize an industry, is to solve every Advent of Code challenge in the conventional manner?
user559633
19:10
@shuttle87 yeah, it's just not interesting or satisfying to win little battles over library snafus
I just find there's a lot of those...
is it wrong to answer these kind of question? stackoverflow.com/questions/34187003/…
It's all subjective but that particular question seems fine to me since OP appears to have put some thought into the problem.
Even though there's no visible attempt at a solution by the original poster, the input and expected output is well articulated so I'm willing to give OP a break.
Agreed. The point of an MCVE isn't so much 'prove you tried' as it is 'precisely communicate your problem'.
@sudomakeinstall2 That Q was asked in chat yesterday. chat.stackoverflow.com/transcript/message/27406432#27406432
19:30
Hmm. Need to sit down and do Day 7 now.
I mean what is the best approach toward very easy question that requires just typing something in the editor.
@sudomakeinstall2 if you think the question wasn't good, downvote it
and if you're concerned about answering them then don't answer
Not sure I follow. All programming problems are solved by "just typing something in the editor". Knowing what to type is the job.
hmm, okay. Thanks
19:48
Very Old but I don't think it's been shared here before.
Wow, that was a lot louder than my podcast I'm listening to. I think I'm deaf.
I'll have to listen to it later once my ears recover.
worldcup2010.mp3
Hi guys :)
Am I being paranoid, or does this question have a co-worker/alt account upvoting for them?
I usually just assume that people upvote things for weird reasons, rather than because of collusion
Someone upvoted his unclear explanation. Ok, now I'm leaning more towards collusion.
20:08
There was another unclear explanation comment that they deleted that immediately got an upvote.
DSM
DSM
I just wrote a solution but the OP clarified that he's working with strings 0 and 1 and not bits. :-(
I love low level implementation stuff but I can't understand what that OP is asking there.
If you look at their other posts, they all have exactly one upvote.
DSM
DSM
"I have assigned an unsigned 8, 16, 32 bit spaces" <- eh?
I have assigned an unsigned 8, 16, 32 bit spaces and I am passing values to it so that I can get a binary. If I pass 2 to a variable which has a 8 bit space and suppose FFFD to a variable which has 16 bit space. — user5517005 1 min ago
I have no idea what any of that means.
DSM
DSM
20:12
@MorganThrapp: did all of those upvotes just vanish?
Whoever upvoted it to begin with, withdrew their vote.
The one on the post did. The comment votes are still there.
Can't undo comment votes after 5 minutes. Also comment votes don't do anything.
Oh, woah, the upvotes on all of their posts just disappeared.
DSM
DSM
... welcome to my earlier comment. :-)
20:14
Not, someone downvoted, just retracted the upvotes.
I misunderstood. :P
downvoted
I'm confused how they still have any rep. It hadn't recalced.
other questions
@MorganThrapp 1 accept
@AnttiHaapala Yeah, that's what I figured. Before it recalced, it still showed them having 40+ rep.
Guys, I demand real time updates as this user's rep changes.
20:19
I can do that
They're holding steady at 12, but I'll bring you further breaking news updates as they happen.
DSM
DSM
Is Kevin around? He's good with userscripts.
[[x for i,x in enumerate(seq) if (j >> i) & 1] for j in range(1,2**len(seq))]
@DSM powerset(seq)?
Welp, just punched myself in the face. Definitely ready for today to be over.
user559633
20:26
@MorganThrapp I do that every morning. I like to remind my brain that I could and am willing to kill it if it crosses me.
DSM
DSM
@QuestionC: yeah, the (Python version of the) old-school BASIC way. :-)
BASIC is one of those things I nostalgically have fond memories of, but would never want to touch again.
DSM
DSM
10 PRINT "HELLO"
20 GOTO 10
user559633
DSM
DSM
20:29
I used to write kaleidoscope programs on store computers, back in the days when they used to just sit there being boring.
Man I need to rewatch AD.
There's an old math book called "Chaos and Fractals' by Peitgen and Saupe. They have a program written in BASIC at the end of each chapter, and translating it to a real language is a nice mathucational exercise.
Nice enough for fresh-out-of-college QuestionC to claim C# experience on his resume at least.
I wish there was a media player that would adjust the amount of time remaining in a track based on how fast I'm playing it. For example, I play podcasts at 1.85x, and I'd like to know how much time is left in the podcast.
Do you get annoyed that people are talking so slow, since you're used to 1.85x?
20:39
There's a bit from the X-Men comics explaining why Quicksilver is so grumpy. "Imagine you're at the store and the old lady in front of you is trying to pay her $200 grocery bill in pennies and expired coupons. Now imagine that everyone in the world is like that"
It actually sounds really weird listening to people talk at normal speeds now. I've been doing this for the past year at work.
He completes a 500 piece jigsaw puzzle in the span of that explanation.
finished my day 9 code and it worked on the first try wow that`s a first
Thankfully the main person who I listen to talk is my girlfriend, and she tends to speak quickly anyway.
@MorganThrapp does my typing sound like 1x typing or 1.85x?
20:40
@shuttle87 I'd put it around 1.6x
user559633
MorganThrapp what are ducks
user559633
MorganThrapp wheres the birth certificate Morgan where is it
@tristan a type of typing.
user559633
it's kind of weird how much you get how my brain works sometimes
user559633
20:42
greedy matching graph database that returns early
tries to form a joke about duck -> duck typing -> keyboard typing -> hunt and peck -> duck, fails
user559633
does my typing -> duck typing -> ducks -> non-sequitur -> say a weird thing about ducks
user559633
whoa arrow diagram dual pythons
@tristan it's not weird. It's fate.
user559633
duck fails, wooohoooo
user559633
if anybody wants to see, i'm pretty proud of my day 9 code :P
R Nar, that is really awesome code! Is Python your first language?
not really but it's definitely the only language I would consider myself 'proficient' in. I technically learned programming with c++ though
That is good. I was starting to feel way behind the curb! I have been at it about two weeks, and I am still really struggling, but I am aiming to write DRY and OOP code, so I feel accomplished in my goals, just not in the realization of those goals.
user559633
@RNar MAXINT can be float('Inf')
20:55
@tristan aahhh I was wondering how to do something like that without having to import sys.maxint thanks.
user559633
:)
I also realized that I have a few things like sorting the regex groups that were left over from my first implementation try that are uneccessary :P
oh jk I did take that out already
user559633
sweet joke
Here's mine. These puzzles are giving me a nice opportunity to practice regex, which I almost never use.
I guess I should have used + instead of *. Not that it makes a difference for well-formed input lines, but that's a weak excuse
21:04
If there's a theme to these problems, it's "Regex is really handy for basic input parsing"
... and "Christmas"
well, using + is discriminating against unnamed areas. Which would make unnamed things all over the world band together to fight against you
user559633
but if they band together, they're a "group of unnamed things," in which case, they cease to exist
next thing you know, the next time you try to using lambda it will just return This is for what you did to the unnamed cities'
user559633
schrödinger's protestor
TIL: itertools.permutations works with 1 argument.
21:07
lol
I just eyeballed the answer to advent 9 part one
who needs code
@Kevin in your route_length, can't you just keep a,b as a single tuple and pass that as your key rather than unpacking and packing again
Yeah, I guess I should.
@tzaman Yeah, that's what I did too. :P I don't know how to do TSP.
kevin is your solution O(n!)? if n is number of cities
Woah there, NSFW audio on that Jet Set Radio playlist at 1:22:25.
@RNar yes it is.
Couldn't think of an obvious way to make it more efficient.
21:22
@Kevin Thanks for the warning, forgot about that.
Pro listeners like me use headphones, so no harm done in any case.
Now to think of it, that's a little odd. This music is supposed to be from a videogame that's otherwise very kid-appropriate.
Sometimes soundtracks contain music not actually in the original work.
I didnt realize that every single location is connected as part of the criteria whoops
The connectedness of every single location is a lucky coincidence. I'm reasonably certain my code (basically same as Kevin's) fails if it doesn't work out that way.
21:31
Yeah that's why I was freaking out when I was looking at Kevin's code and wondering how this would work if it wasn't
@MarcusStuhr so you run TSP 8 times, setting the start node to something different each time?
@RishavKundu It's technically not the TSP problem, but yes, I run it 8 times -- but due to caching, a lot of work is saved on additional runs
(for example consider a linear graph city1 -> city2 -> city3 -> city4, etc)
Then again I don't know if the way I did this problem is considered optimal -- it just seemed like a memoization/DP problem to me and not a permutation problem
the problem is np complete
21:47
where can I find myself some wysiwyg markdown editor
that is, no markdown syntax for users, but uses markdown syntax to save the stuff
user559633
wysiwyg as a js applet or an installed application?
:D:D
javascript damnit
user559633
oh good luck, javascript sucks is mandatory
hem?
I have 100000s of editors that are wysiwyg for not markdown
user559633
there's a react plugin that's markdown
21:49
no react
Why? Do you react badly to it?
user559633
it's js, let the water fill your lungs and use every library you find
user559633
as is customary to their tribe
damnit
I just want to format some comments
with links
22:13
does anybody know of any resources for random graph data? i want to try the day9 problem but with a lot more cities to see how my code scales
You could try generating data for a complete graph, as they will have Hamiltonian paths
I'll generate one -- one sec
>>> locations = ['A', 'B', 'C']
>>> import random
>>> import itertools
>>> for a,b in itertools.combinations(locations, 2):
...   print ('{} to {} = {}'.format(a, b, random.randint(1,1000)))
...
A to B = 54
A to C = 537
B to C = 561
>>>
from random import randint
from itertools import combinations

n = 6

locs = ["Node" + str(i) for i in xrange(1,n+1)]

for c1,c2 in combinations(locs,2):
    print "%s to %s = %s" % (c1,c2,randint(1,500))
Randomly making a connected-but-not-fully-connected graph is an exercise for the reader.
Solution found for n = 2 in 0.000321616331472 s
Solution found for n = 3 in 0.000332679301105 s
Solution found for n = 4 in 0.000376536073578 s
Solution found for n = 5 in 0.000560655496755 s
Solution found for n = 6 in 0.000990530888206 s
Solution found for n = 7 in 0.00209129636668 s
Solution found for n = 8 in 0.00489259832017 s
Solution found for n = 9 in 0.0116453559629 s
Solution found for n = 10 in 0.0288368156664 s
Solution found for n = 11 in 0.0705849071066 s
Solution found for n = 12 in 0.165019601212 s
22:26
beautiful thanks
O(exponentialish)
23:20
@QuestionC eew :(
I hate my phone
Gravity sensor seems to randomly start reporting all "NaNs" without any error/status going from "good" to "bad"...
23:37
@Kevin's list.append(London Spy) // 8.0/10 from me (@JonClements add it your list as well :) )
Is that that movie where there is a spy in london?
seriously, @corvid? :)
what's that movie where John Malkovich is being John Malkovich?
(1. not a movie, but a series (only 6 episodes), 2. the title could be misleading ;))
@corvid surprise: Being John Malkovich :P
Are you sure it's not Black Hawk Down?
23:42
well, it is only you who knows what you have thought of :)
anyways, it's time to call it a night
rhubarb all
~
00:00 - 17:0017:00 - 00:00

« first day (1880 days earlier)      last day (3292 days later) »