« first day (1795 days earlier)      last day (3378 days later) » 

00:00
One of my favorite test examples is from when I was working on modem chips many years ago. We had chips that had to conform to different regulatory regimes all over the world. One day the compliance guy came to me asking for help with a Brazalian "line cross" test (e.g. phone line comes into contact with AC). He said we needed to be able to sustain a line cross for -- don't remember, maybe something like 5 minutes.
My first response was "no problemo -- the modem goes on-hook when that happens." He responded "this is why I need your help -- for the test, the modem has to stay off-hook." I said "There's no effing way the chip can survive that kind of energy -- that's why it goes on-hook automatically!" and he said "The purpose of the test is to insure that any fire or explosion is contained."
Now that's test to failure. (Forgot to mention -- line cross was with 600 VAC.)
cool
600 Volts?
Yeah, that was the regulatory requirement. We just made chips; the Brazilian customer putting it in a box needed to run the test in a testing lab (think UL) and needed special non-self-preservation firmware from me... (Is that assisted suicide?)
But even when we aren't asking the chip to aid in its own demise, we are always torturing and killing them. Need to know how much of a lightning strike a modem chip can take (or how much static electricity for run-of-the-mill electronics)? Test-to-failure is your methodology.
makes sense
 
1 hour later…
01:54
Hi friends. I'm seeing some weird output with sys.stdout.write() in python 3.4.3
>>> x = 'hello'
>>> y = 'world'
>>> msg = ''
>>> import sys
>>> msg += x
>>> msg += '\n' + y
>>> msg
'hello\nworld'
>>> sys.stdout.write(msg)
hello
world11
 
