Fits the loop-data given in instruments loaded
These values are often not correkt
@since 27.08.2006
@param modType
175261
public void fixSampleLoops(int modType)
	{
		if (sample==null || length==0) return;
		if (repeatStop>length)
		{
			repeatStop = length;
			repeatLength = repeatStop - repeatStart;
		}
		if (repeatStart+2>repeatStop)
		{
			repeatStop = repeatStart = 0;
			repeatLength = repeatStop - repeatStart;
			loopType = 0;
		}
		sample[length+4] = sample[length+3] = sample[length+2] = sample[length+1] = sample[length] = sample[length-1];
		if (loopType==1 && (repeatStop+4>repeatLength || modType==Helpers.MODTYPE_MOD || modType==Helpers.MODTYPE_S3M))
		{
			sample[repeatStop  ] = sample[repeatStart  ];
			sample[repeatStop+1] = sample[repeatStart+1];
			sample[repeatStop+2] = sample[repeatStart+2];
			sample[repeatStop+3] = sample[repeatStart+3];
			sample[repeatStop+4] = sample[repeatStart+4];
		}
	}
1241548
public void setAdjustmentTypes(java.util.Collection<AdjustmentType> adjustmentTypes) {
        if (adjustmentTypes == null) {
            this.adjustmentTypes = null;
            return;
        }

        this.adjustmentTypes = new com.amazonaws.internal.SdkInternalList<AdjustmentType>(adjustmentTypes);
    }
1345887
def _match_type(self, i):
        """"""
        self.col_match = self.RE_TYPE.match(self._source[i])
        if self.col_match is not None:
            self.section = "types"
            self.el_type = CustomType
            self.el_name = self.col_match.group("name")
           
            return True
        else:
            return False
591602
public void fit( double samplePoints[] , double[] observations ) {
        // Create a copy of the observations and put it into a matrix
        y.reshape(observations.length,1,false);
        System.arraycopy(observations,0, y.data,0,observations.length);

        // reshape the matrix to avoid unnecessarily declaring new memory
        // save values is set to false since its old values don't matter
        A.reshape(y.numRows, coef.numRows,false);

        // set up the A matrix
        for( int i = 0; i < observations.length; i++ ) {

            double obs = 1;

            for( int j = 0; j < coef.numRows; j++ ) {
                A.set(i,j,obs);
                obs *= samplePoints[i];
            }
        }

        // process the A matrix and see if it failed
        if( !solver.setA(A) )
            throw new RuntimeException("Solver failed");

        // solver the the coefficients
        solver.solve(y,coef);
    }
526899
public void setType(String type) throws ApplicationException {
	type = type.toLowerCase().trim();
	if (type.equals("string")) this.type = RegistryEntry.TYPE_STRING;
	else if (type.equals("dword")) this.type = RegistryEntry.TYPE_DWORD;
	else if (type.equals("key")) this.type = RegistryEntry.TYPE_KEY;
	else if (type.equals("any")) this.type = RegistryEntry.TYPE_ANY;
	else throw new ApplicationException("attribute type of the tag registry has an invalid value [" + type + "], valid values are [string, dword]");
    }
1045022
public static function isModulus(
        float $value,
        float $modulo,
        ?string $message = null,
        ?string $propertyPath = null
    ) : void {
        static::numeric($value);
        static::numeric($modulo);

        if ($value % $modulo !== 0) {
            $message = sprintf(
                $message ?: 'Value %d is not a modulus of %d',
                static::stringify($value),
                static::stringify($modulo)
            );

            throw static::createException($value, $message, static::INVALID_MODULUS, $propertyPath);
        }
    }
1063616
private void confirmMatchForDsTypeModel(ValidationResult result,
                                            DsTypeModel typeModel,
                                            String contentModelPid,
                                            ObjectInfo object) {
        String id = typeModel.getId();
        DatastreamInfo dsInfo = object.getDatastreamInfo(id);
        if (dsInfo == null) {
            // If there is no datastream by that name, nothing to check.
            result.addNote(ValidationResultNotation
                    .noMatchingDatastreamId(contentModelPid, id));
            return;
        }

        Collection<Form> forms = typeModel.getForms();
        if (forms.isEmpty()) {
            // If the type model has no forms, it's an automatic match.
            return;
        }

        // Otherwise, the datastream must meet the constraints of at least one form.
        for (Form form : forms) {
            if (meetsConstraint(dsInfo.getMimeType(), form.getMimeType())
                    && meetsConstraint(dsInfo.getFormatUri(), form
                            .getFormatUri())) {
                return;
            }
        }
        result.addNote(ValidationResultNotation
                .datastreamDoesNotMatchForms(contentModelPid, id));
    }
