« first day (2474 days earlier)      last day (2474 days later) » 

10:03 PM
how do i type the scipy quad function into a calculator?
 
2 hours ago, by davidism
Do research before you ask. Have a basic understanding before you ask. Don't answer if these two things are obviously not fulfilled.
 
i did. i keep trying to integrate it from 0 to my set value using the defined function and it doesnt give the same value
 
lol, a flag
 
now who flagged that
 
ahhh the bliss of not being a room owner :)
 
10:07 PM
@FairlyFactual and do you have some code that you can show? Please read about MCVE first.
 
@enderland *10k user
unless I misunderstood you
 
room owners see flags first, after a while 10k users see them
iirc
 
I haven't heard that
I wasn't even sure <10k ROs see them
 
I'm not 100% sure, tbh, I've been a mod on SE chat for like 3 years now
so.... I see them :'(
 
ok heres the code: from scipy.integrate import quad
import numpy as np
t = np.arctan(3.05*np.tan(5*np.pi/18)/2.23)
Dx = lambda t: -3.05 * np.sin(t)
Dy = lambda t: 2.23 * np.cos(t)
def func(x): return np.sqrt(Dx(x)**2 + Dy(x)**2)
print quad(func, 0, t)[0]
 
10:10 PM
so what is your question?
 
my calculator is giving 3.11212 and python is giving 2.53141952655
 
make sure degrees vs radians are OK
and that you're doing the same thing and correctly
 
I'd calculate the result on paper
if possible
 
10:11 PM
i plugged all trig things directly in as floating point values to avoid degree/radian problems
 
you have sqrt(const + cos**2) in the integrand
@FairlyFactual that sentence only makes me more certain that you messed up your units:P
I don't really understand it but it sounds like a bad sign
 
+1 do it by hand.
 
I'm not sure it's possible
perhaps in complex form
then again you can drop it into wolfram alpha and see
 
just compare them step by step until they diverge.
 
they diverge at the last step
 
10:14 PM
do Dx and Dy values agree?
 
first make sure the t is the same
just replace it with the constant that you got from your calculator
 
just ask the same thing from wolfram alpha and see which one is wrong
 
lol I got yet another number :D
 
10:21 PM
in before earlier in his code he set np.pi = 3 # close enough
 
@AndrasDeak nice, you can write that...
 
8 mins ago, by Andras Deak
then again you can drop it into wolfram alpha and see
 
I must have typoed my limit
 
it's Mathematica syntax which is non-trivial, that's why I did their work for them
 
umm no
ah parenthesized wrong
Fortunately it allows writing this*)
 
10:23 PM
I suspect a similar issue with the wrong calculator version
 
Ah ok I see what I did wrong now lol
@AndrasDeak Thanks for this link because it helped me to see the error
 
and the error was?
 
It was just a typo in the calculator that i couldnt see until i retyped the entire thing out based on his answer
 
extra points for "colliding t in integrand argument and limit"
 
I am too tired :D
I was like "WTF is he talking about" for a minute.
 
10:26 PM
and +1 for sharing with us all the resolution to the problem, instead of just vanishing into the night
 
i should probably get some sleep lol
i just got back from a 36 hour train ride and couldnt figure out such a simple problem lol
 
typos are always trivial in hindsight
 
36 hour train ride
 
now... that's... kind ... of .... long...
 
10:28 PM
Trans-Siberian Express
 
i was in new mexico
 
ah the states :D
 
lol yeah :/ slow trains
 
that expalins.
 
i was in france 4 weeks ago and the trains were fantastic lol
 
10:30 PM
Does it not take too long to get across the Atlantic via train?
 
yea... TGV rules and... want to go to a village with 7000 people - by train of course
 
"The Sub-Atlantic Express"
 
wim
@AndrasDeak I don't agree with that deletion, that's a legitimate mistake that is easy to make. This question can be a useful search result for people seeing the "'str' object is not callable" TypeError.
 
New PEP: str should implement __call__, which just calls eval(self)
 
wim
10:40 PM
So vote to close as a dupe that it can be a signpost. It's certainly not a "simple typo".
 
The weirdness of the specific example, i.e. the shadowing of print of all functions, makes me believe that it's not a useful sign post
I won't contest if you get it to be undeleted, but I disagree with your assessment
 
wim
That's not weird. They mentioned in a comment they had an argument named print.
 
