- 1
- 2
- 3
_itemList.splice(0, uint.MAX_VALUE);
_amuletList.splice(0, uint.MAX_VALUE);
_timeArtefactList.splice(0, uint.MAX_VALUE);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−116
_itemList.splice(0, uint.MAX_VALUE);
_amuletList.splice(0, uint.MAX_VALUE);
_timeArtefactList.splice(0, uint.MAX_VALUE);
+100
int i = 0;
foreach (SomeType item in someCollection)
{
if (i > 0) break;
// ... обрабатываем item
}
Берём первый элемент коллекции и обрабатываем...
+159
if (!is_array($array)) {$array = array($array)}
+144
genchatmessage: function(text, avatar1, avatar2, time, rtl) {
if (typeof rtl == "undefined") var rtl = false;
if (typeof avatar == "undefined") var avatar = "images/user_male.png";
if (typeof time == "undefined") var time = this.gettime();
var tr = document.createElement("tr");
var td = [document.createElement("td"), document.createElement("td"), document.createElement("td")];
var div = document.createElement("div");
var span = document.createElement("span");
var pre = document.createElement("pre");
span.innerHTML = time;
pre.innerHTML = interface.innerText(String(text));
if (rtl) {
div.className = "chat-message-rtl";
} else div.className = "chat-message";
if (typeof avatar1 == "string") {
var img1 = document.createElement("img");
img1.src = avatar1;
td[0].appendChild(img1);
}
if (typeof avatar2 == "string") {
var img2 = document.createElement("img");
img2.src = avatar2;
td[2].appendChild(img2);
}
+157
strrev(strstr(strrev(substr(strip_tags(stripslashes(htmlspecialchars_decode($row['description']))), 0, 250))," "))
Вывод краткого содержания материала, найдено на просторах самописного сайта.
+138
typedef struct {
UInt8 byte0;
UInt8 byte1;
UInt8 byte2;
UInt8 byte3;
UInt8 byte4;
UInt8 byte5;
UInt8 byte6;
UInt8 byte7;
UInt8 byte8;
UInt8 byte9;
UInt8 byte10;
UInt8 byte11;
UInt8 byte12;
UInt8 byte13;
UInt8 byte14;
UInt8 byte15;
} CFUUIDBytes;
http://developer.apple.com/library/ios/documentation/CoreFoundation/Reference/CFUUIDRef/Reference/reference.html
Nuff said.
+138
(04/12/2013 01:39:15 AM) Он: здаров
(01:39:26 AM) Он: какова хуя $num_point_reverse = $num_point['number'] - 5;
(01:39:40 AM) Он: возвращает число и перед числом знак -
(01:39:42 AM) Он:
?
(01:50:00 AM) Я: 2-5 =скока?
(01:50:18 AM) Он: а блядь
(01:50:25 AM) Я: ))))
+148
if (!$_FILES['image']['size'] > 0) {
return;
}
и что самое интересное - оно делает то, что автор пытался изобразить!
−112
+(NSString*)filterDigits:(NSString*)number
{
unichar zer = '0', nine = '9', cur;
unsigned long l = [number length];
NSMutableData *buf = [NSMutableData data];
for (unsigned long j = 0; j!=l; j++)
{
cur = [number characterAtIndex:j];
if (cur>=zer&&cur<=nine)
{
char digit = (char)cur;
[buf appendBytes:&digit length:sizeof(char)];
}
}
NSString* ret = [[[NSString alloc] initWithData:buf encoding:NSUTF8StringEncoding] autorelease];
return ret;
}
Золотые у тебя руки парень. Но всеравно не оттуды растут (;
+149
// Hack - blacklist
if ($msg->abonent == '12345678910')
die("Database error");
Найдено в крупном и сложном проекте, посреди часто вызываемого кода - проверка на забаненный номер (номер изменён).