** Binary Operations ***
541995
@Override
    public Response<String> set(final byte[] key, final byte[] value) {
        writeAsync(key, () -> shadowPipeline.set(key, value));

        return DynoDualWriterPipeline.super.set(key,value);
    }
203761
def decrypt_binary(self, binary, *args, **kwargs):
        
        return self.decrypt(binary, *args, **kwargs)
997398
public static function doBinaryOperation($left, $operator, $right)
    {
        if (self::$binaryOperations === null) {
            self::$binaryOperations = [
                    self::BITWISE_AND              => function ($l, $r) { return $l & $r; },
                    self::BITWISE_OR               => function ($l, $r) { return $l | $r; },
                    self::BITWISE_XOR              => function ($l, $r) { return $l ^ $r; },
                    self::SHIFT_LEFT               => function ($l, $r) { return $l << $r; },
                    self::SHIFT_RIGHT              => function ($l, $r) { return $l >> $r; },
                    self::LOGICAL_AND              => function ($l, $r) { return $l && $r; },
                    self::LOGICAL_OR               => function ($l, $r) { return $l || $r; },
                    self::ADDITION                 => function ($l, $r) { return $l + $r; },
                    self::SUBTRACTION              => function ($l, $r) { return $l - $r; },
                    self::MULTIPLICATION           => function ($l, $r) { return $l * $r; },
                    self::DIVISION                 => function ($l, $r) { return $l / $r; },
                    self::MODULUS                  => function ($l, $r) { return $l % $r; },
                    //Compatible with < PHP 5.6
                    self::POWER                    => function ($l, $r) { return pow($l, $r); },
                    self::CONCATENATION            => function ($l, $r) { return $l . $r; },
                    self::IS_INSTANCE_OF           => function ($l, $r) { return $l instanceof $r; },
                    self::EQUALITY                 => function ($l, $r) { return $l == $r; },
                    self::IDENTITY                 => function ($l, $r) { return $l === $r; },
                    self::INEQUALITY               => function ($l, $r) { return $l != $r; },
                    self::NOT_IDENTICAL            => function ($l, $r) { return $l !== $r; },
                    self::LESS_THAN                => function ($l, $r) { return $l < $r; },
                    self::LESS_THAN_OR_EQUAL_TO    => function ($l, $r) { return $l <= $r; },
                    self::GREATER_THAN             => function ($l, $r) { return $l > $r; },
                    self::GREATER_THAN_OR_EQUAL_TO => function ($l, $r) { return $l >= $r; },
            ];
        }

        if (!isset(self::$binaryOperations[$operator])) {
            throw new PinqException('Binary operator \'%s\' is not supported', $operator);
        }

        $operation = self::$binaryOperations[$operator];

        return $operation($left, $right);
    }
948564
function binl(x, len) {
        var T, j, i, l,
          h0 = 0x67452301,
          h1 = 0xefcdab89,
          h2 = 0x98badcfe,
          h3 = 0x10325476,
          h4 = 0xc3d2e1f0,
          A1, B1, C1, D1, E1,
          A2, B2, C2, D2, E2;

        /* append padding */
        x[len >> 5] |= 0x80 << (len % 32);
        x[(((len + 64) >>> 9) << 4) + 14] = len;
        l = x.length;

        for (i = 0; i < l; i += 16) {
          A1 = A2 = h0;
          B1 = B2 = h1;
          C1 = C2 = h2;
          D1 = D2 = h3;
          E1 = E2 = h4;
          for (j = 0; j <= 79; j += 1) {
            T = safe_add(A1, rmd160_f(j, B1, C1, D1));
            T = safe_add(T, x[i + rmd160_r1[j]]);
            T = safe_add(T, rmd160_K1(j));
            T = safe_add(bit_rol(T, rmd160_s1[j]), E1);
            A1 = E1;
            E1 = D1;
            D1 = bit_rol(C1, 10);
            C1 = B1;
            B1 = T;
            T = safe_add(A2, rmd160_f(79 - j, B2, C2, D2));
            T = safe_add(T, x[i + rmd160_r2[j]]);
            T = safe_add(T, rmd160_K2(j));
            T = safe_add(bit_rol(T, rmd160_s2[j]), E2);
            A2 = E2;
            E2 = D2;
            D2 = bit_rol(C2, 10);
            C2 = B2;
            B2 = T;
          }

          T = safe_add(h1, safe_add(C1, D2));
          h1 = safe_add(h2, safe_add(D1, E2));
          h2 = safe_add(h3, safe_add(E1, A2));
          h3 = safe_add(h4, safe_add(A1, B2));
          h4 = safe_add(h0, safe_add(B1, C2));
          h0 = T;
        }
        return [h0, h1, h2, h3, h4];
      }
