User Profile

Collapse

Profile Sidebar

Collapse
sharat87
sharat87
Last Activity: Nov 20 '09, 09:14 AM
Joined: Feb 25 '09
Location: BITS-Pilani, India
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • sharat87
    replied to Issues with Illegal characters =/
    in Java
    I was able to spot four problems in your code dear..
    1. its not the generally used subtraction operator you are using. It is something else.. I have no idea what the character is.
    2. the semicolon on line 53... that is what is causing the error 'else withou an if', remove that semicolon and you are good
    3. variable tax has not been initialised.. give it some initial value like -1
    4. convert tax to string before you add...
    See more | Go to post

    Leave a comment:


  • hey,
    could you put the code of the loop you are talking about... and also give some code around the lines 191, 69 and 141

    I'll try to help :)

    regards,
    sharat87
    See more | Go to post

    Leave a comment:


  • sharat87
    replied to How to convert a String to a Dictionary?
    yes, in the example I showed you in my previous post... you just store the d_str string into the database... that's the string you will ever need.

    using dumps(d, protocol=1) will give smaller strings, but will have binary data... i am not sure if those can be written to a databse.. but the code in my above post should work just fine

    Note: i did not test it.. so if u have any more problems, just drop in here :)
    See more | Go to post

    Leave a comment:


  • sharat87
    replied to http post and get the parameter from url
    hello,

    i'm not sure it would work... but try this

    instead of the following two lines in your client.py,
    Code:
    data="Welcome to My Page"
    http.putrequest("POST", "/cgi-bin/server.py?id="+data)
    do this...

    Code:
    import urllib
    data = "Welcome to my page"
    http.putrequest("POST", "/cgi-bin/server.py?id="
    ...
    See more | Go to post

    Leave a comment:


  • sharat87
    replied to How to convert a String to a Dictionary?
    if that's what you want, I suggest you take at look at how you can use the pickling library... you do something like this...

    import pickle as pk
    d={'a':'google' , 'b':80, 'c':'string'}
    d_str = pk.dumps(d)
    # put the string d_str into the database...
    # get the string from the database and do
    d = pk.loads(d_str)
    # and there you have your dictionary back

    i did not test the above code.. but...
    See more | Go to post

    Leave a comment:


  • sharat87
    replied to How to convert a String to a Dictionary?
    saving?

    if you are saving the dictionary for later use (writing the string to a file and later reading it and reconstructing the dictionary...)

    you may want to look at a serialization pattern like the pickling library.

    regards,
    sharat87
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...