コード例 #1
0
 /**
  * @param namespacePattern - the format string to be used when constructing the namespace. this
  *     can be a fully formed namespace.
  * @param operationParam - this argument is used to determine the list of possible operation
  *     parameters
  * @param alternativeOperationParam - these arguments are treated as alternatives to
  *     <tt>operationParam</tt> (e.g., <tt>Action</tt> is an alternative to <tt>Operation</tt> ).
  */
 public BaseQueryBinding(
     final String namespacePattern, final T operationParam, final T... alternativeOperationParam) {
   super(namespacePattern);
   this.operationParam = operationParam;
   this.altOperationParams = Arrays.asList(alternativeOperationParam);
   this.possibleParams = Arrays.asList(operationParam.getDeclaringClass().getEnumConstants());
 }
コード例 #2
0
 private APIKeyValidationInfoDTO toDTO(
     org.wso2.carbon.apimgt.impl.dto.xsd.APIKeyValidationInfoDTO generatedDto) {
   APIKeyValidationInfoDTO dto = new APIKeyValidationInfoDTO();
   dto.setSubscriber(generatedDto.getSubscriber());
   dto.setAuthorized(generatedDto.getAuthorized());
   dto.setTier(generatedDto.getTier());
   dto.setType(generatedDto.getType());
   dto.setEndUserToken(generatedDto.getEndUserToken());
   dto.setEndUserName(generatedDto.getEndUserName());
   dto.setApplicationName(generatedDto.getApplicationName());
   dto.setEndUserName(generatedDto.getEndUserName());
   dto.setConsumerKey(generatedDto.getConsumerKey());
   // dto.setAuthorizedDomains(Arrays.asList(generatedDto.getAuthorizedDomains()));
   dto.setValidationStatus(generatedDto.getValidationStatus());
   dto.setApplicationId(generatedDto.getApplicationId());
   dto.setApplicationTier(generatedDto.getApplicationTier());
   dto.setApiPublisher(generatedDto.getApiPublisher());
   dto.setApiName(generatedDto.getApiName());
   dto.setValidityPeriod(generatedDto.getValidityPeriod());
   dto.setIssuedTime(generatedDto.getIssuedTime());
   dto.setApiTier(generatedDto.getApiTier());
   dto.setContentAware(generatedDto.getContentAware());
   dto.setScopes(
       generatedDto.getScopes() == null
           ? null
           : new HashSet<String>(Arrays.asList(generatedDto.getScopes())));
   dto.setThrottlingDataList(Arrays.asList(generatedDto.getThrottlingDataList()));
   dto.setSpikeArrestLimit(generatedDto.getSpikeArrestLimit());
   dto.setSpikeArrestUnit(generatedDto.getSpikeArrestUnit());
   dto.setSubscriberTenantDomain(generatedDto.getSubscriberTenantDomain());
   dto.setStopOnQuotaReach(generatedDto.getStopOnQuotaReach());
   return dto;
 }
コード例 #3
0
ファイル: TrialTest.java プロジェクト: dschrimpf/randi2
  @Test
  public void testStrataNamesAndIdsStrataCriterions() {
    DichotomousCriterion criterion1 = new DichotomousCriterion();
    criterion1.setId(1);
    criterion1.setName("criterion1");
    criterion1.setOption1("option1");
    criterion1.setOption2("option2");
    try {
      DichotomousConstraint d1 = new DichotomousConstraint(Arrays.asList(new String[] {"option1"}));
      d1.setId(1);
      criterion1.addStrata(d1);
      DichotomousConstraint d2 = new DichotomousConstraint(Arrays.asList(new String[] {"option2"}));
      d2.setId(2);
      criterion1.addStrata(d2);
    } catch (ContraintViolatedException e) {
      fail();
    }
    DichotomousCriterion criterion2 = new DichotomousCriterion();
    criterion2.setId(2);
    criterion2.setName("criterion2");
    criterion2.setOption1("option1");
    criterion2.setOption2("option2");
    try {
      DichotomousConstraint d1 = new DichotomousConstraint(Arrays.asList(new String[] {"option1"}));
      d1.setId(1);
      criterion2.addStrata(d1);
      DichotomousConstraint d2 = new DichotomousConstraint(Arrays.asList(new String[] {"option2"}));
      d2.setId(2);
      criterion2.addStrata(d2);
    } catch (ContraintViolatedException e) {
      fail();
    }
    validTrial.addCriterion(criterion1);
    validTrial.addCriterion(criterion2);

    Pair<List<String>, List<String>> pair = validTrial.getAllStrataIdsAndNames();

    assertEquals(4, pair.first().size());
    assertEquals(4, pair.last().size());

    Collections.sort(pair.first());
    assertEquals("1_1;2_1;", pair.first().get(0));
    assertEquals("1_1;2_2;", pair.first().get(1));
    assertEquals("1_2;2_1;", pair.first().get(2));
    assertEquals("1_2;2_2;", pair.first().get(3));

    Collections.sort(pair.last());
    assertEquals("criterion1_option1;criterion2_option1;", pair.last().get(0));
    assertEquals("criterion1_option1;criterion2_option2;", pair.last().get(1));
    assertEquals("criterion1_option2;criterion2_option1;", pair.last().get(2));
    assertEquals("criterion1_option2;criterion2_option2;", pair.last().get(3));
  }
