« first day (2256 days earlier)      last day (2917 days later) » 

w0o0o0
I want m&ms
hooray for marketing:P
winter bash is here <grumpy cat>
I looked at the documented hats; grumpy cat still relevant
brace yourselves for shitty self-answered Q&As
also, shitty answers to shitty questions
also, shitty edits to SOD
also, FGITWs everywhere
grump
*FGsITW for the pedantic ones
00:45
^^ easy solution
it all goes away
My issue is not the hats; it's the shitty behaviour the masses show during winter bash:P Does the button solve that too?
well, what you listed is the frequent struggle on SO, anyway 😛
amplified during winter bash:/
it's the two-weeks-long black friday on SO
haha.
you should just not go to the main site until it's over
01:02
I agree:D
although I got a hat, I'm getting a gold rush
....
(no, not really)
01:30
Had a working HTTP server using BaseHTTPServer, attempted to add an SSL cert to allow for https using LetsEncrypt, now it won't serve any files or respond. No exceptions or errors. What's up with that?

server_address = ('0.0.0.0', 80)
httpd = HTTPServer(server_address, MyHandler)
httpd.socket = ssl.wrap_socket(httpd.socket, keyfile=ssl_key, certfile=ssl_cert, server_side=True)
httpd.serve_forever()
02:20
Freaking Twitter won't let me delete my account without linking a phone number first.
You should call them up :-)
 
1 hour later…
03:29
Cabbage
good night
Rhubarb @Andras
So, any new python language features on the horizon?
braces
03:34
more
 
