- 1
- 2
- 3
- 4
Splash = playGrayscaleSplashFx
playGrayscaleSplashFx = function()
end
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−87
Splash = playGrayscaleSplashFx
playGrayscaleSplashFx = function()
end
Хороший, годный аналог #define true false.
Обнаружен в Lua-скрипте, автоматически включающемся во все скриптовые контексты (примерный аналог precompiled header).
playGrayscaleSplashFx - функция, экспортируемая в Lua из C++ кода.
Внёс в неё изменения, попытался протестировать результат... долго думал.
+200
for (k = 0; k < xl; k += 16) {
AA = a;
BB = b;
CC = c;
DD = d;
a = _FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
d = _FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
c = _FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
b = _FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
a = _FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
d = _FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
c = _FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
b = _FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
a = _FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
d = _FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
c = _FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
b = _FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
a = _FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
d = _FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
c = _FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
b = _FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
a = _GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
d = _GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
c = _GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
b = _GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
a = _GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
d = _GG(d, a, b, c, x[k + 10], S22, 0x2441453);
c = _GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
<40 строк поспипано>
b = _II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
a = addUnsigned(a, AA);
b = addUnsigned(b, BB);
c = addUnsigned(c, CC);
d = addUnsigned(d, DD);
}
http://phpjs.org/downloads/phpjs.commonjs.js.
Там оказалось реально много жира. Я сначала подумал, что сеть Фейштеля, но потом-таки разглядел MD5.
Говносути это конечно не меняет.
+156
if (coms->Strings[1]=="install") {
if (GetFile("localhost",WinDir+comms->Strings[3]) {
execCommand=true;
}else{
execCommand=false;
}
вот такое вот чудо нашел в одном проЭкте предыдущего програмера, который до меня работал)
вместо localhost передавалось имя файла на сервере
+997
char* CFastSmtp::_formatHeader()
{
// check for at least one recipient
if(Recipients.size() <= 0 ) {
printf("Please add a message recipient!\r\n");
return NULL;
}
int s=0;
char *msgHeader = new char[16385];
//char to[1024];
for (unsigned int i=s=0;i<Recipients.size();i++) {
s+=strlen(Recipients.at(i)->GetEmail())+1;
} if (s==0) s=1; char *to = new char[s];
//char cc[1024];
for (i=s=0;i<CCRecipients.size();i++) {
s+=strlen(CCRecipients.at(i)->GetEmail())+1;
} if (s==0) s=1; char *cc = new char[s];
//char bcc[1024];
for (i=s=0;i<BCCRecipients.size();i++) {
s+=strlen(BCCRecipients.at(i)->GetEmail())+1;
} if (s==0) s=1; char *bcc = new char[s];
TCHAR szDate[500];
TCHAR sztTime[500];
// create the recipient string, cc string, and bcc string
to[0] = '\0';
for (i=0;i<Recipients.size();i++) {
i > 0 ? strcat(to,","):strcat(to,"");
strcat(to,Recipients.at(i)->GetEmail());
}
cc[0] = '\0';
for (i=0;i<CCRecipients.size();i++) {
i > 0 ? strcat(cc,","):strcat(cc,"");
strcat(cc,CCRecipients.at(i)->GetEmail());
}
bcc[0] = '\0';
for (i=0;i<BCCRecipients.size();i++) {
i > 0 ? strcat(bcc,","):strcat(bcc,"");
strcat(bcc,BCCRecipients.at(i)->GetEmail());
}
// get the current date and time
SYSTEMTIME st={0};
::GetSystemTime(&st);
::GetDateFormat(LOCALE_SYSTEM_DEFAULT,0,&st,"ddd',
' dd MMM yyyy",szDate,sizeof(szDate));
::GetTimeFormat(LOCALE_SYSTEM_DEFAULT,TIME_FORCE24HOURFORMAT,&st,
"HH':'mm':'ss tt",sztTime,sizeof(sztTime));
// here it is...the main data of the message
wsprintf(msgHeader,"DATE: %s %s\r\n", szDate, sztTime);
if (m_pcFromName != NULL) {
strcat(msgHeader,"FROM: ");
strcat(msgHeader, m_pcFromName);
strcat(msgHeader, "\r\n");
}
strcat(msgHeader,"To: ");
strcat(msgHeader, to);
strcat(msgHeader, "\r\n");
strcat(msgHeader,"Cc: ");
strcat(msgHeader, cc);
strcat(msgHeader, "\r\n");
if (m_pcSubject != NULL) {
strcat(msgHeader, "Subject: ");
strcat(msgHeader, m_pcSubject);
strcat(msgHeader, "\r\n");
}
if (m_pcXMailer != NULL) {
strcat(msgHeader,"X-Mailer: ");
strcat(msgHeader, m_pcXMailer);
strcat(msgHeader, "\r\n");
}
// start optional fields
if (m_pcReplyTo != NULL) {
strcat(msgHeader, "Reply-To: ");
strcat(msgHeader, m_pcReplyTo);
strcat(msgHeader, "\r\n");
}
// start MIME versions
strcat(msgHeader,
"MIME-Version: 1.0\r\nContent-type: text/plain; charset=US-ASCII\r\n");
// send header finish command
strcat(msgHeader, "\r\n");
// clean up
delete to;
delete cc;
delete bcc;
// done
return msgHeader;
}
аццкий говнокодер
http://www.codeproject.com/Articles/623/CFastSmtp-Fast-and-easy-SMTP-class
+153
function fnCheckNetwork($intNetworkId)
{
if (intval($intNetworkId) == 0)
{
return false;
}
if ($intNetworkId != $this->fnGetNetworkId())
{
return false;
}
return true;
}
Замечу, что функция использовалась как приватная, а $intNetworkId никогда не мог быть 0.
Вобщем оригинальный способ проверить на равентсво два числа ))
+130
public void GetLocalUsers(out List<string> members) { ... }
Первый раз вижу что-то подобное.
+197
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.an)!==-1;},ctype_alpha:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.al)!==-1;},ctype_cntrl:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.ct)!==-1;},ctype_digit:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.dg)!==-1;},ctype_graph:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.gr)!==-1;},ctype_lower:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.lw)!==-1;},ctype_print:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.pr)!==-1;},ctype_punct:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.pu)!==-1;},ctype_space:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.sp)!==-1;},ctype_upper:function(text){if(typeof text!=='string'){return false;}
this.setlocale('LC_ALL',0);return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.up)!==-1;},ctype_xdigit:function(text){if(typeof text!=='string'){return false;}
При беглом просмотре бросился мне тут в глаза кусочек из http://phpjs.org/downloads/php.common.min.js
−85
http://pastebin.com/UaTdN6K2
А выложу ка я это тут.
Гуано трёхлетней выдержки. Фрагментации не поддаётся. Ныне отправлено на удобрения.
+158
function SetCeilingType(Txt) {
if (Txt == "1") {
document.getElementById("сeilType").value = Txt //"Одноуровневый";
}
else {
document.getElementById("сeilType").value = Txt //"Двухуровневый";
}
createLink();
}
Сраная школота уходит в буддизм.
Вот такая сентенция была найдена за flash-кодером, хуже всего что функция глобальна, так как дергается ИЗ ФЛЕША при изменении в нем данных. Творческое прочтение паттерна инверсии зависимости, сцуко!
+78
Drawable d = getResources().getDrawable(R.drawable.screen_width);
int width = d.getMinimumWidth();
switch (width) {
case 1024:
CAMERA_WIDTH = 1024;
CAMERA_HEIGHT = 600;
break;
case 800:
CAMERA_WIDTH = 800;
CAMERA_HEIGHT = 480;
break;
case 480:
CAMERA_WIDTH = 480;
CAMERA_HEIGHT = 320;
break;
case 320:
CAMERA_WIDTH = 320;
CAMERA_HEIGHT = 240;
break;
default:
CAMERA_WIDTH = 800;
CAMERA_HEIGHT = 480;
break;
}
Вот так автор определял размер экрана в Android...по размеру загруженной картинки в ресурсах
Про getResources().getConfiguration().screen Layout наверное он не знал...