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

### NY Lost Funds

 srart :-D sproingie attrgetter can actually get multiple attributes at onceit also has a __getattr__ method itself, but i can't see what it's used forer __getattribute__ that is srart I'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 zpertee hello 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 riczho zpertee: Taylor series? srart zpertee: are you entering X on the left, and trying to get a taylor for it? riczho zpertee: Looks like sin(x). zpertee I'm trying to solve for sin using this formula srart diffeq class? zpertee precalc srart what? big extra creditor is your school just nuts. riczho Heh. zpertee srart: extra credit. maybe I'll pass this way srart do you have ANY code yet? riczho So you want to create a function that takes the number of terms (or some maximum error) and return an estimate? zpertee yes. 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 notriczho: yes otherwise it would just go on forever srart it's easy to find factorial examples all over the web. zpertee I've found a factorial function already and it works riczho OK, so since the nth derivative of sine cycles, you can easily know those. srart where is your code dying? riczho Then you just loop until abs(next term) is less than your maximum error.(Where each iteration adds the next term). CSWookie Heneral channel policy, has always been no specific help for class work, btw.s/Heneral/General/ srart hence the leading questions zpertee CSWookie: ok. I'll just ask somewhere else riczho Oh, sorry- I just started listening around here today. CSWookie I just thought I'd mention it. srart good learning for code, non CS specific. zpertee is the overall feeling though that I should create a function to do this though CSWookie zpertee: Probably.I'd look it up on wikipedia. zpertee CSWookie: good old wikipedia CSWookie They offer some fairly readable pseudocode for well-known functions. srart zpertee: look at lambda and zip functions, build your factorials in a list, and your exponents the same way, then smoosh em together.