Slashdot Mirror


User: frantzdb

frantzdb's activity in the archive.

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

Comments · 341

  1. Re:Use this link to read article on one page on Bjarne Stroustrup Reveals All On C++ · · Score: 1

    Not forcing you to carry around a size is a feature, not a bug - if you don't need the size, it's just a waste of space.

    In C, the size of the array is there even if you can't get at it. On the stack, the compiler needs to know how big an array is to know where to put the next variable; on the heap, the runtime needs to know how big the buffer was returned from malloc so it knows how to delete it. You just don't have access to that number.

  2. Re:Symmetry on Firefox Working to Fix Memory Leaks · · Score: 1

    First, if that is your memory model, you should be using RAII tools like auto_ptr . Second, unfortunately, there are times when memory usage is more complicated. For example, when there are multiple views of the same object and that object should be deleted only when the views all disappear. I haven't looked into Firefox, but in general, I almost never trust myself with delete; it's too easy to leak memory. Even without garbage collection, you can go a long way with various smart pointers.

  3. 3DConnexion: 6DOF on On the Widespread Misuse of the Mouse · · Score: 1

    It is amazing what the right input device can do for user experience. If you love Google Earth (or if you do a lot of CAD), you should do yourself a favor and get a 6-degree-of-freedom input device (for about $60). It makes using Google Earth with a mouse feel like using OSX with a keyboard.

  4. Re:const x #define on How to Keep Your Code From Destroying You · · Score: 1

    99% of the time when I see a const being used it references the memory location not the constant. Compilers usually do not respect const. As you can cast it to non const and change the value. I have seen people do it.

    That depends. Any time you write to memory that should be const, you are in the land of undefined behavior. Consider this example:

    void muck_with(const int& x) {
      int& y = const_cast<int&>(x);
      ++y;
    }
     
    int main() {
      int x = 0;
      const int y = 0;
      muck_with(x);
      cout << "x now " << x << endl;
      muck_with(y);
      cout << "y now " << y << endl;
    }
    For me with GCC that outputs

    x now 1
    y now 0
    which is to say the constness wasn't completely cast away.
  5. Re:RTFA, baby. on Gifted Children Find Heavy Metal Comforting · · Score: 1

    Bach was more metal than Mozart ever was. For example, his Toccata and Fugue in D minor.

  6. Transfer on Getting in to a Top Tier College? · · Score: 1

    You can always transfer.

    I was a weak student in high school; I was waitlisted at then rejected from Harvey Mudd so I attended Rensselaer for a year. During that year I stayed in touch with the Mudd admissions department; I took classes to make transferring work smoothly, made sure I did very well in all my classes, and even did a bit of research. When I reapplied to Mudd the following year, I was accepted. I attended and got the exceptional undergraduate education and eccentric hard-working brilliant community that Mudd is known for.

    As I understand it, schools have some sort of agreement not to actively recruit transfer students, so you would have to pursue this yourself. At least with a small school like Mudd, the admissions department was happy to help me prove myself. The transfer process seemed much more sane than the rat race that is undergraduate admissions; I was later told by the decision-makers in admissions that they were just hoping my grades were good enough so they could let me in.

    There are no guarantees, but this worked for me.

  7. Re:Doh on Nokia Developing Diamond-Like Gadget Casing · · Score: 1

    Only if it is sufficiently pointy.

  8. Re:Stroustrup is the problem on Bjarne Stroustrup on the Problems With Programming · · Score: 1

    True. Although that's why the standard is getting shared_ptr and why Boost has pointer containers. It's not perfect, but the STL's philosophy of "make it as generic as possible but not without sacrificing performance" is a restriction. Once you are talking about polymorphic objects, then performance is probably not of as much concern.

  9. Re:Stroustrup is the problem on Bjarne Stroustrup on the Problems With Programming · · Score: 2, Insightful

    Until recently, I thought the STL was just a "container library" too. Then I was introduced to the many useful algorithms it includes. An interesting read is Stepanov's Notes on Programming which describes some of the design decisions behind the STL and how it relates to generic programming. There are imperfections, but overall it is a very powerful library and is certainly not just containers - those are just the obvious part.

  10. Re:Stroustrup is the problem on Bjarne Stroustrup on the Problems With Programming · · Score: 1
    The C++ revision committee is dominated by people who want to do l33t things with templates, things nobody will ever do in production code but, they think, are really cool. There's a whole "generic programming" cult of abusing the template mechanism to do computation at compile time.

    You are confusing generic programming with template metaprogramming. Both do l33t thing with templates. Template metaprogramming involves compile-time computation. It has many uses, some more dubious than others.

    Generic programming is about writing data structures and alorithms in such a way that you don't need to write them again later. For example, the STL provides std::max_element which solves the problem of finding the maximum element (or other extremal element based on some other binary comparison) in any collection of things, be it a C-style array, a linked list, or some other structure. The same has also been done for algorithms such as sort and Dijkstra shortest paths. The one major problem with the STL doesn't have to do with generic programming at all. It is that template errors in C++ are very very ugly. This is a known issue and is getting attention.
  11. Exceptional C++ on Taking Your Programming Skills to the Next Level? · · Score: 1

    If you are a C++ programmer, I suggest reading Exceptional C++ and the other books in that series and the corresponding Guru of the Week archive. You can know a lot of C++ and not know much of what's in there. I found I had a much deeper understanding of C++ by reading it and my coding style has changed (for the better, I hope) as a result.

  12. Re:Corruption on Not As Wiki As It Used To Be · · Score: 1

    If worst comes to worst, the GFDL watches the watchmen. If you want to fork Wikipedia with unrestricted editing, you are within your rights to do so.

  13. Re:I just did this in my entire house. on The Light Bulb That Can Change the World · · Score: 1

    Regarding AC, remember that the 100W25W=75W of saved power per light is power that will now not be heating up your house.

    I did the math a while back and recall finding that with normal AC efficiency, swapping an incandescent for a CF would produce energy savings roughly equal to the entire power output of the incandescent.

  14. Semantics on Harvard Phd Vs. About.com over Gaming · · Score: 1

    This is a classic case of confusion between an operational definition and a coceptual definition. Her operational definition of violent video games says that PacMan is violent. The question is: Is her conceptual definition of violence appropriate? If so, does her operational definition follow from that conceptual definition? If not, why not? Is her concept of a violent video games different from yours? If so, how?

  15. Ordinary? on Duran Duran to Perform Virtual Gigs · · Score: 0

    This sounds like anything but an Ordinary World.

  16. Re:When I hear OO ... When I hear Java on Is the Google Web Toolkit Right For You? · · Score: 3, Insightful
    What do you think when you hear "Code Generator?"

    When I hear "code generator", I think compiler.
  17. Re:great idea for toilets! on 'Big Brother' Eyes Make Us Act More Honestly · · Score: 4, Funny

    Watching eyes in bathrooms? You mean like this?

  18. Re:A more in-depth story on entrance exams ... on Chinese Students' Cheating Techniques - Don't Try at Home · · Score: 1

    And for the universities, it probably doesn't predict performance at the university and beyond as well as other metrics might.

  19. Still room for improvement on Evolution of the Netflix Envelope · · Score: 2, Insightful

    That's a fascinating look at innovation. But they still annoy me in several ways in that it's too easy to damage the return mailer while opening it. First, the perforations on the thin flap are too sturdy. Second, the circular sticker is a pain; unless I am careful I wind up ripping the thin layer with my address on it. If the circular sticker were thinner or perforated or had notches in it to act as stress risers then it would easily rip the way it should. Lastly there is, the flap with the adhesive strip on it to seal it. The line of perforations is often stronger than the fold on the other side of the adhesive strip. Several times I have had to tape a Netflix mailer closed because I accidently ripped off the adhesive strip. Simply cutting notches in the ends of the perforation would get it started ripping.

    The fact that there is an "OPEN ALONG EDGE" notice says to me they aren't done innovating. I should be able to open it naïvely the first and get at my disk without worrying about damaging the return envelope.

  20. Re:From an HMC mailing list on MIT Hackers Appropriate Caltech Cannon · · Score: 3, Informative

    I'm qute sure it's real. (Mudd '03)

  21. Lucid Programming? on The 2006 Underhanded C Contest Begins · · Score: 2, Interesting

    I see a lot of utility in a contest like this. As much fun as an obfuscated programming contest is, in a day and age when our critical infrastructure, including voting machines, are running on software, it is important that we be aware of just how difficult it to assure that code does what it should.

    A related contest I would like to see is a lucid programming contest. Given some small but insidiously tricky task, write a program in the language of your choice which solves the problem correctly and which is easy for someone else to understand. It would be interesting to discover which languages excel at this task and what sorts of patterns emerge when emphasis is placed on clarity.

  22. Re:Laptop / Paper what is the difference? on Professor Bans Laptops from the Classroom · · Score: 1
    The only difference is that of technology. The students will still have their heads buried in paper furiously trying to write down everything she says and there will still be no contact.
    True, but I see two distinct advantages of paper: First, paper doesn't have IM or games. Second, and more importantly, paper makes it easy to annotate, write in the margins, draw arrows, circle things, make tables, and draw diagrams, all of which are condusive to learning.
  23. Lexon Tao on Interesting Wrist Watches? · · Score: 1

    I've been pleased with my Lexon Tao. It is an elegant, simple analog watch - only an hour and minute hand - with a twist: the hands come out tangentially from the hub, not radially.

    The only problem is that the case is plated brass so it can be scratched to reveal brass.

  24. Re:Worth it? on Bjarne Stroustrup Previews C++0x · · Score: 1

    It's not ML, sure; perhaps I overstated things. What I meant to say is that careful use of the type system gives one to option to create code that is fairly typesafe. Anyone can come along and write bad C in C++, or break the type system with reinterpret_cast, but you can write "statically type-robust" code in C++, which can't be said of many production lanugages.

  25. Re:Is the C++ standards committee serious? on Bjarne Stroustrup Previews C++0x · · Score: 1
    type deduction using the auto keyword. C++ already does type deduction, so where is the problem? And why should we wait 4 years for compilers to adopt those things?

    C++ only does type deduction for function calls. This would allow one to write auto foo = bar(A, B) and have it compile even if bar(A, B) returns some essoteric templated type based on the types of A and B.

    I think it is Blitz++, a linear algebra library, that does templated magic to eliminate the need for large temporary arrays when doing summation by having operator+(const matrix&, const matrix&) return essentially a continuation. That is, it returns something of type Evaluator<sum, matrix, matrix> . Then A+B+C evaluates to a Evaluator<sum, Evaluator<sum, matrix, matrix>, matrix> , and then matrix has a copy constructor that accepts Evaluator<Op, T, T> things so you can do matrix D = A + B + C; and not have a temporary matrix allocated.

    The auto keyword would allow you to save intermediate results.

    no variable argument lists in templates.

    This may be because variable-length argument lists aren't type-safe. See the Boost format library for an example of a type-safe version of printf.

    I agree with you on most of the rest of those.