calc the cut off
@param cutOff
@param flt_modifier
@param isExFilterRange
@return
323240
protected long cutOffToFrequency(long cutOff, int flt_modifier, boolean isExFilterRange)
	{
		double fac = (isExFilterRange)?(20.0d*512.0d):(24.0d*512.0d);
		double fc = 110.0d * Math.pow(2.0d, 0.25d + ((double)(cutOff*(flt_modifier+256))) / fac);
		long freq = (long)fc;
		if (freq<120) return 120;
		if (freq>20000) return 20000;
		if ((freq<<1) > sampleRate) return ((long)sampleRate)>>1;
		return freq;
	}
174496
private static String cutOffValidationMatchersPrefix(String expression) {
        if (expression.startsWith(Citrus.VALIDATION_MATCHER_PREFIX) && expression.endsWith(Citrus.VALIDATION_MATCHER_SUFFIX)) {
            return expression.substring(Citrus.VALIDATION_MATCHER_PREFIX.length(), expression.length() - Citrus.VALIDATION_MATCHER_SUFFIX.length());
        }

        return expression;
    }
89845
protected void setupChannelFilter(ChannelMemory aktMemo, boolean bReset, int flt_modifier)
	{
		double cutOff = (double)((aktMemo.nCutOff + aktMemo.nCutSwing)&0x7F);
		double resonance = (double)((aktMemo.nResonance + aktMemo.nResSwing)&0x7F);
		
		double fc = cutOffToFrequency((long)cutOff, flt_modifier, (mod.getSongFlags()&Helpers.SONG_EXFILTERRANGE)!=0);
		fc *= 2.0d * 3.14159265358 / ((double)sampleRate);

		double dmpfac = Math.pow(10.0d, -((24.0d / 128.0d) * resonance) / 20.0d);
		
		double d = (1.0d - 2.0d * dmpfac) * fc;
		if (d > 2.0d) d = 2.0d;
		d = (2.0d * dmpfac - d) / fc;
		double e = Math.pow(1.0d / fc, 2.0d);

		double fg  = 1.0d / (1.0d + d + e);
		double fg1 = -e * fg;
		double fg0 = 1.0d - fg - fg1;
			
		switch(aktMemo.nFilterMode)
		{
			case Helpers.FLTMODE_HIGHPASS:
				aktMemo.nFilter_A0 = (long)((1.0d-fg) * Helpers.FILTER_PRECISION);
				aktMemo.nFilter_B0 = (long)(fg0 * Helpers.FILTER_PRECISION);
				aktMemo.nFilter_B1 = (long)(fg1 * Helpers.FILTER_PRECISION);
				aktMemo.nFilter_HP = -1;
				break;
			default:
				aktMemo.nFilter_A0 = (long)(fg * Helpers.FILTER_PRECISION);
				aktMemo.nFilter_B0 = (long)(fg0 * Helpers.FILTER_PRECISION);
				aktMemo.nFilter_B1 = (long)(fg1 * Helpers.FILTER_PRECISION);
				aktMemo.nFilter_HP = 0;
				break;
		}
		
		if (bReset) aktMemo.nFilter_Y1 = aktMemo.nFilter_Y2 = 0;
		
		aktMemo.filterOn = true;
	}
270475
@VisibleForTesting
    public static boolean checkInBloomFilter(BloomFilter bloomFilter, Object predicateValue, Type sqlType)
    {
        if (sqlType == TINYINT || sqlType == SMALLINT || sqlType == INTEGER || sqlType == BIGINT) {
            return bloomFilter.testLong(((Number) predicateValue).longValue());
        }

        if (sqlType == DOUBLE) {
            return bloomFilter.testDouble((Double) predicateValue);
        }

        if (sqlType instanceof VarcharType || sqlType instanceof VarbinaryType) {
            return bloomFilter.test(((Slice) predicateValue).getBytes());
        }

        // todo support DECIMAL, FLOAT, DATE, TIMESTAMP, and CHAR
        return true;
    }
