« first day (1791 days earlier)      last day (3382 days later) » 

00:02
Yep. Atexit has saved me hours of work a few times.
00:37
SSSSSOOOOOOOO
I just found out about OpenDNS and thought, "What a splendid idea!".
I decided to configure my [Motorola SURFboard ](bestbuy.com/site/…) , when i found out about this‌​...
...and this.
And my warranty is expired...
PSA: Do not purchase a Motorola SURFboard SBG6580!!!
...that is all.
01:04
@AaronHall Hey, even my intern knew about that and used it properly and with good reason on his first day Tuesday! Color me pleased.
02:03
hey guys! I'm confused as to why this isn't working(I consulted dive into python to make this statement) : dataList = min([x - val for x in list(self.frame.XCoordinates[key])])
I'm trying to find the minimum of a list where each element is subtracted by val
each x is a floating point but it gives me the error: TypeError: unsupported operand type(s) for -: 'unicode' and 'unicode'
here is my array from a print : [ 70.268435 35.873233 17.290505 12.377136 10.341896]
@PatrickMaupin where do you get these so-called interns?
At the People Store (TM).
Or the python meetup. I forget which.
Beautiful.
Anyway, I had a script I had written that opened a socket and waited for connections from a Xilinx tool, and allowed JTAG programming of an FPGA. I told him that I didn't have time to research the Xilinx command line version of the tool, but I wanted a script that would do it all from the command line, and he wrote a script that started up my server, ran the xilinx subprocess, and then used atexit to terminate my server.
user559633
that's a good intern
02:09
classes: A(O), B(A), C(O), D(C), E(B, D) - where O is object, what's the mro of E?
B, A, D, C, I assume, but I haven't looked...
correct
It's more fun when you have a class in there 3 different times...
user559633
Okay, now again, but C is the ghost of your father.
3 face to face interviews with people with Python on their resumes, who didn't know that though...
02:11
Did they know how to spell "MRO"?
user559633
What did you say to coach them? Ask them how they think python compilation works and then try again?
Nah, I didn't want to come across as condescending (that means...)
Yeah, interview questions are usually more about the thinking process than the knowledge.
user559633
descending on a con? weird.
You gotta be ready to dig in and get what you need.
user559633
02:13
I'd expect a non-junior python dev to know how do that MRO. I usually do follow ups in case the person knows how to solve the problem, just not when asked on the spot in that way
Python's not required knowledge, but since we sometimes use multiple inheritance for our GUI work and they all had it on their resume I figured it would be a good idea to ask it, since I knew my colleagues wouldn't.
@tristan Not only that, but he had just come in, we set up a board and a computer for him, and the download process takes around 7 or 8 minutes, and he had zero knowledge of our internal network or anything and an admitted minimal knowledge of subversion, but he had it working and checked in in about and hour and a half.
user559633
@AaronHall I think that's totally fair to ask MRO questions if object oriented programming is on the candidate's resume.
Time to promote the intern to senior dev.
user559633
subversion was always my favorite character in mortal kombat
02:17
Unfortunately I don't have any reqs for senior dev. It was, umm, a stretch to actually hire him as an intern -- he just got an MSEE...
user559633
microsoft ecstasy experimenter? and here i thought microsoft was only innovating in their legal department
@tristan Heh. Anyway, he had some interviews for "real" positions which I highly encouraged him to pursue in the middle of our process, but they were apparently looking for more senior people. Even the other interviewers on my team told me that it would be a solid month before I got any real work out of him, but they don't know python...
user559633
okay, that might not make a lot of sense as a setup. i'm running on very little sleep.
user559633
huh. job market must be really rough in texas
He's not looking at web dev stuff.
user559633
02:20
that said, you work in a really cool...yeah
Market's not bad, but not many places do DSP...
Anyway, we brought in a guy using the same ruse about a year ago and managed to find a req and flip him to full-time after about 6 months, so I'm hoping he stays around.
Digital Signal Processing.
6 months!? In NYC you'd be lucky to have him for 3.
Or Dog Sensory Perception.
02:31
You guys write in assembler?
I think I'd be lucky to have him for 3 if he hadn't gone out and done the due diligence of a couple of other interviews. I think he learned a bit about the things he needs to be able to tell people on the next round of interviews. Anyway if he does really well in 3 months and has the cojones to go out and get a couple of interviews, he might do better.
Most of the code on the actual part is in C, but the DSPs have some intrinsic instructions that are coded that way. A very few special loops might be in assembler. It's the same thing as profiling Python and moving part of it to C, only the next level down.
(I don't do much firmware, though.)
So, as an example of why the other interviewers thought I wouldn't be able to get any work out of him in a timely fashion -- he's done C and assembly on an embedded ARM processor, but with an embedded OS -- he had never actually done the full initialization from bare metal, so he didn't know about, for example, how the stack pointer isn't magically set up from you.
But I mainly want him for unit-testing of the device peripherals to start with, a lot of which can be done without even spinning up the processors on the device -- I have a dut class that has register blocks that have registers that have bitfields -- you do it all from the host...
Since he knows C, that explains his familiarity with the concept of atexit: man7.org/linux/man-pages/man3/atexit.3.html
user559633
have a good night guys
02:40
That's probably true. G'night, Tristan.
Good night, Tristan!
:)
 
