Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Java Programming please help!

    dsafsfv
    Last edited by coolcod; 02-15-2013 at 02:19 AM. Reason: added code BB tags

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,910
    Thanks
    56
    Thanked 544 Times in 541 Posts
    Quote Originally Posted by coolcod View Post
    The problems i am having are:
    1. I need to keep track of the maximum and minimum temperature in the weather-short.csv file and compare it with the max or min global variables in the compare method, what is the way to do it?
    2. How should I then link this code in the html file?
    Can I add:

    3. Don't know the difference between java and javascript

    ?

  • #3
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry i didnt get you

  • #4
    Regular Coder low tech's Avatar
    Join Date
    Dec 2009
    Posts
    851
    Thanks
    172
    Thanked 93 Times in 93 Posts
    Hi

    ... trying to make a website that uses a java program ...
    java and javascript are not the same

    you are in the javascript forum

    request a moderator to move this thread to the JAVA forum

    LT
    "The greatest revenge is to accomplish what others say you cannot do."
    ~ Unknown

    I used to be indecisive, but now I'm not so sure.

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    This codes a bit tough to trace since you don't have indentation here.
    The CSV is logically a two dimensional array or a collection of collection. So you could just split the readTextFile entries up into a collection. Problem is I have no idea what is in that collection, so I can't really tell you what to do with it.
    You can write a simple CSV interpreter by simply splitting the string on the delimiter. A good one would need to also determine enclosure characters since a string in a csv file could include the delimiter character as well. If its something like a CSV of numbers, than a simple tokenizer on the delimiter would be sufficient. Collections can then determine min and max very easily using the Collections.min and Collections.max methods.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •