text:
.class public final Landroid/hardware/hdmi/HdmiPlaybackClient;
.super Landroid/hardware/hdmi/HdmiClient;
.source "HdmiPlaybackClient.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/hardware/hdmi/HdmiPlaybackClient$OneTouchPlayCallback;,
        Landroid/hardware/hdmi/HdmiPlaybackClient$DisplayStatusCallback;
    }
.end annotation

# static fields
.field private static final ADDR_TV:I = 0x0

.field private static final TAG:Ljava/lang/String; = "HdmiPlaybackClient"

# direct methods
.method constructor <init>(Landroid/hardware/hdmi/IHdmiControlService;)V
    .registers 2
    .param p1, "service"    # Landroid/hardware/hdmi/IHdmiControlService;

    .prologue
    .line 71
    invoke-direct {p0, p1}, Landroid/hardware/hdmi/HdmiClient;-><init>(Landroid/hardware/hdmi/IHdmiControlService;)V

    .line 70
    return-void
.end method

.method private getCallbackWrapper(Landroid/hardware/hdmi/HdmiPlaybackClient$DisplayStatusCallback;)Landroid/hardware/hdmi/IHdmiControlCallback;
    .registers 3
    .param p1, "callback"    # Landroid/hardware/hdmi/HdmiPlaybackClient$DisplayStatusCallback;

    .prologue
    .line 130
    new-instance v0, Landroid/hardware/hdmi/HdmiPlaybackClient$2;

    invoke-direct {v0, p0, p1}, Landroid/hardware/hdmi/HdmiPlaybackClient$2;-><init>(Landroid/hardware/hdmi/HdmiPlaybackClient;Landroid/hardware/hdmi/HdmiPlaybackClient$DisplayStatusCallback;)V

    return-object v0
.end method

.method private getCallbackWrapper(Landroid/hardware/hdmi/HdmiPlaybackClient$OneTouchPlayCallback;)Landroid/hardware/hdmi/IHdmiControlCallback;
    .registers 3
    .param p1, "callback"    # Landroid/hardware/hdmi/HdmiPlaybackClient$OneTouchPlayCallback;

    .prologue
    .line 121
    new-instance v0, Landroid/hardware/hdmi/HdmiPlaybackClient$1;

    invoke-direct {v0, p0, p1}, Landroid/hardware/hdmi/HdmiPlaybackClient$1;-><init>(Landroid/hardware/hdmi/HdmiPlaybackClient;Landroid/hardware/hdmi/HdmiPlaybackClient$OneTouchPlayCallback;)V

    return-object v0
.end method

# virtual methods
.method public getDeviceType()I
    .registers 2

    .prologue
    .line 92
    const/4 v0, 0x4

    return v0
.end method

