- 1
- 2
- 3
- 4
- 5
- 6
$update_result = mysql_query($update) or die("failed");
if($update_result != false)
header("location: index.php");
else
die("Something Failed.");
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+65
$update_result = mysql_query($update) or die("failed");
if($update_result != false)
header("location: index.php");
else
die("Something Failed.");
−37
int LoggingProvider::AddJournalPackingLogRecord(int eventId, const astring& userId,
const std::vector<std::string>& journals, int errorId, int devCode,
int sysCode, const astring& errorArgs)
{
std::string strUserId(userId.c_str()), strErrorArgs(errorArgs);
return AddJournalPackingLogRecord(eventId, userId, journals, errorId, devCode, sysCode, strErrorArgs);
}
Рекурсия!
−86
NSString *error = [NSString stringWithFormat:@"Please enter %@%@%@%@%@",
(self.addressTextField.text.length ? @"" : @"link address"),
((self.addressTextField.text.length || self.descriptionTextField.text.length) ? @"" : (self.recipientTextField.text.length ? @" and " : @", ")),
(self.descriptionTextField.text.length ? @"" : @"link description"),
((self.recipientTextField.text.length || (self.addressTextField.text.length && self.descriptionTextField.text.length)) ? @"" : @" and "),
(self.recipientTextField.text.length) ? @"" : @"recipient e-mail"];
Ultimate infinite brutality facepalm.
В продолжение http://govnokod.ru/10310, только проверяемых поля теперь три и их названия выводятся в виде "a, b and c" | "a and b" | "a and c" | "b and c" | "a" | "b" | "c". Такие дела.
+152
$(document).ready(function(){
var m;
function fourSize()
{
var size=$(window).width();
if (size<'1210') { css='1000'; m=160;}
if ((size>='1210')&&(size<'1296')) {css='1240';m=160;}
if ((size>='1296')&&(size<'1370')) {css='1320';m=180;}
if(size>='1370') {css='1400';m=180;}
$('#four-size').attr({ href: 'css/styles_'+css+'.css'});marginFoot();
}
function marginFoot()
{
w=$(window).width();
h=$(window).height();
if (h<500) $('.center').css('height',($(window).height()-m));
if ((h>500 && w<1210)||(h>600 && w>1210)){
$('.center').css('height',($(window).height()-m)); //alert($(document).height()-180);
margin=$(window).height()-$('.center').height()-m;
$('.foot').css('margin-top',margin);}
}
fourSize();marginFoot();
$(window).resize(function(){fourSize();})
})
У парня 1 год опыта верстки и js.
+138
<script>window.google={kEI:"iBS9T5-8NY6CtQbXmN3PDQ",getEI:function(a){var b;while(a&&!(a.getAttribute&&(b=a.getAttribute("eid"))))a=a.parentNode;return b||google.kEI},https:function(){return window.location.protocol=="https:"},kEXPI:"24878,27400,30316,31215,35702,35703,38100,38135,38221,38285,38738,38786,38816,38941,39000",kCSI:{e:"24878,27400,30316,31215,35702,35703,38100,38135,38221,38285,38738,38786,38816,38941,39000",ei:"iBS9T5-8NY6CtQbXmN3PDQ"},authuser:0,
ml:function(){},pageState:"#",kHL:"uk",time:function(){return(new Date).getTime()},log:function(a,b,c,e){var d=new Image,h=google,i=h.lc,f=h.li,j="";d.onerror=(d.onload=(d.onabort=function(){delete i[f]}));i[f]=d;if(!c&&b.search("&ei=")==-1)j="&ei="+google.getEI(e);var g=c||"/gen_204?atyp=i&ct="+a+"&cad="+b+j+"&zx="+google.time();
var k=/^http:/i;if(k.test(g)&&google.https()){google.ml(new Error("GLMM"),false,{src:g});delete i[f];return}d.src=g;h.li=f+1},lc:[],li:0,j:{en:1,l:function(){google.fl=true},e:function(){google.fl=true},
b:location.hash&&location.hash!="#",bv:21,cf:"osb",pm:"p",pl:[],mc:0,sc:0.5,u:"f05f80a8"},Toolbelt:{},y:{},x:function(a,b){google.y[a.id]=[a,b];return false}};(function(){var a=
google.j;window.onpopstate=function(){a.psc=1};for(var b=0,c;c=["ad","bc","inpr","is","p","pa","ac","pc","pah","ph","sa","sifp","slp","spf","spn","xx","zc","zz"][b++];)(function(e){a[e]=function(){a.pl.push([e,arguments])}})(c)})();if(!window.chrome)window.chrome={};window.chrome.sv=2.00;window.chrome.userWantsQuery=function(a){google.x({id:"psyapi"},function(){google.nav.search({q:encodeURIComponent(a),
sourceid:"chrome-psyapi1"})})};
window.google.sn="webhp";window.google.timers={};window.google.startTick=function(a,b){window.google.timers[a]={t:{start:(new Date).getTime()},bfr:!(!b)}};window.google.tick=function(a,b,c){if(!window.google.timers[a])google.startTick(a);window.google.timers[a].t[b]=c||(new Date).getTime()};google.startTick("load",true);try{}catch(u){}
</script>
+119
import Control.Monad.Reader
head >>= (:)
+265
00410803 PUSH OFFSET 004FC0C8 ASCII "AnVir Task Manager Pro"
0041189D PUSH OFFSET 004FC0A4 ASCII "data Task Manager Pro"
0041A074 PUSH OFFSET 00500120 ASCII "%sAnVir Task Manager Pro"
0042F9CE PUSH OFFSET 005012A4 ASCII "AnVir Task Manager Pro %s %s!"
00410803 PUSH OFFSET 006AC6E8 ASCII "AnVir Task Manager Pro"
004479E9 PUSH EDI ASCII "AnVir Task Manager Pro"
0044FE01 PUSH OFFSET 00502C34 ASCII "AnVir Task Manager Pro "
00463DC9 PUSH OFFSET 00503708 ASCII "AnVir Task Manager Pro folder selection"
004606BE MOV DWORD PTR SS:[EBP-130],OFFSET 005035>ASCII "AnVir Task Manager Pro file selection"
00490CE9 PUSH OFFSET 00507E5C ASCII "AnVir Task Manager Pro. "
00495441 PUSH OFFSET 00508450 ASCII "AnVir Task Manager Pro, 6.7.1"
00497858 PUSH OFFSET 0050866C ASCII "Logfile of AnVir Task Manager Pro v6.7.1 "
004A3DE6 PUSH OFFSET 00509B54 ASCII "AnVir Task Manager"
Вывод ольки по поиску всех строк. (лишнее порезал)
Надо напомнить сотню раз пользователю имя программы, а то вдруг он забудет что он запустил!
Немного удивляет такой маразм.
+61
foreach($combinations as $combination){
$buffer = array();
if(count($combination)){
if(is_numeric($combination[0])){
$a_cnt = count($words[$combination[0]]);
for($a=0;$a<$a_cnt;$a++){
if(is_numeric($combination[1])){
$b_cnt = count($words[$combination[1]]);
for($b=0;$b<$b_cnt;$b++){
if(is_numeric($combination[2])){
$c_cnt = count($words[$combination[2]]);
for($c=0;$c<$c_cnt;$c++){
if(is_numeric($combination[3])){
$d_cnt = count($words[$combination[3]]);
for($d=0;$d<$d_cnt;$d++){
if(is_numeric($combination[4])){
$e_cnt = count($words[$combination[4]]);
for($e=0;$e<$e_cnt;$e++){
if(is_numeric($combination[5])){
$f_cnt = count($words[$combination[5]]);
for($f=0;$f<$f_cnt;$f++){
if(is_numeric($combination[6])){
$g_cnt = count($words[$combination[6]]);
for($g=0;$g<$g_cnt;$g++){
if(is_numeric($combination[7])){
$h_cnt = count($words[$combination[7]]);
for($h=0;$h<$h_cnt;$h++){
if(is_numeric($combination[8])){
$i_cnt = count($words[$combination[8]]);
for($i=0;$i<$i_cnt;$i++){
if(is_numeric($combination[9])){
$j_cnt = count($words[$combination[9]]);
for($j=0;$j<$j_cnt;$j++){
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e]
.' '.$words[$combination[5]][$f]
.' '.$words[$combination[6]][$g]
.' '.$words[$combination[7]][$h]
.' '.$words[$combination[8]][$i]
.' '.$words[$combination[9]][$j];
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e]
.' '.$words[$combination[5]][$f]
.' '.$words[$combination[6]][$g]
.' '.$words[$combination[7]][$h]
.' '.$words[$combination[8]][$i];
}
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e]
.' '.$words[$combination[5]][$f]
.' '.$words[$combination[6]][$g]
.' '.$words[$combination[7]][$h];
}
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e]
.' '.$words[$combination[5]][$f]
.' '.$words[$combination[6]][$g];
}
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e]
.' '.$words[$combination[5]][$f];
}
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d]
.' '.$words[$combination[4]][$e];
}
}}
else{
$buffer[] = $words[$combination[0]][$a]
.' '.$words[$combination[1]][$b]
.' '.$words[$combination[2]][$c]
.' '.$words[$combination[3]][$d];
}
Вот такой вот кусок кода, к стати весь не поместился, я нашел в самописном движке, на котором моему знакомому сделали корпоративный сайт на 30 страниц. Бюджет был больше 2к зелени.
+69
if (!class_exists('Memcache')) {
class Memcache {
function connect($l, $p) {
echo "НЕТ МЕМКЕША";
return true;
}
function get($n) {
return false;
}
function set($a, $b, $v, $g) {
return true;
}
}
}
улыбнуло )
−19
TElement* get(void)
{
TElement* result = this->allocateBuffer();
if (result!=NULL)
{
try
{
::new(result) TElement; //Вызов конструктора.
}catch(...)//Получили исключение в конструкторе конструироваемого объекта.
{
this->deallocateBuffer(result);
throw;
};
};
return result;
};
template<class TArg1>
TElement* get(TArg1 arg1)
{
TElement* result = this->allocateBuffer();
if (result!=NULL)
{
try
{
::new(result) TElement(arg1); //Вызов конструктора.
}catch(...)//Получили исключение в конструкторе конструироваемого объекта.
{
this->deallocateBuffer(result);
throw;
};
};
return result;
};
//...
template<class TArg1, class TArg2, class TArg3, class TArg4, class TArg5, class TArg6>
TElement* get(TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6)
{
TElement* result = this->AllocateBuffer();
if (result!=NULL)
{
try
{
::new(result) TElement(arg1, arg2, arg3, arg4, arg5, arg6); //Вызов конструктора.
}catch(...)//Получили исключение в конструкторе конструироваемого объекта.
{
this->DeallocateBuffer(result);
throw;
};
};
return result;
};
Хотя этот баян мы уже видели на Action Script.