765 karma · joined February 1, 2012
It's a mistake to introduce new programmers to OOP before they understand the basics
of breaking down problems and turning the solutions into code.
Given how well I remember my classmates with little-to-none programming experience struggled with understanding pointers while not being able to write the simplest algorithms, I thought this was a no-brainer. Is it really a controversial opinion?The links you provide equates this to antisemitism, which is very strange to me. Who was it, you mean, who were being "enthusiastically for" terrorism?
"I know many would fault me for [not supporting IE] on TNL.net but the design decision of not supporting older internet explorer browsers was based on analytics data that showed me that only 5% of my overall audience was using those"
Remember, ignoring IE users is not necessarily about elitism, but can also be a financially sound decision.
[The Florida Family Association] says there are no gay characters in the
Star Wars films and describes the inclusion of LGBT
(lesbian, gay, bisexual and transgender) elements as
"propaganda".
How can anyone possibly make the argument that allowing free choice of romantic partner in an RPG is "propaganda"? It seems very strange to me.So my quest to calculate the hash and the length of a pathname component efficiently continues. I'm pretty happy with where I am now (some changes to the code have happened, it you actually want to see the current situation you need to check out the kernel mailing list post), but finding the number of bytes in the final mask bothers me.
Using an explicit loop is out - the branch mispredicts kill it. And while at least modern Intel CPU's do quite well with just using the bit scan instructions ("bsf") to find where the first NUL or '/' was in the word, that sucks on some older CPU's.
So I came up with the following trick to count the number of bytes set in the byte mask:
/* Low bits set in each byte we used as a mask */
mask &= ONEBYTES;
/* Add up "mask + (mask<<8) + (mask<<16) +... ":
same as a multiply */
mask *= ONEBYTES;
/* High byte now contains count of bits set */
len += mask >> 8*(sizeof(unsigned long)-1);
and I'm wondering if anybody can come up with something that avoids the need for that multiply (and again - conditionals don't work, the mispredict costs kill you).Because that multiply isn't free either."
EDIT: Thanks for the tips, I'm new here