2 hours later…
04:25
we need more people around at this time of night... zzz...
04:42
I'm sort of around, but it didn't go "bing" so I didn't notice. Anyway, I lied -- I'm not around any more. Rhubarb pie for all.
CBG all
I have small doubt can we use for else in list comprehension
05:01
?
check=["1","2","3","4"]
values=["111","22","4"]
output=[]
for data in check:
    for value in values:
        if data in value:
            output.append(value)
            break
    else:
        output.append("No Value match")
I wanted to do this in list comprehension ?
Just wanted to see if it is possible to do it in list comprehension
Hey up all
Hey, fuzzy. I'm trying and failing to go to bed.
s/fuzzy/fizzy/ ??
I get confused whether I'm tired or not, but I'm definitely tired...
05:24
@VigneshKalai is your else supposed to be with the for?
I solved the problem using generators [next((value for value in values if data in value ),"No Value match") for data in check]
Yes it is for else
06:03
cbg @vaultah
cabbage :)
06:20
hey, I'm just getting into javascript, and i'm wondering how I can use javascript to run a python script on my localhost or server. I understand the basics of making a GET or POST from jQuery, but how do i make that actually run a script on the server side?
is setting up Django and using the url-mapper thing a way to do that? or is there a much simpler way? thanks
07:14
@Davidjb is your question essentially "how to write a web application in Python"?
> I have here a very dirty piece of code (it is very tricky code to torture students)
is evil
07:38
stackoverflow.com/q/32518055/3005188 ahhh linkedin questions, brings back the memories.
@Ffisegydd happy memories, yeah? :p
The sheer number of linkedin questions I burned to the ground helps me keep warm on winter nights.
"When the heating stops working - burn linkedin questions instead"
07:50
When inflation means that we're using money for toilet paper, we can still use linkedin questions for money
D'oh, that's an obvious , but I just cannot :'-( : stackoverflow.com/questions/32518313/zx-spectrum-loading-sound
How the hell can that get 2 upvotes?
Burn it with fire.
Cabbage
I didn't upvote it I swear.
@bereal So what's the reason? Did the program loading temporarily use RAM that was mapped to the video & audio hardware?
I remember some Amiga games did that sort of thing on loading: they used all the RAM they could get their hands on to decompress themselves, and that included the Chip RAM that was used to hold the video data.
08:05
@PM2Ring well, the audio part is just similar to modems, just you load it from a tape.
as for the video pattern on the screen, that's most likely, for tuning
@bereal Damn. Someone answered it while I was writing a helpful comment. Only 2 more cv's needed.
Aww, you miserable lot. That's a great question :)
The good ol' days of the speccy... wanna dig out my speccy emulator now :)
08:20
Same thoughts.
My guess would be it's testing channel response
In Russia speccy scene lived until late 90s
With that distinctive first sound. I am pushed towards procrastinating research...
they developed custom clones with 256 or 512k of RAM and cloned UFO and Doom.
Fantastic
08:22
The first part had real-time tactical phase: youtube.com/watch?v=6IcF7j9KskA
I guess we really don't need yet another simple indentation error question, but I'm a little uncomfortable closing it as a typo.
I have no such moral dilemmas.
I'm a simple man. I see a crappy question, I cv.
A prize to whoever finds the exact algorithm the speccy was using to find tape speed, volume etc from that noise*
08:28
if state != False: # ;_;
*no actual prize
I'd presume, tape speed was hard-coded. At some point, there were game collection tapes with custom loaders. They would fit twice as many games and much faster loading time.
def forall(seq,cond):
    """True if cond(x) holds for all x in seq, otherwise False."""
    for x in seq:
        if not cond(x): return False
    return True
