- 1
- 2
- 3
- 4
- 5
- 6
- 7
int MyNewClass::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
return _id;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+150
int MyNewClass::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
return _id;
}
Из Qt 4.8.0, генерится сие чудо и находится в файле moc_ИмяВашегоКласса.
+140
http://govnokod.ru/kucha
kucha - транслит
KO
+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 она не загружает все данные сразу а делает это постепенно.
Ну и напоследок шедевральный способ записи полученных данных в файл.