Examples of Env


Examples of org.apache.etch.interoptester.Env

 
  /** @throws Exception */
  @Test
  public void parse11() throws Exception
  {
    Env e = Env.parse( parseXml( "<env name=\"bar\">s{blag}t</env>" ) );
    assertEquals( "bar", e.name() );
    assertEquals( "s{blag}t", e.value( args ) );
  }
View Full Code Here

Examples of org.apache.etch.interoptester.Env

 
  /** @throws Exception */
  @Test
  public void parse12() throws Exception
  {
    Env e = Env.parse( parseXml( "<env name=\"foo\" value=\"s{blag}t\"/>" ) );
    assertEquals( "foo", e.name() );
    assertEquals( "s{blag}t", e.value( args ) );
  }
View Full Code Here

Examples of org.apache.etch.interoptester.Env

 
  /** @throws Exception */
  @Test
  public void parse13() throws Exception
  {
    Env e = Env.parse( parseXml( "<env name=\"bar\">{bar}</env>" ) );
    assertEquals( "bar", e.name() );
    assertEquals( "123", e.value( args ) );
  }
View Full Code Here

Examples of org.apache.etch.interoptester.Env

 
  /** @throws Exception */
  @Test
  public void parse14() throws Exception
  {
    Env e = Env.parse( parseXml( "<env name=\"foo\" value=\"{bar}\"/>" ) );
    assertEquals( "foo", e.name() );
    assertEquals( "123", e.value( args ) );
  }
View Full Code Here

Examples of org.apache.etch.interoptester.Env

 
  /** @throws Exception */
  @Test
  public void parse15() throws Exception
  {
    Env e = Env.parse( parseXml( "<env name=\"bar\">x{baz}y</env>" ) );
    assertEquals( "bar", e.name() );
    assertEquals( "x456y", e.value( args ) );
  }
View Full Code Here

Examples of org.apache.etch.interoptester.Env

 
  /** @throws Exception */
  @Test
  public void parse16() throws Exception
  {
    Env e = Env.parse( parseXml( "<env name=\"foo\" value=\"x{baz}y\"/>" ) );
    assertEquals( "foo", e.name() );
    assertEquals( "x456y", e.value( args ) );
  }
View Full Code Here

