Slashdot Mirror


User: smellotron

smellotron's activity in the archive.

Stories
0
Comments
1,466
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1,466

  1. Re:Header files on An Interview With C++ Creator Bjarne Stroustrup · · Score: 1

    How is that any better than putting everything in one file, perhaps with a comment separating the declarations from the definitions?

    I didn't intend to argue that it's better than everything in one file; it's just a continuation of the overall conversation:

    I find header files absolutely fantastic, especially for getting an overview of a class and its capabilities _WITHOUT_ using an IDE.

    It's pretty much impossible in C++ too, if the header declares any templates or inline functions, since their definitions have to go into the header file along with the declarations.

    Your statement implies that inline/template definitions clutter the header files, presumably because they're defined inline. I'm just demonstrating that it's trivial to eliminate the clutter. Sure it may be more work than using javap, but it's really not a lot of work.

  2. Re:Is C++ ever the right tool for the job? on An Interview With C++ Creator Bjarne Stroustrup · · Score: 1

    Maybe I've just been using it so long that "integer + float = float" is intuitive to me...

    It is intuitive, as long as you keep in mind that IEEE floating-point is designed as an approximate representation instead of exact. Adding an exact number (integer) to an approximation (float) should produce an approximation. Sometimes you get lucky and the approximation is accurate :)

  3. Re:Is C++ ever the right tool for the job? on An Interview With C++ Creator Bjarne Stroustrup · · Score: 1

    Ruby does the sanest thing and automatically typecasts only in lossless directions, so ints can become floats

    Does Ruby have 64-bit integers? Converting a 64-bit integer to a double-precision IEEE (or 32-bit integer to single-precision IEEE) is lossey.

  4. Re:Header files on An Interview With C++ Creator Bjarne Stroustrup · · Score: 1

    It's pretty much impossible in C++ too, if the header declares any templates or inline functions, since their definitions have to go into the header file along with the declarations.

    Seems pretty easy to me:

    // foo.h
    #ifndef FOO_H // feel free to rag on include guards...
    #define FOO_H

    int rdtsc();

    template <typename T>
    T string_cast(const std::string &s);

    #include "foo.inl"
    #endif

    If you're really curious, I guess you can peek into the implementation, but there's nothing required about it:

    // foo.inl
    inline int rdtsc() {
    // few lines of inline asm...
    }

    #include <sstream>
    template <typename T>
    T string_cast(const std::string &s) {
    std::istringstream s;
    T t;
    s >> t;
    return t;
    }

    If the user doesn't peek into the inl file

  5. Re:Is C++ ever the right tool for the job? on An Interview With C++ Creator Bjarne Stroustrup · · Score: 1

    a.add(b) feels way more like a += b than a + b to me.

    I agree. a.plus(b) at least reads like math.

  6. Re:Is C++ ever the right tool for the job? on An Interview With C++ Creator Bjarne Stroustrup · · Score: 1

    A string plus an integer, if it works, really only has one sane interpretation. ...maybe?

    Maybe not...

    typedef ??? string;
    string s = "12344";
    int i = 1;
    assert(s + 1 == 12345 || s + 1 == "2344" || s + 1 == "123441");

  7. Re:Is C++ ever the right tool for the job? on An Interview With C++ Creator Bjarne Stroustrup · · Score: 1

    ... in C, the bit shifting and boolean operators have precise and well-defined meanings... but in C++, the standard library co-opts those operators and perverts them into something else ...

    I assume you're referring to std::cout << whatever;, but you'll have to remind me where the standard library co-opts boolean operators. I agree that it's possible for someone to futz with that beyond the point of comprehension, but I think if you ever have to stop and ask if a << b is streaming or bit-shifting, you really need better variable names and/or smaller functions. That C++ allows miniature "domain-specific languages" or arithmetic analogues via operator overloading doesn't trump the importance of clean coding for readability.

    I would never suggest that anyone use C++ as a teaching language, I'm with you on that front.

  8. Re:Is C++ ever the right tool for the job? on An Interview With C++ Creator Bjarne Stroustrup · · Score: 1

    How easy is it to mix and match D with C or C++ via shared libraries? I regularly work with C and C++, but if I could experiment by developing an isolated module (shared library + headers) in D, it would be much easier to make that leap.

  9. Re:Too little and too much, way too late on An Interview With C++ Creator Bjarne Stroustrup · · Score: 1

    I wouldn't go so far as to say it's a new language, but IMO Qt is what the C++ standard library should have been.

    I think any C++ "bearded weirdie" will point out that your desire is specifically what makes C++ so great. There's no requirement that you use libstdc++ - go ahead and #pragma GCC poison std and use only Qt*. No wise man will ever begrudge you for preferring one large, opinionated toolkit over the other large, opinionated toolkit.

    * I don't know if that trick actually works with Qt, but it's worth a shot.

  10. Re:What grounds? on Assange Could Face Execution Or Guantanamo Bay · · Score: 1

    So in other words, if NY and CA picked every president, the Midwest and South may as well secede.

    You say that like it should be out of the question. While I imagine it would be very expensive and potentially violent, it's quite possible to consider that at some point the USA will break apart into several smaller nations with an EU-like structure. At that point, all of your wildest dreams will come true.

  11. Re:Way too early on Hosting Company Appears To Be Violating the GPL [Resolved] · · Score: 1

    echo 'void puts(const char*);int main(){while(1)puts("World peace");return 0;}' | gcc -x c - && ./a.out ?

  12. Re:So let me get this straight: on Hosting Company Appears To Be Violating the GPL [Resolved] · · Score: 1

    Both include the ICMPHeader struct with identical field names (not very strong evidence), the struct sequence with identical field names, and the structs nethost and s_nethost which share half a dozen field names precisely--when they do they are in the same order. These three structs are in the same order in each file.

    The functions after new_sequence in the MTR source are, in order, net_send_query, net_process_ping, and net_process_return; the functions after GetNewSequence are SendQuery, ProcessPing, and ProcessReturn.

    Surely there is some tool in academia that looks for isomorphism across two pieces of source code? I mean, the most obvious thing to do when copying someone's code is to rename all of the variables and functions, and maybe trivially futz with the control flow. But if the end result can be shown to have the same "shape" of decision trees, it's either cheating or convergent evolution. Seems you could apply this sort of a tool to source files across WinMTR and MTR.

  13. Re:Bad according to whom on When Smart People Make Bad Employees · · Score: 1

    This may come as a surprise to many, but disagreement does not imply personal conflict.

    I agree with you in general. However, conflict in front of the wrong audience for any reason can be disruptive to an organization. Catching your boss out on a technical mistake may suggest weakness/incompetence/anarchy to some audiences. You and your boss surely know that it's strictly business and not personal, but that doesn't mean everyone else understands. Your boss probably has a political need to present a "unified front" to other organizations or his/her own boss, and in a situation like that I believe "wrong is right until we get back to a whiteboard."

  14. Re:Brilliant Jerks on When Smart People Make Bad Employees · · Score: 2

    A company's purpose is to create profits for its shareholders.

    There are many companies that do not have shareholders.

  15. Re:Common View, Common Error on NJ Server Farms Remake the US Financial Markets · · Score: 1

    BTW, you might like to consider that ALL prices can be considered as bid/ask spreads.

    I've already posted so I can't moderate, but these are great examples.

  16. Re:Common View, Common Error on NJ Server Farms Remake the US Financial Markets · · Score: 2

    I must agree with the GP that if you don't understand something as fundamental as the bid-ask spread, your personal opinion on HFTs (or any other "classes" of traders) just isn't very useful or valid. To put it as a car analogy, it's akin to arguing with your car mechanic, "I don't know what an interference engine is, but I just don't see the value in a timing belt."

    You can read the book Trading and Exchanges if you really want to get into gritty details. Otherwise, if there's ever a term you don't understand I suggest searching for it on investopedia.com. Both of those are very good resources for learning more about the markets.

  17. Re:How Absurd on Does Typing Speed Really Matter For Programmers? · · Score: 2

    I have seen it in the workplace. It's incredibly frustrating to watch a two-index-finger typist write code. That level of typing speed really discourages creativity in the development process, simply because it is laborious to go back and tweak anything.

  18. Re:Why trust your ears? Unless you're blind that i on Electric Cars May Be Made Noisier By Law · · Score: 1

    I never trust my ears when deciding whether to cross the street.

    Nor do I, but people make mistakes. Maybe I looked, saw that there were no cars, but didn't notice someone peeling around the corner or out of a parallel parking spot. My ears have a chance at catching what my eyes miss. That increases my safety, even though I do not rely upon it.

  19. Re:Not on the Wii it isn't on Split Screen Co-op Is Dying · · Score: 1

    In my experience, there's a lot more frustration with 2-player than 4-player. With two people, a jump-on-your-head mistake kills 50% of your team and sends the other 50% on an unexpected trajectory (likely resulting in death). With 4 people, the likelihood of 2 synchronous similar mistakes is much lower, ensuring that at least some fool is left alive. And there's a lot of yelling (laughter-style, not rage-style) with four people sending each other to their accidental dooms. So yeah, way more fun with more people; if you're raging, you're probably approaching the game from too "serious" an angle.

    Plus, the bubble thing someone else mentioned. If you are a hardcore gamer, you shouldn't have much trouble adapting to "bubble when anything bad happens" to reduce your deaths substantially. My non-gamer girlfriend figured that out pretty quickly.

  20. Re:They better hope not on Split Screen Co-op Is Dying · · Score: 1

    ...a few guys meeting after work for a few beers hook up their laptops and have quick game of starcraft.

    Do you genuinely mean the original Starcraft that will run on any modern laptop and includes a spawn mode and UDP LAN play? Or do mean Strarcraft II that will run like ass on most non-techie laptops, requires a $60 account for every player, and doesn't run without Internet access? Because there's a huge difference, and the convenient one is far less popular now that the sequel is out.

  21. Re:Free Software matters. on Opera Goes To 11, With Extensions and Tab Stacks · · Score: 1

    I think that Free Software is better in principle, in theory, and in practice. It's more future-proof than being locked-in to any company's closed-source software.

    I think that Free Software is better in principle, too, but I personally think that Opera as an application has better execution than most other browsers. I am also not too worried about future-proofing of a web browser for a number of reasons:

    • Opera has been around long enough to demonstrate they are not a "fly by night" browser. I trust that they will continue to provide a good closed-source browser just as much as I expect the Mozilla Foundation (in its current form) to continue providing a good open-source browser.
    • Opera supports many platforms, including Linux on the desktop. Brandishing that User-Agent everywhere on the Internet is as good as dollars to many organizations.
    • The presence of multiple browsers forces "future-proofing" of content on the Internet via compliance to published standards. You know what's worse than vendor lock-in to the Opera browser? Vendor lock-in on the entire Internet. Note that if many sites were writing opera-specific features, I wouldn't be too happy about it; but as-is Opera is a good citizen in the browser and web standards community.
    • Auditing the code to make sure a browser doesn't phone home is pointless, when phoning home involves IP traffic. I can monitor that from a tcpdump, or an strace, or even a network tap if I think the browser is a rootkit. So even without source code, the "many eyes" methodology still holds.
  22. Re:Of course it would involve nuclear weapons. on North Korea Says War With South Would Go Nuclear · · Score: 4, Funny

    A zergling rush won't fare well against all of the zealots up there.

  23. Re:Where is wikileaks when you need them on Ex-Goldman Sachs Programmer Found Guilty · · Score: 1

    As the banks have fastest access, tiny transaction times (high liquidity) ensures the banks get first dibs on any better prices -- so in fact it ensures the customer gets a worse price because if there is a better one, the bank will take it and then offer the worse price to the customer. They are also not only trading amongst themselves -- they are using the implicit hedge that the taxpayer will insure their losses lest the bank go under.

    It sounds like you believe that Market Maker = Bank. That is typically not the case for commodity futures and stocks. I haven't heard of any insurance for market makers in the news. In fact, all of the TARP funds seems to be centered around recovering from dangerous OTC/back-room bets, not any activity the open exchanges.

  24. Re:Where is wikileaks when you need them on Ex-Goldman Sachs Programmer Found Guilty · · Score: 1

    (personally I don't see why a whole day would be bad)

    Many institutional investors agree with you. That's why they use Market-on-Close orders. Trading at the closing cross gives everyone a fair "daily price", and it's quite possible to ignore fluctuations within the day.

  25. Re:Pull the plug ... on Ex-Goldman Sachs Programmer Found Guilty · · Score: 1

    If I pulled some nonsense like this with my ISP or other service provider, they'd have something in their TOS to throw me off the system for making bogus requests.

    I assume you're referring to "quote stuffing", which the SEC is pursuing aggressively. Just like your ISP. Also just like your ISP, it's not always clear-cut whether high-volume activity is reasonable (market making with rapid quote changes, or an Ubuntu .torrent) or unreasonable (intentional quote stuffing, or the latest **AA movie .torrent). It requires content analysis, and knee-jerk reactions are just as dangerous as inaction.