What are some code comments that you guys have found that legitimately made you smile...

What are some code comments that you guys have found that legitimately made you smile? I found pic related in some company software today and I'm sure it's going to be deleted by [REDACTED] before it can be allowed to brighten any more days, but hey, it was fun while it lasted.

Attached: DevelopingALisp.png (1638x132, 13.5K)

Other urls found in this thread:

github.com/enigma-dev/enigma-dev/blob/6196449e986765f568098ede47e6a62621701a3f/ENIGMAsystem/SHELL/Universal_System/instance.cpp#L109
en.wikipedia.org/wiki/Fast_inverse_square_root
graphics.stanford.edu/~seander/bithacks.html
github.com/yaspr/bitwise/blob/master/bitwise_util.c
cl.cam.ac.uk/~am21/hakmemc.html
twitter.com/karliekloss/status/697837478141632512
twitter.com/AnonBabble

There's a line somewhere in react.js that says "DO NOT CHANGE THIS OR YOU WILL BE FIRED!".

Not a comment, but this was very unexpected:
github.com/enigma-dev/enigma-dev/blob/6196449e986765f568098ede47e6a62621701a3f/ENIGMAsystem/SHELL/Universal_System/instance.cpp#L109

printf("FUCK! FUCK! FUCK! FUCK! FUCK! FUCK! FUCK! FUCK! FUCK! FUCK! FUCK! FUCK! FUCK!\nFFFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUCK!\nFUCK! %p ISN'T ON THE GOD DAMNED MOTHER FUCKING STACK!", (void*)a); if (a != (enigma::object_basic*)enigma::instance_event_iterator->inst)printf("FUCKING DAMN IT! THE ITERATOR CHANGED FROM POINTING TO %p TO POINTING TO %p\n", (void*)a, (void*)(enigma::object_basic*)enigma::instance_event_iterator->inst);
wew

Win32::Sleep(15); # or Win95 will crash

One of the first times I witnessed SJWs at work was back in 2000. There was a guy that made a popular modification for a particular forum software. His modification was so popular almost every forum on the internet was using it at that point. A year or so after it became popular some SJW discovered that every other line in the source code was
He posted a thread about it which kicked off a huge flame war as people piled in. After a few days the guy that made the modification got so pissed off he took down all copies of it and refused to work on it anymore. No one ever made a proper replacement so to this day people are begging someone to port it to the latest version but everyone refuses to do the work out of respect for him.

top kek

Pretty much all the comments in TempleOS.

Nice LARP, faggot.
TempleOS has very little comments, and the few there are have nothing hilarious.
See this example taken from HomeKeyPlugIns.HC.Z
//Place this file in /Home and change//anything you want.U0 TimeIns(){ CDate cdt; cdt=Now; "$IV,1$----%D %T----$IV,0$\n",cdt,cdt;}Bool MyPutKey(I64 ch,I64 sc){//ch=ASCII; sc=scan_code //See Char for definition of scan codes. //See Key Allocations. //See Keyboard Devices. //You can customize keys. This routine //is called before the main editor //key hndlr DocPutKey(). //You can intercept any key. //Return TRUE if you completely //handled the key. I64 i; U8 *st1,*st2; if (sc&SCF_ALT && !(sc&SCF_CTRL)) { switch (ch) { case 0: switch (sc.u8[0]) { case SC_F1: if (sc&SCF_SHIFT) { if (sc&SCF_KEY_DESC) KeyDescSet("Dol /LTPURPLE"); else "$LTPURPLE$"; } else { if (sc&SCF_KEY_DESC) KeyDescSet("Dol /PURPLE"); else "$PURPLE$"; } return TRUE; case SC_F2:

This. Terry wrote the system SPECIFICALLY for newbies, why would he include comments that do anything other than explain what a given block of code does?

You'd think it'd be full of "ahaha cia nigger lol i ran over KKK sum nigger on 9/9/9", but no, that's not what Terry means.

Attached: serveimage(4).jpg (960x720, 45.14K)

What is this even supposed to do?

A Q_rsqr

