![]() |
Re: Eure besten Quellcode Kommentare...
Eigentlich ist es kein Kommentar, aber es steht als Präambel in einem aktuellen Projekt:
Delphi-Quellcode:
Es ist, ganz nebenbei, der einzige Kommentar...
// DONT try this at home
|
Re: Eure besten Quellcode Kommentare...
ohje... bin grad darüber gestolpert.... :angel2:
Delphi-Quellcode:
// UNGENAU!!! - Begin
NextUser.Deactivated := ((YearA - YearB) * 365 + (MonthA - MonthB) * 30 + (DayA - DayB) < FMaxDeactivatedDays); // UNGENAU!!! - End cheers... |
Re: Eure besten Quellcode Kommentare...
Aus jedem meiner Projekte:
Delphi-Quellcode:
:mrgreen:
function XYZ(hm? : Integer): boolean;
begin // dödel finden der mir das programmiert end; |
Re: Eure besten Quellcode Kommentare...
Aus einem Python-Programm, das u.a. mit dem Dualsystem rechnet.
Code:
Ok, ist kein Kommentar, aber der Quellcode ist trotzdem genial. :mrgreen:
def add_bin(num1, num2):
return dec_to_bin(bin_to_dec(num1) + bin_to_dec(num2)) Mit freundlichen Grüßen, Valle |
Re: Eure besten Quellcode Kommentare...
Etwas habe ich da auch noch anzubieten:
Code:
[...]
do { try { x = Integer.valueOf(System.console().readLine()); } catch (NumberFormatException e) { // Fehler vor dem Bildschirm: // Der Benutzer scheint das Wort "Ganzzahl" nicht zu kennen // Fehlerbehandlung: Einfach ignorieren! } catch (Exception e) { // Wer weiß, was sonst noch fieses passiert... System.err.println("Fehler beim Einlesen der Standardeingabe"); } } while (x < l || x > h); [...] |
Re: Eure besten Quellcode Kommentare...
hab hier auch mal was gefunden...
Delphi-Quellcode:
nicht unbedingt nötig, aber mann kanns ja mal machen... :wink:
ftp.Port:=21;
ftp.Connect; sleep(100); //nicht unbedingt nötig ftp.ChangeDir('html'); ftp.ChangeDir('3-test'); |
Re: Eure besten Quellcode Kommentare...
Nur als kleine Anmerkung an den Code oben:
Die Indys arbeiten blockierend (synchron), das heißt, dass der Code hinter Connect erst ausgeführt wird, wenn auch wirklich verbunden ist. Ein einfaches:
Delphi-Quellcode:
genügt.
ftp.connect;
if ftp.connected then begin ftp.changedir(...); end; |
Re: Eure besten Quellcode Kommentare...
Zitat:
Das sleep wird vor allem keine genau definierte Pause sein, weil der Timer dafür zu ungenau ist. Es gibt WaitFor... oder auch While-Schleifen oder vieles Anderes, was man einsetzen kann. Aber sleep ist definitiv der falsche Weg. |
Re: Eure besten Quellcode Kommentare...
Fast alle Pausen sind unnötig. Wenn ich mit den Sockets direkt in einer Reihe zig verschiedene Verbindungen aufbauen will, erzeuge ich mir ein Socket, gebe es frei, erzeuge ein neues usw. Anstelle davon könnte man auch ein Pause machen, da ein Socket regelrecht Erholung benötigt, allerdings kostet das extrem Zeit -> Pausen sind nicht gut.
|
Re: Eure besten Quellcode Kommentare...
/ironie on
Also ich gönne meinen Socken als auch ne Pause. Ich hänge sie am Abend über die Stuhllehne, dann haben sie bis zum Morgen ausgelüftet und ich kann sie wieder anziehen. ;-) /ironie off |
Re: Eure besten Quellcode Kommentare...
In irgendeinem Projekt hatte ich mal:
Delphi-Quellcode:
Und woanders stand das mal:
// Closed-Source - Wozu Kommentare ?
Delphi-Quellcode:
{
9:03:41 - Fatboy Slim vs. Offspring - Pretty Fly For A White Guy 9:07:06 - The Offspring - Hard Sex 9:07:23 - The Offspring - Parodie de Britney Spears 9:10:24 - The Offspring - The end of the line 9:14:23 - The Offspring - Have you ever 9:18:13 - The Offspring - She's got issues 9:21:14 - The Offspring - The Kids aren't alright 9:24:07 - The Offspring - Why don't you get a job 9:26:46 - The Offspring - Hey Joe 9:28:45 - The Offspring - The Blurb 9:31:32 - The Offspring - Come out swinging 9:33:49 - The Offspring - Conspiracy of one 9:36:38 - The Offspring - Dammit, I changed again 9:38:32 - The Offspring - Living In Chaos 9:42:11 - The Offspring - Million miles away 9:44:56 - The Offspring - One fine day 9:48:37 - The Offspring - Original prankster 9:52:55 - The Offspring - Self Esteem 9:56:18 - The Offspring - Want you bad 9:59:32 - The Offspring - Konzerte - Why 10:03:27 - The Offspring - Defy You 10:05:46 - The Offspring - I Wanna Be Sedated 10:07:45 - The Offspring - Leave it Behind 10:11:11 - The Offspring - Smash It Up 10:13:59 - The Offspring - Total Immortal 10:16:11 - The Offspring - Total Immortal 10:19:12 - The Offspring - Total Immortal 10:22:48 - The Offspring - Total Immortal 10:25:24 - The Offspring - Jennifer lost the War 10:27:37 - The Offspring - Elders 10:30:11 - The Offspring - Out on Patrol 10:33:00 - The Offspring - Crossroads 10:36:12 - The Offspring - Demons 10:38:50 - The Offspring - Beheaded 10:41:59 - The Offspring - Teheran 10:44:12 - The Offspring - A thousand Days 10:47:38 - The Offspring - Blackball 10:50:51 - The Offspring - I'll be waiting 10:54:14 - The Offspring - Kill the President 10:54:58 - The Offspring - Disclaimer 10:57:53 - The Offspring - The Meaning of Life 11:02:24 - The Offspring - Mota 11:05:10 - The Offspring - Me & My Old Lady 11:07:07 - The Offspring - Cool to Hate 11:11:00 - The Offspring - Leave It Behind 11:11:48 - The Offspring - Gone Away 11:13:40 - The Offspring - I Choose 11:16:15 - The Offspring - Intermission 11:18:07 - The Offspring - All I Want 11:22:32 - The Offspring - Way Down the Lin 11:28:56 - The Offspring - Change The World 11:33:25 - The Offspring - Gone Away 11:36:22 - The Offspring - Mota 11:39:14 - The Offspring - Smash 11:41:41 - Crazy Town - Smash 11:45:59 - The Offspring - Self esteem 11:49:43 - The Offspring - Bad Habit 11:53:01 - The Offspring - Come Out and Play 11:56:27 - The Offspring - Genocide 12:00:13 - The Offspring - Gotta get away 12:02:56 - The Offspring - It'll be a long Time 12:04:59 - The Offspring - Killboy Powerhead 12:06:16 - The Offspring - So Alone 12:09:34 - The Offspring - Something To Believe In 12:11:46 - The Offspring - What happened to you 12:14:18 - The Offspring - Session 12:18:19 - The Offspring - We are one 12:21:35 - The Offspring - Kick him when he's down 12:24:31 - The Offspring - Take It Like a man 12:27:37 - The Offspring - Get It right 12:31:26 - The Offspring - Dirty Magic 12:34:48 - The Offspring - Hyodermic 12:37:31 - The Offspring - Burn it up 12:40:54 - The Offspring - No Hero 12:43:39 - The Offspring - L.A.P.D. 12:46:40 - The Offspring - nothing from something 12:49:17 - The Offspring - Forever and a day 12:52:04 - The Offspring - Come out swinging 12:54:21 - The Offspring - Conspiracy of one 12:57:10 - The Offspring - Dammit, I changed again 13:00:39 - The Offspring - Living in chaos 13:03:52 - The Offspring - Americana 13:06:43 - The Offspring - Feelings 13:10:39 - The Offspring - Have you ever 13:12:44 - The Offspring - No Brakes 13:23:02 - The Offspring - Pay the man 13:26:11 - The Offspring - Pretty fly 13:29:59 - The Offspring - She's hot issues 13:32:12 - The Offspring - Staring the sun 13:35:12 - The Offspring - The End of the Lane 13:38:12 - The Offspring - The kids aren't alright 13:41:08 - The Offspring - Walla Walla 13:44:00 - The Offspring - Why don't you get a Job 13:45:07 - The Offspring - Neocon 13:48:26 - The Offspring - The Noose 13:50:50 - The Offspring - Long Way Home 13:53:39 - The Offspring - Hit that 13:57:12 - The Offspring - Race Against Myself 13:59:27 - The Offspring - (Can't Get My) Head Around You 14:02:26 - The Offspring - The Worst Hangover Ever 14:05:05 - The Offspring - Never Gonna Find Me 14:08:26 - The Offspring - Lightning Rod 14:11:50 - The Offspring - Spare Me the Details 14:13:33 - The Offspring - Da Hui 14:16:06 - The Offspring - When You're in Prison } |
Re: Eure besten Quellcode Kommentare...
Hab hier auch noch was :mrgreen:
Delphi-Quellcode:
// Falls jemand auf die besonders dämliche Idee kommt während des Öffnens
// nochmal zu öffnen... |
Re: Eure besten Quellcode Kommentare...
Delphi-Quellcode:
:mrgreen:
//Sieht blöd aus, aber das muss so sein
|
Re: Eure besten Quellcode Kommentare...
Nicht von mir, aber ich muss mich trotzdem drum kümmern:
Delphi-Quellcode:
If Not assigned(fCurrentFrame) Then
Begin // tja End; |
Re: Eure besten Quellcode Kommentare...
Von einem Kollegen:
Delphi-Quellcode:
Dann fand ich woanders noch:
//Modified by xxx, quick and very very dirty, but what the hell, this code is tainted anyway
Delphi-Quellcode:
Steffen
{$IFDEF KYLIX_IS_DUMB}
.... {$ENDIF} |
Re: Eure besten Quellcode Kommentare...
Den fand ich auch gut:
Delphi-Quellcode:
//lass mich überlegen...
einige Zeilen Code //Nein! |
Re: Eure besten Quellcode Kommentare...
Das hier habe ich gerade auf
![]()
Code:
Mit freundlichen Grüßen,
c++; /* this makes c bigger but returns the old value */
Valle |
Re: Eure besten Quellcode Kommentare...
Hab auch was schönes von mir gefunden:
Code:
Is ein Assemblerprogramm wo nur auf Interrupts gewartet wird.
Schleife: Jmp Schleife ; Hauptprogramm ;)
|
Re: Eure besten Quellcode Kommentare...
Gerade gesehen:
Delphi-Quellcode:
// This one's really fucked up.
|
Re: Eure besten Quellcode Kommentare...
Hab ich grade in 'nem VB-Code gefunden:
Code:
Dieser Warnhinweis kommt aber früh :mrgreen:
' ***************************************************************************
' SECURITY WARNING ' ' This code is not for export to any country prohibited by the U.S. ' Export Administration Act and regulations thereunder. ' ' This technology may not be downloaded, exported or re-exported: ' (i) into (or to a national or resident of) Afghanistan (Taliban), ' Cuba, Iran, Iraq, Libya, North Korea, Sudan, or Syria or any other ' country which the U.S. has embargoed goods (List of countries ' current as of August 2001 but is subject to change); or (ii) to ' anyone on the U.S. Treasury Department's list of Specially Designated ' Nationals or the U.S. Commerce Department's Table of Denial Orders. ' ' *************************************************************************** |
Re: Eure besten Quellcode Kommentare...
Gefunden in der Hilfe zu CoDeSys. (XOR)
Zitat:
|
Re: Eure besten Quellcode Kommentare...
aus meinem Old Snakey-Projekt:
Delphi-Quellcode:
tja, dann findet man den abschnitt garantiert!
(********************************************)
(********************************************) (*** ***) (*** I N I T I A L I S I E R U N G E N ***) (*** ***) (********************************************) (********************************************) |
Re: Eure besten Quellcode Kommentare...
Immer wieder schön:
Delphi-Quellcode:
(* wenns knallt, nochmal klicken *)
|
Re: Eure besten Quellcode Kommentare...
Zitat:
|
Re: Eure besten Quellcode Kommentare...
goto ist ja verschriehen, also :tongue: :
Delphi-Quellcode:
asm JMP START end; //no goto XP
|
Re: Eure besten Quellcode Kommentare...
Auch nich schlecht :):
Delphi-Quellcode:
try
[...] except //shit happens end; |
Re: Eure besten Quellcode Kommentare...
Delphi-Quellcode:
und hier noch einer aus dem Code eines Freundes:
//OMG!!!
//Und das soll funktionieren???
Delphi-Quellcode:
:stupid:
//Uhjujui, da hat sich aber jemande
//selbst übertroffen :) |
Re: Eure besten Quellcode Kommentare...
Vom Kollegen:
Code:
// PDF download
// Download start event public function onDownloadStart(evt:Event):void { var fr: FileReference = evt.currentTarget as FileReference; try { fileRefModel.name = fr.name; fileRefModel.size = fr.size; textDownload.visible = true; } catch (err:*) { // uh oh, an error of sorts. } } |
Re: Eure besten Quellcode Kommentare...
Gerade drüber gestolpert:
Delphi-Quellcode:
// Robert Lemke: Was bin ich ?
m_IsSmallController := false; |
Re: Eure besten Quellcode Kommentare...
Gerade eben habe ich das geschrieben, ohne jedoch sofort an diesen Thread zu denken:
Delphi-Quellcode:
asm
//... @@NegativeArraySize: mov [0], 0 //uh, maybe there is a better way to throw an //exception //... @@ArrayIndexOutOfBounds: mov [0], 0 //still a strange way to notify of an error end; |
Re: Eure besten Quellcode Kommentare...
Delphi-Quellcode:
...eben gefunden ! Ich frage mich nur, warum ich das auskommentiert habe wenns funktioniert :gruebel: Es gibt Sachen, die muß man nicht verstehen... :gruebel:
// (funktioniert) ZQueryFilter.SQL.Add('and BEZEICHNUNG in (select BEZEICHNUNG from WARTUNGP where TATIGKEIT = :Tatigkeit and STATUS = 3 and NUMMER = :Nummer) ');
|
Re: Eure besten Quellcode Kommentare...
Zwar kein Kommentar, aber trotzdem genial (gerade in einem Stückchen VB gefunden):
Code:
If count > 0 Then
Set pEntry = pEntries(0) MsgBox pEntry.DN Else MsgBox "Njet gfundovski" End If |
Re: Eure besten Quellcode Kommentare...
Delphi-Quellcode:
// Hat der Dabbes das Passwort vergessen?
if ($passwort == '') { echo ...; } |
Re: Eure besten Quellcode Kommentare...
Hallo,
gut das ich mich an diesen Thread erinnert habe... Hier ein wirklich weitsichtiger Kommentar aus der Unit XSBuiltIns (Borland SOAP Support):
Delphi-Quellcode:
Wer will da noch behaupten das Delphi tot ist?
TXSBaseDate = class
private { place holder for future work supporting years with greater than 4 digits } FAdditionalYearDigits: Word; Axel |
Re: Eure besten Quellcode Kommentare...
Meine besten Kommentare sind immer die aus dem Info GK gewesen. Da kann man sich nicht wirklich konzentrieren, nicht mal um Kommentare zu schreiben (wenn jemand an der Leinwand im Unterricht CS spielt und der Lehrer zuguckt). Naja damals war das toll mit 5 Leuten im Kurs. :D
Wir hatten im Schnitt 1x in der Woche. Wenn es dann hieß PCs ausmachen und ich saß an einem Problem, habe ich über die Problem-Prozedur geschrieben:
Delphi-Quellcode:
1 Woche später: WTF?
//WICHTIG!!!!! UNBEDINGT MACHEN!
:D:D:D:D Sowas passiert mir andauernd, dass ich vergesse hinzuschreiben, wo ich einen Fehler habe. Denn meistens dauert es dann wieder ne Weile, bis ich weiß, was nicht funktioniert hat. |
Re: Eure besten Quellcode Kommentare...
Hi,
gerade mal nen Code durchgesehen:
Delphi-Quellcode:
Man beachte das Kommentar im alten Code - und dazu die Lösung im neuen Code.
//alter Code:
try //Hmm wie sonst an den string kommen außer über noch schlimmere umwege? RaiseLastOSError; except on E: Exception do ShowMessage('Das Installationsprogramm konnte nicht gestartet werden!'#13 + E.Message); end; //neuer Code: ShowMessage('Das Installationsprogramm konnte nicht gestartet werden!'#13 + SysErrorMessage(GetLastError)); Wer Hintergrundinfos will: Es handelt sich um den Rückgabewert von CreateProcess, welcher false ist. Was genau schief lief, soll dem User angezeigt werden. Dazu muss man irgendwie an die Fehlermeldung kommen, die Delphi in der Exception anzeigt. Ein Glück, dass es Shift+Klick gibt. :) Mfg FAlter |
Re: Eure besten Quellcode Kommentare...
Code:
# Profile display not done jet, but guests must not know that
O::Error('Profil is private', 'Error'); |
Re: Eure besten Quellcode Kommentare...
Zitat:
|
Re: Eure besten Quellcode Kommentare...
J oder Y, was ist da schon der Unterschied :zwinker:
|
Re: Eure besten Quellcode Kommentare...
Code:
wtf ...
... // thie makes it exiting -- in other words: unstable !!!!!
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:06 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz