Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror

Comment Re:This is what happens when monopoly revenue fall (Score 1) 572

My printer is an HP LaserJet 4000. It's ancient. It still works 100% perfectly and it takes super-huge super-cheap toner cartridges. By telling Windows 7 that it's a LJ 4100 PCL6, it still works wonderfully. I didn't even try it on Windows 8.x but if you try to use it on Windows 10 with ANY HP LaserJet driver, guess what? All text comes out as black boxes. All of it. Thus Windows 10 is a no-go because it discards support for my ancient but fully functional network printer. I understand "removing legacy cruft" but tossing support for the LJ 4000 is just stupid. Tons of those printers still exist and it's not like the internal workings are even remotely complicated.

This whole "no support for older hardware" thing has been a massive pain; if an OS upgrade renders your perfectly workable peripheral unusable, I see that as a downgrade, and depending upon the particular piece of equipment it could be a very expensive one to replace. It made more sense when Vista was the first 64-bit Windows NT kernel to receive widespread "first-class" support and the 32-bit drivers didn't work, but at this point there is no excuse whatsoever for something that works on Vista 64-bit not having a driver that works on Win10 64-bit. Sometimes I wonder if Microsoft has an agreement with HP to force people to buy new printers and scanners through planned obsolescence.

Comment Thunderbird murders Outlook (Score 1) 184

This is a shred off-topic, but I've converted so many people to Thunderbird from Outlook that I'm losing count. When you add the Google calendar and contacts sync extensions and Lightning, you have a 100% free solution to the problem of calendar and contacts sync that also works with Android and iOS devices. Outlook 2013 does one-way read-only syncing of Google Calendar and that's fairly useless. If you move the Thunderbird data folder between machines, you move the entire configuration and all of the stored data that matters, including stored passwords and account configurations. Unless you're married to Exchange, Outlook is grossly inferior to Thunderbird in almost every way imaginable.

Submission + - Forbes Asks to disable Adblock, Serves Malvertising (engadget.com)

Deathlizard writes: From Engadget: The Forbes 30 Under 30 list came out this week and it featured a prominent security researcher. Other researchers were pleased to see one of their own getting positive attention, and visited the site in droves to view the list.

On arrival, like a growing number of websites, Forbes asked readers to turn off ad blockers in order to view the article. After doing so, visitors were immediately served with pop-under malware, primed to infect their computers, and likely silently steal passwords, personal data and banking information.

Comment Re:Closed System... It Won't Work (Score 1) 474

Exactly. With BI, people can leave abusive or unsuited jobs without fear of falling off a financial cliff, becoming homeless, etc. Plus, people who can't work a traditional job due to serious mental or physical difficulties and are already on disability get a more reliable base income so they can live with some degree of dignity and perhaps even contribute back to society in whatever small ways they can.

Comment Re:Basic income methodology (Score 2) 474

Giving a full basic income to offspring incentivizes reproduction. We'd need to be careful about rules regarding that. One of the major problems with existing welfare systems is that they effectively give people bonuses for cranking out babies and the world is already overpopulated without the help. Also, $500 a month for a single person (some people don't have a spouse and two kids, don'tcha know) won't even pay the rent. If the point is to prevent people from "falling off the cliff" then $500 is grossly insufficient, regardless of location.

Comment Re:Strongly recommend Clang (Score 1) 255

C/C++ are slow to evolve. It looks like at least this one proposal to add the various rotation operators to C/C++ has been authored and it has lots of good information. Your working example of "SHL 3 OR SHR 29 = ROL 3" is obvious when you scribble it on paper: a left rotate is a left shift where the bits that get pushed off the left and "discarded" instead appear on the right in the same order they fell off, so the 32-bit number 10000000000000000000000000000000 -> ROL 3 -> 00000000000000000000000000000100. Picture an arrow going from the "fall off" side back around to the "shift in zeroes" side you're used to seeing with the << operator and it makes more sense.

As for how the compiler "just knows" that this specific construct should become a ROL/ROR instruction, it's not that the compiler has a "special IF" statement on the front-end, but rather has to do with how compilers convert source code into object code. When the compiler breaks down our rotation idiom, it sees it as a series of simpler distinct steps with anonymous temporary variables, and a built-in optimizer can recognize the rotation sequence from there. This is what the compiler sees (see three-address code) when it converts the expression '(x > 29)' into its component parts:

t1 := x << 3
t2 := x >> 29
t3 := t1 | t2

Even a simple peephole optimizer can easily spot this short sequence of fundamental operations (left shift + right shift, the shift amounts equal the width of the variable type, ORed together -> ROL) and convert it to something like:

t1 := x ROL 3

...which is extremely simple to convert to assembler as i.e. ROL 3, EAX. One more important thing about rotations: if you rotate by the width of the unsigned integer type you're working with, you'll get the exact same number, and for any integer X of given width W,

X ROL n == X ROR (W - n)

So ROL 3 and ROR 29 are identical operations when performed on a 32-bit wide integer. That's part of why the C idiom works: a shift is a "rotate" that throws away the bits that "fall off" and zeroes the bits that would be missing, so by ORing two exactly opposing shifts together, you are manually grafting the bits that fell off one side back onto the other side.

Comment Re:Strongly recommend Clang (Score 1) 255

I'm completely fine with trolls as long as they're not trolling me very hard. ;-) There is often a fine line between trolling and innocent asking of questions regarding something the asker isn't familiar with. Also, a lot of C programmers don't ever have to write code that uses bitwise rotation (for example, I'd be surprised if there were bitwise rotations in a text editor or a text processing program), so even if I got trolled the information may get someone else's mental gears cranking.

Comment Re:Strongly recommend Clang (Score 1) 255

Sounds like you've got the gist of it. C only has a bitwise shift (where the end that the shift would "empty" is filled with zeroes for unsigned integers), not a bitwise rotate (ex. 00001011 rotated right by 2 becomes 11000010), so the closest thing to saying "bitwise rotate this" is using a set of expressions that would have the same behavior. Since a bitwise rotate is the same as splitting the binary number into two parts (of sizes determined by the desired rotation amount) you just have to create the two split numbers, then OR them back together. The Wikipedia example tries to be somewhat universally workable (using CHAR_BIT, sizeof(), etc. to make it work with virtually any unsigned integer type without modification) which is why it's a bit confusing. A simplified example:

If the value in a variable 'uint8_t x' is 10010011 and you want to bitwise rotate it right by 3 bits (to yield the result 01110010), you need to first derive the partial values [000]10010 and 011[00000], then OR them together.

The right-shift operator '>>3' will create the [000]10010 for us without any extra work.

We can generate the 011[00000] by doing a left shift '<<5' in the same way but with the reverse number of bits (calculated as BIT_WIDTH_OF_TYPE - left_shift_count to get 8 - 3 = 5).

Thus, 'x right-rotated by 3' for an 8-bit unsigned integer can be stated most simply (and inflexibly) in C as (x << 3) | (x >> 5), and the compiler will recognize the "two opposite shifts with a total shift of the variable type width ORed together" and emit a single bitwise rotate instruction (like 'r1 ROR r2') for the actual work rather than "load to r1; rotate r1; load to r2; rotate r2; r2 OR r1." Any unsigned integer can be rotated in the same way. Relevant x86 assembly: https://en.wikibooks.org/wiki/...

Does that help?

Slashdot Top Deals

An engineer is someone who does list processing in FORTRAN.

Working...