Slashdot Mirror


User: SpinyNorman

SpinyNorman's activity in the archive.

Stories
0
Comments
2,321
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 2,321

  1. Re:Okay... on Symbian Foundation Takes First Step In Open Sourcing Mobile OS · · Score: 4, Informative

    You should soon be able to use Qt for Symbian development.

    Nokia own both Symbian and Qt, and the Qt labs blog is reporting Qt being ported to S60.

    http://labs.trolltech.com/blogs/2009/06/29/port-of-qtwebkit-to-s60/

    Note that Qt is an entire cross-platform library, not just for GUI - it includes stuff like threads, network comms, XML even WebKit!

  2. Re:Seeing as NASA put a value of $0 on it... on NASA Plans To De-Orbit ISS In 2016 · · Score: 2, Interesting

    I seem to recall reading that the automated supply vehicles the Russians periodically send up to the ISS do routinely push it back up into a higher orbit, and I'll bet the cost of this is low enough that it'd be viable to keep doing this indefinitely, paid for by space tourists.

  3. Re:Compare it to your car on NASA Plans To De-Orbit ISS In 2016 · · Score: 2, Insightful

    Except that it's not rusting nor are the few moving parts on it even a fraction of the cost of the whole the way they are on a car.

    A better car analogy would be that you've got vintage Bugatti with almost zero mechanical wear on it that you've been restoring and pouring money into for the last decade or so. You just sourced a brand new engine for it at massive cost last year, paid millions to have brand new titanium transmission built for it (to Bugatti factory specs) the year before.

    Your future plans include similar expenditures for the next five years, after which you plan to take a ceremonial shit on it and torch it.

    Makes sense, eh?

  4. Seeing as NASA put a value of $0 on it... on NASA Plans To De-Orbit ISS In 2016 · · Score: 1

    How about selling it to the Russians for $1. Use the cash windfall to send a postcard to a random taxpayer saying "Sorry we fucked up".

    The Russians kept Mir in orbit for ever, so I'm sure they can keep ISS up on a fraction of what NASA was pissing away on it, and can no doubt make a healthy profit keeping it full of space tourists. Maybe they can occasionally sell a spot to a NASA scientist if NASA can remember why they wanted to build it in the first place, and can figure anything useful to do up there.

  5. Re:No mention of X-platform on Mono Outpaces Java In Linux Desktop Development · · Score: 1

    For the consumer to be able to call 'p.sig.X', you'll have to give it the producer's class definition so it knows about 'sig'. Put your Consumer and Producer in separate files and see what kind of #includes you'll end up needing to make it work.

    Yeah, to use QButton I'd have to #include qbutton.h in myWidget.cpp ...

    If you want to salvage anything out of this, I suggest you go read up on C# delegates, and then ponder if Qt's signal/slot mechanism would be needed if C++ had such a mechanism when Qt was designed (it still doesn't), then come back and reread this thread. Rename MemberCallBack as DelegateCallBack if it helps...

  6. Re:No mention of X-platform on Mono Outpaces Java In Linux Desktop Development · · Score: 1

    No, all Qt does is put a string lookup table inbetween producer and consumer. You could modify the example I gave to do the same if you want to (without modifying either Producer or Signal) just by creating an appropriate CallBack subclass, similiar to the method delegate one I demonstrated.

    Making a connection in Qt takes the form: connect(producer, signal, consumer, slot), and it goes without saying that making a connection between two things is always going to require specifying what those two things are!

    You apparently not only don't know templates, but you can't even read basic C++ code. The Producer class knows **zero** about what, if anything, is going to connect to it, or how they are going to do it. All it knows is that to emit a signal it calls Signal.emit(). The Signal class also knows **zero** about what and how anyone is going to connect to it - only that they will do so by providing a CallBack subclass that somehow does it. It has no way to know that we're going to pass a member delegate (as I demonstrated), or hook it into a lookup table at Qt does, or maybe send a TCP message across the world to a receiver object.

    Too bad that as a beginner you arn't better aware of what you know and don't know. I've been programming professionally for almost 30 years. Being using C++ for the last 10 years. I do, unlike you, actually know this stuff.

  7. Re:No mention of X-platform on Mono Outpaces Java In Linux Desktop Development · · Score: 1

    that 'typename' keyword you use in your example is itself a "fairly recent" addition to the C++ Standard,

    There are two totally unrelated usages of the "typename" keyword. In this usage it's 100% synonymous with "class". I just used it for clarity - I don't like calling things "class" unless they are classes.

    In other words - just substitute the old "class" for "typename" and it will work the same.

    Also, I don't believe your example really qualifies as "loosely coupled":

    Huh? The connection is made entirely external to, without modifying and without the knowledge of producer or consumer! How could it possibly be any more loosely coupled? You obviously don't understand what the term means.

  8. Re:There is no guarantee of Free speech in the UK on British Men Jailed For Online Hate Crimes · · Score: 1

    Well, given that UK law is based on common law, that rather goes without saying. It doesn't mean anything.

    If you want to compare UK vs US regarding freedom of speech, the only meaningful question is what law is enforced, not whether it's based on a system of promises (which can be overridden when the government chooses) or not.

    e.g. Say you're an extremist muslim cleric condoning the 9/11 attacks - will this get you arrested in the UK or US? I'd say that under Bush at least there's a fair chance you'd gave gotten a visit from the men in black, while in the UK more likely Tony Blair bringing you a cup of tea.

    Comparing the "promises" of the UK vs US legal system, I'd much rather have the reality of haebus corpus in the UK vs the reality of potentially being held indefinitely in the US regardless of what the constitution "promises". Of course the UK has gone horribly soft on crime in recent years, which isn't a good thing either.

  9. Re:The US has limits on it too. Thankfully. on British Men Jailed For Online Hate Crimes · · Score: 1

    The point is that they are not constitutionally protected, hence states and local government not only can but do take away all sort of these things that people in the rest of the world regard as basic freedoms. The fact that it's local rather than federal government taking these freedoms away is no consolation. These are things that you really feel in your everyday life in the US if you've ever experienced anything different (I lived in the UK until age of 25).

    OTOH from having lived the last 20+ years in the US, I've got to say that I've never felt for a second there was greater freedom of speech in the US, and in fact during Bush's second term and since I've felt the need to be watchful what I say online because I don't really feel we DO have freedom of speech in the US anymore. I also read militant Islamic clerics spouting anti-British hatred in the UK and wonder why on earth the UK has *so much* freedom of speech to allow it rather than just deport them!

  10. Re:whats the crime in hate crime? on British Men Jailed For Online Hate Crimes · · Score: 2, Insightful

    As for the whole "proud to vote for a black man" thing ... that IS racist. If you're more proud to vote for a particular candidate due to his race, you're a bigot, regardless of whether he's black, white, green, or purple.

    Rubbish. You don't need to be color blind not to be racist.

    I think the sentiment more expressed, or felt, than "proud to vote for a black man" was "proud that we (Americans) elected a black man", and you have to be totally ignorant of American history to see why people would not be proud of this and the progress it represents. The pride wasn't in electing a man because he's black (which would be racist), but in electing him despite it.

  11. Re:The US has limits on it too. Thankfully. on British Men Jailed For Online Hate Crimes · · Score: 2, Interesting

    Well, this case was about two British guys running an anti-Jew hate site (including photos of dead Jews). There's nothing in the least bit idealistic or defensible about it other than the moronic "free speech! we must allow everything!" cry.

    If a rogue US scientist got convicted of passing nuclear know-how to a terrorist group, what's the betting the ./ mob will be howling at the idealistic outrage of it. He was an American! He had the right to say whatever he liked in that e-mail!

    I've often joked that programming is a disease as much as a profession exactly because the logical thought patterns do tend to spill over into real-life where they are grossly inappropriate. A or B, free or not, may make sense in a program but shades of grey and intelligent discrimination tend to work better when dealing with humanity (you know, that carbon based stuff).

  12. Re:The US has limits on it too. Thankfully. on British Men Jailed For Online Hate Crimes · · Score: 1

    It's not that simple.

    The US constitution was never meant to be a static document to be inviolate for all times.

    If you ever visit Washington DC, then go to the Jefferson Memorial building on the tidal basin, and see what Jefferson himself had to say about it. To summarize, he basically says that he's not a fan of rapidly changing laws, but nonetheless it is necessary to change them and improve them as man advances so that as society becomes more civilized the law can also advance.

    I very much doubt that Jefferson, or any other of the authors of the constitution, would deny that technology of the 21st century has changed the needs of the law. They didn't imagine a world where communications and free speech was not just about what one man said in the town square, or sent by horseback messenger to a correspondant, but could include mass-communication via the web and television, and could include subject matter so technologically powerful (e.g. nuclear secrets) that free speech would be trumped by other concerns.

    Of course everyday law is about case law and precendent (in practice, as much in the US as much as in the UK), and the constitution is therefore not the directly applicable law of the land. The fine-grained decisions that the lower courts handle on a day-to-day basis are necessarily far more complex and contradictory than the few guiding principles of the 1st amendment, and even without the need for the law to change with society this is where the real need to interpret the law comes from.

  13. Re:The US has limits on it too. Thankfully. on British Men Jailed For Online Hate Crimes · · Score: 1

    FYI, regarding that last sentence, I'm a dual citizen who's been living in US for the last 20+ years.

    The sad thing about most Americans is that their level of knowledge about other countries is so low that that they really believe they have more freedoms. You know in the UK you can actually walk down the road with your dog off the leash, take him into the pub if you want, then go home and burn some brush in your back yard. You can even go crazy and let off fireworks on Nov 5th, and buy some wine at the supermarket on a Sunday! Can you imagine?!!

  14. Re:The US has limits on it too. Thankfully. on British Men Jailed For Online Hate Crimes · · Score: 1

    "incitement"... Does that preclude the existence of free will?

    It takes a bit more than that to prove it (the illusion of free will), but feel free to mention it in your paper.

    Thanks for asking.

  15. Re:The US has limits on it too. Thankfully. on British Men Jailed For Online Hate Crimes · · Score: 1

    Dude, try to read a post before replying to it.

    I didn't say "Freedom of speech isn't a right" - I said "Freedom of speech isn't a right that overrides all other laws".

    It's kinda like the way you have the right to swing a baseball bat, but not into someone's face. Maybe you agree.

  16. Re:The US has limits on it too. Thankfully. on British Men Jailed For Online Hate Crimes · · Score: 1

    Maybe as an American you should try exercising your "freedom of speech" in one of the myriad ways that also violates the law, before concluding that being American would make any difference. Extradition laws go both ways, so don't expect the Brits to save you either if you managed to jump bail after being convicted and left the US.

    I can just see you in central square standing on a soapbox shouting out threats to the president, describing sex acts with children, and screaming racial insults at passers-by, then foaming at the mouth with outrage as the police lead you away. "Get your hands off me! I'm an American! I have freedom of speech!".

  17. The US has limits on it too. Thankfully. on British Men Jailed For Online Hate Crimes · · Score: 4, Insightful

    "Freedom of speech" in the US doesn't mean you can say whatever you want either. If you endanger other people by what you say (e.g. shout "fire" in a crowded theatre, incite others to murder, violence) there are consequences. If you slander someone there are consequences. If you lie under oath there are consequences.

    Freedom of speech isn't a right that overrides all other laws, not should it be.

    I'm amazed not only that this story was posted to /. but also that so many apparently have sympathy for these losers.

  18. Re:No mention of X-platform on Mono Outpaces Java In Linux Desktop Development · · Score: 1

    Fundamentally I agree - the Trolls needed to work with what was commonly available at the time Qt was designed.

    However, you can do loosely coupled member callbacks in C++ without using anything too sophisticated. All you need is basic template support and member function pointers. The code below compiles and works with gcc 3.4.5 (i.e. a fairly old one).

    #include <stdio.h>
     
    // Define Signal class, emitting virtual CallBack class callbacks
     
    template <typename Param>
    class CallBack {
    public:
      virtual void operator()(const Param &p) const {}
    };
     
    template <typename Param>
    class Signal {
    private:
      const CallBack<Param> *callBack; // Or a list of callbacks, if you want
    public:
      Signal() : callBack(NULL) {}
      void setCallBack(const CallBack<Param> &cb) {callBack = &cb;}
      void emit(Param p) {(*callBack)(p);}
    };
     
    // Now sublcass CallBack to allow use of class member functions
     
    template <class Object, typename Param>
    class MemberCallBack : public CallBack<Param> {
    public:
      typedef void (Object::*MemberFuncPtr)(const Param &p);
    private:
      const Object *object;
      const MemberFuncPtr memberFuncPtr;
    public:
      MemberCallBack(const Object *o, MemberFuncPtr mfp) : object(o), memberFuncPtr(mfp) {}
      void operator()(const Param &p) const {((*((Object *) object)).*memberFuncPtr)(p);}
    };
     
    // Example usage
     
    class Producer {
    public:
      Signal<int> sig;
    };
     
    class Consumer {
    public:
      void slot(const int &i) {printf("%i\n", i);}
    };
     
    int main(int argc, char **argv)
    {
      Producer p;
      Consumer c;
     
      p.sig.setCallBack(MemberCallBack<Consumer, int>(&c, &Consumer::slot));
      p.sig.emit(42);
    }

    If you don't like the appearance of that setCallBack() call, you could always define a template function that would return this MemberCallBack constructor for you, and thereby let the compiler deducde the template parameter types for you.

    Nowdays you could use the new C++ function objects (tr:func), which will be part of the C++00x standard.

  19. Re:No mention of X-platform on Mono Outpaces Java In Linux Desktop Development · · Score: 1

    I've seen the connect() declarations, but never really wanted to look at all the Q_OBJECT related macros. It works...

    It is possible to use a 3rd party signal/slot libary, like Boost Signals, with Qt, but there's not much benefit in terms of prettyness since it still requires Q_SIGNAL/SLOT/EMIT preprocessor pseudo-keywords. I'm not sure what it'd take to ditch the entire Q_OBJECT meta-object approach... designer obviously needs some form of inspection and property support.

    Still, given the enormous benefits, functionality and pleasure of use of Qt, this is really a minor gripe.

  20. Re:No mention of X-platform on Mono Outpaces Java In Linux Desktop Development · · Score: 1

    I guess you could call him an architect - that's Miguel de Icaza you just tried to insult.

  21. Re:No mention of X-platform on Mono Outpaces Java In Linux Desktop Development · · Score: 1

    That does look ugly, but is it that just for making signal/slot connections, or do stringified method names get used elsewhere in Qyoto too?

    I've got to say that, even as a Qt fan, moc and the signal/slot implementation in Qt don't feel so great in C++ either. I wish they'd deprecate it in favor of a pure C++ alternative (like Boost Signals, for example). Presumably there are better ways of implementing something similar in C# too.

  22. Re:No mention of X-platform on Mono Outpaces Java In Linux Desktop Development · · Score: 4, Informative

    Think of network sockets, file access, threads, and a bunch of other things that quite frankly are annoying to do in C or C++.

    Not if you use Qt which has all of those and more in addition to the GUI stuff.

    Qt is a cross-platform library, not just a GUI library.

    Qt-based apps run on Linux, Windows, Mac, Solaris, Symbian S60 ...

    What are you using for the GUI in Mono? Windows Forms? You could have the full power of Qt via Qyoto...

  23. Re:Competition is good, baby! on Google Announces Chrome OS, For Release Mid-2010 · · Score: 1

    Odd rant - totally unrelated to the point being made.

    By common usage "Linux" refers to the whole thing, not the kernel, however much more correct that would be.

    I'm not saying it's a good thing or a bad thing that Chrome's not Linux. It's just not - that's all!

  24. Re:But of course... on Microsoft Puts C# and the CLI Under "Community Promise" · · Score: 1

    That's interesting - I didn't realize that people were using it for it's own sake.

  25. Re:Why a process? Surely a thread would scale bett on Firefox To Get Multi-Process Browsing · · Score: 1

    Forking a process on unix-like systems if fairly lightweight but for Windows this will not scale well at all. Why not just have rendering worker threads? Have I missed something?

    One of the main reason's threads are more lightweight than processes is because they share an address space (so it's cheaper to switch between threads - you don't need to reload page tables), but the downside of that is that one thread can corrupt another. Processes don't share memory hence they are better isolated from each other.