812982
public void applyModifications(Properties mods)
    {
        String key;
        String value;

        for (Iterator it = mods.keySet().iterator(); it.hasNext();)
        {
            key   = (String)it.next();
            value = mods.getProperty(key);
            setProperty(key, value);
        }
    }
936730
private static void modify(final Calendar val, final int field, final ModifyType modType) {
        if (val.get(Calendar.YEAR) > 280000000) {
            throw new ArithmeticException("Calendar value too large for accurate calculations");
        }

        if (field == Calendar.MILLISECOND) {
            return;
        }

        // ----------------- Fix for LANG-59 ---------------------- START ---------------
        // see http://issues.apache.org/jira/browse/LANG-59
        //
        // Manually truncate milliseconds, seconds and minutes, rather than using
        // Calendar methods.

        final Date date = val.getTime();
        long time = date.getTime();
        boolean done = false;

        // truncate milliseconds
        final int millisecs = val.get(Calendar.MILLISECOND);
        if (ModifyType.TRUNCATE == modType || millisecs < 500) {
            time = time - millisecs;
        }
        if (field == Calendar.SECOND) {
            done = true;
        }

        // truncate seconds
        final int seconds = val.get(Calendar.SECOND);
        if (!done && (ModifyType.TRUNCATE == modType || seconds < 30)) {
            time = time - (seconds * 1000L);
        }
        if (field == Calendar.MINUTE) {
            done = true;
        }

        // truncate minutes
        final int minutes = val.get(Calendar.MINUTE);
        if (!done && (ModifyType.TRUNCATE == modType || minutes < 30)) {
            time = time - (minutes * 60000L);
        }

        // reset time
        if (date.getTime() != time) {
            date.setTime(time);
            val.setTime(date);
        }
        // ----------------- Fix for LANG-59 ----------------------- END ----------------

        boolean roundUp = false;
        for (final int[] aField : fields) {
            for (final int element : aField) {
                if (element == field) {
                    //This is our field... we stop looping
                    if (modType == ModifyType.CEILING || modType == ModifyType.ROUND && roundUp) {
                        if (field == DateUtils.SEMI_MONTH) {
                            //This is a special case that's hard to generalize
                            //If the date is 1, we round up to 16, otherwise
                            //  we subtract 15 days and add 1 month
                            if (val.get(Calendar.DATE) == 1) {
                                val.add(Calendar.DATE, 15);
                            } else {
                                val.add(Calendar.DATE, -15);
                                val.add(Calendar.MONTH, 1);
                            }
// ----------------- Fix for LANG-440 ---------------------- START ---------------
                        } else if (field == Calendar.AM_PM) {
                            // This is a special case
                            // If the time is 0, we round up to 12, otherwise
                            //  we subtract 12 hours and add 1 day
                            if (val.get(Calendar.HOUR_OF_DAY) == 0) {
                                val.add(Calendar.HOUR_OF_DAY, 12);
                            } else {
                                val.add(Calendar.HOUR_OF_DAY, -12);
                                val.add(Calendar.DATE, 1);
                            }
// ----------------- Fix for LANG-440 ---------------------- END ---------------
                        } else {
                            //We need at add one to this field since the
                            //  last number causes us to round up
                            val.add(aField[0], 1);
                        }
                    }
                    return;
                }
            }
            //We have various fields that are not easy roundings
            int offset = 0;
            boolean offsetSet = false;
            //These are special types of fields that require different rounding rules
            switch (field) {
                case DateUtils.SEMI_MONTH:
                    if (aField[0] == Calendar.DATE) {
                        //If we're going to drop the DATE field's value,
                        //  we want to do this our own way.
                        //We need to subtrace 1 since the date has a minimum of 1
                        offset = val.get(Calendar.DATE) - 1;
                        //If we're above 15 days adjustment, that means we're in the
                        //  bottom half of the month and should stay accordingly.
                        if (offset >= 15) {
                            offset -= 15;
                        }
                        //Record whether we're in the top or bottom half of that range
                        roundUp = offset > 7;
                        offsetSet = true;
                    }
                    break;
                case Calendar.AM_PM:
                    if (aField[0] == Calendar.HOUR_OF_DAY) {
                        //If we're going to drop the HOUR field's value,
                        //  we want to do this our own way.
                        offset = val.get(Calendar.HOUR_OF_DAY);
                        if (offset >= 12) {
                            offset -= 12;
                        }
                        roundUp = offset >= 6;
                        offsetSet = true;
                    }
                    break;
                default:
                    break;
            }
            if (!offsetSet) {
                final int min = val.getActualMinimum(aField[0]);
                final int max = val.getActualMaximum(aField[0]);
                //Calculate the offset from the minimum allowed value
                offset = val.get(aField[0]) - min;
                //Set roundUp if this is more than half way between the minimum and maximum
                roundUp = offset > ((max - min) / 2);
            }
            //We need to remove this field
            if (offset != 0) {
                val.set(aField[0], val.get(aField[0]) - offset);
            }
        }
        throw new IllegalArgumentException("The field " + field + " is not supported");

    }