# ;___;
all(cond(x) for x in seq)?
Cbg :)
08:30
Yeah all IYF
Cos I guess it's also lazy, unlike that fizzycode
(Unless that fizzycode is lazy and I just don't understand)
Well, it's lazy too.
Doesn't the whole seq need to be in memory for it to work?
Gotta love an early return, it speaks ofa true dedication to the lazy cause.
Ah I guess not, could pass in a generatory thing as seq. Never mind.
For the record I did not write this code
08:33
Don't worry bobby g, it's friday
The Great Debate: Is Short-Circuiting Lazy?
@Ffisegydd did you inherit that for maintenance?
No I just found it in the wild.
Github is dark and full of terrors.
@RobertGrant Short-Circuiting is Eager. Being eager to finish work is Lazy - e.g. in a loop :).
08:42
I would agree with @Fensiko
Knocking off work early has always been a virtuous form of laziness in my book
I'm not sure I can extend that analogy to encompass going to the pub, which is of course the very zenith when it comes to reasons for knocking off early.
I never remember what's what in terms of apogee and perigee, zenith and...the other one, etc
My brain suggested "meridian", which is how bad I am at those
(peri is close, ap is far, from what I remember)
But it could very easily be the opposite
Woohoo!
zenith is top / high
"peri" sounds a bit like "very", so perigee is very close to Earth. :)
08:46
although, strictly, I think it means "a point above" or something like that
I only remember that because I assume that peri sort of means far (as in periphery), and it's the opposite of my assumption
The opposite to zenith is nadir
nadir, that's it.
@Ffisegydd Maybe it predates Python 2.5.
Due to allowing youtube to play on following the speccy question, I am now watching kids reacting to a c. 1980 computer. Amusing. Well, mildly. youtube.com/watch?v=PF7EpEnglgk
08:53
Hey guys! I'm looking for a hacky way to display something on wxpython's ListCtrl
@JRichardSnape there's a good one where kids are shown a cassette player, an 8 bit computer and an atari console :p
So for some reason the ListCtrl only allows rows of items to be changed at once. I want it to change colors for a specific listItem, not a row of list
I can select the listitem and call SetBackgroundColour with no problems, but it doesn't actually change the color...
@JonClements TBH, that might be too much - I'd feel too old. Even with my spritely youthful ways ;P
So I guess what I'm trying to say is - Is there any way to modify single cells in a wx listctrl in any way?
@OneRaynyDay Just a guess: that sort of style control might be getting overridden by the theme imposed by the window manager.
09:02
@PM2Ring I think so too... Unfortunately, I've written a bit too much in listctrl to change to a completely different listctrl-esque format :'(
@PM2Ring Nah it's 2013. From the context, I suspect it was written by a non-Python developer.
I'll post up a question on SO to see if anyone is hacky enough to get around it, and if not I'll just display the selected values in a separate listctrl.
I currently have a love-hate relationship with wxpython
@OneRaynyDay OTOH, it might just be a "feature" of the wx listctrl to enforce uniform appearance of rows, to make it easier to handle the highlighting when a row's selected.
@PM2Ring first time I've heard of OTOH
Yeah, could be actually... I wish it was a bit more autonomous
FWIW, I encountered a vaguely similar problem a while ago with the GTK ListStore stackoverflow.com/q/25840091/4014959
09:06
Cabbage!
cabbage @poke
ahh... I see
This is a classic case of that xkcd comic where it's like
"tell me where the person is according to the background" "Oh yeah no problem, should only take a few hours using a GIS geography lookup"
"Oh and tell me if there are birds in the picture" "Okay give me 3 years"
09:23
OMFG. Chat inlines xkcd now o.O
With correct title text.
It's done that forever
Are you sure?
I'm sure he is
31
A: Which links and sites are handled specially in chat?

Juha SyrjäläThe current list of integrated (we call this onebox, or oneboxing, ala search engines) sites is: Stack Exchange sites: Questions / Answers / Users / Comments Stack Exchange Chat: Messages / Rooms / Bookmarked conversations Area 51 proposals Posts from the Stack Exchange blog, the Server Fault b...

hmm :/
Hey, poke. When a question starts: "I'm triying to run this" there's a good chance that the problem's caused by a dumb typo. :)
09:38
I don’t care :P
fid.close() boo, use with there too.
I was just minimizing the changes to the OP's code, but I showed him how to use with earlier. :p
Anyway, the OP's gone awfully quiet. I suspect he's found his bug / typo.
@vaultah Ooh! I didnt know that you could have a replying-to link in one-boxed stuff. That's handy.
@PM2Ring Just added the full file.
My best guess right now is that the file simply doesn’t have enough bytes left, so the following fails:
fmt = fmt + str(datalen) + "b"
nbytes = struct.calcsize(fmt)
data = fid.read(nbytes)
@Cong Ma Damn your are right, I was wrond indeed... — MathersMax 1 min ago
Suprise, surprise.
@poke Using readline() is the culprit. If you change the read(2) in my code to readline(2) it dies when i=10 because there are no newlines left in the file.
10:11
Actually, it dies because on the i=10 readline the string returned by readline(2) is just a single byte: the newline itself. And that'll happen for the OP too, even though they're on Windows because (as I just noticed) they're opening that binary file in text mode!
That code is so bad on so many levels that I don’t really care anymore tbh :P
I don't blame you. And I'm beginning to feel that way myself.
10:26
@PM2Ring that code is sooooo wrong.
@PM2Ring you shouldn't be minimizing the changes to bad code
you should minimize the reuse of teh shit
@bereal I'll answer that
@AnttiHaapala Well, I did use with both times in my 2nd code block. And I'm thinking of showing the OP how to replace all of those Readxxxx functions.
@AnttiHaapala I look forward to the answer :)
@bereal That’s a really good question, and I have no idea. So hurry up @Antti :D
10:32
^^ +1
^ Is that a “I don’t have an idea after all”?
I wonder - is it implicitly created a single tuple argument
Actually, I'm a bit confused. The examples should have generators paranthesized to work
but it works as described
10:39
it is totally fucked up
If you parenthesize the generator, it doesn’t work.
no - as it shouldn't
And what confuses me the most is that the order is turned around.
@poke agreed
This is excellent distraction fodder. Unless Antti puts me out of my confusion
basically, from ast point of view they are identical
10:45
Mmmm - why?
@JRichardSnape not yet
it was fixed in 3.5
call                 ::=  primary "(" [argument_list [","]
                          | expression genexpr_for] ")"