コード例 #4
0
ファイル: NavResult.java プロジェクト: afercia/dotCMS
 @Override
 public List<PermissionSummary> acceptedPermissions() {
   return Arrays.asList(
       new PermissionSummary[] {
         new PermissionSummary("READ", "READ", PermissionAPI.PERMISSION_READ)
       });
 }
コード例 #5
0
 @SuppressWarnings("unchecked")
 public void runAllTasks() throws TaskSystemException {
   try {
     List<String> triggerNames;
     List<Trigger> triggers = new ArrayList<Trigger>();
     String[] groupNames = scheduler.getTriggerGroupNames();
     for (String group : groupNames) {
       triggerNames = new ArrayList<String>(Arrays.asList(scheduler.getTriggerNames(group)));
       for (String triggerName : triggerNames) {
         triggers.add(scheduler.getTrigger(triggerName, group));
       }
     }
     Collections.sort(
         triggers,
         new Comparator<Trigger>() {
           @Override
           public int compare(Trigger trigger1, Trigger trigger2) {
             if (trigger1.getPriority() < trigger2.getPriority()) {
               return -1;
             } else if (trigger1.getPriority() > trigger2.getPriority()) {
               return 1;
             } else {
               return 0;
             }
           }
         });
     for (Trigger trigger : triggers) {
       scheduler.triggerJob(trigger.getJobName(), trigger.getJobGroup());
     }
   } catch (SchedulerException se) {
     throw new TaskSystemException(se);
   }
 }
コード例 #6
0
  public void transferSampleBeanForDataAvailability(
      SampleBean sampleBean, HttpServletRequest request, String[] availableEntityNames) {

    if (sampleBean == null) return;

    setSampleName(sampleBean.getDomain().getName());
    setDataAvailability(sampleBean.getDataAvailabilityMetricsScore());

    this.setCaNanoLabScore(sampleBean.getCaNanoLabScore());
    this.setMincharScore(sampleBean.getMincharScore());

    setCaNanoLabScore(sampleBean.getCaNanoLabScore());
    setMincharScore(sampleBean.getMincharScore());

    SortedSet<String> ca =
        (SortedSet<String>) request.getSession().getServletContext().getAttribute("chemicalAssocs");
    setChemicalAssocs(new ArrayList<String>(ca));

    setCaNano2MINChar(
        (Map<String, String>)
            request.getSession().getServletContext().getAttribute("caNano2MINChar"));

    SortedSet<String> pc =
        (SortedSet<String>) request.getSession().getServletContext().getAttribute("physicoChars");
    setPhysicoChars(new ArrayList<String>(pc));
    SortedSet<String> iv =
        (SortedSet<String>) request.getSession().getServletContext().getAttribute("invitroChars");
    setInvitroChars(new ArrayList<String>(iv));
    SortedSet<String> invivo =
        (SortedSet<String>) request.getSession().getServletContext().getAttribute("invivoChars");
    setInvivoChars(new ArrayList<String>(invivo));

    if (availableEntityNames != null)
      this.availableEntityNames = new ArrayList<String>(Arrays.asList(availableEntityNames));

    // setSampleName(sampleBean.getDomain().getName());

    //		SortedSet<String> ca = (SortedSet<String>)
    // request.getSession().getServletContext().getAttribute("chemicalAssocs");
    //		this.chemicalAssocs = SampleUtil.getStringArrayFromSortedSet(ca);
    //				// SampleUtil.getDefaultListFromSessionByType("chemicalAssocs", request.getSession());
    //
    //
    //		this.caNano2MINChar = (Map<String, String>) request.getSession().getServletContext()
    //				.getAttribute("caNano2MINChar");
    //
    //		SortedSet<String> pc = (SortedSet<String>)
    // request.getSession().getServletContext().getAttribute("physicoChars");
    //		this.physicoChars = SampleUtil.getStringArrayFromSortedSet(pc);
    //		SortedSet<String> iv = (SortedSet<String>)
    // request.getSession().getServletContext().getAttribute("invitroChars");
    //		this.invitroChars = SampleUtil.getStringArrayFromSortedSet(iv);
    //		SortedSet<String> invivo = (SortedSet<String>)
    // request.getSession().getServletContext().getAttribute("invivoChars");
    //		this.invivoChars = SampleUtil.getStringArrayFromSortedSet(invivo);
    //

  }
