Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?

Comment if "flexible" means uncontrollable 100X variation (Score 1) 56

> The next thing you need to know is that renewable, whilst mostly very flexible

"Flexible" is an interesting word choice. Consider wind, for example. A 20 mph wind has 8 times as much power as a 10 mph wind, at 30 mph it's 27 times as much power. You can't control how much wind there is. Similarly, we might not realize it since our eyes measure brightness on logarithmic scale, but a cloudy day has 95% less solar energy than a sunny day. Most people would probably call this "unpredictable" or "unreliable" rather than "flexible".

On the other hand, the operators of a typical small natural gas plant with 4 generators can choose to run anywhere from full throttle on all four to just one at half throttle.

Comment Whatever is downloaded ends up being run as admin (Score 1) 115

I'm going to simplify this a bit, but consider you download two things You extract, which is a data. You don't execute anything in that download. You just extract it to your downloads folder and use notepad to open the resulting songlist.txt. You don't notice that it also included a file called netssl.ddl, which sits in your downloads folder.

Later, you download mcafee_setup.exe. You run macafee_setup.exe, which needs to run as admin. mcafee_setup.exe makes use of netssl.dll. It could use the hacked version which was part of songlist,zip, running code with full admin privileges that you never intended to run at all.

Comment So you're THAT guy (Score 1) 152

I read your link and now I know exactly what you did.

> gallery_root="../galleries/What I Did/"

You're the guy who put spaces in file names in *nix, in order to make sure that all commands using "for each", *, or find -exec would get messed up. Thanks for that.

Kidding, of course. Actually your post was interesting.

Comment Re: Glue it, internet it, breach it (Score 1) 152

If you work on that type of project, I'd be very interested in knowing about the work environment you've encountered. After 20 years programming, while constantly learning and improving my skills, I've grown wearisome of poor quality, of "duct tape and bailing wire" projects, and of people who just don't know what they're doing.

I think I might much more enjoy working in an environment in which things are done RIGHT, where there is no duct tape and bailing wire. On the other hand, a very much like getting things DONE (and done right), and can get frustrated when there is far more "process" mandated than is necessary to ensure that it's done right.

Do you have any experiences, advice, or thoughts to share with an experienced programmer considering going into life-safety applications like aviation or medical?

Comment Glue it, internet it, breach it (Score 2, Insightful) 152

> on one side of he scale and bits and pieces that require just gluing

Some gluing together projects are useful. People did some good stuff with HyperCard and shell scripts. Shell scripts are a great way to glue pieces together.

What has changed is that now almost all software is on the internet, where they are attacked 1,000 times per day by script kiddies with tools that automatically looking for gluey buts. So shell scripts are now called "remote code execution vulnerabilities ". This is a real problem.

In many fields, including electronics, hardware, pyro, etc there are two classifications of materials and technicians: standard and "life safety". Standard equipment is labeled "not for life safety applications ". Sometimes I think software (and programmers) need a similar distinction: "can hack together some code" vs "internet exposed ".

Comment That's drawing. Neither CS nor code, which are dif (Score 2) 152

> In Flash you can make a cartoon

Yes, just like you can make a cartoon with colored pencils. That's called drawing. That's a left- brain, artistic activity. At my last job we had two people who did that.

Those two people would then send the Flash file over to me, the right-brain guy who did the math-like process of programming (coding) those cartoons to do something useful. I couldn't do their job and they couldn't do mine because the two require fundamentally different ways of thinking. Not just different skills, but almost opposite skills.

As I did the coding, I would code to function interface appropriate to the frameworks each of those Flash objects were embedded in. I would code in the ActionScript language to pass data back amd forth with the larger framework project.

Designing those overall frameworks to hold any needed module and control the interactions between modules required some computer science understanding. The computer science part was language- neutral. A module could be written in any language. The computer science part was mostly about designing systems that are flexible, robust, expandable etc, totally unrelated to any specific language, whereas coding is all about expressing an idea in a particular language.

Comment precalculating inner loop is faster & more eff (Score 1) 310

