User Profile

Collapse

Profile Sidebar

Collapse
DDCane
DDCane
Last Activity: Jan 24 '08, 02:58 PM
Joined: Oct 24 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • DDCane
    replied to derivative and newton raphson
    ok. is there a simpler way to write the newton raphsons method in python? ive looked at the discussions in the forums here and havent found anything that could help m efurther than what i already know. do u have any clue on how to write the method?...
    See more | Go to post

    Leave a comment:


  • DDCane
    replied to derivative and newton raphson
    globally in the module?...
    See more | Go to post

    Leave a comment:


  • DDCane
    replied to derivative and newton raphson
    how am im supposed to fix it? fp in solve is the fisrt function. u use the first function to get the derivative of f in the first function. do u know how i fix this?...
    See more | Go to post

    Leave a comment:


  • DDCane
    replied to Parsing a log file, etc
    def countclient(fil ename, client):
    f = open(filename)
    x = len(f.readlines (client))
    return x

    does that look like something that could work?...
    See more | Go to post

    Leave a comment:


  • DDCane
    started a topic derivative and newton raphson

    derivative and newton raphson

    i have made a code for finding a derivative and now im trying to use it to help me with a code for the newton raphson method:
    [CODE=python]
    def derivative (f,x,h):
    import math
    return float(1/(2*h)) * (f(x+h) - f(x-h))

    def solve (f,x0,h):
    delta= f(x(n))/fp(x(n)
    for x(n+1) in solve():
    x(n)-delta[/CODE]

    the first def works fine but i cant get...
    See more | Go to post
    Last edited by bartonc; Oct 30 '07, 12:36 AM. Reason: Added [CODE=python][/CODE] tags.

  • DDCane
    replied to Parsing a log file, etc
    has anyone come up with anything on function 2 and 3? ive been fooling around with this for s couple days and cant seem to get it right. thanks for all the help....
    See more | Go to post

    Leave a comment:


  • DDCane
    replied to command-line phonebook using a dictionary
    The voting worked perfect. it was exactly what i needed.
    the only reason im asking alot is cuz i have a dead line next week and i got alot to get done that is kinda hard for me....
    See more | Go to post

    Leave a comment:


  • DDCane
    started a topic command-line phonebook using a dictionary

    command-line phonebook using a dictionary

    i need to make a dictionary that works as a telephone book.
    this is what needs to happen when i type in the following:

    add name number – it adds the name and number to the phonebook
    lookup name – returns the number for the given name
    alias name newname – lets u look up the number by typing the name or the alias "newname".
    change name number – changes the number that is connected to the given...
    See more | Go to post

  • DDCane
    replied to getting the sum of digits in a number
    Hey guys! Actually I'm American but I live in Sweden at the moment. Where in Sweden are from?...
    See more | Go to post

    Leave a comment:


  • DDCane
    replied to getting the sum of digits in a number
    temp

    one other small problem i have is i need to define a function that takes the number i put in splits it up and adds them together for example:

    123 --> 1+2+3=6
    88 --> 8+8=16

    thanks for all ur help guys u are really saving my life!
    See more | Go to post
    Last edited by bartonc; Oct 26 '07, 04:55 AM.

    Leave a comment:


  • DDCane
    started a topic getting the sum of digits in a number

    getting the sum of digits in a number

    i made it like this:
    Code:
    def tvarsumman(n):
        if n<10:
            print n
        else:
            tvarsumman((n/10) + n%10)
    but when it comes to 99 it does this

    99--> 9+9=18-->1+8=9

    thats wrong according to my professor.

    can u help fix my function?

    and all the ones u have made so far have been perfect! u are really helping me. thank u sir!...
    See more | Go to post
    Last edited by bartonc; Oct 26 '07, 04:55 AM.

  • DDCane
    started a topic Parsing a log file, etc

    Parsing a log file, etc

    i have to make 3 seperate functions that:

    function1. Counts the lines in a my 'logfile' and returns the answer in idle.

    function2. counts how many times a certain user is in the 'logfile' for instance how many times 'johnny.killed. peter' has been logged in the 'logfile' and returns only the answer

    function3. shows what files the user 'johnny.killed. peter' has looked at and writes the names of the files...
    See more | Go to post
    Last edited by bartonc; Oct 26 '07, 04:59 AM.

  • DDCane
    started a topic Collect and Query votes using a Dictionary

    Collect and Query votes using a Dictionary

    i need to make a dictonary that works like so:

    when u type:

    vote(dict,perso n): it should vote for that person in question by modifying the dictionary and if the person does not exist it creates the person and places a vote for them.

    votes(dict,pers on): it shows how many votes that person in question has and zero if a nmae is tyoed that isnt in the dictionary.

    result(dict): shows who has...
    See more | Go to post

  • DDCane
    started a topic Geometrical mean

    Geometrical mean

    I need to define a function "geomean(number s)" that takes all the numbers in the list, adds then together then takes the sum of the numbers and puts it to the power of 1/how many numbers there are in the list. the resulty should be something like this:

    geomean([1,2,3,4])

    1+2+3+4=10

    10^(1/4)

    do yall get what im trying to say? when i read what i just wrote its hard for ME to follow...
    See more | Go to post

  • DDCane
    replied to list of word from a string
    Thanks u guys this really helped. i ahve some more questions but ill make a new discussion. hop eu read it soon!
    See more | Go to post

    Leave a comment:


  • DDCane
    started a topic list of word from a string

    list of word from a string

    Im a beginner and im tryin to do a couple things.
    #1. i want to def a function "func(ListOWord s)" for exampleand what i want it to do is take a list of words for example (["dod","fre","sd f","ser","ftre" ,"dfr"]) and i want it to split them at the commas and rewrite them printing everyother word first then the remaining words after. that sounds alittle weird but it should...
    See more | Go to post
No activity results to display
Show More
Working...