コード例 #7
0
ファイル: CommServiceImpl.java プロジェクト: vpcaiyc/gw
  @Override
  public List<DictionaryData> findDictValue(String columnValue) throws Exception {

    Dictionary dictionary =
        (Dictionary) this.findByColumn(Dictionary.class.getName(), "code", columnValue).get(0);
    Set<DictionaryData> dictionaryDatas = dictionary.getDatas();
    List<DictionaryData> list =
        new ArrayList<DictionaryData>(Arrays.asList(dictionaryDatas.toArray()));
    // 对list排序,
    PropertyComparator.sort(list, new MutableSortDefinition("id", false, true));
    return list;
  }
コード例 #8
0
ファイル: Map.java プロジェクト: ZacariasRS/DBA---Practica2
  // Private because singleton
  private Map() {
    this.setPreferredSize(new Dimension(width * pixelWidth, height * pixelHeight));

    // Initially the map is completely unknown
    Arrays.fill(mapComposition, MapState.UNKNOWN);

    // Fill buffers with the according colors. We do this in the constructor instead
    // Of doing it at each repaint for optimization
    Arrays.fill(robotSurface, MapState.ROBOT.getColor().getRGB());
    Arrays.fill(unknownSurface, MapState.UNKNOWN.getColor().getRGB());
    Arrays.fill(knownSurface, MapState.KNOWN.getColor().getRGB());
    Arrays.fill(obstacleSurface, MapState.OBSTACLE.getColor().getRGB());
    Arrays.fill(goalSurface, MapState.GOAL.getColor().getRGB());

    // Show map in window
    SwingUtilities.invokeLater(
        new Runnable() {

          @Override
          public void run() {
            JFrame frame = new JFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.add(Map.getInstance());
            frame.pack();
            frame.setVisible(true);
          }
        });
  }
