- 1
- 2
- 3
- 4
- 5
- 6
#define TRUE (1)
#define FALSE (0)
#define internal protected:
#define external public:
#define declareSuper(superClass) protected: typedef superClass super
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+24
#define TRUE (1)
#define FALSE (0)
#define internal protected:
#define external public:
#define declareSuper(superClass) protected: typedef superClass super
Оттуда.
+39
<?php
session_start();
include ("system/db.config.php");
if (empty($_SESSION['login']) or empty($_SESSION['id']))
{
header("Location: index.php");
}
else
{
//Выясняем, кто зашел сюда, если админ, удаляем юзера, если нет - перекидываем в список пользователей
$fResult = mysql_query("SELECT user_level FROM users WHERE id=".$_SESSION['id'], $db);
$fRow = mysql_fetch_array($fResult);
if($fRow['user_level'] == 1)
{
$DelTenderId = $_GET['id'];
$DellFiled = mysql_query("SELECT file_link FROM tenders WHERE id=".$DelTenderId);
$isdLnk = mysql_fetch_array($DellFiled);
$delPater = "uploads/".$isdLnk['file_link'];
unlink($delPater);
mysql_query("DELETE FROM tenders WHERE id =".$DelTenderId);
header("Location: tenders_list.php");
}
else
{
header("Location: home.php");
}
}
?>
Ну как то так....
+83
if ((decoded.length() > 40) && (el != null))
el.addMsg("Info: Decoded More Characters Than Is Specified By The Track 2 ANSI/ISO Standards");
else if ((decoded.length() > 107) && (el != null)) {
el.addMsg("Info: Decoded More Characters Than Is Specified By The Track 3 ANSI/ISO Standards");
}
Декодинг содержимого магнитной полосы карты в софте одного банка.
+158
if (
event.which == $.ui.keyCode.COMMA ||
event.which == $.ui.keyCode.ENTER ||
(
event.which == $.ui.keyCode.TAB &&
that._tagInput.val() !== ''
) ||
(
event.which == $.ui.keyCode.SPACE &&
that.options.allowSpaces !== true &&
(
$.trim(that._tagInput.val()).replace( /^s*/, '' ).charAt(0) != '"' ||
(
$.trim(that._tagInput.val()).charAt(0) == '"' &&
$.trim(that._tagInput.val()).charAt($.trim(that._tagInput.val()).length - 1) == '"' &&
$.trim(that._tagInput.val()).length - 1 !== 0
)
)
)
) {
event.preventDefault();
that.createTag(that._cleanedInput());
// The autocomplete doesn't close automatically when TAB is pressed.
// So let's ensure that it closes.
that._tagInput.autocomplete('close');
}
https://github.com/aehlke/tag-it/blob/master/js/tag-it.js#L183
+14
[code=cpp]
#include <iostream>
#include <cmath>
void foo(double x, double y)
{
if (std::cos(x) != std::cos(y))
std::cout << "Я знаю точно невозможное возможно";
}
int main()
{
foo(1.0, 1.0);
return 0;
}
[/code]
floatы и нуб.
−112
while h == h
Делал так раньше, когда не знал про while True
+136
private BusinessSocialProfile GetSocialProfileLink(string searchProvider, string searchKey)
{
var link = new BusinessSocialProfile { Name = searchProvider, Url = "#" };
if (searchProvider.Contains("city", StringComparison.InvariantCultureIgnoreCase))
{
link.Url = cityLink;
link.Logo = "/citysearch.png";
link.ImageStyle = "margin-top:-8px";
}
else if (searchProvider.Contains("google", StringComparison.InvariantCultureIgnoreCase))
{
link.Url = googleLink;
link.Logo = "/google.png";
}
else if (searchProvider.Contains("yelp", StringComparison.InvariantCultureIgnoreCase))
{
link.Url = yelpLink;
link.Logo = "/yelp.png";
link.ImageStyle = "margin-top:-8px";
}
else if (searchProvider.Contains("manta", StringComparison.InvariantCultureIgnoreCase))
{
link.Url = mantaLink;
link.Logo = "/manta.png";
}
else if (searchProvider.Contains("patch", StringComparison.InvariantCultureIgnoreCase))
{
link.Url = patchLink;
link.Logo = "/patch.png";
}
else
{
link.Url = "#";
link.Logo = string.Empty;
link.Name = string.Empty;
}
return link;
}
уже до боли известный девелопер ;) а для чего еще нужна бизнесс-логика...?
+141
C:\>php -r "echo mb_convert_encoding('хуй', 'cp866', 'windows-1251') . chr(7);"
+132
#define LengthOfArrayInternal(a)(sizeof(a)/sizeof(a[0]))
#define is_array(x) _Generic((x), typeof((x)[0])[LengthOfArrayInternal(x)]:1, default: 0)
#define COMPILE_TIME_ASSERT(expr) char constraint[expr]
#define length_of_array(a) ({COMPILE_TIME_ASSERT(is_array(a)); LengthOfArrayInternal(a)})
Определение длины массива. gcc и с11 only.
Говно как известно рождается в споре:
http://govnokod.ru/12108#comment160631
+109
GLOBAL _start
SEGMENT .text
_start:
mov eax,4 ; N function=write
mov ebx,1 ; N handle=1 (stdout)
mov ecx, txt ; address of buf
mov edx,16 ; number of byte
int 80h
mov eax,3 ; N function=read
mov ebx,0 ; 0 handle=0 (stdin)
mov ecx, buf ; address of buf
mov edx,80 ; number of byte
int 80h
mov [len],eax ;save length buf
mov byte [buf+1],'!'
mov eax,4 ; N function=write
mov ebx,1 ; N handle=1 (stdout)
mov ecx, buf ; address of buf
mov edx,[len] ; number of byte
int 80h
mov eax,1 ; function=exit
int 80h
SEGMENT .data
buf times 80 db 0 ;
len dd 0
txt db 'Enter the text '