Examples of RandomData


Examples of javacard.security.RandomData

        JCSystem.beginTransaction();
        if (state[0] == (byte) 0x00) {
          //nonceT
          Util.arrayCopy(buff, (short) ISO7816.OFFSET_CDATA,tempData, (short) 0, (short) 8);
          //nonceC
          RandomData nonceC = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
          nonceC.generateData(calcData, (short) 0, (short) 8);

          //nonceT^nonceC=nonceR
          XOR(tempData, calcData, calcData, (short) 0, (short) 0,(short) 8, (short) 8);

          //We send id,AES(nonceR)K and update internal state of handshake protocol
View Full Code Here

Examples of org.apache.avro.RandomData

    GenericDatumWriter<Object> writer = new GenericDatumWriter<Object>();
    writer.setSchema(schema);
    ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
    BinaryEncoder encoder = new BinaryEncoder(baos);
   
    for (Object datum : new RandomData(schema, count, seed)) {
      writer.write(datum, encoder);
      records.add(datum);
    }
    data = baos.toByteArray();
  }
View Full Code Here

Examples of org.apache.avro.RandomData

    GenericDatumWriter<Object> writer = new GenericDatumWriter<Object>();
    writer.setSchema(schema);
    ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
    BinaryEncoder encoder = e_factory.binaryEncoder(baos, null);
   
    for (Object datum : new RandomData(schema, count, seed)) {
      writer.write(datum, encoder);
      records.add(datum);
    }
    encoder.flush();
    data = baos.toByteArray();
View Full Code Here

Examples of org.apache.avro.RandomData

    GenericDatumWriter<Object> writer = new GenericDatumWriter<Object>();
    writer.setSchema(schema);
    ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
    BinaryEncoder encoder = e_factory.binaryEncoder(baos, null);
   
    for (Object datum : new RandomData(schema, count, seed)) {
      writer.write(datum, encoder);
      records.add(datum);
    }
    encoder.flush();
    data = baos.toByteArray();
View Full Code Here

Examples of org.apache.avro.RandomData

    GenericDatumWriter<Object> writer = new GenericDatumWriter<Object>();
    writer.setSchema(schema);
    ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
    BinaryEncoder encoder = e_factory.binaryEncoder(baos, null);
   
    for (Object datum : new RandomData(schema, count, seed)) {
      writer.write(datum, encoder);
      records.add(datum);
    }
    encoder.flush();
    data = baos.toByteArray();
View Full Code Here

Examples of org.apache.commons.math.random.RandomData

        final int len = 10;        // length of values array
        final double mu = 0;       // mean of test data
        final double sigma = 5;    // std dev of test data
        double[] values = new double[len];
        double[] weights = new double[len];
        RandomData randomData = new RandomDataImpl();

        // Fill weights array with random int values between 1 and 5
        int[] intWeights = new int[len];
        for (int i = 0; i < len; i++) {
            intWeights[i] = randomData.nextInt(1, 5);
            weights[i] = intWeights[i];
        }

        // Fill values array with random data from N(mu, sigma)
        // and fill valuesList with values from values array with
        // values[i] repeated weights[i] times, each i
        List<Double> valuesList = new ArrayList<Double>();
        for (int i = 0; i < len; i++) {
            double value = randomData.nextGaussian(mu, sigma);
            values[i] = value;
            for (int j = 0; j < intWeights[i]; j++) {
                valuesList.add(new Double(value));
            }
        }
View Full Code Here

Examples of org.apache.commons.math.random.RandomData

    public void testWithInitialCapacity() {

        ResizableDoubleArray eDA2 = new ResizableDoubleArray(2);
        assertEquals("Initial number of elements should be 0", 0, eDA2.getNumElements());

        RandomData randomData = new RandomDataImpl();
        int iterations = randomData.nextInt(100, 1000);

        for( int i = 0; i < iterations; i++) {
            eDA2.addElement( i );
        }
View Full Code Here

Examples of org.apache.commons.math.random.RandomData

    public void testWithInitialCapacityAndExpansionFactor() {

        ResizableDoubleArray eDA3 = new ResizableDoubleArray(3, 3.0f, 3.5f);
        assertEquals("Initial number of elements should be 0", 0, eDA3.getNumElements() );

        RandomData randomData = new RandomDataImpl();
        int iterations = randomData.nextInt(100, 3000);

        for( int i = 0; i < iterations; i++) {
            eDA3.addElement( i );
        }
View Full Code Here

Examples of org.apache.commons.math.random.RandomData

        }
      }
    }
    state.getMap().remove(LAST_SETTING);
    state.getMap().remove(LAST_TABLE_SETTING);
    RandomData random = new RandomDataImpl();
    if (random.nextInt(0, 1) == 0) {
      changeTableSetting(random, state, props);
    } else {
      changeSetting(random, state, props);
    }
  }
View Full Code Here

Examples of org.apache.commons.math.random.RandomData

        }
      }
    }
    state.getMap().remove(LAST_SETTING);
    state.getMap().remove(LAST_TABLE_SETTING);
    RandomData random = new RandomDataImpl();
    if (random.nextInt(0, 1) == 0) {
      changeTableSetting(random, state, props);
    } else {
      changeSetting(random, state, props);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.