$partnerChargesRegular = $row['charges'];
    $partnerChargesIrregular = $row['charges'];
    if (!isset($partnerChargesIrregular) || $partnerChargesIrregular == "") {
      $partnerChargesIrregular = $partnerChargesRegular;
    }

Look. We take A from X and B from X. Then, you make a check, and if it is true you assing A to B. BUT A AND B ARE TAKEN FROM THE SAME X PLACE!!! HOW CAN THEY DIFFER?!?!!!?!?!?!?!!

By My boss, 2018-02-20 10:06:53
$options.splice($options.indexOf('option7'), 1);
$options.splice($options.indexOf('option5'), 1);
$options.splice($options.indexOf('option4'), 1);
$options.splice($options.indexOf('option3'), 1);
$options.splice($options.indexOf('option2'), 1);
$options.splice($options.indexOf('option1'), 1);
By A "senior" developer, 2018-02-19 16:49:52
	public static int findSplitVariable(LinkedList<ByteDataRow> matrix) {
		LinkedList<ByteDataRow> list = new LinkedList<ByteDataRow>();
		int maxNoOfZeros = 0;
		int maxNoOfOnes = 0;
		int varId = -1;
		int[] NoOfOnesInColumn = new int[matrix.get(0).getInVars().length];


		for (ByteDataRow bdr : matrix) {
			int tmpNoOfZeros = bdr.getNumberOfZeros();
			if (maxNoOfZeros < tmpNoOfZeros) {
				list.clear();
				list.add(bdr.clone());
				maxNoOfZeros = tmpNoOfZeros;
			} else if (maxNoOfZeros == tmpNoOfZeros) {
				list.add(bdr.clone());
			}
		}

		for (ByteDataRow bdr : list) {
			byte[] vars = bdr.getInVars();
			for (int i = 0; i < vars.length; i++) {
				NoOfOnesInColumn[i] = NoOfOnesInColumn[i]
						+ Byte.compare(vars[i], Byte.parseByte("0"));
				if (NoOfOnesInColumn[i] > maxNoOfOnes) {
					maxNoOfOnes = NoOfOnesInColumn[i];
					varId = i;
				}
			}
		}

		return varId;
	}

	public static int findSplitVariable(LinkedList<ByteDataRow> matrix, int varIdx) {
		LinkedList<ByteDataRow> list = new LinkedList<ByteDataRow>();
		int maxNoOfZeros = 0;
		int maxNoOfOnes = 0;
		int varId = -1;
		int[] NoOfOnesInColumn = new int[matrix.get(0).getInVars().length];

		// Wybierz kostkÍ z najwiÍkszπ liczbπ zer.
		for (ByteDataRow bdr : matrix) {
			int tmpNoOfZeros = bdr.getNumberOfZeros();
			if (maxNoOfZeros < tmpNoOfZeros) {
				list.clear();
				list.add(bdr.clone());
				maxNoOfZeros = tmpNoOfZeros;
			} else if (maxNoOfZeros == tmpNoOfZeros) {
				list.add(bdr.clone());
			}
		}

		for (ByteDataRow bdr : list) {
			byte[] vars = bdr.getInVars();
			for (int i = 0; i < vars.length; i++) {
				NoOfOnesInColumn[i] = NoOfOnesInColumn[i]
						+ Byte.compare(vars[i], Byte.parseByte("0"));
				if (NoOfOnesInColumn[i] > maxNoOfOnes) {
					maxNoOfOnes = NoOfOnesInColumn[i];
					varId = i;
				}
			}
		}

		return varId;
	}

There are two methods findSplitVariable. Second one takes extra parameter (varIdx) that is not used anywhere.

