- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
setlocale(0,"");
int x;
cin >> x;
if(x > 10 && x < 0)
{
cout << "Неверный множытель!" << endl;
}
else
{
//...
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 1419
+133.3
setlocale(0,"");
int x;
cin >> x;
if(x > 10 && x < 0)
{
cout << "Неверный множытель!" << endl;
}
else
{
//...
}
А, я ещё удивлялса, почемуже она работает не так как надо)))
+175.3
for(i=0;i<3;i++)
{
pictures[i] = new Image()
if(i==0) pictures[i].src = "jpg/javascript/3.jpg"
if(i==1) pictures[i].src = "jpg/javascript/2.jpg"
if(i==2) pictures[i].src = "jpg/javascript/1.jpg"
}
http://citforum.ru/internet/javascript/exgraph.shtml
+124.6
#define Yield()
winbase.h , строка 57.
В Windows SDK, даже новом от Windows 7, присутствует заглушка для функции от Windows 3.x (1992 год). Эта заглушка мешает называть свои методы "Yield", никакой пользы при этом не принося - код от 3.х не дожил до этого года без изменений.
+147.9
<?php
define('1',E_ERROR);
define('2',E_WARNING);
define('4',E_PARSE);
define('8',E_NOTICE);
define('16',E_CORE_ERROR);
define('32',E_CORE_WARNING);
define('64',E_COMPILE_ERROR);
define('128',E_COMPILE_WARNING);
define('256',E_USER_ERROR);
define('512',E_USER_WARNING);
define('1024',E_USER_NOTICE);
define('2048',E_STRICT);
define('4096',E_RECOVERABLE_ERROR);
define('8192',E_DEPRECATED);
define('16384',E_USER_DEPRECATED);
define('30719',E_ALL);
?>
<?php
define('E_ERROR',1);
define('E_WARNING',2);
define('E_PARSE',4);
define('E_NOTICE',8);
define('E_CORE_ERROR',16);
define('E_CORE_WARNING',32);
define('E_COMPILE_ERROR',64);
define('E_COMPILE_WARNING',128);
define('E_USER_ERROR',256);
define('E_USER_WARNING',512);
define('E_USER_NOTICE',1024);
define('E_STRICT',2048);
define('E_RECOVERABLE_ERROR',4096);
define('E_DEPRECATED',8192);
define('E_USER_DEPRECATED',16384);
define('E_ALL',30719);
?>
(c) http://ru2.php.net/manual/en/errorfunc.constants.php#87906
+149
//--------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------INCLUDES--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------------------
#include <stdio.h>
#include <iostream>
#include <conio.h>
#include <windows.h>
#include <time.h>
#include <string.h>
//--------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------DEFINES----------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------------------
#define PI 3.14
#define jmp(label) goto label
#define snl printf("\n")
#define printl(str) printf(str);snl
#define add(n0,n1) n0+n1
#define sub(n0,n1) n0-n1
#define mov(n0,n1) n0=n1
#define rpl(n0,n1) int tmp; tmp=n0; n0=n1; n1=tmp
#define Nothing void
#define EverLoop(operator) while(true){operator;}
//--------------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------NAMESPACES-------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------------------
namespace ofn
{
namespace Math
{
int PushedValue;
int factorial(int Num)
{
int res = 1;
for(int i=1;i<=Num;i++)
{
res = res * i;
}
return res;
}
bool mod(int Num,int module)
{
if(Num % module == 0) return true;
else return false;
}
void push(int value)
{
PushedValue = value;
}
int pop()
{
return PushedValue;
}
}
namespace Strings
{
char* Files(){return "Namespace \"Strings\" is empty!";}
}
namespace Files
{
char* Files(){return "Namespace \"Files\" is empty!";}
}
}
Вот нашол у себя на компе такой хеадер))))
Делалса он тупо ради прикола...
+142
if(id==llGetOwner()){
if(message=="re")say(reverseText(last,russian,engl));
else if(message=="re2")say(reverseText("\n"+prelast+"\n"+last,russian,engl));
else if(message=="re3")say(reverseText("\n"+preprelast+"\n"+prelast+"\n"+last,russian,engl));
else if(message=="rem")say(reverseText(last_my,russian,engl));
else if(message=="rem2")say(reverseText("\n"+prelast_my+"\n"+last_my,russian,engl));
else if(message=="rem3")say(reverseText("\n"+preprelast_my+"\n"+prelast_my+"\n"+last_my,russian,engl));
else if(message=="ren")say(reverseText(last_nm,russian,engl));
else if(message=="ren2")say(reverseText("\n"+prelast_nm+"\n"+last_nm,russian,engl));
else if(message=="ren3")say(reverseText("\n"+preprelast_nm+"\n"+prelast_nm+"\n"+last_nm,russian,engl));
else if(message=="ee")say(reverseText(last,engl,russian));
else if(message=="ee2")say(reverseText("\n"+prelast+"\n"+last,engl,russian));
else if(message=="ee3")say(reverseText("\n"+preprelast+"\n"+prelast+"\n"+last,engl,russian));
else if(message=="eem")say(reverseText(last_my,engl,russian));
else if(message=="eem2")say(reverseText("\n"+prelast_my+"\n"+last_my,engl,russian));
else if(message=="eem3")say(reverseText("\n"+preprelast_my+"\n"+prelast_my+"\n"+last_my,engl,russian));
else if(message=="een")say(reverseText(last_nm,engl,russian));
else if(message=="een2")say(reverseText("\n"+prelast_nm+"\n"+last_nm,engl,russian));
else if(message=="een3")say(reverseText("\n"+preprelast_nm+"\n"+prelast_nm+"\n"+last_nm,engl,russian));
else if(message=="be")say(reverseText(last,both_engl,both_russian));
else if(message=="be2")say(reverseText("\n"+prelast+"\n"+last,both_engl,both_russian));
else if(message=="be3")say(reverseText("\n"+preprelast+"\n"+prelast+"\n"+last,both_engl,both_russian));
else if(message=="bem")say(reverseText(last_my,both_engl,both_russian));
else if(message=="bem2")say(reverseText("\n"+prelast_my+"\n"+last_my,both_engl,both_russian));
else if(message=="bem3")say(reverseText("\n"+preprelast_my+"\n"+prelast_my+"\n"+last_my,both_engl,both_russian));
else if(message=="ben")say(reverseText(last_nm,both_engl,both_russian));
else if(message=="ben2")say(reverseText("\n"+prelast_nm+"\n"+last_nm,both_engl,both_russian));
else if(message=="ben3")say(reverseText("\n"+preprelast_nm+"\n"+prelast_nm+"\n"+last_nm,both_engl,both_russian));
}
Кусок кода на SecondLife-овском LSL. Создатель утверждает, что это охуенно прогрессивная техника, использующая новейшие методы =))
+175
$exp=explode("/images/",$value['picture_big_location']);
$newVal=$exp[0]."/bigImages/".$exp[1];
Задача состояла в том, чтобы в строке заменить "/images/" на "/bigImages/"
−82.1
# заменяем в разделитель на запятую в поле "Количество"
$row[4] =~ s/\./,/;
# лишние нули красим цветом фона
$row[4] =~ s/,000/<font color=#ffffff>.000<\/font>/;
Обработка суммы платежа при выводе пользователю в личном кабинете (web-страница)
+154
<?php
$br="
";
include "functions.php";
mconnect();
$result=mysql_query("TRUNCATE base");
$tags=file_get_contents("tag_cache");
$tags=str_replace("'","\'",$tags);
$tags=explode("songList begin",$tags);
$j=0;
for($i=1; $i<count($tags); $i++)
{
$tmp=explode("songList end",$tags[$i]);
$tbase[$j++]=$tmp[0];
}
$j=0;
for($i=0; $i<count($tbase); $i++)
{
$tmp=explode("key: ", $tbase[$i]);
for($i2=1; $i2<count($tmp); $i2++)
$element[$j++]=$tmp[$i2];
}
for($i=0; $i<count($element); $i++)
{
$tmp=explode($br."file: ",$element[$i]);
$track[$i]['key']=$tmp[0];
$tmp=explode($br."Time: ",$tmp[1]);
$track[$i]['file']=$tmp[0];
$tmp=explode($br."Artist: ",$tmp[1]);
$track[$i]['Time']=$tmp[0];
$tmp=explode($br."Title: ", $tmp[1]);
$track[$i]['Artist']=$tmp[0];
$tmp=explode($br."Album: ", $tmp[1]);
$track[$i]['Title']=$tmp[0];
$tmp=explode($br."Track: ", $tmp[1]);
$track[$i]['Album']=$tmp[0];
$tmp=explode($br."Date: ", $tmp[1]);
$track[$i]['Track']=$tmp[0];
$tmp=explode($br."Genre: ", $tmp[1]);
$track[$i]['Date']=$tmp[0];
$tmp=explode($br."mtime: ", $tmp[1]);
$track[$i]['Genre']=$tmp[0];
$track[$i]['mtime']=$tmp[1];
$track[$i]['Size']=filesize(str_replace("\'","'", $track[$i]['file']));
}
for($i=0; $i<count($track); $i++)
{
// echo $track[$i]['Artist']." - ".$track[$i]['Album'].": ".$track[$i]['Title']."; " . round($track[$i]['Time']/60) . "m " .$track[$i]['Time']%60 . "s<hr>";
$request="INSERT INTO base (file, Time, Artist, Title, Album, Track, Date, Genre, mtime, Size) VALUES ('".
$track[$i]['file']."', '"
.$track[$i]['Time']."', '"
.$track[$i]['Artist']."', '"
.$track[$i]['Title']."', '"
.$track[$i]['Album']."', '"
.$track[$i]['Track']."', '"
.$track[$i]['Date']."', '"
.$track[$i]['Genre']."', '"
.$track[$i]['mtime']."', '"
.$track[$i]['Size']."')";
echo $request."<hr>";
$result=mysql_query($request) or die(mysql_error().$i.";(");
}
?>
Прога, которая из базы mpd запихивает в mysql
+147
{"width":910,"element":null,"appto":null,"random_seed":874464,"html":"<div style='width:910' class='animated_pic_group' id='re874464'><a href='\/\/' class='animated_image'> \n<table class='kartinko_s_tenju'>\n <tr>\n <td><div class='tl'><\/div><\/td>\n <td><div class='top'><\/div><\/td>\n <td><div class='tr'><\/div><\/td>\n <\/tr>\n <tr>\n <td height='100%' class='left'><\/td>\n <td><div class='image'><img src='\/images\/up\/image1.jpg' width='150px'><\/div><\/td>\n <td class='right'><\/td>\n <\/tr>\n <tr>\n <td><div class='bl'><\/div><\/td>\n <td><div class='bottom'><\/div><\/td>\n <td><div class='br'><\/div><\/td>\n <\/tr>\n<\/table>\n \n <\/a><a href='\/\/' class='animated_image'> \n<table class='kartinko_s_tenju'>\n <tr>\n <td><div class='tl'><\/div><\/td>\n <td><div class='top'><\/div><\/td>\n <td><div class='tr'><\/div><\/td>\n <\/tr>\n <tr>\n <td height='100%' class='left'><\/td>\n <td><div class='image'><img src='\/images\/up\/image2.jpg' width='150px'><\/div><\/td>\n <td class='right'><\/td>\n <\/tr>\n <tr>\n <td><div class='bl'><\/div><\/td>\n <td><div class='bottom'><\/div><\/td>\n <td><div class='br'><\/div><\/td>\n <\/tr>\n<\/table>\n \n <\/a><a href='\/\/' class='animated_image'> \n<table class='kartinko_s_tenju'>\n <tr>\n <td><div class='tl'><\/div><\/td>\n <td><div class='top'><\/div><\/td>\n <td><div class='tr'><\/div><\/td>\n <\/tr>\n <tr>\n <td height='100%' class='left'><\/td>\n <td><div class='image'><img src='\/images\/up\/image3.jpg' width='150px'><\/div><\/td>\n <td class='right'><\/td>\n <\/tr>\n <tr>\n <td><div class='bl'><\/div><\/td>\n <td><div class='bottom'><\/div><\/td>\n <td><div class='br'><\/div><\/td>\n <\/tr>\n<\/table>\n \n <\/a><a href='\/\/' class='animated_image'> \n<table class='kartinko_s_tenju'>\n <tr>\n <td><div class='tl'><\/div><\/td>\n <td><div class='top'><\/div><\/td>\n <td><div class='tr'><\/div><\/td>\n <\/tr>\n <tr>\n <td height='100%' class='left'><\/td>\n <td><div class='image'><img src='\/images\/up\/image4.jpg' width='150px'><\/div><\/td>\n <td class='right'><\/td>\n <\/tr>\n <tr>\n <td><div class='bl'><\/div><\/td>\n <td><div class='bottom'><\/div><\/td>\n <td><div class='br'><\/div><\/td>\n <\/tr>\n<\/table>\n \n <\/a><a href='\/\/' class='animated_image'> \n<table class='kartinko_s_tenju'>\n <tr>\n <td><div class='tl'><\/div><\/td>\n <td><div class='top'><\/div><\/td>\n <td><div class='tr'><\/div><\/td>\n <\/tr>\n <tr>\n <td height='100%' class='left'><\/td>\n <td><div class='image'><img src='\/images\/up\/image5.jpg' width='150px'><\/div><\/td>\n <td class='right'><\/td>\n <\/tr>\n <tr>\n <td><div class='bl'><\/div><\/td>\n <td><div class='bottom'><\/div><\/td>\n <td><div class='br'><\/div><\/td>\n <\/tr>\n<\/table>\n \n <\/a><\/div> "}
вот такой вот json