.method public oneTouchPlay(Landroid/hardware/hdmi/HdmiPlaybackClient$OneTouchPlayCallback;)V
    .registers 5
    .param p1, "callback"    # Landroid/hardware/hdmi/HdmiPlaybackClient$OneTouchPlayCallback;

    .prologue
    .line 84
    :try_start_0
    iget-object v1, p0, Landroid/hardware/hdmi/HdmiPlaybackClient;->mService:Landroid/hardware/hdmi/IHdmiControlService;

    invoke-direct {p0, p1}, Landroid/hardware/hdmi/HdmiPlaybackClient;->getCallbackWrapper(Landroid/hardware/hdmi/HdmiPlaybackClient$OneTouchPlayCallback;)Landroid/hardware/hdmi/IHdmiControlCallback;

    move-result-object v2

    invoke-interface {v1, v2}, Landroid/hardware/hdmi/IHdmiControlService;->oneTouchPlay(Landroid/hardware/hdmi/IHdmiControlCallback;)V
    :try_end_9
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_9} :catch_a

    .line 81
    :goto_9
    return-void

    .line 85
    :catch_a
    move-exception v0

    .line 86
    .local v0, "e":Landroid/os/RemoteException;
    const-string/jumbo v1, "HdmiPlaybackClient"

    const-string/jumbo v2, "oneTouchPlay threw exception "

    invoke-static {v1, v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_9
.end method

.method public queryDisplayStatus(Landroid/hardware/hdmi/HdmiPlaybackClient$DisplayStatusCallback;)V
    .registers 5
    .param p1, "callback"    # Landroid/hardware/hdmi/HdmiPlaybackClient$DisplayStatusCallback;

    .prologue
    .line 103
    :try_start_0
    iget-object v1, p0, Landroid/hardware/hdmi/HdmiPlaybackClient;->mService:Landroid/hardware/hdmi/IHdmiControlService;

    invoke-direct {p0, p1}, Landroid/hardware/hdmi/HdmiPlaybackClient;->getCallbackWrapper(Landroid/hardware/hdmi/HdmiPlaybackClient$DisplayStatusCallback;)Landroid/hardware/hdmi/IHdmiControlCallback;

    move-result-object v2

    invoke-interface {v1, v2}, Landroid/hardware/hdmi/IHdmiControlService;->queryDisplayStatus(Landroid/hardware/hdmi/IHdmiControlCallback;)V
    :try_end_9
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_9} :catch_a

    .line 101
    :goto_9
    return-void

    .line 104
    :catch_a
    move-exception v0

    .line 105
    .local v0, "e":Landroid/os/RemoteException;
    const-string/jumbo v1, "HdmiPlaybackClient"

    const-string/jumbo v2, "queryDisplayStatus threw exception "

    invoke-static {v1, v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_9
.end method

.method public sendStandby()V
    .registers 5

    .prologue
    .line 114
    :try_start_0
    iget-object v1, p0, Landroid/hardware/hdmi/HdmiPlaybackClient;->mService:Landroid/hardware/hdmi/IHdmiControlService;

    invoke-virtual {p0}, Landroid/hardware/hdmi/HdmiPlaybackClient;->getDeviceType()I

    move-result v2

    const/4 v3, 0x0

    invoke-static {v3}, Landroid/hardware/hdmi/HdmiDeviceInfo;->idForCecDevice(I)I

    move-result v3

    invoke-interface {v1, v2, v3}, Landroid/hardware/hdmi/IHdmiControlService;->sendStandby(II)V
    :try_end_e
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_e} :catch_f

    .line 112
    :goto_e
    return-void

    .line 115
    :catch_f
    move-exception v0

    .line 116
    .local v0, "e":Landroid/os/RemoteException;
    const-string/jumbo v1, "HdmiPlaybackClient"

    const-string/jumbo v2, "sendStandby threw exception "

    invoke-static {v1, v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_e
.end method

redpajama_set_name: RedPajamaGithub


text:
/// Copyright (c) 2012 Ecma International.  All rights reserved.
/**
 * @path ch15/15.2/15.2.3/15.2.3.6/15.2.3.6-4-294.js
 * @description Object.defineProperty - 'O' is an Arguments object, 'name' is own data property of 'O', test TypeError is thrown when updating the [[Writable]] attribute value of 'name' which is defined as non-configurable (10.6 [[DefineOwnProperty]] step 4)
 */

function testcase() {
        return (function () {
            Object.defineProperty(arguments, "0", {
                value: 10,
                writable: false,
                enumerable: false,
                configurable: false
            });
            try {
                Object.defineProperty(arguments, "0", {
                    writable: true
                });
            } catch (e) {
                return e instanceof TypeError && dataPropertyAttributesAreCorrect(arguments, "0", 10, false, false, false);
            }
            return false;
        }(0, 1, 2));
    }
runTestCase(testcase);


text:
/**
 * @file   Registration-Fusion-MRF.h
 * @author Tobias Gass <tobiasgass@gmail.com>
 * @date   Thu Mar 12 11:39:15 2015
 *
 * @brief  This file implements a class to fuse registrations using MRFs
 *
 *
 */

#pragma once

#include <stdio.h>
#include <iostream>

#include "ArgumentParser.h"
#include "Log.h"
#include <vector>
#include <map>
#include "itkImageRegionIterator.h"
#include "TransformationUtils.h"
#include "ImageUtils.h"
#include "FilterUtils.hpp"
#include <sstream>
#include <string>
#include "ArgumentParser.h"
#include <fstream>
#include <sys/stat.h>
#include <sys/types.h>
#include "itkConstNeighborhoodIterator.h"
#include "itkDisplacementFieldTransform.h"
#include "itkNormalizedCorrelationImageToImageMetric.h"
#include "itkMeanSquaresImageToImageMetric.h"
#include "itkMattesMutualInformationImageToImageMetric.h"
#include "itkNormalizedMutualInformationHistogramImageToImageMetric.h"
#include "itkLinearInterpolateImageFunction.h"
#include <itkAddImageFilter.h>
#include "Metrics.h"
#include "itkLabelOverlapMeasuresImageFilter.h"
#include "MRFRegistrationFuser.h"
#include <itkDisplacementFieldJacobianDeterminantFilter.h>
#include "SegmentationMapper.hxx"
#include "itkHistogramMatchingImageFilter.h"

namespace MRegFuse{

  /**
   * @brief  Registration fusion of multiple registration hypotheses between two images,  using MRF and optionally LWA fusion
   */
  template <class ImageType>
    class RegistrationFusionMRF{
  public:
    typedef typename ImageType::PixelType PixelType;
    static const unsigned int D=ImageType::ImageDimension;
    typedef typename  ImageType::Pointer ImagePointerType;
    typedef typename  ImageType::IndexType IndexType;
    typedef typename  ImageType::PointType PointType;
    typedef typename  ImageType::OffsetType OffsetType;
    typedef typename  ImageType::SizeType SizeType;
    typedef typename  ImageType::ConstPointer ImageConstPointerType;
    typedef typename  ImageUtils<ImageType,double>::FloatImageType FloatImageType;
    typedef typename  FloatImageType::Pointer FloatImagePointerType;

    typedef typename  TransfUtils<ImageType>::DisplacementType DisplacementType;
    typedef typename  TransfUtils<ImageType>::DeformationFieldType DeformationFieldType;
    typedef typename  DeformationFieldType::Pointer DeformationFieldPointerType;
    typedef typename  itk::ImageRegionIterator<ImageType> ImageIteratorType;
    typedef typename  itk::ImageRegionIterator<FloatImageType> FloatImageIteratorType;
    typedef typename  itk::ImageRegionIterator<DeformationFieldType> DeformationIteratorType;
    typedef typename  itk::ConstNeighborhoodIterator<ImageType> ImageNeighborhoodIteratorType;
    typedef   ImageNeighborhoodIteratorType * ImageNeighborhoodIteratorPointerType;
    typedef typename  ImageNeighborhoodIteratorType::RadiusType RadiusType;

    typedef MRFRegistrationFuser<ImageType,double> RegistrationFuserType;
    typedef typename itk::DisplacementFieldJacobianDeterminantFilter<DeformationFieldType,double> DisplacementFieldJacobianDeterminantFilterType;

    typedef typename itk::AddImageFilter<DeformationFieldType,DeformationFieldType,DeformationFieldType> DeformationAddFilterType;
    typedef map<string,ImagePointerType> ImageCacheType;
    typedef map<string, map< string, string> > FileListCacheType;
    enum MetricType {MAD,NCC,MSD};
    enum WeightingType {UNIFORM,GLOBAL,LOCAL};
  protected:
    double m_gamma;
    RadiusType m_patchRadius;
  public:
    int run(int argc, char ** argv){
      feraiseexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW);
      ArgumentParser * as=new ArgumentParser(argc,argv);
      string inputDeformationFilenames,targetFileName,sourceFileName,trueDefFilename="",targetSegmentationFilename="",sourceSegmentationFilename="",targetLandmarkFilename="",sourceLandmarkFilename="";
      int verbose=0;
      double pWeight=1.0;
      int radius=3;
      double controlGridSpacingFactor=4;
      int maxHops=1;
      bool uniformUpdate=true;
      string metricName="NCC";
      string weightingName="local";
      bool lateFusion=false;
      bool dontCacheDeformations=false;
      bool graphCut=false;
      double smoothness=1.0;
      double alpha=0;
      m_gamma=10;
      double m_pairwiseWeight=1.0;
      bool useHardConstraints=false;
      bool m_refineSolution=false;
      bool estimateMRF=false,estimateMean=false;
      int refineIter=0;
      int refineSeamIter=0;
      string outputFilename;
      bool histNorm=false;
      string outputDir="./";
      bool anisoSmoothing=false;
      int nKernels=20;
      double smoothIncrease=1.2;
      bool useMaskForSSR=false;
      //as->parameter ("A",atlasSegmentationFileList , "list of atlas segmentations <id> <file>", true);
      as->option ("MRF", estimateMRF, "use MRF fusion");
      as->option ("mean", estimateMean, "use (local) mean fusion. Can be used in addition to MRF or stand-alone.");
      as->parameter ("T", inputDeformationFilenames, "list of deformations (comma separated)", true);
      as->parameter ("t", targetFileName, " target image filename", true);
      as->parameter ("s", sourceFileName, " source image filename", true);
      as->parameter ("true", trueDefFilename, "  TRUE deformation filename", false);
      as->parameter ("o", outputFilename , "output filename prefix ", false);

      as->parameter ("st",targetSegmentationFilename , "target segmentation filename", false);
      as->parameter ("ss",sourceSegmentationFilename , "source segmentation filename", false);
      as->parameter ("lt",targetLandmarkFilename , " target landmark filename", false);
      as->parameter ("ls",sourceLandmarkFilename , " source landmark filename", false);

      //as->parameter ("W", weightListFilename,"list of weights for deformations",false);
      as->parameter ("metric", metricName,"metric to be used for global or local weighting, valid: NONE,SAD,MSD,NCC,MI,NMI",false);
      as->parameter ("weighting", weightingName,"internal weighting scheme {uniform,local,global}. non-uniform will only work with metric != NONE",false);
      as->parameter ("g", m_gamma,"gamma for exp(- metric/gamma)[SSD,SAD,..] or metric^gamma [NCC]",false);
      as->parameter ("w", m_pairwiseWeight,"pairwise weight for MRF",false);
      as->parameter ("radius", radius,"patch radius for local metrics",false);
      as->parameter ("controlGridSpacing", controlGridSpacingFactor,"Resolution of the MRF control grid, obtained by dividing the input image resolution by this factor.",false);
      as->option ("hardConstraints", useHardConstraints,"Use hard constraints in the MRF to prevent folding.");
      as->parameter ("refineIter", refineIter,"refine MRF solution by adding the result as new labels to the MRF and re-solving until convergence.",false);
      as->parameter ("refineSeamIter", refineSeamIter,"refine MRF solution at seams by smoothing the result and fusing it with the original solution.",false);
      as->parameter ("smoothIncrease", smoothIncrease,"factor to increase smoothing with per iteration for SSR.",false);
      as->option ("useMask", useMaskForSSR,"only update pixels with negative jac dets (or in the vincinity of those) when using SSR.");
      as->parameter ("O", outputDir,"outputdirectory (will be created + no overwrite checks!)",false);
      as->parameter ("maxHops", maxHops,"maximum number of hops",false);
      as->parameter ("alpha", alpha,"pairwise balancing weight (deformation (alpha=0) vs label smoothness (alpha=1))",false);
      as->option ("dontCacheDeformations", dontCacheDeformations,"read deformations only when needed to save memory. higher IO load!");
      as->option ("histNorm", histNorm,"Match source histogram to target histogram!");
      as->option ("anisoSmooth", anisoSmoothing,"Anisotropically penalize unsmooth deformations, using statistics from the input");

      //        as->option ("graphCut", graphCut,"use graph cuts to generate final segmentations instead of locally maximizing");
      //as->parameter ("smoothness", smoothness,"smoothness parameter of graph cut optimizer",false);
      as->parameter ("verbose", verbose,"get verbose output",false);
      as->help();
      as->parse();

      if (!estimateMRF && !estimateMean){
	LOG<<"Neither MRF nor mean estimation activated, will compute metrics for original deformations and exit"<<endl;
	maxHops=1;
	//estimateMRF=true;
      }
      LOG<<VAR(estimateMRF)<<" "<<VAR(estimateMean)<<endl;
      for (unsigned int i = 0; i < ImageType::ImageDimension; ++i) m_patchRadius[i] = radius;

      mkdir(outputDir.c_str(),0755);
      logSetStage("IO");
      logSetVerbosity(verbose);

      MetricType metric;
     if (metricName=="MSD")
	metric=MSD;
      else if (metricName=="MAD")
	metric=MAD;
      else if (metricName=="NCC")
	metric=NCC;
      else{
	LOG<<"don't understand "<<metricName<<", aborting"<<endl;
	exit(0);
      }
      WeightingType weighting;
      if (weightingName=="uniform" ){
	weighting=UNIFORM;}
      else if (weightingName=="global")
	weighting=GLOBAL;
      else if (weightingName=="local"){
	weighting=LOCAL;

      }
      else{
	LOG<<"don't understand "<<VAR(weightingName)<<", defaulting to uniform."<<endl;
	weighting=UNIFORM;
      }

      if (metric==MAD || metric==MSD){
	if (m_gamma ==0.0){
	  weighting=UNIFORM;
	}
      }

      ImagePointerType targetImage=ImageUtils<ImageType>::readImage(targetFileName);
      ImagePointerType sourceImage=ImageUtils<ImageType>::readImage(sourceFileName);

      if (histNorm){
	typedef itk::HistogramMatchingImageFilter<ImageType,ImageType> HEFilterType;
	typename HEFilterType::Pointer IntensityEqualizeFilter = HEFilterType::New();
	IntensityEqualizeFilter->SetReferenceImage(targetImage  );
	IntensityEqualizeFilter->SetInput( sourceImage );
	IntensityEqualizeFilter->SetNumberOfHistogramLevels( 100);
	IntensityEqualizeFilter->SetNumberOfMatchPoints( 15);
	IntensityEqualizeFilter->ThresholdAtMeanIntensityOn();
	IntensityEqualizeFilter->Update();
	sourceImage=IntensityEqualizeFilter->GetOutput();
      }
      //split comma separated list
      std::stringstream   myStream( inputDeformationFilenames );
      char          temp[1000];
      const char * cdelim=",";
      char delim=*cdelim;
      std::vector<std::string> inputDeformationFilenameList;
      while( myStream.getline(temp, 1000,delim) ){ // getline( myStream , temp, delim ) ) {
	inputDeformationFilenameList.push_back( temp );
	LOGV(1)<<temp<<endl;
      }

      int nDeformations=inputDeformationFilenameList.size();
      RegistrationFuserType estimator;
      estimator.setAlpha(alpha);
      estimator.setPairwiseWeight(m_pairwiseWeight);
      estimator.setGridSpacing(controlGridSpacingFactor);
      estimator.setHardConstraints(useHardConstraints);
      estimator.setAnisoSmoothing(anisoSmoothing);
      GaussianEstimatorVectorImage<ImageType,double> meanEstimator;
      DeformationFieldPointerType result;
      for (int i=0;i<nDeformations;++i){
	DeformationFieldPointerType def=ImageUtils<DeformationFieldType>::readImage(inputDeformationFilenameList[i]);
	FloatImagePointerType weightImage=addImage(weightingName,metric,estimator,meanEstimator,targetImage,sourceImage,def,estimateMean,estimateMRF,radius,m_gamma);
	if (weightImage.IsNotNull() && outputDir!=""){
	  ostringstream oss;
	  string fName=inputDeformationFilenameList[i];
	  replace(fName.begin(), fName.end(), '/', '_' );
	  LOG<<VAR(fName)<<endl;
	  oss<<outputDir<<"/"<<outputFilename<<"-weights-"<<fName;
	  LOGI(2,ImageUtils<FloatImageType>::writeImage(oss.str(),weightImage));
	}
      }
      double m_energy=0.0;
      double relativeClosenessToLB;
      ImagePointerType labelImage;
      if (estimateMean)
	meanEstimator.finalize();

      if (! estimateMRF){
	DeformationFieldPointerType meanDef=meanEstimator.getMean();
	result=meanDef;
      }else{

	if (estimateMean){
	  DeformationFieldPointerType meanDef=meanEstimator.getMean();
	  addImage(weightingName,metric,estimator,meanEstimator,targetImage,sourceImage,meanDef,estimateMean,estimateMRF,radius,m_gamma);

	}

	estimator.finalize();
	double energy=estimator.solve();
	labelImage=estimator.getLabelImage();
	result=estimator.getMean();
	relativeClosenessToLB=estimator.getRelativeLB();

	LOGV(1)<<VAR(energy)<<endl;
	if (refineSeamIter>0){

	  typename DisplacementFieldJacobianDeterminantFilterType::Pointer jacobianFilter = DisplacementFieldJacobianDeterminantFilterType::New();
	  jacobianFilter->SetInput(result);
	  jacobianFilter->SetUseImageSpacingOff();
	  jacobianFilter->Update();
	  FloatImagePointerType jac=jacobianFilter->GetOutput();
	  double minJac = FilterUtils<FloatImageType>::getMin(jac);
	  if (minJac<0.0){
	    if (outputDir!=""){
	      ostringstream oss2;
	      oss2<<outputDir<<"/"<<outputFilename<<"-jacobianDetWithNegVals.mha";
	      LOGI(3,ImageUtils<FloatImageType>::writeImage(oss2.str(),jac));
	    }

	    LOG<<"Refining seams by smoothing solution with "<<nKernels<<" kernels.."<<endl;
	    DeformationFieldPointerType originalFusionResult=result;
	    RegistrationFuserType seamEstimator;
	    double kernelBaseWidth=0.5;//1.0;//pow(-1.0*minJac,1.0/D);

	    seamEstimator.setAlpha(alpha);
	    seamEstimator.setGridSpacing(controlGridSpacingFactor);
	    seamEstimator.setHardConstraints(useHardConstraints);
	    seamEstimator.setAnisoSmoothing(false);
	    //seamEstimator.setAlpha(pow(2.0,1.0*iter)*alpha);

	    //hacky shit to avoid oversmoothing
	    FloatImagePointerType weights=addImage(weightingName,metric,estimator,meanEstimator,targetImage,sourceImage,originalFusionResult,false,estimateMRF,radius,m_gamma);
	    seamEstimator.addImage(estimator.getLowResResult(),weights);
	    //kernelSigmas= kernelBaseWidth/4,kbw/2,kbw,2*kbw,4*kbw
	    int k=0;
	    double kernelSigma;
	    double previousSigma=0.0;
	    kernelBaseWidth=0.5;
	    double exp=2;
	    DeformationFieldPointerType smoothedResult=result;
#ifdef USELOCALSIGMASFORDILATION
	    ImagePointerType negJacMaskPrevious=FilterUtils<FloatImageType,ImageType>::binaryThresholdingHigh(jac,0.0);
	    FloatImagePointerType localKernelWidths=ImageUtils<FloatImageType>::duplicate(jac);
	    localKernelWidths->FillBuffer(0.0);
#endif
	    for (;k<nKernels;++k){

	      kernelSigma=kernelBaseWidth*pow(exp,1.0*(k));
	      double actualSigma=sqrt(pow(kernelSigma,2.0)-pow(previousSigma,2.0));
	      LOGV(3)<<VAR(kernelSigma)<<" "<<VAR(actualSigma)<<endl;
	      smoothedResult=TransfUtils<ImageType>::gaussian(smoothedResult,actualSigma);
	      previousSigma=actualSigma;
	      addImage(weightingName,metric,seamEstimator,meanEstimator,targetImage,sourceImage,smoothedResult,false,estimateMRF,radius,m_gamma);
	      typename DisplacementFieldJacobianDeterminantFilterType::Pointer jacobianFilter = DisplacementFieldJacobianDeterminantFilterType::New();
	      jacobianFilter->SetInput(smoothedResult);
	      jacobianFilter->SetUseImageSpacingOff();
	      jacobianFilter->Update();
	      FloatImagePointerType jac=jacobianFilter->GetOutput();
	      if (outputDir!=""){
		ostringstream oss2;
		oss2<<outputDir<<"/"<<outputFilename<<"-jacobianDetWithNegVals-sigma"<<actualSigma<<".mha";
		LOGV(3)<<"Saving jac to " << oss2.str()<<endl;
		LOGI(3,ImageUtils<FloatImageType>::writeImage(oss2.str(),jac));
	      }
	      double minJac2 = FilterUtils<FloatImageType>::getMin(jac);
	      LOGV(3)<<VAR(minJac2)<<endl;
#ifdef USELOCALSIGMASFORDILATION
	      //get negative jacobian value locations
	      ImagePointerType negJacMask=FilterUtils<FloatImageType,ImageType>::binaryThresholdingHigh(jac,0.0);
	      //subtract and invert to get locations of removed negative JDs
	      //ImagePointerType removedNegJacMask=(FilterUtils<ImageType>::substract(negJacMaskPrevious,negJacMask));
	      ImagePointerType removedNegJacMask=FilterUtils<ImageType>::binaryThresholding(FilterUtils<ImageType>::add(negJacMaskPrevious,negJacMask),1,1);
	      //ImagePointerType removedNegJacMask=FilterUtils<ImageType>::binaryThresholdingHigh(FilterUtils<ImageType>::add(negJacMaskPrevious,negJacMask),1);
	      //create image with sigma at locations where nJDs were removed
	      FloatImagePointerType kernelWidthForRemovednJDs=ImageUtils<FloatImageType>::createEmpty(jac);
	      kernelWidthForRemovednJDs->FillBuffer(3.0*kernelSigma);
	      kernelWidthForRemovednJDs=ImageUtils<FloatImageType>::multiplyImageOutOfPlace(kernelWidthForRemovednJDs,FilterUtils<ImageType,FloatImageType>::cast(removedNegJacMask));
	      //add to localKernelWidths image
	      LOGI(3,ImageUtils<FloatImageType>::writeImage("localKernelWidths-New.nii",kernelWidthForRemovednJDs));
	      LOGI(3,ImageUtils<FloatImageType>::writeImage("localKernelWidths-old.nii",localKernelWidths));

	      localKernelWidths=FilterUtils<FloatImageType>::add(localKernelWidths,kernelWidthForRemovednJDs);

	      negJacMaskPrevious=negJacMask;
#endif
	      if (minJac2>0.1)
		break;
	    }
	    LOG<<"Actual number of kernels: "<<VAR(k)<<endl;
	    LOGV(3)<<VAR(minJac)<<" "<<VAR(minJac/kernelSigma)<<" "<<VAR(kernelSigma)<<endl;
#ifdef USELOCALSIGMASFORDILATION
	    LOGI(3,ImageUtils<FloatImageType>::writeImage("localKernelWidths.nii",localKernelWidths));
#endif
	    seamEstimator.setPairwiseWeight(m_pairwiseWeight);
	    seamEstimator.finalize();
#ifdef USELOCALSIGMASFORDILATION
	    energy=seamEstimator.solveUntilPosJacDet(refineSeamIter,smoothIncrease,useMaskForSSR,localKernelWidths);
#else
	    energy=seamEstimator.solveUntilPosJacDet(refineSeamIter,smoothIncrease,useMaskForSSR,50);
#endif
	    result=seamEstimator.getMean();
	  }//actual neg jac
	}//refine seams
	for (int iter=0;iter<refineIter;++iter){
	  //estimator.setAlpha(pow(2.0,1.0*iter)*alpha);
	  addImage(weightingName,metric,estimator,meanEstimator,targetImage,sourceImage,result,false,estimateMRF,radius,m_gamma);
	  estimator.finalize();
	  double newEnergy=estimator.solve();
	  LOGV(1)<<VAR(iter)<<" "<<VAR(newEnergy)<<" "<<(energy-newEnergy)/energy<<endl;
	  if (newEnergy >energy )
	    break;
	  result=estimator.getMean();
	  if ( (energy-newEnergy)/energy < 1e-4) {
	    LOGV(1)<<"refinement converged, stopping."<<endl;
	    break;
	  }
	  energy=newEnergy;

	}
	estimator.setAlpha(alpha);

	m_energy+=energy;
      }

      if (outputDir!=""){
	ostringstream oss;
	oss<<outputDir<<"/"<<outputFilename<<"-avgDeformation.mha";
	if (result.IsNotNull())
	  ImageUtils<DeformationFieldType>::writeImage(oss.str(),result);
	if (estimateMRF && labelImage.IsNotNull()){
	  ostringstream oss2;
	  oss2<<outputDir<<"/"<<outputFilename<<"-labelImage.nii";
	  LOGI(1,ImageUtils<ImageType>::writeImage(oss2.str(),labelImage));
	}

      }
      double m_dice=0.0;
      double m_TRE=0.0;
      double m_similarity=0.0;
      double m_averageMinJac=0;
      double m_minMinJacobian=100000000;
      if (targetLandmarkFilename!="" && sourceLandmarkFilename!="" ){
	//hope that all landmark files are available :D
	m_TRE+=TransfUtils<ImageType>::computeTRE(targetLandmarkFilename, sourceLandmarkFilename,result,targetImage);
      }

      if (targetSegmentationFilename!="" && sourceSegmentationFilename!=""){
	ImagePointerType targetSegmentation=ImageUtils<ImageType>::readImage(targetSegmentationFilename);
	ImagePointerType sourceSegmentation=ImageUtils<ImageType>::readImage(sourceSegmentationFilename);
	ImagePointerType deformedSeg=TransfUtils<ImageType>::warpImage(  sourceSegmentation , result ,true);
	SegmentationMapper<ImageType> segmentationMapper;

	ImagePointerType groundTruthImg=segmentationMapper.FindMapAndApplyMap(targetSegmentation);
	ImagePointerType segmentedImg=segmentationMapper.ApplyMap(deformedSeg);
	double dice=0.0;
	for (int i=1;i<segmentationMapper.getNumberOfLabels();++i){
	  typedef typename itk::LabelOverlapMeasuresImageFilter<ImageType> OverlapMeasureFilterType;
	  typename OverlapMeasureFilterType::Pointer filter = OverlapMeasureFilterType::New();
	  filter->SetSourceImage(FilterUtils<ImageType>::select(groundTruthImg,i));
	  filter->SetTargetImage(FilterUtils<ImageType>::select(segmentedImg,i));
	  filter->SetCoordinateTolerance(1e-4);
	  filter->Update();
	  dice+=filter->GetDiceCoefficient();
	}
	dice/=(segmentationMapper.getNumberOfLabels()-1.0);
	//LOGV(1)<<VAR(sourceID)<<" "<<VAR(targetID)<<" "<<VAR(dice)<<endl;
	m_dice+=dice;
      }
      double similarity;
      ImagePointerType warpedSourceImage=TransfUtils<ImageType>::warpImage(sourceImage,result);
      switch(metric){
      case NCC:
	similarity=Metrics<ImageType,FloatImageType>::nCC(warpedSourceImage,targetImage);
	break;
      case MSD:
	similarity=Metrics<ImageType,FloatImageType>::msd(warpedSourceImage,targetImage);
	break;
      case MAD:
	similarity=Metrics<ImageType,FloatImageType>::mad(warpedSourceImage,targetImage);
	break;
      }
      typename DisplacementFieldJacobianDeterminantFilterType::Pointer jacobianFilter = DisplacementFieldJacobianDeterminantFilterType::New();
      jacobianFilter->SetInput(result);
      jacobianFilter->SetUseImageSpacingOff();
      jacobianFilter->Update();
      FloatImagePointerType jac=jacobianFilter->GetOutput();
      if (outputDir!="" && jac.IsNotNull()){
	ostringstream filename;
	filename<<outputDir<<"/"<<outputFilename<<"-jacobian.mha";
	LOGI(1,ImageUtils<FloatImageType>::writeImage(filename.str(),jac));
      }
      double minJac = FilterUtils<FloatImageType>::getMin(jac);
      double maxJac = FilterUtils<FloatImageType>::getMax(jac);
      //LOGV(2)<<VAR(sourceID)<<" "<<VAR(targetID)<< " " << VAR(minJac) <<" " <<VAR(nCC)<<endl;
      m_averageMinJac+=minJac;
      if (minJac<m_minMinJacobian){
	m_minMinJacobian=minJac;
      }
      double error=0;

      if (trueDefFilename!=""){
	DeformationFieldPointerType trueDef=ImageUtils<DeformationFieldType>::readImage(trueDefFilename);

	ImagePointerType mask=TransfUtils<ImageType>::createEmptyImage(trueDef);
	mask->FillBuffer(0);
	typename ImageType::SizeType size=mask->GetLargestPossibleRegion().GetSize();
	IndexType offset;
	double fraction=0.9;
	for (int d=0;d<D;++d){
	  offset[d]=(1.0-fraction)/2*size[d];
	  size[d]=fraction*size[d];
	}

	typename ImageType::RegionType region;
	region.SetSize(size);
	region.SetIndex(offset);
	LOGV(6)<<VAR(region)<<endl;
	ImageUtils<ImageType>::setRegion(mask,region,1);
	DeformationFieldPointerType diff=TransfUtils<ImageType>::subtract(result,trueDef);
	//error=TransfUtils<ImageType>::computeDeformationNormMask(diff,mask);
	error=TransfUtils<ImageType>::computeDeformationNorm(diff);
      }
      LOG <<VAR(error)<<" "<<VAR(m_TRE)<<" "<<VAR(m_dice)<<" "<<VAR(m_energy)<<" "<<VAR(relativeClosenessToLB)<<" "<<VAR(similarity)<<" "<<VAR(minJac)<<" "<<VAR(maxJac)<<endl;

    }//run
  protected:

    FloatImagePointerType addImage(string weighting, MetricType metric,RegistrationFuserType & estimator,  GaussianEstimatorVectorImage<ImageType,double> & meanEstimator, ImagePointerType targetImage, ImagePointerType sourceImage, DeformationFieldPointerType def, bool estimateMean, bool estimateMRF, double radius, double m_gamma){

      FloatImagePointerType metricImage;
      if (weighting=="global" || weighting=="local" || weighting=="globallocal"){
	ImagePointerType warpedSourceImage=TransfUtils<ImageType>::warpImage(sourceImage,def);

	if (weighting=="local" || weighting=="globallocal"){
	  switch(metric){
	  case NCC:
	    metricImage=Metrics<ImageType,FloatImageType>::efficientLNCC(warpedSourceImage,targetImage,radius,m_gamma);
	    break;
	  case MSD:
	    metricImage=Metrics<ImageType,FloatImageType>::LSSDNorm(warpedSourceImage,targetImage,radius,m_gamma);
	    break;
	  case MAD:
	    metricImage=Metrics<ImageType,FloatImageType>::LSADNorm(warpedSourceImage,targetImage,radius,m_gamma);
	    break;
	  default:
	    metricImage=Metrics<ImageType,FloatImageType>::efficientLNCC(warpedSourceImage,targetImage,radius,m_gamma);
	  }
	}else{
	  metricImage=FilterUtils<ImageType,FloatImageType>::createEmpty(targetImage);
	  metricImage->FillBuffer(1.0);
	}
	double globalWeight=1.0;
	if (weighting=="global" || weighting=="globallocal"){
	  switch(metric){
	  case NCC:
	    globalWeight=Metrics<ImageType,FloatImageType>::nCC(warpedSourceImage,targetImage);
	    break;
	  case MSD:
	    globalWeight=Metrics<ImageType,FloatImageType>::nCC(warpedSourceImage,targetImage);
	    break;
	  case MAD:
	    globalWeight=Metrics<ImageType,FloatImageType>::nCC(warpedSourceImage,targetImage);
	    break;
	  default:
	    globalWeight=Metrics<ImageType,FloatImageType>::nCC(warpedSourceImage,targetImage);
	  }
	  LOGV(2)<<VAR(globalWeight)<<" "<<VAR(pow(globalWeight,m_gamma))<<endl;
	  globalWeight=pow(globalWeight,m_gamma);
	  ImageUtils<FloatImageType>::multiplyImage(metricImage,globalWeight);
	}
	FilterUtils<FloatImageType>::lowerThresholding(metricImage,std::numeric_limits<float>::epsilon());
	if (estimateMRF)
	  estimator.addImage(def,metricImage);
	if (estimateMean)
	  meanEstimator.addImage(def,metricImage);
      }else{
	if (estimateMRF){
	  //estimator.addImage(def);
	  LOG<<"should not be called like that!"<<endl;
	}
	if (estimateMean)
	  meanEstimator.addImage(def);
      }
      return metricImage;
    }

    FloatImagePointerType replaceFirstImage(string weighting, MetricType metric,RegistrationFuserType & estimator,  GaussianEstimatorVectorImage<ImageType,double> & meanEstimator, ImagePointerType targetImage, ImagePointerType sourceImage, DeformationFieldPointerType def, bool estimateMean, bool estimateMRF, double radius, double m_gamma){

      FloatImagePointerType metricImage;
      if (weighting=="global" || weighting=="local" || weighting=="globallocal"){
	ImagePointerType warpedSourceImage=TransfUtils<ImageType>::warpImage(sourceImage,def);

	if (weighting=="local" || weighting=="globallocal"){
	  switch(metric){
	  case NCC:
	    metricImage=Metrics<ImageType,FloatImageType>::efficientLNCC(warpedSourceImage,targetImage,radius,m_gamma);
	    break;
	  case MSD:
	    metricImage=Metrics<ImageType,FloatImageType>::LSSDNorm(warpedSourceImage,targetImage,radius,m_gamma);
	    break;
	  case MAD:
	    metricImage=Metrics<ImageType,FloatImageType>::LSADNorm(warpedSourceImage,targetImage,radius,m_gamma);
	    break;
	  default:
	    metricImage=Metrics<ImageType,FloatImageType>::efficientLNCC(warpedSourceImage,targetImage,radius,m_gamma);
	  }
	}else{
	  metricImage=FilterUtils<ImageType,FloatImageType>::createEmpty(targetImage);
	  metricImage->FillBuffer(1.0);
	}
	double globalWeight=1.0;
	if (weighting=="global" || weighting=="globallocal"){
	  switch(metric){
	  case NCC:
	    globalWeight=Metrics<ImageType,FloatImageType>::nCC(warpedSourceImage,targetImage);
	    break;
	  case MSD:
	    globalWeight=Metrics<ImageType,FloatImageType>::nCC(warpedSourceImage,targetImage);
	    break;
	  case MAD:
	    globalWeight=Metrics<ImageType,FloatImageType>::nCC(warpedSourceImage,targetImage);
	    break;
	  default:
	    globalWeight=Metrics<ImageType,FloatImageType>::nCC(warpedSourceImage,targetImage);
	  }
	  LOGV(2)<<VAR(globalWeight)<<" "<<VAR(pow(globalWeight,m_gamma))<<endl;
	  globalWeight=pow(globalWeight,m_gamma);
	  ImageUtils<FloatImageType>::multiplyImage(metricImage,globalWeight);
	}
	FilterUtils<FloatImageType>::lowerThresholding(metricImage,std::numeric_limits<float>::epsilon());
	if (estimateMRF)
	  estimator.replaceFirstImage(def,metricImage);
	if (estimateMean)
	  meanEstimator.addImage(def,metricImage);
      }else{
	if (estimateMRF)
	  estimator.addImage(def);
	if (estimateMean)
	  meanEstimator.addImage(def);
      }
      return metricImage;
    }

  };//class
}//namespace


