### HP Unveils 'The Machine,' a New Computer Architecture

Re:Run a completely new OS? (257 comments)

This is Slashdot... is reading TFA even... allowed?

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and learn more about it. Thanks for reading, and for making the site better!

Re:Run a completely new OS? (257 comments)

This is Slashdot... is reading TFA even... allowed?

Re:Not obvious at all it is problematic (586 comments)

C++'s STL fixes this with for_each, transform, and accumulate. All three are looping constructs over a range, but each one has well-defined termination and meaning. For example if I want to visit each element once, I'd use

for_each(begin(container), end(container), some_action);

If I want to mutate it,

transform(begin(container), end(container), begin(destination), some_transforming_action);

and if I want to collapse it down into a scalar,

some_type result = accumulate(begin(container), end(container), initial_value, some_operation);

If you squint at it enough it almost looks like a declarative language, and the compiler is usually smart enough to inline those function calls!

Re:I guess you don't understand languages either (594 comments)

You can simulate inheritance in C: just store an instance of the parent struct in the derived struct, and you can access inherited members via self->parent->method( );

Similarily for polymorphism: just cast it to a pointer to the base struct. If you lay your struct out nicely memory-wise this should be a safe operation.

If you can write it in assembly you can write it in C. And all that fancy C++ stuff has to eventually make its way down to ASM at some point.

Re:One good reason... (793 comments)

Value templates can be great. Have a look at std::array. Under the hood it's just a static C-style array (take a look at the generated assembly, on a decent compiler there's zero added overhead), but it remembers it's size as it's baked into the type itself. So it gives us all the speed of a C-style stack-allocated array of N items, plus removes the hassle of having to pass the size around as an extra parameter to functions. Finally, if you really want to be safe, you can use the

clusterssh (202 comments)

If you have ssh access to the laptops then use clusterssh. It's a simple program that takes your keystrokes and sends them to all of the machines you're connected to. So doing an

# aptitude update

# aptitude safe-upgrade

on 30 machines is no harder than doing it to one.

Re:Maximize (1002 comments)

For a start, how the hell do you even get a CS degree without doing any interfaces?

Easy: by studying real Computer *Science*.

Re:end is harder to read (140 comments)

I never said I was a bad typer, just a slower typer. I probably would be better off if I were a better (faster) typer, but as I am I'm still more productive than the majority of programmers I've worked with, many of which who type a lot faster than I do.

Re:end is harder to read (140 comments)

If you can't type very fast you'll never be a very productive programmer.

I'm not a very fast typer but I'm a *very* productive programmer. Maybe it's because I do more thinking than banging my keyboard

Re:So it works the way Stallman envisioned? (191 comments)

There is nothing in the GPL License that says they have to make their own improvements available. All that is required is that IF they decide to make their improvements available, they have to provide the source. They can even charge for the improvements, but as long as the source is available then they're in the clear.

Re:struct vs. class (553 comments)

Nope, the parent is correct. The only difference between a struct and a class is the default access level of its members. Structs are public, classes are private.

It also has an effect on inheritance as well. A struct will inherit publicly by default,

struct A : B { };

is the same as

struct A : public B { };

Similarly for classes, but replace "public" with "private".

Both structs and classes are contiguous blocks of memory. The only cases where pointers come into play are when your member functions (methods) are declared as virtual.

Re:Rough times (342 comments)

Actually it's B and !A to disprove A -> B

A -> B is the same as !A or B, !(!A or B) is !!A and !B, or A and !B

(Assuming you meant implication by -> (if A then B))

Re:Thank you (225 comments)

Who says upgrades are mandatory? If it keeps working why trash it? With that mindset, every PC has a mandatory upgrade cycle...

Re:Well frankly (775 comments)

You are completely 100% spot on with this comment. If I had mod points I would be spending them here

Re:Sokoban (322 comments)

I think I may have been a bit mistaken then, either that or I was just talking out my ass. I really appreciate the clarification, especially with a good example like that one. So, NP-Complete problems are a subset of NP-Hard which are a subset of NP?

Re:Sokoban (322 comments)

Your definition of NP-Complete isn't quite accurate. Np-Complete isn't made by NP and NP-Hard. NP-Hard IS NP-Complete for yes/no type problems. NP-Hard == NP-Complete, and both are a subset of NP.

Think of any NP-Complete problem, such as the famous Travelling Salesman Problem: given a weighted graph G, find a minimum cost Hamiltonian Cycle on it (visit every vertex exactly once, and do it while minimizing the cost of travel). We can convert this from an optimization problem to a yes/no problem. Given a graph G and a value K, is there a Hamiltonian Cycle in G with cost less than or equal to K?

The first problem is NP-Complete, the second is NP-Hard. Essentially they're the same problem, just one outputs a number, and other outputs yes or no.

Re:Depends... (466 comments)

If you don't mind me asking: which field do you work in? I.e. do you write mostly "business" apps or do you do any neat stuff?

Not meaning to offend, of course. It's just that for me personally, the fun areas of programming have all required a lot more math.

Re:Depends what programming you want to do (466 comments)

Interesting thing, since you mentioned the P = NP problem. One area of mathematics that is making heavy progress on that problem is (for some reason) Algebraic Geometry. It seems that Mathematicians are as interested in the P = NP problem as we Computer Scientists are. I wonder who will eventually solve it, and whether they'll get a Field Medal or a Turing Award

Graph Theory (466 comments)

If I had to choose one of the two listed, I would go with the first. As a student currently finishing his CS Undergrad I can tell you that discrete maths like Combinatorics and Graph Theory will help you much more than Continuous maths like analysis and calculus. I'm not saying Calculus isn't important -- it is to an extent when you're working with the design and analysis of algorithms, but Graph Theory is something that you should not miss out on.

Graph Theory is used all over CS: it can be used to model network flow, it can be used in AI to represent search spaces, and don't forget that the majority of cool data structures fall directly from Graph Theory. If you're looking for more practical uses, think of the flow of a computer program. You can use vertices to represent states of your program such as assignments, branches, and so on. Connecting these states with edges determines the flow of your program.

Plus, overall Graph Theory is fun to do! The proofs are rigorous, but everything is very easy to visualize. If you're having trouble with a concept, in most cases it's easy to draw up a graph and see for yourself that some theorem holds. All in all, it's quite an experience, and as a Computer guy you'll definitely get more practical uses out of it.

Re:wrong level of complexity (184 comments)

Not the grammar you're thinking of. In Computer Science grammars are used to represent languages, and the sentences that can be represented by them. For example, the language that generates all sentences of the form a^n b^n, meaning n a's followed by n b's.
Grammars in this sense are a collection of rules, such as:
S -> aSb
We say that S is a terminal, and a and b are non-terminals. Now there are restrictions on the types of rules we can have, which creates a hierarchy of grammars, where regular grammars are on one side of the spectrum (one terminal S creates one non-terminal a), and unrestricted grammars are on the opposite side (no rules).
Unrestricted grammars are obviously much more complicated to deal with, but their power is immense. Hence when the grandparent talked about using an unrestricted grammar, he meant that we don't have the power to deal with it, but if we did, hoooo boy

Re:Obligatory... (259 comments)

Would this inverted universe by chance be a cowboy universe? If so, that would be awesome.

We support a small subset of HTML, namely these tags:

- b
- i
- p
- br
- a
- ol

- ul
- li
- dl
- dt
- dd
- em

- strong
- tt
- blockquote
- div
- quote
- ecode

`<ecode> while(1) { do_something(); } </ecode>`