"Fast inverse square root" for lighting.

en.wikipedia.org/wiki/Fast_inverse_square_root
There's probably lots of forgotten magical numerical approximation hacks written in 80s scientific codes.

Do you know any other?

Not that user, but Linux uses approximations of dividing by 1,000,000 in the networking code in various places when calculating time deltas of things like ACK intervals to avoid having to emit a real DIV instruction. These shift/add/sub mixes to approximate MUL/DIV were very common in the '90s when those instructions were much more expensive. It surprises people that they're still there today, and bothers others that critical timing code is deliberately inaccurate. I forget where in the code, but if I run into it tomorrow I'll post one.

Lots of bit manipulation stuff still exists, but the magic numbers used are less mysterious.
graphics.stanford.edu/~seander/bithacks.html

React.__INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
It's where React handles its internal magic, and its APIs rapidly change, hence the name.

she removed the comments

Attached: koding_with_karlie3.jpg (869x1776, 229.7K)

Attached: serveimage.jpeg (980x653 85.56 KB, 104.23K)

...

Hey, somebody's gotta write all those Excel formulas for us.

The fact that "she" even posted fast inverse square root leads me to believe this is a troll socket puppet account to make women look stupid.
I'm 99% certain.

that's exactly what it is, but most people here are incels who would believe anything to justify its hatred for women

Most people who accuse everyone of being incels are women who can't code.

Holy shit i remember seeing this on xkcd!

Holy shit I remember seeing this on xkcd

ASCII piccolo with crossed eyes and a speech bubble congratulating the reader for finding the manual, some short notes on what functions do what, followed by a bunch of links to pastebins and the closing message was 'read a book dood'.

major jej holy shit

Shalom Ayash is definitely taking the piss.

Faggit

In my experience people writing Excel formulas tended to have above average intelligence. Average harpy from unholy abyss of accounting never advance past bashing Autosum button.

It's verified account, so it's not kid with similar username. So one of:
1) she (or her management, which, for all intents and purposes, is a same thing) is trolling. Which means than all kOdInG 4 GrRrLs is conscious bullshit run for fun and profit.
2) she gives so few fucks about it, that doesn't even bother about hiring normal social media writer, and not some kid who values trolling more than his job
So yes, she might not be semi-retarded pig, but people who take what she says serious are.

I had a management professor that gave us an excel doc and instead of using the SUM function he manually added like 20 different cells.

The funniest thing about that piece of shit code is that int max (8,8) would return 5.

I feel like I'm in hell right now. I fell for the college meme, and I'm having to take a damn course on the usage of MS Office. Running it in a VM without network access, no problems there. I already know it well enough from previous classes too. But the horror is that this asshole has severe autism - forcing us to memorize every single keyboard shortcut and how to do it in the GUI also, and if there's multiple ways to do it in the GUI, we have to learn them all. Even with his autism, one of the questions I had was to sum some cells into the bottom row for totals using the GUI. No problem, right? Drag and autosum. Wrong. I checked the solution to the problem and we were supposed to click the cell, start the function with =, then click each cell with a + in between manually. This is after I was asked to use sum(aX:aY), so he's got to know you don't have to do that. We also have to make an 80 on these shitty exams to pass the class, and it's a required class. God help me. Polite sage for off-topic.

Attached: __yuuhi_riri_nijisanji_drawn_by_ogami_kazuki__2e25753d9758715cba37fe774cc89e60.jpg (973x800, 403.29K)

The Dao - Intro
Lesson1: The hacker spirit is; in oneness. "You" don't exist, therefore "your" skills are not "yours".
They're gifts offered throught the many iterative and parallel incarnations of the spirit.
Lesson2: The hacker spirit knows no gender. Spirit knows no form and spirit knows no sides. It is the balance source of balance.
Lesson3: The hacker spirit imbudes all and is omnipotent.
Lesson4: The hacker spirit knows not bugs. If bugs, the flesh is week. One must meditate on the Dao.
Lesson5: The hacker spirit wastes not bits, nor cycles.