コード例 #9
0
  private URITemplate toTemplates(org.wso2.carbon.apimgt.api.model.xsd.URITemplate dto) {
    URITemplate template = new URITemplate();
    template.setAuthType(dto.getAuthType());
    template.setHTTPVerb(dto.getHTTPVerb());
    template.setResourceSandboxURI(dto.getResourceSandboxURI());
    template.setUriTemplate(dto.getUriTemplate());
    template.setThrottlingTier(dto.getThrottlingTier());

    ConditionGroupDTO[] xsdConditionGroups = dto.getConditionGroups();
    org.wso2.carbon.apimgt.api.dto.ConditionGroupDTO[] conditionGroups =
        new org.wso2.carbon.apimgt.api.dto.ConditionGroupDTO[xsdConditionGroups.length];

    for (short groupCounter = 0; groupCounter < xsdConditionGroups.length; groupCounter++) {
      org.wso2.carbon.apimgt.api.dto.ConditionGroupDTO conditionGroup =
          new org.wso2.carbon.apimgt.api.dto.ConditionGroupDTO();
      ConditionGroupDTO xsdConditionGroup = xsdConditionGroups[groupCounter];

      // Have to check nullity explicitly here because, in certain cases, length becomes 1 even when
      // there are
      // no elements in the array.
      if (xsdConditionGroup != null) {
        conditionGroup.setConditionGroupId(xsdConditionGroup.getConditionGroupId());
        ConditionDTO[] xsdConditions = xsdConditionGroup.getConditions();

        if (xsdConditions != null) {
          org.wso2.carbon.apimgt.api.dto.ConditionDTO[] conditions =
              new org.wso2.carbon.apimgt.api.dto.ConditionDTO[xsdConditions.length];
          for (short conditionCounter = 0;
              conditionCounter < xsdConditions.length;
              conditionCounter++) {

            ConditionDTO xsdCondition = xsdConditions[conditionCounter];
            if (xsdCondition != null) {
              org.wso2.carbon.apimgt.api.dto.ConditionDTO condition =
                  new org.wso2.carbon.apimgt.api.dto.ConditionDTO();
              condition.setConditionName(xsdCondition.getConditionName());
              condition.setConditionType(xsdCondition.getConditionType());
              condition.setConditionValue(xsdCondition.getConditionValue());
              conditions[conditionCounter] = condition;
            }
          }
          conditionGroup.setConditions(conditions);
        }
        conditionGroups[groupCounter] = conditionGroup;
      }
    }
    template.setConditionGroups(conditionGroups);
    template.setThrottlingConditions((Arrays.asList(dto.getThrottlingConditions())));
    return template;
  }
コード例 #10
0
  @Test
  public void testExecuteForResult() throws Exception {

    resourceService = Mockito.mock(ResourceService.class);
    responseGenerator = Mockito.mock(ResponseGenerator.class);

    addClusterCmd._resourceService = resourceService;
    addClusterCmd._responseGenerator = responseGenerator;

    Cluster cluster = Mockito.mock(Cluster.class);
    Cluster[] clusterArray = new Cluster[] {cluster};

    Mockito.when(resourceService.discoverCluster(addClusterCmd))
        .thenReturn(Arrays.asList(clusterArray));

    addClusterCmd.execute();
  }
コード例 #11
0
ファイル: SplitSYF.java プロジェクト: 1003771635/NC632
 /**
  * 拆分到汇兑损益应付单的表体(3条,4/4/2)
  *
  * @param listF
  * @param objSYF
  * @return
  */
 private List<ExchangeSyfBVO> splitToSyfBvos(Object[] objSYF, Object[] objF)
     throws BusinessException {
   ExchangeSyfBVO[] bvos = new ExchangeSyfBVO[3];
   int mainBill = 1; // 主
   int assistBill = 2; // 辅
   if ("PP".equals(objF[12]) || "月结".equals(objF[12])) {
     // 挂在业务员
     bvos[0] = SplitToSyfStartBVO(objF, assistBill);
     bvos[1] = SplitToSyfDesBVO(objF, assistBill);
     bvos[2] = SplitToSellmanBVO(objF, mainBill);
   } else {
     // 挂在目的地
     bvos[0] = SplitToSyfStartBVO(objF, assistBill);
     bvos[1] = SplitToSyfDesBVO(objF, mainBill);
     bvos[2] = SplitToSellmanBVO(objF, assistBill);
   }
   List<ExchangeSyfBVO> list = Arrays.asList(bvos);
   return list;
 }
コード例 #12
0
  /**
   * Checks whether all the elements in the idsAccessing array are found in the idsAllowed
   * Collection
   *
   * @param idsAccessing the ids the user is trying to access
   * @param idsAllowed the ids the user is allowed to access
   * @return whether all the elements are in the Collection
   */
  private boolean elementsInCollection(String[] idsAccessing, Collection<Workgroup> idsAllowed) {
    // convert the accessing array to a list
    List<String> idsAccessingList = Arrays.asList(idsAccessing);

    // convert the allowed Collection to a list
    List<String> idsAllowedList = new ArrayList<String>();

    // obtain an iterator for the Collection
    Iterator<Workgroup> idsAllowedIter = idsAllowed.iterator();

    // loop through all the Workgroups in the Collection
    while (idsAllowedIter.hasNext()) {
      // obtain the workgroup id from the Workgroup
      String idAllowed = idsAllowedIter.next().getId().toString();

      // add the workgroup id string to the list of allowed ids
      idsAllowedList.add(idAllowed);
    }

    // see if all the elements in the accessing list are in the allowed list
    return idsAllowedList.containsAll(idsAccessingList);
  }
