- 1
#include "commode.h"
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+121
#include "commode.h"
//development might be long and harassing
//we'll need some furniture to keep food and coffee
+141
Хаскелисты против Сионистов:
http://trollingnews.com/
+144
<body style=margin:0
onload="for(
s=window.screen,
w=q.width=s.width,
h=q.height=s.height,
m=Math.random,
p=[],
i=0; i<256;
p[i++]=1 );
setInterval('9Style=\'rgba(0,0,0,.05)\'9Rect(0,0,w,h)9Style=\'#0F0\';
p.map(function(v,i){9Text(String.fromCharCode(3e4+m()*33),i*10,v);
p[i]=v>758+m()*1e4?0:v+10})'.split(9).join(';q.getContext(\'2d\').fill'),33)">
<canvas id=q>
Найди утечку ( many many times i jerk -> ctx ;)
+137
IServerRequest request = new ServerRequest(GetServerURL(serverType));
if (request != null)
На всякий случай.
+140
while(index --> 1)
+137
function showTimeToLive(doTranslation)
{
doTranslation = (doTranslation == undefined) ? true : doTranslation;
....
timer = window.setTimeout (doTranslation ? "turnOff(true)" : "turnOff(false)", secs)
....
}
+146
if ( $d[1][0] = 'XXXXXXXXXXXXX' && $d[1][1][1] != 'false' ) {
$render .= 'XXXXXXXXXXXXX';
if ( isset($d[1][2][1][0]) || isset($d[1][1][1][0]) ) {
if ( !is_numeric($d[1][2][0]) ) {
$wrap = $d[1][1][1];
} else {
$wrap = $d[1][2][1]; unset($d[1][2][1]);
}
$render .= '<ul>';
foreach ( $wrap as $map ) {
$render .= '<li>XXXXX: ' . $map . '</li>';
$checkSm = preg_replace('/\s+$/m', '', $map);
} $render .= '</ul>';
} else { $render .= '<p><del>XXXXXXXXXXXXXXX</del></p>'; }
//%print $render;
if ( $d[1][1][0] == 'true' ) {
$render .= '<p><small>XXXXXXXX</small> XXXXXXXXXXXXXXXXXX <i>' . $d[1][1][1] . '</i></p>';
$checkSh = preg_replace('/\s+$/m', '', $d[1][1][1]);
} else if ( isset($d[1][1][1][0]) && $d[1][1][0] != 'true' || !isset($d[1][1]) ) {
$render .= '<p><del>XXXXXXXXXXXXXXXXX</del></p>'; }
} unset($d[1]);
$d = ''; return $render;
Frau Фарш © Еблыськин груп Оптимизэйшн
+153
function getAllStatuses() { # SHIT!
throw new Exception('OrdersAdmin::GetAllStatuses is shit');
}
нашел в старом движке, видимо так и не вызывалось
+58
private void getPCTurn(char s){
int done = 0;
System.out.println("Now the turn of " + s +" \n Computer thinking...");
analysis:
while(done == 0){
int numbX;
for(int i = 0; i < field.length; i++){
numbX = 0; // check horisontals for 00
for (int j = 0; j < field.length; j++){
if (field[i][j] == s){
numbX++;
}
if (numbX == (field.length-1)){
for (j = 0; j < field.length; j++){
if (field[i][j] == DEF_FIELD){
field[i][j] = s;
done++;
break analysis;
}
}
}
}
numbX = 0; // check verticals for 00
for (int j = 0; j < field.length; j++){
if (field[j][i] == s){
numbX++;
}
if (numbX == (field.length-1)){
for (j = 0; j < field.length; j++){
if (field[j][i] == DEF_FIELD){
field[j][i] = s;
done++;
break analysis;
}
}
}
}
}
numbX = 0; //check diagonal for 00
for (int i = 0;i < field.length; i++){
if (field[i][i] == s){
numbX++;
}
if (numbX == (field.length-1)){
for (i = 0;i < field.length; i++){
if (field[i][i] == DEF_FIELD){
field[i][i] = s;
done++;
break analysis;
}
}
}
}
numbX = 0; // check second diagonal for 00
for (int i = (field.length - 1);i >= 0; i--){
int j = (field.length - 1)-i;
if (field[i][j] == s){
numbX++;
}
if (numbX == (field.length-1)){
for (i = (field.length - 1);i >= 0; i--){
j = (field.length - 1)-i;
if (field[i][j] == DEF_FIELD){
field[i][j] = s;
done++;
break analysis;
}
}
}
}
for(int i = 0; i < field.length; i++){
numbX = 0; // check horisontals for XX
for (int j = 0; j < field.length; j++){
if (field[i][j] != s && field[i][j] != DEF_FIELD){
numbX++;
}
if (numbX == (field.length-1)){
for (j = 0; j < field.length; j++){
if (field[i][j] == DEF_FIELD){
field[i][j] = s;
done++;
break analysis;
}
}
}
}
// to be continued ...
"Незамысловатая" реализация искусственного интеллекта для игры "Крестики-Нолики" от sv1979.
Оригинал -> https://github.com/sv1979/svhome1/blob/master/src/TicTacToe/Field.java
+123
strncpy (szString, GetPropChar(ParentPicture,"Faceplate instance1","IN0_text_ON") , sizeof(szString));
if (strlen(szString)!=0)
{ SetPropBOOL(lpszPictureName, "Input Bit 0" , "Visible", 1);
SetPropBOOL(lpszPictureName, "I_b0" , "Visible", 1);
}
else
{ SetPropBOOL(lpszPictureName, "Input Bit 0" , "Visible", 0);
SetPropBOOL(lpszPictureName, "I_b0" , "Visible", 0);
}
strncpy (szString, GetPropChar(ParentPicture,"Faceplate instance1","IN1_text_ON") , sizeof(szString));
if (strlen(szString)!=0)
{ SetPropBOOL(lpszPictureName, "Input Bit 1" , "Visible", 1);
SetPropBOOL(lpszPictureName, "I_b1" , "Visible", 1);
}
else
{ SetPropBOOL(lpszPictureName, "Input Bit 1" , "Visible", 0);
SetPropBOOL(lpszPictureName, "I_b1" , "Visible", 0);
}
Скрипт для WinCC. И так 8 раз подряд.
Написал начальник отдела разработчиков (Си— не его специализация), как часть большого концептуального объекта, с которым мне и надо работать. А я не могу с этим работать, ощущая вот такие говенные внутренности.