The hacker spirit of the programmer who wrote that Quake RSQRT poetry (people wrote theses about the magic constant) is still unidentified (even the known masters - Carmack, Abrash, Mathisen, Romero - wo made the code public remain ignorant of its origins).
Only an egoless master of the Dao could disolve their ego to let the infinite intelligence immaculately reflect through the work and live on forever in the memories of those who recognize an enlightened being's work.

That tweet is typical "girl code glitter" and the spirit behind it is no hacker spirit. It is full of disappointing pride and shows no class.

Reinventing the max(a, b) is no big deal. A little analysis:

if (a < b) return b;
else if (a > b && b < a)
return a;

Most non initiates care less about compilation. Code isn't written for people, it is written for a compiler which in turn produces machine code.
Compilers have a spark of hacker spirit doing magic on behalf of the non initiate's ignorance - dead code elimination, loop unrolling, cache blocking, expression simplification, branch prediction, ...
When a non initiate is initiated into what's behind the veil, the newl initiate is humbled by the Grace of the spirit.
The condition of the else statement above will obviously be reduced by the compiler to if (a > b) rather than if (a > b && b < a), the condition being always satisfied on both sides. The only acceptable implementation of such operation is the following.

#define max(a, b) ((a) > (b)) ? (a) : (b) //A bit of Lispiness for the preproc.

This typeless macro can span any type for which the operator > is valid and will be handled by the preprocessor which will cause an "inlining" of the expression over a function call. Of course, the compiler will optimize the expression according to your desires (-O1, -O2, -O3, ...). An optimized integer implementation could also be expressed as follows,using a XOR and a compare:

static inline int max(int x, int y) { return x ^ ((x ^ y) & -(x < y)); } //

or as follows, using subtractions and a shift:

static inline int max(int x, int y) { return x - ((x - y) & ((x - y) >> (sizeof(int) * 8 - 1))); }

Funny comment, first comment, hilarious: github.com/yaspr/bitwise/blob/master/bitwise_util.c

Flip it! (0 ~ 1)

I didn't know there was special ed college. Is this a result of dysgenics?

It's modern Marxist academia, of course it is.

Attached: 1511330279.mp4 (1280x720, 6.67M)

gcc will try to optimise your divides with bit shifts and such. If you divide or multiply by power of 2s it will definitely do that even on O0 but with some more complicated numbers O2 will almost never give you div (for constant numbers of course)

What degree are you going for that needs you to know MS office?
Also shortcuts are pointless since MS Office 2007 was released.

How is that "Lispy" at all? You aren't using prefix notation and you are trying to evaluate a number like it's a function.

Excess parentheses! (.)(.) ((.))((.)) (((.)(.)))

You have to understand the audience here. The first 2-3 years of college are 100% general education for the masses with like one or two specialized classes sprinkled in there. This is for drooling retards who have NEVER used a word processor or spreadsheet in their entire lives. Specialization doesn't begin until MS or Ph.D, minimum.

Lisps don't use an excess amount of parenthesis, but rather the perfect amount unlike what the C preprocessor practically requires.

I used them a lot in an embedded system FFT implementation for a project in university. I think the general term for it is 'Horner multiplication'.

cl.cam.ac.uk/~am21/hakmemc.html

I like it, some of the very first tricks I've ever learned are listed. Specifically interleaving bits, It's the obvious way to convert planar bitmaps into non planar ones... say if you wanted to display/edit ye olde console video game graphics.

Somebody post those M$ comments from the leaked Win2k source code.

Attached: 3b1806795298fe1790e5bce89e550bde.jpg (800x600, 119.25K)

Do you know that homosexuality is a sin?

Really, it's status quoe as far as I've seen personally. Then again, my job is at a shit company doing shit work for shit customers.

private\ntos\w32\ntuser\kernel\mnpopup.c:// Set the GlobalPopupMenu variable so that EndMenu works for popupmenus so// that WinWart II people can continue to abuse undocumented functions.private\windows\shell\accesory\hypertrm\emu\minitel.c:// Guess what? Latent background color is always adopted for mosaics.// This is a major undocumented find...private\windows\shell\accesory\hypertrm\emu\minitelf.c:// Ah, the life of the undocumented. The documentation says// that this guys does not validate, colors, act as a delimiter// and fills with spaces. Wrong. It does validate the color.// As such its a delimiter. If...

