this.onSubmit = this.onSubmit.bind(this)
this.onClose = this.onClose.bind(this)

somewhere in react-native app

By fluttershy, 2018-01-08 08:01:40
// We have this enum.
enum Formula {
  case proposition(String)
  indirect case negation(Formula)
  indirect case operation(op: String, lhs: Formula, rhs: Formula)

  var nnf: Formula { /* ... */  }
}

// And now ...

switch formula.nnf {
 case .proposition(_):
   return formula.nnf
 case .negation(_):
   return formula.nnf
 case .operation(_, _, _):
   return formula.nnf
}
By Anonymous, 2018-01-08 11:04:54
    foreach ($desired_components as $name => $junk) {
      list($component_value, $component_comments) = self::unpackPair($desired_components[$name]);
      $desired_components[$name] = self::packPair(round($component_value, 2), $component_comments);
    }
By Anonymous, 2018-01-10 09:01:18
if ($customerId > 0) {
    $customerId = $customerId;
} else {
    $customerId = $this->customerSession->getId();
}
By Anonymous, 2018-01-10 16:42:14
string random = "1";
By Anonymous, 2018-01-11 20:23:55
$config = Config::getConfig('common');
$contract_carriers = $config[$market . "_" . $clearing . '_contract_carriers']; // f**ing php array
$interline_carriers = $config[$market . "_" . $clearing . '_interline_carriers']; // another f**ing array
// $marketing_carriers - is also array

$sets = [];
foreach ($marketing_carriers as $mc) {
  $sets[] = array_unique(array_intersect(
    array_merge(
      [$mc],
      array_intersect(
        isset(self::$interlines[$mc]) ? self::$interlines[$mc] : [],
        array_merge(
          $marketing_carriers,
          $interline_carriers
        )
      )
    ),
    $contract_carriers
  ));
}
By Anonymous, 2018-01-16 10:56:13
// What they did:
var serverCommands = {};
for(var each in commandList.general)
    (dmCommands[commandList.general[each].type] ? dmCommands[commandList.general[each].type] +=
    (config.prefix + each + (commandList.general[each].args ? ' ' + commandList.general[each].args : '') +
    ': ' + commandList.general[each].description + '\n') : (dmCommands[commandList.general[each].type] =
    '\u200B'+ config.prefix + each + (commandList.general[each].args ? ' ' + commandList.general[each].args : '') +
    ': ' + commandList.general[each].description + '\n'))

// What they should've done:
let srvrCmds = new Map();
let gldCmds = commandList[message.guild.id];
for (let each in gldCmds) {
    const cur = gldCmds[each];
    const text = `${config.prefix + each + (cur.args ? " " + cur.args : "")}: ${cur.description}\n`;
    const srvrCmdType = srvrCmds.get(cur.type);
    srvrCmds.set(cur.type, (srvrCmdType || "\u200B") + text);
}
By Anonymous, 2018-01-18 05:57:37
this.props.HeaderStore.setHeader(true, null, false, false, true, true,'dashboardNavigation');
By Fluttershy, 2018-01-19 08:53:26
if ( $ordinal_competitors > 0 ) {
	foreach( $ordinal_bests as $label => $tuple ) {
		unset( $waste[ $tuple['id']->{ '$id' } ] );
		$essential[ $search_str ][ $tuple['stamp'] ][ $tuple['source'] ]['updated_at'] = $tuple['updated'];
		$essential[ $search_str ][ $tuple['stamp'] ][ $tuple['source'] ]['proposals'][ $label ] = $tuple['price'];
		$final_count ++;
	}
}
  • So, you've called the variable "tuple"
  • Yes
  • What is tuple?
  • Eeeemmm...
  • You don't know. Me too, but my experience said that tuple is a collection, of N-arity where you can't ask by key and give exception, what data structure is placed here?
  • F..ing.. ph.. arr...
  • I can't hear you girl!
  • Fucking php array
  • So why did you call fucking php array a tuple?
  • I do not know...
  • Go f...ck yourself
By Anonymous, 2018-01-22 10:32:32
function isAllowSearchLength(text) {
    return text.length > isNaN(parseInt(text, 10)) ? 1 : 0;
}
By Anonymous, 2018-01-24 12:02:46
if (isset(self::$proposals[$view])) {
      $best_proposals = [];
      $all_sources = [];
      foreach (self::$proposals[$view] as $proposal_source => $proposal) {
        if (!isset($this->backend_branch) || substr($this->backend_branch, 0, 11) != "adjust-for:" || substr($this->backend_branch, 11) == $proposal_source) {
          if ($proposal['orig_base'] == $curr_base || $relax_checking) {
            $age = time() - $proposal['updated_at'];
            if ($age < self::MAX_AGE) {
              foreach ($proposal['proposals'] as $proposal_label => $proposal_price) {
                if (!in_array($proposal_label, [self::SK_LABEL_AVIASALES, self::SK_LABEL_SKYSCANNER, self::SK_LABEL_YANDEX, self::SK_LABEL_MOMONDO])) {
                  $proposal_key = $proposal_label;
                  if (!isset($best_proposals[$proposal_key]) || $best_proposals[$proposal_key]['price'] > $proposal_price) {
                    $best_proposals[$proposal_key] = [
                      'price' => $proposal_price,
                      'name' => $proposal_price . "@" . implode("~", array_map(function ($part) {
                          return preg_replace('/[~|=#@ ]/', '_', $part);
                        }, [
                          'label' => $proposal_label,
                          'source' => $proposal_source,
                        ])),
                      'age' => $age,
                    ];
                    $all_sources[$proposal_source] = null;
                  }
                }
              }
            }
          }
        }
      }
By Anonymous, 2018-01-24 12:49:44
contracts = Contract.objects.filter(staff=staff).filter(active=True)
if contracts.__len__() > 0:
   ind = contracts.__len__() - 1
   dic[‘active_contract_id’] = contracts[ind].id
else:
   dic[‘active_contract_id’] = contracts[0].id

Get last object of queryset in django

By itsN0ll, 2018-01-29 11:35:27
for x,x1 in enumerate(hack):
 
        if hack[x] in letters:
            exception +=1

ffs why

By just why, 2018-02-05 01:25:30
  $guard = ($vars->a_payment) + (0) * $price;
  if ($bless >= $guard) {
    $amount = $bless;
  }

Why not to write just 1 line?! $amount = max($bless, $vars->a_payment);

By Anonymous, 2018-02-05 17:27:25
private static function derivePrice(...)
  {
	$price = self::derivePriceUnchecked($vars);
    
    if (isset($price)) {
		// CODE HERE
    } 

    if (isset($price)) {
		// CODE HERE
    } 
    
    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    return $price;
  }
By Anonymous, 2018-02-06 11:38:18