I visited stackoverflow.com with NoScript enabled and got this nice message: Stack Overflow works best with JavaScript enabled
strcmp
@strcmp
Best posts made by strcmp
-
RE: StackOverflow WTF
-
RE: StackOverflow WTF
@Aaron said:
That's not a WTF. Expecting any site to work properly with NoScript on is the WTF.
Ok, I'll explain it to you. Like this site the site is mostly working with NoScript and only works "best" with JavaScript. And yes, I can expect web designers to not waste my CPU resources with stupid effects because I open many tabs and do more work in parallel and no site has the CPU for itself. But I like the ambiguous message. Just read it again. I don't know if the author wanted to be funny here or not, but this can be read as a property of a programming language.
Latest posts made by strcmp
-
RE: Hey Microsoft - Was this was the only way you could think of removing several hyperlinks in Excel?
@El_Heffe said:
If you are attaching something to an e-mail, why does Hotmail have to "know" what type of file it is? Just attach the file and send it.
An attachment has a MIME type, which any MUA has to set. Changing the extension to .txt to force a text/* type is a semi-good approach, because text is converted to the platform's text format by the receiver's MUA and you don't want to have line ends or character set converted if you send binary data.
-
RE: Byte Array To String
@joeyadams said:
void bytea_to_hex(const void *bytea, size_t len, char *hex_out) {
const unsigned char b = (const unsigned char)bytea;
const char *h = "0123456789ABCDEF";
for (;len--; b++) {
*hex_out++ = h[*b >> 4];
*hex_out++ = h[*b & 15];
}
*hex_out = 0;
}If you have a real programming language anyway, you can speed this up by reading, converting, and writing several bytes at once, i.e.
void bytea_to_hex(const void *bytea, size_t len, char *hex_out) { const unsigned int *b = (const unsigned char*)bytea; unsigned int *o = (unsigned short*)hex_out; const unsigned short *h = /* lookup table */; int l = len / sizeof(*b); for (;l--; b++,o+=2) { if (sizeof(*b) == 4) { o[0] = h[(*b ) & 0xff] + (h[(*b>>8) & 0xff] << 16); o[1] = h[(*b>>16) & 0xff] + (h[(*b>>24) & 0xff] << 16); } else { /* other cases */ } } /* handling of rest bytes and string termination */ }
or
void bytea_to_hex(const void *bytea, size_t len, char *hex_out) { const unsigned int *b = (const unsigned short*)bytea; unsigned int *o = (unsigned int*)hex_out; const unsigned int = /* lookup table */; int l = len / sizeof(*b); for (;l--; b++,o+=2) { if (sizeof(*b) == 4) { o[0] = h[(*b ) & 0xffff]; o[1] = h[(*b>>16) & 0xffff]; } else { /* other cases */ } } /* handling of rest bytes and string termination */ }
, depending which lookup table (byte order dependent like the code) better fits into the L1 cache.
-
RE: TODO: How to just have one function?
@morbiuswilters said:
At the very least, why didn't he just make 1 function with if (ZRQ) { ... } else { ... } containing the different algos?
That would be sufficiently equivalent to #if ZRQ ... #else ... #endif and not WTF-worthy, so it wouldn't have been posted. -
RE: TODO: How to just have one function?
@Zylon said:
@DaveK said:
This is great, because by doing it this way you can dynamically select
which algorithm to use at runtime by simply changing the value of the
#define!You might want to think that through again.
#define ZRQ zrq zrq; ... zrq = !!getenv("USE_ALGO1")
-
RE: Bad user experience by design
@takatori said:
"First, setting the default to something other than the current format will require lots more coding."
If the option is in a sub-menu, users will take about half a minute or so to activate the option and lose even more time by exporting in the wrong format first and finding out too late (started to work with it) or needing a support call. The manager is trading his costs (1 hour developer time) against other department's lost productivity (adding up to many days). He looks good, but the net result is wasted money.
Why can't they at least add a second [Export new format] button without having to use the details page?
-
RE: Homebrew Security
@mjk340 said:
my $xor = 0xEDB88320;
oh no! you posted your secret key!
While guessing if that number may have a meaning I stumbled over the well known opcode B8, but than the ED is only done for its side effects on the hardware?
00000000 ED in ax,dx 00000001 B88320 mov ax,0x2083
-
RE: Okay, SERIOUS WTF
@Flatline said:
@danixdefcon5 said:
single-mother children keep only the mother's one if there is no parent.
What the fuck is that sentence supposed to mean? Most children only have one mother. And I haven't got a clue how to parse the second part of the sentence.
You failed the Turing test. Humans should be able to understand slightly erroneous grammar or words as e.g. coming from a foreign speaker. The algorithm: indentify the parts of the sentence you have problems with, make a list of possible substitutions, find the meaning which makes most sense.
-
RE: A god being sued
@Someone You Know said:
I doubt if Satan can really claim to be a natural-born citizen of the United States. If Satan existed, surely he'd be much older than the United States.
He is not the first one with this problem, what about the first few presidents?
-
RE: TOAD
@Morbii said:
Kind of just nitpicking, but this isn't standard Windows behavior. You have to write code to make this happen (not the other way around) - though, enough programs do it that it might give you that idea.
This ultimately depends on what you mean by 'standard behavior', a) what is builtin and will happen if you don't say otherwise or b) what is expected, because most entities (programs) do it. This is uncommon on e.g. unix, thus the prefix 'windows'. Did I translate that wrongly?