コード例 #13
0
  protected void processData(final Context context, Bundle dataBundle) {
    if (dataBundle.containsKey(ContinuousProbe.EVENT_TIMESTAMP)
        && dataBundle.containsKey("X")
        && dataBundle.containsKey("Y")
        && dataBundle.containsKey("Z")) {
      double[] incomingTimes = dataBundle.getDoubleArray(ContinuousProbe.EVENT_TIMESTAMP);

      float[] incomingX = dataBundle.getFloatArray("X");
      float[] incomingY = dataBundle.getFloatArray("Y");
      float[] incomingZ = dataBundle.getFloatArray("Z");

      this.appendValues(incomingX, incomingY, incomingZ, incomingTimes);

      final long now = System.currentTimeMillis();

      final String key = this.featureKey();

      final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
      long updateInterval =
          Long.parseLong(
                  prefs.getString(
                      "config_probe_" + key + "_frequency",
                      XYZBasicFrequencyFeature.DEFAULT_FREQUENCY))
              * 1000;

      if (now - this._lastUpdate > updateInterval) // add last updated
      // check for config
      {
        this._lastUpdate = now;

        LinearInterpolator interpolator = new LinearInterpolator();

        double[] xs = _xValues;
        double[] ys = _yValues;
        double[] zs = _zValues;
        double[] ts = _timestamps;

        if (this._currentIndex < BUFFER_SIZE - 1) {
          xs = Arrays.copyOfRange(_xValues, 0, this._currentIndex);
          ys = Arrays.copyOfRange(_yValues, 0, this._currentIndex);
          zs = Arrays.copyOfRange(_zValues, 0, this._currentIndex);
          ts = Arrays.copyOfRange(_timestamps, 0, this._currentIndex);
        }

        // Log.e("PR", "FIRST RAW TIME: " + ts[0] + " LAST RAW TIME: " +
        // ts[ts.length - 1]);

        // Log.e("PR", "RAW TIME[0]: " + ts[0]);
        // Log.e("PR", "RAW TIME[1]: " + ts[1]);

        PolynomialSplineFunction fX = interpolator.interpolate(ts, xs);
        PolynomialSplineFunction fY = interpolator.interpolate(ts, ys);
        PolynomialSplineFunction fZ = interpolator.interpolate(ts, zs);

        // double lowFreq = 0.6;
        // double highFreq = 7.0;

        double durationOffset = ts[0];
        double bufferDuration = ts[ts.length - 1] - durationOffset;

        double interval = 1.0 / 120.0;

        // Log.e("PR", "TS/0: " + ts[0] + " -- TS/-1: " + ts[ts.length -
        // 1] + " -- LEN TS: " + ts.length);
        // Log.e("PR", "BD: " + bufferDuration + " INT: " + interval);

        int twoPow = ts.length == 0 ? 0 : (32 - Integer.numberOfLeadingZeros(ts.length - 1));
        int bufferSize = (int) Math.pow(2, twoPow);

        // Log.e("PR", "BUFF SIZE: " + bufferSize);

        final double[] _interX = new double[bufferSize];
        final double[] _interY = new double[bufferSize];
        final double[] _interZ = new double[bufferSize];

        Arrays.fill(_interX, 0.0);
        Arrays.fill(_interY, 0.0);
        Arrays.fill(_interZ, 0.0);

        interTimes = new double[bufferSize];

        for (int i = 0; i < bufferSize; i++) {
          interTimes[i] = durationOffset + (i * interval);

          // Log.e("PR", "TIME REQUEST: " + time);
          // Log.e("PR", "TIME DIFFERENCE: " + (oldTime - time));

          if (interTimes[i] > ts[ts.length - 1]) // If the current
            // timestamp is
            // greater than the
            // last recorded
            // timestamp, set it
            // to the last
            // timestamp
            interTimes[i] = ts[ts.length - 1];

          _interX[i] = fX.value(interTimes[i]);
          _interY[i] = fY.value(interTimes[i]);
          _interZ[i] = fZ.value(interTimes[i]);
        }

        // double timeDifference = interTimes[bufferSize - 1] -
        // interTimes[0];

        // Log.e("PR", "INTERP TIME: " + timeDifference +
        // " BUFFER SIZE: " + bufferSize);
        // Log.e("PR", "FIRST INTERP TIME: " + interTimes[0] +
        // " LAST INTERP TIME: " + interTimes[interTimes.length - 1]);

        // Log.e("PR", "INTERP SAMPLE: " + interX[bufferSize - 1] +
        // " - " + interY[bufferSize - 1] + " - " + interZ[bufferSize -
        // 1]);

        final double[] _dynamicX = new double[_interX.length];
        final double[] _dynamicY = new double[_interY.length];
        final double[] _dynamicZ = new double[_interZ.length];

        final double[] _staticX = new double[_interX.length];
        final double[] _staticY = new double[_interY.length];
        final double[] _staticZ = new double[_interZ.length];

        for (int i = 0; i < _interX.length; i++) {
          if (i < 2) {
            _dynamicX[i] = 0;
            _dynamicY[i] = 0;
            _dynamicZ[i] = 0;

            _staticX[i] = 0;
            _staticY[i] = 0;
            _staticZ[i] = 0;
          } else {
            if (i == _dynamicX.length - 1) {
              _dynamicX[i] = XYZBasicFrequencyFeature.bpFilter(_interX, this._xBPHistory, i, "X");
              _dynamicY[i] = XYZBasicFrequencyFeature.bpFilter(_interY, this._yBPHistory, i, "Y");
              _dynamicZ[i] = XYZBasicFrequencyFeature.bpFilter(_interZ, this._zBPHistory, i, "Z");

              _staticX[i] = XYZBasicFrequencyFeature.lpFilter(_interX, this._xLPHistory, i, "X");
              _staticY[i] = XYZBasicFrequencyFeature.lpFilter(_interY, this._yLPHistory, i, "Y");
              _staticZ[i] = XYZBasicFrequencyFeature.lpFilter(_interZ, this._zLPHistory, i, "Z");
            } else {
              _dynamicX[i] = XYZBasicFrequencyFeature.bpFilter(_interX, this._xBPHistory, i, null);
              _dynamicY[i] = XYZBasicFrequencyFeature.bpFilter(_interY, this._yBPHistory, i, null);
              _dynamicZ[i] = XYZBasicFrequencyFeature.bpFilter(_interZ, this._zBPHistory, i, null);

              _staticX[i] = XYZBasicFrequencyFeature.lpFilter(_interX, this._xLPHistory, i, null);
              _staticY[i] = XYZBasicFrequencyFeature.lpFilter(_interY, this._yLPHistory, i, null);
              _staticZ[i] = XYZBasicFrequencyFeature.lpFilter(_interZ, this._zLPHistory, i, null);
            }

            this._xBPHistory[1] = this._xBPHistory[0];
            this._xBPHistory[0] = _dynamicX[i];

            this._yBPHistory[1] = this._yBPHistory[0];
            this._yBPHistory[0] = _dynamicY[i];

            this._zBPHistory[1] = this._zBPHistory[0];
            this._zBPHistory[0] = _dynamicZ[i];

            this._xLPHistory[1] = this._xLPHistory[0];
            this._xLPHistory[0] = _staticX[i];

            this._yLPHistory[1] = this._yLPHistory[0];
            this._yLPHistory[0] = _staticY[i];

            this._zLPHistory[1] = this._zLPHistory[0];
            this._zLPHistory[0] = _staticZ[i];
          }
        }

        // Log.e("PR", "Inter Sample: " + _interX[_interX.length - 1] +
        // " - " + _interY[_interX.length - 1] + " - " +
        // _interZ[_interX.length - 1]);
        // Log.e("PR", "DY Sample: " + _dynamicX[_dynamicX.length - 1] +
        // " - " + _dynamicY[_dynamicX.length - 1] + " - " +
        // _dynamicZ[_interX.length - 1]);
        // Log.e("PR", "GR Sample: " + _staticX[_staticX.length - 1] +
        // " - " + _staticY[_staticY.length - 1] + " - " +
        // _staticZ[_staticZ.length - 1]);

        double observedFreq = _interX.length / bufferDuration; // (((double)
        // this._currentIndex)
        // /
        // bufferDuration);

        // Log.e("PR", "IL: + " + _interX.length + " / BD: " +
        // bufferDuration);
        // Log.e("PR", "OBS HZ: " + observedFreq);

        FastFourierTransformer fft = new FastFourierTransformer(DftNormalization.STANDARD);

        Complex[] xFFT = fft.transform(_dynamicX, TransformType.FORWARD);
        Complex[] yFFT = fft.transform(_dynamicY, TransformType.FORWARD);
        Complex[] zFFT = fft.transform(_dynamicZ, TransformType.FORWARD);

        double[] frequencies =
            XYZBasicFrequencyFeature.calculateFreqArray(_interX.length, observedFreq);

        final double[] _xMaxFreqPowPair =
            XYZBasicFrequencyFeature.findPeakFrequency(xFFT, frequencies);
        final double[] _yMaxFreqPowPair =
            XYZBasicFrequencyFeature.findPeakFrequency(yFFT, frequencies);
        final double[] _zMaxFreqPowPair =
            XYZBasicFrequencyFeature.findPeakFrequency(zFFT, frequencies);

        // Log.e("PR", "FREQS & GEEKS: x:" + _xMaxFreqPowPair[0] + " - "
        // + _xMaxFreqPowPair[1] + " y:" + _yMaxFreqPowPair[0] + " - " +
        // _yMaxFreqPowPair[1] + " z:" + _zMaxFreqPowPair[0] + " - " +
        // _zMaxFreqPowPair[1] );

        final XYZBasicFrequencyFeature me = this;

        Runnable r =
            new Runnable() {
              public void run() {
                Bundle data = new Bundle();

                data.putDouble("TIMESTAMP", now / 1000);
                data.putString("PROBE", me.name(context));

                boolean incInterpolated =
                    prefs.getBoolean(
                        "config_probe_" + key + "_interpolated_enabled",
                        XYZBasicFrequencyFeature.INTERPOLATED_ENABLED);
                boolean incBandpass =
                    prefs.getBoolean(
                        "config_probe_" + key + "_bandpass_enabled",
                        XYZBasicFrequencyFeature.BANDPASS_ENABLED);
                boolean incLowpass =
                    prefs.getBoolean(
                        "config_probe_" + key + "_lowpass_enabled",
                        XYZBasicFrequencyFeature.LOWPASS_ENABLED);

                if (incInterpolated || incBandpass || incLowpass) {
                  Bundle sensorData = new Bundle();

                  synchronized (me) {
                    sensorData.putDoubleArray("INTERP_TIMESTAMPS", interTimes);

                    if (incInterpolated) {
                      sensorData.putDoubleArray("INTER_X", _interX);
                      sensorData.putDoubleArray("INTER_Y", _interY);
                      sensorData.putDoubleArray("INTER_Z", _interZ);
                    }

                    if (incBandpass) {
                      sensorData.putDoubleArray("DYNAMIC_X", _dynamicX);
                      sensorData.putDoubleArray("DYNAMIC_Y", _dynamicY);
                      sensorData.putDoubleArray("DYNAMIC_Z", _dynamicZ);
                    }

                    if (incLowpass) {
                      sensorData.putDoubleArray("STATIC_X", _staticX);
                      sensorData.putDoubleArray("STATIC_Y", _staticY);
                      sensorData.putDoubleArray("STATIC_Z", _staticZ);
                    }

                    data.putBundle("CALCULATIONS", sensorData);
                  }
                }

                data.putDouble("WINDOW_TIMESTAMP", interTimes[0]);

                data.putDouble("POWER_X", _xMaxFreqPowPair[1]);
                data.putDouble("POWER_Y", _yMaxFreqPowPair[1]);
                data.putDouble("POWER_Z", _zMaxFreqPowPair[1]);

                data.putDouble("FREQ_X", _xMaxFreqPowPair[0]);
                data.putDouble("FREQ_Y", _yMaxFreqPowPair[0]);
                data.putDouble("FREQ_Z", _zMaxFreqPowPair[0]);

                me.transmitData(context, data);
              }
            };

        Thread t = new Thread(r);

        t.start();
      }
    }
  }