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


Forgot your password?
Check out the new SourceForge HTML5 internet speed test! No Flash necessary and runs on all devices. ×

Comment Re: This again? (Score 1) 270

Why is it fair to group POSIX-C and MISRA-C together but not different assembly languages?

Because the difference between POSIX C and MISRA C is a large pile of custom headers to define type conversions. The difference between ARM64 assembly with Neon instructions and 6502 assembly is more like the difference between C++11 and the original 1983 version of Pascal.

Comment Re:This again? (Score 2) 270

He's not even right in a pedantic way. Assembly languages are programming languages.

No, the OP is right in a pedantic way. Assembly language isn't really a language, but rather a loose collection of related languages.

As for the other poster's comment that it is basically just human-readable machine language, so is C, but nobody argues that C isn't a programming language. :-D

Comment Re:Curly braces = good. Indents = bad. (Score 1) 167

Apologies in advance for the bad font, but Slashdot stopped allowing   because of the trolls, so this was the only way to get indentation.  Ugh.  There's some irony for you.

I've used GNU indent, and it is maybe 1% of the way to a complete solution, if that.  A complete solution needs crazy things like:

* Variable weights for indentation priority between the minimum indentation of a continuation line relative to the first line and colon alignment in Objective-C
* Rules on where whitespace can and can't be inserted to correct alignment (e.g. rules like "Don't put any space between the (strong, atomic) and the subsequent type name in an Objective-C property, in such a way that they can be outweighed by other rules if it makes the line too long
* Choosing whether to indent function parameters by the standard n spaces instead of indenting to the open parenthesis if the latter approach would result in a single parameter getting split across multiple lines and the former approach wouldn't
* Closing up space between certain types of tokens (arbitrarily)
* Adding space between certain types of tokens (arbitrarily)
* Proper handling of comment markup (e.g. HeaderDoc, Doxygen, JavaDoc, etc.) with knowledge of where newlines and whitespace matter
* Ability to handle programming languages other than C and related languages

And so on.  Basically, the set of rules would likely mean that everything on the left side of the language's BNF would be a named token type, and you could specify rules regarding whether spaces could be added before or after that token type.  For example, you might write rules like this:

