- 1
- 2
if ((float)TF1.getText()>(float)(TF2.getText()){
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+73
if ((float)TF1.getText()>(float)(TF2.getText()){
}
Вот так вот приводят типы:)
http://www.sql.ru/forum/actualthread.aspx?bid=38&tid=551373&hl=
+132
int cont[15];
bool stop_access = false;
struct cel container[MAX_SIZE];
struct termios savetty;
struct termios tty;
pthread_t thread[100];
pthread_mutexattr_t muattr;
pthread_mutex_t count_mutex;
int icn=0;//Number elements in container
static int x;
static int y;
void* stack;
pthread_mutex_unlock(&count_mutex);
sleep(1);
};
return (void*)1;
};
void* main_thread(void *arg){
while(true){
sleep(1);
char ic=getchar();
if(ic=='\n'){
printf("Thread\tnumber elements\n");
for(int i=0;i<=x;i++)
pthread_cancel(thread[i]);
for(int i=0;i<=x;i++){
printf("%d ",i);
int cn=0;
for(int j=0;j<=icn;j++){
if(container[j].thrnm==i){ cn++; };
};
printf("\t%d\n",cn);
};
printf("container number element %d\n",icn);
exit(0);
};
};
};
int main(int argc, char * argv[])
{
icn=0;
if(argc<2){printf("1 arg n number of threads, 2 argument maximum number element in container");exit(0);};
x=atoi(argv[1]);
y=atoi(argv[2]);
if(x>64){printf("Число потоков должно быть меньше 64\n");exit(0);}
printf("x %d y %d\n",x,y);
//mutex initialization
int ret;
ret = pthread_mutexattr_init(&muattr);
//switch the keyboard to noncanonical mode
pid_t pt=tcgetsid(0);
// char *var=ctermid (NULL);
printf("pid %d\n",pt);
tcgetattr (0, &tty);
savetty = tty;
tty.c_lflag &= ~(ICANON);
tty.c_cc[VMIN] = 1;
tcsetattr (0, TCSAFLUSH, &tty);
pthread_t mthr;
pthread_attr_t mattr;
pthread_attr_init(&mattr);
pthread_attr_setdetachstate(&mattr,PTHREAD_CREATE_DETACHED);
int mres = pthread_create(&mthr, &mattr, main_thread, NULL);
if (mres == 0) {
printf("Creating main thread\n");
sleep(0.7);
} else {
perror("Creating the main first thread");
return EXIT_FAILURE;
}
for(int i=0;i<=x;i++){
int id1, id2, result;
id1 = 1;
pthread_attr_t attr;
pthread_attr_init(&attr);
// отсоединенный поток - не ждем его возврата
pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_DETACHED);
result = pthread_create(&thread[i], &attr, thread_func, &i);
if (result == 0) {
printf("Creating thread %d\n",i);
sleep(1);
} else {
perror("Creating the first thread");
−97
hash.to_a.select{|elem| elem[1].map{|st| st.from}.include? state}.map{|elem| elem[1].map{|inner| inner.to}.uniq}.flatten
+147
void
syslog(int pri, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vsyslog(pri, fmt, ap);
va_end(ap);
}
......................................
void
vsyslog(int pri, const char *fmt, va_list ap)
{
vsyslog_r(pri, &sdata, fmt, ap);
}
....................................
void
vsyslog_r(int pri, struct syslog_data *data, const char *fmt, va_list ap)
{
int cnt;
char ch, *p, *t;
time_t now;
int fd, saved_errno, error;
#define TBUF_LEN 2048
#define FMT_LEN 1024
char *stdp = NULL, tbuf[TBUF_LEN], fmt_cpy[FMT_LEN];
int tbuf_left, fmt_left, prlen;
#define INTERNALLOG LOG_ERR|LOG_CONS|LOG_PERROR|LOG_PID
/* Check for invalid bits. */
if (pri & ~(LOG_PRIMASK|LOG_FACMASK)) {
if (data == &sdata) {
syslog(INTERNALLOG,
"syslog: unknown facility/priority: %x", pri);
} else {
syslog_r(INTERNALLOG, data,
"syslog_r: unknown facility/priority: %x", pri);
}
pri &= LOG_PRIMASK|LOG_FACMASK;
}
.......................
}
......................
Из исходников Bioninc - Android libc.
В реализации сислога, в случае ошибки, вызывается syslog
+163
<?
$url = file_get_contents("url страницы");
$js = "<script";
$endjs = "</script>";
$test = 0;
$i = 1;
while($test == 0)
{
$q = strpos($url, $js);
$q++;
$y = strpos($url,$endjs);
$y++;
$url = substr($url, $q, $y);
if($url == false)
{
$test = 1;
}else{
$i++;
}
}
echo"<br>Удалено скриптов: " .$i. "<br>";
$url = htmlspecialchars("$url", ENT_QUOTES);
echo $url;
?>
программа удаляющую полностью все javascript
+165
function writeln($str) {
echo $str."\n";
}
function readln() {
$handle = fopen ("php://stdin","r");
$line = fgets($handle);
fclose($handle);
return $line;
}
Функции для реализации ввода и вывода PHP-CGI в режиме консоли
−181
if str(type(code_text)) == "<type 'str'>":
code = self.errors[code_text]
else:
code = code_text
Случайно найдено на просторах гуглокода
−130
echo "Ghbdtn? rfr ltkf&" | sed "s/.*/\L&/;y|f,dult~;pbqrkvyjghcnea[wxioms]'.z&?|абвгдеёжзийклмнопрстуфхцчшщьыъэюя?,|"
Транслирует английскую раскладку в русскую.
+137
<a id="top_home_link" class="top_home_link fl_l" href="/" onclick="return nav.go(this, event)" class="fl_l" style=""></a>
Duplicate attribute class.
Простите за контактик, не удержался.
+160
<?php
session_start();
if(isset($_GET['gc'])){
$s="";
$s = rand(0,10).rand(0,10).rand(0,10).rand(0,10).rand(0,10).rand(0,10);
$ct=mktime();
$_SESSION['tm']=$ct;
echo "<a href=\"http://netelis.hmsite.net/cg.php?cn=$s\">http://localhost/cg.php?cn=$s</a>";
$_SESSION['ccc']=$s;
} elseif(isset($_GET['cn']) && isset($_SESSION['tm'])){
$tt=mktime();
$dt=$tt-$_SESSION['tm'];
if($dt<=25){
if(isset($_SESSION['ccc'])){echo "<p align=center><FORM name=cp method=POST action=\"\"><br>"; echo $_SESSION['ccc']."<br>";echo "Enter the text you see<br>";}
echo "<input name=cpt type=text>";
echo "<input name=sub type=submit>";
echo "</FORM></p>";} else {echo "The link was broken";};
};
if(isset($_POST['cpt'])){
if(isset($_SESSION['ccc'])){
if($_SESSION['ccc']==$_POST['cpt']){
echo "Captcha is valid";
};
session_destroy();
};
};
?>
Проверочный код