Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×

Comment Re:Compactness and Readability (Score 1) 298

> What the hell is this?

The 8th entry is set to zero so that the test can verify the table was initialized properly.

> 4))

> Why is there a block comment at the beginning that does nothing.

For alignment of CRC32_REVERSE, CRC32_VERIFY, CRC32_Table since /. fucks up formatting.

> and what the hell does that trailing comment mean?

The comments lists entries [0] and [1]. The first 8 entries are these :
i.e. 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,

Whenever you generate a table it is always helpful to list _expected_ values so someone can _verify_ them with _actual_ values.

Submission + - Internet Explorer website wont work with Windows (homeoffice.gov.uk) 3

Anne Thwacks writes: The British Government web site for applying for for a licence to be a security guard requires a plugin providing Internet Explorer emulation on Firefox to login and apply for a licence. It wont work with Firefox without the add-on, but it also wont work with Internet Explorer! (I tried Win XP and Win7 Professional). The error message says "you have more than one browser window open on the same internet connection". I didn't. and "to avoid this problem, close your browser and reopen it". I did. No change. I tried three different computers, with three different OSes.
Still no change.
I contacted their tech support and they said "Yes ... a lot of users complain about this. We have known about it since September, and are working on a fix! Meanwhile, we have instructions on how to use the "Fire IE" plugin to get round the problem". Eventually, I got this to work on Win7pro. (The plugin will not work on Linux). The instructions require a very old version of the plugin, and a bit of trial and error is needed to get it to work with the current one.

How can a government department concerned with security not get this sort of thing right?

Besides a massive amount of bribery and corruption, what could explain how the designers of the web site can't fix a chronic useability problem after 6 months?

Comment Compactness and Readability (Score -1, Flamebait) 298

Let's let at the clusterfuck of Boost's CRC code
1109 lines of over-engineered C++ crap for a simple CRC32 function!?!?

Now compare that to these simple 27 lines of C/C++ code.

#include <stdint.h>
 
const uint32_t CRC32_REVERSE = 0xEDB88320; // reverse = shift right
const uint32_t CRC32_VERIFY = 0xCBF43926; // "123456789" -> 0xCBF43926
/* */ uint32_t CRC32_Table[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // i.e. 0x00000000, 0x77073096,
 
void crc32_init()
{
  for( short byte = 0; byte < 256; byte++ )
  {
      uint32_t crc = (uint32_t) byte;
      for( char bit = 0; bit < 8; bit++ )
          if( crc & 1 ) crc = (crc >> 1) ^ CRC32_REVERSE; // reverse/reflected Form
          else /* = 0*/ crc = (crc >> 1);
      CRC32_Table[ byte ] = crc;
  }
  if( CRC32_Table[8] != (CRC32_REVERSE >> 4))
      printf("ERROR: CRC32 Table not initialized properly!\n");
}
 
uint32_t crc32_buffer( const char *pData, uint32_t nLength )
{
  uint32_t crc = (uint32_t) -1 ; // Optimization: crc = CRC32_INIT;
  while( nLength-- > 0 )
      crc = CRC32_Table[ (crc ^ *pData++) & 0xFF ] ^ (crc >> 8);
  return ~crc; // Optimization: crc ^= CRC32_DONE
}

Typical bloated code solves some theoretical "general purpose" solution. Good code does one thing well:

It communicates clearly what it is trying to do.

_When_ was the last time you actually needed a different CRC function from the standard 32-bit one?

Submission + - Amazon Requires Non-Compete Agreements...For Warehouse Workers

Rick Zeman writes: Amazon, perhaps historically only second to NewEgg in the IT nerdling's online shopping heart, not only has treated their warehouse workers to appalling working condtions, but they're also making them sign a non-compete agreement for the privilege. Excerpt from the agreement:
During employment and for 18 months after the Separation Date, Employee will not, directly or indirectly, whether on Employee’s own behalf or on behalf of any other entity (for example, as an employee, agent, partner, or consultant), engage in or support the development, manufacture, marketing, or sale of any product or service that competes or is intended to compete with any product or service sold, offered, or otherwise provided by Amazon (or intended to be sold, offered, or otherwise provided by Amazon in the future)....

Submission + - Did Neurons Evolve Twice? (quantamagazine.org)

An anonymous reader writes: When Leonid Moroz, a neuroscientist at the Whitney Laboratory for Marine Bioscience in St. Augustine, Fla., first began studying comb jellies, he was puzzled. He knew the primitive sea creatures had nerve cells — responsible, among other things, for orchestrating the darting of their tentacles and the beat of their iridescent cilia. But those neurons appeared to be invisible. The dyes that scientists typically use to stain and study those cells simply didn’t work. The comb jellies’ neural anatomy was like nothing else he had ever encountered.

After years of study, he thinks he knows why. According to traditional evolutionary biology, neurons evolved just once, hundreds of millions of years ago, likely after sea sponges branched off the evolutionary tree. But Moroz thinks it happened twice — once in ancestors of comb jellies, which split off at around the same time as sea sponges, and once in the animals that gave rise to jellyfish and all subsequent animals, including us. He cites as evidence the fact that comb jellies have a relatively alien neural system, employing different chemicals and architecture from our own. “When we look at the genome and other information, we see not only different grammar but a different alphabet,” Moroz said.

Comment Re:Check their work or check the summary? (Score 1) 486

> Optimizing memory is a dying skill,

It is now called Data Orientated Design.

Google+ Group
* https://plus.google.com/+Datao...

Data-Oriented Design and C++
  * https://www.youtube.com/watch?...

Typical C++ Bullshit
  * http://macton.smugmug.com/gall...

Pitfalls of Object Oriented Programming
* http://research.scee.net/files...
* http://www.slideshare.net/royc...

Submission + - Microsoft to Rename Modern Apps "Windows Apps"

jones_supa writes: While fumbling with the new application platform for Windows, Microsoft has juggled with different names for the applications: Metro, Modern UI, Windows Store apps, universal apps. Going forward, these apps will be called "Windows apps", Microsoft explained during the Developing for the Windows 10 Hardware Platform session at WinHEC 2015. This is what the future of Windows is all about, and these apps are expected to completely supplant desktop applications. A "Windows app" can run on every device category: phone, PC, Xbox, IoT, and on more obscure devices like the HoloLens. For now the classic Win32 platform will remain fully supported on x86 PCs, but Microsoft is taking a "legacy" attitude towards it.

Comment Re:PHP is fine (Score 1) 182

Ad hominem fallacy. The reasons _why_ I hate PHP are irrelevant.

PHP is a shit design language. Education is the only way to get people to see its problems.

> They either don't notice it,

Typical head in the sand. Ignoring a problem doesn't make it go away.

> work around it,

Sometimes you can, however one can't work around fundamental inconsistency embedded in the design.

> or work in the language with such a level of abstraction that they are not a problem.

Exactly; They use a better designed language.

Slashdot Top Deals

"When the going gets tough, the tough get empirical." -- Jon Carroll

Working...