- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
FROM: Glype 1.2
SITE: http://www.glype.com/download.php
FILE: themes/default/framedForm.inc.php
LINE: 23
#include script {
display:none;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+119
FROM: Glype 1.2
SITE: http://www.glype.com/download.php
FILE: themes/default/framedForm.inc.php
LINE: 23
#include script {
display:none;
}
+107
begin
writeln('Enter 1st number');
readln(a);
writeln('Enter 2st number');
readln(b);
writeln('Enter 3st number');
readln(c);
if a = b then if a = c then if b = c then ;
writeln('numbers are');
if a > b then if a = c then if b < c then
writeln('a Equally c and it is more b') ;
if a = b then if a > c then if b > c then
writeln('a Equally b and it is more c') ;
if a < b then if a < c then if b = c then
writeln('b Equally c and it is more a') ;
if a > b then if a > c then if b > c then
writeln('a it is more ') ;
if a > b then if a > c then if b < c then
writeln('a it is more ') ;
if a > b then if a > c then if b = c then
writeln('a it is more ') ;
if a < b then if a = c then if b > c then
writeln('b it is more ') ;
if a < b then if a > c then if b > c then
writeln('b it is more ') ;
if a < b then if a < c then if b > c then
writeln('b it is more ') ;
if a = b then if a < c then if b < c then
writeln('c it is more ') ;
if a > b then if a < c then if b < c then
writeln('c it is more ') ;
if a < b then if a < c then if b < c then
writeln('c it is more ') ;
Такое выдал один из моих учеников в 10м классе после того, как отказался учится рисовать блок-схемы и сказал, что сразу сможет писать. Задание заключалось в том, чтобы программа выводила большее из 3х введенных пользователем чисел.
+65
public int getSysEmailId() {
return super.getJdbcTemplate().queryForInt(
"SELECT id FROM sys_email");
}
Коллега порадовал. Говнонюанс в том, что sys_email имеет структуру (id SERIAL PRIMARY KEY, login text NOT NULL UNIQUE, password text NOT NULL).
+111
while (true)
{
if (sec > 10)
{
sec = 0;
// Вызор функции
}
else
sec++;
Thread.Sleep(1000);
}
Боевой код, который допиливаю(
+150
$id = $_GET['id'];
$id = (int) intval($id);
Чтобы уж наверняка :)
+953
void Update()
{
float anime = (animation.wrapMode = WrapMode.Loop);
anime = false;
}
Хентай повышенной концентрации.
+142
private void run() throws Exception {
Scanner s = new Scanner(new File("input.txt"));
PrintWriter p = new PrintWriter(new File("output.txt"));
int n = s.nextInt();
int sum = 0;
init();
for(int i = 1; i <= n; i++) {
sum += find(i);
}
p.print(sum);
s.close();
p.close();
}
private void init() {
for(int i = 0; i < 100; i++) {
pow_2[i] = (int) Math.pow(2, i + 1);
}
for(int i = 0; i < 100; i++) {
pow_3[i] = (int) Math.pow(3, i + 1);
}
for(int i = 0; i < 100; i++) {
pow_4[i] = (int) Math.pow(4, i + 1);
}
for(int i = 0; i < 100; i++) {
pow_5[i] = (int) Math.pow(5, i + 1);
}
}
private int find(int num) {
for(int i = 0; i < 100; i++) {
if(pow_2[i] == num) return 2;
if(num > pow_2[99]) break;
}
for(int i = 0; i < 100; i++) {
if(pow_3[i] == num) return 3;
if(num > pow_3[99]) break;
}
for(int i = 0; i < 100; i++) {
if(pow_4[i] == num) return 4;
if(num > pow_4[99]) break;
}
for(int i = 0; i < 100; i++) {
if(pow_5[i] == num) return 5;
if(num > pow_5[99]) break;
}
return 0;
}
Говнолаба... есть идеи как оптимизировать по скорости?
+159
QSqlQueryModel model,model1,model2;
...
model2.setQuery("SELECT * FROM cardInfoChange");
while(model2.canFetchMore())
model2.fetchMore();
...
for(int i = 0; i < model2.rowCount(); i++)
{
QString t = model2.record(i).value(1).toString().toUtf8()+
";"+model2.record(i).value(2).toString().toUtf8()+";"+model2.record(i).value(3).toString().toUtf8()+
";"+model2.record(i).value(4).toString().toUtf8()+
";"+model2.record(i).value(5).toString().toUtf8()+
";"+model2.record(i).value(6).toString().toUtf8()+
";"+model2.record(i).value(7).toString().toUtf8()+
";"+model2.record(i).value(8).toString().toUtf8()+
";"+model2.record(i).value(9).toString().toUtf8()+
";"+model2.record(i).value(10).toString().toUtf8()+
";"+model2.record(i).value(11).toString().toUtf8()+
";"+model2.record(i).value(12).toString().toUtf8()+
";"+model2.record(i).value(13).toString().toUtf8()+
";"+model2.record(i).value(14).toString().toUtf8()+
";"+model2.record(i).value(15).toString().toUtf8()+
";\n";
f.write( t.toAscii());
}
Продолжаем стрелять по воробьям из пушки.
Особое внимание на строки 4 и 5 так как QSqlQueryModel предназначена для вывода отображения в QTableView она не загружает все данные сразу а делает это постепенно.
Ну и напоследок шедевральный способ записи полученных данных в файл.
+106
public void CheckMemoStyle(bool isChecked)
{
if (isChecked)
{
memoStyleLayoutCntrl.Selected = true;
}
else
{
memoStyleLayoutCntrl.Selected = false;
}
}
memoStyleLayoutCntrl.Selected = isChecked; уже не модно?
+146
class BbCod{
function BbCod(){
}
static function BbB($text){
if (is_array($text)) {
$text = '<b>'.$text[1].'</b>';
}
return preg_replace_callback("~\[b]((?:[^[]|\[(?!/?b])|(?R))+)\[/b]~is", "BbCod::BbB" , $text);
}
static function BbI($text){
if (is_array($text)) {
$text = '<i>'.$text[1].'</i>';
}
return preg_replace_callback("~\[i]((?:[^[]|\[(?!/?i])|(?R))+)\[/i]~is", "BbCod::BbI" , $text);
}
// ...
function Bb($text, $param = array()){
if(!isset($param['b']) || $param['b'] !== false) $text = $this->BbB($text);
if(!isset($param['i']) || $param['i'] !== false) $text = $this->BbI($text);
if(!isset($param['u']) || $param['u'] !== false) $text = $this->BbU($text);
if(!isset($param['ol']) || $param['ol'] !== false) $text = $this->BbOl($text);
if(!isset($param['ul']) || $param['ul'] !== false) $text = $this->BbUl($text);
if(!isset($param['li']) || $param['li'] !== false) $text = $this->BbLi($text);
if(!isset($param['quote']) || $param['quote'] !== false) $text = $this->BbQuote($text);
if(!isset($param['left']) || $param['left'] !== false) $text = $this->BbLeft($text);
if(!isset($param['right']) || $param['right'] !== false) $text = $this->BbRight($text);
if(!isset($param['center']) || $param['center'] !== false) $text = $this->BbCenter($text);
if(!isset($param['justify']) || $param['justify'] !== false) $text = $this->BbJustify($text);
if(!isset($param['size']) || $param['size'] !== false) $text = $this->BbSize($text);
if(!isset($param['color']) || $param['color'] !== false) $text = $this->BbColor($text);
if(!isset($param['fright']) || $param['fright'] !== false) $text = $this->BbFRight($text);
if(!isset($param['fleft']) || $param['fleft'] !== false) $text = $this->BbFLeft($text);
if(!isset($param['table']) || $param['table'] !== false) $text = $this->BbTable($text);
if(!isset($param['td']) || $param['td'] !== false) $text = $this->BbTd($text);
if(!isset($param['th']) || $param['th'] !== false) $text = $this->BbTh($text);
if(!isset($param['tr']) || $param['tr'] !== false) $text = $this->BbTr($text);
if(!isset($param['br']) || $param['br'] !== false) $text = $this->BbBr($text);
if(!isset($param['hr']) || $param['hr'] !== false) $text = $this->BbHr($text);
if(!isset($param['youtube']) || $param['youtube'] !== false) $text = $this->BbYoutube($text);
if(!isset($param['img']) || $param['img'] !== false) $text = $this->BbIms($text);
if(!isset($param['src']) || $param['src'] !== false) $text = $this->BbSrc($text);
if(!isset($param['mail']) || $param['mail'] !== false) $text = $this->BbMail($text);
return $text;
}
}
// end class
Писал в само начале осваивания ООП в php. И причем такое ощущения что бухой писал)