help on pickle tool

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hanumizzle

    #16
    Re: help on pickle tool

    On 6 Oct 2006 01:41:48 -0700, virg <06virg@gmail.c omwrote:
    Hi,
    The data is simple dictionary with one or more keys. If i use YAML at
    the client (webui) do i have to change serialisation method to YAML at
    server also. Without changing serialisation method at server, can i use
    any of the deserialisation methods at the client. We cannot change the
    serialisation methods at the server since it is not under our control.
    Oh, poopy.

    What do you have at the server end?

    -- Theerasak

    Comment

    • Steve Holden

      #17
      Re: help on pickle tool

      Fredrik Lundh wrote:
      MonkeeSage wrote:
      >
      >
      >
      >>YAML is a little more complex
      >
      >
      a little? when did you last look at the spec?
      >
      >
      >>and a little more mature.
      >
      >
      than JavaScript's expression syntax? are you sure you're not confusing
      libraries with standards here? (has anyone even managed to write a YAML
      library that's small and simple enough to be "obviously correct"?)
      I have to agree that YAML, having started out with simplicity in mind,
      has become a monster that threatens to collapse under its own weight.
      The very existence of JSON is a good indicator that YAML has failed to
      meet its design goals for a significant proportion of application
      developers.

      regards
      Steve
      --
      Steve Holden +44 150 684 7255 +1 800 494 3119
      Holden Web LLC/Ltd http://www.holdenweb.com
      Skype: holdenweb http://holdenweb.blogspot.com
      Recent Ramblings http://del.icio.us/steve.holden

      Comment

      • virg

        #18
        Re: help on pickle tool

        At the server, based on client request it does some computations , it
        sends the result as dictionary (serialized) to the client.

        hanumizzle wrote:
        On 6 Oct 2006 01:41:48 -0700, virg <06virg@gmail.c omwrote:
        Hi,
        The data is simple dictionary with one or more keys. If i use YAML at
        the client (webui) do i have to change serialisation method to YAML at
        server also. Without changing serialisation method at server, can i use
        any of the deserialisation methods at the client. We cannot change the
        serialisation methods at the server since it is not under our control.
        >
        Oh, poopy.
        >
        What do you have at the server end?
        >
        -- Theerasak

        Comment

        • hanumizzle

          #19
          Re: help on pickle tool

          On 10/6/06, Steve Holden <steve@holdenwe b.comwrote:
          I have to agree that YAML, having started out with simplicity in mind,
          has become a monster that threatens to collapse under its own weight.
          The very existence of JSON is a good indicator that YAML has failed to
          meet its design goals for a significant proportion of application
          developers.
          I am looking at JSON, but YAML does work fine for my purposes w/ no
          discernable disadvantages. Of course I didn't implement the library,
          so I can't really speak with any kind of expertise on this matter. I'm
          just saying that, at least at the front end, it's pretty simple to
          use. (JMO)

          -- Theerasak

          Comment

          • hanumizzle

            #20
            Re: help on pickle tool

            On 6 Oct 2006 02:03:07 -0700, virg <06virg@gmail.c omwrote:
            At the server, based on client request it does some computations , it
            sends the result as dictionary (serialized) to the client.
            If I interpret your message correctly, you are receiving a Python
            dictionary object from the server. Yes? In this case, I guess it might
            be necessary to use Jython. I'm drawing a blank otherwise.

            (This may be naive, but can you write the client in Python as well?)

            -- Theerasak

            Comment

            • virg

              #21
              Re: help on pickle tool

              Yes your are right. I will send a dictionary object from the server to
              the client.
              I already have client which is written in python. But we are migrating
              the python client which is a command line tool to Web UI client
              (java). If it is possible to call python function from java, i need to
              read more about jython, i am new to this.


              hanumizzle wrote:
              On 6 Oct 2006 02:03:07 -0700, virg <06virg@gmail.c omwrote:
              At the server, based on client request it does some computations , it
              sends the result as dictionary (serialized) to the client.
              >
              If I interpret your message correctly, you are receiving a Python
              dictionary object from the server. Yes? In this case, I guess it might
              be necessary to use Jython. I'm drawing a blank otherwise.
              >
              (This may be naive, but can you write the client in Python as well?)
              >
              -- Theerasak

              Comment

              • hanumizzle

                #22
                Re: help on pickle tool

                On 6 Oct 2006 02:29:59 -0700, virg <06virg@gmail.c omwrote:
                Yes your are right. I will send a dictionary object from the server to
                the client.
                I already have client which is written in python. But we are migrating
                the python client which is a command line tool to Web UI client
                (java).
                Please explain 'Web UI'. Can Python perform an equivalent function?

                -- Theerasak

                Comment

                • virg

                  #23
                  Re: help on pickle tool

                  Hi,

                  Yes, using python client we are able deserialize data using

                  r = pickle.loads(re sult).

                  where result is a response from the server and r is a dictionary after
                  deserialization .
                  For serialisation at the server written in python using
                  pickle.dumps(re sult, 2)

                  Now we are developing web based Client using java. So we are writing
                  client in java. If server and client are in python we dont see any
                  problems since we are using same serialisation tool "pickle". Now we
                  have seen problems because we are writing client in java. we did not
                  find equivalent function on java for this tool pickle. If i use
                  standard java desrialisation functions i am getting error as invalid
                  header becasue of incompatibility between python and java. Please help
                  me if you have any clue

                  regards,
                  - Virg

                  hanumizzle wrote:
                  On 6 Oct 2006 02:29:59 -0700, virg <06virg@gmail.c omwrote:
                  Yes your are right. I will send a dictionary object from the server to
                  the client.
                  I already have client which is written in python. But we are migrating
                  the python client which is a command line tool to Web UI client
                  (java).
                  >
                  Please explain 'Web UI'. Can Python perform an equivalent function?
                  >
                  -- Theerasak

                  Comment

                  • Paddy

                    #24
                    Re: help on pickle tool


                    hanumizzle wrote:
                    On 5 Oct 2006 22:25:58 -0700, Paddy <paddy3118@nets cape.netwrote:
                    >
                    You might try picking the data with a different pickle formatter that
                    your Java can use. Maybe an XML pickler
                    (http://www.gnosis.cx/download/Gnosis...1.2.1.ANNOUNCE
                    untested by me).
                    You might also use a JSON/YAML pickler. JSON is now a subset of YAML:
                    >
                    Why a subset?
                    I was referring to comments ike:




                    Happy coding - Paddy.

                    Comment

                    • Paddy

                      #25
                      Re: help on pickle tool


                      Paddy wrote:
                      hanumizzle wrote:
                      On 5 Oct 2006 22:25:58 -0700, Paddy <paddy3118@nets cape.netwrote:
                      You might try picking the data with a different pickle formatter that
                      your Java can use. Maybe an XML pickler
                      (http://www.gnosis.cx/download/Gnosis...1.2.1.ANNOUNCE
                      untested by me).
                      You might also use a JSON/YAML pickler. JSON is now a subset of YAML:
                      >

                      Why a subset?
                      >
                      I was referring to comments ike:

                      >

                      >
                      Happy coding - Paddy.
                      Oh, and this might also be of use:



                      - Pad.

                      Comment

                      • Kirill Simonov

                        #26
                        Re: help on pickle tool

                        Hi,

                        I'm somewhat late to this discussion, but as the author of PyYAML, I'd
                        like to put my 2c in.


                        On Thu, Oct 05, 2006 at 09:52:56PM -0700, virg wrote:
                        Is it possible to deserialize the data by java which serialized by
                        Python or is there any compatibility issue. Is there any equivalent
                        pickle tool on java which supports this operation. so that i can use
                        across languages.
                        You may serialize/deserialize your data to YAML using PyYAML
                        (http://pyyaml.org/wiki/PyYAML) on the Python side and jvyaml
                        (https://jvyaml.dev.java.net/) on the Java side. You may also check
                        JSON (http://json.org/) as other posters suggested.


                        On Thu, Oct 05, 2006 at 10:54:46PM -0700, MonkeeSage wrote:
                        hanumizzle wrote:
                        Why a subset?
                        >
                        I don't think JSON is a subset of YAML.
                        It is.


                        On Fri, Oct 06, 2006 at 08:36:07AM +0200, Fredrik Lundh wrote:
                        JSON is almost identical to Python's expression syntax, of course,
                        while YAML isn't even close.
                        A valid Python list/dict expression is likely to be a valid YAML
                        expression. For instance

                        { "odd": [1, 3, 5, 7, 9], "even": [2, 4, 6, 8] }

                        is both valid Python and valid YAML.


                        On Fri, Oct 06, 2006 at 08:28:29AM +0200, Fredrik Lundh wrote:
                        than JavaScript's expression syntax? are you sure you're not
                        confusing libraries with standards here? (has anyone even managed to
                        write a YAML library that's small and simple enough to be "obviously
                        correct"?)
                        I've written a complete YAML parser and I must admit it hasn't been
                        extremely difficult. The YAML syntax is very close to Python and I just
                        needed to rewrite YAML grammar using Python as a model. The PyYAML
                        parser is LL(1), which is as simple as it could be.


                        --
                        xi

                        Comment

                        Working...