168242
@javax.annotation.Nonnull
  public static double[] op(@javax.annotation.Nonnull final double[] a, @javax.annotation.Nonnull final double[] b, @javax.annotation.Nonnull final DoubleBinaryOperator fn) {
    assert a.length == b.length;
    @javax.annotation.Nonnull final double[] c = new double[a.length];
    for (int j = 0; j < a.length; j++) {
      c[j] = fn.applyAsDouble(a[j], b[j]);
    }
    return c;
  }
1191000
def is_binary(self):
        """"""
        with open(self.path, 'rb') as fin:
            CHUNKSIZE = 1024
            while 1:
                chunk = fin.read(CHUNKSIZE)
                if b'\0' in chunk:
                    return True
                if len(chunk) < CHUNKSIZE:
                    break
        return False
274298
function binaryStringToArrayBuffer(bin) {
  var length = bin.length;
  var buf = new ArrayBuffer(length);
  var arr = new Uint8Array(buf);
  for (var i = 0; i < length; i++) {
    arr[i] = bin.charCodeAt(i);
  }
  return buf;
}
633433
def reverse_byte_pairs!
      w = ""
      w.force_encoding("BINARY") if w.respond_to?(:force_encoding)
      (0...@bytes.size).step(2) do |i|
        w << @bytes[i+1]
        w << @bytes[i]
      end
      @bytes = w
      __setobj__ @bytes
      self
  end
1277501
private MutableBigInteger binaryGCD(MutableBigInteger v) {
        // Algorithm B from Knuth section 4.5.2
        MutableBigInteger u = this;
        MutableBigInteger r = new MutableBigInteger();

        // step B1
        int s1 = u.getLowestSetBit();
        int s2 = v.getLowestSetBit();
        int k = (s1 < s2) ? s1 : s2;
        if (k != 0) {
            u.rightShift(k);
            v.rightShift(k);
        }

        // step B2
        boolean uOdd = (k == s1);
        MutableBigInteger t = uOdd ? v: u;
        int tsign = uOdd ? -1 : 1;

        int lb;
        while ((lb = t.getLowestSetBit()) >= 0) {
            // steps B3 and B4
            t.rightShift(lb);
            // step B5
            if (tsign > 0)
                u = t;
            else
                v = t;

            // Special case one word numbers
            if (u.intLen < 2 && v.intLen < 2) {
                int x = u.value[u.offset];
                int y = v.value[v.offset];
                x  = binaryGcd(x, y);
                r.value[0] = x;
                r.intLen = 1;
                r.offset = 0;
                if (k > 0)
                    r.leftShift(k);
                return r;
            }

            // step B6
            if ((tsign = u.difference(v)) == 0)
                break;
            t = (tsign >= 0) ? u : v;
        }

        if (k > 0)
            u.leftShift(k);
        return u;
    }
751797
function xor_64_2(a, b)
	{
		return new Int_64(
			a.highOrder ^ b.highOrder,
			a.lowOrder ^ b.lowOrder
		);
	}
