- 1
- 2
- 3
- 4
static public function vkontakte_enabled()
{
return ( ipsRegistry::$settings['vk_enabled'] AND ipsRegistry::$settings['vk_api_id'] AND ipsRegistry::$settings['vk_secret'] ) ? TRUE : FALSE;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+154
static public function vkontakte_enabled()
{
return ( ipsRegistry::$settings['vk_enabled'] AND ipsRegistry::$settings['vk_api_id'] AND ipsRegistry::$settings['vk_secret'] ) ? TRUE : FALSE;
}
* IP.Board v3.1.4
И почему я пишу форумы сам?..
−95
try:
ix, iy, image = im.size[0], im.size[1], im.tostring("raw", "RGBA", 0, -1)
except SystemError:
ix, iy, image = im.size[0], im.size[1], im.tostring("raw", "RGBX", 0, -1)
"Ну пожалуйста!"
Нашел здесь:
http://pyopengl.sourceforge.net/context/tutorials/nehe6.xhtml
+963
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public void label1_Click(object sender, EventArgs e)
{
}
public void button1_Click(object sender, EventArgs e)
{
label1.Text = "неправильно, вы проиграли";
button1.Dispose();
button2.Dispose();
button3.Dispose();
button4.Dispose();
this.BackColor = System.Drawing.Color.Red;
}
public void button2_Click(object sender, EventArgs e)
{
label1.Text = "неправильно, вы проиграли";
button1.Dispose();
button2.Dispose();
button3.Dispose();
button4.Dispose();
this.BackColor = System.Drawing.Color.Red;
}
public void button4_Click(object sender, EventArgs e)
{
label1.Text = "неправильно, вы проиграли";
button1.Dispose();
button2.Dispose();
button3.Dispose();
button4.Dispose();
this.BackColor = System.Drawing.Color.Red;
}
public void button3_Click(object sender, EventArgs e)
{
label1.Text = "правильно";
button1.Dispose();
button2.Dispose();
button3.Dispose();
button4.Dispose();
btn.Dispose();
this.BackColor = System.Drawing.Color.Green;
btn = new Button();
btn.Text = "Дальше";
btn.Top = 200;
btn.Left = 360;
btn.Height = 165;
btn.Width = 269;
btn.Click += new EventHandler(Press_ok);
this.Controls.Add(btn);
}
public void Press_ok (object sender, EventArgs e)
{
this.BackColor = System.Drawing.Color.White;
btn.Dispose();
label1.Text = "сколько должно быть зубов у человека?";
button1 = new Button();
button1.Text = "16";
button1.Height = 23;
button1.Width = 142;
button1.Left = 272;
button1.Top = 414;
button1.Click += new EventHandler(Press_1);
this.Controls.Add(button1);
button2 = new Button();
button2.Text = "32";
button2.Height = 23;
button2.Width = 142;
button2.Left = 711;
button2.Top = 414;
button2.Click += new EventHandler(Press_2);
this.Controls.Add(button2);
button3 = new Button();
button3.Text = "28";
button3.Height = 23;
button3.Width = 142;
button3.Left = 272;
button3.Top = 491;
button3.Click += new EventHandler(Press_3);
this.Controls.Add(button3);
button4 = new Button();
button4.Text = "101";
//еще over100500 ГК
−126
if (!defined $login || (defined $login && length($login)<3 && length($login>16))) {
−120
my $uid = 0;
my $parse_uid = $parse_sid->{uid} || 0;
my $memd_uid = $RR::Init::memd->get('sid'.$sid) || 0;
# Авторизуем при помощи memd
if ($parse_uid==$memd_uid){
$uid = $memd_uid;
}
# Запоминаем в Куку
$r->pnotes('USER_SID' => $sid);
$param{sid} = $sid;
# Захватываем sid
unless (defined $uid){
$RR::Init::memd->set('sid'.$sid, 0);
}
# Всяке артефакты лезут
$uid||=undef;
Лезут всякие артефакты видите ли...
+961
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
switch (keyData)
{
case Keys.Up:
if ((pictureBox1.Location.X + pictureBox1.Width >= pictureBox4.Location.X) & (pictureBox1.Location.X <= pictureBox4.Location.X + pictureBox4.Width) & (pictureBox1.Location.Y <= pictureBox4.Location.Y + pictureBox4.Height) & (pictureBox1.Location.Y >= pictureBox4.Location.Y + pictureBox4.Height / 2)) ;
else pictureBox1.Top -= 5;
if ((pictureBox2.Visible) & (pictureBox3.Visible))
if ((pictureBox1.Location.Y >= pictureBox2.Location.Y) & (pictureBox1.Location.Y + pictureBox1.Height <= pictureBox2.Location.Y + pictureBox2.Height) & (pictureBox1.Location.X >= pictureBox2.Location.X) & (pictureBox1.Location.X + pictureBox1.Width <= pictureBox2.Location.X + pictureBox2.Width))
pictureBox1.Location = new Point(pictureBox3.Location.X + (pictureBox1.Location.X - pictureBox2.Location.X), pictureBox3.Location.Y - 5);
if ((pictureBox2.Visible) & (pictureBox3.Visible))
if ((pictureBox1.Location.Y >= pictureBox3.Location.Y) & (pictureBox1.Location.Y + pictureBox1.Height <= pictureBox3.Location.Y + pictureBox3.Height) & (pictureBox1.Location.X >= pictureBox3.Location.X) & (pictureBox1.Location.X + pictureBox1.Width <= pictureBox3.Location.X + pictureBox3.Width))
pictureBox1.Location = new Point(pictureBox2.Location.X + (pictureBox1.Location.X - pictureBox3.Location.X), pictureBox2.Location.Y - 5);
break;
case Keys.Down:
if ((pictureBox1.Location.X + pictureBox1.Width >= pictureBox4.Location.X) & (pictureBox1.Location.X <= pictureBox4.Location.X + pictureBox4.Width) & (pictureBox1.Location.Y + pictureBox1.Height <= pictureBox4.Location.Y + pictureBox4.Height / 2) & (pictureBox1.Location.Y + pictureBox1.Height >= pictureBox4.Location.Y)) ;
else pictureBox1.Top += 5;
if ((pictureBox2.Visible) & (pictureBox3.Visible))
if ((pictureBox1.Location.Y >= pictureBox2.Location.Y) & (pictureBox1.Location.Y + pictureBox1.Height <= pictureBox2.Location.Y + pictureBox2.Height) & (pictureBox1.Location.X >= pictureBox2.Location.X) & (pictureBox1.Location.X + pictureBox1.Width <= pictureBox2.Location.X + pictureBox2.Width))
pictureBox1.Location = new Point(pictureBox3.Location.X + (pictureBox1.Location.X - pictureBox2.Location.X), (pictureBox3.Location.Y + pictureBox3.Height) - 5);
if ((pictureBox2.Visible) & (pictureBox3.Visible))
if ((pictureBox1.Location.Y >= pictureBox3.Location.Y) & (pictureBox1.Location.Y + pictureBox1.Height <= pictureBox3.Location.Y + pictureBox3.Height) & (pictureBox1.Location.X >= pictureBox3.Location.X) & (pictureBox1.Location.X + pictureBox1.Width <= pictureBox3.Location.X + pictureBox3.Width))
pictureBox1.Location = new Point(pictureBox2.Location.X + (pictureBox1.Location.X - pictureBox3.Location.X), (pictureBox2.Location.Y + pictureBox2.Height) - 5);
break;
Это не поддаётся описанию. Полная версия: http://pastebin.com/97sbSVLa
−104
Dim KolvoZnakov As String = IIf(SqlUser = "Beschastnova" Or SqlUser = "Rodionova", "00000", "00")
Для двух привередливых бухов выводим аж 4 знака после запятой.
+122
else
{
if ((textBox1.Text == textBox2.Text) | (textBox1.Text == textBox3.Text) | (textBox1.Text == textBox4.Text) | (textBox1.Text == textBox7.Text)) textBox1.ForeColor = Color.Red; else textBox1.ForeColor = Color.Black;
if ((textBox2.Text == textBox1.Text) | (textBox2.Text == textBox3.Text) | (textBox2.Text == textBox5.Text) | (textBox2.Text == textBox8.Text)) textBox2.ForeColor = Color.Red; else textBox2.ForeColor = Color.Black;
if ((textBox3.Text == textBox1.Text) | (textBox3.Text == textBox2.Text) | (textBox3.Text == textBox6.Text) | (textBox3.Text == textBox9.Text)) textBox3.ForeColor = Color.Red; else textBox3.ForeColor = Color.Black;
if ((textBox4.Text == textBox5.Text) | (textBox4.Text == textBox6.Text) | (textBox4.Text == textBox1.Text) | (textBox4.Text == textBox7.Text)) textBox4.ForeColor = Color.Red; else textBox4.ForeColor = Color.Black;
if ((textBox5.Text == textBox4.Text) | (textBox5.Text == textBox6.Text) | (textBox5.Text == textBox2.Text) | (textBox5.Text == textBox8.Text)) textBox5.ForeColor = Color.Red; else textBox5.ForeColor = Color.Black;
if ((textBox6.Text == textBox4.Text) | (textBox6.Text == textBox5.Text) | (textBox6.Text == textBox3.Text) | (textBox6.Text == textBox9.Text)) textBox6.ForeColor = Color.Red; else textBox6.ForeColor = Color.Black;
if ((textBox7.Text == textBox8.Text) | (textBox7.Text == textBox9.Text) | (textBox7.Text == textBox1.Text) | (textBox7.Text == textBox4.Text)) textBox7.ForeColor = Color.Red; else textBox7.ForeColor = Color.Black;
if ((textBox8.Text == textBox7.Text) | (textBox8.Text == textBox9.Text) | (textBox8.Text == textBox2.Text) | (textBox8.Text == textBox5.Text)) textBox8.ForeColor = Color.Red; else textBox8.ForeColor = Color.Black;
if ((textBox9.Text == textBox7.Text) | (textBox9.Text == textBox8.Text) | (textBox9.Text == textBox3.Text) | (textBox9.Text == textBox6.Text)) textBox9.ForeColor = Color.Red; else textBox9.ForeColor = Color.Black;
if ((textBox1.Text == textBox2.Text) | (textBox1.Text == textBox3.Text) | (textBox1.Text == textBox4.Text) | (textBox1.Text == textBox7.Text) |
(textBox2.Text == textBox1.Text) | (textBox2.Text == textBox3.Text) | (textBox2.Text == textBox5.Text) | (textBox2.Text == textBox8.Text) |
(textBox3.Text == textBox1.Text) | (textBox3.Text == textBox2.Text) | (textBox3.Text == textBox6.Text) | (textBox3.Text == textBox9.Text) |
(textBox4.Text == textBox5.Text) | (textBox4.Text == textBox6.Text) | (textBox4.Text == textBox1.Text) | (textBox4.Text == textBox7.Text) |
(textBox5.Text == textBox4.Text) | (textBox5.Text == textBox6.Text) | (textBox5.Text == textBox2.Text) | (textBox5.Text == textBox8.Text) |
(textBox6.Text == textBox4.Text) | (textBox6.Text == textBox5.Text) | (textBox6.Text == textBox3.Text) | (textBox6.Text == textBox9.Text) |
(textBox7.Text == textBox8.Text) | (textBox7.Text == textBox9.Text) | (textBox7.Text == textBox1.Text) | (textBox7.Text == textBox4.Text) |
(textBox8.Text == textBox7.Text) | (textBox8.Text == textBox9.Text) | (textBox8.Text == textBox2.Text) | (textBox8.Text == textBox5.Text) |
(textBox9.Text == textBox7.Text) | (textBox9.Text == textBox8.Text) | (textBox9.Text == textBox3.Text) | (textBox9.Text == textBox6.Text)) ;
else
{
label1.Visible = true;
label2.Visible = true;
}
Удивлению нет границ! Полная версия: http://pastebin.com/S2getyHn
+158
function return_report($new,$do) {
$dosec = $do - $new;
$days = floor($dosec / 86400);
$hour = floor(($dosec - ($days*86400))/3600);
$min = floor(($dosec - ($days*86400) - ($hour*3600))/60);
$sec = floor(($dosec - ($days*86400) - ($hour*3600) - ($min*60)));
switch(substr($days, -2)) { // какое выводить слово
case 1: case 21: $ost = 'остался '; break;
default: $ost = 'осталось '; break;
}
switch(substr($days, -2)) { // вывод дней
case 1: case 21: case 31: case 41: $d=' день '; break;
case 2: case 3: case 4: case 22: case 23: case 24: case 32: case 33: case 34: case 42: case 43: case 44: $d=' дня '; break;
default: $d=' дней ';
}
switch(substr($hour, -2)) { // вывод часов
case 1: case 21: $h=' час '; break;
case 2: case 3: case 4: case 22: case 23: case 24: $h=' часа '; break;
default: $h=' часов ';
}
switch(substr($min, -2)) { // вывод минут
case 1: case 21: case 31: case 41: case 51: $m=' минута '; break;
case 2: case 3: case 4: case 22: case 23: case 24: case 32: case 33: case 34: case 42: case 43: case 44: case 52: case 53: case 54: $m=' минуты '; break;
default:$m=' минут ';
}
switch(substr($sec, -2)) { // вывод секунд
case 1: case 21: case 31: case 41: case 51: $s=' секунда'; break;
case 2: case 3: case 4: case 22: case 23: case 24: case 32: case 33: case 34: case 42: case 43: case 44: case 52: case 53: case 54: $s=' секунды'; break;
default:$s=' секунд';
}
if ($dosec > 0) {
$period = $ost;
if ($days > 0) $period .= '<b>'.$days.'</b>'
.$d;
if ($hour > 0) $period .= '<b>'.$hour.'</b>'
.$h;
if ($min > 0) $period .= '<b>'.$min.'</b>'.
$m;
if ($sec > 0) $period .= '<b>'.$sec.'</b>'.
$s;
return $period;
}
return false;
}
Человек пытался сделать вывод времени, прошедшего с определенного момента *FACEPALM*
−122
Функция ПреобразованиеДаты(Дата) Экспорт
Если НЕ ПустаяСтрока(Дата) Тогда
ГодКраткий = Прав(Дата, 2);
Если ГодКраткий = "83" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1983";
ИначеЕсли ГодКраткий = "84" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1984";
ИначеЕсли ГодКраткий = "85" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1985";
ИначеЕсли ГодКраткий = "86" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1986";
ИначеЕсли ГодКраткий = "87" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1987";
ИначеЕсли ГодКраткий = "88" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1988";
ИначеЕсли ГодКраткий = "89" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1989";
ИначеЕсли ГодКраткий = "90" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1990";
ИначеЕсли ГодКраткий = "91" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1991";
ИначеЕсли ГодКраткий = "92" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1992";
ИначеЕсли ГодКраткий = "93" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1993";
ИначеЕсли ГодКраткий = "94" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1994";
ИначеЕсли ГодКраткий = "95" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1995";
ИначеЕсли ГодКраткий = "96" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1996";
ИначеЕсли ГодКраткий = "97" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1997";
ИначеЕсли ГодКраткий = "98" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1998";
ИначеЕсли ГодКраткий = "99" Тогда
ДатаНовая = "" + Лев(Дата,6) + "1999";
ИначеЕсли ГодКраткий = "00" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2000";
ИначеЕсли ГодКраткий = "01" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2001";
ИначеЕсли ГодКраткий = "02" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2002";
ИначеЕсли ГодКраткий = "03" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2003";
ИначеЕсли ГодКраткий = "04" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2004";
ИначеЕсли ГодКраткий = "05" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2005";
ИначеЕсли ГодКраткий = "06" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2006";
ИначеЕсли ГодКраткий = "07" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2007";
ИначеЕсли ГодКраткий = "08" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2008";
ИначеЕсли ГодКраткий = "09" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2009";
ИначеЕсли ГодКраткий = "10" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2010";
ИначеЕсли ГодКраткий = "11" Тогда
ДатаНовая = "" + Лев(Дата,6) + "2011";
КонецЕсли;
ДатаЗначение = Дата(Сред(ДатаНовая,7,4),Сред(ДатаНовая,4,2),Сред(ДатаНовая,1,2));
Возврат ДатаЗначение;
КонецЕсли;
КонецФункции
Прихожу сегодня с утра и вижу вот такой код коллеги. Надо теперь психологически восстанавливаться.