Can I use the breakpoints like this?

I try to use the modulo breakpoints and the relative breakpoints together to create a row by row scan .
Can I design like that
昨天是今天的昨天
明天是今天的明天
今天是昨天的明天
是明天的昨天
Attachments:
mytry.vi ‏114 KB

Hello,
Yes, modulus breakpoints can be used to generate pulses at even intervals through your moves. To do this, you would load your initial breakpoint position to determine what position value will be used for the first breakpoint and then set the breakpoint modulus to determine the position interval for subsequent breakpoints to be set. If your motion will be occurring in a grid, you can reset your breakpoint position for each line and then reload the modulus for the reverse direction.
Try this and let me know if you have any additional questions on this issue.
Regards,
Scott R.
Applications Engineer
National Instruments

Similar Messages

  • The "Apple ID Password box along with the keyboard keeps popping up on my iPad and stays there.  I have changed my email address on my iMac but my old one still remains on the iPad.  Also changed password.  Nothing works!  I can't use the iPad like this!

    The "apple ID Password" box along with the keyboard pops up when I turn the iPad on and it stays there.  I have changed my email address on my iMac and also changed my password.  The old email address is still on the iPad.  Anyway, I can't use the iPad because can't get the apple id password box to go away.  Thanks for any help!

    This is an older photo but the sleep and home buttons are still in the same place on all iPads. The home button is the round button at the bottom of the iPad and the sleep button is also called the on/off button and it is at the top right corner of the iPad.

  • Can I use the phone like a touch?

    I am on verizon wireless. Can I purchase an iPhone 4 and use it as a touch, i.e. only accessing internet via wifi, not using the phone, etc.? and still be able to install and use apps, pictures, mp3, etc.?
    I love the specs on the screen of the iphone. I would much prefer this over the touch.

    Well, if the unlocked iphone is $600 - then surely even if there is a 4g touch it'll be out of my price range.
    Thanks for the replies, I'm going to try to get one of the "true" 3g touch tomorrow.

  • Can I use a cursor like this ...

    I have 10 columns that are named block_1 through block_10. I want to carry out some validation on the 10 columns but I do not want to use 10 separate conditional statements to process them. So what I would like to do is use a FOR LOOP to return a number into the variable COL_NUM, I will then use this value to numerically increment the column names from 1 to 10. Then hope to use the concatenated results which include the cursor variable to form an IF THEN statement that will be looped through. WHat I have does not work, Is this because using cursor in this way cant be done or is it for some other reason?
      OPEN get_invalid_cur;
      LOOP
        FETCH get_invalid_cur INTO p_rec;
        EXIT
      WHEN get_invalid_cur%NOTFOUND; 
      upl_id_num := p_rec.upl_id;
    FOR col_num IN 1..10
      LOOP
        fk_chk_blk_id := 'p_rec.fk_chk_blk_id_' || col_num;
                block := 'p_rec.block_' || col_num;
        IF fk_chk_blk_id IS NULL AND block > 0 THEN
          p_error_desc := p_error_desc || ' (FK violated BLOCK)';
          UPDATE fmbsite.fbt_doc_bulk_upload SET error_desc = p_error_desc WHERE upl_id = p_rec.upl_id AND created_by = user;
        END IF;
      END LOOP;
      END LOOP; -- Loop for get_invalid_cur
      CLOSE get_invalid_cur;I want to do the above so that I don't have to do the following:
      OPEN get_invalid_cur;
      LOOP
        FETCH get_invalid_cur INTO p_rec;
        EXIT
      WHEN get_invalid_cur%NOTFOUND; 
      upl_id_num := p_rec.upl_id;
    IF p_rec.fk_chk_blk_id_1 IS NULL AND p_rec.block_1 > 0 THEN
        p_error_desc := p_error_desc || ' (FK violated BLOCK_1)';
        UPDATE fmbsite.fbt_doc_bulk_upload SET error_desc = p_error_desc WHERE upl_id = p_rec.upl_id AND created_by = user;
      END IF;
      IF p_rec.fk_chk_blk_id_2 IS NULL AND p_rec.block_2 > 0 THEN
        p_error_desc := p_error_desc || ' (FK violated BLOCK_2)';
        UPDATE fmbsite.fbt_doc_bulk_upload SET error_desc = p_error_desc WHERE upl_id = p_rec.upl_id AND created_by = user;
      END IF;
    and so on another 8 times ...
      END LOOP; -- Loop for get_invalid_cur
      CLOSE get_invalid_cur;Cheers
    Benton
    Edited by: Benton on Nov 22, 2010 11:59 AM

    Benton wrote:
    I have 10 columns that are named block_1 through block_10. I want to carry out some validation on the 10 columns but I do not want to use 10 separate conditional statements to process them. So what I would like to do is use a FOR LOOP to return a number into the variable COL_NUM, I will then use this value to numerically increment the column names from 1 to 10. Then hope to use the concatenated results which include the cursor variable to form an IF THEN statement that will be looped through. WHat I have does not work, Is this because using cursor in this way cant be done or is it for some other reason?
    OPEN get_invalid_cur;
    LOOP
    FETCH get_invalid_cur INTO p_rec;
    EXIT
    WHEN get_invalid_cur%NOTFOUND; 
    upl_id_num := p_rec.upl_id;
    FOR col_num IN 1..10
    LOOP
    fk_chk_blk_id := 'p_rec.fk_chk_blk_id_' || col_num;
    block := 'p_rec.block_' || col_num;
    IF fk_chk_blk_id IS NULL AND block > 0 THEN
    p_error_desc := p_error_desc || ' (FK violated BLOCK)';
    UPDATE fmbsite.fbt_doc_bulk_upload SET error_desc = p_error_desc WHERE upl_id = p_rec.upl_id AND created_by = user;
    END IF;
    END LOOP;
    END LOOP; -- Loop for get_invalid_cur
    CLOSE get_invalid_cur;I want to do the above so that I don't have to do the following:
    OPEN get_invalid_cur;
    LOOP
    FETCH get_invalid_cur INTO p_rec;
    EXIT
    WHEN get_invalid_cur%NOTFOUND; 
    upl_id_num := p_rec.upl_id;
    IF p_rec.fk_chk_blk_id_1 IS NULL AND p_rec.block_1 > 0 THEN
    p_error_desc := p_error_desc || ' (FK violated BLOCK_1)';
    UPDATE fmbsite.fbt_doc_bulk_upload SET error_desc = p_error_desc WHERE upl_id = p_rec.upl_id AND created_by = user;
    END IF;
    IF p_rec.fk_chk_blk_id_2 IS NULL AND p_rec.block_2 > 0 THEN
    p_error_desc := p_error_desc || ' (FK violated BLOCK_2)';
    UPDATE fmbsite.fbt_doc_bulk_upload SET error_desc = p_error_desc WHERE upl_id = p_rec.upl_id AND created_by = user;
    END IF;
    and so on another 8 times ...
    END LOOP; -- Loop for get_invalid_cur
    CLOSE get_invalid_cur;Cheers
    Benton
    Edited by: Benton on Nov 22, 2010 11:59 AMUse tag
    Regards,
    Sayan M.
    ps. i'm going to lunch... will read and answer later                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How can I fix the problem like this?( in JBuilder6+Weblogic+ejb)

    "Cabin.ejbgrpx": D:\JBuilder6\jdk1.3.1\bin\javaw -classpath "D:\java_code\jb6\MyFirstEJB\classes;D:\bea\weblogic700\server\lib\weblogic_sp.jar;D:\bea\weblogic700\server\lib\weblogic.jar;D:\JBuilder6\lib\jbuilder.jar;D:\JBuilder6\lib\help.jar;D:\JBuilder6\lib\gnuregexp.jar;D:\JBuilder6\jdk1.3.1\demo\jfc\Java2D\Java2Demo.jar;D:\JBuilder6\jdk1.3.1\jre\lib\i18n.jar;D:\JBuilder6\jdk1.3.1\jre\lib\jaws.jar;D:\JBuilder6\jdk1.3.1\jre\lib\rt.jar;D:\JBuilder6\jdk1.3.1\jre\lib\sunrsasign.jar;D:\JBuilder6\jdk1.3.1\lib\dt.jar;D:\JBuilder6\jdk1.3.1\lib\htmlconverter.jar;D:\JBuilder6\jdk1.3.1\lib\tools.jar;D:\JBuilder6\jdk1.3.1\lib\ejb.jar;D:\JBuilder6\jdk1.3.1\lib\tools.jar;D:\JBuilder6\patch\jb6_all_001.jar;D:\JBuilder6\lib\activation.jar;D:\JBuilder6\lib\beandt.jar;D:\JBuilder6\lib\borlandxml.jar;D:\JBuilder6\lib\castor-xml.jar;D:\JBuilder6\lib\castor.jar;D:\JBuilder6\lib\cx.jar;D:\JBuilder6\lib\dbswing.jar;D:\JBuilder6\lib\dbswingdt.jar;D:\JBuilder6\lib\dbtools.jar;D:\JBuilder6\lib\dt.jar;D:\JBuilder6\lib\dx.jar;D:\JBuilder6\lib\gnuregexp.jar;D:\JBuilder6\lib\help.jar;D:\JBuilder6\lib\iastools.jar;D:\JBuilder6\lib\ias_common.jar;D:\JBuilder6\lib\internetbeans.jar;D:\JBuilder6\lib\jakarta-regexp-1.1.jar;D:\JBuilder6\lib\javaws.jar;D:\JBuilder6\lib\jbcl.jar;D:\JBuilder6\lib\jbuilder.jar;D:\JBuilder6\lib\jdbcx.jar;D:\JBuilder6\lib\jdom.jar;D:\JBuilder6\lib\jds.jar;D:\JBuilder6\lib\jdsremote.jar;D:\JBuilder6\lib\jdsserver.jar;D:\JBuilder6\lib\junit.jar;D:\JBuilder6\lib\mail.jar;D:\JBuilder6\lib\sqltools.jar;D:\JBuilder6\lib\unittest.jar;D:\JBuilder6\lib\webserverglue.jar;D:\JBuilder6\lib\xalan.jar;D:\JBuilder6\lib\xerces.jar;D:\JBuilder6\lib\xml4j.jar;D:\JBuilder6\lib\xmlbeans.jar;D:\JBuilder6\lib\xmldbms.jar;D:\JBuilder6\lib\bes\agentclient.jar;D:\JBuilder6\lib\bes\asrt.jar;D:\JBuilder6\lib\bes\client.jar;D:\JBuilder6\lib\bes\guicore.jar;D:\JBuilder6\lib\bes\jaas.jar;D:\JBuilder6\lib\bes\jcert.jar;D:\JBuilder6\lib\bes\jnet.jar;D:\JBuilder6\lib\bes\jsse.jar;D:\JBuilder6\lib\bes\lm.jar;D:\JBuilder6\lib\bes\vbdev.jar;D:\JBuilder6\lib\bes\vbejb.jar;D:\JBuilder6\lib\bes\vbjdev.jar;D:\JBuilder6\lib\bes\vbjorb.jar;D:\JBuilder6\lib\bes\vbsec.jar;D:\JBuilder6\lib\bes\xmlrt.jar"
    weblogic.ejbc -keepgenerated -compiler D:/JBuilder6/bin/bcjW D:/java_code/jb6/MyFirstEJB/Cabin.jar.jar
    D:/java_code/jb6/MyFirstEJB/Cabin.jar
    "Cabin.ejbgrpx": Spaces in the temporary directory path may cause WebLogic EJBC utility
    to produce fatal compile errors.
    "Cabin.ejbgrpx": <2002-5-30 &#19979;&#21320;11&#26102;32&#20998;20&#31186;> <Warning>
    <EJB> <010054> <EJB Deployment: CabinBean has a class com.titan.cabin.CabinBean which
    is in the classpath. This class should only be located in the ejb-jar file.>
    "Cabin.ejbgrpx": <2002-5-30 &#19979;&#21320;11&#26102;32&#20998;20&#31186;> <Warning>
    <EJB> <010054> <EJB Deployment: CabinBean has a class com.titan.cabin.CabinHome which
    is in the classpath. This class should only be located in the ejb-jar file.>
    "Cabin.ejbgrpx": <2002-5-30 &#19979;&#21320;11&#26102;32&#20998;20&#31186;> <Warning>
    <EJB> <010054> <EJB Deployment: CabinBean has a class com.titan.cabin.Cabin which
    is in the classpath. This class should only be located in the ejb-jar file.>
    "Cabin.ejbgrpx": <2002-5-30 &#19979;&#21320;11&#26102;32&#20998;20&#31186;> <Warning>
    <EJB> <010054> <EJB Deployment: CabinBean has a class com.titan.cabin.CabinPK which
    is in the classpath. This class should only be located in the ejb-jar file.>
    "Cabin.ejbgrpx": ERROR: The classes which ejbc generated from your home and remote
    interfaces cannot be loaded. Please ensure that you have set the -d option to a
    writeable directory.
    "Cabin.ejbgrpx": ERROR: ejbc found errors

    iTunes error 54

  • HT4623 the Icons on my iphone 4...suddenly get extreemly large, I don't know why.  I can't use the phone when this happens, I have to shut off the phone, which is a problem, just finding the red arrow and making it go across the screen to shut down...help

    does anyone know what is going on with my phone?  I don't think I'm causing this, but you never know.  my home page where the phone, camera, messages, etc...all the icons will get giant....maybe 3 will be on the screen instead of the normal 20.....I have to move the screen around to find what I need to open and then I cannot...so I turn off the phone, when the red arrow appears, and have to hold down one side of the screen to make the arrow move, If I try to slide it over with my finger..........I can't get it to the end.....eventually the phone will shut off and then I turn it on again and the icons are normal....but this happens several times a week and I would like it not to happen , what can I do?

    Thank You, thank You ...so much......that feature made me crazy!  
    Ocean20 wrote:
    This can be turned off in settings/accessibility/zoom. Then on the next screen turn off

  • Can you use the zen like a removable hard dri

    can you record something or be at work and download an mp3 and upload it to your player and then go home and add it to your collection?
    i know you can do this with the cowon iaudio m3. but can you do it with the zen 20gb?
    thanks

    Yes you can do this, but it won't act as an external hard dri've such as E:\ You will have to have the creative drivers and Nomad Explorer installed on both your home computer and your work computer.

  • How can I use a class like this?

    public class Test<N, T extends Test<N, T>> {
    public static void main(String[] args) {
    Test<String, Test<String, Test>> test = null; //compile failed...
    }

    I could suggest the following example:public class Test<N, T extends Test<N, T>> {
        public void op(T t){
            System.out.println("T: " + t.getClass().getName());
        public static void main(String[] args) {
            SubTest<String> subTest = new SubTest<String>();
            subTest.op(subTest);
    class SubTest<N> extends Test<N, SubTest<N>>{   
    }The problem is that T parameter should be a descendant of Test class

  • How Can i use the key file Generated by RSACryptoServiceProvider to encrypt with php?

    I need to be able to encrypt data in PHP using a public key generate by .NET(RSACryptoServiceProvider).  I will then decrypt the data later in C# using the private key.
    Code Snippet
    <RSAKeyValue><Modulus>xU5JyaPNDKXI/h/uo5Vk89wZSz3zsB1+c+1IMYIQa+mCmuRCRPuoBI7ODSV2ndP6grfhdrWEzhpZtkI3SThbBh/3t+tfZ2PF8Iyv9ECN07V64nPCiJGhAnfENE+J9UD9Kw5czXHgZcBbpM5N0VfXmLSleaS65DDoNPtoStVy7ss=</Modulus><Exponent>AQAB</Exponent><P>4ScAjVrPZii/6lICAP2yDQiNEmNL74+5AcxNVDI0IombfDPIygrqEWmuDu0pngApQak7XnEnLbaDChILFiHPZQ==</P><Q>4FaYlse+cjrlPD/jk+GsTJeuP7yuQx8ztjVnQWVh6GKQP+uk1dAl6kcZOfLNR6LWwE3CSygt8PthTEw96Zbabw==</Q><DP>XvXtNLE9UjATqYeHEtXtV7Pok/3PVC3A8PIzFzTJaluxeXP51sU9rbRt1hvO9rXIsMnooU+GH7Cfmgq8JEyERQ==</DP><DQ>HXkC/vwq9xLpvuqd2XXSjxV2XQVK16Knxo5pjFvnawJX9S3eMADymj7Q/534firUj9snZXxX3MsJ015I3AFnnQ==</DQ><InverseQ>AM0fVCE3n2FKf2zb3CcDEge1Ko35VvMEL+LXgR87QwO2HScZSuLevGLi2SSAkB1vu8RSNzB028SZReeOZWnq4Q==</InverseQ><D>fI+GKdRNOTTYhQZnw8Im74T+OvArjf2wvUMJlqfD8jyDBYIhDCfL1MTK9KW4Er+moSuxHR5Pb0ZXaKa4/HKlk0aJ1jB2C+jg7zTSuPRNuS16BpVHaJYsQurCwZwElXMum+GxeXK/h3wXWq5HwebjqZr0aLUMZKRcweDPRoVFiRE=</D></RSAKeyValue>
    As you see this code snippet is a xml format private key. at .net platform,which can use encrypt or dencrypt.
    i have try the Extension Crypt RSA ( http://pear.php.net/reference/Crypt_RSA-1.0.0/elementindex_Crypt_RSA.html ) to help me encrypt data by php.but it haven't return a currect result. the data encrypted by php cann't dencrypt by c#.
    does the RSA algorithm provider by Crypt_RSA can give a stand result as c#?
    BTW :i just use the xmlkeystring like this.
    Code Snippet
    <?php
    require_once("Crypt/RSA.php");
    require_once("includes/Utils.class.php");
        $public_key_string = simplexml_load_string("<RSAKeyValue><Modulus>xU5JyaPNDKXI/h/uo5Vk89wZSz3zsB1+c+1IMYIQa+mCmuRCRPuoBI7ODSV2ndP6grfhdrWEzhpZtkI3SThbBh/3t+tfZ2PF8Iyv9ECN07V64nPCiJGhAnfENE+J9UD9Kw5czXHgZcBbpM5N0VfXmLSleaS65DDoNPtoStVy7ss=</Modulus><Exponent>AQAB</Exponent><P>4ScAjVrPZii/6lICAP2yDQiNEmNL74+5AcxNVDI0IombfDPIygrqEWmuDu0pngApQak7XnEnLbaDChILFiHPZQ==</P><Q>4FaYlse+cjrlPD/jk+GsTJeuP7yuQx8ztjVnQWVh6GKQP+uk1dAl6kcZOfLNR6LWwE3CSygt8PthTEw96Zbabw==</Q><DP>XvXtNLE9UjATqYeHEtXtV7Pok/3PVC3A8PIzFzTJaluxeXP51sU9rbRt1hvO9rXIsMnooU+GH7Cfmgq8JEyERQ==</DP><DQ>HXkC/vwq9xLpvuqd2XXSjxV2XQVK16Knxo5pjFvnawJX9S3eMADymj7Q/534firUj9snZXxX3MsJ015I3AFnnQ==</DQ><InverseQ>AM0fVCE3n2FKf2zb3CcDEge1Ko35VvMEL+LXgR87QwO2HScZSuLevGLi2SSAkB1vu8RSNzB028SZReeOZWnq4Q==</InverseQ><D>fI+GKdRNOTTYhQZnw8Im74T+OvArjf2wvUMJlqfD8jyDBYIhDCfL1MTK9KW4Er+moSuxHR5Pb0ZXaKa4/HKlk0aJ1jB2C+jg7zTSuPRNuS16BpVHaJYsQurCwZwElXMum+GxeXK/h3wXWq5HwebjqZr0aLUMZKRcweDPRoVFiRE=</D></RSAKeyValue>");
        $key =new Crypt_RSA_Key(base64_decode($public_key_string->Modulus),base64_decode($public_key_string->Exponent),"public");
        echo "<pre>";
        print_r($key);
        echo "</pre>";
        $rsa_obj = new Crypt_RSA();
        //try encrypt data
        echo "encrypted result is:<br/>".$rsa_obj->encrypt("this is a smple text.",$key)
        ?>
    but the encrypted data cann't decrypt by c#?where is the problem?what should i do with php codes?

    thank you for your reply, i also found this article by google.but this does not meet scene,  thank you all the same.
    i have already solved the problem now,i'd like to post the Solution .infact it's so easy to use rsakey file generated by .net .
    -------------rsa.class.php-------------------
    Code Snippet
    <?php
     * Some constants
    define("BCCOMP_LARGER", 1);
    class RSA
      * PHP implementation of the RSA algorithm
      * (C) Copyright 2004 Edsko de Vries, Ireland
      * Licensed under the GNU Public License (GPL)
      * This implementation has been verified against [3]
      * (tested Java/PHP interoperability).
      * References:
      * [1] "Applied Cryptography", Bruce Schneier, John Wiley & Sons, 1996
      * [2] "Prime Number Hide-and-Seek", Brian Raiter, Muppetlabs (online)
      * [3] "The Bouncy Castle Crypto Package", Legion of the Bouncy Castle,
      *      (open source cryptography library for Java, online)
      * [4] "PKCS #1: RSA Encryption Standard", RSA Laboratories Technical Note,
      *      version 1.5, revised November 1, 1993
      * Functions that are meant to be used by the user of this PHP module.
      * Notes:
      * - $key and $modulus should be numbers in (decimal) string format
      * - $message is expected to be binary data
      * - $keylength should be a multiple of 8, and should be in bits
      * - For rsa_encrypt/rsa_sign, the length of $message should not exceed
      *   ($keylength / 8) - 11 (as mandated by [4]).
      * - rsa_encrypt and rsa_sign will automatically add padding to the message.
      *   For rsa_encrypt, this padding will consist of random values; for rsa_sign,
      *   padding will consist of the appropriate number of 0xFF values (see [4])
      * - rsa_decrypt and rsa_verify will automatically remove message padding.
      * - Blocks for decoding (rsa_decrypt, rsa_verify) should be exactly
      *   ($keylength / 8) bytes long.
      * - rsa_encrypt and rsa_verify expect a public key; rsa_decrypt and rsa_sign
      *   expect a private key.
      * rsa encrypt data
      * @param binary string $message
      * @param unknown_type $public_key
      * @param numbers $modulus
      * @param numbers $keylength
      * @return binary data
     function rsa_encrypt($message, $public_key, $modulus, $keylength)
      $padded = RSA::add_PKCS1_padding($message, true, $keylength / 8);
      $number = RSA::binary_to_number($padded);
      $encrypted = RSA::pow_mod($number, $public_key, $modulus);
      $result = RSA::number_to_binary($encrypted, $keylength / 8);
      return $result;
     function rsa_decrypt($message, $private_key, $modulus, $keylength)
      $number = RSA::binary_to_number($message);
      $decrypted = RSA::pow_mod($number, $private_key, $modulus);
      $result = RSA::number_to_binary($decrypted, $keylength / 8);
      return RSA::remove_PKCS1_padding($result, $keylength / 8);
     function rsa_sign($message, $private_key, $modulus, $keylength)
      $padded = RSA::add_PKCS1_padding($message, false, $keylength / 8);
      $number = RSA::binary_to_number($padded);
      $signed = RSA::pow_mod($number, $private_key, $modulus);
      $result = RSA::number_to_binary($signed, $keylength / 8);
      return $result;
     function rsa_verify($message, $public_key, $modulus, $keylength)
      return RSA::rsa_decrypt($message, $public_key, $modulus, $keylength);
     function rsa_kyp_verify($message, $public_key, $modulus, $keylength)
      $number = RSA::binary_to_number($message);
      $decrypted = RSA::pow_mod($number, $public_key, $modulus);
      $result = RSA::number_to_binary($decrypted, $keylength / 8);
      return RSA::remove_KYP_padding($result, $keylength / 8);
      * The actual implementation.
      * Requires BCMath support in PHP (compile with --enable-bcmath)
     // Calculate (p ^ q) mod r
     // We need some trickery to [2]:
     //   (a) Avoid calculating (p ^ q) before (p ^ q) mod r, because for typical RSA
     //       applications, (p ^ q) is going to be _WAY_ too large.
     //       (I mean, __WAY__ too large - won't fit in your computer's memory.)
     //   (b) Still be reasonably efficient.
     // We assume p, q and r are all positive, and that r is non-zero.
     // Note that the more simple algorithm of multiplying $p by itself $q times, and
     // applying "mod $r" at every step is also valid, but is O($q), whereas this
     // algorithm is O(log $q). Big difference.
     // As far as I can see, the algorithm I use is optimal; there is no redundancy
     // in the calculation of the partial results.
     function pow_mod($p, $q, $r)
      // Extract powers of 2 from $q
      $factors = array();
      $div = $q;
      $power_of_two = 0;
      while(bccomp($div, "0") == BCCOMP_LARGER)
       $rem = bcmod($div, 2);
       $div = bcdiv($div, 2);
       if($rem) array_push($factors, $power_of_two);
       $power_of_two++;
      // Calculate partial results for each factor, using each partial result as a
      // starting point for the next. This depends of the factors of two being
      // generated in increasing order.
      $partial_results = array();
      $part_res = $p;
      $idx = 0;
      foreach($factors as $factor)
       while($idx < $factor)
        $part_res = bcpow($part_res, "2");
        $part_res = bcmod($part_res, $r);
        $idx++;
       array_push($partial_results, $part_res);
      // Calculate final result
      $result = "1";
      foreach($partial_results as $part_res)
       $result = bcmul($result, $part_res);
       $result = bcmod($result, $r);
      return $result;
     // Function to add padding to a decrypted string
     // We need to know if this is a private or a public key operation [4]
     function add_PKCS1_padding($data, $isPublicKey, $blocksize)
      $pad_length = $blocksize - 3 - strlen($data);
      if($isPublicKey)
       $block_type = "\x02";
       $padding = "";
       for($i = 0; $i < $pad_length; $i++)
        $rnd = mt_rand(1, 255);
        $padding .= chr($rnd);
      else
       $block_type = "\x01";
       $padding = str_repeat("\xFF", $pad_length);
      return "\x00" . $block_type . $padding . "\x00" . $data;
     // Remove padding from a decrypted string
     // See [4] for more details.
     function remove_PKCS1_padding($data, $blocksize)
      assert(strlen($data) == $blocksize);
      $data = substr($data, 1);
      // We cannot deal with block type 0
      if($data{0} == '\0')
      die("Block type 0 not implemented.");
      // Then the block type must be 1 or 2
      assert(($data{0} == "\x01") || ($data{0} == "\x02"));
      // Remove the padding
      $offset = strpos($data, "\0", 1);
      return substr($data, $offset + 1);
     // Remove "kyp" padding
     // (Non standard)
     function remove_KYP_padding($data, $blocksize)
      assert(strlen($data) == $blocksize);
      $offset = strpos($data, "\0");
      return substr($data, 0, $offset);
     // Convert binary data to a decimal number
     function binary_to_number($data)
      $base = "256";
      $radix = "1";
      $result = "0";
      for($i = strlen($data) - 1; $i >= 0; $i--)
       $digit = ord($data{$i});
       $part_res = bcmul($digit, $radix);
       $result = bcadd($result, $part_res);
       $radix = bcmul($radix, $base);
      return $result;
     // Convert a number back into binary form
     function number_to_binary($number, $blocksize)
      $base = "256";
      $result = "";
      $div = $number;
      while($div > 0)
       $mod = bcmod($div, $base);
       $div = bcdiv($div, $base);
       $result = chr($mod) . $result;
      return str_pad($result, $blocksize, "\x00", STR_PAD_LEFT);
    ?>
    -------------RSAProcessor.class.php------------------------
    Code Snippet
    <?php
    require_once("rsa.class.php");
    class RSAProcessor
     private $public_key = null;
     private $private_key = null;
     private $modulus = null;
     private $key_length = "1024";
     public function __construct($xmlRsakey=null,$type=null)
             $xmlObj = null;
       if($xmlRsakey==null)
               $xmlObj = simplexml_load_file("xmlfile/RSAKey.xml");
              elseif($type==RSAKeyType::XMLFile)
               $xmlObj = simplexml_load_file($xmlRsakey);
              else
               $xmlObj = simplexml_load_string($xmlRsakey);
             $this->modulus = RSA::binary_to_number(base64_decode($xmlObj->Modulus));
       $this->public_key = RSA::binary_to_number(base64_decode($xmlObj->Exponent));
       $this->key_length = strlen(base64_decode($xmlObj->Modulus))*8;
      * get public key
      * @return string public key
     public function getPublicKey()
      //return base64_encode(RSA::number_to_binary($this->public_key,($this->key_length)/8));
      return $this->public_key;
     public function getPrivateKey()
      //return base64_encode(RSA::number_to_binary($this->private_key,($this->key_length)/8));
      return $this->private_key;
     public function getKeyLength()
      return $this->key_length;
     public function getModulus()
      return $this->modulus;
      * encrypt data
      * @param string $data
      * @return base64 encoded  binary string
     public function encrypt($data)
      return base64_encode(RSA::rsa_encrypt($data,$this->public_key,$this->modulus,$this->key_length));
     public function dencrypt($data)
      return RSA::rsa_decrypt($data,$this->private_key,$this->modulus,$this->key_length);
     public function sign($data)
      return RSA::rsa_sign($data,$this->private_key,$this->modulus,$this->key_length);
     public function verify($data)
      return RSA::rsa_verify($data,$this->public_key,$this->modulus,$this->key_length);
    class RSAKeyType
     const XMLFile = 0;
     const XMLString = 1;
    ?>
    -------------- encrypt data with public key-----------------
    Code Snippet
    <?php
    require_once("RSAProcessor.class.php");
    $processor = new RSAProcessor
    ("<RSAKeyValue><Modulus>m6ljoeWhmnd0oRnsVEH5iNw3B8+vKVu7v7CVfMyf6bnKEzHa62TRmT/baJiSevoI/vgm2ph/s1JrQQTaGiErHicigwSC
    Aw7+i05WFbnz7tOyiiJJVMfsdd+v7Xan9Hiud05FzxoMbM8vpiMHPEIDbGJ1MiXyupTVkz2WcMHyBoJ4S189opktZ43pviUhy0PeuWkyoU7zR54akPmK
    Yg+z5Zr1r7K8lUZ1a3TThfJGxTQR/uZMtZz/q8QF0AANVQ/eyahTv9icBzBoDuncS0Y5l3vqogW1C/ltJvhJpvSn/OgjbRjuixCAptOUmRd13sDWU95/
    x0bMq+Lg68lj2OjJ1Q==</Modulus><Exponent>AQAB</Exponent><P>zfvdBsMLlmo+4PAUYLgSV2xyyVa7ZqFjkJaAE4EbYuH24EoZjrzeiJR++D
    FUT/GUhjfZ5eZ/5e29dXwk0sKUw6nHzBdBtOPp5fr4t5SKLEcWY+J+zLUSOlhG9NUkohFf6+Miy2Y7BLpXVrcl6UwXV0ak8KkTPB2l/aIMwYj5dgc=</
    P><Q>wXV0sA3nDzoSDQA/4QSu/WIlBhkA3jZ7K7G9Z9rpP1A0vH+bZeyCIyo52u8ahGuYbubaizF1XMp+Xv3Mh2KmRbt7+UptwEwbFAUiiad2a312mqm
    j7IJd7gRjGkyzKEm+6fpNeY3NFLNVNhccBqzhNkRoM22xnvQcImD10XVAakM=</Q><DP>wd1HdCLEWCfc0DYE59a2pINUMXyo2foRTDbpifHcRZ+ojAY
    Rsc6+nsssCQnccXVMNVqBgSgEvfGYe+eAfMBX5SN5APPuioJrVGF2DsoFlZC+WPoGH0JYSoNlHO8yEDrMDaXzzH2GFHgQ1XOAged0nFbHzB1FFjJNVL5
    cxRXWu6c=</DP><DQ>QDKuCk5SwubOXqoaiJ15RHRxPNjHRPZnYVSWOgSXKn9/QJ5H/0bA2NKGaHS4JAFgkEzjcRV0kNpRnUwztymxa6qPtWZRjWK0Ca
    y6jVuZHIqB9UkeMLoCWZ3zFSMmwNPYGuUJGLFJwPjR6iU5E64C/nMs8QQR0WHIhFAQwvVZ7uk=</DQ><InverseQ>JckMSlJR10VZdnp83VPjrZ/Z+63
    CGu3tWHm7f4DJ8IwjJWr8FlCpbSwiP6a4e9Upv6bUn/tOj2gY6MMq5G5yTKm2SCRvpUKRu4NCmWAt7vlFv0Z6pkXlTOpzvVjv3v16+dIZOA5Zn+v7+r1
    xbdYdH20KRAbiBO3MfQP7s+VJJvM=</InverseQ><D>W1xrBr2hQOj1wgxWAgoK7IHbprEFrK+TnWmGA46SGPsbmHJ9fAVbY6fwHg7Wgmk4WHXLUCeLY
    /Nu0eWIISfwh60Oe3ls2WC2k4qxyeSvQDBuLNb81U7WAUT9m9E1uK4QMCP3oxs1ybM80zTh7UMNgVK0WG+fbFUomVffcWTTqW+Fu12PEIO+UR/85oq+x
    qVlTzYAEzt1OE9IhkYiRzi99ePXeH2gFltzJ/fb/7jLsDTkhM2eiYTGyOTZmBnen6c6a8b9LFTY4Bc0bGpk5ezHkub6F8p2ZgL/JgIOJMyRZICjDjs+9
    k9PTmMTFsCF6xzHY15Fg25xIDYzIyx1rrRUjQ==</D></RSAKeyValue>",RSAKeyType::XMLString);
    $rs =  $processor->encrypt("Hello,It's Works.");
    echo $rs;
    ?>
    with the front codes.you can easy to encrypt data by public key generate by .net programe.

  • I would like to have my iPad2 mirror onto 2 TVs at the same time. Can I use the iPad HDMI connector with a HDMI splitter to accomplish this?

    I would like to have my iPad2 mirror onto 2 TVs at the same time. Can I use the iPad HDMI connector with a HDMI splitter to accomplish this?

    I don't want to spend the money on the HDMI connector and HDMI splitter if it won't work.

  • I have a Macbook Air that had some coffee spilled on the keyboard and as a result the plus/equals key is no longer functioning. Can I use a program like Ukelele to reprogram a different key to be my plus/equals key? Can I program a function key? key

    I have a Macbook Air that had some coffee spilled on the keyboard and as a result the plus/equals key is no longer functioning. Can I use a program like Ukelele to re-program another key to do that function? Can I re-program a function key to do this function?

    Water + electronics do not mix.  Something was damaged insode, and the logic board may be corroding as is.
    Take it to a Genius Bar for an evaluation and repair estimate.
    This is accidental damage and not covered by warranty.

  • I updated to Photoshop cc 2014 and now can't resize the images like I used to.

    I updated to Photoshop cc 2014 and now can't resize the images like I used to. 
    I used to click on the image and then go to the corner hold down shift and resize it.  Now it won't do it.
    How do I do it now? 
    I have a project deadline and need to do this asap.  Panicking that I won't meet my deadline.

    Did you turn off the "show transform controls" option in the move tool?
    It sounds like you were using that previously.
    And you can always transform by using the Free Transform command (command/control T).

  • I just bought and installed the Adobe Illustrator. I would like to know how long can I use the product before an extension is needed?

    I just bought and installed the Adobe Illustrator. I would like to know how long can I use the product before an extension is needed?  And on how many computers can I install this product? Thanks.

    What version exactly did you buy? If you bought CS6, then the license is perpetual and doesn't need any extension. If you bought CC, then you need to renew your plan every year. You can install each Adobe software on 2 machines with a single license for non-concurrent use.
    Mylenium

  • Why doesn't my iTunes Radio give me the option to customize stations using "play more like this" and "never play this" in the star menu?

    Why doesn't my iTunes Radio give me the option to customize stations using "play more like this" and "never play this" in the star menu?

    You can only "play more like this" on your custom stations. The pre-programmed ones cannot be altered, at least to my understanding

  • HT1212 I've forgotten my ipad passcode but when I try to restore on the computer it won't let me as I have to turn "find your ipad" off but i don't know how when I can't use the  ipad itself. How do I do this on the cloud?

    I've forgotten my ipad passcode but when I try to restore on the computer it won't let me as I have to turn "find your ipad" off but i don't know how when I can't use the  ipad itself. How do I do this on the cloud?

    If the iPad was running iOS 7,  iCloud: Find My iPhone Activation Lock in iOS 7
    http://support.apple.com/kb/HT5818
    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just cancelling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

Maybe you are looking for