Mistři v programování na #hovnokod

Když standardní namespace nevyhovuje...

class _app_°_app_°view__html_index 
    extends _app_°_base_°base_app__view_
{
   ...
}

Anonymous,

public function getRandomText($length = 6)
	{
		$md5 = "";
		while (strlen($md5) < 6) {
			$str = 'blabla ' . date('r') . 'asdf' . rand(1, 10000000);
			$md5 .= md5($str);
		}
		return substr($md5, 0, $length);
	}

Jakub Filla,

Takto sa robia zaporne cisla z kladnych :-)

$suma = ($item['suma'] - ($item['suma'] * 2));

Anonymous,

Jedná o javascriptovou funkce generovanou php kodem z webu rar.cz K vidění na http://www.rar.cz/data/cena.php Donedávna kód končil podmínkou if (count <= 4999) return 120 poté co jsme se dožadovali 5000 licencí za cenu NaN správci přidali zbývající podmínky

function price(product, count) { var p = product; if (p == 2) p = 1; if (p == 3) p = 1; if (p == 4) p = 1; if (p == 5) p = 1; if (p == 7) p = 0; if (p == 1) { if (count <= 0)	return 715; if (count <= 1)	return 795; if (count <= 9)	return 610; if (count <= 24)	return 477; if (count <= 49)	return 400; if (count <= 99)	return 318; if (count <= 199)	return 240; if (count <= 499)	return 212; if (count <= 999)	return 186; if (count <= 1999)	return 159; if (count <= 4999)	return 120; if (count <= 9999)	return 93; if (count <= 19999)	return 66; if (count <= 49999)	return 53; if (count <= 99999)	return 40; if (count > 99999)	return 40; } if (p == 6) { if (count <= 0)	return 618; if (count <= 1)	return 730; if (count <= 2)	return 580; if (count <= 5)	return 495; if (count <= 10) return 435; if (count <= 25)	return 340; if (count <= 50)	return 250; if (count <= 100)	return 186; if (count <= 250)	return 144; } return NaN; }

Anonymous,


Anonymous,