- 1
- 2
- 3
- 4
- 5
- 6
- 7
try {
AjaxContext ajaxContext = AjaxContextImpl
.getCurrentInstance(context);
ajaxContext.setAjaxRequest(true);
} catch (Exception e) {
e.getMessage();
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+150
try {
AjaxContext ajaxContext = AjaxContextImpl
.getCurrentInstance(context);
ajaxContext.setAjaxRequest(true);
} catch (Exception e) {
e.getMessage();
}
+147
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
char end;
char *stroka[end];
int number[10] = {0,1,2,3,4,5,6,7,8,9};
int size = 0;
cout << "Input element of array: \n";
while(end != '*')
{
cin >> end;
*stroka[size] = end;
size++;
}
for(int i = 0; i < size-1; i++)
{
cout << stroka[i] << " ";
}
for(int i = 0; i < size-1; i++)
{
for(int j = 0; j < 10; j++)
{
if(*stroka[i] == number[j])
{
cout << *stroka[i] << " ";
}
}
}
system("PAUSE");
}
говнокод одногруппника. оно ещё и собирается 0_o.
−870.1
select x1.g_id,
(select switch(
str='0','новое строительство',
str='1','подготовка территории',
str='2','реконструкция',
str='3','снос' )
from t1
where g_id=x1.p_id
and f_id in(1,71,81)
and id=1),
(select switch(
str='0','административное здание',
str='1','детский сад',
str='2','дорога',
str='3','жилое здание',
str='4','инженерные сети',
str='5','коммуникации',
str='6','поликлиника',
str='7','путепровод',
str='8','ЦТП',
str='9','школа') from t1
where g_id=x1.p_id
and f_id in(1,71,81)
and id=2),
(select 'Субъект '+
(select str from subj
where type1=1
and id1=int(x3.str))+
switch(
x4.str='0',', город ',
x4.str='1',', деревня ',
x4.str='2',', ПГТ ',
x4.str='3',', поселок ',
x4.str='4',', село ')+
(select str from subj
where type1=3
and id1=int(x5.str))+iif(x6.str,
(select ', '+str from subj
where type1=2
and id1=int(x6.str)),'')+iif(x7.str,
(select ', '+str from subj
where type1=5
and id1=int(x7.str)),'')+iif(x8.str,',микр.'+x8.str,'')+iif(x9.str,', квартал '+x9.str,'')+iif(x10.str,', жил.группа '+x10.str,'')+
(select Format(', '+str) from t1
where f_id in(1,71,81)
and id=12
and g_id=x1.p_id)+iif(x11.str,', вл.'+x11.str,'')+iif(x12.str,', д.'+x12.str,'')+iif(x13.str,', кор.'+x13.str,'')+iif(x14.str,', стр.'+x14.str,'')
from t1 as x3,t1 as x4,t1 as x5,t1 as x6,t1 as x7,t1 as x8,t1 as x9,t1 as x10,t1 as x11,t1 as x12,t1 as x13,t1 as x14
where x3.f_id in(1,71,81)
and x3.id=4
and x3.g_id=x1.p_id
and x4.f_id=x3.f_id
and x4.id=7
and x4.g_id=x3.g_id
and x5.f_id=x3.f_id
and x5.id=8 and x5.g_id=x3.g_id
and x6.f_id=x3.f_id
and x6.id=5
and x6.g_id=x3.g_id
and x7.f_id=x3.f_id
and x7.id=6
and x7.g_id=x3.g_id
and x8.f_id=x3.f_id
and x8.id=9
and x8.g_id=x3.g_id
and x9.f_id=x3.f_id
and x9.id=10
and x9.g_id=x3.g_id
and x10.f_id=x3.f_id
and x10.id=11
and x10.g_id=x3.g_id
and x11.f_id=x3.f_id
and x11.id=13
and x11.g_id=x3.g_id
and x12.f_id=x3.f_id
and x12.id=14
and x12.g_id=x3.g_id
and x13.f_id=x3.f_id
and x13.id=15
and x13.g_id=x3.g_id
and x14.f_id=x3.f_id
and x14.id=16
and x14.g_id=x3.g_id),
(select code1 from fkko,t1
where id1=int(t1.str)
and g_id=x1.g_id
and f_id=x1.f_id
Запрос по теме "Помогите ускорить базу".
Взято здесь: http://sql.ru/forum/actualthread.aspx?bid=4&tid=656930
+135.6
for(int time = 0; time < 24 * 3600; time++)
{
for(int i = 0; i < arr.Length; i++)
if(time >=toSec(arr[i]) && time < toSec(dep[i]))
{
if(time >= toSec("18:00:00") && time <= toSec("23:59:59"))
x++;
else if (time >= toSec("00:00:00") && time <= toSec("05:59:59"))
x++;
else
s++;
break;
}
+143
(=<`:9876Z4321UT.-Q+*)M'&%$H"!~}|Bzy?=|{z]KwZY44Eq0/{mlk**
hKs_dG5[m_BA{?-Y;;Vb'rR5431M}/.zHGwEDCBA@98\6543W10/.R,+O<
Программа "Hello World", написанная языке Malbolge. Сорцы интерпретатора можно скатать отсюда: http://www.lscheffer.com/malbolge_interp.html
+153.9
function win2utf ($string) {
$string = ereg_replace("?","а",$string);
$string = ereg_replace("?","б",$string);
$string = ereg_replace("?","в",$string);
$string = ereg_replace("?","г",$string);
$string = ereg_replace("?","д",$string);
$string = ereg_replace("?","е",$string);
$string = ereg_replace("?","ё",$string);
$string = ereg_replace("?","ж",$string);
$string = ereg_replace("?","з",$string);
$string = ereg_replace("?","и",$string);
$string = ereg_replace("?","й",$string);
$string = ereg_replace("?","к",$string);
$string = ereg_replace("?","л",$string);
$string = ereg_replace("?","м",$string);
$string = ereg_replace("?","н",$string);
$string = ereg_replace("?","о",$string);
$string = ereg_replace("?","п",$string);
$string = ereg_replace("?","р",$string);
$string = ereg_replace("?","с",$string);
$string = ereg_replace("?","т",$string);
$string = ereg_replace("?","у",$string);
$string = ereg_replace("?","ф",$string);
$string = ereg_replace("?","х",$string);
$string = ereg_replace("?","ц",$string);
$string = ereg_replace("?","ш",$string);
$string = ereg_replace("?","щ",$string);
$string = ereg_replace("?","ъ",$string);
$string = ereg_replace("?","ь",$string);
$string = ereg_replace("?","э",$string);
$string = ereg_replace("?","ю",$string);
$string = ereg_replace("?","я",$string);
$string = ereg_replace("?","ч",$string);
$string = ereg_replace("?","ы",$string);
$string = ereg_replace("?","А",$string);
$string = ereg_replace("?","Б",$string);
$string = ereg_replace("?","В",$string);
$string = ereg_replace("?","Г",$string);
$string = ereg_replace("?","Д",$string);
$string = ereg_replace("?","Е",$string);
$string = ereg_replace("?","A",$string);
$string = ereg_replace("?","Ж",$string);
$string = ereg_replace("?","З",$string);
$string = ereg_replace("?","И",$string);
$string = ereg_replace("?","Й",$string);
$string = ereg_replace("?","К",$string);
$string = ereg_replace("?","Л",$string);
$string = ereg_replace("?","М",$string);
$string = ereg_replace("?","Н",$string);
$string = ereg_replace("?","О",$string);
$string = ereg_replace("?","П",$string);
$string = ereg_replace("?","Р",$string);
$string = ereg_replace("?","С",$string);
$string = ereg_replace("?","Т",$string);
$string = ereg_replace("?","У",$string);
$string = ereg_replace("?","Ф",$string);
$string = ereg_replace("?","Х",$string);
$string = ereg_replace("?","Ц",$string);
$string = ereg_replace("?","Ш",$string);
$string = ereg_replace("?","Щ",$string);
$string = ereg_replace("?","Ъ",$string);
$string = ereg_replace("?","Ь",$string);
$string = ereg_replace("?","Э",$string);
$string = ereg_replace("?","Ю",$string);
$string = ereg_replace("?","Я",$string);
$string = ereg_replace("?","Ч",$string);
$string = ereg_replace("?","Ы",$string);
return $string;
}
из копрроротивных сорцов.
русланчик - хуйло
+139.9
$nsql = "SELECT *, `top_img`, DAY(`date`) d FROM `bijo_cal` WHERE `date` LIKE '{$YEAR}-{$MONTH}-{$DAY}%' AND `date` <= CURDATE() ORDER BY `date` ,`id` DESC" ;
$result = Db::query($nsql);
$DATA_ARRAY = $result->fetchRow() ;
$_DATA_ARRAY = array() ;
if(!empty($DATA_ARRAY["id"])){
$nsql = "SELECT * FROM `bijo_cal_info` WHERE `cal_id` = {$DATA_ARRAY["id"]} ORDER BY `id` DESC LIMIT 1;" ;
$result = Db::query($nsql);
$_DATA_ARRAY = $result->fetchRow() ;
}
Разгребаю код в чужом проекте.
Задача: выгребсти с таблички айдишку по дате, и если она есть, то выгребсти с другой таблички данные по оной. Явно предвидиться использование джойна, которого правда нету. Но зато выборка айдишки по дате убила. Вся сила в 1 и 3 рядке! Жесть
+143.1
if (((HttpContext.Current.Profile as ProfileCommon).Role == "3") || ((HttpContext.Current.Profile as ProfileCommon).Role == "4"))
{
if (e.Item.Value == " Add New Trainee ")
e.Item.Enabled = false;
if (e.Item.Value == " Add New Group ")
e.Item.Enabled = false;
if (e.Item.Value == " Audit Log ")
e.Item.Enabled = false;
if (e.Item.Value == " Manage Holidays ")
e.Item.Enabled = false;
}
if ( (( HttpContext.Current.Profile as ProfileCommon).Role != "0") && (( HttpContext.Current.Profile as ProfileCommon).Role != "") )
{
if (e.Item.Value == " Manage Users ")
e.Item.Enabled = false;
if (e.Item.Value == " Manage Courses ")
e.Item.Enabled = false;
if (e.Item.Value == " Audit Log ")
e.Item.Enabled = false;
}
if (((HttpContext.Current.Profile as ProfileCommon).Role == "") ||
((HttpContext.Current.Profile as ProfileCommon).Role == "0") ||
((HttpContext.Current.Profile as ProfileCommon).Role == "1") ||
((HttpContext.Current.Profile as ProfileCommon).Role == "2"))
{
if (e.Item.Value == " Holidays ")
e.Item.Enabled = false;
}
Новое место работы. Новые порции говнокода.
Это классика - no comments...
+142
case MOTO_ACCY_IOCTL_SET_CHARGER_LOAD_LINE:
/* Copy the load line setting from user space */
retval = copy_from_user ((void *)&data, (void *)arg, sizeof(data));
/* If the copy failed, return an error */
if (retval != 0)
{
retval = -EFAULT;
}
/* Else, configure the hardware for the requested load line setting */
else
{
/* Acquire the lock to prevent changes to connected_accessories */
spin_lock (&connected_lock);
/* Verify that the 3G fast charger is connected */
if (ACCY_BITMASK_ISSET(connected_accessories, MOTO_ACCY_TYPE_CHARGER_FAST_3G))
{
/* This charger is the only charger that supports an adjustable load line */
/* TBD */
}
/* Else, the appropriate charger type is not connected */
else
{
/* Return error: No such device */
retval = -ENODEV;
}
/* Release the lock for connected_accessories */
spin_unlock (&connected_lock);
}
break;
+135.2
<SPAN style="FONT-SIZE: 8pt; COLOR: #4c4c4c; FONT-FAMILY: Verdana"><FONT face=Arial><FONT size=3><FONT face="Times New Roman" size=2>
ЦМСка и пользователь сделали