1 hour later…
04:55
cbg
05:16
cbg
aww, I didn't make the top 100 ;-(
.....
I think we need to start cracking down on cbg chain breakers
:P
05:46
I remember doing a similar exercise in my C class with linked lists.
we had to implement our own linked list of course, not use a library
hehe
and number one spot secured on local board
ahh today's puzzle is nice <3
is del very inefficeint?
yes
it depends on the container of course :D
05:51
I'm using it on a list.
it depends on the position :D
hint, you won't solve this using lists... in python...
you will, but it will take until next day... or.... well next month
mine runs in 3 seconds for both parts
yah, mine is slow
wrong datastructure... find out about advanced python datastructures
it will finish tonight I think, but still is already running 5+ mins.
it is wrong.
05:55
I have a nifty little formula for j to calculate elf i steals from elf j.
@Code-Apprentice hint: you need an import.
code this, don't use any formulas
I have a for loop, too.
you need an import, but which module
I know next to nothing about available modules.
@Code-Apprentice then that's why you're an apprentice and I am a master.
06:01
exactly =p
you want to look into chapter 8.
I got that far =p
spent far too much time trying to find some elegant approach
@idjaw Are you still doing AoC?
@AnttiHaapala MutableSequence?
yes you want a mutable sequence, no you don't want MutableSequence, it is an abstract class
@MarcusS :D
06:17
I kindda thought that was what abc means. It's the closest thing I found to what I want, though.
no it is not...
you should be in 8.3
yah, "collections" was a hint
Counter?
yes that one (and tell me how do you use it because I don't find it useful at all in this)
I have no idea...I was just guessing
I really don't see anything in collections that gives me any ideas what to do.
you just need to stare at the short descriptions of each class
@MarcusS how fast is your code?
06:25
May I know, you are discussing about which question? I am also interested in giving it a try
@MoinuddinQuadri day 19 of the advent of code -> see the starboard on the ... starboard side
@AnttiHaapala melon
watermelon
@MoinuddinQuadri you can also join the private leaderboard at adventofcode.com/2016/leaderboard/private using the code 41753-59ea35f1
@AnttiHaapala Under a second
mine takes 2 seconds for each part... hmhm.
ahhh... I forgot that ... one can index too hmhm.
well it doesn't matter
ah but it didn't help here
@MarcusS or you have a faster computer
06:30
I will have to work on this another time. I'm already up way past my bedtime.
rbrb all
hello, can someone help me out??
Cabbage
@AnttiHaapala Now how many times have I heard that over at PE :P
Sorry for asking newbie question. It is my first time over AoC. I just see a small textbox at the bottom to submit answer. Do I need to paste my code in that Textbox? And how does Input and output stream works? I mean how the code reads the test cases. Any related document will be helful
06:36
@Nightmare Sure! Which way did you come in? :D
input is only magnitude 10^6 -- I use a single loop up to n so it runs quickly
took me a while to find though -- trying to find a faster way
@MoinuddinQuadri No, just the answer
@MarcusS our algos are asymptotically similar, that's why I wonder if you did some other nice tricks.
@Nightmare It's a good idea to read our Room rules if you haven't already done so.
06:39
Okay, read the rules, thanks
So now you should understand how to ask questions here, and have a rough idea of what kinds of questions are acceptable.
Lets assume i have a number 100000, i want to check the 2,3,4 consecutive digit summation and check if its prime for the entire number, if they are all satisfied. I will increment count, lets say number of digits > 4, and i have to traverse all the numbers with the same number of digits, ex: 1000 to 9999 how can i do this in a good complexity for larger ranges like 10^7 to (10^7)-1
my current idea is for number 1000, check 1+0 = 1 not prime so add 1 to the 2nd digit, and continue until all the 2,3,4 are satisfied
but once i find the 1st satisfied number, how would i continue from there ?
It depends on how crazy you want to get with the optimizations
Once you find a satisfied number, you know it must be odd, so you can do +=2, but sometimes this will result in a rollover of digits to its left -- so you'll have to re-scan those parts that changed (or anything connecting to them from the left) to ensure the sums are still prime
need to handle 10^5 digit size
and if you're only checking up to 4 digit windows, pre-cache those prime sums so you aren't making unnecessary calls to isPrime
06:48
yeah i wish it was just the sum of all digits, rather then the ranges of digits in the number
yeh thats what i was thinking, but i think i have to pre-find the ones that satisfy the 2 digits first
then continue from there
Another approach is to use dynamic programming
For example if you start with the two-digit prefix "11" (sums to prime 2), you only have so many valid ways to add additional digits to that -- and then you recurse into that new case, etc.
@MarcusS: Does the code runs against any set of test cases, like other online coding sites? How it reads the inputs. Via raw_input?
@MoinuddinQuadri For what? AoC? For AoC you just solve the problem as stated on the page and submit your answer
@Nightmare So if the number is 1373 then count gets incremented because 13, 137, and 1373 is prime. But if the number is 1371 then count doesn't get incremented because 1371 isn't prime. Is that correct?
06:53
@MarcusS: Yes, for AoC
that is correct
wait
no
for the 2 you would have checked, 13,37,73
for the 3 you would have checked 137,373
@MarcusS ok, faster solution exists for part 1...
for the 4 you would check 1373
if all those numbers are prime then increment counter
why so complicated
It's not that complicated / and it's fast
06:55
@Nightmare Do you mean you want to handle numbers like 100000? Or do you mean you want to handle numbers with 100000 digits? If it's the latter you are going to have problems because it's generally not easy to test primality of numbers that large.
numbers with 100000 digits
@Nightmare Which problem is this / where, out of curiosity
can i post link?
Yeah
06:57
@MarcusS complicated meaning "use format 'b' instead, forgot join"
@AnttiHaapala Ah, wasn't familiar with that
@Nightmare Is this part of a live contest?
@MarcusS: For example, in the day 19 problem. I should hardcode the elf count as 5?
but it took me longer to google for that solution that it took to actually to solve the part 1. I didn't even remember the name of the problem
@Nightmare Oh. But with those huge numbers you are only checking the components that consist of 2, 3, and 4 consecutive digits, right?
06:58
@Nightmare Afraid we can't really say more than that then if the contest is live
There are other similar problems to that though on HackerRank
im just having runtime issues
not logical issues
lol, that's where the difficulty lies
runtime issues usually means logical (or memory) issues somewhere, assuming your code works for smaller inputs
@MarcusS ok, 2.66 s for both in total...
of which the first part needs 0.000000000000000000000000001 or sth.
07:04
lol this problem is so lame
I checked Antti's solution, there is: d = get_aoc_data(day=19) I think this is the way to read input in AoC where day = 19 refers to the question. Please correct me if I am wrong
yes
@MoinuddinQuadri that is from my helpers, that uses @wim's advent-of-code-data
Is there any document available which help me to know about the do/don't and how AoC works?
@Nightmare Thanks. That makes the problem clear. :) In your original post you didn't mention that you are summing the digits. This makes it very easy to do the primality tests because the sum of a n-digit number must be <=9*n. For your problem, n<=5, so you can do your prime testing with a boolean list of the primes <= 45. I.e., primes[n] is True if & only if n is prime.
07:06
yeah i have the prime testing down, the iterating is what i would like to reduce
@MoinuddinQuadri adventofcode.com/2016 <- see the calendar here, each day at midnight @ some-american-timezone a new puzzle appears
you can solve the old puzzles too. usually the answers are just numbers (sometimes not), you enter the answer into a box - but if you enter a wrong answer, then you cannot submit a new answer for 1, 5 or 10 minutes... or perhaps even longer... so better be sure it is right
Hello everyone, I have created a BDD framework in Python language and committed the code in VSTS Git.
Is it possible to perform a CI process in VSTS?
@MoinuddinQuadri you can from the first puzzle: adventofcode.com/2016/day/1
@Ashokkumar I needed to google for VSTS. I wouldn't know. Not that many M$ slaves here...
@AnttiHaapala: That means the execution time of code that you people were discussing about, you were calculating it on your local machines? In AoC we need to just post the answer as plain text based on the xxx input mentioned as: Your puzzle input is xxx.
I think I got it. Thanks a lot!
07:12
@AnttiHaapala I could see there are some possibilities using Jenkins but I have to perform with VSTS. When I searched with google I don't found any. If you found anything it would be helpful
@Ashokkumar You probably need someone who uses Windows to help you with that. Some of the regulars here use Windows, but many of us don't.
@PM2Ring How to reach them
07:26
Got part 2 down to O(log(n))
Oh goodie, I solved today's puzzle before as a Stack Overflow answer..
So today's puzzle quest is to find my own answer! :-D
(The keyword is Josephus)
07:44
@MartijnPieters part one.
@MarcusS omg!
@MarcusS did you use DP?
morning
cbg
Morning room.
@MarcusS wat :D
how did you find that :D
@MarcusS post it to the reddit thread if not yet
cbg all
08:20
I think it can actually be simplified a little more
@AnttiHaapala yup, and I am using a doubly-linked list of elves to do part two at the moment ;-)
I'm currently working on a project that has a few DSLs specified with lrparsing (lrparsing.sourceforge.net/doc/html). This library does some magic to process class variables into parsing rules. I have a few different grammars that share some common tokens and some common syntax. To try save repeating myself a bunch of times I wanted to create a base class with the common DSL definitions but the library doesn't work with inheritance.
Now I wish there was a built-in bitset object..
Is there some metaprogramming type way that does the equivalent of copy and pasting in the source to build up class variables?
08:34
Woohoo! Winterbash: http://winterbash2016.stackexchange.com/
Collecting hats ;)
Guys small question:

