A VoltDB extension
426658
public Object mod(Object a, Object b) {

         if (a == null || b == null) {
             return null;
         }

         switch (typeCode) {

             case Types.SQL_REAL :
             case Types.SQL_FLOAT :
             case Types.SQL_DOUBLE : {
                 double ad = ((Number) a).doubleValue();
                 double bd = ((Number) b).doubleValue();

                 if (bd == 0) {
                     throw Error.error(ErrorCode.X_22012);
                 }

                 return ValuePool.getDouble(Double.doubleToLongBits(ad % bd));
             }
            case Types.SQL_DECIMAL : {
                if ((b).equals(0)) {
                     throw Error.error(ErrorCode.X_22012);
                }

                return ValuePool.getBigDecimal(((BigDecimal) a).remainder((BigDecimal) b));
             }
             case Types.TINYINT :
             case Types.SQL_SMALLINT :
             case Types.SQL_INTEGER : {
                 int ai = ((Number) a).intValue();
                 int bi = ((Number) b).intValue();

                 if (bi == 0) {
                     throw Error.error(ErrorCode.X_22012);
                 }

                 return ValuePool.getInt(ai % bi);
             }
             case Types.SQL_BIGINT : {
                 long al = ((Number) a).longValue();
                 long bl = ((Number) b).longValue();

                 if (bl == 0) {
                     throw Error.error(ErrorCode.X_22012);
                 }

                 return ValuePool.getLong(al % bl);
             }
             default :
                 throw Error.runtimeError(ErrorCode.U_S0500, "NumberType");
         }
     }
1322741
def exportdb():
    '''
    
    '''

    cmd = 'udevadm info --export-db'
    udev_result = __salt__['cmd.run_all'](cmd, output_loglevel='quiet')

    if udev_result['retcode']:
        raise CommandExecutionError(udev_result['stderr'])

    return _parse_udevadm_info(udev_result['stdout'])
487816
private ArrayDBIDs computeM_current(DBIDs m, DBIDs m_best, DBIDs m_bad, Random random) {
    ArrayModifiableDBIDs m_list = DBIDUtil.newArray(m);
    m_list.removeDBIDs(m_best);
    DBIDArrayMIter it = m_list.iter();

    ArrayModifiableDBIDs m_current = DBIDUtil.newArray();
    for(DBIDIter iter = m_best.iter(); iter.valid(); iter.advance()) {
      if(m_bad.contains(iter)) {
        int currentSize = m_current.size();
        while(m_current.size() == currentSize) {
          m_current.add(it.seek(random.nextInt(m_list.size())));
          it.remove();
        }
      }
      else {
        m_current.add(iter);
      }
    }

    return m_current;
  }
835183
public static Vector getDatabaseURIs() {

        Vector   v  = new Vector();
        // A VoltDB extension to work around ENG-6044
        /* disable 1 line ...
        Iterator it = databaseIDMap.values().iterator();
           ... disabled 1 line */
        java.util.Iterator<Database> it = databaseIDMap.values().iterator();
        // End of VoltDB extension

        while (it.hasNext()) {
            Database db = (Database) it.next();

            v.addElement(db.getURI());
        }

        return v;
    }
