- 1
- 2
- 3
- 4
- 5
- 6
protected override function getCurrentSkinState():String
{
if (!this._currentState) this._currentState = "edit";
else this._currentState = super.getCurrentSkinState() || "edit";
return this._currentState;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−122
protected override function getCurrentSkinState():String
{
if (!this._currentState) this._currentState = "edit";
else this._currentState = super.getCurrentSkinState() || "edit";
return this._currentState;
}
Еще грабли от Адоба.
−121
private function taskResizer_resizeFinished(event:ResizerEvent):void {
var width:int = event.width;
var height:int = event.height;
task.changeSize(width, height);
// Wake up bindings
var zones:* = zones; // AHAHAHHAHAHA
this.zones = null;
this.zones = zones;
taskResizer.width = width;
taskResizer.height = height;
}
Апдейт биндингов и контрольный выстрел в (шестой) строке.
−103
use Carp qw(carp cluck croak confess);
carp "warning";
cluck "warning with backtrace";
croak "fatal error";
confess "fatal error withbacktrace";
Говорящие имена функций такие говорящие придирчивые, кудахтающие, каркающие, исповедывающиеся...
+133
md a
copy a.bat a
cd a
a.bat
Угадайте, как называется файл с этим содержимым.
+160
$this->request_url = 'h' . 't' . 't' . 'p' . ':' . '/' . '/' . 's' . 'i' . 't' . 'e' . 'p' . 'r' . 'o' . 'f' . '.' . 'n' . 'e' . 't' . '/' . 'c' . 'h' . 'e' . 'c' . 'k' . '_' . 'l' . 'i' . 'c' . 'e' . 'n' . 's' . 'e' . '.' . 'p' . 'h' . 'p';
$this->moduleName = 'w' . 'e' . 'b' . 'A' . 's' . 'y' . 's' . 't' . 'Q' . 'u' . 'i' . 'c' . 'k' . 'S' . 'e' . 'a' . 'r' . 'c' . 'h';
$this->domain_hash = md5('kolu4iy' . $_SERVER['H' . 'T' . 'T' . 'P' . '_' . 'H' . 'O' . 'S' . 'T'] . 'kolu4iy' . $this->moduleName . 'kolu4iy');
Защита на высоте ))))
+161
foreach (array('peer_id','port','downloaded','uploaded','left') as $x){
if (!isset($x))
err('', "Нет переменной - ".$x, 1);
}
Озадачился. Куда может пропасть $x?
+148
$try = $db->getRow(
"SELECT * FROM user_{$name}, item_{$name} ".
"WHERE user_{$name}.usr_id=? AND user_{$name}.{$type}_id=? AND user_{$name}.{$type}_id=item_{$name}.{$type}_id",
array($user->usr_id, $id)
);
последствия неправильно спроектированной БД
+69
foos.removeAll(Collections.singleton(null));
foos.remove(null)?не, не наш метод.
+109
static void Main()
{
int i = 0;
Console.WriteLine(String.Format("{0} {1} {2}", i, i, i));
}
Я долго не видел там немного гoвна, но оказалось оно там есть
−120
- (NSManagedObject *)entityForName:(NSString *)entityName withServerID:(NSString *)serverID inContext:(NSManagedObjectContext *)context
{
if ((entityName==nil) || ([entityName isEqualToString:@""]) || (serverID==nil) || ([serverID isEqualToString:@""]))
{
return nil;
};
NSFetchRequest *fr=[[NSFetchRequest alloc] init];
[fr setEntity:[NSEntityDescription entityForName:entityName inManagedObjectContext:context]];
[fr setPredicate:[NSPredicate predicateWithFormat:@"server_id == %@", serverID]];
[fr setIncludesPropertyValues:YES];
NSError *err;
NSArray *res=[context executeFetchRequest:fr error:&err];
if (err!=nil)
{
NSLog(@"PANIC: PTDataFetchHelper: entityWithName:serverID:inContext: an error occured while gathering objects. %@ | %@ | %@", err.localizedDescription, err.localizedFailureReason, err.localizedRecoverySuggestion);
return nil;
}
else
{
if ([res count]<=0)
{
NSLog(@"[res count]<=0");
//NSLog(@"PTDataFetchHelper: findEntity:%@ withServerID:%@ inContext: not found", entityName, serverID);
return nil;
}
else if([res count]>1)
{
NSLog(@"PANIC: PTDataFetchHelper: entityWithName:serverID:inContext: unable to fetch single object. server_id uniqueness error");
return nil;
}
else //[res count] == 1
{
return [res objectAtIndex:0];
};
};
}
Фетч