- 1
- 2
cout << "\xFFsome_message" << endl; // OK
cout << "\xFFanother_message" << endl; // std::shooted_foot_exception
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+3
cout << "\xFFsome_message" << endl; // OK
cout << "\xFFanother_message" << endl; // std::shooted_foot_exception
Just another perl hacker shooted foot.
+167
$a = true;
$b = $a xor true;
var_dump($b);
ПЫХОПРОБЛЕМЫ
http://ideone.com/cRMQor
bool(true)
−98
[1,2,3,11,12,13,14,15,17].to_a
Чтобы наверняка..
+159
static function beforeIblockElementAddOrUpdateResetResponseAuthor($fields){
...
}
+127
/**
* Determines equality based upon the contents of this Box instead of the box itself.
* As a result, it is not symmetric. Which means that for
*
* <pre name="code" class="scala">
* val foo = "foo"
* val boxedFoo = Full(foo)
* foo == boxedFoo //is false
* boxedFoo == foo //is true
* </pre>
*
* For Full and Empty, this has the expected behavior. Equality in terms of Failure
* checks for equivalence of failure causes.
*/
override def equals(other: Any): Boolean = (this, other) match {
case (Full(x), Full(y)) => x == y
case (Full(x), y) => x == y
case (x, y: AnyRef) => x eq y
case _ => false
}
https://github.com/lift/framework/blob/master/core/common/src/main/scala/net/liftweb/common/Box.scala
−109
command = gets.chomp
while command != 'ПОКА'
if command != command.upcase
puts 'АСЬ?! ГОВОРИ ГРОМЧЕ, ВНУЧЕК!'
else
puts 'НЕТ, НИ РАЗУ С 1938 ГОДА!'
end
end
puts 'ПОКА, ВНУЧЕК!'
Нашёл ошибку, лишь когда вписывал код сюда.
Бесконечный цикл, как видите.
+133
<form action="/admin.php?action=edit_category&name=razdel1" method="post">
<table>
<tr>
<td>
<input type="image" src="views/admin/i/save.png" value="Сохранить" />
</td>
</tr>
<tr>
<td>
Название раздела:
<input type="text" name="name" value="Раздел1" size="41" maxlength="128" />
</td>
</tr>
</table>
</form>
"Имею большой опыт в области веб-программирования" говорите? Вот кусок творения нашего прославившегося клована Мишустика. Пруф для лулзов будет ниже в комменте.
Викинул лишнее и отформатировал для простоты понимания.
Как можно догадаться, редактирование раздела производится по идентификатору в параметре name, передаваемому методом GET. Название же раздела передается в одноименном параметре, только методом POST. Оригинально, да?
А как же задается идентификатор раздела? Обычным транслитом из названия!
Изменяем название с "Раздел1" на "Раздел2" - Сохранить - "Название раздела изменено!" Ок. Остаемся в этой же форме и пробуем изменить название обратно, сохраняем... А хрен вам - "Раздела не существует!"
Ну правильно, че! Идентификатор раздела в базе изменился на "razdel2", а форма по прежнему работает с "razdel1".
Вот такая вот реализация ЧПУ. Из этих идентификаторов потом строится адрес страницы а-ля http://test.soft-oskol.ru/razdel1/index.html
+89
pp = pp++;
Что хотел сказать автор?...
+1
Ой, девачьки, я 5 лет не заходило. Почему нет говнокодов на Дульфи? Я десять страниц промотал! Неужели все дульфисты впали
в старческий маразм и не могут больше срать на этом недоязыке? Почему? Он же изначально создавался для даунов.
Что стало с Тарасом? Что стало с поняшей-ассемблеристом?
Только одфаги меня вспомнят.
0
using System;
namespace MainNamespace
{
class SelectionSort
{
private static int FindSmallest(int[] arr)
{
int smallest = arr[0];
int smallestIndex = 0;
for (int i = 1; i < arr.Length; i++)
{
if (arr[i] < smallest)
{
smallest = arr[i];
smallestIndex = i;
}
}
return smallestIndex;
}
public static int[] ArraySort(int[] arr)
{
int[] newArr = new int[arr.Length];
for (int i = 0; i < arr.Length; i++)
{
int smallestIndex = FindSmallest(arr);
int arrayBeginningIndex = i;
newArr[arrayBeginningIndex] = arr[smallestIndex];
arr[smallestIndex] = Int32.MaxValue;
}
return newArr;
}
}
class MainClass
{
const int sizeOfArr = 7;
static int FindMaxProduct(int[] arr)
{
int maxProduct = 1;
int firstIndex = 0;
int secondIndex = 1;
int lastIndex = sizeOfArr - 1;
int beforeLastIndex = sizeOfArr - 1 - 1;
int beforeBeforeLastIndex = sizeOfArr - 1 - 2;
if (arr[firstIndex] * arr[secondIndex] * arr[lastIndex] > arr[beforeLastIndex] * arr[beforeBeforeLastIndex] * arr[lastIndex])
{
maxProduct = arr[firstIndex] * arr[secondIndex] * arr[lastIndex];
}
else
for (int i = 0; i < 3; i++)
maxProduct *= arr[lastIndex - i];
return maxProduct;
}
static void Main()
{
int[] arr = new int[sizeOfArr] {-31, 54, -39, -34, 0, 56, 92};
arr = SelectionSort.ArraySort(arr);
Console.WriteLine( FindMaxProduct(arr) );
Console.ReadKey();
}
}
}
Есть массив с целыми числами. Найти в этом массиве самое большое произведение 3 чисел и вывести в консоль.