684121
public ComparisonExpression getGteFilterFromPrefixLike() {
        ExpressionType rangeComparator = ExpressionType.COMPARE_GREATERTHANOREQUALTO;
        String comparand = extractLikePatternPrefix();
        return rangeFilterFromPrefixLike(m_left, rangeComparator, comparand);
    }
179479
def cutoff(s, length=120):
    """"""
    if length < 5:
        raise ValueError('length must be >= 5')
    if len(s) <= length:
        return s
    else:
        i = (length - 2) / 2
        j = (length - 3) / 2
        return s[:i] + '...' + s[-j:]
793008
def make_filter(self, fieldname, query_func, expct_value):
        '''  '''

        def actual_filter(item):
            value = getattr(item, fieldname)

            if query_func in NULL_AFFECTED_FILTERS and value is None:
                return False

            if query_func == 'eq':
                return value == expct_value
            elif query_func == 'ne':
                return value != expct_value
            elif query_func == 'lt':
                return value < expct_value
            elif query_func == 'lte':
                return value <= expct_value
            elif query_func == 'gt':
                return value > expct_value
            elif query_func == 'gte':
                return value >= expct_value
            elif query_func == 'startswith':
                return value.startswith(expct_value)
            elif query_func == 'endswith':
                return value.endswith(expct_value)

        actual_filter.__doc__ = '{} {} {}'.format('val', query_func, expct_value)

        return actual_filter
398737
public ComparisonExpression getLtFilterFromPrefixLike() {
        ExpressionType rangeComparator = ExpressionType.COMPARE_LESSTHAN;
        String comparand = extractAndIncrementLikePatternPrefix();
        return rangeFilterFromPrefixLike(m_left, rangeComparator, comparand);
    }
1264216
private Operation range( CssFormatter formatter ) {
        type = LIST;
        double start = get( 0 ).doubleValue( formatter );
        double end;
        if( parameters.size() >= 2 ) {
            end = get( 1 ).doubleValue( formatter );
        } else {
            end = start;
            start = 1;
        }
        double step;
        if( parameters.size() >= 3 ) {
            step = get( 2 ).doubleValue( formatter );
        } else {
            step = 1;
        }
        String unit = get( 0 ).unit( formatter );
        Operation op = new Operation( this, ' ' );
        while( start <= end ) {
            op.addOperand( new ValueExpression( this, start + unit ) );
            start += step;
        }
        return op;
    }
469496
private final static boolean checkExpand(TypedArrayDecoder tad)
    {
        if (tad instanceof ValueDecoderFactory.BaseArrayDecoder) {
            ((ValueDecoderFactory.BaseArrayDecoder) tad).expand();
            return true;
        }
        return false;
    }
1132768
protected /*@pure@*/ int rangeSingle(/*@non_null@*/String singleSelection) {

        String single = singleSelection.trim();
        if (single.toLowerCase().equals("first")) {
            return 0;
        }
        if (single.toLowerCase().equals("last") || single.toLowerCase().equals("-1")) {
            return -1;
        }
        int index = Integer.parseInt(single);
        if (index >= 1) { //Non for negatives
            index--;
        }
        return index;
    }
510158
def scanline_at index_or_range
      base = self
      prev_filters = self.filter_types
      filter_codecs = Array.new(prev_filters.size)
      scanlines = []
      index_or_range = self.filter_types.size - 1 if index_or_range == -1
      range = index_or_range.is_a?(Range) ? index_or_range : [index_or_range]

      at = 0
      scanline_positions.push(@filtered_data.size).inject do |pos, delimit|
        if range.include? at
          s = Scanline.new(@filtered_data, pos, (delimit - pos - 1), at) do |scanline|
            if base.fabricate_scanline(scanline, prev_filters, filter_codecs)
              base.apply_filters(prev_filters, filter_codecs)
            end
            base.compress
          end
          scanlines << s
        end
        at += 1
        delimit
      end
      scanlines.size <= 1 ? scanlines.first : scanlines
    end
