« first day (1657 days earlier)      last day (3296 days later) » 

12:39 AM
@SterlingArcher That's a funny site :D
 
1:18 AM
I'm writing a statistical function that forbids empty input. What kind of exception should I raise if the function is called with empty input?
 
 
2 hours later…
3:27 AM
a ValueError probably ...
or maybe even better a custom exception
 
 
4 hours later…
7:03 AM
Hey up
 
Hi
 
good morning to you all :)
 
7:19 AM
vaulta , do i have to put all the stuff i wanna output in a mongodb pipeline under $project?
 
7:39 AM
With this code, below two computations are giving two different results.
par1(r1, r2) = (r1 * r2) / (r1 + r2), or

par2(r1, r2) = 1 / (1/r1 + 1/r2)
>>> r1 = (1, 2)
>>> r2 = (3, 4)
>>> par1(r1, r2)
(0.5, 2.0)
>>> par2(r1, r2)
(0.75, 1.3333333333333333)
How does different style of formulae change the results? Is that a bug in mul_interval()/ add_interval/ div_interval in my code? par1 and par2 are as shown below:
def par1(r1, r2):
    return div_interval(mul_interval(r1, r2), add_interval(r1, r2))

def par2(r1, r2):
    one = interval(1, 1)
    rep_r1 = div_interval(one, r1)
    rep_r2 = div_interval(one, r2)
    return div_interval(one, add_interval(rep_r1, rep_r2))
 
8:12 AM
Hello, is it possible to program a GUI in java and run the background algorithms entirely in Python ?
 
@Nakkini Why would it not be possible?
 
@InbarRose because in life sometimes we can not get we want.
 
@overexchange Your problem is ints and floats. sopython.com/canon/36/…
@Nakkini That's very defeatist, and not very Pythonic.
 
Hi there !
I need a little bit help here : stackoverflow.com/questions/29939003/…
 
@InbarRose am using python 3.4.2
 
8:23 AM
@InbarRose not that one
 
@AnttiHaapala ?
 
little correction in my above code it is interval(1, 2) and interval(3, 4)
I think this has something to do with IEEE floating point format, where you lose the precision
 
@overexchange your code has 2 different calculations
so of course the intervals are going to be different
 
par1 and par2 are algebraically equivalent expressions. so results should be same
I think this has somehing to do with IEEE floating point format, where when you compute two floats you lose some precision.
In par2 we perform 3 div_interval operations and so we may lose precision.
 
no, this is not because of the loss of precision
 
8:32 AM
ok
 
your code is just wrong
 
which code? par1 and par2?
Q6 in this link realise that two algebraically equivalent expr are giving different results: Lem complains that Alyssa's program gives different answers for the two ways of computing. This is a serious complaint.. am trying to know, why?
 
Cabbage, mes amis
 
hello :)
 
9:01 AM
@overexchange Don's electronic engineering hat You've got a bit confused about what that assigment is trying to get you to do. It doesn't want you to put the intervals into the direct formulae, so when Antti is telling you your code is wrong, because he didn't have context, he's assuming you want an exact result - in which case you shouldn't be passing in a tuple (e.g. r1 = (1,2))
 
Cabbage
 
Cbg @poke
 
@JRichardSnape Sorry I did not get you. Are you saying the same point that I mentioned here? chat.stackoverflow.com/transcript/message/23013328#23013328
I am expecting an exact/same result from par1 and par2
 
@overexchange No. When I say exact, I don't mean same. By exact, I mean would return one value - this is common in most calculations for parallel resistors etc - we assume that the values of resistors are exactly known. You are working with inexact values, or intervals (as I'm sure you know). Without the context of the assignment that wasn't clear - interval(1,2) is not common terminology
Now. You wouldn't expect to get the same result, because the assignment is telling you to look for why you don't get the same
 
which assignment?
 
9:15 AM
Sorry - my bad terminology now. I meant "Homework question" by "assignment" there
 
oh ok i mis-understood as = operator, when you say assignment );
 
Yes - bad terminology on my part.
The good news is - I think your results are right. The bad news is - you need to figure out why
i.e. I would expect the bounded interval on the resistance values you gave to give [0.5,2] using method par1, given all the preceding questions / code and for par2 to give you 0.75 to 1.333
What it's trying to get you to look at is nasty problems when doing arithmetic with intervals instead of exact values - your python code is (probably, without seeing answers to previous questions) right.
 
I've had little luck with teh internets so I'll try it here. My script is a simulation that produces an error (or not) somewhere down the line. It's not feasible to step through the code each iteration at a time so I'd like to examine what happens in post mortem mode. Unfortunately I couldn't find a way to run the script like so: python -m pdb myscript.py in PyCharm. Any tips, or am I doomed to running it via a terminal?
 