or I misinterpret what that means...
I don't think you misinterpret (indeed the OP example is from 2 - see the print syntax).
10:50
indeed...
But it works on Python 3.4.2 for me
I've lost the thread of what "works" means. You mean it gives same behaviour as OP?
I think
I think I know why this is
the parser is ambiguous
You've mixed *[2] and *['the first argument'] a bit in the first bit of the answer, @Antti - in particular the output doesn't match the input in the code block...
@AnttiHaapala oooh, interesting
i know iknow
11:01
Figuring that out: i.imgur.com/XE20szx.gif
Nice work there, Antti. Personally - I'd remove "surprisingly" from the sentence about 3.5 vs 3.4 - I think 3.4 behaves the same as 2.7 with the paranthesizing. Just that 3.5 has changed the behaviour as you describe.
no,
it didnt change
it fixed the bug!
you're not getting it :D
but I am trying to find where the bug is
I'm not - you're right
there is some special cases in the parser for parenthesized genexps
11:19
OK - I *think I see what you're saying now: the bug is that the generator should have been paranthesized and the fact the 2.7-3.4 did not raise that as an error when the other argument was *something is a bug. And that's fixed in 3.5. Is so, agreed.
yes exactly
I was more intrigued by the re-ordering, I think, and thought that was what you were calling the bug. That also disappears with 3.5
but I am still trying to understand why the bug occurs
of course the reordering disappears with 3.5
Possibly due to the same change.
@AnttiHaapala may be "of course" to you - I am not so well versed on changes 3.4 - 3.5. I saw pep 448 while googling around which seems a bit relevant
(in fact - I only just installed 3.5 - to play with this problem - or at least your solutions to it.)
that is the point why the parenthesized works (it does not work in 3.4) ;)
there is a special thingie in the grammar for unparenthesized genexp or sth.
>>> f(1, i for i in [42])
  File "<stdin>", line 1