1291929
private void processCreateStreamStatement(DDLStatement stmt, Database db, DdlProceduresToLoad whichProcs)
            throws VoltCompilerException {
        String statement = stmt.statement;
        Matcher statementMatcher = SQLParser.matchCreateStream(statement);
        if (statementMatcher.matches()) {
            // check the table portion
            String tableName = checkIdentifierStart(statementMatcher.group(1), statement);
            String targetName = null;
            String columnName = null;

            // Parse the EXPORT and PARTITION clauses.
            if ((statementMatcher.groupCount() > 1) &&
                (statementMatcher.group(2) != null) &&
                (!statementMatcher.group(2).isEmpty())) {
                String clauses = statementMatcher.group(2);
                Matcher matcher = SQLParser.matchAnyCreateStreamStatementClause(clauses);
                int start = 0;
                while ( matcher.find(start)) {
                    start = matcher.end();

                    if (matcher.group(1) != null) {
                        // Add target info if it's an Export clause. Only one is allowed
                        if (targetName != null) {
                            throw m_compiler.new VoltCompilerException(
                                "Only one Export clause is allowed for CREATE STREAM.");
                        }
                        targetName = matcher.group(1);
                    }
                    else {
                        // Add partition info if it's a PARTITION clause. Only one is allowed.
                        if (columnName != null) {
                            throw m_compiler.new VoltCompilerException(
                                "Only one PARTITION clause is allowed for CREATE STREAM.");
                        }
                        columnName = matcher.group(2);
                    }
                }
            }
            VoltXMLElement tableXML = m_schema.findChild("table", tableName.toUpperCase());
            if (tableXML != null) {
                tableXML.attributes.put("stream", "true");
            } else {
                throw m_compiler.new VoltCompilerException(String.format(
                        "Invalid STREAM statement: table %s does not exist", tableName));
            }
            // process partition if specified
            if (columnName != null) {
                tableXML.attributes.put("partitioncolumn", columnName.toUpperCase());
                // Column validity check done by VoltCompiler in post-processing

                // mark the table as dirty for the purposes of caching sql statements
                m_compiler.markTableAsDirty(tableName);
            }

            // process export
            targetName = (targetName != null) ? checkIdentifierStart(
                    targetName, statement) : Constants.DEFAULT_EXPORT_CONNECTOR_NAME;

            if (tableXML.attributes.containsKey("drTable") && "ENABLE".equals(tableXML.attributes.get("drTable"))) {
                throw m_compiler.new VoltCompilerException(String.format(
                        "Invalid CREATE STREAM statement: table %s is a DR table.", tableName));
            } else {
                tableXML.attributes.put("export", targetName);
            }
        } else {
            throw m_compiler.new VoltCompilerException(String.format("Invalid CREATE STREAM statement: \"%s\", "
                    + "expected syntax: CREATE STREAM <table> [PARTITION ON COLUMN <column-name>] [EXPORT TO TARGET <target>] (column datatype, ...); ",
                    statement.substring(0, statement.length() - 1)));
        }
    }
351237
private List<String> configureNoDB(final String argv[], final int currentIdx) throws DevFailed {
        final List<String> noDbDevices = new ArrayList<String>();
        if (!ArrayUtils.contains(argv, NODB)) {
            throw DevFailedUtils.newDevFailed(INIT_ERROR, getUsage());
        } else {
            for (int j = currentIdx + 1; j < argv.length; j++) {
                if (!argv[j].startsWith("-")) {
                    // several devices separated by commons
                    final String[] devices = argv[j].split(",");
                    if (devices.length > 1) {
                        Collections.addAll(noDbDevices, devices);
                    } else {
                        noDbDevices.add(argv[j]);
                    }
                    logger.warn("Device with no db: " + argv[j]);
                } else {
                    break;
                }
            }
            // only one class can be loaded with no db (the last one)
            DatabaseFactory.setNoDbDevices(noDbDevices.toArray(new String[0]), lastClass);
        }
        return noDbDevices;

    }
745640
private static void notifyServers(Database db) {

        Iterator it = serverMap.keySet().iterator();

        for (; it.hasNext(); ) {
            Server  server    = (Server) it.next();
            HashSet databases = (HashSet) serverMap.get(server);

            if (databases.contains(db)) {
// A VoltDB extension to disable a package dependency
/* disable 2 lines ...
                server.notify(ServerConstants.SC_DATABASE_SHUTDOWN,
                              db.databaseID);
... disabled 2 lines */
// End of VoltDB extension
            }
        }
    }
878143
long executeSQL(boolean isFinal) throws VoltAbortException {
        long count = 0;
        VoltTable[] results = voltExecuteSQL(isFinal);
        for (VoltTable result : results) {
            long dmlUpdated = result.asScalarLong();
            if (dmlUpdated == 0) {
                throw new VoltAbortException("Insert failed for tuple.");
            }
            if (dmlUpdated > 1) {
                throw new VoltAbortException("Insert modified more than one tuple.");
            }
            ++count;
        }
        return count;
    }