You bring up two important points. First, you said "we" want power efficiency. The article says Intel is going to provide efficient CPUs. It does not say that everyone will always prioritize efficiency over speed for all tasks. "We" (many people) will continue to want many tasks to run quickly. In many cases, speed will be more important than efficiency, and that's what this sub-thread is about. We're talking about what to do when you want speed.

Secondly, it just so happens that in the vast majority of cases, over 90% of CPU time is spent in a very small section of code called the "inner loop", which is the little chunk that runs many times.

Suppose you're adjusting a video in some way, maybe resizing it or changing the brightness. The video is a bunch of frames, each frame is a bunch of pixels, and each pixel is three color values, red green blue. There are 256 possible values for each of R, G, and B. The code looks like this:

for each of 200,000 frames
              for each of 800,000 pixels

CalculatePixel() gets called 320,000,000,000 times. (320 billion times). Each time, it's passed a value from 0-255 and returns a value from 0-255. Which means that the value for CalculatePixel(0) gets recalculated about a million times. Compare this code:

For x in 0-255
          Answer[x] = CalculatePixel(x)

for each of 200,000 frames
              for each of 800,000 pixels
                 = Answer[]
                 = Answer[]
                 = Answer[]

If you're in the habit of speeding it up by calculating all possible values for your inner loop, you code to take advantage of that fact. Here we can see that it's much more efficient to do the calculation 256 times rather than 320 billion times. This concept is generally true for most programs- the bulk of the CPU time is spent doing whatever the program does repeatedly. I routinely make other people's software faster amd more efficient using this type of approach.

A recent case was a security scanner, which did this:
For each IP -
        For each port
                  For each vulnerability

You can see that CheckPortForVulnerablity() was called over a billion times.

Comment speculative execution etc. With 1024 cores ... (Score 2) 310

> consider, as a thought experiment, any task where the outcome of the first "step" determines the parameters for the next.

> There is no way to complete this overall task in parallel

In fact it's sometimes trivial. Consider this code, in which 'the outcome of the first step determines the parameters for the next':

HasPMI = IsMoreThan80()
PaymentAmount = CalculatePayment (Balance, HasPMI)

If you have 1024 cores, you can easily run CalculatePayment() in parallel with the line before it. You run it for both the true and false case simultaneously with IsMoreThan80. Then when the three threads complete, HasPMI tells you which of the two results to use.

That can also be EVERY IF STATEMENT, every switch-case, etc. On any branch, go ahead and precompute the value for the branch while deciding which branch you'll take. As things move in this direction, functional programming and similar disciplines start to become more valueable, so they will be used more.

A lot of things that wouldn't make sense to run parallel on two cores or four cores suddenly make sense of you have hundreds or thousands of cores laying around. With 4096 otherwise idle cores, it can make sense to calculate 1,000 possible scenarios in parallel and then ignore the 999 options you didn't need. Our way of thinking about problems will change, as will the tools we use to take advantage of the strengths of new systems.

Comment Rubio didn't say that. That misquotes the spin of (Score 4, Informative) 346

Rubio didn't say that. Here's what he said is a fundamental lesson to be learned:

-- Quote- -
Syria, Yemen, and Libya are all examples of our failure to learn one of the fundamental lessons of the terrorist attacks of September 11, 2001 -- that failed and failing states breed instability and are potential safe havens for terrorists who will eventually turn their attention toward us.

Also, now that the mass surveillance of metadata is no longer legal and has theoretically stopped , Rubio also supports keeping the currently-legal intelligence programs. I disagree with him, but I'm not a liar so I'll be honest about where we disagree. The summary posted to Slashdot is a lie misquoting some spin.

Comment We elected Iraq Hussein Osama? (Score 0, Offtopic) 49

I sometimes think "with that name, this is going nowhere - the imagery, the branding, is just all wrong."
Then, three really bad things were in the news:
Iraq Hussein Osama
We elected:
Barak Hussein Obama

One could imagine that US voters are too sophisticated and informed to be put off by an unfortunate name. In fact, many (most?) Obama voters didn't know which party he was running as, nor did they know the VP candidate's name. So it's not attributable to be voters being sophisticated and well-informed.

Slashdot Top Deals

Money cannot buy love, nor even friendship.