- 1
- 2
// bg_pmove.c -- both games player movement code
// takes a playerstate and a usercmd as input and returns a modifed playerstate
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+131
// bg_pmove.c -- both games player movement code
// takes a playerstate and a usercmd as input and returns a modifed playerstate
Дальше идут 11 тысяч строк нечитаемого говна. Это вообще нормально?!
+160
// проверяем на дубли
$email_exists = $db->select('SELECT * FROM customers_info AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.email LIKE ?', "%$email%")
|| $db->select('SELECT * FROM customers_info_inpr AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.inpr_email LIKE ?', "%$email%")
|| $db->select('SELECT * FROM customers_info_org AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.org_phone LIKE ?', "%$email%")
|| $db->select('SELECT * FROM customers_info_org AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.contact_phone LIKE ?', "%$email%");
Всего лишь проверка на дубли =)
+159
request.done(function(data){
if (data){
<...много кода с кучей вложенных if else ..>
noty({type: "success", text: 'Заказ взят с биржи'});
setTimeout(location.reload(), 2000);
}
} else if (data.error) {
console.log(data);
noty({type: "error", text: data.error["message"]});
}
});
i had n1ce debug time
+135
<html class=" js flexbox flexboxlegacy hashchange history rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity flash no-touch no-opera cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage applicationcache performance mediaqueries" lang="ru-RU" xml:lang="ru-RU" style="">
−84
public function equals(newSprite:SpriteVO): Boolean
{
return (newSprite.x == this.x &&
newSprite.y == this.y &&
newSprite.width == this.width &&
newSprite.height == this.height &&
newSprite.scaleX == this.scaleX &&
newSprite.scaleY == this.scaleY &&
newSprite.rotation == this.rotation &&
newSprite.assetId == this.assetId &&
newSprite.asset == this.asset &&
newSprite.track == this.track &&
newSprite.flipped == this.flipped)
}
Почему-то у меня есть впечатление, что люди которые пытаются писать на языке используя приемы из другого языка, это в первую очередь люди, которые не поняли оригинальную задумку в другом языке.
+136
int Sys_FunctionCmp(void *f1, void *f2) {
int i, j, l;
byte func_end[32] = {0xC3, 0x90, 0x90, 0x00};
byte *ptr, *ptr2;
byte *f1_ptr, *f2_ptr;
ptr = (byte *) f1;
if (*(byte *)ptr == 0xE9) {
//Com_Printf("f1 %p1 jmp %d\n", (int *) f1, *(int*)(ptr+1));
f1_ptr = (byte*)(((byte*)f1) + (*(int *)(ptr+1)) + 5);
}
else {
f1_ptr = ptr;
}
//Com_Printf("f1 ptr %p\n", f1_ptr);
ptr = (byte *) f2;
if (*(byte *)ptr == 0xE9) {
//Com_Printf("f2 %p jmp %d\n", (int *) f2, *(int*)(ptr+1));
f2_ptr = (byte*)(((byte*)f2) + (*(int *)(ptr+1)) + 5);
}
else {
f2_ptr = ptr;
}
//Com_Printf("f2 ptr %p\n", f2_ptr);
#ifdef _DEBUG
sprintf((char *)func_end, "%c%c%c%c%c%c%c", 0x5F, 0x5E, 0x5B, 0x8B, 0xE5, 0x5D, 0xC3);
#endif
for (i = 0; i < 1024; i++) {
for (j = 0; func_end[j]; j++) {
if (f1_ptr[i+j] != func_end[j])
break;
}
if (!func_end[j]) {
break;
}
}
#ifdef _DEBUG
l = i + 7;
#else
l = i + 2;
#endif
//Com_Printf("function length = %d\n", l);
for (i = 0; i < l; i++) {
// check for a potential function call
if (*((byte *) &f1_ptr[i]) == 0xE8) {
// get the function pointers in case this really is a function call
ptr = (byte *) (((byte *) &f1_ptr[i]) + (*(int *) &f1_ptr[i+1])) + 5;
ptr2 = (byte *) (((byte *) &f2_ptr[i]) + (*(int *) &f2_ptr[i+1])) + 5;
// if it was a function call and both f1 and f2 call the same function
if (ptr == ptr2) {
i += 4;
continue;
}
}
if (f1_ptr[i] != f2_ptr[i])
return qfalse;
}
return qtrue;
}
Хмм...
+132
#ifndef M_PI
#define M_PI 3.14159265358979323846f // matches value in gcc v2 math.h
#endif
Сишкопроблемы.
+215
if (new Boolean(false)) {
Отвратная вещь этот new.
+53
void MainWindow::on_actionHelp_triggered()
{
bool helpNoWritten = 0;
QDir d(QCoreApplication::applicationDirPath()+QDir::separator()+"help");
d.makeAbsolute();
if (d.exists() && d.entryList(QDir::Files).size())
helpNoWritten = !QDesktopServices::openUrl(QUrl::fromUserInput(QFileInfo(d.entryList(QDir::Files).at(0)).absoluteFilePath()));
else
helpNoWritten++;
if (helpNoWritten)
QMessageBox::warning(0,"Warning",QString::fromUtf8("Похоже документацию так никто и не написал... можете почитать исходники.\nЕсли напишете положите в папку help рядом с программой"), QString::fromUtf8("Okay..."));
}
Код вроде бы хороший, читается не очень да не суть... дело тут не в коде.
−85
public static function getItemIndex(array: Object, item: Object): int
{
var result: int = -1;
if (array is Array)
array = new ArrayCollection(array as Array);
if (array is ArrayCollection)
{
var collection: ArrayCollection = ArrayCollection(array);
result = collection.getItemIndex(item);
/* if (result == -1 && item is IEquals)
{
for (var index: int = 0; index < collection.length; index++)
{
var obj: Object = collection.getItemAt(index);
if (obj == item || (obj is IEquals && IEquals(item).equals(IEquals(obj))))
{
result = index;
break;
}
}
}*/
}
return result;
}
Душа настойчиво требовала Яву, но под рукой ничего подходящего не оказалось.
Для тех, кто не в курсе, это очередная попытка авторов супербиблиотеки изобрести Array.indexOf.