67186
function filterFallback ( f ) {

		switch ( f ) {

			case THREE.NearestFilter:
			case THREE.NearestMipMapNearestFilter:
			case THREE.NearestMipMapLinearFilter: return _gl.NEAREST; break;

			case THREE.LinearFilter:
			case THREE.LinearMipMapNearestFilter:
			case THREE.LinearMipMapLinearFilter:
			default:

				return _gl.LINEAR; break;

		}

	}
1286255
public function applyFilterRange(Filter\FilterRange $filter)
	{
		$conditions = $filter->getCondition();
		$c = $this->checkAliases($filter->getColumn());

		$value_from = $conditions[$filter->getColumn()]['from'];
		$value_to = $conditions[$filter->getColumn()]['to'];

		if ($value_from) {
			$p = $this->getPlaceholder();
			$this->data_source->andWhere("$c >= :$p")->setParameter($p, $value_from);
		}

		if ($value_to) {
			$p = $this->getPlaceholder();
			$this->data_source->andWhere("$c <= :$p")->setParameter($p, $value_to);
		}
	}
478394
private CompiledForeachRangeArgs calculateRangeArgs(ForNode forNode, Scope scope) {
    RangeArgs rangeArgs = RangeArgs.createFromNode(forNode).get();
    ForNonemptyNode nonEmptyNode = (ForNonemptyNode) forNode.getChild(0);
    ImmutableList.Builder<Statement> initStatements = ImmutableList.builder();
    Expression startExpression =
        computeRangeValue(
            SyntheticVarName.foreachLoopRangeStart(nonEmptyNode),
            rangeArgs.start(),
            0,
            scope,
            initStatements);
    Expression stepExpression =
        computeRangeValue(
            SyntheticVarName.foreachLoopRangeStep(nonEmptyNode),
            rangeArgs.increment(),
            1,
            scope,
            initStatements);
    Expression endExpression =
        computeRangeValue(
            SyntheticVarName.foreachLoopRangeEnd(nonEmptyNode),
            Optional.of(rangeArgs.limit()),
            Integer.MAX_VALUE,
            scope,
            initStatements);

    return new AutoValue_SoyNodeCompiler_CompiledForeachRangeArgs(
        startExpression, endExpression, stepExpression, initStatements.build());
  }
540906
def absrange_fltr(dem, rangelim):
    
    out = range_fltr(np.ma.abs(dem), *rangelim)
    #Apply mask to original input
    out = np.ma.array(dem, mask=np.ma.getmaskarray(out))
    out.set_fill_value(dem.fill_value)
    return out
1276915
private static <T extends RingPosition<T>> List<Range<T>> deoverlap(List<Range<T>> ranges)
    {
        if (ranges.isEmpty())
            return ranges;

        List<Range<T>> output = new ArrayList<Range<T>>();

        Iterator<Range<T>> iter = ranges.iterator();
        Range<T> current = iter.next();

        @SuppressWarnings("unchecked")
        T min = (T) current.partitioner.minValue(current.left.getClass());
        while (iter.hasNext())
        {
            // If current goes to the end of the ring, we're done
            if (current.right.equals(min))
            {
                // If one range is the full range, we return only that
                if (current.left.equals(min))
                    return Collections.<Range<T>>singletonList(current);

                output.add(new Range<T>(current.left, min));
                return output;
            }

            Range<T> next = iter.next();

            // if next left is equal to current right, we do not intersect per se, but replacing (A, B] and (B, C] by (A, C] is
            // legit, and since this avoid special casing and will result in more "optimal" ranges, we do the transformation
            if (next.left.compareTo(current.right) <= 0)
            {
                // We do overlap
                // (we've handled current.right.equals(min) already)
                if (next.right.equals(min) || current.right.compareTo(next.right) < 0)
                    current = new Range<T>(current.left, next.right);
            }
            else
            {
                output.add(current);
                current = next;
            }
        }
        output.add(current);
        return output;
    }