828896
def _call_vecfield_p(self, vf, out):
        """"""
        # Optimization for 1 component - just absolute value (maybe weighted)
        if len(self.domain) == 1:
            vf[0].ufuncs.absolute(out=out)
            if self.is_weighted:
                out *= self.weights[0] ** (1 / self.exponent)
            return

        # Initialize out, avoiding one copy
        self._abs_pow_ufunc(vf[0], out=out, p=self.exponent)
        if self.is_weighted:
            out *= self.weights[0]

        tmp = self.range.element()
        for fi, wi in zip(vf[1:], self.weights[1:]):
            self._abs_pow_ufunc(fi, out=tmp, p=self.exponent)
            if self.is_weighted:
                tmp *= wi
            out += tmp

        self._abs_pow_ufunc(out, out=out, p=(1 / self.exponent))
1150471
private function _voltage()
    {
        if (isset($this->_filecontent["volt"]) && (trim($this->_filecontent["volt"]) !== "")) {
            $values = preg_split("/ /", trim($this->_filecontent["volt"]));
            foreach ($values as $id=>$value) {
                $dev = new SensorDevice();
                $dev->setName("in".$id);
                $dev->setValue($value);
                $this->mbinfo->setMbVolt($dev);
            }
        }
    }
754350
VoltXMLElement voltAnnotateFunctionXML(VoltXMLElement exp)
    {
        // XXX Should this throw HSQLParseException instead?
        assert(getType() == OpTypes.SQL_FUNCTION);

        exp.attributes.put("name", name);
        exp.attributes.put("valuetype", dataType.getNameString());
        if (parameterArg != -1) {
            exp.attributes.put("result_type_parameter_index", String.valueOf(parameterArg));
        }
        int volt_funcType = funcType;

        String implied_argument = null;
        int keywordConstant = 0;

        switch (funcType) {
        case FUNC_SUBSTRING_CHAR :
            // A little tweaking is needed here because VoltDB wants to define separate functions for 2-argument and 3-argument SUBSTRING
            if (nodes.length == 2 || nodes[2] == null) {
                volt_funcType = FUNC_VOLT_SUBSTRING_CHAR_FROM;
            }
            exp.attributes.put("function_id", String.valueOf(volt_funcType));
            return exp;

            // A little tweaking is needed in some other cases because VoltDB
        	// wants to define separate functions for each leading keyword
        	// argument, eliminating the hard-coded node[0] value.

        case FUNC_TRIM_CHAR :
            implied_argument = null;
            keywordConstant = ((Integer) nodes[0].valueData).intValue();
            switch (keywordConstant) {

                case Tokens.BOTH :
                    implied_argument = "BOTH";
                    break;

                case Tokens.LEADING :
                    implied_argument = "LEADING";
                    break;

                case Tokens.TRAILING :
                    implied_argument = "TRAILING";
                    break;

                default :
                    throw Error.runtimeError(ErrorCode.U_S0500,
                                             "FunctionSQL");
            }
            assert(implied_argument != null);
            exp.attributes.put("function_id", String.valueOf(keywordConstant + SQL_TRIM_VOLT_FUNC_OFFSET));
            exp.attributes.put("implied_argument", implied_argument);
            // Having accounted for the first argument, remove it from the child expression list.
            exp.children.remove(0);
            return exp;

        case FUNC_EXTRACT :
            implied_argument = null;
            keywordConstant = ((Integer) nodes[0].valueData).intValue();
            switch (keywordConstant) {
            case Tokens.DAY_NAME :
            // case DTIType.DAY_NAME :
                implied_argument = "DAY_NAME";
                break;
            case Tokens.MONTH_NAME :
            // case DTIType.MONTH_NAME :
                implied_argument = "MONTH_NAME";
                break;
            case Tokens.QUARTER :
            // case DTIType.QUARTER :
                implied_argument = "QUARTER";
                break;
            case Tokens.DAY_OF_YEAR :
            // case DTIType.DAY_OF_YEAR :
                implied_argument = "DAY_OF_YEAR";
                break;
            case Tokens.WEEKDAY :
                implied_argument = "WEEKDAY";
                break;
            case Tokens.DAY_OF_WEEK :
            // case DTIType.DAY_OF_WEEK :
                implied_argument = "DAY_OF_WEEK";
                break;
            case Tokens.WEEK:
                keywordConstant = Tokens.WEEK_OF_YEAR;
            case Tokens.WEEK_OF_YEAR :
            // case DTIType.WEEK_OF_YEAR :
                implied_argument = "WEEK_OF_YEAR";
                break;
            case Types.SQL_INTERVAL_YEAR :
                implied_argument = "INTERVAL_YEAR";
                break;
            case Types.SQL_INTERVAL_MONTH :
                implied_argument = "SQL_INTERVAL_MONTH";
                break;
            case Types.SQL_INTERVAL_DAY :
                implied_argument = "SQL_INTERVAL_DAY";
                break;
            case Types.SQL_INTERVAL_HOUR :
                implied_argument = "SQL_INTERVAL_HOUR";
                break;
            case Types.SQL_INTERVAL_MINUTE :
                implied_argument = "SQL_INTERVAL_MINUTE";
                break;
            case Types.SQL_INTERVAL_SECOND :
                implied_argument = "SQL_INTERVAL_SECOND";
                break;
            case Tokens.YEAR :
                implied_argument = "YEAR";
                break;
            case Tokens.MONTH :
                implied_argument = "MONTH";
                break;
            case Tokens.DAY_OF_MONTH :
            // case DTIType.DAY_OF_MONTH :
                keywordConstant = Tokens.DAY;
            case Tokens.DAY :
                implied_argument = "DAY";
                break;
            case Tokens.HOUR :
                implied_argument = "HOUR";
                break;
            case Tokens.MINUTE :
                implied_argument = "MINUTE";
                break;
            case Tokens.SECOND :
                implied_argument = "SECOND";
                break;
            case Tokens.SECONDS_MIDNIGHT :
            // case DTIType.SECONDS_MIDNIGHT :
                implied_argument = "SECONDS_MIDNIGHT";
                break;
            case Tokens.TIMEZONE_HOUR :
            // case DTIType.TIMEZONE_HOUR :
                implied_argument = "TIMEZONE_HOUR";
                break;
            case Tokens.TIMEZONE_MINUTE :
            // case DTIType.TIMEZONE_MINUTE :
                implied_argument = "TIMEZONE_MINUTE";
                break;
            default :
                throw Error.runtimeError(ErrorCode.U_S0500, "DateTimeTypeForVoltDB: " + String.valueOf(keywordConstant));
            }

            assert(implied_argument != null);
            exp.attributes.put("function_id", String.valueOf(keywordConstant + SQL_EXTRACT_VOLT_FUNC_OFFSET));
            exp.attributes.put("implied_argument", implied_argument);
            // Having accounted for the first argument, remove it from the child expression list.
            exp.children.remove(0);
            return exp;

        case FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_SINCE_EPOCH :
            implied_argument = null;
            keywordConstant = ((Integer) nodes[0].valueData).intValue();
            int since_epoch_func = -1;
            switch (keywordConstant) {
            case Tokens.SECOND :
                implied_argument = "SECOND";
                since_epoch_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_SINCE_EPOCH_SECOND;
                break;
            case Tokens.MILLIS :
            case Tokens.MILLISECOND:
                implied_argument = "MILLISECOND";
                since_epoch_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_SINCE_EPOCH_MILLISECOND;
                break;
            case Tokens.MICROS :
            case Tokens.MICROSECOND :
                implied_argument = "MICROSECOND";
                since_epoch_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_SINCE_EPOCH_MICROSECOND;
                break;
            default:
                throw Error.runtimeError(ErrorCode.U_S0500, "DateTimeTypeForVoltDB: " + String.valueOf(keywordConstant));
            }

            assert(implied_argument != null);
            assert(-1 != since_epoch_func);
            exp.attributes.put("function_id", String.valueOf(since_epoch_func));
            exp.attributes.put("implied_argument", implied_argument);

            // Having accounted for the first argument, remove it from the child expression list.
            exp.children.remove(0);
            return exp;

        case FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TO_TIMESTAMP :
            implied_argument = null;
            keywordConstant = ((Integer) nodes[0].valueData).intValue();
            int to_timestamp_func = -1;
            switch (keywordConstant) {
            case Tokens.SECOND :
                implied_argument = "SECOND";
                to_timestamp_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TO_TIMESTAMP_SECOND;
                break;
            case Tokens.MILLIS :
            case Tokens.MILLISECOND :
                implied_argument = "MILLISECOND";
                to_timestamp_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TO_TIMESTAMP_MILLISECOND;
                break;
            case Tokens.MICROS :
            case Tokens.MICROSECOND :
                implied_argument = "MICROSECOND";
                to_timestamp_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TO_TIMESTAMP_MICROSECOND;
                break;
            default:
                throw Error.runtimeError(ErrorCode.U_S0500, "DateTimeTypeForVoltDB: " + String.valueOf(keywordConstant));
            }

            assert(-1 != to_timestamp_func);
            exp.attributes.put("function_id", String.valueOf(to_timestamp_func));
            exp.attributes.put("implied_argument", implied_argument);

            // Having accounted for the first argument, remove it from the child expression list.
            exp.children.remove(0);
            return exp;

        case FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TRUNCATE_TIMESTAMP :
            implied_argument = null;
            keywordConstant = ((Integer) nodes[0].valueData).intValue();
            int truncate_func = -1;
            switch (keywordConstant) {
            case Tokens.YEAR :
                implied_argument = "YEAR";
                truncate_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TRUNCATE_YEAR;
                break;
            case Tokens.QUARTER :
                implied_argument = "QUARTER";
                truncate_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TRUNCATE_QUARTER;
                break;
            case Tokens.MONTH :
                implied_argument = "MONTH";
                truncate_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TRUNCATE_MONTH;
                break;
            case Tokens.DAY :
                implied_argument = "DAY";
                truncate_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TRUNCATE_DAY;
                break;
            case Tokens.HOUR :
                implied_argument = "HOUR";
                truncate_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TRUNCATE_HOUR;
                break;
            case Tokens.MINUTE :
                implied_argument = "MINUTE";
                truncate_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TRUNCATE_MINUTE;
                break;
            case Tokens.SECOND :
                implied_argument = "SECOND";
                truncate_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TRUNCATE_SECOND;
                break;
            case Tokens.MILLIS:
            case Tokens.MILLISECOND :
                implied_argument = "MILLISECOND";
                truncate_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TRUNCATE_MILLISECOND;
                break;
            case Tokens.MICROS:
            case Tokens.MICROSECOND :
                implied_argument = "MICROSECOND";
                truncate_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_TRUNCATE_MICROSECOND;
                break;
            default:
                throw Error.runtimeError(ErrorCode.U_S0500, "DateTimeTypeForVoltDB: " + String.valueOf(keywordConstant));
            }

            assert(implied_argument != null);
            assert(-1 != truncate_func);
            exp.attributes.put("function_id", String.valueOf(truncate_func));
            exp.attributes.put("implied_argument", implied_argument);

            // Having accounted for the first argument, remove it from the child expression list.
            exp.children.remove(0);
            return exp;

        case FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DISTANCE :
            Type leftChildType = nodes[0].dataType;
            Type rightChildType = nodes[1].dataType;

            // in here the only cases needed to be handled are distance between polygon-to-point
            // and point-to-point.
            assert(leftChildType.isGeographyType() || leftChildType.isGeographyPointType());
            assert(rightChildType.isGeographyPointType());

            if (leftChildType.isGeographyType()) {
                exp.attributes.put("function_id", String.valueOf(FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DISTANCE_POLYGON_POINT));
            }
            else {
                exp.attributes.put("function_id", String.valueOf(FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DISTANCE_POINT_POINT));
            }
            return exp;

        case FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DWITHIN:
            Type firstArgType = nodes[0].dataType;
            Type secondArgType = nodes[1].dataType;
            Type thirdArgType = nodes[2].dataType;

            // valid first and second arguments are geo types
            // third argument, distance, is a numeric type
            // resolveTypes() has logic to perform the type-validity for arguments
            assert(firstArgType.isGeographyType() || firstArgType.isGeographyPointType());
            assert(secondArgType.isGeographyPointType());
            assert(thirdArgType.isNumberType());

            if (firstArgType.isGeographyType()) {
                exp.attributes.put("function_id", String.valueOf(FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DWITHIN_POLYGON_POINT));
            }
            else {
                exp.attributes.put("function_id", String.valueOf(FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DWITHIN_POINT_POINT));
            }
            return exp;

        case FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_ASTEXT:
            // only valid types for asText are geography and geography-point
            // resolveTypes in FunctionForVoltDB will block any other types
            // as unsupported types
            assert(nodes[0].dataType.isGeographyPointType() || nodes[0].dataType.isGeographyType());

            if (nodes[0].dataType.isGeographyPointType()) {
                exp.attributes.put("function_id", String.valueOf(FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_ASTEXT_GEOGRAPHY_POINT));
            }
            else {
                exp.attributes.put("function_id", String.valueOf(FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_ASTEXT_GEOGRAPHY));
            }
            return exp;

        case FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DATEADD :
            implied_argument = null;
            keywordConstant = ((Integer) nodes[0].valueData).intValue();
            int dateadd_func = -1;
            switch (keywordConstant) {
            case Tokens.YEAR :
                implied_argument = "YEAR";
                dateadd_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DATEADD_YEAR;
                break;
            case Tokens.QUARTER :
                implied_argument = "QUARTER";
                dateadd_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DATEADD_QUARTER;
                break;
            case Tokens.MONTH :
                implied_argument = "MONTH";
                dateadd_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DATEADD_MONTH;
                break;
            case Tokens.DAY :
                implied_argument = "DAY";
                dateadd_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DATEADD_DAY;
                break;
            case Tokens.HOUR :
                implied_argument = "HOUR";
                dateadd_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DATEADD_HOUR;
                break;
            case Tokens.MINUTE :
                implied_argument = "MINUTE";
                dateadd_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DATEADD_MINUTE;
                break;
            case Tokens.SECOND :
                implied_argument = "SECOND";
                dateadd_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DATEADD_SECOND;
                break;
            case Tokens.MILLIS:
            case Tokens.MILLISECOND :
                implied_argument = "MILLISECOND";
                dateadd_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DATEADD_MILLISECOND;
                break;
            case Tokens.MICROS:
            case Tokens.MICROSECOND :
                implied_argument = "MICROSECOND";
                dateadd_func = FunctionForVoltDB.FunctionDescriptor.FUNC_VOLT_DATEADD_MICROSECOND;
                break;
            default:
                throw Error.runtimeError(ErrorCode.U_S0500, "DateTimeTypeForVoltDB: " + String.valueOf(keywordConstant));
            }

            assert(implied_argument != null);
            assert(-1 != dateadd_func);
            exp.attributes.put("function_id", String.valueOf(dateadd_func));
            exp.attributes.put("implied_argument", implied_argument);

            // Having accounted for the first argument, remove it from the child expression list.
            exp.children.remove(0);
            return exp;

        default :
            if (voltDisabled != null) {
                exp.attributes.put("disabled", voltDisabled);
            }
            exp.attributes.put("function_id", String.valueOf(volt_funcType));
            return exp;
        }
    }