1235618
def fit_for_distance(self):
        
        for prop in self.properties.keys():
            if prop in self.ic.bands:
                return True
        return False
592808
public synchronized static boolean addModuleInfo(String moduleID, String modulePrefix) {
        if (PerfModules.addModuleInfo(modulePrefix + moduleID) != null)
            return true;
        else
            return false;
    }
222793
private void setType(Type type) {
    setSamplesPerSecond(type.getSamplesPerSecond());
    setFramesPerSecond(type.getFramesPerSecond());
    setUseSamples(type.usesSamples());
  }
191537
private boolean parametersMatch(Type observedParameter, Type eventParameter) {
        if (Types.isActualType(observedParameter) && Types.isActualType(eventParameter)) {
            /*
             * the observed event type parameter is an actual type with identical raw type to the event type
             * parameter, and, if the type is parameterized, the event type parameter is assignable to the
             * observed event type parameter according to these rules, or
             */
            return matches(observedParameter, eventParameter);
        }
        if (observedParameter instanceof WildcardType && eventParameter instanceof WildcardType) {
            /*
             * both the observed event type parameter and the event type parameter are wildcards, and the event type parameter is assignable to the observed event
             * type
             */
            return CovariantTypes.isAssignableFrom(observedParameter, eventParameter);
        }
        if (observedParameter instanceof WildcardType) {
            /*
             * the observed event type parameter is a wildcard and the event type parameter is assignable
             * to the upper bound, if any, of the wildcard and assignable from the lower bound, if any, of the
             * wildcard, or
             */
            return parametersMatch((WildcardType) observedParameter, eventParameter);
        }
        if (observedParameter instanceof TypeVariable<?>) {
            /*
             * the observed event type parameter is a type variable and the event type parameter is assignable
             * to the upper bound, if any, of the type variable.
             */
            return parametersMatch((TypeVariable<?>) observedParameter, eventParameter);
        }
        return false;
    }
850311
public boolean validateModcaString32_MaxLength(String modcaString32, DiagnosticChain diagnostics, Map<Object, Object> context) {
		int length = modcaString32.length();
		boolean result = length <= 32;
		if (!result && diagnostics != null)
			reportMaxLengthViolation(BasePackage.Literals.MODCA_STRING32, modcaString32, length, 32, diagnostics, context);
		return result;
	}
154481
public void ensureCapacity(int minCapacity) {
		modCount++;
		int oldCapacity = elementData.length;
		if (minCapacity > oldCapacity) {
			int oldData[] = elementData;
			int newCapacity = (oldCapacity * 3)/2 + 1;
				if (newCapacity < minCapacity)
				newCapacity = minCapacity;
			elementData = new int[newCapacity];
			System.arraycopy(oldData, 0, elementData, 0, size);
		}
	}
1189574
public boolean matches(final MediaType type) {
        final String star = "*";
        return (this.high.equals(star)
            || type.high.equals(star)
            || this.high.equals(type.high))
            && (this.low.equals(star)
            || type.low.equals(star)
            || this.low.equals(type.low));
    }
1215196
private String getModType(String kennung) throws IOException
	{
		if (!kennung.equals("!Scream!")) 
			throw new IOException("Mod id: " + kennung + ": this is not a screamtracker mod");

		setNSamples(31);
		setNChannels(4);
		return "ScreamTracker";
	}