864034
static Object bigIntegerBinaryOperation(BigInteger lhs, BigInteger rhs, int kind)
    {

        switch(kind)
        {
            // arithmetic
            case PLUS:
                return lhs.add(rhs);

            case MINUS:
                return lhs.subtract(rhs);

            case STAR:
                return lhs.multiply(rhs);

            case SLASH:
                return lhs.divide(rhs);

            case MOD:
            case MODX:
                return lhs.mod(rhs);

            case POWER:
            case POWERX:
                return lhs.pow(rhs.intValue());

            // bitwise
            case LSHIFT:
            case LSHIFTX:
                return lhs.shiftLeft(rhs.intValue());

            case RSIGNEDSHIFT:
            case RSIGNEDSHIFTX:
                return lhs.shiftRight(rhs.intValue());

            case RUNSIGNEDSHIFT:
            case RUNSIGNEDSHIFTX:
                if ( lhs.signum() >= 0 )
                    return lhs.shiftRight(rhs.intValue());
                BigInteger opener = BigInteger.ONE.shiftLeft(lhs.toString(2).length() + 1);
                BigInteger opened = lhs.subtract(opener);
                BigInteger mask = opener.subtract(BigInteger.ONE).shiftRight(rhs.intValue() + 1);
                return opened.shiftRight(rhs.intValue()).and(mask);


            case BIT_AND:
            case BIT_ANDX:
                return lhs.and(rhs);

            case BIT_OR:
            case BIT_ORX:
                return lhs.or(rhs);

            case XOR:
            case XORX:
                return lhs.xor(rhs);

        }
        throw new InterpreterError(
                "Unimplemented binary integer operator");
    }
681309
function() {
        var node, biop, prec, stack, biop_info, left, right, i;

        // First, try to get the leftmost thing
        // Then, check to see if there's a binary operator operating on that leftmost thing
        left = gobbleToken();
        biop = gobbleBinaryOp();

        // If there wasn't a binary operator, just return the leftmost node
        if (!biop) {
          return left;
        }

        // Otherwise, we need to start a stack to properly place the binary operations in their
        // precedence structure
        biop_info = { value: biop, prec: binaryPrecedence(biop) };

        right = gobbleToken();
        if (!right) {
          throwError("Expected expression after " + biop, index);
        }
        stack = [left, biop_info, right];

        // Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)
        while ((biop = gobbleBinaryOp())) {
          prec = binaryPrecedence(biop);

          if (prec === 0) {
            break;
          }
          biop_info = { value: biop, prec: prec };

          // Reduce: make a binary expression from the three topmost entries.
          while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {
            right = stack.pop();
            biop = stack.pop().value;
            left = stack.pop();
            node = createBinaryExpression(biop, left, right);
            stack.push(node);
          }

          node = gobbleToken();
          if (!node) {
            throwError("Expected expression after " + biop, index);
          }
          stack.push(biop_info, node);
        }

        i = stack.length - 1;
        node = stack[i];
        while (i > 1) {
          node = createBinaryExpression(stack[i - 1].value, stack[i - 2], node);
          i -= 2;
        }
        return node;
      }
439145
def binary_operation_logical(self, rule, left, right, **kwargs):
        
        return LogicalBinOpRule(rule.operation, left, right)
30656
function bintooctoutput(bin){
  var len = bin.length;
  var octoutput = String();
  for(var i=0; i<len; i+=3){
    if((i > 0) && !(i%24)){octoutput = " " + octoutput;}
    var value = 0;
    if(bin[len - 1 - i - 0]){value+=1;}
    if(bin[len - 1 - i - 1]){value+=2;}
    if(bin[len - 1 - i - 2]){value+=4;}
    switch(value){
      case 0: octoutput = "0" + octoutput; break;
      case 1: octoutput = "1" + octoutput; break;
      case 2: octoutput = "2" + octoutput; break;
      case 3: octoutput = "3" + octoutput; break;
      case 4: octoutput = "4" + octoutput; break;
      case 5: octoutput = "5" + octoutput; break;
      case 6: octoutput = "6" + octoutput; break;
      case 7: octoutput = "7" + octoutput; break;
      default: break;
    }
  }
  // todo: make faster
  return octoutput;
}
811354
public static boolean[] invert(boolean[] binary)
    {
        Check.notNull(binary);

        final boolean[] inverted = new boolean[binary.length];
        for (int i = 0; i < inverted.length; i++)
        {
            inverted[i] = !binary[i];
        }
        return inverted;
    }
966992
private int binaryGreaterSearch() {

        int low     = 0;
        int high    = count;
        int mid     = 0;
        int compare = 0;

        while (low < high) {
            mid     = (low + high) / 2;
            compare = compare(mid);

            if (compare < 0) {
                high = mid;
            } else {
                low = mid + 1;
            }
        }

        return low == count ? -1
                            : low;
    }
418805
public void write_binary(final byte[] bin) {
        write1(OtpExternal.binTag);
        write4BE(bin.length);
        writeN(bin);
    }