43028
def save_volt(elecs, volt, filename):
    
    # bring data in shape
    content = np.column_stack((elecs, volt, np.zeros(len(volt))))

    # save datapoints
    with open(filename, 'w') as fid:
        fid.write('{0}\n'.format(content.shape[0]))
    with open(filename, 'ab') as fid:
        np.savetxt(fid, np.array(content), fmt='%i %i %f %f')
89795
function TXDBState(wid, id) {
  this.wid = wid;
  this.id = id;
  this.tx = 0;
  this.coin = 0;
  this.unconfirmed = 0;
  this.confirmed = 0;
  this.committed = false;
}
154043
public void solveVandermondeSystem(int[] x, byte[][] y, 
                                     int len, int dataStart, int dataLen) {
    assert(x.length <= len && y.length <= len);
    int dataEnd = dataStart + dataLen;
    for (int i = 0; i < len - 1; i++) {
      for (int j = len - 1; j > i; j--) {
        for (int k = dataStart; k < dataEnd; k++) {
          y[j][k] = (byte)(y[j][k] ^ mulTable[x[i]][y[j - 1][k] & 0x000000FF]);
        }
      }
    }
    for (int i = len - 1; i >= 0; i--) {
      for (int j = i + 1; j < len; j++) {
        for (int k = dataStart; k < dataEnd; k++) {
          y[j][k] = (byte)(divTable[y[j][k] & 0x000000FF][x[j] ^ x[j - i - 1]]);
        }
      }
      for (int j = i; j < len - 1; j++) {
        for (int k = dataStart; k < dataEnd; k++) {
          y[j][k] = (byte)(y[j][k] ^ y[j + 1][k]);
        }
      }
    }
  }
