#python - Thu 26 Apr 2007 between 00:00 and 00:20

sproingieattrgetter can actually get multiple attributes at once
it also has a __getattr__ method itself, but i can't see what it's used for
er __getattribute__ that is
srartI'm working on the help implimentation of jython, operator doesn't have attrgetter implemented, and the call used is classes.sort(key=attrgetter('__module__', '__name__')) ,then some reflection type magic to call for '__doc__', eventually.
that call is from C version
zperteehello i have a formula that I need solved when I enter any real value for x. I've posted my formula at http://pastebin.ca/458773. I'm getting stuck any help appreciated
riczhozpertee: Taylor series?
srartzpertee: are you entering X on the left, and trying to get a taylor for it?
riczhozpertee: Looks like sin(x).
zperteeI'm trying to solve for sin using this formula
srartdiffeq class?
srartwhat? big extra credit
or is your school just nuts.
zperteesrart: extra credit. maybe I'll pass this way
srartdo you have ANY code yet?
riczhoSo you want to create a function that takes the number of terms (or some maximum error) and return an estimate?
zperteeyes. i'm a newbie but I started trying to do a while loop to generate numbers but not sure If i was on the right track or not
riczho: yes otherwise it would just go on forever
srartit's easy to find factorial examples all over the web.
zperteeI've found a factorial function already and it works
riczhoOK, so since the nth derivative of sine cycles, you can easily know those.
srartwhere is your code dying?
riczhoThen you just loop until abs(next term) is less than your maximum error.
(Where each iteration adds the next term).
CSWookieHeneral channel policy, has always been no specific help for class work, btw.
srarthence the leading questions
zperteeCSWookie: ok. I'll just ask somewhere else
riczhoOh, sorry- I just started listening around here today.
CSWookieI just thought I'd mention it.
srartgood learning for code, non CS specific.
zperteeis the overall feeling though that I should create a function to do this though
CSWookiezpertee: Probably.
I'd look it up on wikipedia.
zperteeCSWookie: good old wikipedia
CSWookieThey offer some fairly readable pseudocode for well-known functions.
srartzpertee: look at lambda and zip functions, build your factorials in a list, and your exponents the same way, then smoosh em together.

Page: 2 9 16 23 30 37 44 51 58 65