my-if-statement-whitespace-ruleset  {
    weight 10000;
    if.token {
        space-after: 1;
my-if-statement-whitespace-ruleset {
    weight 10000; {
        space-after: close-up;

To specify that an if statement should be followed by exactly one space before the opening parenthesis, but a function should not, and any such space should be removed.

You'd also need to be able to contextually describe specific tokens like braces.  For example, if you wanted to indent the opening brace of a function by 4 and every line nested inside it by 8, you might write something like:

my-function-body-indent-rule-set {
    weight: 100;
    function.body.first-matching-child("{") {
        min-indent: [previous-line] + 4;
        child-indent: [previous-line] + 8;

So basically, something vaguely like CSS, but with weighting instead of order-based priority, plus the ability to define fallback rules with lower priority that get used if the higher-priority rule fails because it conflicts with another rule that has higher priority (e.g. an indent rule set that uses four-character indent if the first rule set for indenting to the open parenthesis gets overruled by a maximum line length rule).

Comment Re:Not buying it (Score 1) 135

Sure, it could be that. But it could also be:

  • A cleaning person plugging a vacuum cleaner into the power strip on the rack instead of into the wall outlet that's on an external circuit (combined with improper power filtering in the equipment).
  • Electrical noise caused by some other crappy piece of equipment in the rack (combined with improper power filtering in the equipment).
  • Errors caused by higher operating temperature.
  • Errors caused by emissions from natural Uranium or other radioactive elements in the soil.
  • A software bug.
  • A hardware bug.

And if it happens disproportionately on one class of equipment, unless there are material differences in the amount of shielding, any one of those five is probably much more likely than cosmic rays, IMO. :-)

Comment Re:Curly braces = good. Indents = bad. (Score 4, Interesting) 167

Agreed. And more importantly, if you have braces, it is possible for the IDE to programmatically fix the indentation so that it is easy to read. There's absolutely no sane reason to require a programmer to use whitespace for any reason other than between tokens that would otherwise be a single token if shoved together. All other use should be superfluous, and the IDE should make it readable for you without the need for a person to do it.

And the reason braces should be in every programming language, IMO, is that it makes it easier to jump to the end of a block. When I have nested blocks in a properly braced language, I can hit percent in vi, and I'm at the end of that block. I don't have to move the cursor to the beginning of the line and laboriously hit the down arrow key a line at a time until I find a line that isn't indented as far. Therein lies the path to madness.

Want to dramatically improve the programming world in a single project? Design a meta-language for code formatting so that a set of text-based rules can enforce everybody's own quirky code formatting standards. Make it handle at least the twenty or so most popular programming languages. Then open source it under a BSD license so that the interpreter can be readily built into every IDE on the planet. Then, we can finally dispense with all of these silly programming languages that use whitespace syntactically once and for all.

Comment Re:They HAD this service? (Score 1) 49

Start shooting in RAW mode. You'll hit a terabyte before you know it. Better yet, get a 5D Mark IV and use Dual-Pixel RAW so that 5% more image data can take 100% more space. I mean, you'd think they would have used sum-difference encoding, sign-magnitude encoding (with a single-bit right rotation so the sign bit is on the right), and bitwise run-length encoding (all the top-order bits first) to make that file format efficient, but instead, they encoded the sum of the two images followed by one of the two images by itself, both using lossless JPEG. I can't imagine what they were thinking. The impact of dual-pixel RAW should have been an order of magnitude less than it is.

Comment Re:Business Class With Static IP Force you to rent (Score 1) 65

With Business service, you're paying extra for a higher level of support, therefore, they get to dictate what hardware is used as CPE, so they can monitor it.

That's just a lame excuse. It has no basis in reality.

I have business-class DSL, and Covad (or whatever they're called now) doesn't dictate what hardware is used as a CPE, and they sure as h*** don't require me to rent it from them. They do provide recommendations. If you stray outside those recommendations, it becomes your problem if things don't work.

Besides, Comcast Business Internet service, unless you buy into one of their special high-end tiers, doesn't come with an SLA. They don't give you a higher level of support. They just give you a connection without port blocking, data caps, etc.

There's absolutely no reason for an SLA-free Internet service to require you to rent a modem. The problem is that Comcast uses a fundamentally broken and insecure technology for routing, wherein your cable modem has custom firmware with a crypto key in it that lets it do encrypted RIP for router advertisements upstream. Instead of setting up their network correctly, with a properly maintained centralized routing database, they propagate routing changes by sending an IP range to your cable modem and letting it propagate it upstream to the router.

I'm sure there's some advantage to Comcast in terms of being able to rewire things and your cable modem automatically being able to fix routes when it reaches a different head end or something, but it is a security nightmare, can potentially be abused easily by a malicious user to bring down their entire network (at least within a region), and on top of that, forces everyone to rent cable modems from them.

TL/DR, they force you to rent because they don't know what they're doing.

Comment Re:They do charge for the modem... (Score 2) 65

It was a great plan until they changed which docsis standard they were using and my modem was rendered useless, and along with it any savings I might have realized over the next few years.

Huh??? DOCSIS requires backwards compatibility, both for the head end and the modems themselves. Any DOCSIS n hardware is compatible with n+k and n-k for all values of k. There's absolutely no reason for your cable company's head end to not negotiate a connection with your existing cable modem. You just won't get the faster speeds provided by the newer standard.

Besides, at $6 a month, it doesn't take years to recover the cost. It takes just a few months. Unless you're doing something special, a cable modem typically costs only forty or fifty bucks. That's only about seven or eight months of service. Unless your cable company requires you to rent one (e.g. Comcast when using multiple static IPs), you're a chump if you rent from the cable company. The break-even point is probably about a dollar a month.

Comment Re:Bribery wins again (Score 1) 222

Correct. And this town's response should be to lease access to an ISP (ideally owned by a local) under the condition that they provide service under the same terms as the municipal service for at least 3 years, and with the condition that their exclusive access to the lines ends at the end of those three years.

Comment Re:So long, Netflix, it was good while it lasted (Score 2) 186

You also can't have a go-to streaming service when studios are going to make better money with their own streaming service.

Studios only think that they are going to make better money. The reality is that they might, but only in the very short term. The more studios go to that model, the more companies you'll have competing for a limited entertainment budget. Eventually, those studios are going to get squeezed, and viewers are going to start subscribing for two months to each one, then dropping them, and other similar tactics to allow them to subscribe to more services than they can afford to subscribe to continuously.

At that point, the only difference between running your own streaming service and making your content available through Netflix is the profit that Netflix takes, but that mostly gets eaten up by the advertising budget that you have to spend trying to convince people to try your one-off service that has only limited content.

In the long run, the content providers are doomed without a small number of common providers. The "everybody provides their own subscription service" model is unsustainable. An "everybody provides their own DRM-free download service" might be sustainable, but the content providers won't touch that with a ten-meter pole.

Comment Re:So where will existing content come from? (Score 1) 186

What they really need is the equivalent of buying a DVD for digital content.

The problem is, then Netflix would not only have to keep all of their active content available for streaming, but also all of their historical content, just in case somebody bought it and wants to redownload it. I mean yes, they could have it on fewer servers, but still, it isn't clear how that benefits consumers over, for example, buying it from the iTunes Store's video section unless they can somehow convince the movie studios to discard their blind trust in DRM and sell the content in a more usable format without all the vendor lock-in.

Comment Re:My recollection of Kindergarten, circa 1986 (Score 1) 227

That's a little extreme, maybe, but in principle, there's no reason we couldn't teach the basics of algebra right alongside the basics of math in first or second grade, while kids still have the mental flexibility to become good at abstract thinking. Teach it in terms of computer programming, where you aren't thinking of variables as placeholders,but as something more concrete initially. Then become progressively more abstract over the years so that we can be teaching calculus by junior high.

Of course, we don't do these things—largely because most K-8 teachers don't have a strong enough math background to teach them, rather than because the students can't learn such things at that age.

Slashdot Top Deals

He keeps differentiating, flying off on a tangent.