- 1
- 2
- 3
- 4
- 5
<?php if (!$mode || true) { ?>
<div class="yiiForm">
<?php } else { ?>
<div class="yiiForm">
<?php } ?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+144.5
<?php if (!$mode || true) { ?>
<div class="yiiForm">
<?php } else { ?>
<div class="yiiForm">
<?php } ?>
последствия удаления ненужных частей кода
+153.5
private function _createPath() {
$_url = DEFAULT_URL;
$_url = false === strpos($_url, 'http://') ? 'http://' . $_url : $_url;
$_url = false === strpos($_url, '/', strlen($_url) - 1) ? $_url . '/' : $_url;
return $_url . 'gateway.php?';
}
Давайте скидываться на киллеров. Заработаем больше :)
+158.3
function onbot($who) {
$crime = 5;
$crime_ar=array();
for($i=0;$i<=$crime;$i++) {
$crime_ar[$i]=$i;}
for($i=$crime+1;$i<=100;$i++) {
$crime_ar[$i]="empty";
}
$crime_numer=rand(0,100);
$is_crime="0";
for($i=0;$i<=100;$i++) {
if($crime_numer==$crime_ar[$i]) {
$is_crime="1";
}
}
if($is_crime == 1) {
$at = rand(1,4);
if($at == 1) {$attacker = 'gorg1';}
if($at == 2) {$attacker = 'gorg2';}
if($at == 3) {$attacker = 'gorg3';}
if($at == 4) {$attacker = 'gorg4';}
attack($who,$attacker,'1');
die();
}
}
function attack($who,$attacker,$dif) {
..........................................
if($attacker == "gorg1") {
$prototype = "Рядовой Горг";
$name = "Рядовой Горг";}
if($attacker == "gorg2") {
$prototype = "Горг-Лейтенант";
$name = "Горг-Лейтенант";}
if($attacker == "gorg3") {
$prototype = "Горг-Капитан";
$name = "Горг-Капитан";}
if($attacker == "gorg4") {
$prototype = "Горг Подполковник";
$name = "Горг Подполковник";}
$mine_id=$db["id"];
// далее идет заполнение таблиц, для "блоя"
}
}
Разбираюсь в онлайн игре. Архитектура самой игры на высшем уровне!
+165.4
<script language="JavaScript">
function change_city()
{
document.getElementById("header_18").style.display='none';
document.getElementById("header_18_add").style.display='block';
document.getElementById("header_18_add").id='header_18'; //т.к. стили прописаны для id
}
</script>
</head>
<body>
<div id="mega_scroller">
<div id="mega_scroller">
document.getElementById("header_18_add") .id='header_18'; //т.к. стили прописаны для id
http://www.cinemapark.ru/ - гении делали
+96.3
public class zTimer
{
object SomeTag;
int StartTime;
int TimeOut;
public int Start(int Value, object tag)
{
SomeTag = tag;
TimeOut = Value;
StartTime = MakeLngTime(DateTime.Now);
return StartTime;
}
public int MakeLngTime(DateTime Tm)
{
return ((Tm.Day * 24 + Tm.Hour) * 60 + Tm.Minute) * 60 + Tm.Second;
}
public bool IsTimeOut(object tag)
{
if (tag != null && SomeTag != null)
{
if (tag == SomeTag)
{
if (MakeLngTime(DateTime.Now) > StartTime + TimeOut)
{
return true;
}
else
{
return false;
}
}
else
{
StartTime = MakeLngTime(DateTime.Now);
SomeTag = tag;
return false;
}
}
else
{
if (MakeLngTime(DateTime.Now) > StartTime + TimeOut)
{
return true;
}
else
{
return false;
}
}
}
}
Могучий таймер. Особое внимание стоит уделить методу MakeLngTime.
+92.7
unit CelFahKel;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Edit2: TEdit;
RadioGroup1: TRadioGroup;
RadioGroup2: TRadioGroup;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
F: Extended;
C: Integer;
begin
if RadioGroup1.ItemIndex=0 then
if RadioGroup2.ItemIndex=0 then
Edit2.Text := Edit1.Text
else if RadioGroup2.ItemIndex=1 then
begin
F := StrToFloat(Edit1.Text) * (9/5) + 32;
Edit2.Text := FloatToStr(F)
end
else if RadioGroup2.ItemIndex=2 then
begin
C := StrToInt(Edit1.Text) + 273;
Edit2.Text := FloatToStr(C);
end;
if RadioGroup1.ItemIndex=1 then
if RadioGroup2.ItemIndex=0 then
begin
F := StrToFloat(Edit1.Text) - 32 * (5/9);
Edit2.Text := FloatToStr(F);
end
else if RadioGroup2.ItemIndex=1 then
Edit2.Text := Edit1.Text
else if RadioGroup2.ItemIndex=2 then
begin
F := StrToFloat(Edit1.Text) - 32 * (5/9) + 273;
Edit2.Text := FloatToStr(F);
end;
if RadioGroup1.ItemIndex=2 then
if RadioGroup2.ItemIndex=0 then
begin
C := StrToInt(Edit1.Text) - 273;
Edit2.Text := IntToStr(C);
end
else if RadioGroup2.ItemIndex=1 then
begin
F := StrToFloat(Edit1.Text) + 32 * (9/5) - 273;
Edit2.Text := FloatToStr(F);
end
else if RadioGroup2.ItemIndex=2 then
Edit2.Text := Edit1.Text
end;
end.
Всего-то навсего перевод градусных величин: Сельсий <-> Фаренгейт <-> Кельвин и вывод в Эдит
−854.3
-- I found table with 20 millions rows, that nobody read just add new rows again and again :(
-- table size was 1 GB.
Я описал в коде.
+150.6
{if eq($view_parameters.affichage,'avis')}
<!-- complete comment -->
<script type="text/javascript">
var object_id = {$next_prev.object.id};
var url_alias = {$next_prev.url_alias|ezurl()};
</script>
{include uri="design:inc/esi/esi_complete_comment.tpl" object_id=$node.object.id class_identifier=$next_prev.object.class_identifier}
{else}
<!-- full comment -->
<script type="text/javascript">
var object_id = {$next_prev.object.id};
var url_alias = {$next_prev.url_alias|ezurl()};
</script>
{include uri="design:inc/esi/esi_full_comment.tpl" object_id=$next_prev.object.id class_identifier=$next_prev.object.class_identifier}
{/if}
Комментарии французов в шаблоне eZ Publish понятны как никогда.
−164.9
ORA-600 [12235]: Oracle process has no purpose in life!
Даже Оракл знает что такое смысл жизни
+66.7
mNewFrame->SetName (new char [MAX_TOKEN]);
strcpy (mNewFrame->GetName(), mXFrame->Attribute("name"));
Умелая работа со строками....