Last thought - as this is veering off into engineering, rather than python. Try the hint - set the values of the intervals to high values with small % differences - e.g. r1 = interval(99,101) r2 = interval(99.101)
 
9:31 AM
@ikaros45 bad joke — Antti Haapala 8 secs ago
 
If I use high values this is the result
>>> r1 = interval(99, 101)
>>> r2 = interval(102, 103)
>>> par1(r1, r2)
(49.5, 51.756218905472636)
>>> par2(r1, r2)
(50.23880597014925, 50.99509803921569)
>>>
 
Ah, I found it. I was adding -m pdb to script options, whereas I should have added it to interpreter options.
 
@JRichardSnape For your question: you need to figure out why I strongly feel this is due to IEEE floating point format where we are losing the precision. I feel par1 ahould give more accurate output than par2
 
@overexchange I can't figure out why you strongly feel that, as that is in your head. I know plenty about floating point precision. I have no question - you are the one looking for help. If you feel that's the problem - put loads of print statements in your helper functions to convince yourself what's happening. Set r1 and r2 the same - then you know in the exact case, the value should be exactly half of the middle value. You need to think about why the intervals are different.
All I'm telling you is that the python is right - your problem is an engineering maths one
 
Damnit I forgot to by garlic for my pasta tonight D: now I need to go back out again.
 
9:45 AM
@Ffisegydd Get me some too. I'm off for coffee.
By the way Fizzy - I saw that link that you posted (I think to Kevin) last night - Time clustering paper looks interesting - revives an old interest of mine from too-many-years-ago masters dissertation
 
It was to DSM but yeah was an interesting topic. I love working with time-series data.
 
I am at -1 for posting a correct answer :D
 
@Ffisegydd You could buy "garlic bush" and keep it on your window sill for such emergencies.
 
Tempting but my windows don't get much direct sunlight.
 
Get some pot growing equipment et voila. :)
 
10:29 AM
re-cbg. Back, with garlic and caffeine concentrations in my bloodstream stabilised. Equilibrium restored
 
Looks like you're a fan of homeostasis? :)
 
In this question.. I do not understand the meaning of returns the interval of all values f(t) such that t is in the argument interval x
 
@AnttiHaapala Maybe someone objected to your bold must not. They don't like being told what to do, those RasPi hackers... I note the problem no longer persists
 
Q8. Write a function quadratic that returns the interval of all values f(t) such that t is in the argument interval x and f(t) is a quadratic function:

``f(t) = a * t * t + b * t + c``
 
@RomanLuštrik Oh, I don't know - I quite like puntuated equilibria. I'm easily bored
Although my current level of fitness might indicate too much stasis...
 
10:33 AM
Don't you go Walt Disney on us, now.
 
That reference is too obscure for me (or at least off the top of my head) heads to google...
 
Walt Disney jumped into a deep freezer and is now in a state of deep inactivity.
 
ahhh, I see. A little early for the deep freeze for me, I think (hope). I did note yesterday that I started programming 25 years ago, though. I'm going to claim a young start, but still...
 
I remember doing first html files in primary school. I still remember having problems because Internet Explorer wouldn't recognize my html file, only to realize it was actually a .txt. Damn you hidden extensions in windows (still a problem today, ~20 years later).
 
"html in primary school" The internet didn't exist when I was in primary school. HTML was specified the year I left. Now that's scary. I remember the school had one physical turtle which you could connect to a BBC B and drive around using simple logo. The teacher could never get it to work and would hardly ever let me have a go :(
 
10:52 AM
I remember playing with LOGO in primary school. I remember learning what a degree is. :)
 
I remember that too. We used Lego Logo at the science/engineering camp I went to.
Although I had some trouble wrapping my head around programming at that age. It wasn't until my friend taught me TI Basic in high school that I understood the basic idea.
 
We would work on stuff like that, but always end up playing Warcraft 1 or some other games I don't remember any more. :)
My first "true" programming experience was in college in early 20s... Had I started earlier, I would be much more proficient in some other languages. Too bad I never had money for programming books.
 
@JRichardSnape I didn't
@JRichardSnape I said "maybe you should not"
I changed it to "must not" afterwards
 
@AnttiHaapala Fair enough - I lazily didn't check the edit history. Was just musing (procrastinating) You can probably guess this, but for the avoidance of doubt - I wasn't the downvote, so wasn't explaining myself :D
 