weird as in unlikely to happen very often
 
wim
is for getting rid of spam / hateful / harmful content. you're misusing it.
 
uhhhh no, offensive flags are for that
 
10:42 PM
shog has more or less said "closure is the road to deletion" on multiple occasions
 
wim
that doesn't apply for closure as dupe.
linked up dupes are very useful for the search
 
well, it should have been fixed.
 
Fixed how? What?
 
should have pushed for mcve from them so that they'd write more code.
 
wim
@AndrasDeak you want to delete all problems that are unlikely to happen very often?
 
10:45 PM
and explain how the error happened
 
wim
yes, I agree with @AnttiHaapala
 
@wim not all of them, only the ones that have a gazillion dupes of the general problem
 
as I said, I'm not going to lose any sleep over this if you get it undeleted
 
wim
it should have reproducible example, but it still was obvious enough from the context what the issue was in order for it to be answerable.
 
10:46 PM
sounds like you don't need another signpost
 
but then, @wim you didn't ask for a mcve :D
 
I just didn't find it to be of any additional use
 
wim
@davidism that's a bad post with way too much code
 
so it looks like we need a new canonical dupe
 
Ok, well I'm sure there's plenty of other posts. And like Antti said, clean it up.
 
10:47 PM
@AnttiHaapala that could be useful
 
wim
alright, if it ever gets undeleted I'll request the user to make it reproducible in the question.
 
No, fix the dupe, it's already got Google juice. Or pick another dupe.
 
wim
Perhaps it could even be a good canonical for that exception, that's clear and concise.
 
I'd say a new canonical one.
and close everything as a dupe of that
that first google hit is awful code.
 
Then pick a different one.
 
10:49 PM
I mean if there is nothing nice, a self-answered one would be nice
 
wim
self-answered questions are kinda gross, imo.
 
I don't personally see the problem with the linked dupe. Or at least one that can't be cleaned up there.
 
wim
too much code, no easy way to clean up all that code whilst keeping the answers relevant
also too many junk answers lying around on it
 
that's the problem
 
I still want to see the ability to dupe target documentation.
 
10:51 PM
All the answers still seem relevant with minimal code. They're mostly just saying "and this can cause it too", not "and this is also wrong with that specific code".
Downvote the answers that aren't good. them ;-)
 
I found a better duplicate for that other: stackoverflow.com/questions/17963264/…
 
wim
that's a bit better
overwriting print is a bit more interesting, because that's not possible in python2 without the future import
 
stackoverflow.com/documentation/python/9300/… TypeError: <obj> is not callable is covered here.
 
wim
that one is pretty decent
shrugs probably Martijn thinks it's kinda OK to answer a dupe if you can answer it faster than you can find a good target ... :P and I would tend to agree
 
So `return sum(x['actual'] == x['predicted'] for x in image_entries) / len(image_entries)`
 
10:59 PM
bane of SO
 
So all that's left to do is point all the high visiblity dupes at it, assuming we're going with that one.
Going back to the original premise though, that still doesn't mean we can't delete duplicates.
 
wim
 
11:17 PM
 
@wim haha, that is great
 
I feel like I just walked into SOCVR accidentally.
 
is it a good idea to store active user on a server and deserialize them from there, or is it better to looking them up from the database to deserialize them?
 
stackoverflow.com/questions/45314922/… pictures of code, no actual question?
 
wim
11:29 PM
@AnttiHaapala yah, that's a perfect dupe for the one I answered
just deleted another accepted answer, gee that's fun
 
@TemporalWolf Willem's probably going to answer it anyway
 
@AndrasDeak All the more reason to ninja close it before he can post it.
 
hehe
 
he can't answer it now >:)
 
wim
this is really nicely illustrated: Learn git branching
5
likely too basic for everyone here, but I wish I had that resource back when I was learning how to git
 
11:33 PM
@wim you keep forgetting the likes of me:P
looks useful, thanks
 
"too basic for everyone here" I think you overestimate people's abilities
I starred it so I can find it when i get home.
 
wim
ok, cool
 
I get questions about basic git stuff at least a couple times a week, if that checks out I'll just refer them to that.
 
@wim my friend made that
Back when he was learning git
 
wim
11:52 PM
oh, nice. he must be good with javascript
 

« first day (2474 days earlier)      last day (2474 days later) »