- 1
mysql_query ("INSERT INTO mr_costadvtxt VALUES ('LAST_INSERT_ID(id+1)','$itemid','$kindofstr','$size', '$size_count','$pricered','$fordisc','$disc','$scheme_name','$pnum')") or die(mysql_error());
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+47
mysql_query ("INSERT INTO mr_costadvtxt VALUES ('LAST_INSERT_ID(id+1)','$itemid','$kindofstr','$size', '$size_count','$pricered','$fordisc','$disc','$scheme_name','$pnum')") or die(mysql_error());
+81
int i=0;
for (;i<5;
printf("%d",i);
i++;
);
+139
public static IEnumerable<T> QuickSort<T>(
this IEnumerable<T> source) where T : IComparable<T>
{
if (!source.Any()) return source;
var first = source.First();
return source
.AsParallel()
.GroupBy(i => i.CompareTo(first))
.OrderBy(g => g.Key)
.SelectMany(g => g.Key == 0 ? g : QuickSort(g));
}
−27
class Screen
{
private:
unsigned char *data; // do not move
size_t size; // do not move
+52
header( 'Content-Type: text/html; charset=utf-8' );
$year = date( 'Y' );
$months = array( 1 => 'Январь', 'Фервраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' );
$infoYear = getdate( mktime( 0, 0, 0, 1, 1, $year, 0 ) );
$weekDay = $infoYear['wday'] == 0 ? 7 : $infoYear['wday']; // wday - номер дня недели. 0 - Воскресение. Делаем воскресение седьмым днем.
echo "<h2>$year</h2>";
for ( $month = 1; $month <= 12; $month++ ) {
echo '<div style="float: left; padding: 2px;"><b>' . $months[$month] . '</b>';
echo '<table border="1">';
echo '<th>Пн</th><th>Вт</th><th>Ср</th><th>Чт</th><th>Пт</th><th>Сб</th><th>Вс</th>';
echo '<tr>';
for ( $day = 1; $day < 31; $day++ ) {
if ( checkdate($month, $day, $year) ) {
if ( $day == 1 )
for ( $i = 1; $i < $weekDay; $i++ )
echo '<td> </td>';
printf( '<td>%02d</td>', $day );
$weekDay++;
if ( $weekDay > 7 ) {
$weekDay = 1;
echo '</tr><tr>';
}
}
}
echo '</tr></table></div>';
}
Задача: Вывести календарь, для установки нужных дат админом и сохранить их в БД.
Остается отрефракторить и добавить checkbox'ы.
+112
switch (SelectedCategory)
{
case "Landscapers":
inputSearch.Value = "Landscapers";
break;
case "Baby sitters":
inputSearch.Value = "Baby sitters";
break;
case "Doctor":
inputSearch.Value = "Doctor";
break;
case "Cleaning services":
inputSearch.Value = "Cleaning services";
break;
case "Pet sitters":
inputSearch.Value = "Pet sitters";
break;
case "Handyman":
inputSearch.Value = "Handyman";
break;
case "Electrical services":
inputSearch.Value = "Electrical services";
break;
case "Tutor":
inputSearch.Value = "Tutor";
break;
case "Dog walker":
inputSearch.Value = "Dog walker";
break;
case "Plumbing":
inputSearch.Value = "Plumbing";
break;
case "Caterers":
inputSearch.Value = "Caterers";
break;
case "Misc":
inputSearch.Value = "Misc";
break;
}
обычный switch
−117
For t = 3 To u
If Cells(t, 204).Text = " " Or Cells(t, 204).Text = "" Then
If Cells(t + 1, 204).Text = " " Or Cells(t + 1, 204).Text = "" Then
If Cells(t + 2, 204).Text = " " Or Cells(t + 2, 204).Text = "" Then
If Cells(t + 3, 204).Text = " " Or Cells(t + 3, 204).Text = "" Then
If Cells(t + 4, 204).Text = " " Or Cells(t + 4, 204).Text = "" Then
If Cells(t + 5, 204).Text = " " Or Cells(t + 5, 204).Text = "" Then
If Cells(t + 6, 204).Text = " " Or Cells(t + 6, 204).Text = "" Then
If Cells(t + 7, 204).Text = " " Or Cells(t + 7, 204).Text = "" Then
If Cells(t + 8, 204).Text = " " Or Cells(t + 8, 204).Text = "" Then
If Cells(t + 9, 204).Text = " " Or Cells(t + 9, 204).Text = "" Then
If Cells(t + 10, 204).Text = " " Or Cells(t + 10, 204).Text = "" Then
If Cells(t + 11, 204).Text = " " Or Cells(t + 11, 204).Text = "" Then
If Cells(t + 12, 204).Text = " " Or Cells(t + 12, 204).Text = "" Then
If Cells(t + 13, 204).Text = " " Or Cells(t + 13, 204).Text = "" Then
If Cells(t + 14, 204).Text = " " Or Cells(t + 14, 204).Text = "" Then
If Cells(t + 15, 204).Text = " " Or Cells(t + 15, 204).Text = "" Then
If Cells(t + 16, 204).Text = " " Or Cells(t + 16, 204).Text = "" Then
If Cells(t + 17, 204).Text = " " Or Cells(t + 17, 204).Text = "" Then
If Cells(t + 18, 204).Text = " " Or Cells(t + 18, 204).Text = "" Then
If Cells(t + 19, 204).Text = " " Or Cells(t + 19, 204).Text = "" Then
If Cells(t + 20, 204).Text = " " Or Cells(t + 20, 204).Text = "" Then
If Cells(t + 21, 204).Text = " " Or Cells(t + 21, 204).Text = "" Then
If Cells(t + 22, 204).Text = " " Or Cells(t + 22, 204).Text = "" Then
If Cells(t + 23, 204).Text = " " Or Cells(t + 23, 204).Text = "" Then
If Cells(t + 24, 204).Text = " " Or Cells(t + 24, 204).Text = "" Then
If Cells(t + 25, 204).Text = " " Or Cells(t + 25, 204).Text = "" Then
If Cells(t + 26, 204).Text = " " Or Cells(t + 26, 204).Text = "" Then
If Cells(t + 27, 204).Text = " " Or Cells(t + 27, 204).Text = "" Then
If Cells(t + 28, 204).Text = " " Or Cells(t + 28, 204).Text = "" Then
If Cells(t + 29, 204).Text = " " Or Cells(t + 29, 204).Text = "" Then
If Cells(t + 30, 204).Text = " " Or Cells(t + 30, 204).Text = "" Then
If Cells(t + 31, 204).Text = " " Or Cells(t + 31, 204).Text = "" Then
If Cells(t + 32, 204).Text = " " Or Cells(t + 32, 204).Text = "" Then
If Cells(t + 33, 204).Text = " " Or Cells(t + 33, 204).Text = "" Then
If Cells(t + 34, 204).Text = " " Or Cells(t + 34, 204).Text = "" Then
GoTo zan4:
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
Next t
zan4:
Кусок реально используемого "проэкта", используется у нас на призводстве.
И вот-такого штук 10 в коде.
ноу коментс.
+999
assert(t1.tm_sec == t2.tm_sec);
assert(t1.tm_min == t2.tm_min);
assert(t1.tm_hour == t2.tm_hour);
assert(t1.tm_mday == t2.tm_mday);
assert(t1.tm_mon == t2.tm_mon);
assert(t1.tm_year == t2.tm_year);
assert(t1.tm_wday == t2.tm_wday);
assert(t1.tm_yday == t2.tm_yday);
assert(t1.tm_isdst == t2.tm_isdst);
фрагмент из кода библиотеки SOCI: http://soci.sourceforge.net/
наконец-то исправили на: assert(memcmp(&t1, &t2, sizeof(std::tm)) == 0);
+82
private static final String QUERY =
new StringBuffer("SELECT p.id FROM policysummary p ")
.append(" WHERE p.currentRevisionInd = 1 ")
.append("AND p.policyStatusCd IN ('issued') ")
.append("AND p.timedPolicyStatusCd IN ('inForce') ")
.append("AND p.txType IN ('policy','renewal','endorsement','reinstatement') ")
.append("AND p.expiration <= :requestDate ")
.append("AND :requestDate <= (p.expiration + :requestTo) ")
.append("AND NOT EXISTS ")
.append(" (SELECT prs.id ")
.append(" FROM PolicyReportStatus prs ")
.append(" WHERE prs.policyId = p.id ")
.append(" AND prs.mvrOrderDt IS NOT NULL ")
.append(" )")
.toString();
Недавно выдавили заграничные коллеги
+953
void Update()
{
float anime = (animation.wrapMode = WrapMode.Loop);
anime = false;
}
Хентай повышенной концентрации.