text:
from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('company', '0026_auto_20201110_1011'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='supplierpricebreak',
            name='currency',
        ),
    ]


text:
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>

  <title>SchemaSpy - rt</title>
  <link rel=stylesheet href='schemaSpy.css' type='text/css'>
  <meta HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>

Tables

Relationships

Utility Tables

Constraints

Anomalies

Columns

Donate

  SchemaSpy Analysis of rt
  Generated by
SchemaSpy

Generated by SchemaSpy on Tue Oct 23 12:20 UTC 2012

  Database Type: MySQL - 5.5.27

XML Representation
Insertion Order Deletion Order (for database loading/purging scripts)

<input type='checkbox' id='showTables' checked>
 <input type=checkbox id='showComments'>Comments

<colgroup>
<colgroup>
<colgroup>
<colgroup>
<colgroup>
<colgroup class='comment'>

  Table
  Children
  Parents
  Columns
  Rows
  Comments

  ACL

  8
  1,453

  AT_Assets

  10
  0

  AT_IPs

  9
  0

  AT_Ports

  8
  0

  AT_ScripActions

  9
  1

  AT_ScripConditions

  10
  1

  AT_Scrips

  16
  0

  AT_Templates

  12
  1

  AT_Types

  9
  1

  Attributes

  11
  112,224

  CachedGroupMembers

  6
  3,078,435

  CustomFields

  14
  41

  CustomFieldValues

  9
  89

  FM_Articles

  11
  56

  FM_Classes

  10
  3

  FM_ObjectTopics

  4
  29

  FM_Topics

  6
  2

  GroupMembers

  3
  1,151,224

  Groups

  6
  2,047,026

  Links

  10
  269,972

  ObjectCustomFields

  8
  80

  ObjectCustomFieldValues

  14
  127,327

  Principals

  4
  2,048,845

  Queues

  13
  65

  ScripActions

  9
  27

  ScripConditions

  10
  19

  Scrips

  16
  24

  sessions

  3
  253,418

  Templates

  12
  27

  Tickets

  25
  510,723

  Transactions

  14
  4,630,028

  Users

  34
  1,187

    32 Tables

    343
    14,232,328

    0 Views

    0


