Slashdot Mirror


User: bstamour

bstamour's activity in the archive.

Stories
0
Comments
29
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 29

  1. Re:Plain ol' C might a better option on Ask Slashdot: Is C++ the Right Tool For This Project? · · Score: 1

    Your code need not be object oriented, but you can write totally fine procedural code in C++ while gaining value from the standard containers and algorithms, such as vector, dequeue, et al. Think of it as a version of C without the need for malloc/realloc/etc.

  2. Re:The THREE shells: on Microsoft's Asimov System To Monitor Users' Machines In Real Time · · Score: 1

    What about the zeroth law? Would that be something along the lines of "Windows may not harm the profit margins of Microsoft, or by inaction cause profits to drop." So Windows itself can injure members of the board if it's in the best interests of the company :-)

  3. Re:Run a completely new OS? on HP Unveils 'The Machine,' a New Computer Architecture · · Score: 0

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

  4. Re:Not obvious at all it is problematic on The IDE As a Bad Programming Language Enabler · · Score: 1

    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!

  5. Re:I guess you don't understand languages either on Objective-C Overtakes C++, But C Is Number One · · Score: 1

    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.

  6. Re:One good reason... on What's To Love About C? · · Score: 2

    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 .at( ) member function for range-checked access. The operator [ ] is overloaded of course for direct access, in case you need that too. This functionality would be impossible without the ability to use std::size_t as a template parameter.

  7. 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.

  8. Re:Maximize on Do Developers Really Need a Second Monitor? · · Score: 1

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

    Easy: by studying real Computer Science.

  9. Re:end is harder to read on Ruby Dropped In Netbeans 7 · · Score: 1

    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.

  10. Re:end is harder to read on Ruby Dropped In Netbeans 7 · · Score: 1

    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 :-)

  11. Re:So it works the way Stallman envisioned? on Paid Developers Power the Linux Kernel · · Score: 1

    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.

  12. Re:struct vs. class on Bjarne Stroustrup Reflects On 25 Years of C++ · · Score: 1

    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.

  13. Re:Rough times on Oracle's Newest Move To Undermine Android · · Score: 1

    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))

  14. Re:Thank you on Happy 17th Birthday, Debian! · · Score: 1

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

  15. Re:Well frankly on Microsoft Out of Favor With Young, Hip Developers · · Score: 1

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

  16. Re:Sokoban on All the Best Games May Be NP-Hard · · Score: 1

    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?

  17. Re:Sokoban on All the Best Games May Be NP-Hard · · Score: 0

    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.

  18. Re:Depends... on Which Math For Programmers? · · Score: 1

    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? :P
    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.

  19. Re:Depends what programming you want to do on Which Math For Programmers? · · Score: 1

    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 ;)

  20. Graph Theory on Which Math For Programmers? · · Score: 1

    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.

  21. Re:wrong level of complexity on Memristor Minds, the Future of Artificial Intelligence · · Score: 1

    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 :)

  22. Re:Obligatory... on Futurama Rumored To Return On Comedy Central · · Score: 1

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

  23. Re:Obligatory... on Futurama Rumored To Return On Comedy Central · · Score: 2

    Sweet zombie Jesus!

  24. Re:Apple OS != Linux? on Microsoft Sees Linux As Bigger Competitor Than Apple · · Score: 1

    I believe you're mixing up Linux with GNU, which stands for Gnu's Not Unix. Linux, as far as I know, doesn't stand for anything.

  25. Arch Linux on Fast-Booting Text-Editor Operating System? · · Score: 1

    I have been playing around with this very minimalist distro the past few days. I can get it to go from completly shut down to a graphical login in about 35 seconds. This includes grub and everything. Getting it to boot into a text-only login will probably take less time, but I haven't benchmarked it yet.