- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
function showEntry($name)
{
if(empty($name))
{
return false;
break;
}
...
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+146
function showEntry($name)
{
if(empty($name))
{
return false;
break;
}
...
}
+154
<?php
function crypt_apr1_md5($plainpasswd) {
$salt = substr(str_shuffle("abcdefghijklmnopqrstuvwxyz0123456789"), 0, 8);
$len = strlen($plainpasswd);
$text = $plainpasswd.'$apr1$'.$salt;
$bin = pack("H32", md5($plainpasswd.$salt.$plainpasswd));
for($i = $len; $i > 0; $i -= 16) { $text .= substr($bin, 0, min(16, $i)); }
for($i = $len; $i > 0; $i >>= 1) { $text .= ($i & 1) ? chr(0) : $plainpasswd{0}; }
$bin = pack("H32", md5($text));
for($i = 0; $i < 1000; $i++) {
$new = ($i & 1) ? $plainpasswd : $bin;
if ($i % 3) $new .= $salt;
if ($i % 7) $new .= $plainpasswd;
$new .= ($i & 1) ? $bin : $plainpasswd;
$bin = pack("H32", md5($new));
}
for ($i = 0; $i < 5; $i++) {
$k = $i + 6;
$j = $i + 12;
if ($j == 16) $j = 5;
$tmp = $bin[$i].$bin[$k].$bin[$j].$tmp;
}
$tmp = chr(0).chr(0).$bin[11].$tmp;
$tmp = strtr(strrev(substr(base64_encode($tmp), 2)),
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
return "$"."apr1"."$".$salt."$".$tmp;
}
?>
Кручу-верчу, запутать хочу!
−119
standby: function(version) {
FastChat.destroy();
curFastChat.standby = true;
var to = 1,
cb = function() {
if (!curNotifier.is_server) {
curFastChat.standbyTO = setTimeout(cb, to * 1000);
return;
}
ajax.post('notifier.php?act=a_get_reload', {
version: version
}, {
onDone: function(navVersion, config) {
FastChat.lcSend('gotConfig', {
navVersion: navVersion,
config: config
});
FastChat.gotConfig(navVersion, config);
},
onFail: function() {
to *= 2;
curFastChat.standbyTO = setTimeout(cb, to * 1000);
return true;
}
});
};
cb();
},
gotConfig: function(navVersion, config) {
clearTimeout(curFastChat.standbyTO);
if (!curFastChat.standby) {
return;
}
setTimeout(function() {
if (navVersion > stVersions['nav']) {
debugLog('appending al loader');
headNode.appendChild(ce('script', {
type: 'text/javascript',
src: '/al_loader.php?act=nav&v=' + navVersion
}));
}
setTimeout(function() {
if (navVersion <= stVersions['nav']) {
stManager.add(['notifier.js', 'notifier.css'], function() {
FastChat.init(config);
})
return;
}
setTimeout(arguments.callee, 100);
}, 0);
}, curNotifier.is_server ? 0 : irand(1000, 2000));
},
updateVersion: function(version) {
FastChat.lcSend('standby', {
version: version
});
FastChat.standby(version);
},
// Local connection: communication between tabs in one browser instanse
lcSend: function(act, data) {
// debugLog('fc::lcSend', act, clone(data));
Notifier.lcSend('fastchat', extend({
act: act,
__id: curFastChat.me && curFastChat.me.id || vk.id
}, data));
},
lcRecv: function(data) {
if (isEmpty(data)) return;
var act = data.act;
if (data.__id != (curFastChat.me && curFastChat.me.id || vk.id)) {
debugLog('drop foreign event', data);
return;
}
delete data.act;
delete data.__id;
FastChat.lcFeed(act, data);
},
lcFeed: function(act, data) {
+134
void cmps_genslave(prog src[progs], char slave, char look){ // заполнение списков нелокальных имен
int s=0,m=0,l=0;
while( src[s].name[0]!=0 && src[s].name[0]!=slave && s<progs)s++;
if(!src[s].master) return;
if(look==slave){ if(src[s].nonlnum) return; l=s; }else
while( src[l].name[0]!=0 && src[l].name[0]!=look && l<progs)l++;
if(!src[l].master) return;
while(src[m+1].name[0]!=0 && src[l].master==src[m+1].name[0] && m+1<progs)m++;
strcpy(src[s].nonlocals+strlen(src[s].nonlocals),src[m].locals);
src[s].nonlnum+=src[m].lnum;
if(src[m].master) cmps_genslave(src,slave,src[m].name[0]);
}
курсовик по проге на втором курсе, изобретаем области видимости
+163
/* allocate memory for the extended format buffer */
extFormat = new char [ strlen( format ) +
strlen( "\n" ) +
1 ];
if ( (char*)0 != extFormat )
{
/* extend format info */
sprintf ( extFormat, "%s", format );
strcat ( extFormat, "\n" );
}
из реализации логгера. просто нет слов.
+147
/*Авотризвация*/
table.authform
{
border: 1px solid #899AB2;
}
.............
Интерлайн Про Авотризвирует -_-
+164
FrmCabinetFound *frm = new FrmCabinetFound(index.data(Qt::UserRole).toInt());
((QMdiArea*)this->parent()->parent()->parent())->addSubWindow(frm);
frm->show();
−97
i = 0
t = 12
r = 0
g = 0
while r!=1:
i = i + 1
if t%i==0:
g = g + 1
if i==5000:
print t, ' - ',g
i, g = 0, 0
t = t + 1
if t==203:
r = 1
Нахождение дилителей.
Вот так-вот, человек видимо на любит юзать цикл for=)
+71
@Test
public void testExecuteNoBean1() {
try {
//...
} catch (Exception e) {
assertEquals("ActionHandlerDefineDueDate: Error, failed to retrieve ... <over 9000 chars>", e.getMessage());
}
}
У кого-то явно проблемы с TDD.
−112
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
[KQCache clearCache];
}
memory warning?
значит надо очистить, и пох какая memory!