SyntaxError: Generator expression must be parenthesized if not sole argument
>>> f(*[1], i for i in [42])
  File "<stdin>", line 1
    f(*[1], i for i in [42])
            ^
SyntaxError: invalid syntax
python 2.5
11:24
for God's sake, where did you find python 2.5?
It’s also become legal to provide keyword arguments after a *args argument to a function call.
ahha :D
@AnttiHaapala Sure - yes, I get that. I am with you now - apologies if I seem slow - not my home turf (BTW - also impressed you have 2.5 hanging around for these occasions)
maybe it is this change
I don't :P it was on my shell server
(that is, I do not admin that server)
11:38
Hello everyone. I have a little question. What's the difference between these code?
response = urllib.request.urlopen('http://python.org/')
print(response.read())
and this:
req = urllib.request.Request('http://python.org/')
response = urllib.request.urlopen(req)
print(response.read())
not anything there...
I don't see urllib.request, is that a monkey-patch?
but in the latter case you can customize the Request object more, before opening
@bereal yes, it is called Python 3
ah right, that hipster thingie
Get out.
11:41
@bereal yes, I'm using Python3.
@bereal slap
@AnttiHaapala Well, I understand. thanks :)
I think I get why the bug was there
11:45
@KevinGuan basically, the urlopen by default calls the default opener's open method, which checks that if the argument is just a string, it constructs a new Request() (so internally it does the same thing)
@JRichardSnape good, because I do not :D
well I do get it but I do not understand yet why it was caught because I cannot read the CPython parser
lines 2512, 2513
@KevinGuan I'd like to apologise in advance for all the pings you get over the next few days when people are actually pinging @Kevin :(
@JRichardSnape but it does not explain it yet :D
11:47
Before the condition (ngens && (nargs || nkeywords)) was not satisfied, because the star argument did not increment nargs
because it has nkeywords
and before the nkeywords would have been incremented for that which now is nargs
(i guess)
except, if these were not calculated as arguments at all :D
@AnttiHaapala Thank you.
@JRichardSnape hmhm complicated
it is somehow because of the named args after starargs
11:49
@AnttiHaapala of course. If you do not see it straight away - I assume it is complicated :) Just trying to stretch my brain / understanding
Wife's visa approved. Thank goodness.
@RobertGrant good to hear.
Yeah. There was no plan b for that
Would be a shame for Little Fizzy to grow up in SA.
@JRichardSnape anyway, as you can see this is really annoying, because I know the bug is in the parser but I cannot FIND the parser :D
it is somewhere there in the Parser directory...
11:50
@AnttiHaapala I also was wondering exactly where that was...
there is this gen_for
but where does it come from?
I really know a lot about python internals already but the parser is a biiiig mystery.
woot
gen_for is totally gone in python 3.5
Maybe it's time to summon Him for answers.
"I really know a lot about python internals already " is why I assumed it must be complicated
@Ffisegydd who is him
He has many names. The Old People call Him...El Pieters...
11:54
sorry comp_for :d
now
Grammar/Grammar
arglist: (argument ',')* (argument [',']
|'*' test (',' argument)* [',' '**' test]
|'**' test)
# The reason that keywords are test nodes instead of NAME is that using NAME
# results in an ambiguity. ast.c makes sure it's a NAME.
argument: test [comp_for] | test '=' test # Really [keyword '='] test
@Ffisegydd And if the Ninja in Clogs doesn't know maybe we can ping stackoverflow.com/users/1001643/raymond-hettinger
Ninja In Clogs <- Amazing. Best racial stereotyping ever.
@JRichardSnape ahha getting there I guess..
FWIW, Martijn does actually own a pair of clogs.
I hope they were presented to him in a ceremony when he came of age.

« first day (1791 days earlier)      last day (3382 days later) »