How would I create a OrderedDict like this:

ordereddict = ([(key, [value1,value2,value3]), (key, [value1, value2, value3]), etc. etc.])

Is this even possible to do?
values as a list?
yeah @manuzi1
cbg first of all o/
hi ;)
cbg?
Oh haha wb
sum-of-digits-mod 8 guy has reposted: stackoverflow.com/questions/41218305/…
But @manuzi1 You know if this is possible?
@PM2Ring repost is good, when all are answering in the same time :D
@Emre yes ;)
And how would I do this? @manuzi1
08:44
You edited your code. Now you have square brackets. ;)
for k in ordereddict: ordereddict[value].sort() ?
Yeah but how would I append a list to a ordered dict key?
This is my code with a normal dict:

dict = {
"a": [],
"b": [],
"c": [],
"d": [],
"e": [],
"f": []
}


dict['a'].append(foo)
dict['b'].append(bar)
dict['c'].append(test)
dict['d'].append(etc)
dict['e'].append(etc)
dict['f'].append(etc)
How could I do the same thing but with a ordered dict?
@MarcusS that's the problem with this puzzle again
this would be a perfect programming skill puzzle if they said: "get the md5 hash of your input + number - the first hex digit tells how many elves to skip"
now it is just .... pfft.
it would still be solvable in ~5 seconds with inputs of that magnitude, but not if you don't use correct data structures.
I mean, to be fair, it took me a lot longer to get the fast solution working
Than if I had just gone straight for a deque or something
yea, but for the first part, not... if you knew what it was about
Idk, I thought it was a better puzzle this time around. Programming solutions exist and force you not to rely on lists that involve O(n) removal time, but at the same time, the faster solutions exist if you want to pursue those instead.
Also ties into a famous problem
Always nice when a problem has multiple solutions
09:53
cabbage, all
10:05
grmp, so apparently a binary tree holding ranges is not working either, not recursively at least.
I'll have to make this iterative..
10:15
@MartijnPieters AoC?
10:26
yup
Morning all
Cabbages all round
10:43
@MarcusS I mean, I don't really mind for faster solutions existing but what I do mind about is taking a straight known problem without any twist...
re-cbg. I've just been writing functions to sum digits of a non-negative integer, and timing them. I was surprised that sum(map(int, str(n))) is actually slower than doing it the hard way with % and // in a Python loop, unless n is 20 digits or larger. See this Gist if you're interested.
Hi, @JRichardSnape Here's a beautiful old song for you people in the North: Winter Song by Lindisfarne. I was a big fan of Lindisfarne, back in the day, and I'm still rather fond of them.
hrm, my tree isn't doing too well either. I'll have to find a better way to find the midpoint in a linked list then.
(max log N deletion cost on a tree with millions of entries still takes too much time)
erm, it's not logN, my tree isn't balanced. Doh.
11:19
Pffft, finally, solved #2 too. Trick was to find a O(1) method of determining the next elf to chop.
11:30
@PM2Ring I love that song. I play it regularly - one of the few songs that I spent some time on to really replicate the guitar part. Also enjoy playing fiddle on it when someone else has a guitar. You pick my oeuvre very well!
Holds a great many good memories.
@JRichardSnape I was pretty sure that you'd be familiar with it. :)
Lindisfarne came to Australia in the early mid-1970s, not long after the Nicely Out of Tune album was released, but I was a bit too young to go to any of the gigs. Sadly, the tour was poorly organised and not well advertised, and it was a financial disaster for them. :~(
@PM2Ring That whole record is fantastic - all 5 tracks amazing.
The CD version has 13 tracks. It's on my MP3 player, so I hear it fairly regularly.
Ah - I think I'm thinking side 1 only. Used to get a lot of playing in the house of young Snape
I fell in love with Lindisfarne the first time I heard Lady Eleanor
11:36
Yes - wikipedia confirms my intuition. Side 2 got a lot less playing, although we can swing together was occasionally heard.
Lady Eleanor is a beautiful song. My niece is called Eleanor, I think not unrelated.
I just saw a clip of Alan Hull playing Winter Song. I was surprised to see him playing it on guitar with a capo up around the 7th fret: I've always assumed the high sound was a mandolin... maybe it was, and he was just using a guitar + capo for that gig.
Mmm - possibly. I guess they change their minds over time in some cases, too. I could go into an extended discussion of how I do it, but maybe here is not the place. If he uses capo 7(ish) then my version is not how he does it :D
IIRC, We Can Swing Together predates Lindisfarne. It's a classic song of the era, and virtually an anthem in certain circles... :)
Here's Elvis Costello doing a version of Winter Song on a Christmas special. He's playing it without a capo, and it sounds fine to me.
11:59
@PM2Ring Ha found the clips of Alan Hull. Where he slides an Am shape on capo 7 to get the maj7 on the intro, I slide a Dminor shape fret 3 to 5, no capo. I think that means I play it in D where he's in E. So similar, but not quite! I have found some lovely versions on Youtube now :)
That sounds right. I'll have to check it later when I'm a bit closer to a guitar. :)
Change of feel, but very nice : Women of Ireland - Jeff Beck Nice fiddle and bass on there, too.
Hellow @isabel
I use a function like this
urls = ['https://www.google.com/', 'https://www.bing.com/']
pool.apply_async(func_reqest, urls)
but say func_reqest() takes exactly 1 argument (2 given)
how I give correct list?
12:27
@JRichardSnape I've seen that one before, during my days of hunting down every clip of Tal that I could find. :) But it's certainly worth watching again.
Hi, @heather!
4 hours ago, by PM 2Ring
sum-of-digits-mod 8 guy has reposted: http://stackoverflow.com/questions/41218305/python-program-to-find-the-sum-and-d‌​ivide-and-check-reminder
So I owe you a point or two. :)
cabbage
That's for Bobby G
cbg everyone
hats are awesome
12:42
cabbage
13:06
Hi everyone, I am learning python scripting , I want to automate login of multiple user accounts. I want to know how can I do that ? For example, for a given username password, my script should login me in freecharge.in website and then scrape a particular data and then log me out & repeat this for multiple user accounts.
The data is account balance which is displayed in top left corner , if anyone has used the website
@PratikNagelia That's a pretty broad question. What in particular is giving you difficulty in that implementation?
first of all , using requests module, I submit the username password, but i am unable to be sure , if it has logged me in...
Second, I further scrape the page , after submitting the username pass, It doesnt display the balance in the source code
so how can I automate the browser,
like the browser records this particular user has logged in , and then then displays the data , about the user .
How can I get that in python, like remember the session id, in python ?
http://stackoverflow.com/questions/22300275/how-to-use-python-to-login-page-which-requires-session-id-responded-by-server-on