text:
<?php

namespace frontend\models;

use Yii;
use yii\base\Model;

class Youtube extends Model
{

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [];
    }

    /**
     * @inheritdoc
     */
    public static function getVideo($videoArr, $channelId)
    {
        $returnArr['title']             = $videoArr['items'][0]['snippet']['title'];
        $returnArr['channelTitle']      = $videoArr['items'][0]['snippet']['channelTitle'];
        $returnArr['description']       = $videoArr['items'][0]['snippet']['description'];
        $returnArr['url']               = $videoArr['items'][0]['snippet']['thumbnails']['default']['url'];
        $returnArr['viewCount']         = $videoArr['items'][0]['statistics']['viewCount'];
        $returnArr['commentCount']      = $videoArr['items'][0]['statistics']['commentCount'];
        $returnArr['likeCount']         = $videoArr['items'][0]['statistics']['likeCount'];
        $returnArr['dislikeCount']      = $videoArr['items'][0]['statistics']['dislikeCount'];
        $returnArr['subscriberCount']   = $channelId['items'][0]['statistics']['subscriberCount'];
        return $returnArr;
    }

}


text:
<?php

namespace APIDocGen\Controller;

use APIDocGen\Lib\APIDoc;
use APIDocGen\Model\Documentation;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use Slim\Exception\NotFoundException;

final class DocumentationController extends BaseController
{
	/**
	 * Index
	 *
	 * Lists all documentations
	 */
	public function index(Request $request, Response $response, $args)
	{
		// Render page
		$this->view->render($response, 'documentation/index.twig');
	}

	/**
	 * Creates a new documentation
	 *
	 * @param Request $request
	 * @param Response $response
	 * @param $args
	 */
	public function post(Request $request, Response $response, $args)
	{
		if ( $request->isPost() ) {
			// GET form data
			$data = $request->getParsedBody();
			// $data = [
				// 'name' => 'MarbleLife API Documentation',
				// 'version' => '1.0.1',
				// 'description' => 'This is a documentation for MarbleLife RESTful API',
				// 'title' => 'MarbleLife API Documentation v1.0.1',
				// 'url' => 'http://128.199.156.89',
				// 'header' => 'Header Title',
				// 'header_content' => 'Content',
				// 'footer' => 'Footer Title',
				// 'footer_content' => 'Content',
			// ];

			// Initialize API Doc generator
			// $gen = new APIDoc($data);
			// $gen->createPath();
			// $gen->createFile();
			// $path = $gen->generate();
			// return $this->redirectTo($response, $request->getUri()->getBasePath() . $path);

			// Initialize model
			$model = new Documentation;
			$model->name = $data['name'];
			$model->version = $data['version'];
			$model->description = $data['description'];
			$model->title = $data['title'];
			$model->url = $data['url'];
			$model->header = $data['header'];
			$model->header_content = $data['header_content'];
			$model->footer = $data['footer'];
			$model->footer_content = $data['footer_content'];

			if ( $id = $model->save() )
				return $this->redirectTo($response, 'viewDoc', ['id' => $id]);
		}

		// Render page
		$this->view->render($response, 'documentation/create.twig');
	}

	/**
	 * Fetches a specific documentation
	 */
	public function get(Request $request, Response $response, $args)
	{
		$id = intval($args['id']);

		// Initialize model
		$model = new Documentation;
		$data = $model->find($id);

		if ( !$data )
			throw new NotFoundException($request, $response);

		// Render page
		$this->view->render($response, 'documentation/view.twig', $data->getAttributes());
	}
}


text:
using System;
using System.Collections.Generic;
using Sharpex2D.Math;
using Sharpex2D.Rendering;

namespace Sharpex2D.Entities
{
    [Developer("ThuCommix", "developer@sharpex2d.de")]
    [TestState(TestState.Tested)]
    public abstract class Entity
    {
        /// <summary>
        /// EntityDestroyedEventHandler.
        /// </summary>
        /// <param name="sender">The Sender.</param>
        /// <param name="e">The EventArgs.</param>
        public delegate void EntityDestroyedEventHandler(object sender, EventArgs e);

        /// <summary>
        /// EntityPositionEventHandler.
        /// </summary>
        /// <param name="sender">The Sender.</param>
        /// <param name="e">The EventArgs.</param>
        public delegate void EntityPositionEventHandler(object sender, EntityPositionEventArgs e);

        private Vector2 _position;

        /// <summary>
        /// Initializes a new Entity class.
        /// </summary>
        protected Entity()
        {
            Id = 0;
            _position = new Vector2(0, 0);
            Entities = new List<Entity>();
            RaiseEvents = true;
        }

        /// <summary>
        /// Sets or gets the Position of the Entity.
        /// </summary>
        public Vector2 Position
        {
            get { return _position; }
            set
            {
                OnPositionChanged(value - _position);
                _position = value;
                IsDirty = true;
            }
        }

        /// <summary>
        /// Sets or gets the Id of the Entity.
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// Gets the EntityContainer.
        /// </summary>
        public List<Entity> Entities { private set; get; }

        /// <summary>
        /// A value indicating whether the Entity is dirty.
        /// </summary>
        public bool IsDirty { set; get; }

        /// <summary>
        /// A value indicating whether the Entity is destroyed.
        /// </summary>
        public bool IsDestroyed { private set; get; }

        /// <summary>
        /// A value indicating whether the Entity can raise events.
        /// </summary>
        public bool RaiseEvents { set; get; }

        /// <summary>
        /// PositionChanged event.
        /// </summary>
        public event EntityPositionEventHandler PositionChanged;

        /// <summary>
        /// Destroyed event.
        /// </summary>
        public event EntityDestroyedEventHandler Destroyed;

        /// <summary>
        /// Called, if the Position changed.
        /// </summary>
        /// <param name="delta">The Delta.</param>
        public virtual void OnPositionChanged(Vector2 delta)
        {
            if (RaiseEvents)
            {
                if (PositionChanged != null)
                {
                    PositionChanged(this, new EntityPositionEventArgs(delta));
                }
            }
        }

        /// <summary>
        /// Destroys the Entity.
        /// </summary>
        public void Destroy()
        {
            IsDestroyed = true;
            if (RaiseEvents)
            {
                if (Destroyed != null)
                {
                    Destroyed(this, EventArgs.Empty);
                }
            }
        }

        /// <summary>
        /// Updates the object.
        /// </summary>
        /// <param name="gameTime">The GameTime.</param>
        public abstract void Update(GameTime gameTime);

        /// <summary>
        /// Processes a Render.
        /// </summary>
        /// <param name="spriteBatch">The SpriteBatch.</param>
        /// <param name="gameTime">The GameTime.</param>
        public abstract void Draw(SpriteBatch spriteBatch, GameTime gameTime);
    }
}


text:
package org.jgroups.util;

import org.jgroups.logging.Log;
import org.jgroups.logging.LogFactory;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.util.concurrent.*;

/**
 * @author Bela Ban
 * @since  Helper class to create regular or virtual threads. Virtual threads are not supported for versions
 * less than Java 17.
 */
public class ThreadCreator {
    private static final Log                  LOG=LogFactory.getLog(ThreadCreator.class);
    private static final MethodHandles.Lookup LOOKUP;
    private static final String               OF_VIRTUAL_NAME="java.lang.Thread$Builder$OfVirtual";
    private static final Class<?>             OF_VIRTUAL_CLASS;
    private static final MethodHandle         OF_VIRTUAL;
    private static final MethodHandle         CREATE_VTHREAD;
    private static final MethodHandle         EXECUTORS_NEW_VIRTUAL_THREAD_FACTORY;

    static {
        LOOKUP=MethodHandles.publicLookup();
        OF_VIRTUAL_CLASS=getOfVirtualClass();
        OF_VIRTUAL=getOfVirtualHandle();
        CREATE_VTHREAD=getCreateVThreadHandle();
        EXECUTORS_NEW_VIRTUAL_THREAD_FACTORY=getNewVirtualThreadFactoryHandle();
    }

    public static boolean hasVirtualThreads() {
        return CREATE_VTHREAD != null;
    }

    protected static MethodHandle getCreateVThreadHandle() {
        MethodType type=MethodType.methodType(Thread.class, Runnable.class);
        try {
            return LOOKUP.findVirtual(OF_VIRTUAL_CLASS, "unstarted", type);
        }
        catch(Exception ex) {
            LOG.debug("%s.unstarted() not found, trying Thread.newThread() (jdk 15/16)", OF_VIRTUAL_NAME);
        }

        // try Thread.newThread(String name, int characteristics, Runnable task)  in JDKs 15 & 16
        type=MethodType.methodType(Thread.class, String.class, int.class, Runnable.class);
        try {
            return LOOKUP.findStatic(Thread.class, "newThread", type);
        }
        catch(Exception ex) {
            LOG.debug("Thread.newThread() not found, falling back to regular threads");
        }
        return null;
    }