686138
def _call(self, f, out):
        """"""
        for vfi, oi, ran_wi, dom_wi in zip(self.vecfield, out,
                                           self.__ran_weights, self.weights):
            vfi.multiply(f, out=oi)
            if not np.isclose(ran_wi, dom_wi):
                oi *= dom_wi / ran_wi
271155
private void fastABOD(Database db, Relation<V> relation, DBIDs ids, WritableDoubleDataStore abodvalues, DoubleMinMax minmaxabod) {
    // Build a kernel matrix, to make O(n^3) slightly less bad.
    SimilarityQuery<V> sq = db.getSimilarityQuery(relation, kernelFunction);
    KernelMatrix kernelMatrix = new KernelMatrix(sq, relation, ids);

    MeanVariance s = new MeanVariance();
    KNNHeap nn = DBIDUtil.newHeap(k);
    for(DBIDIter pA = ids.iter(); pA.valid(); pA.advance()) {
      final double simAA = kernelMatrix.getSimilarity(pA, pA);

      // Choose the k-min nearest
      nn.clear();
      for(DBIDIter nB = relation.iterDBIDs(); nB.valid(); nB.advance()) {
        if(DBIDUtil.equal(nB, pA)) {
          continue;
        }
        double simBB = kernelMatrix.getSimilarity(nB, nB);
        double simAB = kernelMatrix.getSimilarity(pA, nB);
        double sqdAB = simAA + simBB - simAB - simAB;
        if(!(sqdAB > 0.)) {
          continue;
        }
        nn.insert(sqdAB, nB);
      }
      KNNList nl = nn.toKNNList();

      s.reset();
      DoubleDBIDListIter iB = nl.iter(), iC = nl.iter();
      for(; iB.valid(); iB.advance()) {
        double sqdAB = iB.doubleValue();
        double simAB = kernelMatrix.getSimilarity(pA, iB);
        if(!(sqdAB > 0.)) {
          continue;
        }
        for(iC.seek(iB.getOffset() + 1); iC.valid(); iC.advance()) {
          double sqdAC = iC.doubleValue();
          double simAC = kernelMatrix.getSimilarity(pA, iC);
          if(!(sqdAC > 0.)) {
            continue;
          }
          // Exploit bilinearity of scalar product:
          // <B-A, C-A> = <B, C-A> - <A,C-A>
          // = <B,C> - <B,A> - <A,C> + <A,A>
          double simBC = kernelMatrix.getSimilarity(iB, iC);
          double numerator = simBC - simAB - simAC + simAA;
          double div = 1. / (sqdAB * sqdAC);
          s.put(numerator * div, FastMath.sqrt(div));
        }
      }
      final double abof = s.getNaiveVariance();
      minmaxabod.put(abof);
      abodvalues.putDouble(pA, abof);
    }
  }