@PratikNagelia
@IsabelCariod: you want ot work asynchronously on each URL?
@PratikNagelia You need something like selenium. I did this exact thing as a practice to learn Node. I ended up using phantomjs to do this. But if you are looking for pure Python, look at Selenium, or anything equivalent that does what selenium does.
13:13
Okay , thanks a lot, I will try @Emre
@idja
@idjaw ...Thanks I will look into it .
How about something like results = [poll.apply_async(func_request, url) for url in urls]?
What would actually make this all easier, is if the website has an API and all this can be avoided and you can just go via API to do this work.
13:36
@PratikNagelia if you're lucky, robobrowser might work, or mechanicalsoup
but yeah, that is written in react, so not much luck there
Don't you hate it when your O(log(n)) code doesn't generalize to part two... Amirite, folks?
And what's the deal with airline food?
13:56
@Kevin don't you hate that there is ~O(1) solution much shorter than your O(log(n)) that doesn't generalize.
Having read the Wikipedia page on the underlying concept a few months back, I'm aware there are even more savage optimizations that I can't remember how to implement, but I don't want to check until I get both stars.
@AndrasDeak <3 now in German media too
Ooh, milestone: one million soldiers sacrificed elves degifted. Only two million and change to go.
yeah dollars < 1M are just change to kevin.
Filled burlap sacks with a big dollar sign on the front is the smallest unit of currency I'm interested in
14:08
ok, then you can donate the half-filled burlap sacks with small dollar sign on the front to me.
And I'll take the overstuffed sacks with tiny dollar signs on them
I'll have to take your words for it that such things exist at all.
And... Finished. Only took about half an hour.
I should try to figure out if there's a data type with O(1) indexing and O(1) item removal.
morning cbg
woop got christmas presents!
road kill?
Is that a crow delicacy?
14:40
Cbg
@Kevin hashmap is O(1ish)?
I guess I didn't explicitly specify but I also need myDataStructure.delete(index=3) to make every item with index greater than three to shift one index to the left
Ah :-)
Just wrap it with something that keeps track of index offsets that need to be applied
And don't count that in the complexity calculation
Because that would be.. casts around for a good excuse .. unprofessional?
I can sweep numbers under the rug all I like, and Python will shrug and run my program for thirty minutes anyway
Bobby G - long time no, erm, see? @RobertGrant
Drawing on one's map does not change the state of the territory. On balance, this is a good thing.
14:50
Season's greetings and all that in case our logging on times do not coincide again.
hee hee... Hairy McHairface. I like that.
@JRichardSnape sup :-) been on holiday, not been on internet
Still on holiday but thought I'd say hi
Hey Bobby.
@RobertGrant No internet holidays are nice. I'm not on here so much at the minute - work is hectic. Such is life.
14:55
Hi :-)
@JRichardSnape that sucks. I've had 7 days off this year before this, including paternity leave, so I have a long break now!
Also because BA messed us around so much we're getting £1k compensation! Woohoo!
Good for you.
Even better. Drinks are on Robert.
Alright. I'll take a Balvenie, neat.
I just clicked the link from the star board and note that there have been 4.5 billion line changes to JavaScript code on Github. That means on average everyone in the world who owns a computer has changed two lines of JavaScript on github. That's a lot of changes. I wonder how many have progressed the state of mankind...
0
definitely

« first day (2256 days earlier)      last day (2917 days later) »