Announcement

Collapse
No announcement yet.

Multiple field indexes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Multiple field indexes



    Hi,

    Is it possible to create an index of two fields where one field is
    ascending and the other descending?

    First field is character, length 3 and it needs to be ascending.

    Second field is character, length 10 (a date field) and it needs to
    be descending.

    I'd hoped this might work:

    EXPR="{news_db.d.cat $ (0 - news_db.d.cat_date)}"
    FLAGS="ascending">

    but the date field is also ascending.

    Thanks,

    Yvonne
    Yvonne Russell
    CMY Systems Sdn Bhd
    4 Jalan 9/2C, Shah Alam, 40000 Selangor, Malaysia
    Tel: +60 3 5510 7063 Fax: +60 3 5510 4249
    Email: [email protected]
    Web: http://cmysystems.com/



    #2
    Multiple field indexes



    Yeah, it would still be ascending because that's the flag you used for
    the index. It doesn't know or care if you want part of the index to be
    descending.

    The easy way to do this is have two databases. Don't get caught up in
    the trap that you always have to use one database, or that having
    extra databases around is bad- use as many as you need to get the job
    done, especially if an extra one or two make it easier.

    So instead, make one db for your category codes, and one db for your
    dates (and other stuff).

    Have the category sorting index be padl(d.cat,3,'0') (this will force
    the correct sort on category codes that don't contain three
    numbers/characters) and the flags set to: flags="asending,string"

    For the db that stores the date field, the sorting index descending
    using the expression: "padl(d.cat,3,'0') $ d.date" and flags="string"

    On a side note, using d.field_date (and d.field_month, d.field_day,
    d.field_year, etc) is not supported in the compiled version of
    mivascript. You might want to use a 10 character field for
    s.dyn_time_t or a 14 character field for YYYYMMDDHHMMSS.

    Using the two databases side by side to do what you want is simple.

    Open both databases. Find the first category code in the category db,
    then use a MvFIND (non exact) to find the first record in your dates
    database that starts with the category code you're looking for.

    If your first category code is "abc", by searching through the dates
    db and NOT not using the EXACT flag, the first indexed record that
    starts with "abc" (as per the index expression above) will come up
    regardless of the date stuff after it.

    Once that first record comes up, then you can MvSKIP through your
    database until d.cat doesn't equal the category code you want to
    display.

    You can also slip in some filtering and date ranges to tighten up the
    search/display, of course.

    Let me know if this doesn't make any sense, my brain hasn't quite
    started this morning.

    Regards,

    Scot Ranney
    <A HREF ="http://www.scotsscripts.com">http://www.scotsscripts.com</A>


    ===============================
    Original Message:
    ===============================
    Saturday, March 13, 2004, 3:32:19 AM, you wrote:

    Hi,

    Is it possible to create an index of two fields where one field is
    ascending and the other descending?

    First field is character, length 3 and it needs to be ascending.

    Second field is character, length 10 (a date field) and it needs to
    be descending.

    I'd hoped this might work:

    EXPR="{news_db.d.cat $ (0 - news_db.d.cat_date)}"
    FLAGS="ascending">

    but the date field is also ascending.

    Thanks,

    Yvonne
    Yvonne Russell
    CMY Systems Sdn Bhd
    4 Jalan 9/2C, Shah Alam, 40000 Selangor, Malaysia
    Tel: +60 3 5510 7063 Fax: +60 3 5510 4249
    Email: [email protected]
    Web: http://cmysystems.com/


    Comment


      #3
      Multiple field indexes



      Yeah, it would still be ascending because that's the flag you used for
      the index. It doesn't know or care if you want part of the index to be
      descending.

      The easy way to do this is have two databases. Don't get caught up in
      the trap that you always have to use one database, or that having
      extra databases around is bad- use as many as you need to get the job
      done, especially if an extra one or two make it easier.

      So instead, make one db for your category codes, and one db for your
      dates (and other stuff).

      Have the category sorting index be padl(d.cat,3,'0') (this will force
      the correct sort on category codes that don't contain three
      numbers/characters) and the flags set to: flags="asending,string"

      For the db that stores the date field, the sorting index descending
      using the expression: "padl(d.cat,3,'0') $ d.date" and flags="string"

      On a side note, using d.field_date (and d.field_month, d.field_day,
      d.field_year, etc) is not supported in the compiled version of
      mivascript. You might want to use a 10 character field for
      s.dyn_time_t or a 14 character field for YYYYMMDDHHMMSS.

      Using the two databases side by side to do what you want is simple.

      Open both databases. Find the first category code in the category db,
      then use a MvFIND (non exact) to find the first record in your dates
      database that starts with the category code you're looking for.

      If your first category code is "abc", by searching through the dates
      db and NOT not using the EXACT flag, the first indexed record that
      starts with "abc" (as per the index expression above) will come up
      regardless of the date stuff after it.

      Once that first record comes up, then you can MvSKIP through your
      database until d.cat doesn't equal the category code you want to
      display.

      You can also slip in some filtering and date ranges to tighten up the
      search/display, of course.

      Let me know if this doesn't make any sense, my brain hasn't quite
      started this morning.

      Regards,

      Scot Ranney
      <A HREF ="http://www.scotsscripts.com">http://www.scotsscripts.com</A>

      ===============================
      Original Message:
      ===============================
      Saturday, March 13, 2004, 3:32:19 AM, you wrote:

      Hi,

      Is it possible to create an index of two fields where one field is
      ascending and the other descending?

      First field is character, length 3 and it needs to be ascending.

      Second field is character, length 10 (a date field) and it needs to
      be descending.

      I'd hoped this might work:

      EXPR="{news_db.d.cat $ (0 - news_db.d.cat_date)}"
      FLAGS="ascending">

      but the date field is also ascending.

      Thanks,

      Yvonne
      Yvonne Russell
      CMY Systems Sdn Bhd
      4 Jalan 9/2C, Shah Alam, 40000 Selangor, Malaysia
      Tel: +60 3 5510 7063 Fax: +60 3 5510 4249
      Email: [email protected]
      Web: http://cmysystems.com/


      Comment


        #4
        Multiple field indexes



        Hi Yvonne,

        You have the right idea...

        Store your date (news_db.d.cat_date) as a string field in the format
        YYYYMMDD -- concatenate HHMMSS if you need it. Then you can do this:

        EXPR="{news_db.d.cat $ (99999999 - news_db.d.cat_date)}"
        FLAGS="ascending" (if not using time) or
        EXPR="{news_db.d.cat $ (99999999999999 - news_db.d.cat_date)}"
        FLAGS="ascending" (if using time)

        That should work for you.

        HTH,

        Bob




        > -----Original Message-----
        > From: Yvonne Russell [mailto:[email protected]]
        > Sent: Saturday, March 13, 2004 6:32 AM
        > To: [email protected]
        > Subject: [meu] Multiple field indexes
        >
        >
        > Hi,
        >
        > Is it possible to create an index of two fields where one field is
        > ascending and the other descending?
        >
        > First field is character, length 3 and it needs to be ascending.
        >
        > Second field is character, length 10 (a date field) and it needs to
        > be descending.
        >
        > I'd hoped this might work:
        >
        > EXPR="{news_db.d.cat $ (0 - news_db.d.cat_date)}"
        > FLAGS="ascending">
        >
        > but the date field is also ascending.
        >
        > Thanks,
        >
        > Yvonne
        > Yvonne Russell
        > CMY Systems Sdn Bhd
        > 4 Jalan 9/2C, Shah Alam, 40000 Selangor, Malaysia
        > Tel: +60 3 5510 7063 Fax: +60 3 5510 4249
        > Email: [email protected]
        > Web: http://cmysystems.com/
        >
        >

        Comment


          #5
          Multiple field indexes



          On Sat, 13 Mar 2004 12:22:57 -0500, Robert J Miller Jr
          <[email protected]> gave utterance to the following:

          > Hi Yvonne,
          >
          > You have the right idea...
          >
          > Store your date (news_db.d.cat_date) as a string field in the format
          > YYYYMMDD -- concatenate HHMMSS if you need it. Then you can do this:
          >
          > EXPR="{news_db.d.cat $ (99999999 - news_db.d.cat_date)}"
          > FLAGS="ascending" (if not using time) or
          > EXPR="{news_db.d.cat $ (99999999999999 - news_db.d.cat_date)}"
          > FLAGS="ascending" (if using time)
          >
          The same will also work with time_t values, which is what I was going to
          suggest.
          --
          Richard Grevers
          Between two evils always pick the one you haven't tried


          Comment


            #6
            Multiple field indexes



            I believe you're on the right track. Try this:

            EXPR=3D"{ padl(news_db.d.cat,3,0) $ ':' $ padl((10000000000 -
            news_db.d.cat_date),11,0) }" FLAGS=3D"ascending">

            I hope that helps.

            - Jeff Huber
            President 4TheBest eCommerce Solutions
            http://4TheBest.com
            [email protected]
            Office: 760-742-1469
            Cell: 760-445-8454
            =20


            -----Original Message-----
            From: [email protected] [mailto:[email protected]] On =
            Behalf
            Of Yvonne Russell
            Sent: Saturday, March 13, 2004 3:32 AM
            To: [email protected]
            Subject: [meu] Multiple field indexes


            Hi,

            Is it possible to create an index of two fields where one field is=20
            ascending and the other descending?

            First field is character, length 3 and it needs to be ascending.

            Second field is character, length 10 (a date field) and it needs to=20
            be descending.

            I'd hoped this might work:

            EXPR=3D"{news_db.d.cat $ (0 - news_db.d.cat_date)}"
            FLAGS=3D"ascending">

            but the date field is also ascending.

            Thanks,

            Yvonne
            Yvonne Russell
            CMY Systems Sdn Bhd
            4 Jalan 9/2C, Shah Alam, 40000 Selangor, Malaysia
            Tel: +60 3 5510 7063 Fax: +60 3 5510 4249
            Email: [email protected]
            Web: http://cmysystems.com/


            Comment


              #7
              MAD Ring- helps you sell more scripts/modules



              Hi Folks,

              Anyone tired of paying commissions to sell their stuff? There's
              another way to do it.

              The MAD Ring (Mivascript Application Developers Ring) is a system that
              lets people search a global database of scripts and modules, but come
              to your website to purchase them using your own store (or the MAD Ring
              build in ecommerce system).

              If you have good products, you can only benefit from the system, and
              it can be used along any other system you have for selling scripts and
              modules.

              Addons available include a shopping cart (uses PayPal instant payment
              notification), license manager, and a stand-alone addon. Product
              groups and such are planned for the near future.

              This system can be used in conjunction with your own stores because
              each product can be linked directly to another location so that when a
              customer clicks on it they go to your store, your friend's store, or
              even Module Walmart.

              Download it at: <A HREF ="http://www.scotsscripts.com/mr/madring.mvc">http://www.scotsscripts.com/mr/madring.mvc</A>

              I'll be happy to answer any questions about getting it set up on your
              site, addons, or the weather in the San Juans this time of year.

              Most people I've talked to have asked, "Why?"

              Why did I make it? So I could sell my own stuff while creating a neat
              system for everyone who wants to use it. Plus the addons are not quite
              as free as the main MAD Ring system.

              Regards,

              Scot Ranney
              <A HREF ="http://www.scotsscripts.com">http://www.scotsscripts.com</A>




              Comment


                #8
                MAD Ring- helps you sell more scripts/modules



                Glad to see this is finally out...we'll try to get this setup on our site soon.!

                -Bruce
                PHOSPHOR Media
                www.phosphormedia.com

                > -----Original Message-----
                > From: [email protected] [mailto:[email protected]]On
                > Behalf Of Scot Ranney
                > Sent: Tuesday, March 16, 2004 7:03 PM
                > To: [email protected]; [email protected]
                > Subject: [meu] MAD Ring- helps you sell more scripts/modules
                >
                >
                > Hi Folks,
                >
                > Anyone tired of paying commissions to sell their stuff? There's
                > another way to do it.
                >
                > The MAD Ring (Mivascript Application Developers Ring) is a system that
                > lets people search a global database of scripts and modules, but come
                > to your website to purchase them using your own store (or the MAD Ring
                > build in ecommerce system).
                >
                > If you have good products, you can only benefit from the system, and
                > it can be used along any other system you have for selling scripts and
                > modules.
                >
                > Addons available include a shopping cart (uses PayPal instant payment
                > notification), license manager, and a stand-alone addon. Product
                > groups and such are planned for the near future.
                >
                > This system can be used in conjunction with your own stores because
                > each product can be linked directly to another location so that when a
                > customer clicks on it they go to your store, your friend's store, or
                > even Module Walmart.
                >
                > Download it at: <A HREF ="http://www.scotsscripts.com/mr/madring.mvc">http://www.scotsscripts.com/mr/madring.mvc</A>
                >
                > I'll be happy to answer any questions about getting it set up on your
                > site, addons, or the weather in the San Juans this time of year.
                >
                > Most people I've talked to have asked, "Why?"
                >
                > Why did I make it? So I could sell my own stuff while creating a neat
                > system for everyone who wants to use it. Plus the addons are not quite
                > as free as the main MAD Ring system.
                >
                > Regards,
                >
                > Scot Ranney
                > <A HREF ="http://www.scotsscripts.com">http://www.scotsscripts.com</A>
                >
                >
                >
                >

                Comment


                  #9
                  encode base64



                  Hi all,

                  I'm trying to encode some images in my automated e-mails (due to the new
                  SP2 I cannot use web hosted images in my multimedia e-mails anymore) and I
                  want to make this happen with the new miva crypto_base64_encode function.
                  The only problem I have is that I don't have the correct result. I'm
                  importing the image and encoding it to insert it in my multipart e-mail
                  body. All is fine less the encoded result. I have encoded the same image
                  with another software and I noticed that the begining of the encrypted
                  result is ok.. but after a few characters my miva result change..

                  Miva encoded image result :
                  /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQg=DBQ=DAsLDBkSEw8UHRofHh0a
                  HBw=GDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyMjIyMjIyMjIy
                  Mv/AABEIAF8AXQMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQI .. etc .. etc

                  VB software encoded image result :
                  /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a
                  HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy
                  MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjL/wA .. etc .. etc

                  The VB result is working well with Outlook and other e-mail clients, but..
                  the miva one is not working at all (I have a broken image in the e-mail
                  body)

                  Does anybody is aware of some encoding problems with the
                  crypto_base64_encode(data) function?

                  PS: I already looked on the Ivo website encoding solution but I need a 100%
                  mivascript solution ( if there is one .. :s )

                  Thanks everybody
                  Claudiu


                  Comment


                    #10
                    encode base64



                    ------=_NextPart_000_0000_01C4B075.BF396B50
                    Content-Type: text/plain;
                    charset="Windows-1252"
                    Content-Transfer-Encoding: quoted-printable

                    Hi,
                    I was under the impression that crypto_base64_encode function only =
                    worked on
                    strings-not files. How exactly do you use the function? -
                    crypto_base64_encode(l.image_url)???

                    Bill M.

                    -----Original Message-----
                    From: [email protected] [mailto:[email protected]] On =
                    Behalf
                    Of Claudiu Bischoff
                    Sent: Tuesday, October 12, 2004 9:47 AM
                    To: [email protected]
                    Subject: [meu] encode base64


                    Hi all,

                    I'm trying to encode some images in my automated e-mails (due to the =
                    new
                    SP2 I cannot use web hosted images in my multimedia e-mails anymore) and =
                    I
                    want to make this happen with the new miva crypto_base64_encode =
                    function.
                    The only problem I have is that I don't have the correct result. I'm
                    importing the image and encoding it to insert it in my multipart e-mail
                    body. All is fine less the encoded result. I have encoded the same image
                    with another software and I noticed that the begining of the encrypted
                    result is ok.. but after a few characters my miva result change..

                    Miva encoded image result :
                    /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQg=3DDBQ=3DDAsLDBkSEw8UH=
                    RofHh0a
                    HBw=3DGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy MjIyMjIyMjIyMjIyMjIyMjI=
                    yMjIy
                    Mv/AABEIAF8AXQMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQI .. etc .. =
                    etc

                    VB software encoded image result :
                    /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofH=
                    h0a
                    HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyM=
                    jIy
                    MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjL/wA .. etc .. =
                    etc

                    The VB result is working well with Outlook and other e-mail clients, =
                    but..
                    the miva one is not working at all (I have a broken image in the e-mail
                    body)

                    Does anybody is aware of some encoding problems with the
                    crypto_base64_encode(data) function?

                    PS: I already looked on the Ivo website encoding solution but I need a =
                    100%
                    mivascript solution ( if there is one .. :s )

                    Thanks everybody
                    Claudiu


                    Comment


                      #11
                      encode base64



                      You can't encode them with Miva script unless you have the binary
                      data in the variable, and you can't get the binary data into the
                      variable by using an import because the import makes assumptions
                      about the data and strips out characters or modifies them based
                      on those assumptions.

                      When we need to do this sort of things, we store the already
                      encoded version of the image as base64 in a file, or in a
                      database memo field and then we use the
                      crypto_base64_decode(data) in combination with the header control
                      functions to stream out the image.

                      So, while you can get the encode binary data to stream out of
                      Miva scripts as binary data, thus delivering a binary image, PDF,
                      etc. You can't use native Miva script to encode the file
                      contents.

                      Sorry.

                      - Jeff Huber
                      President 4TheBest eCommerce Solutions
                      http://4TheBest.com
                      [email protected]
                      Office: 760-742-1469
                      Cell: 760-445-8454
                      =20


                      -----Original Message-----
                      From: [email protected]
                      [mailto:[email protected]] On Behalf Of Claudiu Bischoff
                      Sent: Tuesday, October 12, 2004 7:47 AM
                      To: [email protected]
                      Subject: [meu] encode base64


                      Hi all,

                      I'm trying to encode some images in my automated e-mails (due to
                      the new
                      SP2 I cannot use web hosted images in my multimedia e-mails
                      anymore) and I
                      want to make this happen with the new miva crypto_base64_encode
                      function.
                      The only problem I have is that I don't have the correct result.
                      I'm
                      importing the image and encoding it to insert it in my multipart
                      e-mail
                      body. All is fine less the encoded result. I have encoded the
                      same image
                      with another software and I noticed that the begining of the
                      encrypted
                      result is ok.. but after a few characters my miva result change..

                      Miva encoded image result :
                      /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQg=3DDBQ=3DDAsLDBkSE
                      w8UHRofHh0a
                      HBw=3DGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy MjIyMjIyMjIyMjIyM
                      jIyMjIyMjIy
                      Mv/AABEIAF8AXQMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQI ..
                      etc .. etc

                      VB software encoded image result :
                      /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSE
                      w8UHRofHh0a
                      HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyI
                      RwhMjIyMjIy
                      MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjL/wA ..
                      etc .. etc

                      The VB result is working well with Outlook and other e-mail
                      clients, but..
                      the miva one is not working at all (I have a broken image in the
                      e-mail
                      body)

                      Does anybody is aware of some encoding problems with the
                      crypto_base64_encode(data) function?

                      PS: I already looked on the Ivo website encoding solution but I
                      need a 100%
                      mivascript solution ( if there is one .. :s )

                      Thanks everybody
                      Claudiu


                      Comment


                        #12
                        encode base64



                        Ahh, but if you can get the file into a string then you can use
                        it :)

                        We actually got very close to an algorithm that would let us
                        GUESS at the file contents enough that we could suck up files
                        using MvIMPORT and the encode them and manipulate them.

                        In fact we have successfully done it with a number of files but
                        it is not stable because if the guesses are wrong then everything
                        falls apart badly.

                        The problem of course is rooted in the fact that MvIMPORT is
                        specifically intended to import text files that are considered
                        one record per line, and a line is determined by the existence of
                        a LF, CR, or CRLF, which means that Miva eats some of the binary
                        data and you can't be sure which it eats.

                        I am holding out hope that we will get a way to read files in a
                        more raw manner into variables sometime after 5.o of Empresa is
                        released, and if we don't then we will be building and releasing
                        a file system function library for Miva Empresa VM because we
                        have some things planned for early next year that we HAVE to have
                        that functionality for and I have reasons why I want it all done
                        as Miva script rather than using PHP, Perl, C, etc.

                        - Jeff Huber
                        President 4TheBest eCommerce Solutions
                        http://4TheBest.com
                        [email protected]
                        Office: 760-742-1469
                        Cell: 760-445-8454
                        =20


                        -----Original Message-----
                        From: [email protected]
                        [mailto:[email protected]] On Behalf Of
                        [email protected]
                        Sent: Tuesday, October 12, 2004 2:09 PM
                        To: 'Claudiu Bischoff'; Miva Users List
                        Subject: RE: [meu] encode base64


                        Hi,
                        I was under the impression that crypto_base64_encode function
                        only worked on
                        strings-not files. How exactly do you use the function? -
                        crypto_base64_encode(l.image_url)???

                        Bill M.

                        -----Original Message-----
                        From: [email protected]
                        [mailto:[email protected]] On Behalf
                        Of Claudiu Bischoff
                        Sent: Tuesday, October 12, 2004 9:47 AM
                        To: [email protected]
                        Subject: [meu] encode base64


                        Hi all,

                        I'm trying to encode some images in my automated e-mails (due to
                        the new
                        SP2 I cannot use web hosted images in my multimedia e-mails
                        anymore) and I
                        want to make this happen with the new miva crypto_base64_encode
                        function.
                        The only problem I have is that I don't have the correct result.
                        I'm
                        importing the image and encoding it to insert it in my multipart
                        e-mail
                        body. All is fine less the encoded result. I have encoded the
                        same image
                        with another software and I noticed that the begining of the
                        encrypted
                        result is ok.. but after a few characters my miva result change..

                        Miva encoded image result :
                        /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQg=3DDBQ=3DDAsLDBkSE
                        w8UHRofHh0a
                        HBw=3DGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy MjIyMjIyMjIyMjIyM
                        jIyMjIyMjIy
                        Mv/AABEIAF8AXQMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQI ..
                        etc .. etc

                        VB software encoded image result :
                        /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSE
                        w8UHRofHh0a
                        HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyI
                        RwhMjIyMjIy
                        MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjL/wA ..
                        etc .. etc

                        The VB result is working well with Outlook and other e-mail
                        clients, but..
                        the miva one is not working at all (I have a broken image in the
                        e-mail
                        body)

                        Does anybody is aware of some encoding problems with the
                        crypto_base64_encode(data) function?

                        PS: I already looked on the Ivo website encoding solution but I
                        need a 100%
                        mivascript solution ( if there is one .. :s )

                        Thanks everybody
                        Claudiu


                        Comment


                          #13
                          encode base64



                          Yes, it _is_ possible to achieve it in plain Miva Script. Unfortunately, I
                          cannot disclose the exact way, because one of my commercial products is
                          based on the trick (MmATTACH) and disclosing it would endanger its market
                          position. The trick is not quite simple; it uses secondary effects of
                          unexpected functions, but it works fine.

                          In case of need I could provide a compiled library containing the function,
                          though. Better told, I could disclose the way how to call the function from
                          the MmATTACH module (after adjusting it little bit), when installed on the
                          system.

                          Just please note that the encoding is not very fast and not well suitable
                          for files bigger than few hundreds of kilobytes. Whenever possible, using an
                          external encoder like MimeConv 2 freely available on my website is a much
                          faster solution.

                          Ivo
                          http://mivo.truxoft.com




                          -----Original Message-----
                          From: Jeff Huber - Listmail


                          Ahh, but if you can get the file into a string then you can use
                          it :)

                          We actually got very close to an algorithm that would let us
                          GUESS at the file contents enough that we could suck up files
                          using MvIMPORT and the encode them and manipulate them.

                          In fact we have successfully done it with a number of files but
                          it is not stable because if the guesses are wrong then everything
                          falls apart badly.

                          The problem of course is rooted in the fact that MvIMPORT is
                          specifically intended to import text files that are considered
                          one record per line, and a line is determined by the existence of
                          a LF, CR, or CRLF, which means that Miva eats some of the binary
                          data and you can't be sure which it eats.

                          I am holding out hope that we will get a way to read files in a
                          more raw manner into variables sometime after 5.o of Empresa is
                          released, and if we don't then we will be building and releasing
                          a file system function library for Miva Empresa VM because we
                          have some things planned for early next year that we HAVE to have
                          that functionality for and I have reasons why I want it all done
                          as Miva script rather than using PHP, Perl, C, etc.

                          - Jeff Huber
                          President 4TheBest eCommerce Solutions
                          http://4TheBest.com
                          [email protected]
                          Office: 760-742-1469
                          Cell: 760-445-8454



                          -----Original Message-----
                          From: [email protected]
                          [mailto:[email protected]] On Behalf Of
                          [email protected]
                          Sent: Tuesday, October 12, 2004 2:09 PM
                          To: 'Claudiu Bischoff'; Miva Users List
                          Subject: RE: [meu] encode base64


                          Hi,
                          I was under the impression that crypto_base64_encode function
                          only worked on
                          strings-not files. How exactly do you use the function? -
                          crypto_base64_encode(l.image_url)???

                          Bill M.

                          -----Original Message-----
                          From: [email protected]
                          [mailto:[email protected]] On Behalf
                          Of Claudiu Bischoff
                          Sent: Tuesday, October 12, 2004 9:47 AM
                          To: [email protected]
                          Subject: [meu] encode base64


                          Hi all,

                          I'm trying to encode some images in my automated e-mails (due to
                          the new
                          SP2 I cannot use web hosted images in my multimedia e-mails
                          anymore) and I
                          want to make this happen with the new miva crypto_base64_encode
                          function.
                          The only problem I have is that I don't have the correct result.
                          I'm
                          importing the image and encoding it to insert it in my multipart
                          e-mail
                          body. All is fine less the encoded result. I have encoded the
                          same image
                          with another software and I noticed that the begining of the
                          encrypted
                          result is ok.. but after a few characters my miva result change..

                          Miva encoded image result :
                          /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQg=DBQ=DAsLDBkSE
                          w8UHRofHh0a
                          HBw=GDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyM
                          jIyMjIyMjIy
                          Mv/AABEIAF8AXQMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQI ..
                          etc .. etc

                          VB software encoded image result :
                          /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSE
                          w8UHRofHh0a
                          HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyI
                          RwhMjIyMjIy
                          MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjL/wA ..
                          etc .. etc

                          The VB result is working well with Outlook and other e-mail
                          clients, but..
                          the miva one is not working at all (I have a broken image in the
                          e-mail
                          body)

                          Does anybody is aware of some encoding problems with the
                          crypto_base64_encode(data) function?

                          PS: I already looked on the Ivo website encoding solution but I
                          need a 100%
                          mivascript solution ( if there is one .. :s )

                          Thanks everybody
                          Claudiu


                          Comment


                            #14
                            encode base64



                            Ivo,

                            Since I, or any other developer that has released one or more
                            Miva Merchant modules could reasonably be considered your
                            "competitor", and since most of the people in that group, or I
                            assume most of them, could already easily release a Miva Merchant
                            software solution that attached files to email very easily and
                            thus compete with MmATTACH if we wanted to, I think it is a bad
                            excuse not to share the coding technique on this list.

                            This list has always been a place where people with a shared
                            interest for or in some cases a love of the Miva script language
                            can share experiences and work together to improve the ability of
                            all of use using the language.

                            There are a significant number of people that make a lot of money
                            selling Miva Merchant modules that learned a lot about how to
                            program from Myself and the other "core" members of this list and
                            they are our "competitors" now in one sense or another. I always
                            considered you one of the "core" members because I never saw you
                            hold back information based on some stupid market advantage
                            excuse, and because I thought that you, like many others, had a
                            fondness for the language that often goes beyond it's commercial
                            worth.

                            If you aren't going to share a technique of using the language
                            then it seems to me that maybe you are no longer really "One of
                            us". Maybe you have succumbed to the "dark side" and become "one
                            of them", whoever "them" is.

                            Many people who use Miva script only have Miva script as a
                            scripting option, they can't use other means, and for them, who
                            are not your "competitors" and who are the people who used to be
                            the only type of people on this list, knowing that technique
                            might be very nice.

                            The fact that you don't want to share it with the community
                            because of some supposed, and I believe non existent, market
                            advantage. makes me think less of you than I used to.

                            Especially when I combine this current event with the reaction
                            you had when Darren Ehlers posted his assembler file technique to
                            allow dynamic function calls and you quickly jumped in and said
                            that was an old obvious technique you had been using for a long
                            time with the Vladdy engine, and yet you had never seen fit to
                            publish the technique on this list. I guess that was another
                            market advantage that you didn't want to give up, and yet you
                            sure wanted to jump in and claim credit for the technique after
                            the fact.

                            I wonder if there are more of you than I realize and maybe that
                            is why we (Meaning Jeff Collins, myself, and a few others) found
                            it so hard to get support for the Miva script Open source
                            project.

                            When people have asked questions about things I have never
                            hesitated to answer and even provide source code, just because
                            what we were doing was a technique used in a Miva Merchant
                            module.

                            I am saddened by your attitude Ivo, adn even though it may not
                            mean anythign to you I am also dissapointed in you.

                            I hope you will see the error of your ways and "come back into
                            the light".

                            I shouldn't send this to the list because I am not in a calm and
                            rational frame of mind, but I usually avoid posting when I am
                            annoyed and upset for fear that I will say something I will
                            regret later.

                            In this case I don't care.

                            - Jeff Huber
                            President 4TheBest eCommerce Solutions
                            http://4TheBest.com
                            [email protected]
                            Office: 760-742-1469
                            Cell: 760-445-8454
                            =20




                            -----Original Message-----
                            From: [email protected]
                            [mailto:[email protected]] On Behalf Of Ivo Truxa
                            Sent: Tuesday, October 12, 2004 4:04 PM
                            To: 'Miva Users List'
                            Subject: RE: [meu] encode base64


                            Yes, it _is_ possible to achieve it in plain Miva Script.
                            Unfortunately, I
                            cannot disclose the exact way, because one of my commercial
                            products is
                            based on the trick (MmATTACH) and disclosing it would endanger
                            its market
                            position. The trick is not quite simple; it uses secondary
                            effects of
                            unexpected functions, but it works fine.=20

                            In case of need I could provide a compiled library containing the
                            function,
                            though. Better told, I could disclose the way how to call the
                            function from
                            the MmATTACH module (after adjusting it little bit), when
                            installed on the
                            system.

                            Just please note that the encoding is not very fast and not well
                            suitable
                            for files bigger than few hundreds of kilobytes. Whenever
                            possible, using an
                            external encoder like MimeConv 2 freely available on my website
                            is a much
                            faster solution.

                            Ivo
                            http://mivo.truxoft.com=20




                            -----Original Message-----
                            From: Jeff Huber - Listmail


                            Ahh, but if you can get the file into a string then you can use
                            it :)

                            We actually got very close to an algorithm that would let us
                            GUESS at the file contents enough that we could suck up files
                            using MvIMPORT and the encode them and manipulate them.

                            In fact we have successfully done it with a number of files but
                            it is not stable because if the guesses are wrong then everything
                            falls apart badly.

                            The problem of course is rooted in the fact that MvIMPORT is
                            specifically intended to import text files that are considered
                            one record per line, and a line is determined by the existence of
                            a LF, CR, or CRLF, which means that Miva eats some of the binary
                            data and you can't be sure which it eats.

                            I am holding out hope that we will get a way to read files in a
                            more raw manner into variables sometime after 5.o of Empresa is
                            released, and if we don't then we will be building and releasing
                            a file system function library for Miva Empresa VM because we
                            have some things planned for early next year that we HAVE to have
                            that functionality for and I have reasons why I want it all done
                            as Miva script rather than using PHP, Perl, C, etc.

                            - Jeff Huber
                            President 4TheBest eCommerce Solutions
                            http://4TheBest.com
                            [email protected]
                            Office: 760-742-1469
                            Cell: 760-445-8454
                            =20


                            -----Original Message-----
                            From: [email protected]
                            [mailto:[email protected]] On Behalf Of
                            [email protected]
                            Sent: Tuesday, October 12, 2004 2:09 PM
                            To: 'Claudiu Bischoff'; Miva Users List
                            Subject: RE: [meu] encode base64


                            Hi,
                            I was under the impression that crypto_base64_encode function
                            only worked on
                            strings-not files. How exactly do you use the function? -
                            crypto_base64_encode(l.image_url)???

                            Bill M.

                            -----Original Message-----
                            From: [email protected]
                            [mailto:[email protected]] On Behalf
                            Of Claudiu Bischoff
                            Sent: Tuesday, October 12, 2004 9:47 AM
                            To: [email protected]
                            Subject: [meu] encode base64


                            Hi all,

                            I'm trying to encode some images in my automated e-mails (due to
                            the new
                            SP2 I cannot use web hosted images in my multimedia e-mails
                            anymore) and I
                            want to make this happen with the new miva crypto_base64_encode
                            function.
                            The only problem I have is that I don't have the correct result.
                            I'm
                            importing the image and encoding it to insert it in my multipart
                            e-mail
                            body. All is fine less the encoded result. I have encoded the
                            same image
                            with another software and I noticed that the begining of the
                            encrypted
                            result is ok.. but after a few characters my miva result change..

                            Miva encoded image result :
                            /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQg=3DDBQ=3DDAsLDBkSE
                            w8UHRofHh0a
                            HBw=3DGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy MjIyMjIyMjIyMjIyM
                            jIyMjIyMjIy
                            Mv/AABEIAF8AXQMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQI ..
                            etc .. etc

                            VB software encoded image result :
                            /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSE
                            w8UHRofHh0a
                            HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyI
                            RwhMjIyMjIy
                            MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjL/wA ..
                            etc .. etc

                            The VB result is working well with Outlook and other e-mail
                            clients, but..
                            the miva one is not working at all (I have a broken image in the
                            e-mail
                            body)

                            Does anybody is aware of some encoding problems with the
                            crypto_base64_encode(data) function?

                            PS: I already looked on the Ivo website encoding solution but I
                            need a 100%
                            mivascript solution ( if there is one .. :s )

                            Thanks everybody
                            Claudiu


                            Comment


                              #15
                              encode base64



                              Jeff,

                              I think you raise some valid points, but I do understand Ivo's position
                              perfectly well. What is however more important than to question the
                              importance of the marketposition of a certain functionality is the fact that
                              you leave out that Ivo actually provides more truly unique sources than
                              anybody else on this list, including a mime converter, source code to some
                              of his products and a hell lot of other resources than makes his website the
                              most important resource of information about Mivascript out there.
                              Unfortunately, there are very few Mivascript (non-merchant) related
                              resources left: On Adam's site (Mvdevelopment?) are about 30 snippets, and
                              then there is Copernicus-James with his MySQL library, Scot's scripts and
                              Greg, I believe.

                              Ivo is certainly not to blame for the lack of interesting and new resources,
                              "the others", meaning us, are, because we are too busy doing our own stuff.
                              It is a sad fact that MvOPENSOURCE never saw the light of the day. Maybe it
                              could have changed something about it.

                              On the other hand, in spite of the apparent "niceness" of the
                              Merchant-module business, it seems to get tougher, too, with new companies
                              making their way in. I am happy to see new faces, but of course someone like
                              Ivo who offers truly unique functionality at a very decent price (and still
                              ocassionally gets yelled at!) must protect his inventions and clever
                              algorithms.


                              Markus





                              -----Original Message-----
                              From: [email protected] [mailto:[email protected]] On Behalf
                              Of Jeff Huber - Listmail
                              Sent: Wednesday, October 13, 2004 2:23 AM
                              To: 'Ivo Truxa'; 'Miva Users List'
                              Subject: RE: [meu] encode base64

                              Ivo,

                              Since I, or any other developer that has released one or more Miva Merchant
                              modules could reasonably be considered your "competitor", and since most of
                              the people in that group, or I assume most of them, could already easily
                              release a Miva Merchant software solution that attached files to email very
                              easily and thus compete with MmATTACH if we wanted to, I think it is a bad
                              excuse not to share the coding technique on this list.

                              This list has always been a place where people with a shared interest for or
                              in some cases a love of the Miva script language can share experiences and
                              work together to improve the ability of all of use using the language.

                              There are a significant number of people that make a lot of money selling
                              Miva Merchant modules that learned a lot about how to program from Myself
                              and the other "core" members of this list and they are our "competitors" now
                              in one sense or another. I always considered you one of the "core" members
                              because I never saw you hold back information based on some stupid market
                              advantage excuse, and because I thought that you, like many others, had a
                              fondness for the language that often goes beyond it's commercial worth.

                              If you aren't going to share a technique of using the language then it seems
                              to me that maybe you are no longer really "One of us". Maybe you have
                              succumbed to the "dark side" and become "one of them", whoever "them" is.

                              Many people who use Miva script only have Miva script as a scripting option,
                              they can't use other means, and for them, who are not your "competitors" and
                              who are the people who used to be the only type of people on this list,
                              knowing that technique might be very nice.

                              The fact that you don't want to share it with the community because of some
                              supposed, and I believe non existent, market advantage. makes me think less
                              of you than I used to.

                              Especially when I combine this current event with the reaction you had when
                              Darren Ehlers posted his assembler file technique to allow dynamic function
                              calls and you quickly jumped in and said that was an old obvious technique
                              you had been using for a long time with the Vladdy engine, and yet you had
                              never seen fit to publish the technique on this list. I guess that was
                              another market advantage that you didn't want to give up, and yet you sure
                              wanted to jump in and claim credit for the technique after the fact.

                              I wonder if there are more of you than I realize and maybe that is why we
                              (Meaning Jeff Collins, myself, and a few others) found it so hard to get
                              support for the Miva script Open source project.

                              When people have asked questions about things I have never hesitated to
                              answer and even provide source code, just because what we were doing was a
                              technique used in a Miva Merchant module.

                              I am saddened by your attitude Ivo, adn even though it may not mean anythign
                              to you I am also dissapointed in you.

                              I hope you will see the error of your ways and "come back into the light".

                              I shouldn't send this to the list because I am not in a calm and rational
                              frame of mind, but I usually avoid posting when I am annoyed and upset for
                              fear that I will say something I will regret later.

                              In this case I don't care.

                              - Jeff Huber
                              President 4TheBest eCommerce Solutions
                              http://4TheBest.com
                              [email protected]
                              Office: 760-742-1469
                              Cell: 760-445-8454





                              -----Original Message-----
                              From: [email protected]
                              [mailto:[email protected]] On Behalf Of Ivo Truxa
                              Sent: Tuesday, October 12, 2004 4:04 PM
                              To: 'Miva Users List'
                              Subject: RE: [meu] encode base64


                              Yes, it _is_ possible to achieve it in plain Miva Script.
                              Unfortunately, I
                              cannot disclose the exact way, because one of my commercial products is
                              based on the trick (MmATTACH) and disclosing it would endanger its market
                              position. The trick is not quite simple; it uses secondary effects of
                              unexpected functions, but it works fine.

                              In case of need I could provide a compiled library containing the function,
                              though. Better told, I could disclose the way how to call the function from
                              the MmATTACH module (after adjusting it little bit), when installed on the
                              system.

                              Just please note that the encoding is not very fast and not well suitable
                              for files bigger than few hundreds of kilobytes. Whenever possible, using an
                              external encoder like MimeConv 2 freely available on my website is a much
                              faster solution.

                              Ivo
                              http://mivo.truxoft.com




                              -----Original Message-----
                              From: Jeff Huber - Listmail


                              Ahh, but if you can get the file into a string then you can use it :)

                              We actually got very close to an algorithm that would let us GUESS at the
                              file contents enough that we could suck up files using MvIMPORT and the
                              encode them and manipulate them.

                              In fact we have successfully done it with a number of files but it is not
                              stable because if the guesses are wrong then everything falls apart badly.

                              The problem of course is rooted in the fact that MvIMPORT is specifically
                              intended to import text files that are considered one record per line, and a
                              line is determined by the existence of a LF, CR, or CRLF, which means that
                              Miva eats some of the binary data and you can't be sure which it eats.

                              I am holding out hope that we will get a way to read files in a more raw
                              manner into variables sometime after 5.o of Empresa is released, and if we
                              don't then we will be building and releasing a file system function library
                              for Miva Empresa VM because we have some things planned for early next year
                              that we HAVE to have that functionality for and I have reasons why I want it
                              all done as Miva script rather than using PHP, Perl, C, etc.

                              - Jeff Huber
                              President 4TheBest eCommerce Solutions
                              http://4TheBest.com
                              [email protected]
                              Office: 760-742-1469
                              Cell: 760-445-8454



                              -----Original Message-----
                              From: [email protected]
                              [mailto:[email protected]] On Behalf Of [email protected]
                              Sent: Tuesday, October 12, 2004 2:09 PM
                              To: 'Claudiu Bischoff'; Miva Users List
                              Subject: RE: [meu] encode base64


                              Hi,
                              I was under the impression that crypto_base64_encode function only worked on
                              strings-not files. How exactly do you use the function? -
                              crypto_base64_encode(l.image_url)???

                              Bill M.

                              -----Original Message-----
                              From: [email protected]
                              [mailto:[email protected]] On Behalf Of Claudiu Bischoff
                              Sent: Tuesday, October 12, 2004 9:47 AM
                              To: [email protected]
                              Subject: [meu] encode base64


                              Hi all,

                              I'm trying to encode some images in my automated e-mails (due to the new
                              SP2 I cannot use web hosted images in my multimedia e-mails
                              anymore) and I
                              want to make this happen with the new miva crypto_base64_encode function.
                              The only problem I have is that I don't have the correct result.
                              I'm
                              importing the image and encoding it to insert it in my multipart e-mail
                              body. All is fine less the encoded result. I have encoded the same image
                              with another software and I noticed that the begining of the encrypted
                              result is ok.. but after a few characters my miva result change..

                              Miva encoded image result :
                              /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQg=DBQ=DAsLDBkSE
                              w8UHRofHh0a
                              HBw=GDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjIyMjIyM
                              jIyMjIyMjIy
                              Mv/AABEIAF8AXQMBIgACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQI ..
                              etc .. etc

                              VB software encoded image result :
                              /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSE
                              w8UHRofHh0a
                              HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyI
                              RwhMjIyMjIy
                              MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj IyMjIyMjL/wA ..
                              etc .. etc

                              The VB result is working well with Outlook and other e-mail clients, but..
                              the miva one is not working at all (I have a broken image in the e-mail
                              body)

                              Does anybody is aware of some encoding problems with the
                              crypto_base64_encode(data) function?

                              PS: I already looked on the Ivo website encoding solution but I need a 100%
                              mivascript solution ( if there is one .. :s )

                              Thanks everybody
                              Claudiu


                              Comment

                              Working...
                              X