« first day (1906 days earlier)      last day (3266 days later) » 

00:12
@thefourtheye one you might like puppy: youtube.com/watch?v=rT1c_zHfUak
Would you call that Country or Western? I get those two kinds of music mixed up sometimes.
from itertools import combinations
res = []
comp = [1, 2, 3, 4]
res.append([])

for i in range(1, len(comp) + 1):
for c in combinations(comp, i):
res.append(list(c))

print(res)
is it possible for that to be converted to a one liner list comprehension
yeah - what you've tried so far?
i'm trying to find all the possible combinations in the list...it works but i saw an example with python2
res = [list(map(combinations(comp, 1), res)) for i in range(1, len(comp) + 1)]
obviously dosen't work
right... firstly - format your post appropriately, secondly, try and not sound like a help vampire and most importantly - re-read the room rules ;)
also - why so concerned about it being a one liner!?
00:20
@JonClements was just wondering if it was possible in python3 cuz i saw a python2 solution on SO
what makes you think it wouldn't be possible in 3.x?
cuz i couldn't do it and i couldn't find any help on the internet or on SO :(
seriously though, don't one line it
the python2 code seemed to void my little understanding on mapping i thought it was map(aFunction, aSequence)
but the solution seemed to map an iterable/sequence to a function sum([map(list, combinations(input, i)) for i in range(len(input) + 1)], [])
which solution would you prefer?
00:28
sum([map(list, combinations(input, i)) for i in range(len(input) + 1)], [])
the second solution is more readable....but of what use are the advanced functions of python if they are not used
as much as i love the easy to read solutions, i also want to learn about the itertools module and some language features like map n filter
i was also told they are faster than re-implementing them yourself (though speed is not my issue for now)
okay - that's great - but not rushing into things is also great :)
okay then, can you grok this one
that uses a lot of itertools
00:55
still don't get the list comp i'm trying to write a solution using if and for, then if it works i try to re-write it as a list comprehension
that's the way i approach list comprehensions for now :)
 
2 hours later…
user559633
03:08
Anyone have favorite strategies beyond logging for debugging tasks that get popped off a queue? I'm using redis and rq and would love a pdb-like hook into what's happening
03:57
@JonClements Awww :-) You made my Monday morning nuppy :-) Thanks.
 
2 hours later…
05:49
Cbg
Cabbage :-)
 
