- 1
ViewState["Action"] = result.client == "merchantName" ? false : true;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+145.4
ViewState["Action"] = result.client == "merchantName" ? false : true;
+145.4
индокод:
#ifdef PRINT_DEBUG_INFO
#define DBG_PRINT if(1) printf
#else
#define DBG_PRINT if(0) printf
#endif
Индокод - макрос для вкл-выкл дебажной печати.
+145.2
// тип System.Int32[]
int[] d = new int[0] { };
// тип System.Int32[,]
int[,] d = new int[3,0] { {}, {}, {} }
// тип System.Int32[,]
int[,] d = new int[1,0] { {} };
// тип System.Int32[, ,]
int[, ,] d = new int[2, 1, 0] { { { } }, { { } } };
// тип System.Int32[, , , , ,] и т.д.
int[, , , , ,] d = new int[1, 1, 1, 1, 1, 0] { { { { { { } } } } } };
// System.Int32[][][][][][][][][][][][][][][][][][][][][][][][][]
// (jagged array)
int[][][][][][][][][][][][][][][][][][][][][][][][][] d =
new int[5][][][][][][][][][][][][][][][][][][][][][][][][];
главное все работает
теперь осталось найти применение.. :)
+145
if ($test_domain->num_rows or true )
Обычная проверка на количество строк в запросе... Видимо, не всегда попадало в условие, и автор решил добавить or)
+145
<img src="%20.png">
+145
// Я не знаю, на чём до c# писал человек, который пишет вот такой код...
// sum типа decimal. Видимо, надо умножить её на 100 и передать округленной до целого куда-то в текстовом виде.
UInt32 summ_st = Convert.ToUInt32((Math.Round(sum * 100)).ToString("G"));
string cmd = "" + summ_st.ToString() + "";
И такое приходит от аутсорсеров
+145
Xml: {
parse: function (text) {
var xmlDocument;
if (window.DOMParser) {
var parser = new DOMParser();
xmlDocument = parser.parseFromString(text, "text/xml")
} else {
if (window.ActiveXObject) {
try {
xmlDocument = new ActiveXObject("Msxml2.DOMDocument.6.0")
} catch (err6) {
try {
xmlDocument = new ActiveXObject("Msxml2.DOMDocument.5.0")
} catch (err5) {
try {
xmlDocument = new ActiveXObject("Msxml2.DOMDocument.4.0")
} catch (err4) {
try {
xmlDocument = new ActiveXObject("MSXML2.DOMDocument.3.0")
} catch (err3) {
try {
xmlDocument = new ActiveXObject("Microsoft.XMLDOM")
} catch (err2) {
Wicket.Log.error("Cannot create DOM document: " + err2)
}
}
}
}
}
if (xmlDocument) {
xmlDocument.async = "false";
if (!xmlDocument.loadXML(text)) {
Wicket.Log.error("Error parsing response: " + text)
}
}
}
}
return xmlDocument
}
},
http://trudvsem.ru/
+145
var lst = new List<string>();
foreach (String parameterName in parameters.Keys) // parameters это Dictionary<String, Object>
{
lst.Add(parameterName + ": " + parameters[parameterName].ToString());
}
Долгий вариант перебора словаря: перебор ключей в цикле и на каждой итерации получение по ключу значения из словаря
+145
$change = FALSE;
if ($formdata['information_status'] == 0)
{
$change = TRUE;
}
$change = FALSE;
+145
<?
include "mode.php";
#session_start();
?>
<? $carttext .='<div class="text">';
$carttext .= "<form action=\"?confirm\" method=\"post\"><table border=\"0\" width=\"100%\" cellpadding=\"3\" cellspacing=\"0\">";
$carttext .="<tr>";
$split = explode(",",$list);
foreach ($split as $item) {
$check = explode("+",$item);
$query = mysql_query("SELECT p.id, p.urlname, p.name, p.group_join_category, p.price, c.name, p.photo_foto, c.urlname FROM catalog_prod as p left join catalog_category as c ON p.group_join_category=c.id WHERE p.id=$check[0]");
$row = mysql_fetch_row($query);
$row[10]="руб.";
$add_item="";
$add_item.=$row[1]."/";
$carttext .= "</tr><tr>";
if (!empty($row[6])) {
if(file_exists($_SERVER['DOCUMENT_ROOT'].$row[6])) {
$fo1 = '<img style="border:3px solid #f1f1f1;" src="/image.php/image-name.jpg?width=100&cropratio=1:1&image='.$row[6].'" alt="'.$row[2].'" width="100" height="100" align="left" />';}
else {$fo1 = '<img style="border:3px solid #f1f1f1;" src="/images/nofoto.png" alt="'.$row[2].'" width="100" height="100" align="left" />';}
} else {
$fo1 = '<img style="border:3px solid #f1f1f1;" src="/images/nofoto.png" alt="'.$row[2].'" width="100" height="100" align="left" />';
}
$carttext .= "<td valign=\"top\" width=\"100\">
<a href=\"/catalog/$row[7]/$add_item\">$fo1</a></td><td class=\"catlist\" valign=\"top\" width=\"100%\"><a href=\"/catalog/$row[7]/$add_item\">$row[2]</a></td>";
$carttext .= "<td valign=\"top\" class=\"catlist\" nowrap=\"nowrap\">$row[4] $row[10]</td>";
$carttext .= '<td valign=\"top\" class="catlist"><input type="hidden" value="'.$row[4].'" name="curprice" id="'.$check[0].'_curprice" /><input type="text" maxlength="5" size="3" style="width:20px" name="'.$check[0].'_amount" value="'.$check[1].'" id="'.$check[0].'_amount" class="basketinput1" onKeypress="onlyDigit(event);" onkeyup="updateBasket('.$check[0].');" /></td>';
$price = $row[4] * $check[1];
$price = sprintf("%0.2f", $price);
$carttext .= "<td valign=\"top\" class=\"catlist\" nowrap>$price $row[10]</td>";
$carttext .= '<td valign=\"top\" class="catlist"><input type="button" onclick="xajax_DelFromCart('.$check[0].');" value="Удалить" class="cartsubmit1" /></td>';
if (!IsSet($total1)) {
$total1 = 0;
}
if (!IsSet($totalcheck1)) {
$totalcheck1 = 0;
}
$total1 = $total1+ $price;
$totalcheck1 = $totalcheck1 + $check[1];
$total1 = sprintf("%0.2f", $total1);
}
$carttext .= "</tr><tr>";
$carttext .= "</tr><tr>";
$carttext .= "<td colspan=\"6\"><div style=\"border-bottom: solid 1px #3e1f16; padding: 5px 0 0 0; font-size:1px;\"> </div></td>";
$carttext .= "</tr><tr>";
$carttext .= "<td width=\"100%\" colspan=\"3\" class=\"catlist1\"><b>Итого:</b></td>";
$carttext .= "<td class=\"catlist1\">$totalcheck1</td>";
$carttext .= "<td class=\"catlist1\" colspan=\"2\" nowrap><b>$total1 $value</b></td>";
$carttext .= "</tr><tr>";
$carttext .= '';
$carttext .= "<td colspan=\"6\"><div style=\"border-bottom: solid 1px #3e1f16; padding: 1px 0 0 0; font-size:1px;\"> </div><br><input type=\"submit\" value=\"Оформить заказ\" class=\"inputsubmit1\" /></td>";
$carttext .= "</tr></table></form></div>";
?>
Специалист формирует корзину товаров. ЗП 1500$