Curse words: there are a dozen or so "fucks" and "shits", and hundreds of "craps". Some dissatisfaction with the compiler is expressed in private\shell\shell32\util.cpp: // the fucking alpha cpp compiler seems to fuck up the goddam type "LPITEMIDLIST", so to work // around the fucking peice of shit compiler we pass the last param as an void *instead of a LPITEMIDLISTSome insight into Microsoft's famous daily build process is given in private\windows\media\avi\verinfo.16\verinfo.h: * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * !!!!!!!IF YOU CHANGE TABS TO SPACES, YOU WILL BE KILLED!!!!!!! * !!!!!!!!!!!!!!DOING SO FUCKS THE BUILD PROCESS!!!!!!!!!!!!!!!! * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! There are also various references to idiots and morons, some external, some within Microsoft. The file private\ntos\rtl\heap.c, which dates from 1989, tells us // The specific idiot in this case is Office95, which likes // to free a random pointer when you start Word95 from a desktop // shortcut. The file private\ntos\w32\ntuser\kernel\swp.c from 11-Jul-1991 points at * for idiots like MS-Access 2.0 who SetWindowPos( SWP_BOZO * and blow away themselves on the shell, then lets * just ignore their plea to be removed from the tray

Morons also abound, as in this selection private\genx\shell\inc\prsht.w: // we are such morons. Wiz97 underwent a redesign between IE4 and IE5 private\shell\ext\ftp\ftpdrop.cpp: We have to do this only because Exchange is a moron. private\shell\shdoc401\unicpp\desktop.cpp: // We are morons. We changed the IDeskTray interface between IE4 private\shell\browseui\itbar.cpp: // should be fixed in the apps themselves. Morons!

Microsoft programmers also take their duty to warn others seriously. There are over 4,000 references to "hacks", mostly warnings. These include private\inet\mshtml\src\core\cdbase\baseprop.cxx: // HACK! HACK! HACK! (MohanB) In order to fix #64710 at this very late private\inet\mshtml\src\core\cdutil\genutil.cxx: // HACK HACK HACK. REMOVE THIS ONCE MARLETT IS AROUND private\inet\mshtml\src\other\moniker\resprot.cxx: // goto EndHack; // private\inet\mshtml\src\site\layout\flowlyt.cxx: // God, I hate this hack ... private\inet\wininet\urlcache\cachecfg.cxx: // Dumb hack for back compat. *sigh* private\inet\wininet\urlcache\filemgr.cxx: // ACHTUNG!!! this is a special hack for IBM antivirus software private\ispu\pkitrust\trustui\acuictl.cpp: // HACK ALERT, believe it or not there is no way to get the height of the current // HACK ON TOP OF HACK ALERT, private\ntos\udfs\devctrl.c: // Add the hack-o-ramma to fix formats. private\shell\shdoc401\unicpp\sendto.cpp: // Mondo hackitude-o-rama. private\ntos\w32\ntcon\server\link.c: // HUGE, HUGE hack-o-rama to get NTSD started on this process! private\ntos\w32\ntuser\client\dlgmgr.c: // HACK OF DEATH: private\shell\lib\util.cpp: // TERRIBLE HORRIBLE NO GOOD VERY BAD HACK private\ntos\w32\ntuser\client\nt6\user.h: * The magnitude of this hack compares favorably with that of the national debt. While surprisingly informal, there are limits to how far the programmers go. There are no derogatory references to Microsoft or Windows themselves. Bill Gates is never mentioned. There are no racist or homophobic slurs. I saw only one drug reference. private\shell\ext\tweakui\genthunk.c: * CallProc32W is insane. It's a variadic function that uses * the pascal calling convention. (It probably makes more sense * when you're stoned.)

>//


>//


The absolute state of MS, everyone.

I'm so glad I wasn't eating when I read that.