1 hour later…
07:00
@thefourtheye Hi puppy got your cup?.
CBG all.
07:11
@The6thSense Nope. I think SO people will be in vacation now. So it will take some more time I believe
No cup for you :P Just kidding you will get it anytime soon.
That's not the important thing now. Somebody stole my caps. I had 14 of them hidden under my pillow :'(
I lost all 10.
We should call the SO cop.
CBG
IT SEEMS I HAVE ALL THE CAPS NOW
lol. It would have been better if it was "ALL CAPS" :D
@The6thSense I bet they are also vacationing. That's why somebody dared stealing the caps
@tristan I didn't understand that :(
07:22
cbg
How are you all doing?
All good. How about you?
Fine, thank you.
Have you got any Python internals books or materials that you would recommend? If I want to level up my understanding and skills in Python
07:38
Alright, added to my to watch list
any other stuff I should read/watch to become better with python?
hehe
mmm martijn needs more coffee
@GLaDOS have you gone through the full python tutorial on the official site ?.
I don't think so, I've been developing for a few years in Python though, is it really necessary?
I'm looking to hone my skills rather than learn the basics
even though I'm pretty sure there are some basics I haven't actually got to cover
I just feel it solves many problem that may be difficult for many big time users.
I'll take a look then.
07:43
I you are already good at python you could cover it in a day or so.
then you could look at all python internals tags in SO.
'{:%Y-%m-%d}'.format(datetime.now()) - do that with old formatting
@GLaDOS recommended. First go through the tutorial (wouldn't take too long)
Scribbles down in a page, titled "Python interview questions to ask"
@GLaDOS then go through the python modules listing, reading the contents of every single module top to bottom
I was banging my head against the wall, after 10 years of python, because I found out so much stuff that I'd NIHhed myself
Interesting
like, in the module random
it was like 2010 or so that I found out that there is the SystemRandom class
since python 2.4;
it is there at the bottom of the page so you never read the documentation until that
07:49
I see. Didn't know that actually...
@AnttiHaapala I got schooled by Tim Peters, here
@GLaDOS ^
no one knows
And I haven't finished the official tutorial yet :p.
@thefourtheye /dev/urandom is not cryptographically secure on many embedded linuxen
07:51
True, but /dev/random would be better, right?
And then it will be a blocking read :(
but it could block...
Security or performance... Hmmm, which of these non-functional requirements I can sacrifice?
the problem is that you never know what goes into random either
it might be it is not full of entropy
but urandom after boot is the worst
because it might not have ever seen even that many bits of things that linux kernel would believe are random...
07:54
it will be easily predictable?
it depends.
see, on boot, whenever randomness is seen, it is mixed with the urandom state...
but there is no "minimum limit" of randomness that is mixed into the urandom
so many stupid embedded systems which for example generate ssh host keys on the first boot...
whenever randomness is seen - I thought all the noises in the system will be fed to /dev/urandom
yes
but there is not enough noise
and the noise might not be random
Ah, got it.
see 101001010101111011001010010100110101011010010100101001101 random
less random noise 000000000000011000000000000000000000010100000000000000010
for example, if you count the number of cpu cycles between "disk accesses"
and you're reading from "flash" as harddisk
07:57
Let's say, if my main source of noise is Network interfaces, and during the boot, till they become active, my randomness will be pathetic. Correct?
yes
many linux distros also "save the random seed on disk" then feed it back...
but on these, the embedded provider ships the initial random seed, which is the same on all devices :d
Then if I ask for 100 random bytes and if urandom doesn't have that much, does it pad something and return?
no, it just permutes the internal state with the randomness.
basically, it is a CPRNG
if it has 512 bit state, say, then you should preferably seed it with 512 bits
if you seed it with 5 bits then ...
in any case:
you can always write to urandom.
urandom is 666 on linuxes
Hmmm, urandom implementation will be very interesting to read I believe
if you write bytes to urandom, they'd be mixed with the current pool
08:01
That was exactly what I was about to ask :D
you can also write to /dev/random
but you need to do an ioctl to tell it that "ok there is more entropy actually"
but latter I believe/hope is root only
   If  you  are  unsure  about whether you should use /dev/random or /dev/urandom, then probably you want to use the latter.  As a general rule, /dev/urandom should be used for everything except
   long-lived GPG/SSL/SSH keys.
In my Ubuntu box both have 666.
ls -ltrh /dev/random
crw-rw-rw- 1 root root 1, 8 Jan  3 13:50 /dev/random
ls -ltrh /dev/urandom
crw-rw-rw- 1 root root 1, 9 Jan  3 13:50 /dev/urandom
yes
but writing to /dev/random does not make reads from /dev/random not block
see man urandom
   Writing to /dev/random or /dev/urandom will update the entropy pool with the data written, but this will not result in a higher entropy count.  This means that it  will  impact  the  contents
   read from both files, but it will not make reads from /dev/random faster.
so...
if you do have some random data, you can always write it to /dev/urandom, before using SystemRandom to generate stuff
@MartijnPieters cbg
That's really interesting
Ill play with that today
@MartijnPieters Cabbage :-)
rbrb Lunch time
08:44
Cbg
 
1 hour later…
09:45
cbg
My cronjob is like this
0 */12 * * * /home/ec2-user/twitter_api && python twitter.py
I dont know what is issue, but it could not run
Log message
sudo grep "twitter.py" /var/log/cron
Jan  3 12:00:01 ip-162-31-61-19 CROND[26186]: (ec2-user) CMD (/home/ec2-user/twitter_api && python twitter.py)
Jan  4 00:00:01 ip-162-31-61-19 CROND[27282]: (ec2-user) CMD (/home/ec2-user/twitter_api && python twitter.py)
Jan  4 01:00:01 ip-162-31-61-19 CROND[27360]: (root) CMD (/usr/bin/python2.7 /home/ec2-user/twitter_api/twitter.py)
@MartijnPieters happy new cabbage
@RobertGrant Indeed, a very happy new cabbage to you too!
Is this the year we all go work for the puppy?
user559633
10:00
@GLaDOS Have you read the entire Python3 documentation -- even the parts on interfacing with C? That documentation is just a trove. I feel like every time I go through it, I find some part that I skipped and a new rabbit hole to go down.
I havent
user559633
It's quite good. I'd go there before stabbing around Python "internals" questions on SO.
Speaking of which, are there any golden answers in SO that are helpful?
Like, really good answers people give that make you look at the language differently.
Could also be articles online
user559633
@thefourtheye tl;dr I have this workflow that's "hit API with payload, which drops messages in a queue. a number of other processes pick up work from this queue." some of those worker processes are having errors and i'd like to iteractively step through them with something like pdb. i think what i'll do is just dump out the state data to a file on disk and just call the worker task synchronously
user559633
@GLaDOS Go through the official documentation first
user559633
10:06
I have the same issue where I'll hoard a bunch of digital/paper resources and half read all of them.
user559633
In a general purpose language like Python 3, you could read great/golden answers and resources until Python 4 comes out.
Cabbage!
user559633
cbg poke
user559633
back in a bit
Hi everyone
Am working with ACE editor... I was not able to specifically highlight the function and class name with different color.. Can anyone help ?
10:34
@tristan Hmmm, can't you print logs with the worker id and timestamps and analyze what actually happened?
user559633
@Mathan Sounds like a question for ACE support and not really Python-specific
user559633
@thefourtheye Yeah, that's what I'm currently doing, but I'd like to be able to step into the code at the breaking point to do failure-driven-development
Oh. I have seen problems like this in my production boxes, where I cannot do break-points. So, normally, as you said, I dump developer friendly information (state information) in the logs, with the worked id, timestamp and when it starts and ends the current work.
user559633
@vaultah Yeah, I saw that -- buzzards.
10:38
Later, I download the logs and sort them based on the worker id and timestamp to get entire log for one run.
user559633
@thefourtheye Yeah, that's what I'm doing. That's really helpful when it's production ready, but not really convenient for dev as the time between "drop payload from worker" and "worker has processed until the error" can be a non-trivial amount of time.
user559633
it's okay though, I think my answer is down the path of "run a worker flow synchronously so i can hook it with pdb or ipdb"
Hmmm, never faced that problem before. Normally, in dev stage everything will work fine and when it goes to LIVE, the real load would give a tough fight
Or you can limit the workers to one?
user559633
@thefourtheye Yeah, I can do that. I think that's effectively what I'll do.
user559633
One worker, where I consume off redis instead of from the worker dispatching process
user559633
10:46
rbrb running to the store before work
Ya, that would be helpful I guess. Let me know if it works :-)
user559633
[thanks for letting me bounce ideas off you @thefourtheye, i appreciate it]
@tristan Which chat room i should log in?
@tristan You are welcome :-)
11:06
What a slow day.
hello
i am prompted to install "It should be placed in the directory pointed to by the %USERPROFILE% variable" searching the internet but cannot find a good answer
@hmmmbob That’s C:\Users\<yourusername>\
if thats true
i think i will kill myself :)
Why would you do that?
to hide my shame :)
11:16
Don’t feel bad about that, it’s a valid question, and it’s difficult to search for it.
trying to install theano
for deep learning
installed sucessfully, ran the test that the module works
but the last step unfortunately does not :(
want to get gpu computing going
11:32
@Ffisegydd move to Oxford :)
user559633
"Oxford / London / remote. You’ll be working a couple of days a week in our offices in the heart of Oxford, and from home whenever it’s more productive." that's not really remote...
@RobertGrant I perused that job. Think I'm going to stay here, but could be interesting.
user559633
That's a "you can work from home some days" setup.
True that
Yeah should probably be plus signs, not slashes
user559633
11:41
"You'll probably have a couple of years of commercial heavy lifting under your belt." Bro do you even commercially lift?
Am I the only one who reads "Codementor" as if it was some complementary Harry Potter character?
user559633
CoD E-Mentor. It's like someone that would scream at you while playing Call of Duty online, but he means well.
@bereal Until now, yes
Advent of Code is awesome.
Cabbage all
user559633
11:43
hi Gary
user559633
@RobertGrant is this where you or jon are working
Why would I be working in Oxford!?
user559633
Dude IDK everywhere is 20 minutes from everywhere in the UK!!
Because it's the best Uni city in the country ducks
@tristan I appreciate your respect for Concorde, but it doesn't run any more
user559633
@RobertGrant Is Concorde another one of Ye Olde Adorable Townes?
11:47
Anyway - after our wonderful success in duke3d @tristan - weren't we going to sack @poke today :p
user559633
Oh, I thought I was getting suspended/banned from SO :P
what
Sorry for this option based question. Which is the best visualization module for python ?. I have used plotly liked it but wanted know this.
user559633
Also, yeah, sorry about that server latency -- I was hosting from a 3/4g router and I'm in a relatively remote part of the world.
@tristan remote part of world owns u!?
user559633
11:49
That shooting latency though -- does it do a round-trip to each host to determine placement? I was seeing 500-1500ms delay on firing
@poke just kidding just kidding!
@tristan @poke yeah - that was really odd guys - running around and stuff was absolutely fine, but as soon as firing it really just delayed
I lost the second round (on purpose *cough*) so you two wouldn’t be too mad about inviting me in your game!
Most appreciated
Honestly though, I think the shooting delay is what makes this game far too hard.
user559633
What a gentleman.
11:51
hard as in not difficult but annoying.
user559633
Yeah, it was only on shooting. I wonder why that is. It didn't used to be like that, did it @JonClements?
it was a good laugh - would be worth trying again - I'd certainly be up for it :)
user559633
Yeah -- and that game is extremely twitchy, so having a delay on shooting meant spray and pray.
@tristan well the first game was fine, the second game was just odd - I'd had better games when I use to play it on dial-up
@tristan The delay was there in the mirror too though!
user559633
11:52
The delay was even local -- which makes me wonder if the game tries to do N-player consensus.
It was super scary when I was walking in front of the mirror, and then that character in the mirror was walking in front of the mirror too… 5 seconds later.
user559633
Yeah -- I'd see that being a local rendering engine thing. Maybe the engine doesn't connect character movement and painting?
@poke @tristan @JonClements Want hard mode? Play it from an internet connection provided by Indian ISPs
Not sure if that’s able to make it even worse.
user559633
@thefourtheye High latency or just unreliable?
11:55
@thefourtheye anything other then airtel :p.
@tristan Both + Power cuts :D
user559633
@thefourtheye Heh. I miss the stability of internet connections in the US
user559633
▶ ping google.com
PING google.com (173.194.32.129): 56 data bytes
64 bytes from 173.194.32.129: icmp_seq=0 ttl=54 time=74.939 ms
64 bytes from 173.194.32.129: icmp_seq=1 ttl=54 time=108.915 ms
64 bytes from 173.194.32.129: icmp_seq=2 ttl=54 time=85.872 ms
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
Request timeout for icmp_seq 6
Request timeout for icmp_seq 7
64 bytes from 173.194.32.129: icmp_seq=3 ttl=54 time=5254.387 ms
Quick people... We know his IP address. Locate him quick
user559633
My current connection is a testament to how well internet protocols were designed.
12:01
Well.. it's not exactly difficult when he's on SO to get his IP address if you're a mod :p
... and when you are Ninja Puppy :D
user559633
My current connection is a testament to how well internet protocols were designed.
user559633
@JonClements don't you go hack my planets
I'm sure I'll manage to resist the temptation :)
@tristan Yours is far better I guess. My ping responses are taking 196 ms
consistently
user559633
12:03
Also, FWIW, 173.194.32.129 is the remote end, not mine.
he he he, I realised it a bit late :D
FGIW FTW
user559633
▶ whois 173.194.32.129 | grep -E 'NetName|Org' | head -n3
NetName:        GOOGLE
Organization:   Google Inc. (GOGL)
OrgName:        Google Inc.
user559633
FWIW FGIW FTW
user559633
It's probably good that we all don't work together because I think we'd spend a strange amount of time trying to amuse each other instead of working.
user559633
12:09
Oh hey, is the star trek spoiler embargo done now?
Yeah
And star wars
But yeah - so how about Khan betraying them like that?
user559633
Wasn't it weird how Han Solo dies in the lightsabre duel with Jar Jar?
Leia dies and Chewbacca is the new Sith Lord called Finn Ren who fights against Luke's son Ben Rey.
user559633
The funny thing is all these things could be true because the Star Wars universe is flat out garbage.
12:11
I heard they're filming the Spaceball sequel.
It was the wookie what won it
@tristan wat
Why is it garbage?
user559633
@JRichardSnape then how come he never got his space medal during that scene with the big dumb space bow that they used two of the originals
user559633
@poke redlettermedia.com/plinkett/star-wars this guy picks it apart in a more amusing way than I ever could
I liked the directors look at Han Solo, and that when he settles down with darth Jar Jar he changes his name to Han Duo.
12:13
@tristan There’s no IV-VI one
user559633
@poke Yeah, because the original ones were actually pretty okay fantasy-in-space movies.
I heard you only get space medals for phaser phighting. Our was it phishing?
@tristan But the thing is that the new movie is more a old trilogy movie than it is a old new trilogy one.
user559633
@poke I skipped the new one. I'll probably see it in 10 years or something.
user559633
I heard it was a good popcorn movie though. "Good for star wars"
12:15
Oh.
I'm going to stop. Trolling from a position of ignorance is no fun :)
So, do you actually know what’s happening in it?
one thing I didn't understand, why does Kylo Ren wear the mask?
tribute to grandpa?
He’s a terrible fanboi
user559633
@JRichardSnape Ain't never stopped me. If I couldn't troll from a position of ignorance, I'd never get to troll at all.
user559633
12:16
@poke Yes, and no. I can guess because it's Disney + JJ Abrams.
@tristan Do you care about spoilers? Do you want to know? Do you mind?
In answer to poke, I haven't any idea beyond my preconceptions.
You didn’t watch it either? Oh wow.
user559633
Some cutesy garbage, they probably "kill off" one of the classic characters (he'll probably be back in one of the upcoming 5 movies that will be released in the next 10 years). The storm trooper guy probably is a hero or something after reaching his breaking point. I'm sure that the girl in it defeats some mega villain because she's secretly a bad ass or something.
But then, I rarely know what's going on, so don't change anything on the strength of that
12:18
Star Wars sucks. Flies away before getting beaten up
@tristan That’s scarily accurate
user559633
It's all just paint-by-numbers plot.
user559633
It's hero's journey + fan service + lean into whatever current social trend will put asses in chairs.
which reminds me that it's been a while since I read tvtropes last time...
user559633
Speaking of which, 2016 is the year of nerdcop.
12:20
tvtropes are stupid.
why stupid?
user559633
St. Upid was my favorite saint as a child.
Give me a single movie/story/whatever where you cannot find anything defined on tvtropes.
People always call out when they see “trope X”, but I don’t believe it’s possible to come up with something that doesn’t follow some pattern we have seen before.
And I don’t think that’s bad either.
user559633
"For sale: baby shoes, never worn."
@tristan i presume, that's been used multiple times since that, so that easily can be on tvtropes
user559633
12:23
I think poke's point is that sites that enumerate plot devices within ordering will end up being all encompassing.
user559633
That's like saying "ugh! this song is just the trope of chord progressions and notes"
that does not make classification and enumeration less interesting.
@tristan My point is more that using a plot device that happens to have a “name” because it has appeared before is not a bad thing. So people should stop calling out tv tropes in movies as a way to degrade that movie.
What do you guys usually do when you discover that your accepted answer with 8 upvotes is wrong?
12:24
I mean, yes, there's a limited number of progressions, but C - Am - F - G, please.
user559633
@vaultah Silently correct it and hope no one calls me out on it.
@vaultah Silently correct it and assume that it was always correct before the upvotes happened?
@vaultah or you can get a self-discipline badge.
Not for 8 upvotes… and accepted.
@bereal I already have it
user559633
12:25
[real answer: correct it, leave a note in the edit saying "the original answer was wrong for the following reasons, here is the right one...", and comment on the question so that the asker has a chance of seeing it]
I find it strange that Martijn didn't correct me...
user559633
@bereal what is that, doo-wop?
@tristan what?
user559633
that chord series
@bereal whaaaat? C Am F G is a classic! I will not have you denegrating my all time favourite progression ;) Just let it be, OK?
user559633
12:27
man, i'm just now remembering that i used to have hobbies
user559633
like, things that i did not on the computer
I guess, the most frequently used progression, along with Am - F - C - G.
cbg
Bloody android...
@tristan Yeah, it could be doo-wop. See 50s progression on Wikipedia
I don't know how to fix that answer...
Can you check if this is correct? It looks correct but I can't prove it :[
I even modified the source code of datetime.py to include some print calls. datetime.time.__format__ doesn't get executed.
12:50
did you reload the module after modifying it?
@vaultah Oops !
actually, in my installation datatime is a builtin module...
ah that's in 2.7
I'm modifying Lib/datetime.py
hm indeed, does not print
12:55
Thanks...
😬
@JRichardSnape you whisper words of wisdom, sir

« first day (1906 days earlier)      last day (3266 days later) »