- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
public void saveDomain(DomainMetadata domainMetadata){
domainStore.save(domainMetadata);
}
оттуда же
public void saveMail(Mail mail){
mailCollection.save(mail);
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+143
public void saveDomain(DomainMetadata domainMetadata){
domainStore.save(domainMetadata);
}
оттуда же
public void saveMail(Mail mail){
mailCollection.save(mail);
}
+118
for (int Low = 0, Up = 8; (Low <= 72) & (Up <= 80); Low += 12, Up += 12)
if ((i >= Low) & (i <= Up))
{
a = 0;
for (int l = 0; l <= 13 * 3; l += 13)
{
if (labels[i + l].Text == "X")
{
a += 1;
if ((l == 13 * 3) & (a != 4)) a = 0;
}
else a = 0;
}
if (a == 4)
{
if ((i != 8) & (i != 72))
{
if ((i == Low) | ((i >= 0) & (i <= 7)))
if (labels[i + 13 * 4].Text == "-")
{
labels[i + 13 * 4].Text = "O";
win = true;
goto End2;
}
if ((i == Up) | ((i >= 73) & (i <= 80)))
if (labels[i - 13].Text == "-")
{
labels[i - 13].Text = "O";
win = true;
goto End2;
}
if (i == Low)
if (labels[i + 13 * 4].Text == "-")
{
labels[i + 13 * 4].Text = "O";
win = true;
goto End2;
}
if (i == Up)
if (labels[i - 13].Text == "-")
{
labels[i - 13].Text = "O";
win = true;
goto End2;
}
if (((i >= 0) & (i <= 7)) | ((i >= 73) & (i <= 80)) | (i == Low) | (i == Up)) ;
else
{
if (labels[i + 13 * 4].Text == "O")
if (labels[i - 13].Text == "-")
{
labels[i - 13].Text = "O";
win = true;
goto End2;
}
Полная версия: http://pastebin.com/gZFjYrtM
+156
XXXCompany_API::addDebugLine("Didn't crash and burn.");
+153
<option value="0"
<?
if($_SESSION['ttype'] == 0){ echo "SELECTED"; }
echo ">Подключение\n<option value=\"0last\" ";
if($_SESSION['ttype'] == '0last'){ echo "SELECTED"; }
echo ">История - Подключение\n<option value=\"1\" ";
if($_SESSION['ttype'] == 1){ echo "SELECTED"; }
echo ">Саппорт\n<option value=\"1last\" ";
if($_SESSION['ttype'] == '1last'){ echo "SELECTED"; }
echo ">История - саппорт\n<option value=\"all\" ";
if($_SESSION['ttype'] == 'all'){ echo "SELECTED"; }
?>
>Все
</select>
Вывод селекта для выбора типа заявки. 0.001% сочно наговнокоженного проекта
+123
http://funkyimg.com/u2/1556/586/2825302008_10_13_08_56_pit_dirty_ru_lepro_2_2008_10_09_18140_132300_8a155bd531ebf86457f70e98dff1756d.gif
+989
stek* getLast(){
stek* result = first;
while (!isLast(*result)){
result = result->next;
}
return result;
}
void push( char* string ){
stek* anew = new stek;
anew->string = string;
anew->next = NULL;
anew->first = first;
getLast()->next = anew;
}
void printList(){
if (first != NULL){
stek* element = first;
puts( element->string );
while (!isLast(*element)){
element = element->next;
puts( element->string );
}
}
else{
puts( "List is empty" );
}
}
stek* getPrev( stek* element ){
stek* result = first;
while (result->next != element){
result = result->next;
}
return result;
}
void changeFirstInList( stek* newFirst ){
stek* element = first;
while (element != NULL){
element->first = newFirst;
element = element->next;
}
}
void deleteElement( stek* element )
{
if ( element->first == element ){
first = element->next;
changeFirstInList( first );
}
else{
stek* prev = getPrev( element );
stek* next = element -> next;
prev->next = next;
}
}
void deleteElements( int length ){
stek* element = first;
while (element != NULL){
stek* next = element->next;
if (strlen(element->string) < length) {
deleteElement( element );
}
element = next;
}
}
int _tmain(int argc, _TCHAR* argv[]){
char *token;
char st1[80];
int minLength = 4;
int n=0;
printf("Enter string: ");
gets( st1 );
printf("Enter minimal length: ");
scanf( "%d", &minLength );
first=NULL;
first=new stek;
first->next=NULL;
first->first=first;
token=strtok(st1," ");
first->string=token;
token=strtok(NULL," ");
while( token != NULL){
push(token);;
token=strtok(NULL," ");
}
stek* element = first;
while (element != NULL){
stek* next = element->next;
if (strlen(element->string)<3) n++;
element = next;
}
puts("Initial stack:");
printList();
deleteElements( minLength );
printf("Slov dlinoi less than 3: %d\n",n);
puts("After deleting:");
printList();
getch();
}
Лабораторная работа, написанная двумя студентами первого курса. Задание: "Дана строка 80 символов, разбить её на слова (разделитель - пробел), удалить слова меньше опр. длины и вывести количество слов с длиной меньше 3-ех".
Почти каждая строчка в main'e - перл.
З.Ы. Форматирование кода тоже доставляет.
−118
- (int) getRandomValue {
int rnd = 1000;
return rnd;
}
И это было уже в предрелизе..
+156
<html>
<head>
<title> Тест </title>
<h2 align="center"> Тест </h2>
<form action="11.php" method=POST>
<h4> 1. После ссоры в семье, после выговора начальника ищете ли Вы успокоение в спиртных напитках ?</h4>
<p><input type=radio name='v1' value='1'> Да </p>
<p><input type=radio name='v1' value='0'>Нет </p>
......
......
......
<h4> 20. Бывают ли у Вас после пьянки слуховые и зрительные галлюцинации ?</h4>
<p><input type=radio name='v20' value='1'> Да </p>
<p><input type=radio name='v20' value='0'>Нет </p>
<input type=submit value="Ответить">
</form>
</body>
</html>
И файл обработчик 11.php
<?php
$v1 = $_POST['v1'];
$v2 = $_POST['v2'];
$v3 = $_POST['v3'];
$v4 = $_POST['v4'];
$v5 = $_POST['v5'];
$v6 = $_POST['v6'];
$v7 = $_POST['v7'];
$v8 = $_POST['v8'];
$v9 = $_POST['v9'];
$v10 = $_POST['v10'];
$v11 = $_POST['v11'];
$v12 = $_POST['v12'];
$v13 = $_POST['v13'];
$v14 = $_POST['v14'];
$v15 = $_POST['v15'];
$v16 = $_POST['v16'];
$v17 = $_POST['v17'];
$v18 = $_POST['v18'];
$v19 = $_POST['v19'];
$v20 = $_POST['v20'];
$over = $v1 + $v2 + $v3 + $v4 + $v5 + $v6 + $v7 + $v8 + $v9 + $v10 + $v11 + $v12 + $v13 + $v14 + $v15 + $v16 + $v17 + $v18 + $v19 + $v20 ;
if ($over > 0 && $over <= 7) { $ball = "1-7: ранняя стадия, которая длится обычно 10-15 лет."; }
if ($over > 8 && $over <= 17) { $ball = "8-17: средняя стадия, длится обычно 2-5 лет"; }
if ($over > 18 && $over <= 20) { $ball = "18-20: последняя стадия алкоголизма."; }
echo "<h4>Результат теста:</h4><p>Вами набрано <b> $over</b> баллов.</p> <p>Результат <b>$ball</b></p>";
?>
The Best Answer on topic ))) http://phpforum.ru/index.php?showtopic=59990&st=0
−100
def del_space_both(t):
return del_space_end(del_space_begin(t))
def del_space_begin(text):
if len(text):
while text[:1] == ' ': text = text[1:]
return text
def del_space_end(text):
if len(text):
while text[-1:] == ' ': text = text[:-1]
return text
религия не позволяет использовать strip(), lstrip() и rstrip
+151
<?
$pathinfo = pathinfo($_SERVER['REQUEST_URI']);
if ($pathinfo['extension'] == 'htm') {
$new_url = str_replace('.htm', '.html', $_SERVER['REQUEST_URI']);
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $new_url);
exit;
}
require_once($_SERVER["DOCUMENT_ROOT"] . "/check_url.php");
session_start();
@ignore_user_abort();
@set_time_limit(0);
$doNotRedirect = FALSE;
include ($_SERVER['DOCUMENT_ROOT'] . "/adv_cnt.inc");
include($_SERVER['DOCUMENT_ROOT'] . "/db.inc");
include("../../lang.inc");
include("../../e_hotel.inc");
include("../../lib.inc");
include("../../rooms.inc");
include("../../e_page.inc");
include("../../month.inc");
include("../../e_geo.inc");
include("../../social.inc");
include("../../review.inc");
include("../../banner.inc");
include_once '../../classes/class.DatePicker.php';
error_reporting(E_All);
ini_set('display_errors', 0);
openDB();
ini_set("include_path", ".:" . $_SERVER["DOCUMENT_ROOT"] . "/libs/PEAR");
require_once('Cache/Lite.php');
$languagecode = $_GET["languagecode"];
$hotelurl = $_GET["hotel"];
if ($hotelurl == 'xmltesthetelno1' && $_GET['debug'] != 1){
header('HTTP/1.1 404 Not Found');
exit;
}
$countrycode = $_GET["countrycode"];
$nearby = $_GET["nearby"];
$city_id = $_GET["city_id"];
$hotel_id = $_GET["hotel_id"];
$cityurl = $_GET["city"];
if ($languagecode == "") {
$languagecode = "en";
}
$no_cache = FALSE;
if ($hotel_id) {
$no_cache = TRUE;
}
Нади 1000 и 1 гавно...