1311552
private static BigInteger d2b(double d, int[] e, int[] bits)
    {
        byte dbl_bits[];
        int i, k, y, z, de;
        long dBits = Double.doubleToLongBits(d);
        int d0 = (int)(dBits >>> 32);
        int d1 = (int)(dBits);

        z = d0 & Frac_mask;
        d0 &= 0x7fffffff;   /* clear sign bit, which we ignore */

        if ((de = (d0 >>> Exp_shift)) != 0)
            z |= Exp_msk1;

        if ((y = d1) != 0) {
            dbl_bits = new byte[8];
            k = lo0bits(y);
            y >>>= k;
            if (k != 0) {
                stuffBits(dbl_bits, 4, y | z << (32 - k));
                z >>= k;
            }
            else
                stuffBits(dbl_bits, 4, y);
            stuffBits(dbl_bits, 0, z);
            i = (z != 0) ? 2 : 1;
        }
        else {
    //        JS_ASSERT(z);
            dbl_bits = new byte[4];
            k = lo0bits(z);
            z >>>= k;
            stuffBits(dbl_bits, 0, z);
            k += 32;
            i = 1;
        }
        if (de != 0) {
            e[0] = de - Bias - (P-1) + k;
            bits[0] = P - k;
        }
        else {
            e[0] = de - Bias - (P-1) + 1 + k;
            bits[0] = 32*i - hi0bits(z);
        }
        return new BigInteger(dbl_bits);
    }