@RomanLuštrik My first "True" programming experience was an RPG my friend and I wrote on our TI-89s in high school. But I didn't receive any formal education in it into undergrad at 19 when we learned Matlab as part of our signal processing course, and two years later when we learned C in a "C for engineers" course.
 
10:59 AM
@JRichardSnape :D
 
Unfortunately my training as a biologist involved zero computer time. Which is sad, given that I now work in biology/ecology 110% computer time. :)
 
yeah my friend did genetics :D
 
I did biomedical engineering, which had, if I remember correctly, at least 3 required programming-intensive courses, as well as several optional ones.
 
it amazes me that they really do not have any programming to speak of...
 
I had a TI-81. The recommended one at school was a Casio. I laughed at them. Always like to be different - I attribute my early 2000's leanings towards Linux that way.
 
11:06 AM
I had a 3-color casio for a while, I switched to an 89 because its calculus capabilities were better.
 
Although - given the number of questions I see that mysteriously involve the characters 'A','C','T' and 'G', I suspect there is some basic stuff being done...
"Calculus capabilities were better" and there is where I triumphed
 
I had TI 86 and 89
 
cbg
 
89 I won at a school, there was a math competition at my highschool and the one who posted the best detailed solution then got a 89,
 
Although, I have to admit, I never got as far as writing an RPG on it!! HT @TheBlackCat
 
11:07 AM
@JRichardSnape Shouldn't be too surprising, bioinformatics is a thing
 
Did sumone mention ?
 
funnily enough they gave out 5 calculators (samples or so), I got one, and the one who had always been the 2nd in each of these 5 tasks, got a pizza
 
@BhargavRao Several someones, in fact
 
yeah - I know :) I feel like I'm teetering towards a shhh big data discussion
 
Nice that Logo is still in the air
 
11:09 AM
@BhargavRao left(180), forward(30)
 
@BhargavRao More reminiscing about the good old days, I am afraid.
 
I know the answer, but the OP doesn't reply
 
@BhargavRao as in cving?
 
11:10 AM
No
 
cv'd already :d
 
@BhargavRao Walk on by...
 
It is a good question
Can you please tell as to what is the specific answer you are looking for? For the question Anyone else get UCBLogo to work as described in the manual?, the answer is yes — Bhargav Rao Mar 22 at 12:13
 
sorry but the question is not good
you asked for clarification 1 month ago
and the OP failed to come up with clarification
 
It is not framed properly. The OP should have clarified
 
11:12 AM
so can you frame it properly
you said you have that logo on windows?
 
Have to agree with Antti here
 
if you can verify the problem you can edit the question so that at least it is a question on how to fix it
 
As I mentioned there, For the question Anyone else get UCBLogo to work as described in the manual?, the answer is yes
:D
 
so, it is not a very good question at all
it is not widely useful
 