    protected static Class<?> getOfVirtualClass() {
        try {
            return Util.loadClass(OF_VIRTUAL_NAME, (Class<?>)null);
        }
        catch(ClassNotFoundException e) {
            LOG.debug("class %s not found", OF_VIRTUAL_NAME);
            return null;
        }
    }

    protected static MethodHandle getOfVirtualHandle() {
        try {
            return OF_VIRTUAL_CLASS != null?
              LOOKUP.findStatic(Thread.class, "ofVirtual", MethodType.methodType(OF_VIRTUAL_CLASS)) : null;
        }
        catch(Exception e) {
            return null;
        }
    }

    protected static MethodHandle getNewVirtualThreadFactoryHandle() {
        MethodType type=MethodType.methodType(ExecutorService.class);
        String[] names={
          "newVirtualThreadPerTaskExecutor",  // jdk 18-21
          "newVirtualThreadExecutor",         // jdk 17
          "newUnboundedVirtualThreadExecutor" // jdk 15 & 16
        };

        for(int i=0; i < names.length; i++) {
            try {
                return LOOKUP.findStatic(Executors.class, names[i], type);
            }
            catch(Exception e) {
                String next=(i+1) < names.length? names[i+1] : "regular thread pool";
                LOG.debug("%s not found, falling back to %s", names[i], next);
            }
        }

        return null;
    }

    public static Thread createThread(Runnable r, String name, boolean daemon, boolean virtual) {
        if(!virtual || CREATE_VTHREAD == null) {
            Thread t=new Thread(r, name);
            t.setDaemon(daemon);
            return t;
        }

        // Thread.ofVirtual().unstarted()
        try {
            Object of=OF_VIRTUAL.invoke();
            Thread t=(Thread)CREATE_VTHREAD.invokeWithArguments(of, r);
            t.setName(name);
            return t;
        }
        catch(Throwable t) {
        }

        // Thread.newThread(String name, int characteristics, Runnable task)  in JDKs 15 & 16
        try {
            return (Thread)CREATE_VTHREAD.invokeExact(name, 1, r);
        }
        catch(Throwable ex) {
        }
        return new Thread(r, name);
    }

    public static ExecutorService createThreadPool(int min_threads, int max_threads, long keep_alive_time,
                                                   boolean virtual_threads, Log log) {
        return createThreadPool(min_threads, max_threads, keep_alive_time, "abort", new SynchronousQueue<>(),
                                new DefaultThreadFactory("threads", true, true),
                                virtual_threads, log);
    }