By Paul, 2018-02-17 14:47:37
base.transform.name = this.bodyName;
		this.radius = this.diameterKm * 500.0;
		this.mass = Math.Pow(this.radius, 2.0) * this.surfaceGravity;
		this.cameraSwitchHeightM = this.cameraSwitchHeightKm * 1000.0;
		if (this.atmosphereData.shadowIntensity == 0f)
		{
			this.atmosphereData.shadowIntensity = 1.65f;
		}
		this.atmosphereData.atmosphereHeightM = this.atmosphereData.atmosphereHeightKm * 1000.0;
		if (this.terrainData.terrainMaterial != null)
		{
			this.terrainData.terrainMaterial.color = this.terrainData.terrainColor;
		}
		this.terrainData.maxTerrainHeight = this.GetMaxTerrainHeight();
		this.terrainData.unitToAngle = 360.0 / ((this.radius + this.terrainData.maxTerrainHeight) * 2.0 * 3.1415926535897931);
		for (int i = 0; i < this.terrainData.detailLevels.Length; i++)
		{
			this.terrainData.detailLevels[i].chunckSize = (double)this.terrainData.baseChunckSize / Math.Pow(2.0, (double)i);
			this.terrainData.detailLevels[i].angularSize = (float)this.terrainData.detailLevels[i].chunckSize / (float)this.terrainData.heightMaps[0].heightMap.HeightDataArray.Length * 360f;
		}
		this.terrainData.detailLevels[0].loadDistance = double.PositiveInfinity;
		if (this.type == CelestialBodyData.Type.Star)
		{
			this.parentBody = null;
			this.orbitData.SOIMultiplier = double.PositiveInfinity;
		}
		if (this.parentBody != null && (this.type == this.parentBody.type || (this.type == CelestialBodyData.Type.Planet && this.parentBody.type == CelestialBodyData.Type.Moon)))
		{
			this.parentBody = null;
		}
		if (this.parentBody != null)
		{
			this.orbitData._period = Kepler.GetPeriod(0.0, this.orbitData.orbitHeightM, this.parentBody.mass);
			this.orbitData.periodString = Ref.GetTimeString(this.orbitData._period);
			this.orbitData._meanMotion = -6.2831853071795862 / this.orbitData._period;
			this.orbitData.orbitalVelocity = this.orbitData.orbitHeightM * this.orbitData._meanMotion;
			this.orbitData.SOI = this.orbitData.orbitHeightM * Math.Pow(this.mass / this.parentBody.mass, 0.4) * this.orbitData.SOIMultiplier;
			if (!this.ParentHasThisBodyAsSatellite())
			{
				List<CelestialBodyData> list = new List<CelestialBodyData>(this.parentBody.satellites);
				list.Add(this);
				this.parentBody.satellites = list.ToArray();
				this.parentBody.ValidateSatellites();
			}
By Anonymous, 2018-02-16 21:20:56

$d = explode(".",$request->get("due_date",".."));
foreach ($d as $key => $val) $d[$key]=(int)$val;

if (
	!is_numeric($d[0]) || $d[0]<1 ||$d[0]>31 ||
	!is_numeric($d[1]) || $d[1]<1 ||$d[1]>12 ||
	!is_numeric($d[2]) || $d[2]<2005 ||$d[2]>2100 ) {
    $error["due_date"] = "Missing date.";
}

I think this was the last piece of code the developer wrote .... :D

By elpado, 2018-02-15 14:41:45
<?php 
$k =1;
for($v = 0; $v < $nt; $v++) {         
	$bgClass= 'blueBg';
		if($k > 1 && $k%2 == 0){
			$bgClass= 'whiteBg';
		}
?> 
<tr  class="row_tr <?php echo $bgClass;?>">						
			<td class="row_td td_column_0">&nbsp;</td>					
			<td class="row_td column_1"><?php echo $rows[$v]['nothing'];?></td>
			...
			<td class="row_td td_column_0">&nbsp;</td>
	</tr>

<?php       
	$k++;
	}	
?>
By Unknown, 2018-02-13 14:47:19
var filter = options.dataSource.filter();

if(e.filter) {
   filter = filter && filter.filters.length ? filter.filters.concat(e.filter.filter) : e.filter.filters;
}
else {
   filter = filter && filter.filters.length ? filter.filters.linqRemove({ field: e.field }) : [];
}
options.dataSource.filter(filter);
By Anonymous, 2018-02-09 19:03:07
...
if (alignEntrySize & 1)
    alignEntrySize++;
if (alignEntrySize & 2)
    alignEntrySize += 2;
...
By dzuma, 2018-02-08 18:19:17
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
  $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
for x,x1 in enumerate(hack):
 
        if hack[x] in letters:
            exception +=1

ffs why

By just why, 2018-02-05 01:25:30
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
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
function isAllowSearchLength(text) {
    return text.length > isNaN(parseInt(text, 10)) ? 1 : 0;
}
By Anonymous, 2018-01-24 12:02:46
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