- 1
private static string TestExistFiles(ref int maxd, ref Hashtable executedgroups)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+132
private static string TestExistFiles(ref int maxd, ref Hashtable executedgroups)
+147
trim($_GET['password'])
nc
+162
try {
die(@date("d.m.Y H:i:s") . "\t" . $this->x($id, true) . "\r\n");
} catch (Exception $e) {
die(@date("d.m.Y H:i:s") . "\tERROR: " . $e->getMessage() . "\r\n");
}
остаться в живых
+101
if(searchParams == null)
{
throw new NullReferenceException("параметры поиска = null" + searchParams.ToString());
}
Эдакий InnerException, чтоб верняково
−102
@interface CORERatingImages : NSObject
{
UIImage *imageForOne;
UIImage *imageForTwo;
UIImage *imageForThree;
UIImage *imageForFour;
UIImage *imageForFive;
}
+(CORERatingImages *) ratingImages;
-(UIImage *) getRatingImage:(int) ratings;
@property (nonatomic, retain) UIImage *imageForOne;
@property (nonatomic, retain) UIImage *imageForTwo;
@property (nonatomic, retain) UIImage *imageForThree;
@property (nonatomic, retain) UIImage *imageForFour;
@property (nonatomic, retain) UIImage *imageForFive;
-(void) releaseResources;
@end
static CORERatingImages *ratingImages = nil;
@implementation CORERatingImages
@synthesize imageForOne;
@synthesize imageForTwo;
@synthesize imageForThree;
@synthesize imageForFour;
@synthesize imageForFive;
+(CORERatingImages *) ratingImages
{
@synchronized(self)
{
if (ratingImages == nil)
{
ratingImages = [[self alloc] init];
}
}
return ratingImages;
}
-(id) init
{
if (self = [super init])
{
self.imageForOne = [UIImage imageNamed:@"1.png"];
self.imageForTwo = [UIImage imageNamed:@"2.png"];
self.imageForThree = [UIImage imageNamed:@"3.png"];
self.imageForFour = [UIImage imageNamed:@"4.png"];
self.imageForFive = [UIImage imageNamed:@"5.png"];
}
return self;
}
-(UIImage *) getRatingImage:(int) ratings
{
if (ratings == 1)
{
return imageForOne;
}
else if (ratings == 2)
{
return imageForTwo;
}
else if (ratings == 3)
{
return imageForThree;
}
else if (ratings == 4)
{
return imageForFour;
}
else if (ratings == 5)
{
return imageForFive;
}
else
{
return [UIImage imageNamed:@"0.png"];
}
}
-(void) dealloc
{
NSLog(@"release Images");
[imageForOne release];
[imageForTwo release];
[imageForThree release];
[imageForFour release];
[imageForFive release];
[super dealloc];
}
-(void) releaseResources
{
[ratingImages release];
ratingImages = nil;
}
@end
Массив или stringWithFormat: @"%d.png"?
Не, не слышал.
+156
$.post("include/show_watching.php",
function(data) {
$('#content').empty().append(data);
}
);
Вот такой вот POST-запрос.
+133
using (var twainManager = new DeviceManager())
{
twainManager.Open();
using (var evn = new ManualResetEvent(false))
{
var device = twainManager.Devices[targetDevice.Index];
device.UserInterfaceClosed += (sender, args) => { evn.Set(); };
device.Setup();
evn.WaitOne();
}
twainManager.Close();
}
Модальное открытие говноформы.
+161
function printf(format, value) {
return format.replace(/%s/, value.toString());
}
return {
updateProgressBar: function (percentage) {
console.log("update \"progressBar\" status");
progressBar.innerHTML = printf("<p>%s %</p>", percentage);
}
};
+149
$ev = '$atHtml[] = template::translateTemplate('.$atArr[0].'::getHTML($atArr[1]));';
eval($ev);
Самый простой способ заставить работать статический метод класса из переменной в PHP ниже 5.3.
−167
declare @billing_types table(k int null, t varchar(14)
collate SQL_Latin1_General_CP1255_CI_AS)
insert @billing_types
values (1, 'אשרי')
,(2, 'צ׳ק')
,(3, 'הוראת קבע')
declare @standing_order_status table(i int null, s varchar(14)
collate SQL_Latin1_General_CP1255_CI_AS)
insert @standing_order_status
values (4, 'מבותל')
,(3, 'לא מאושר')
,(2, 'ממתין')
,(1, 'מאושר')
declare @fax varchar(20)
select billing_company_id
,internal_company_name
,isnull(t, 'לא פעיל') collate SQL_Latin1_General_CP1255_CI_AS as payment_type_string
,case when company_email is null then ''
when replace((ltrim(rtrim(company_email))), '0', '') = '' then ''
-- some emails were imported in the way, they aren't valid
when charindex('@', company_email) = 0 then ''
else (ltrim(rtrim(company_email))) end as email
,case when replace(ltrim(rtrim(company_fax)), '0', '') = ''
then ''
when -- some times there are words like "none", "n/a" etc. in there
replace(replace(replace(replace(replace(replace(replace(
replace(replace(replace(replace(ltrim(rtrim(company_fax)), '-', ''),
'0', ''), '1', ''), '2', ''), '3', ''), '4', ''), '5', ''), '6', ''),
'7', ''), '8', ''), '9', '') != ''
then ''
else replace(ltrim(rtrim(company_fax)), '-', '')
end as c_fax
,ltrim(rtrim(company_address)) as c_address
,ltrim(rtrim(cast(company_comments as varchar(1000)))) as c_comments
,invoice_send_with_details
,invoice_send_fax
,invoice_print
,ltrim(rtrim(cc_name)) as c_name
,ltrim(rtrim(cc_number)) as c_number
,ltrim(rtrim(cc_cvv)) as c_cvv
,ltrim(rtrim(cc_id)) as c_id
,ltrim(rtrim(cc_expire)) as c_expire
,ltrim(rtrim(bank_number)) as number
,ltrim(rtrim(bank_branch)) as branch
,ltrim(rtrim(bank_account)) as account
,bank_hoshen
,isnull(s, 'אין') collate SQL_Latin1_General_CP1255_CI_AS as order_status
from billing_companies
left join @billing_types bt on bt.k = payment_type
left join @standing_order_status os on os.i = bank_standing_order_status
Война. Экспорт в Эксель, для того, чтобы потом ее обратно, но уже другим людям в базу передать.
Из интересных подробностей. Поле "факс" в базе имеет тип varchar(50), например. Никакой серверной валидации отродясь не было. Иногда люди просто путали факс и электорпочту, когда заполняли данные.