- 1
- 2
- 3
- 4
- 5
- 6
Nullable<float> r = p.Intersects( b );
if( r.HasValue)
{
c = Color.BlueViolet;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+29
Nullable<float> r = p.Intersects( b );
if( r.HasValue)
{
c = Color.BlueViolet;
}
+23.3
public function logout()
{
$_SESSION = array();
session_unset();
session_destroy();
setcookie("username", "", time() - 3600, "/", '.'.BASE_HTTP_HOST);
setcookie("password", "", time() - 3600, "/", '.'.BASE_HTTP_HOST);
}
Это чтоб уж наверняка, стереть сессию, так стереть...
+14
';alert(0)//\';alert(1)//";alert(2)//\";alert(3)//--></SCRIPT>"">'><SCRIPT>alert(4)</SCRIPT>=&{}"");}alert(6);function xss(){//"
';alert(0)//\';alert(1)//";alert(2)//\";alert(3)//--></SCRIPT>"">'><SCRIPT>alert(4)</SCRIPT>=&{}"");}alert(6);function xss(){//"
−47.1
public AlarmKey(AlarmKey key)
{
oc = "";
id = "";
source = null;
oc = key.oc;
id = key.id;
source = key.source;
}
DoubleCheck :)
+15
if (ValidatorBillablePhase())
{
// строк 40-50 кода
}
private static bool ValidatorBillablePhase()
{
return true;
}
я в шоке от такой валидации ;-)
+28
// country
if($user_country) {
$where .= '(tbl_publications.id_country = '.$user_country;
// city
if($user_city) {
$where .= ' OR tbl_publications.id_city = '.$user_city;
}
$where .= ')';
}else{
$where .= ' 1=1'; // black magic
}
черная магия.
+25.2
google search site:google.com/search?q=google+search
Интересно, а так рекурсия получится?
+3.4
try
{
...
if (obj == null)
{
LogManager.GetLogger("Log").Warn(msg);
throw new SoapException("Object not found", SoapException.ServerFaultCode);
}
}
catch (Exception ex)
{
LogManager.GetLogger("Log").Error(msg, ex);
throw new SoapException("Object not found, SoapException.ServerFaultCode, ex);
}
−23.1
if (TableData = 1) or ((TableData = 2) and
(Pos(FieldDelim + 'Т_НАЦ' + FieldDelim, OpArtFields) > 0)) then
sSelect := sSelect + ', ' + LMax + 'AR.Percent' + R + ' AR_Percent';
if (TableData = 1) or ((TableData = 2) and
(Pos(FieldDelim + 'Т_КАТ' + FieldDelim, OpArtFields) > 0)) then
sSelect := sSelect + ', ' + LMax + 'AR.ID_ArtCat' + R + ' AR_ID_ArtCat';
if (TableData = 1) or ((TableData = 2) and
(Pos(FieldDelim + 'Т_ВЕС' + FieldDelim, OpArtFields) > 0)) then
sSelect := sSelect + ', ' + LMax + 'AR.Weight' + R + ' AR_Weight';
if (TableData = 1) or ((TableData = 2) and
(Pos(FieldDelim + 'Т_ОБЪЕМ' + FieldDelim, OpArtFields) > 0)) then
sSelect := sSelect + ', ' + LMax + 'AR.Capacity' + R + ' AR_Capacity';
if (TableData = 1) or ((TableData = 2) and
(Pos(FieldDelim + 'МИННАЦ' + FieldDelim, OpArtFields) > 0)) then
sSelect := sSelect + ', ' + LMax + 'AR.MinDiscount' + R + ' AR_MinDiscount';
if (TableData = 1) or ((TableData = 2) and
(Pos(FieldDelim + 'Т_МИНКОЛ' + FieldDelim, OpArtFields) > 0)) then
sSelect := sSelect + ', ' + LMax + 'AR.MinQuantity' + R + ' AR_MinQuantity';
if (TableData = 1) or ((TableData = 2) and
(Pos(FieldDelim + 'Т_СТАТУС' + FieldDelim, OpArtFields) > 0)) then
sSelect := sSelect + ', ' + LMax + 'AR.Status' + R + ' AR_Status';
if (TableData = 1) or ((TableData = 2) and
(Pos(FieldDelim + 'Т_ГТД' + FieldDelim, OpArtFields) > 0)) then
sSelect := sSelect + ', ' + LMax + 'AR.GTD' + R + ' AR_GTD';
if (TableData = 1) or ((TableData = 2) and
(Pos(FieldDelim + 'Т_СТРАНА' + FieldDelim, OpArtFields) > 0)) then
sSelect := sSelect + ', ' + LMax + 'CO.Name' + R + ' AR_Country';
Собирание SQL - запроса для выборки полей. И это маленький кусочек :)
Серьёзная контора с миллиардными оборотами!
+27
private int checkTerm(PatternTerm term, int arr[],
int symbNum, boolean isEditing) {
if (term.count != INFINITY) {
int endIdx = Math.min(symbNum + term.count, arr.length);
int count = 0;
switch(term.termType) {
case DIGIT: {
for(int i = symbNum; i < endIdx; i++) {
if (!Character.isDigit((char)arr[i]))
return -1;
count++;
}
break;
}
case LETTER: {
for(int i = symbNum; i < endIdx; i++) {
if (!Character.isLetter((char)arr[i]))
return -1;
count++;
}
break;
}
case LETTERORDIGIT: {
for(int i = symbNum; i < endIdx; i++) {
if (!Character.isLetterOrDigit((char)arr[i]))
return -1;
count++;
}
break;
}
case CHARACTER: {
for(int i = symbNum; i < endIdx; i++) {
if (arr[i] != term.value)
return -1;
count++;
}
break;
}
}
if (!isEditing && count != term.count)
return -1;
symbNum+=term.count;
} else {
int i = 0;
switch(term.termType) {
case DIGIT: {
while (((symbNum + i) < arr.length) &&
Character.isDigit((char)arr[symbNum + i])) i++;
break;
}
case LETTER: {
while (((symbNum + i) < arr.length) &&
Character.isLetter((char)arr[symbNum + i])) i++;
break;
}
case LETTERORDIGIT: {
while (((symbNum + i) < arr.length) &&
Character.isLetterOrDigit((char)arr[symbNum + i])) i++;
break;
}
case CHARACTER: {
while (((symbNum + i) < arr.length) &&
(arr[symbNum + i] == term.value)) i++;
break;
}
}
symbNum+=i;
}
return symbNum;
}
Паша любит такие конструкции, которые хрен разобрать