These are some really cool or obfuscated code snippets for your amusement. We didn't want to rate them, so the order doesn't mean anything at all :) Just to make sure that there's no misunderstanding: This code really is/was in the KDE CVS. - From KIllustrator (now Kontour), KIllustrator_doc.cc: bool KIllustratorDocument::completeSaving (KoStore* store) { if (!store) return true; return true; } - From Kivio, main.cpp: if (!app.start()) { delete splash; return 1; } sleep(3); delete splash; app.exec(); - From Qt 2.2.1 (src/canvas/qcanvas.cpp): static int gcd(int a, int b) { // ### Should use good method, but not speed critical. int r = QMIN(a,b); while ( a%r || b%r ) r--; return r; } - Actual code from Corel Explorer (committed accidentally), can be found at http://kdewebcvs.nebsllc.com/cgi-bin/cvsweb.cgi/kdebase/kioslave/csmb/Libraries/SambaNetworking/CorelExplorer/Attic/mainfrm.cpp if (!strncmp((LPCSTR)Destination #ifdef QT_20 .latin1() #endif , "file:", 5)) { GoItem((LPCSTR) Destination #ifdef QT_20 .latin1() #endif + 5); - Found in koffice/filters/kocrypt/kocryptimport.cc, not really code, but still funny: // OK. Get this. I'm not going to add 4 lines of code to this thing and // nest it in another [infinite] loop just so someone can feel warm and // fuzzy because they found a complicated way to avoid using a perfectly // fine goto. This is my code and I like the goto just the way it is. // Deal with it. start: - Found in qt/src/kernel/qlayoutengine.cpp - also "just" a comment: /* Do a trial distribution and calculate how much it is off. If there are more deficit pixels than surplus pixels, give the minimum size items what they need, and repeat. Otherwise give to the maximum size items, and repeat. I have a wonderful mathematical proof for the correctness of this principle, but unfortunately this comment is too small to contain it. */ - From qt/plugins/src/imageformats/jpeg (3.0 beta 4): if ( name.lower() != "JPEG" ) - From kdebase/kate/view/kateviewdialog.cpp (KDE 2.2) (m_search is a QComboBox): ((QLineEdit *) (m_search->children()->getFirst()))->selectAll(); - From koffice/kspread/kspread_cell.cc (KOffice 1.1), trying to save a date: tmp=tmp.setNum(m_Validity->dateMin.year())+"/"+ tmp.setNum(m_Validity->dateMin.month())+"/"+ tmp.setNum(m_Validity->dateMin.day()); - From kdenetwork/kmail/kmfoldercachedimap.cpp (HEAD post 3.1) (http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdenetwork/kmail/kmfoldercachedimap.cpp?annotate=1.1.2.62) emit newState( i18n("%1").arg(name()) , ...