Examples of org.fusesource.lmdbjni.Env

    private Env env;
    private String directory;

    public LMDBDataInterfaceFactory(CachesManager cachesManager, MemoryManager memoryManager, String directory) {
        super(cachesManager, memoryManager);
        env = new Env();
        env.setMaxDbs(100);
        env.setMapSize(200 * 1024 * 1024); //needs to be quite high, otherwise we get EINVAL or MDB_MAP_FULL errors
        File directoryAsFile = new File(directory);
        if (directoryAsFile.isFile()) {
            throw new RuntimeException("Path " + directoryAsFile.getAbsolutePath() + " is a file! Expected a directory...");
View Full Code Here

Examples of org.lilypondbeans.jccparser.reparse.Env

            if (nd.id == ParserTreeConstants.JJTSCORE) {
                bookOrScoreFound = true;
                ASTScore sc = (ASTScore) nd;
                sc.root = this;
                if (this.childContexts.size() == 0) {
                    Env env=new Env();
                    env.currentScore=sc;
                    this.createVirtualContextIfNeeded(env, ASTContext.TYPE_BOOK, sc);
                } else {
                    ASTBook book = (ASTBook) this.childContexts.get(0);
                    sc.setParentContext(book);
                }
            }
        }
        parsedScore = null;
        if (bookOrScoreFound) {
            parsedScore = findScore(scoreNr, midi);
        } else {
            //if nothing found->took first Block and create Score manuell
            for (int x = 0; x < jjtGetNumChildren(); x++) {
                SimpleNode nd = jjtGetChild(x);
                if (nd.id == ParserTreeConstants.JJTBLOCK) {
                    ASTBlock sc = (ASTBlock) nd;
                    sc.root = this;
                    sc.root.createVirtualContextIfNeeded(new Env(), ASTContext.TYPE_SCORE, nd);
                    parsedScore = (ASTScore) nd.getParentContext();
                    break;
                }
            }
        }

        Env env = new Env();
        env.currentContext = this;
        for (int x = 0; x < jjtGetNumChildren(); x++) {
            SimpleNode nd = jjtGetChild(x);
            if (nd.id == ParserTreeConstants.JJTSCORE || nd.id == ParserTreeConstants.JJTBOOK
                    || (nd.id == ParserTreeConstants.JJTBLOCK && ((ASTBlock) nd).getParentContext() == parsedScore))
View Full Code Here

Examples of org.ozoneDB.core.Env

     * This constructor will only be called, when the object is constructed
     * from a stream.
     */
    public OzoneProxy() {
        //we assume that we are inside the kernel
        Env env = Env.currentEnv();
        if (env != null) {
            link = env.database;
        }
    }
View Full Code Here

Examples of water.cascade.Env

  }

  abstract double op( double d0, double d1 );
  @Override void apply(Env global, Env local) {
    // Expect we can broadcast across all functions as needed.
    Env env = local == null ? global : local;
    Frame fr0 = null, fr1 = null;
    double d0=0, d1=0;
    if( env.isAry() ) fr1 = (Frame) env.pop(); else d1 = (double)env.pop()//String k0 = env.key();
    if( env.isAry() ) fr0 = (Frame) env.pop(); else d0 = (double)env.pop()//String k1 = env.key();
    if( fr0==null && fr1==null ) {
      env.push(op(d0, d1));
      return;
    }
    final boolean lf = fr0 != null;
    final boolean rf = fr1 != null;
    final double df0 = d0, df1 = d1;
    Frame fr  = null;           // Do-All frame
    int ncols = 0;              // Result column count
    if( fr0 !=null ) {          // Left?
      ncols = fr0.numCols();
      if( fr1 != null ) {
        if( fr0.numCols() != fr1.numCols() ||
                fr0.numRows() != fr1.numRows() )
          throw new IllegalArgumentException("Arrays must be same size: "+fr0+" vs "+fr1);
        fr = new Frame(fr0).add(fr1);
      } else {
        fr = fr0;
      }
    } else {
      ncols = fr1.numCols();
      fr = fr1;
    }
    final ASTBinOp bin = this// Final 'this' so can use in closure

    // Run an arbitrary binary op on one or two frames & scalars
    Frame fr2 = new MRTask() {
      @Override public void map( Chunk chks[], NewChunk nchks[] ) {
        for( int i=0; i<nchks.length; i++ ) {
          NewChunk n =nchks[i];
          int rlen = chks[0].len();
          Chunk c0 = chks[i];
          if( (!c0.vec().isEnum() &&
                  !(lf && rf && chks[i+nchks.length].vec().isEnum())) ||
                  bin instanceof ASTEQ ||
                  bin instanceof ASTNE ) {
            for( int r=0; r<rlen; r++ ) {
              double lv; double rv;
              if (lf) {
                if(chks[i].isNA0(r)) { n.addNum(Double.NaN); continue; }
                lv = chks[i].at0(r);
              } else {
                if (Double.isNaN(df0)) { n.addNum(Double.NaN); continue; }
                lv = df0;
              }
              if (rf) {
                if(chks[i].isNA0(r)) { n.addNum(Double.NaN); continue; }
                rv = chks[i+(lf ? nchks.length:0)].at0(r);
              } else {
                if (Double.isNaN(df1)) { n.addNum(Double.NaN); continue; }
                rv = df1;
              }
              n.addNum(bin.op(lv, rv));
            }
          } else {
            for( int r=0; r<rlen; r++ n.addNA();
          }
        }
      }
    }.doAll(ncols,fr).outputFrame((lf ? fr0 : fr1)._names,null);
    env.push(fr2);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.