    public static ExecutorService createThreadPool(int min_threads, int max_threads, long keep_alive_time,
                                                   String rejection_policy,
                                                   BlockingQueue<Runnable> queue, final ThreadFactory factory,
                                                   boolean useVirtualThreads, Log log) {
        if(!useVirtualThreads || EXECUTORS_NEW_VIRTUAL_THREAD_FACTORY == null) {
            ThreadPoolExecutor pool=new ThreadPoolExecutor(min_threads, max_threads, keep_alive_time,
                                                           TimeUnit.MILLISECONDS, queue, factory);
            RejectedExecutionHandler handler=Util.parseRejectionPolicy(rejection_policy);
            pool.setRejectedExecutionHandler(new ShutdownRejectedExecutionHandler(handler));
            if(log != null)
                log.debug("thread pool min/max/keep-alive (ms): %d/%d/%d", min_threads, max_threads, keep_alive_time);
            return pool;
        }

        try {
            return (ExecutorService)EXECUTORS_NEW_VIRTUAL_THREAD_FACTORY.invokeExact();
        }
        catch(Throwable t) {
            throw new IllegalStateException(String.format("failed to create virtual thread pool: %s", t));
        }
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <!-- PlugPDF Text -->
    <string name="text_search_progress">searching keyword.</string>
    <string name="text_search_found_fail">not found keyword.</string>
    <string name="text_ok">OK</string>
    <string name="text_cancel">Cancel</string>
    <string name="text_password">input password.</string>
    <string name="text_rotate_lock">rotation lock.</string>
    <string name="text_rotate_unlock">rotation unlock.</string>
    <string name="text_annot_menu_item_delete">Delete</string>
    <string name="text_annot_menu_item_edit">Edit</string>
    <string name="text_annot_menu_item_color">Color</string>
    <string name="text_annot_menu_item_opacity">Clearity</string>
    <string name="text_annot_menu_item_width">Width</string>
    <string name="text_annot_menu_item_color_white">White</string>
    <string name="text_annot_menu_item_color_black">Black</string>
    <string name="text_annot_menu_item_color_red">Red</string>
    <string name="text_annot_menu_item_color_orange">Orange</string>
    <string name="text_annot_menu_item_color_yellow">Yellow</string>
    <string name="text_annot_menu_item_color_green">Green</string>
    <string name="text_annot_menu_item_color_blue">Blue</string>
    <string name="text_annot_menu_item_color_purple">Purple</string>
    <string name="text_annot_menu_item_opacity_10">10%</string>
    <string name="text_annot_menu_item_opacity_25">25%</string>
    <string name="text_annot_menu_item_opacity_50">50%</string>
    <string name="text_annot_menu_item_opacity_75">75%</string>
    <string name="text_annot_menu_item_opacity_100">100%</string>
    <string name="text_annot_menu_item_width_1">1Px</string>
    <string name="text_annot_menu_item_width_3">3Px</string>
    <string name="text_annot_menu_item_width_5">5Px</string>
    <string name="text_annot_menu_item_width_7">7Px</string>
    <string name="text_annot_menu_item_width_9">9Px</string>
    <string name="text_annot_menu_item_width_11">11Px</string>

    <!-- Text -->
    <string name="text_search">search</string>
    <string name="text_color">color</string>
    <string name="text_fill_color">fill color</string>
    <string name="text_opacity">opacity</string>
    <string name="text_width">width</string>
    <string name="text_straight">straight</string>
    <string name="text_notice">Notice</string>
    <string name="text_url_downloading">Please Wait for downloading</string>

    <!-- Button Label -->
    <string name="label_save_button">save</string>
    <string name="label_back_button">back</string>
    <string name="label_erase_button">delete</string>
    <string name="label_change_button">change</string>
	<string name="label_outline_title">Set outline title:</string>
	<string name="label_outline_child_check">is Child</string>
    <string name="text_squiggly">Squiggly</string>

    <!-- ImageView description -->
    <string name="bottom_menu_thumbnail">bottom thumbnail</string>

</resources>


text:
[![CI Status](http://img.shields.io/travis/aadesh/AsyncKit.svg?style=flat)](https://travis-ci.org/aadesh/AsyncKit)
[![License](https://img.shields.io/cocoapods/l/AsyncKit.svg?style=flat)](http://cocoapods.org/pods/AsyncKit)
[![Platform](https://img.shields.io/cocoapods/p/AsyncKit.svg?style=flat)](http://cocoapods.org/pods/AsyncKit)

Brings the power of promises/futures to iOS development in the form of Tasks

## Get Started

Check out the thorough [AsyncKit documentation](https://aadeshp.github.io/async-kit#docs)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Installation

AsyncKit is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "AsyncKit"
```

## Author

Aadesh Patel, aadeshp95@gmail.com

## License

AsyncKit is available under the MIT license. See the LICENSE file for more info.


text:
. /etc/rtwsrc

if [ $# -ne 1 ]; then
    echo "Usage: $0 <input-file>"
    exit 1
fi

pid=`ps auxwww | pgrep -f org.apache.directory.server.UberjarMain`

if [ -z "$pid" ]; then
  echo "ApacheDS is currently not running"
  exit 1
fi

while [ 1 ]
do
  netstat -an | grep -i LISTEN | grep 10389

  if [ $? -eq 0 ]; then
    break
  else
    if [ "$wait" == "......" ]; then
      echo "ApacheDS is not listening on port 10389"
      exit 1
    else
      wait="$wait""."
      sleep 5
    fi
  fi
done

# Wait until the DNS is updated with the correct values
counter=0
public_hostname=$(curl -s -f http://169.254.169.254/latest/meta-data/public-hostname)

while [ $counter -le 15 ]
do
  name=$(nslookup $RTWS_FQDN | grep 'Name:' | cut -s -f2)

  if [ -z $name ]
  then
    echo "Trying to resolve $RTWS_FQDN"
    counter=$(( $counter + 1))
    sleep 60
  else
    if [ "$name" == "$public_hostname" ]
    then
      echo "$name"
      break
    else
      echo "Trying to resolve $RTWS_FQDN"
      counter=$(( $counter + 1))
      sleep 60
    fi
  fi
done

#
# Change the Directory Manager admin password
#
java -Dlog4j.configuration=null -jar lib/deleidos-rtws-apacheds.jar changeSystemPassword > logs/change_apacheds_password.log 2>&1

#
# Reset all MD5 user passwords to use SHA-256 - REMOVE after all passwords have been converted
#
java -Dlog4j.configuration=null -cp "/usr/local/apacheds-2.0.0-M16/lib/*" com.deleidos.rtws.ldaputils.LdapModify resetMD5UserPasswords > logs/reset_md5_passwords.log 2>&1
cp logs/reset_md5_passwords.log /mnt/rdafs/reset_md5_passwords.`date +%s`.log

#
# Install ldap-utils to be able to use ldapmodify to load LDIFs to the LDAP
#
if [ -f /etc/lsb-release ]; then
	apt-get -y install ldap-utils --force-yes
fi
if [ -f /etc/centos-release ]; then
	yum -y install openldap-clients
fi

#
# Load the LDIF file specified on command line arg
#
RTWS_PROPERTIES_FILE="/usr/local/rtws/properties/rtws-common.properties"
LDAP_URL="$(cat $RTWS_PROPERTIES_FILE | grep ldap.provider.url | cut -d '=' -f 2- | tr -sd '\r' '' | tr -sd '\n' '')"
LDAP_PRINCIPAL=$(cat "$RTWS_PROPERTIES_FILE" | grep ldap.principal | cut -d '=' -f 2- | sed 's/|/,/' | tr -sd '\r' '' | tr -sd '\n' '')
LDAP_PASS=$(cat "$RTWS_PROPERTIES_FILE" | grep ldap.credentials | cut -d '=' -f 2- | cut -d '(' -f2 | cut -d ')' -f1)

APACHEDS_LIB_DIR="/usr/local/apacheds/lib/"
COMMONS_CONFIG_JAR="$APACHEDS_LIB_DIR"/$(ls "$APACHEDS_LIB_DIR" | grep deleidos-rtws-commons-config-.*.jar)

echo "***********************************************************************************************"
echo " NOTE: \"ERR_250_ENTRY_ALREADY_EXISTS\" is an acceptable error in this log and can be ignored!"
echo "***********************************************************************************************"

VAR=$RTWS_DOMAIN
if [ "$RTWS_IS_TMS" == "true" ]; then
  VAR=com.deleidos.rtws.commons.config.ConfigEncryptor
fi

LDAP_PASS=$(java -cp "$COMMONS_CONFIG_JAR" com.deleidos.rtws.commons.config.ConfigEncryptor -d "$VAR" "$LDAP_PASS")

ldapmodify -H "$LDAP_URL" -D "$LDAP_PRINCIPAL" -w "$LDAP_PASS" -a -c -f $1 > logs/setup_apacheds.log 2>&1


text:
package com.codeborne.selenide.ex;

import com.codeborne.selenide.Driver;

import javax.annotation.ParametersAreNonnullByDefault;

@ParametersAreNonnullByDefault
public class FrameNotFoundException extends UIAssertionError {
  public FrameNotFoundException(Driver driver, String message, Throwable cause) {
    super(driver, message, cause);
  }
}


text:
package org.apache.zeppelin.service;

import java.util.Collection;
import java.util.List;
import java.util.Set;

import org.apache.shiro.realm.Realm;

/**
 * Interface for Zeppelin Security.
 * //TODO(zjffdu) rename it to AuthenticationService
 */
public interface AuthenticationService {

  /**
   * Get current principal/username.
   * @return
   */
  String getPrincipal();

  /**
   * Get roles associated with current principal
   * @return
   */
  Set<String> getAssociatedRoles();

  Collection<Realm> getRealmsList();

  boolean isAuthenticated();

  /**
   * Used for user auto-completion
   * @param searchText
   * @param numUsersToFetch
   * @return
   */
  List<String> getMatchedUsers(String searchText, int numUsersToFetch);

  /**
   * Used for role auto-completion
   * @return
   */
  List<String> getMatchedRoles();
}


text:
<?xml version="1.0" encoding="utf-8"?>
<project name="runner-setup">
  <import file="exp-gettarget.xml" />

  <!-- Half-baked pre build setup from Android SDK r20.0.1 and later -->
  <target name="sdk-build-setup" depends="setup-target">
    <!-- read the previous build mode -->
    <property file="${out.build.prop.file}" />
    <!-- if empty the props won't be set, meaning it's a new build.
	 To force a build, set the prop to empty values. -->
    <property name="build.last.target" value="" />
    <property name="build.last.is.instrumented" value="" />
    <property name="build.last.is.packaging.debug" value="" />
    <property name="build.last.is.signing.debug" value="" />

    <path id="android.renderscript.include.path">
        <pathelement location="${android.platform.tools.dir}/renderscript/include" />
        <pathelement location="${android.platform.tools.dir}/renderscript/clang-include" />
    </path>

    <!-- Value of the hasCode attribute (Application node) extracted from manifest file -->
    <xpath input="${manifest.abs.file}" expression="/manifest/application/@android:hasCode"
	   output="manifest.hasCode" default="true"/>

    <echo level="info">----------</echo>
    <echo level="info">Creating output directories if needed...</echo>
    <mkdir dir="${resource.absolute.dir}" />
    <mkdir dir="${jar.libs.absolute.dir}" />
    <mkdir dir="${out.absolute.dir}" />
    <mkdir dir="${out.res.absolute.dir}" />
    <do-only-if-manifest-hasCode>
      <mkdir dir="${gen.absolute.dir}" />
      <mkdir dir="${out.classes.absolute.dir}" />
    </do-only-if-manifest-hasCode>

    <echo level="info">----------</echo>
    <echo level="info">Resolving Dependencies for ${ant.project.name}...</echo>
    <dependency
	libraryFolderPathOut="project.library.folder.path"
	libraryPackagesOut="project.library.packages"
	libraryManifestFilePathOut="project.library.manifest.file.path"
	libraryResFolderPathOut="project.library.res.folder.path"
	libraryBinAidlFolderPathOut="project.library.bin.aidl.folder.path"
	libraryNativeFolderPathOut="project.library.native.folder.path"
        libraryRFilePathOut="project.library.bin.r.file.path"
	jarLibraryPathOut="project.all.jars.path"
	targetApi="${project.target.apilevel}"
	verbose="${verbose}" />
  </target>

  <!-- Half-baked package regenerator -->
  <!-- TBD: dependency handling -->
  <target name="regenerate" depends="sdk-build-setup">
    <property name="renderscript.opt.level" value="O0" />

    <!-- always merge manifest -->
    <mergemanifest
	appManifest="${manifest.abs.file}"
	outManifest="${out.manifest.abs.file}"
	enabled="${manifestmerger.enabled}">
      <library refid="project.library.manifest.file.path" />
    </mergemanifest>

    <do-only-if-manifest-hasCode
	elseText="hasCode = false. Skipping aidl/renderscript/R.java">
      <echo level="info">Handling aidl files...</echo>
      <aidl executable="${aidl}"
	    framework="${project.target.framework.aidl}"
	    libraryBinAidlFolderPathRefid="project.library.bin.aidl.folder.path"
	    genFolder="${gen.absolute.dir}"
	    aidlOutFolder="${out.aidl.absolute.dir}">
	<source path="${source.absolute.dir}"/>
      </aidl>

      <!-- renderscript generates resources so it must be called before aapt -->
      <echo level="info">----------</echo>
      <echo level="info">Handling RenderScript files...</echo>
      <renderscript executable="${renderscript}"
                    includePathRefId="android.renderscript.include.path"
                    genFolder="${gen.absolute.dir}"
                    resFolder="${out.res.absolute.dir}/raw"
                    targetApi="${project.minSdkVersion}"
                    optLevel="${renderscript.opt.level}"
                    buildType="${build.is.packaging.debug}"
                    previousBuildType="${build.last.is.packaging.debug}">
	<source path="${source.absolute.dir}"/>
      </renderscript>

      <echo level="info">----------</echo>
      <echo level="info">Handling Resources...</echo>
      <aapt executable="${aapt}"
	    command="package"
	    verbose="${verbose}"
	    manifest="${out.manifest.abs.file}"
	    androidjar="${project.target.android.jar}"
	    rfolder="${gen.absolute.dir}"
	    nonConstantId="${android.library}"
	    libraryResFolderPathRefid="project.library.res.folder.path"
	    libraryPackagesRefid="project.library.packages"
            libraryRFileRefid="project.library.bin.r.file.path"
	    ignoreAssets="${aapt.ignore.assets}"
	    proguardFile="${out.absolute.dir}/proguard.txt">
	<res path="${out.res.absolute.dir}" />
	<res path="${resource.absolute.dir}" />
      </aapt>
    </do-only-if-manifest-hasCode>
  </target>
</project>


text: The Study of Poor Man's IoT


text:
<Alloy>
	<Window class="container">
		<ScrollView id="scrollView"/>
		<Button id="btn"/>
	</Window>
</Alloy>


text:
import { applicationGenerator } from '@nrwl/angular/generators';
import { createTreeWithEmptyV1Workspace } from '@nrwl/devkit/testing';
import { RoutingScope } from '@schematics/angular/module/schema';

import { angularModuleGenerator } from './angular-module-generator';

describe('angularModuleGenerator', () => {
  it('should generate an angular module', async () => {
    const tree = createTreeWithEmptyV1Workspace();
    await applicationGenerator(tree, {
      name: 'my-app',
    });
    await angularModuleGenerator(tree, {
      name: 'my-module',
      project: 'my-app',
    });
    expect(
      tree.read('/apps/my-app/src/app/my-module/my-module.module.ts', 'utf-8')
    ).toBeTruthy();
  });

  it('should generate an angular module with routing', async () => {
    const tree = createTreeWithEmptyV1Workspace();
    await applicationGenerator(tree, {
      name: 'my-app',
    });
    await angularModuleGenerator(tree, {
      name: 'my-module',
      project: 'my-app',
      routing: true,
      routingScope: RoutingScope.Root,
    });
    await angularModuleGenerator(tree, {
      name: 'my-sub-module',
      project: 'my-app',
      module: 'my-module',
      route: 'my-sub-module',
      routing: true,
      routingScope: RoutingScope.Child,
    });
    expect(
      tree.read('/apps/my-app/src/app/my-module/my-module.module.ts', 'utf-8')
    ).toMatchSnapshot();
    expect(
      tree.read(
        '/apps/my-app/src/app/my-sub-module/my-sub-module.module.ts',
        'utf-8'
      )
    ).toMatchSnapshot();
  });
});


text:
package io.piotrjastrzebski.dungen.gui;

import io.piotrjastrzebski.dungen.DrawSettings;
import io.piotrjastrzebski.dungen.GenSettings;

/**
 * Created by PiotrJ on 10/09/15.
 */
public interface Restarter {
	public void restart (GenSettings settings);
	public void update (DrawSettings settings);
}


text:
//
// opt.h
// ~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2004-2013 Metasystems Technologies Inc. (MTI)
// All rights reserved
//
// Distributed under the MTI Software License, Version 0.1.
//
// as defined by accompanying file MTI-LICENSE-0.1.info or
// at http://www.mtihq.com/license/MTI-LICENSE-0.1.info
//
// forked from Yet another C++ version of getopt
//
//  Copyright (C) Daniel Gutson, FuDePAN 2007-2010
//  Distributed under the Boost Software License, Version 1.0.
//  (See accompanying file LICENSE_1_0.txt in the root directory or
//  copy at http://www.boost.org/LICENSE_1_0.txt)
//
//  opt IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
//  SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
//  FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
//  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
//  DEALINGS IN THE SOFTWARE.

#ifndef __OPT_H
#define __OPT_H

#include <string>
#include <vector>   // candidate to be removed
#include <map>
#include <sstream>
#include <list>

/*
    DESIGN GOALS:
        - EASY to use
        - EASY to learn
        - mimc STL's streams
        - EASY to extend
*/

#ifndef OPT_INLINE
#   define OPT_INLINE
#endif

namespace mti {

//
struct Token
{
    enum Type
    {
        ShortOption,
        LongOption,
        GlobalArgument,
        GlobalArgumentUsed, // already read, skip in the next read
        OptionArgument,
        PossibleNegativeArgument,
        UnknownYet  // can be a global option, or an option of the previous one
    };

    Type type;
    std::string value;
    Token* next;

    Token(const std::string& value, Type type = UnknownYet)
        : type(type), value(value), next(NULL)
    {}

    bool is_last() const
    {
        return next == NULL;
    }

    void link_to(Token* new_next)
    {
        next = new_next;
    }

    Token* get_next_option_argument() const
    {
        if (is_last())
            return NULL;
        else
        {
            if (next->type == UnknownYet || next->type == OptionArgument || next->type == PossibleNegativeArgument)
                return next;
            else
                return NULL;
        }
    }
};

struct OptionData
{
    enum _Flags
    {
        CmdLine_NotExtracted,
        CmdLine_Extracted,
        Envir
    };

    _Flags flags;
    Token* token;
    OptionData() : flags(CmdLine_NotExtracted) {}
};

typedef std::map<std::string, OptionData> LongOptions;
typedef std::map<char, OptionData> ShortOptions;

struct _Option
{
    enum Result
    {
        OK,
        ParsingError,
        OptionNotFound,
        BadType,
        NoArgs,
        TooManyArgs,
        OptionNotFound_NoEx
    };

    virtual Result operator()(ShortOptions& short_ops, LongOptions& long_ops, Token* first, std::ios::fmtflags flags) const = 0;
    virtual ~_Option() {}

    static const char NO_SHORT_OPT = 0;
protected:
    static void setTokenAsUsed(Token* token, ShortOptions& short_ops, Token::Type usedAs)
    {
        if (token->type == Token::PossibleNegativeArgument)
            short_ops.erase(token->value[1]);

        token->type = usedAs;
    }
};

template <class T> inline _Option::Result convert(const std::string& s, T& result, std::ios::fmtflags flags)
{
    std::stringstream ss;
    ss.clear();
    ss.flags(flags);
    ss << s;
    ss >> result;
    if (ss.fail() || !ss.eof())
        return _Option::BadType;
    else
        return _Option::OK;
}

template <> inline _Option::Result convert<std::string>(const std::string& s, std::string& result, std::ios::fmtflags /*flags*/)
{
    result = s;
    return _Option::OK;
}

template <class T> class _OptionTBase : public _Option
{
    const char short_opt;
    const std::string long_opt;
protected:
    T& target;
    virtual Result _assign(Token* token, std::ios::fmtflags flags, ShortOptions& short_ops) const = 0;

public:
    _OptionTBase(const _OptionTBase<T>& other)
        : _Option(), short_opt(other.short_opt), long_opt(other.long_opt), target(other.target)
    {}

    _OptionTBase(char short_opt, const std::string& long_opt, T& target)
        : short_opt(short_opt), long_opt(long_opt), target(target)
    {}

    virtual Result operator()(ShortOptions& short_ops, LongOptions& long_ops, Token* /*first*/, std::ios::fmtflags flags) const
    {
        Result ret = OptionNotFound;
        ShortOptions::iterator it;
        if (short_opt == _Option::NO_SHORT_OPT)
            it = short_ops.end();
        else
            it = short_ops.find(short_opt);

        if (it != short_ops.end())
        {
            it->second.flags = OptionData::CmdLine_Extracted;
            ret = _assign(it->second.token, flags, short_ops);
        }
        else if (!long_opt.empty())
        {
            LongOptions::iterator it = long_ops.find(long_opt);
            if (it != long_ops.end())
            {
                it->second.flags = OptionData::CmdLine_Extracted;
                ret = _assign(it->second.token, flags, short_ops);
            }
        }

        return ret;
    }
};

template <class T> class _OptionT : public _OptionTBase<T>
{
protected:
    virtual _Option::Result _assign(Token* token, std::ios::fmtflags flags, ShortOptions& short_ops) const
    {
        Token* const option_token = token->get_next_option_argument();
        if (option_token == NULL)
            return _Option::NoArgs;
        else
        {
            this->setTokenAsUsed(option_token, short_ops, Token::OptionArgument);
            return convert<T>(option_token->value, this->target, flags);
        }
    }
public:
    _OptionT(const _OptionT<T>& other)
        : _OptionTBase<T>(other)
    {}

    _OptionT(char short_opt, const std::string& long_opt, T& target)
        : _OptionTBase<T>(short_opt, long_opt, target)
    {}

};

template <class T> class _OptionT<std::vector<T> > : public _OptionTBase<std::vector<T> >
{
protected:
    virtual _Option::Result _assign(Token* token, std::ios::fmtflags flags, ShortOptions& short_ops) const
    {
        Token* option_token = token->get_next_option_argument();
        if (option_token != NULL)
        {
            _Option::Result result;
            //OptionArgs::const_iterator it = args.begin();
            T temp;

            do
            {
                this->setTokenAsUsed(option_token, short_ops, Token::OptionArgument);
                result = convert<T>(option_token->value, temp, flags);
                if (result == _Option::OK)
                    this->target.push_back(temp);

                option_token = option_token->get_next_option_argument();
            }
            while (option_token != NULL && result == _Option::OK);

            return result;
        }
        else
            return _Option::NoArgs;
    }

public:
    _OptionT(const _OptionT<std::vector<T> >& other)
        : _OptionTBase<std::vector<T> >(other)
    {}

    _OptionT(char short_opt, const std::string& long_opt, std::vector<T>& target)
        : _OptionTBase<std::vector<T> >(short_opt, long_opt, target)
    {}
};

template <class T, class BaseOption>
class _DefValOption : public BaseOption
{
    const T default_value;
public:

    _DefValOption(const _DefValOption<T, BaseOption>& other)
        : BaseOption(other), default_value(other.default_value)
    {}

    _DefValOption(char short_opt, const std::string& long_opt, T& target, const T& default_value)
        : BaseOption(short_opt, long_opt, target), default_value(default_value)
    {}

    virtual _Option::Result operator()(ShortOptions& short_ops, LongOptions& long_ops, Token* first, std::ios::fmtflags flags) const
    {
        _Option::Result ret = BaseOption::operator()(short_ops, long_ops, first, flags);

        if (ret == _Option::OptionNotFound)
        {
            this->target = default_value;
            ret = _Option::OK;
        }

        return ret;
    }
};

template <class T>
class _GlobalOption : public _Option
{
    T& target;
    virtual Result operator()(ShortOptions& short_ops, LongOptions& long_ops, Token* first, std::ios::fmtflags flags) const
    {
        // find first token GlobalArgument or UnknownYet (candidate) or PossibleNegativeArgument (candidate too)
        Token* token(first);
        bool found(false);
        while (token != NULL && !found)
        {
            found = (token->type == Token::GlobalArgument || token->type == Token::UnknownYet || token->type == Token::PossibleNegativeArgument);
            if (!found)
                token = token->next;
        }
        if (found)
        {
            this->setTokenAsUsed(token, short_ops, Token::GlobalArgumentUsed);
            return convert<T>(token->value, target, flags);
        }
        else
            return OptionNotFound;
    }
public:
    _GlobalOption(const _GlobalOption<T>& other)
        : target(other.target)
    {}

    _GlobalOption(T& target)
        : target(target)
    {}
};

template <class T>
class _GlobalOption<std::vector<T> > : public _Option
{
    std::vector<T>& target;
    virtual Result operator()(ShortOptions& short_ops, LongOptions& /*long_ops*/, Token* first, std::ios::fmtflags flags) const
    {
        // find first token GlobalArgument or UnknownYet (candidate) or PossibleNegativeArgument (candidate too)
        Token* token(first);
        bool found_any(false);
        T tmp;
        Result res(OK);

        while (token != NULL && res == OK)
        {
            if (token->type == Token::GlobalArgument || token->type == Token::UnknownYet || token->type == Token::PossibleNegativeArgument)
            {
                res = convert<T>(token->value, tmp, flags);
                if (res == OK)
                {
                    this->setTokenAsUsed(token, short_ops, Token::GlobalArgumentUsed);
                    found_any = true;
                    target.push_back(tmp);
                }
            }
            token = token->next;
        }
        if (res == OK)
        {
            if (found_any)
                return res;
            else
                return OptionNotFound;
        }
        else
            return res;
    }
public:
    _GlobalOption(const _GlobalOption<std::vector<T> >& other)
        : target(other.target)
    {}

    _GlobalOption(std::vector<T>& target)
        : target(target)
    {}
};

template <class T>
inline _OptionT<T> Option(char short_opt, const std::string& long_opt, T& target)
{
    return _OptionT<T>(short_opt, long_opt, target);
}

template <class T>
inline _OptionT<T> Option(char short_opt, T& target)
{
    return _OptionT<T>(short_opt, std::string(), target);
}

// LongOpt only
template <class T>
inline _OptionT<T> Option(const std::string& long_opt, T& target)
{
    return _OptionT<T>(_Option::NO_SHORT_OPT, long_opt, target);
}

// Defaulted version
template <class T>
inline _DefValOption<T, _OptionT<T> >
Option(char short_opt, const std::string& long_opt, T& target, const T& def)
{
    return _DefValOption<T, _OptionT<T> >(short_opt, long_opt, target, def);
}

template <class T>
inline _DefValOption<T, _OptionT<T> > Option(char short_opt, T& target, const T& def)
{
    return _DefValOption<T, _OptionT<T> >(short_opt, std::string(), target, def);
}

//  no short opt.
template <class T>
inline _DefValOption<T, _OptionT<T> >
Option(const std::string& long_opt, T& target, const T& def)
{
    return _DefValOption<T, _OptionT<T> >(_Option::NO_SHORT_OPT, long_opt, target, def);
}

// Defaults for strings:
inline _DefValOption<std::string, _OptionT<std::string> >
Option(char short_opt, const std::string& long_opt, std::string& target, const char* def)
{
    return _DefValOption<std::string, _OptionT<std::string> >(short_opt, long_opt, target, def);
}

inline _OptionT<std::string> Option(char short_opt, std::string& target, const char* def)
{
    return _DefValOption<std::string, _OptionT<std::string> >(short_opt, std::string(), target, def);
}

//  no short opt.
inline _DefValOption<std::string, _OptionT<std::string> >
Option(const std::string& long_opt, std::string& target, const char* def)
{
    return _DefValOption<std::string, _OptionT<std::string> >(_Option::NO_SHORT_OPT, long_opt, target, def);
}

// Global Option:
template <class T>
inline _GlobalOption<T> GlobalOption(T& target)
{
    return _GlobalOption<T>(target);
}

class OptionPresent : public _Option
{
    const char short_opt;
    const std::string long_opt;
    bool* const present;
public:
    // two combinations: with/without target, and with/without long opt.

    // WITH long_opt:
    OptionPresent(char short_opt, const std::string& long_opt, bool& present)
        : short_opt(short_opt), long_opt(long_opt), present(&present)
    {}

    OptionPresent(char short_opt, const std::string& long_opt)
        : short_opt(short_opt), long_opt(long_opt), present(NULL)
    {}

    // WITHOUT long_opt:
    OptionPresent(char short_opt, bool& present)
        : short_opt(short_opt), present(&present)
    {}

    OptionPresent(char short_opt)
        : short_opt(short_opt), present(NULL)
    {}

    // WITHOUT short_opt
    OptionPresent(const std::string& long_opt, bool& present)
        : short_opt(_Option::NO_SHORT_OPT), long_opt(long_opt), present(&present)
    {}

    OptionPresent(const std::string& long_opt)
        : short_opt(_Option::NO_SHORT_OPT), long_opt(long_opt), present(NULL)
    {}
protected:
    virtual Result operator()(ShortOptions& short_ops, LongOptions& long_ops, Token* /*first*/, std::ios::fmtflags /*flags*/) const
    {
        bool found;
        ShortOptions::iterator it = short_ops.find(short_opt);

        found = (it != short_ops.end());
        if (found)
        {
            it->second.flags = OptionData::CmdLine_Extracted;
        }
        else if (!long_opt.empty())
        {
            LongOptions::iterator it = long_ops.find(long_opt);
            found = (it != long_ops.end());
            if (found)
            {
                it->second.flags = OptionData::CmdLine_Extracted;
            }
        }

        if (present != NULL)
        {
            *present = found;
            return OK;
        }
        else
        {
            return found ? OK : OptionNotFound_NoEx;
        }
    }
};

class optex : public std::exception {};
struct ParsingErrorEx : optex {};
struct InvalidFormatEx : optex {};
struct ArgumentNotFoundEx : optex {};
struct TooManyArgumentsEx : optex {};
struct OptionNotFoundEx : optex {};
struct TooManyOptionsEx : optex {};
struct OptionsFileNotFoundEx : optex
{
    const std::string targetFile;
    OptionsFileNotFoundEx(const std::string& file) : targetFile(file) {}
    ~OptionsFileNotFoundEx() throw() {}
};

enum _EnvTag
{
    Include_Environment
};

class opt
{
    ShortOptions _shortOps;
    LongOptions _longOps;
    std::ios_base::iostate _exc;
    _Option::Result _last;
    std::ios::fmtflags _flags;
    std::string _app_name;
    Token* _first_token;
    Token* _last_token;

    class TokensDeleter
    {
        Token*& _first;
    public:
        TokensDeleter(Token*& first) : _first(first) {}

        OPT_INLINE ~TokensDeleter();
    };

    TokensDeleter _tokens_deleter;

    OPT_INLINE Token* _add_token(const std::string& value, Token::Type type);
    OPT_INLINE void _init_flags();
    OPT_INLINE void _parse(const std::vector<std::string>& args);
    OPT_INLINE void _parse_env();
    static OPT_INLINE void _argc_argv_to_vector(int argc, const char* const* const argv, std::vector<std::string>& args);
    OPT_INLINE void _parse_sub_file(const std::string& file);
public:
    OPT_INLINE opt(int argc, const char* const* const argv);
    OPT_INLINE opt(int argc, const char* const* const argv, _EnvTag);

    std::ios_base::iostate exceptions() const
    {
        return _exc;
    }
    void exceptions(std::ios_base::iostate except)
    {
        _exc = except;
    }
    void exceptions_all()
    {
        _exc = std::ios_base::failbit | std::ios_base::eofbit;
    }

    operator bool() const
    {
        return _last == _Option::OK;
    }

    OPT_INLINE bool options_remain() const;

    void end_of_options() const // throw(optex)
    {
        if (options_remain() && (_exc & std::ios_base::eofbit))
            throw TooManyOptionsEx();
    }

    std::ios::fmtflags flags() const
    {
        return _flags;
    }
    void flags(std::ios::fmtflags flags)
    {
        _flags = flags;
    }

    const std::string& app_name() const
    {
        return _app_name;
    }

    OPT_INLINE opt& operator >> (const _Option& opt); // throw(optex);

    OPT_INLINE opt& operator >> (std::ios_base& (*iomanip)(std::ios_base&));

    // Alternative to manipulators, for those who don't like them: the 'getopt' method :)
    // Combination 1: with long option:
    template <class T> inline T getopt(char short_opt, const std::string& long_opt) // throw(optex)
    {
        T result;
        operator >> (Option(short_opt, long_opt, result));
        return result;
    }

    template <class T> inline T getopt(char short_opt, const std::string& long_opt, const T& def_value)
    {
        T result;
        operator >> (Option(short_opt, long_opt, result, def_value));
        return result;
    }

    // Combination 2: without long option:
    template <class T> inline T getopt(char short_opt) // throw(optex)
    {
        T result;
        operator >> (Option(short_opt, result));
        return result;
    }

    template <class T> inline T getopt(char short_opt, const T& def_value)
    {
        T result;
        operator >> (Option(short_opt, result, def_value));
        return result;
    }

    struct ItCtorData
    {
        ShortOptions::const_iterator short_iter;
        LongOptions::const_iterator  long_iter;
        opt* optpp;
    };

    template <class Container, class Adapter, class OptionType>
    class _iterator
    {
        typename Container::const_iterator _it;
        opt* _optpp;
    public:
        _iterator(const ItCtorData& ctor_data)
        {
            _it = Adapter::adapt(ctor_data);
            _optpp = ctor_data.optpp;
        }

        _iterator() : _optpp(NULL)
        {}

        _iterator<Container, Adapter, OptionType>& operator = (const _iterator<Container, Adapter, OptionType>& other)
        {
            _it = other._it;
            _optpp = other._optpp;
            return *this;
        }

        bool operator != (const _iterator<Container, Adapter, OptionType>& other) const
        {
            return _it != other._it;
        }

        OptionType option() const
        {
            return _it->first;
        }
        OptionType operator*() const
        {
            return option();
        }

        _iterator<Container, Adapter, OptionType>& operator ++()
        {
            ++_it;
            return *this;
        }

        template <class T>
        opt& operator >> (T& t)
        {
            Adapter::extract(t, *_optpp, option());
            return *_optpp;
        }
    };

    ItCtorData begin()
    {
        ItCtorData ret;
        ret.short_iter = _shortOps.begin();
        ret.long_iter  = _longOps.begin();
        ret.optpp  = this;
        return ret;
    }

    ItCtorData end()
    {
        ItCtorData ret;
        ret.short_iter = _shortOps.end();
        ret.long_iter  = _longOps.end();
        ret.optpp  = this;
        return ret;
    }

    struct ShortAdapter
    {
        static ShortOptions::const_iterator adapt(const ItCtorData& data)
        {
            return data.short_iter;
        }

        template <class T>
        static void extract(T& t, opt& optpp, char option)
        {
            optpp >> Option(option, t);
        }
    };

    struct LongAdapter
    {
        static LongOptions::const_iterator adapt(const ItCtorData& data)
        {
            return data.long_iter;
        }

        template <class T>
        static void extract(T& t, opt& optpp, const std::string& option)
        {
            optpp >> Option('\0', option, t);
        }
    };

    typedef _iterator<ShortOptions, ShortAdapter, char> short_iterator;
    typedef _iterator<LongOptions, LongAdapter, const std::string&> long_iterator;
};

class Environment
{
    // Coming soon!
};

} // mti

#endif


text:
using System.Threading.Tasks;
using Confluent.Kafka.Serialization;

namespace Confluent.Kafka
{
    /// <summary>
    ///     This interface describes the minimum functionality
    ///     to be provided by a high level (serializing) Kafka
    ///     producer.
    /// </summary>
    public interface ISerializingProducer<TKey, TValue>
    {
        /// <summary>
        ///     Gets the name of the underlying producer instance.
        /// </summary>
        string Name { get; }

        /// <summary>
        ///     Gets the ISerializer implementation instance used to serialize keys.
        /// </summary>
        ISerializer<TKey> KeySerializer { get; }

        /// <summary>
        ///     Gets the ISerializer implementation instance used to serialize values.
        /// </summary>
        ISerializer<TValue> ValueSerializer { get; }

        /// <summary>
        ///     Refer to <see cref="Producer{TKey, TValue}.ProduceAsync(string, TKey, TValue)"/>.
        /// </summary>
        Task<Message<TKey, TValue>> ProduceAsync(string topic, TKey key, TValue val);

        /// <summary>
        ///     Refer to <see cref="Producer{TKey, TValue}.ProduceAsync(string, TKey, TValue, int, bool)"/>.
        /// </summary>
        Task<Message<TKey, TValue>> ProduceAsync(string topic, TKey key, TValue val, int partition, bool blockIfQueueFull);

        /// <summary>
        ///     Refer to <see cref="Producer{TKey, TValue}.ProduceAsync(string, TKey, TValue, int)"/>.
        /// </summary>
        Task<Message<TKey, TValue>> ProduceAsync(string topic, TKey key, TValue val, int partition);

        /// <summary>
        ///     Refer to <see cref="Producer{TKey, TValue}.ProduceAsync(string, TKey, TValue, bool)"/>.
        /// </summary>
        Task<Message<TKey, TValue>> ProduceAsync(string topic, TKey key, TValue val, bool blockIfQueueFull);

        /// <summary>
        ///     Refer to <see cref="Producer{TKey, TValue}.ProduceAsync(string, TKey, TValue, IDeliveryHandler{TKey, TValue})"/>.
        /// </summary>
        void ProduceAsync(string topic, TKey key, TValue val, IDeliveryHandler<TKey, TValue> deliveryHandler);

        /// <summary>
        ///     Refer to <see cref="Producer{TKey, TValue}.ProduceAsync(string, TKey, TValue, int, bool, IDeliveryHandler{TKey, TValue})"/>.
        /// </summary>
        void ProduceAsync(string topic, TKey key, TValue val, int partition, bool blockIfQueueFull, IDeliveryHandler<TKey, TValue> deliveryHandler);

        /// <summary>
        ///     Refer to <see cref="Producer{TKey, TValue}.ProduceAsync(string, TKey, TValue, int, IDeliveryHandler{TKey, TValue})"/>.
        /// </summary>
        void ProduceAsync(string topic, TKey key, TValue val, int partition, IDeliveryHandler<TKey, TValue> deliveryHandler);

        /// <summary>
        ///     Refer to <see cref="Producer{TKey, TValue}.ProduceAsync(string, TKey, TValue, bool, IDeliveryHandler{TKey, TValue})"/>.
        /// </summary>
        void ProduceAsync(string topic, TKey key, TValue val, bool blockIfQueueFull, IDeliveryHandler<TKey, TValue> deliveryHandler);
    }
}


text:
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('impress-slide', 'Integration | Component | impress slide', {
  integration: true
});

test('it renders', function(assert) {
  assert.expect(2);

  // Set any properties with this.set('myProperty', 'value');
  // Handle any actions with this.on('myAction', function(val) { ... });

  this.render(hbs`{{impress-slide}}`);

  assert.equal(this.$().text().trim(), '');

  // Template block usage:
  this.render(hbs`
    {{#impress-slide }}
      template block text
    {{/impress-slide}}
  `);

  assert.equal(this.$().text().trim(), 'template block text');
});

test('it received all of its data attributes', function(assert) {
  this.render(hbs`{{impress-slide
    id='hello'
    classNames='world'
    x='x'
    y='y'
    z='z'
    scale='scale'
    rotate='rotate'
    rotateY='rotateY'
    rotateZ='rotatez'
    }}`);

  let dataAttrs = $('#hello').data();
  assert.equal(Object.getOwnPropertyNames(dataAttrs).length, 7, 'Slide data attributes were successfully provided');
});


text:
package org.nlpcn.es4sql.query;

import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestBuilder;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.reindex.DeleteByQueryRequestBuilder;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * Created by Eliran on 19/8/2015.
 */
public class SqlElasticDeleteByQueryRequestBuilder implements SqlElasticRequestBuilder {
    DeleteByQueryRequestBuilder deleteByQueryRequestBuilder;

    public SqlElasticDeleteByQueryRequestBuilder(DeleteByQueryRequestBuilder deleteByQueryRequestBuilder) {
        this.deleteByQueryRequestBuilder = deleteByQueryRequestBuilder;
    }

    @Override
    public ActionRequest request() {
        return deleteByQueryRequestBuilder.request();
    }

    @Override
    public String explain() {
        try {
            SearchRequestBuilder source = deleteByQueryRequestBuilder.source();
            return source.toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    @Override
    public ActionResponse get() {

        return this.deleteByQueryRequestBuilder.get();
    }

    @Override
    public ActionRequestBuilder getBuilder() {
        return deleteByQueryRequestBuilder;
    }

}


text:
public class Solution {
    public List<Integer> findSubstring(String s, String[] words) {
        List<Integer> res = new ArrayList();
        int n = s.length(), m = words.length, k;
        if (n == 0 || m == 0 || (k = words[0].length()) == 0) return res;

        Map<String, Integer> dict = new HashMap();
        for (String word : words)
            dict.put(word, dict.getOrDefault(word, 0) + 1);

        Map<String, Integer> curdict = new HashMap();

        int start = 0, len = m * k;
        String test, tmp;
        for (int i = 0; i < k; i++) {
            curdict.clear();
            start = i;
            if (start + len > n) return res;
            for (int j = i; j + k <= n; j += k) {
                test = s.substring(j, j + k);
                if (dict.containsKey(test)) {
                    if (!curdict.containsKey(test) || curdict.get(test) < dict.get(test)) {
                        curdict.put(test, curdict.getOrDefault(test, 0) + 1);
                        if (start + len == j + k) {
                            res.add(start);

                            // remove s.substring(start, start + k)
                            decreaseCount(curdict, s.substring(start, start + k));

                            // move window to right, move start to start + k
                            start += k;
                        }
                        continue;
                    }

                    // if curdict.get(test) == dict.get(test)
                    // find the first substring that equals test
                    while (!(tmp = s.substring(start, start + k)).equals(test)) {
                        decreaseCount(curdict, tmp);
                        start += k;
                    }
                    // and skip one substring that equals test
                    start += k;
                    if (start + len > n) break;
                    continue;
                }
                // if dict not contains test, move start k steps right
                start = j + k;
                if (start + len > n) break;
                curdict.clear();
            }
        }
        return res;
    }

    private void decreaseCount(Map<String ,Integer> curdict, String tmp) {
        if (curdict.get(tmp) == 1)
            curdict.remove(tmp);
        else
            curdict.put(tmp, curdict.get(tmp) - 1);
    }
}


text:
package pl.edu.agh.scalamas.mas.logic

import pl.edu.agh.scalamas.mas.LogicTypes.{BehaviourFunction, Behaviour}

/**
 * Created by Daniel on 2015-01-14.
 */
trait BehaviourStrategy {

  def behaviourStrategy: BehaviourProvider

  trait BehaviourProvider {

    def behaviours: Seq[Behaviour]

    def behaviourFunction: BehaviourFunction
  }

}


text:
package com.speakingfish.protocol.ssp.path;

import com.speakingfish.common.function.Mapper;
import com.speakingfish.protocol.ssp.Any;
import com.speakingfish.protocol.ssp.AnyPathValue;
import com.speakingfish.protocol.ssp.PathValueVisitor;
import com.speakingfish.protocol.ssp.PathVisitor;

public class AnyPathExprImpl<
    R, R_Any  extends Any<R>,
    T, T_Any  extends Any<T>,
    N, N_Any  extends Any<N>,
    T_SubPath extends AnyPathValue<
        R, R_Any,
        N, N_Any>
> extends AnyPathContinuationImpl<
    R, R_Any,
    T, T_Any,
    N, N_Any,
    T_SubPath
> {

    protected final Mapper<N_Any, T_Any> _selectNext;

    public AnyPathExprImpl(T_Any value, Mapper<N_Any, T_Any> selectNext, T_SubPath next) {
        super(value, next);
        _selectNext = selectNext;
    }

    @Override public N_Any next(T_Any current) {
        return _selectNext.apply(current);
    }

    public void visitForward(PathValueVisitor<R, R_Any> visitor) {
        throw new UnsupportedOperationException();
    }

    public void visitBackward(PathValueVisitor<R, R_Any> visitor) {
        throw new UnsupportedOperationException();
    }

    public void visitForward(T_Any src, PathValueVisitor<R, R_Any> visitor) {
        final N_Any result = next(src);
        if(null != result) {
            next().visitForward(result, visitor);
        }
    }

    public void visitBackward(T_Any src, PathValueVisitor<R, R_Any> visitor) {
        throw new UnsupportedOperationException();
    }

    @Override public void visit(PathVisitor<R, R_Any> visitor) {
        throw new UnsupportedOperationException();
    }

}


text:
{% extends "user_map/base_page.html" %}
{% load leaflet_tags %}
{% load bootstrap %}

{% block head_resources %}
  {{ block.super }}
  {% leaflet_js plugins="forms" %}
  {% leaflet_css plugins="forms" %}
{% endblock head_resources %}

{% block main_content %}
   {{ block.super }}

Sign In
Please provide your account information on the form
      below.

      {% if messages %}
        {% for message in messages %}
          {% if 'success' in message.tags %}

              x
              {{ message }}

          {% endif %}
        {% endfor %}
      {% endif %}

      <form class="form-horizontal" action='#' method='POST'>
        {% csrf_token %}
        {{ form|bootstrap_horizontal:'col-lg-3'}}

            <input type="submit" value="Sign In" class="btn btn-default">

          Forgot your password?

      </form>

{% endblock main_content %}

{% block js_container %}
  {{ block.super }}
{% endblock js_container %}


text:
All Notable changes to this repo will be documented in this file

## 3.0.1 - 2015-01-31

### Added
- Nothing

### Deprecated
- Nothing

### Fixed
- Updates to Readme.md file

### Security
- Including Cloudflare's HTTPS plugin via Composer

## 3.0.0 - 2015-01-30

### Added
- Move to Bedrock boilerplate
- Moved theme to its own repo, include it via Composer

### Deprecated
- Nothing

### Fixed
- Nothing

### Security
- Nothing

## 2.0.1 - 2015-12-14

### Added
- Nothing

### Deprecated
- Nothing

### Fixed
- Typography and styling updates

### Security
- Nothing

## 2.0.0 - 2015-12-4

### Added
- Initial release

### Deprecated
- Nothing

### Fixed
- Nothing

### Security
- Nothing


text:
#include <xenia/gpu/nop/nop_gpu.h>

#include <xenia/gpu/nop/nop_graphics_system.h>

using namespace xe;
using namespace xe::gpu;
using namespace xe::gpu::nop;

namespace {
  void InitializeIfNeeded();
  void CleanupOnShutdown();

  void InitializeIfNeeded() {
    static bool has_initialized = false;
    if (has_initialized) {
      return;
    }
    has_initialized = true;

    //

    atexit(CleanupOnShutdown);
  }

  void CleanupOnShutdown() {
  }
}

GraphicsSystem* xe::gpu::nop::Create(Emulator* emulator) {
  InitializeIfNeeded();
  return new NopGraphicsSystem(emulator);
}