If I can attach a PDF, I ran across attached when looking up information about the Apollo Guidance Computer. I don't know if any of the math was used for Apollo, I just saved the document when I found it. These are the kinds of hacks and analysis that you don't see anymore.


I had a manager who had a story for why you shouldn't put shit like this in code. Apparently, he got a call ten years after leaving a program, and five years after the program was canned, by some users who had run into the impossible condition that printed out "If you see this, call James at ...".

wew
I wonder what she'd call
int a = 0x10;
int b = 020;
int c = (a + b) >>1;

Common as mud in engineering fields, especially where fast performance is needed.
See Numerical Recipes in for more examples.

Make it time sensitive, let's say, last update + 6 months.

put in a
C CALL SOL*

*Shit Out of Luck from FORTRAN

Or it's just a fake screencap. At the very least, all the accounts in the replies aren't seemed to have changed.
@notsoeli seems to belong to some foreign man, even at the time of the tweet.
@Vintage_Swift13 is now @isitdelicate. old account deleted.
@abi1699 has become @abu1966. old account deleted.
@youfitinmypoem has replies, but the account is now empty.
@4440dc66ee4b45a gets me no search results but exists.
@5sosandtswift is now @goldentswift. old account empty.

Someone also could have taken an old tweet and replaced the picture with something.

those are all still integers and have no decimal points..........................................

not so much a comment. when I was reverse engineering a pre-cracked dos game I examined how the previous person got around copy protection. basically instead of shorting a jmp he explicitly made a code cave, which was a hassle in those days, passed execution then had a password cracking function in there. it did a whole lot of nothing then always passed back 8 in ax which was used as an immediate jump to get past the fail state of the copy protection.

it blew my mind but it felt kind of comfy to be next to someone's earnest if retarded code so many years later.

> Numerical Recipes in for more examples
There's numerical analysis and there's numerical analysis:
1) Using numerical algorithms to come to solutions to problems.
2) Analyzing the result for goodness, for some definition of good.
My understanding is that Numerical Recipes primarily does the former and little if any of the latter. The attached book is entirely about the latter.

...

This. Was that written by a chink or pajeet?

(You'(re joking right?))

It's iterating over a set of points and computing the distance between each point and some other point, which given variable names is likely the "center" of the set. This means that the absolute value call is useless and probably indicates that either an idiot wrote it, or there is a horrible bug somewhere.

I was just lurking the front page and instinctively tried to parse your post like a Lisp expression not knowing the context of it. I don't really get why you're even arguing over something so trivial, but I am amused.

There it is. Absolutely based.

...

obvious bait, try harder next time

Based developer. Wrote truth and nothing but the truth. SJW couldn't handle it. Respect for the developer.

Post more of those big khazar milkers

OP here.
It's both. This "startup" is going to be under soon (Florida business that was started by faggot with silver spoon stuck in mouth) but I managed to get in touch with a guy who knew my grandpa back in the day who managed to get in touch with someone who works at a different company with a possible open position. I hope it works out, but I'm also morbidly curious to see what a company looks like from the inside as it burns to the ground.

By the way, this is literally software that counts dead chickens as they pass down a conveyor belt.

How do you even fuck that up?

Ran into this patch Debian adds to httperf and was amused.
Index: httperf-0.9.0/src/httperf.c===================================================================--- httperf-0.9.0.orig/src/httperf.c+++ httperf-0.9.0/src/httperf.c@@ -808,7 +808,7 @@ main (int argc, char **argv) SSLeay_add_ssl_algorithms (); /* for some strange reason, SSLv23_client_method () doesn't work here */- ssl_ctx = SSL_CTX_new (SSLv3_client_method ());+ ssl_ctx = SSL_CTX_new (SSLv23_client_method ()); if (!ssl_ctx) { ERR_print_errors_fp (stderr);

It's a fake screenshot - see the real one she posted at 9:39 AM on Feb 11, 2016:

twitter.com/karliekloss/status/697837478141632512

Was it vBulletin?

Also favorite thread. Glad it got bumped.