Yep
Not useful in general
We need more questions in both those tags
:(
@Antti Any leads on tilaprimera?
 
11:18 AM
@BhargavRao not that I know, last online bout 1 hour before the quake
 
Yep. And his place has been badly hit
 
ahh
twitter :P
@BhargavRao s/he/she/ :D
 
Thank God
@AnttiHaapala What's that huge pile of food there?
 
Calling some one a failure is not good
 
11:28 AM
@BhargavRao actually now that I reread that, it isn't calling OP a failure, just that the task is a failure :D
 
I disagree that it should be flagged
 
Ah! Another disputed flag then
:(
 
Yeah, was reading that
 
(noticed that the link didn't show up well and couldn't be edited anymore)
 
11:32 AM
Oh Damn! Hailstorms again :( :(
4th day continuous
When you have a clear error, you should search what it means and try figure it out before asking a question here. — SuperBiasedMan 39 secs ago
:D
 
@BhargavRao armageddon imminent
 
My only problem with that is the old tree in front of our house
 
How about you'd use the google or the search box on the site. — Antti Haapala 51 secs ago
 
Nice hammer there
@AnttiHaapala You saw the video footage of the earthquake?
 
not yet
 
11:38 AM
Hi everyone, I am having problem. Are these two statements same because they aren't giving me same results, I mean output is same but problem occurs when i use these in code.
table = [ [0] * (capacity+1)] * (length+1)

table = [[0 for i in range(capacity + 1)] for j in range(length + 1)]
 
@AnttiHaapala Just see the visuals here youtube.com/watch?v=jBHsx4PBN8g&feature=youtu.be
@Ankit What are capacity and length? Integers?
 
Yes, constant integers/
 
Oh Ok
 
Second statement is giving me correct output in code while first one doesn't. When i tried to print those individually they show same exact output.
 
You've got a reproducible code?
 
11:41 AM
It's because lists are mutable.
 
Fine got the error
[0]*(capacity+1) the culprit
There is a SO post on this, searching for that
 
Thanks, Please share so that i can understand.
 
To understand - define table both ways in your interpreter. Then do table[0][0] = 1 on both versions. The difference should be visible...
 
11:44 AM
Good work, sir - SO skillz
 
Oh Antti has already posted :(
 
Thanks everyone, I didn't knew that. Thank you again. :)
 
Ah, I always forget the canon
 
@Ankit I didn't *know that :)
 
11:46 AM
bhargav-rao-cc -Pedantic :D
 
overscrupulous
Malevolent Pedantic For Life
:D :D
 
So finally
The tree falls
:'(
 
didit?
 
Kind of
The main bark is still there
 
12:00 PM
I thought you'd enjoy that one. :-P
 
This makes me sad. link‌​. The OP is just totally unaware of what he is trying to do, he doesn't even know how to ask properly.
People don't take the minimum time to read the tutorial before coming online to ask for help.
I would rather stay away from dictionaries right now and just program it normally on python first, I might check it out later but for now I am more interested in programing it manually on python first. Thanks anyways :) — NecropolisMcServer 5 mins ago
Dictionaries are absolutely part of "normal" python, and their basic usage is not very different from lists. You really should consider using them. — leeladam 4 mins ago
Lolz.
 
It seems like a lot of new users get their very first experience with file manipulation when they want to make a persistent high score table for their game.
 
Yes, and again, they don't take the minimum time to learn on their own before coming online for help. The easy access of the internet is it's own downfall :P
 
Leading to a mess of a question like "I want a high score list that can contain three users, and each user has up to ten high scores, with higher ones pushing lower ones down the list, and I'd like each user to be sorted based on average score..." when they really should start with "how do I get the lines of a file into a list?"
 
should we have a "canonical" highscore in a file -answer
 
12:11 PM
How about "how to save and load data"
It's not just about highscores, or reading data, its about the whole save/load feature.
pickle, csv, sqlite, (or even mongo) are all better than dumping into a text file.
 
Cᴀʙʙᴀɢᴇ
 
-1
A: Python Reading from .txt file

TichodromaCode: data = """Username:level:Score Starplayer:2:24 John:2:14 Starplayer:3:14""" highscore = sum(int(row.split(":")[2]) for row in data.split("\n") if row.split(":")[0] == "Starplayer") print(highscore) Output: 38

downvote pls :D
looks like a troll
 
The answer?
 
I'd probably go with csv or json. A human readable output file would be easier for them to debug.
 
12:14 PM
Um.... I disagree.
 
I mean, why do you post a troll answer and do not just CLOSE THE DAMNED QUESTION
 
@AnttiHaapala ??? Had heard of [cv-pls] ... What is this new [dv-pls]?
:D
 
@BhargavRao ^see the answer above
 
I don't think he is trolling, maybe just lazy :P
 
Oops, it works.
 
12:16 PM
(removed)
 
lol :D
anw, that q should be closed
 
Oh, wow. I just put that in my parser - so many errors. Damn. It's not like him to make such a trolling answer.
 
Are we talking about the same answer?
>>> data = """Username:level:Score
... Starplayer:2:24
... John:2:14
... Starplayer:3:14"""
>>>
>>> highscore = sum(int(row.split(":")[2])
...     for row in data.split("\n")
...     if row.split(":")[0] == "Starplayer")
>>> print(highscore)
38
 
yes.
 
But it runs and produces the desired output.
Or are you saying that the code is deceptive because it only produces the high score for Starplayer, even if Starplayer doesn't have the highest combined score?
Ok, I agree with that.
I have pointed this out to the guy, as there's a chance that he simply misunderstood the requirements.
Based on his previous comments, though, I expect him to say something like "changing this code so it finds the cumulative score of each user, and then chooses the maximum among them, is left as an exercise to the reader"
 
12:29 PM
You've been very gentle there - and any response should elucidate whether he's misunderstood or just trolliing
 
all the "any inputs" should be closed with "unclear what you're asking" and asking to ask a single specific question
 
@gladys0313 Could you please post the answer? — Bhargav Rao 18 hours ago
@BhargavRao, yes I have posted it — gladys0313 5 hours ago
Can anyone explain his answer there?
 
@BhargavRao Nope, that must have been the other Kevin.
 
morning friends
 
12:31 PM
He said pretty much what I would have said, though
 
@Kevin Argh! Too many Kevins
But the answer is too damn obfuscated there
 
@BhargavRao They're subtracting the bigger set from the smaller set instead of vice-versa
with an edit, the answer posted is right
 
Well, really, we're all just four-dimensional projections of a single five-dimensional Kevin hivemind. There can be, and is, only one.
 
(i.e. edit to make the code bits clearer)
 
Naw, in his ques the length of the lists are opposite
 
12:33 PM
it is not correct...
 
I think, though, it might fall into the typo category.
 
the question and the answer are wrong
 
ooops - sorry - you're right
I think they are confusing themselves. I suspect that they have taken the larger from the smaller
but in typing it up have made a similar mistake. It closes as a typo, surely? Unless they respond with more info
 
should close that question and ask it to be moved to the "puzzling"
 
cv it?
 
12:35 PM
what's something easy to assign to someone for a web application? CSS?
 
Easiest is to not assign anything :D
 
proofreading
 
We just need this column dynamically centered on all major browsers... maniacal laughter rings through the halls
4
 
Actual laugh in the office for that one
 
Success :-)
 
12:37 PM
Saying "Actual laugh in the office" makes me think about the mongodb webscale videos. I was literally creased up at those. I almost fell off the chair.
 
Damn - now all my colleagues with line-of-sight to my monitor know I'm chatting... Back to the abstract rbrb
 
here, have a star for your efforts
 
Same to you Just kiddin
:D
 
b.b..b..but its ✨✨***webscale***✨✨
 
I wonder why Chrome doesn't show some of those unicode symbols. I mean, I'd expect Chrome to show them properly, it's not as if it's IE6.
If anyone can answer this (and how to fix it) I will gift them my finest stallion.
 
12:43 PM
Internet Explorer 1 Google Chrome 0
 
I suggest screwing around with the "encoding" menu until it works.
If Chrome doesn't have an encoding menu, I suggest switching to a browser that does.
 
Funny it was already set to UTF-8 :/
And setting it to UTF-16 breaks the internet.
 
what do y'all think of RethinkDB ?
 
Rhubarb all
 
@Ffisegydd shitty font
 
1:03 PM
@AnttiHaapala Good call. FWIW, my Firefox 29.0.1 isn't rendering those "✨✨" properly, either, even though it does detect that the encoding is UTF-8
 
user559633
@MartijnPieters hah, yes. i maintain my point of view.
 
@PM2Ring possibly use something else than comic sans :P
 
1:18 PM
aaand finally figured out this problem, and it seems really obvious now...
just had to make multiple extended controllers to reduce redundancy
 
user559633
@JRichardSnape yeah but we're chatting about python. you will learn something from being in this room, i promise
 
@corvid I don't know. I'm tempted to just say Choose Boring Technology, but that's just knee jerk reaction.
 
Good morning lovely Python people
 
Damn, this question was so nice and clean that I bookmarked it as a canonical Q, but now the OP is back with some "one more thing..." BS involving menu bars or I don't even know what
 
@WayneConrad Iunno, I'm just inherently drawn to new things, even if they're bad
 
1:27 PM
Me too :)
Programmers are like crows. "Oh, shiny! Must take it back to my nest."
 
Like crows? I am a crow
 
I hadn't noticed. Haha!
 
@corvid <grumble> Their website renders really badly on my phone - which starts them at -10 in my book. Specially when it's obviously a Jekyll site and there's a ton of resources how to specifically make them responsive </grumble>
 
user559633
@corvid if it does what it says, it's a cool replacement for firebase
 
1:43 PM
I think this question should probably be moved to Code Review: stackoverflow.com/questions/29969031/too-many-branches
 
That code is a little smelly.
 
When I write a statistical function that forbids empty input, what exception should I raise when the function is call with empty input? (Btw, is raising an exception the way to go?)
 
@Heisenberg Probably ValueError
 
cabbage
 
user559633
cbg @tilaprimera how are you doing? (subtext: i hope you and your family is safe)
 
1:55 PM
I was lucky and so were my family and relatives.
 
user559633
good
 
Just checking in to say cabbage.
 
@tilaprimera cabbage
 
I assume you all know the updates by now on the situation here.
@TheBlackCat cabbage
 
@tilaprimera I don't follow news, so I don't. I understand it's very bad, much loss of life, property, monuments.
 
1:58 PM
@tilaprimera :d
 
Most of the eight world heritage sites are in rubble..
 
if there are any new aftershocks, remember you need to come online to stackoverflow asap
how about the housing there?
 
user559633
heritage sites are just places and structures. replaceable.
 

« first day (1657 days earlier)      last day (3296 days later) »