- 1
chunksLst.erase(++it1);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+1
chunksLst.erase(++it1);
−164
Процедура глЗагрузитьЗаказы() Экспорт
ОткрытьФорму("Отчет",,"\\SQLDSTR\1C\ExtERT\InvoiceLoader.ert");
КонецПроцедуры
Встретил в самописке в клюшках. Если поменяется имя сервера или каталога - всё рухнет).
+108
if (needParce)
{
try
{
count = decimal.Parse(tb_count.Text.Replace(".", ","));
}
catch
{
count = decimal.Parse(tb_count.Text.Replace(",", "."));
}
}
+133
[Serializable]
public class CSScriptCompiler
{
//file name of script including full path
string sFileNameWithPath;
System.Reflection.Assembly m_assembly = null;
public CSScriptCompiler(string ScriptFileName)
{
this.sFileNameWithPath = Path.GetFullPath(ScriptFileName);
try
{
//load Assembly of *.cs file
m_assembly = CSScript.Load(sFileNameWithPath, null, true);
}
catch (Exception ex)
{
m_assembly = null;
MessageBox.Show(ex.Message);
throw (ex);
}
}
public bool Initialize(params object[] InitArgs)
{
if (m_assembly == null)
{
return false;
}
try
{
var InitFuntion = m_assembly.GetStaticMethod("*.Initialize", InitArgs);
//call initialize function
InitFuntion(InitArgs);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return false;
}
return true;
}
public object CallFunction(String sFunctionName, params object[] args)
{
object result = null;
sFunctionName = "*." + sFunctionName;
try
{
var theFunction = m_assembly.GetStaticMethod(sFunctionName, args);
//call the method with your own arguements
result = theFunction(args);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return result;
}
}
Ну что тут скажешь...
Велосипедист...
+138
public string GetStringOfEnum(object myEnum)
{
string sValue = "";
sValue = Enum.GetName(myEnum.GetType(), myEnum);
return sValue;
}
Nuff said...
+155
function deposit(){
if(document.getElementById("no_of_year").value=="1") {
document.getElementById("interest_rate").value="9.5"
}
if(document.getElementById("no_of_year").value=="2") {
document.getElementById("interest_rate").value="10"
}
if(document.getElementById("no_of_year").value=="3") {
document.getElementById("interest_rate").value="10.5"
}
if(document.getElementById("no_of_year").value=="4") {
document.getElementById("interest_rate").value="11"
}
if(document.getElementById("no_of_year").value=="5") {
document.getElementById("interest_rate").value="11.5"
}
}
отсюда - http://stackoverflow.com/questions/24236980/values-not-passing-in-to-database
+164
function EscapePHPString($str)
{
$str = str_replace("\\", "\\\\", $str);
$str = str_replace("\$", "\\\$", $str);
$str = str_replace("\"", "\\"."\"", $str);
return $str;
}
function UnEscapePHPString($str)
{
$str = str_replace("\\\\", "\\", $str);
$str = str_replace("\\\$", "\$", $str);
$str = str_replace("\\\"", "\"", $str);
return $str;
}
Bitrix.
+158
// Выше PHP + HTML
$redirect = "
<script language='JavaScript'>
window.location.href = 'http://www.p-ride.ru'
</script>
";
// ...
$query1 = "SELECT main_id FROM email WHERE email = '$email'";
$idquery = mysql_query($query1);
$id = mysql_fetch_row($idquery);
// ...
if(in_array($id[0], $idarray2))
{
echo $starthtml;
echo $redirect;
// ^ тут
echo "<p>Такой почтовый адрей уже используется, ведите пожалуйста другой адрес или восстановите пароль. Вы сейчас будете перенаправлены на главную страницу, если этого не произошло, кликните <a href='http://p-ride.ru'>сюда</a>.</p>";
echo $endhtml;
}
Редирект аля ПоХаПэ + отображение сообщение которое не будет показано.
+165
/* Выше HTML ... */
include_once "config/mysql.php";
$email = $_POST['email'];
$password = $_POST['password'];
$confirm = $_POST['confirm'];
$email = stripslashes($email);
$email = htmlspecialchars($email);
$email = trim($email);
$password = stripslashes($password);
$password = htmlspecialchars($password);
$password = trim($password);
$confirm = stripslashes($confirm);
$confirm = htmlspecialchars($confirm);
$confirm = trim($confirm);
/* ... больше ПоХаПэ */
Мммм... О функциях не слышали?
+89
(1 until n) flatMap (i => (1 until i) filter (j => isPrime(i+j)) map (j => (i, j)))
Скала говна.