1 hour later…
03:02
@linuxfan What's weird about that?
user559633
the int at the end of the output denoting the num of chars
I assumed he was in some sort of IDE, and that was the number of the next thing...
But I guess not...
user559633
nah, iirc, it's the buffer size on the textio object
How is Python 3 better again?
user559633
it does the right thing by default(tm) most of the time now, has coroutines, handles unicode
03:07
>>> l = sys.stdout.write('foobarbaz\n')
foobarbaz
>>> l
10
>>> sys.stdout.write('abc\n')
abc
4
>>> x = sys.stdout.write('abc\n')
abc
>>>
Most people just say, "What Aaron said." :D
user559633
What do you mean?
user559633
hey vaultah
03:08
6 hours ago, by DSM
(what Aaron said..)
user559633
yes, one quote six hours ago is most people :P
I might have done that if I refreshed fast enough. OTOH, I think mine's a tiny bit clearer...
But maybe not.
oh it's fine, I refreshed my browser cuz I wasn't sure who got it first.
Anyway, Python always used to consistently return None when you were using a built-in method that modified self. Could just be me, but I think this behavior violates that from a philosophical POV (if you consider self to be the entire state of the stdout file object).
@tristan And the coroutines aren't very general and the unicode usually gets in my way.
But I'm not a web guy.
user559633
coroutines are still settling in syntax and you don't need to be a webdev to care about unicode
03:14
There are a lot of contexts where the previous unicode worked fine, and the accepted use-cases for the settling of the coroutine syntax are essentially web-based, as well.
user559633
re: couroutine -- at least the examples. i see coroutines as a softer intro than multiprocessing for new users
Anyway, I'm a curmudgeon -- I don't see why we can't have coroutines at least as good as the ones provided by Modula-2 in 1980...
user559633
what was good about those?
user559633
i'm sure redhat will pay people to support py2 for at least a few years after 2020
You can transfer control out of a nested function without any special syntax in any of the parent functions, for a start.
AFAICT, generalized coroutines were always thought to be too hard for Python from a "how the heck do I bubble exceptions up to the top" standpoint.
03:20
I'm still trying to figure out where in the source stdout.write returns the len of the string it writes. Anyone care to point the way? hg.python.org/cpython/file/tip/Modules/_io
Actually Python 3.5 is probably "good enough" to replace Python 2.7 for most of my needs. There's a bit of a performance hit, but, for example, the new % operator for bytes removes a huge pain point.
user559633
That's a non-trivial thing to generalize, but I think we're going to pay that down over the next few years with 3.x
user559633
Yeah, the 3.x tax is rough as is defending "unicode is the right thing to do!" against legitimate performance needs.
the docstring is one thing. return len is another...
03:23
True dat...
user559633
I wonder when I'll give up and just switch to a Go/C++ stack
Go is interesting, but most of my use cases prioritize development time over run time.
Patrick Star!
And neither Go nor C++ cuts it there (for me, anyway).
user559633
I like C++. I mostly write Python because I like antagonizing the people in here.
6
03:30
Tristan gets three stars too!
user559633
Python, it's not Ruby!
And that's a relief.
Someone once told me offhandedly that, in his experience, programmers who were really proficient in C and assembler preferred Python to Ruby. Don't know if that's a one-off or if it generalizes, but at one time I was really proficient in C and assembler.
I'm also proficient in Verilog, but I'm an outlier there -- most of the Verilog people I know do perl or TCL...
user559633
I started becoming proficient enough in Ruby to see it as a less efficient PHP with a worse community
I think it's awesome when languages broadcast clearly that they're not for me.
03:37
But the Ruby community is so nice! They even have a be nice idiom!
user559633
@PatrickMaupin Yeah, I actually really appreciated it. I found a bug in the stdlib URI module, mentioned it, and everyone that liked Ruby told me that being non-RFC compliant was a good thing. One week later, another stdlib bug/feature. Didn't look back.
user559633
'Ha ha but we have so many memes in our slides and we're a group of "socially-inclusive" bullies, how can you not like us?'
@AaronHall So they can't even spell "idiot"?
user559633
be nice and think the way that we like or we'll dox/harass/mob you. so progressive!
@tristan To be fair, language maintainers get so many bogus bug reports that it probably makes some of the worst questioners on SO appear sane.
user559633
03:41
@PatrickMaupin i opened a bug report in the python stdlib (argparse) and the response on bugs.python was a "yeah, okay, but this is meant in X way" and it was left open more than longer enough for me to plead my case.
user559633
it's anecdotal, but was enough warning for me as to what i was going to be getting into with ruby
Yeah, I reported a regex bug and my MCVE was essentially immediately dismissed as too trivial, but (as you point out) the issue was left open (and subsequently fixed).
user559633
I'm willing to humor that I just had some bad experiences or that I'm missing something beautiful in the language as people are doing interesting things with it, but Python suits me fine and it's a sibling language, so "i came to a fork in the road..."
For me, personally, it honestly boils down to syntax. I don't mind C or assembler syntax -- they mostly make sense in the context. When Paul Graham says Python is a lisp-wannabe, I think he misses the point that, for some people, syntax matters (the lack of syntax in lisp is a strength in some ways, but a huge weakness in others). TCL is sort of a lisp-wannabe; Ruby shares perl's propensity for line noise; I don't like either approach.
@AaronHall Hey, at least I found the right file :p
Even if I was off by 1200 lines.
03:54
I guess you wouldn't believe that I backed out to the directory in case I was on the wrong scent.
:)
I'd believe anything. Code spelunking is sort of like riding a bicycle, but if you don't do it regularly you might wobble a lot when you get back on.
what I'm not clear on at this point is how the clinic directory plays in.
No idea. Interestingly, some of the files in there were updated just a few hours ago.
Seems like that's always happening...
I vaguely recall some fairly recent tool that helps to automatically generate some of the C code.
04:00
seems like every C directory has a clinic directory in it
cool, ok, gotta hit the hay!!!
G'nite, Aaron! G'mornin', Antti!
(And g'nite Antti and Tristan as well -- I need some sleep tonight too.)
Coulda sworn I saw Antti drop in, maybe not...
04:33
Looking for some quick obvious optimizations for a slow-running (several seconds) program. The program is searching a bunch (~100s) of text files (~20k lines, IRC logs) for a given work (username). Right now I'm looping over each file name, opening the file, reading line by line, and searching with "if name in line.lower()".
I'm basically looking for a sanity check, on whether there's a clearly better way I could be doing this.
@Sean, sure; paste the code.
Thanks. Let me just clean it up real quick so it fits nicely...
Use dpaste.org if your code is long
Alrighty. Please excuse the mess. It started as a throw-a-way that gradually became more useful (and slower). dpaste.de/fzkj#L13
 
1 hour later…
05:59
Hey up all
hey there
cbg
Just realised, that if Python has duck-typing, then PHP has ostrich-typing. If you ignore a type mismatch, it didn't happen.
08:07
closed
Cabbage!
Hey all
Hello.
Hi Ffisegydd
I'm working on a real-time trivia quiz game, with a wide range of topics. We recently added the Python topic and I was wondering if I can get some feedback on the quality of the questions and the gameplay.
Is this an appropriate forum, or is this room dedicated for SO discussions only?
08:18
Dunno what room owners think, but it send ok to post a link to me. No guarantee of feedback, though.
Yeah it seems quite interesting, go for it.
If it's a large bit of text you may want to post it to dpaste.com and link it here though.
Great, thanks. triviusgame.com
We just added a bunch of Python 3.5 questions too :)
08:20
I need an opponent!!!
I can't load it at the moment as am at work, but where should we send feedback?
Or is there a link on the page itself?
Oops, we have a problem!
Switching to other apps during a game is not allowed. You have been removed from the game.
Hey, firebase
Yeah, that's so you can't open a new tab and Google the question :D
Genius
08:21
There's a feedback link on the site itself
how about another window?
Okay cool, will have a look later.
or voice google on the phone
Or another PC?
Ha ha, true. We do what we can to restrict cheating. :)
08:21
or BDFL sitting next to you?
But no defense against the truly resourceful!
@OrionMelt hmm, can't copy the wrong questions
well...
it is like some of them are a bit vague
for example a, b = b, a
is not "swapping variables" but "swapping the values of 2 variables"
also
I just won! Boom
Lol I won \o/
instead of numbers I'd want to have a progress bar for the time remaining
08:23
Cool website; I like it :)
@Antti
Thanks
also, it should give feedback on after I give answer as ... "you answered foo, waiting for others to answer" or sth:D
Do you mean instead of Question #X of Y, you'd want a progress bar?
yeah I won!
noo
instead of the timer
08:24
Oh I see, okay, that makes sense
a progress bar that runs on top of the question
easier to perceive the time remaining
ah also, anon play should still allow you to pick a name
Hey, how come everyone is winning? :)
I do not know what was my name
I didn't win the second time
Very good point about the progress bar, thanks Antti
08:25
I really like the site though
You can change your display name if you're a registered user, but as a Guest, you can't
Thanks @RobertGrant!
Good branch off the quizup idea; makes sense
What happens if you can't find players?
But we're not particular about it though, we just launched last week and looking for initial feedback.
but I won
You should've signed in :)
08:27
also,
I won again. I'm PureMule, btw.
it should show the "Looking for other players... 2/4"
Wow turns out I know no Python
then you can notice if it is stuck at 1/4 forever then you can stop waiting
@RobertGrant, I probably shouldn't admit this, but if I can't find other players, I kick off some bots :D
08:27
You know no Python, John Snow.
I won.
I'm hoping there won't be a need for them once we start having regular users
It's really nice on a mobile btw
How do you make a class method private?
this is wrong
there is no way to make a class method private in Python
there should be an answer you really cannot make a class method private :D
well
debatable though :D
since stupid docs call them "private"
Thanks @AnttiHaapala, I single-handedly wrote every single Python question. I might have made several mistakes even after review :)
08:29
Bam. 2 on the trot.
is there a question "by value or by reference"?
lol
a reference-by-value :D
@bereal, ha ha no! I didn't add that on purpose
I had to pick questions that fit this format
08:31
@OrionMelt also I had a layout bug
'a' and 'b'
the 'b' answer was not in the grid
brief morning cbg all
Hat trick.
@AnttiHaapala oh really? Can I ask what kind of browser you are on?
anw, you should think about a feedback mechanism
firefox 39
> Switching to other apps during a game is not allowed. You have been removed from the game.
Then make the other players faster, I don’t want to wait 9 seconds doing nothing :(
08:33
I do have a feedback overlay, which is just a Google form for now. Do you mean a feedback form within the site?
@OrionMelt again on this "Given a = set([1, 2]) and b = set([3, 4]), what does a|b evaluate to?"
Damnit I lost ;_;
@poke, sorry about that!
feedback on a question
:D
you should probably do it the other way...
do it the way that...
@OrionMelt Did you create the game? Good job!
08:34
@OrionMelt I have a fun idea for the gameplay
oh, on a particular question. good point, maybe I can show it at the end of the game, as it probably won't make sense during a game, thoughts?
@poke, yes, thank you!
do it so that the first guy picks the choice, it is removed from others...
the fastest to choose the right answer gets the points
then it is always fast :d
@AnttiHaapala Meh, as if we need another fastest gun in the west-game besides SO… >_<
but it'd be fun, then you could have rankings in there...
08:36
Okay stopping now. It's really good though.
I'll play again later and sort out some feedback.
lol, good idea, although won't the other players get confused if an answer suddenly disappears while they are looking at all the answers?
Thanks @Ffisegydd! If you guys have any suggestions for questions, I'd be happy to add them. :)
Yeah, nicely designed etc. I have seen a similar quiz, but players also needed to occupy territories on a map by answering questions. That had some extra element of strategy.
I like it the way it is, but I'd either a) reduce the time from 10s to 5s or b) Make it so when everyone has answered it instantly finishes
Yes, advancing to the next question when everyone has answered is actually #1 on our to-do feature list....
08:41
"I'm using Django" I wonder, how it it relevant?
"I'm 25 and have a cat"
@OrionMelt Questions repeat often. Also, "which of the generator methods does thing" question does not mention the Python version, but the correct answer is next()
@OrionMelt haha :) not a bad solution
You could also do what QuizUp does and record times people take to play questions, and reconstruct their performance for later. But that may not make sense outside of the QU thing of challenging individuals
@vaultah, thanks! I've been adding more and more questions (manually), but there's only a 100 or so of them, so unfortunately some of them might be repeated. Where do I go for thousands of Python questions? :D
Stack Overflow :D
@RobertGrant, cool idea. All the data is there (since your score depends on how fast you answer), I'll just have to reconstruct the game and have a "replay" feature.
lol, yes, I did get a lot of them from SO, but I had to pick questions that had short answers, were short enough themselves, and could be answered in under 10 secs
That rules out "What is the output of this code" type of questions
08:48
Yeah not easy. I like the questions so far (3 games)
awesome, thanks! good timing with Python 3.5.0 release too, I just added a few questions about that a few hours ago :)
11/11 wins (I think) C:
@vaultah, great! are the questions too easy, or are you just that good? :P
@OrionMelt The question about what is a valid delimiter might need more context
And yeah I got a 3.5 question, which is cool
I posted it on /r/learnpython a couple of days ago, and haven't received feedback saying all the questions were too easy...
@RobertGrant, sure, how would you reword it?
08:52
@OrionMelt questions seem easy...
I just wasn't sure what it was delimiting
Like...strings?
Then again you have come to the Python chatroom on SO, we may be smarter than the average bear when it comes to Python.
Ah I see what you mean
@RobertGrant I got that too and still have no idea what it was about
@Ffisegydd, I really hope so!
My head hurts trying to think of more questions, lol
08:54
You can allow users to add more questions (with post-moderation)
Yeah, propose questions, and vote on questions (and suddenly, we do what we do on SO…)
ha ha :)
@vaultah, yes we are definitely planning on letting users suggest questions (and maybe even have others vote on it), but first we need users, lol
Oh - is that how it works? ;p
so we're currently focusing on generating content ourselves and of course, the site functionality itself
I've got a question I want to cv-pls but the 10 minutes isn't up ;_;
#first_world_so_problems
08:58
@OrionMelt you should make levelling up more of an occasion :)
I only know because I made a (much, much simpler) quiz site and that was something people really wanted - a bit more fanfare on levelling up
It should play the "Victory" music from FFVII, which is funnily enough called "Fanfare"

« first day (1795 days earlier)      last day (3378 days later) »