Slashdot Mirror


User: MeerCat

MeerCat's activity in the archive.

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

Comments · 236

  1. Moderators please mod the reply up.... on Space-based Power Generation · · Score: 0, Offtopic

    'cos he seems to know more about it than me, but being an AC he's sitting at 0....

    T

  2. Permanent eclipse generator ? on Space-based Power Generation · · Score: 1

    Apart from the terrorist risks of controlling the beam....

    I take it the idea is to make it geostationary so it always beams to the same spot, in which case you're only going to generate power during the daylight hours, so the only benefit over earth based solar cells is that it's above the weather (cloud cover), but then you'd have to beam your energy down thru - oh dear - exactly the same weather...

    Or you try and get an orbit so it's permanently facing the sun - is there such an orbit ?? and do what, charge batteries and beam the power down at regular intervals ?

    Any way you do it, if it's big enough to be useful, then I take it that it'll be visible to the naked eye from earth. So will we get eclipses from it (even if very brief) ? Now that's cool - book me a seat on my birthday !!

    T

  3. Re:Question about Steven's comments in Dr Dobbs... on TrollTech Releases Qt 3.0 · · Score: 1

    Actually I *want* the users to be able to create the objects on the stack

    Without looking at exactly what you want to do, the usual answer in C++ is "add another level of indirection". Make a handler class that people can make and destroy on the stack or the heap as they want, and make that handler class manage the real resource - look at "smart pointer" classes to see how best to do this generically, or you can use hand-coded or template classes if you only have a few classes that need wrapping.

    I have tried to stop the copy & assignment by making them private and undefined. Unfortunately the stupid MicroSoft VC++ does not like this

    Are you sure ?? This technique has been around for 10+ years, I can't see (even) MS breaking this. I presume you're getting a link time error, in which case it means someone is actually trying to call the CC or AO !! I'd check your code, and if necessary get a port of NM (such as from MinGW to let you examine your object files to see who's listing the CC or AO as a unresolved symbol....

    T

  4. Re:Question about Steven's comments in Dr Dobbs... on TrollTech Releases Qt 3.0 · · Score: 1

    Maybe I'm missing something, but I believe in Qt you can call setAutoDelete( FALSE ); [...] Did I miss something ??

    Hey, I'm just asking the questions - I know nothing much about Qt except what I've read, and I'll freely admit it !!

    But from what I've seen of the doucmentation I think the setAutoDelete() only applies to the Qt container classes (those derived from QCollection), whereas we're talking about the GUI framework classes (which derive from QObject).

    Thanks for heads-up, all these contributions at least let me know that either what I see as a problem tends not to be a problem in practice, and that there may be ways to avoid it that I can investigate anyway.

    Cheers

    T

  5. Re:Question about Steven's comments in Dr Dobbs... on TrollTech Releases Qt 3.0 · · Score: 1

    Exposing nuts and bolts because you think it might otherwise confuse people doesn't work

    I work on the basis that you expose only those functions that people are allowed to use - if they're not allowed to make and delete objects in every way they want, then you make the ctor and dtors not available, and expose them via an object or class that controls what you can or can't do. For example, I wrote a smart-pointer based framework for working with databases that had all objects as const objects, the only way to get a non-const pointer to an object was to make a Transaction object and ask that to get you a non-const pointer - it actually gave you back a modifiable copy of the object, locked the original object to prevent it taking part in another Transaction, and then the Transaction object could give you Commit and Abandon functions that would write your copy over the original or discard it. The point of it was that it controlled what you do and when - you couldn't call a non-const member of an object without starting a Transaction... Transactions abandoned themselves unless Committed before destruction, lots of code could share objects knowing that there were language-enforced rules governing what changed what.

    [ Don't get me started on the problems of programmers trying to figure how to get the right parameters to call the public method OnPaint() because it's not obvious that in fact they should simply be calling InvalidateRect().... ]

    Feel free to email me if you want to push this discussion further

    Thank you for the offer, I may well do so... I'm not after "proving I'm right", but I'd like to take a little of your time to ask you more about whether Qt is, in fact, for me for a rather interesting but large product idea I have in mind....

    Cheers, and thanks for the answers so far...

    T

  6. Re:Question about Steven's comments in Dr Dobbs... on TrollTech Releases Qt 3.0 · · Score: 1

    My toolkit fltk does things similar to Qt: when you destroy a "containier" widget it destroys all the inner widgets for you, even though you had to use "new" to create all those child widgets.

    So why not make a rule that in all these classes the constructors are protected (so they can be derived from) and they also declare a friend of a template class that just makes instances. This means that users of your library can't make instances directly (so they don't accidentally make them on the stack), they always have to do something like...

    MyObj * p = Helper::MakeNewOne(args);

    Not the prettiest in the world, but hell, I've seen STL and ATL and the above is not too bad.

    Why do this ? Well, reading the code I can see that I asked for it to be made, but I didn't actually new it, so presumably I'm not the one to delete it (we actually made the destructors protected too). It also prevents me from making one on the stack (part of the "if I shouldn't do it, then I shouldn't be able to it" philosophy), and it puts the onus on those deriving new classes to follow the rules, rather than those USING the classes - and deriving is always less common and a more responsible task than using ....

    Just a thought, but this is the sort of thing I try to do with my own code (for example, a shared-create-on-demand-freed-when-scarce-resource ) and it makes it much easier for people to use a class if they know that anything that they CAN call they are ALLOWED to call... and it makes it easier for the class designer because he knows that his class can't be misused.

    Compare this to the deep-copy / shallow-copy problem : the way we fix that is to make the Copy Constructor and Assign Operator private and undefined - that way you use the language to prevent misuse...

    Cheers

    T

  7. Re:Question about Steven's comments in Dr Dobbs... on TrollTech Releases Qt 3.0 · · Score: 1
    I suggest you take a look at the Qt tutorial, it seems you're just building your opinion on Al Stevens' article

    I did look at the tutorials (they tend not to talk about it too much, I also have 2 books on Qt and one on KDE), and I have read the article, but nothing compares to using-in-anger-for-6-months (which I haven't done) or, failing that, asking those who have done so.... ;^)

    this is not a leak, because box owns the labels

    I know this, but the point is that when reading the code I have to know this - every time. What if I read the code of one of my colleagues and he makes an instance of class MyHandyClass and then doesn't free it ? I now have to look at the class definition to see if it is in some way derived from a Qt class to know if this is a bug or not... I'm not doubting that it can work (hell, I've seen all sorts of nasty code that works) but it doesn't make for code that can be easily seen to be correct - and that makes for code that is hard to maintain.

    every C++ project above 2 kloc has to set some memory management policy for some classes

    Exactly, and the bigger the project the more you aim to have one policy to bind them all. I don't like cosmic class libraries because they force their policy on all my code, similarly I'm not too keen on those that break the core language idioms.

    you are still perfectly allowed to delete a widget, it will unmap itself and tell his parent about it

    Ah, now that's very handy to know. So when Stevens says:
    If you instantiate a widget on the heap as you must but then delete it yourself, as you are conditioned by your proper upbringing to do, the program fails when the parent deletes the widget a second time. Another heap of trouble.

    then that's wrong ? Again, I'm not being sarcastic, I just want to know....

    you generally don't "set" widgets

    True, but I was simply illustrating a common example of a bad class design practice that can work, but tends to break over time - that is giving a resource to someone else to manage. The usual C++ practice, from the C practices before it, is "you are responsible for what you make".

    Cheers

    T
  8. Re:Question about Steven's comments in Dr Dobbs... on TrollTech Releases Qt 3.0 · · Score: 1

    It doesn't break it, it hides it from you. That's what any good library should do, hide the complexity from the programmer [...] This is like saying std::string is bad because it frees you from allocating and freeing char arrays.

    Well, YMMV, but from my point of you it doesn't hide it from me - I still have to allocate it but remember not to free it (cf std::string which looks after both parts), and this is in contrast to every other resource I allocate, so it costs me mental space to remember the exceptions (to the rule, not "C++ exceptions").

    Note that I'm not denying that you may be able to live with it, I'm just pointing out that I can't without something to help (thanks for the reply anyway) ... see also my longer response to another's reply...

    T

  9. Re:Question about Steven's comments in Dr Dobbs... on TrollTech Releases Qt 3.0 · · Score: 3, Interesting

    Having looked at MSFC (yuck!), GTK and Qt, I find that Qt is the toolkit that makes UI programming the easiest

    I agree MFC is nasty (I almost had to use Glockenspiel CommonView 10+ years ago, and MS just stole the entire team to write MFC version 1 - I'd already written my own C++ wrapper by then).

    except for two things [...] You don't have to bother deleting Qt Objects. It's done by Qt [...] How is this bad?

    When you have a large body of code evolving over a period of time, you often want to check such things as resource leakage. This normally means checking that all allocations match up with deallocations (with a GC-ed resource you do this by checking all your GC code works and by checking people use the GC properly). You check this by matching up alloc and de-allocs of whatever resource it is.

    If you have a single block of code that runs

    alloc resource
    use resource
    free resource

    then you can easily see that this resource is handled properly (ignore true exceptions for now).

    On the other hand

    alloc resource
    if resource allocated
    use resource
    free resource
    end-if

    is also correct, but

    alloc resource
    use resource
    if some-condition
    free resource
    blah-blah-blah
    if some-other-condition
    free resource

    is usually wrong - it breaks the idiom - reviewing this code should set off alarm bells as allocs and frees don't directly match. If the code is genuinely correct (say the 2 conditions are mutually exclusive) then you have to mark it in some way to say "this misuse of the idiom is correct" - often you "mark it" by refactoring the code to use the idiom

    alloc resource
    use resource
    do-the-commonstuff-here
    free resource

    In C++ the standard idiom is "object construction is resource allocation", and this makes exception handling and some of the refactoring easier - you allocate the resource in the constructor and free it in the destructor. Again, for the reader/reviewer it is easy to see where allocs and frees match up and prove the use is correct

    class blah
    {
    blah() { alloc resource }
    ~ blah { free resource }
    reset { free resource; alloc resource }
    }

    Again, this is not language specific, but idioms that make it easy to see when your code is correct. That's why adding a function to the above class

    set(r) { free resource; resource = r; }

    is nasty - you have an unbalanced freeing of a resource so to prove its correct you have to show that everyone who calls set knows how to use it properly. This seems to be the Qt idiom.

    How is this bad ? Add 5 years of development with a rotating team of 10 developers (say turnover of 2 a year) and management, and a medium sized code base of 250,000 lines of code across 25 libraries and a dozen executables.... it's 10pm on the night before a release - do you know where all your allocs and frees are ?? On a small project or a small codebase you can hold it in your head "don't worry about these special cases" but in the larger case it makes for problems, and I put enough bugs in my own code without idioms that encourage me to introduce more. I can think of ways to code around it (a wrapper that allocates the class and gives it to the Qt framework, a bit like auto_ptr) but why doesn't Qt do this for me ?

    Long answer to a short question - sorry....

    T

  10. Re:Porting not an option on No GNOME For Solaris 9 · · Score: 1

    5 years ago, only a small subset of C++ was portable in the real world. Things have improved a lot,

    This is not meant to be sarcastic, but are you sure about this ? 5 years ago I worked in developing a C++ multi-platform shrink-wrap large app, and we found the compilers had pretty much settled down (the ones you paid for, anyway). Templates were sort of settling on a common set of ideas as Stroustrup stopped changing his mind, and the ANSI C++ implementation was pretty solid (we standardly compiled with 7 compilers on 4 platforms). Things like exception handling were still experimental and so not in commercial use.

    But it seems that now all the changes that STL has forced into templates and the like have meant that cross compiler portability is out the window (just reading Meyer's Effective STL for instance)... not to mention made a mess of reading what was quite an elegant language, but now I'm veering towards flamebaiting...

    T

  11. Question about Steven's comments in Dr Dobbs... on TrollTech Releases Qt 3.0 · · Score: 2, Interesting

    Not wanting to troll, but in October's Dr Dobbs (pages 105-107), Al Stevens points out what he doesn't like about Qt - primarily the way that the framework breaks the "new/delete" idiom. In particular, widgets must be allocated on the heap and then given to the framework to manage and delete. (When I last looked at Qt I though the same sort of thing but thought maybe I was being a little too snobby and showing my age).

    As I said, I don't want to troll, but for those who're using Qt/KDE is this a big concern ? Do you write a handler wrapper class around widgets that hides this mis-match, or do you just live with it ? Does it only happen in one or two spots ? Is short - how do you change your practices to match the toolkit ?

    He also dislikes the metaobject compiler and a few other items, but I'm less concerned about those...

    T

  12. Microsoft don't want you running old versions on Microsoft Shuts Auction Doors On Old Windows · · Score: 2, Insightful

    Why Microsoft is so worried about old software puzzles me

    Apart from all the valid points contributed so far about ownership etc. I'd also point out that...
    MS don't want you running old software, they want you to buy new software, and then pay to upgrade, and pay to upgrade it continuously.

    New MS software in one area tends to force you to use new software elsewhere (XP ? Better upgrade to Office XP as 2000 is being phased out and might have problems. And IE6, as 5 may not run properly. Oh, and that include WMP, maybe you'd better buy something else too) - its called locking in the users and raiding their wallets.... and thats the part of their business model that I find unethical.... (wanna run IE, its free, but the new version with the bug fixes needs a new version of windows)

    T

  13. Re:Wait for the Panasonic on Which DVR - Tivo or ReplayTV? · · Score: 1

    Ah, I see they were a week before me, never mind better luck ! See, I can now prove to my boss that the problem is I don't read slashdot enough...

  14. OT: Re:3 in a row!!! on Nokia 5510 - Cell Phone and More · · Score: -1, Offtopic

    Um, either you're stupid or super-stupid but when you moderate and then POST to the same story it doesn't count.

    Thats why I modded him down in other story FP attempts, but not in this one (I saw someone else did it first, hence the thought that maybe there are a load of moderators sitting around doing their own first-moderation competition, waiting for the first idiot to show up, but silently).

    Plus, you're a jackass.

    Maybe... but I've been worse ... (does a personal insult from CmdrTaco count as + or - karma ??)

    T

  15. Re:3 in a row!!! on Nokia 5510 - Cell Phone and More · · Score: -1, Offtopic

    Mate, I'm just sitting in each empty story waiting for you to appear (you're a bit slow) so I can moderate your arse down....

    Notice how you never see any "first moderation" posts ??

  16. Wait for the Panasonic on Which DVR - Tivo or ReplayTV? · · Score: 1

    Personally I'm waiting for this to appear on the shelves in the UK - 52 hours on the hard disk and a DVD-RAM burner in the same box.... (I submitted it as a story a few weeks back, but it was rejected).

  17. Re:Collection of icons on New Themes.org Almost Ready; Needs A Little Help · · Score: 1

    Try the following sites - some icons are lame, some are not free etc. but there are a load of ideas at least...

    http://www.iconbazaar.com/
    http://www.iconarchive.com/
    http://www.everyicon.com/

    T

  18. Re:User Productivity (Good Device Detection) on A Visual Comparison Between XP And Mandrake · · Score: 1

    Follow-up to myself (first sign of insanity).

    According to Raskin a key part of a humane interface is that it considers the user input sacred and always preserves it (whereas its own work is of lower value as it can be repeated or recreated). PnP (in its current guise in certain OS) fails this test - I tell the OS what hardware I have, and it overwrites this next time it boots.

    T

  19. Re:User Productivity (Good Device Detection) on A Visual Comparison Between XP And Mandrake · · Score: 1

    Point taken that ISA makes it slow, but I still think the idea is stupid. I used to tell Windows what type of monitor I had, later it would guess using PnP on the spare pins of a DSUB cable, but now when I attach a monitor using BNC cables then I can't tell it what the monitor is any more - it's either PnP or nothing. Similarly it forgets about my external modem on COM1 - I used to tell it, configure it, and leave it, but now the OS seems to think that if it can't personally verify details every time it's booted then it sure as hell won't believe me.

    PnP is nice, but unless I can override it then sooner or later it's a Jerry-Pournelle-style pain in the arse (where you end up trying to trick the PnP into believing whats really there but not in the way it thinks).

    My hope is that as Linux/KDE/GNOME/what-ever moves ahead it doesn't repeat these errors (see also Intelli-sense, wizards, and other non-repeatable non-automatable schemes designed to assist the user but end up getting in the way when you know what you want to do) in the interests of supposed "playing catch up".

    T

  20. User Productivity (Good Device Detection) on A Visual Comparison Between XP And Mandrake · · Score: 1

    Is it just me, am I a luddite, or is plug-n-play really a Bad Idea ? Every time I boot my Win2K machine, it wastes 30 to 40 seconds of my time checking to see if I've plugged in some new hardware. Over a year (esp. given the number of reboots needed) this wastes my time - given that I only add/change hardware say twice a year.

    The fact that it keeps losing my external modem so I have to waste another 30-40 seconds doing a manual "re-scan for changes" just rubs salt into
    the wound.

    I'd be much happier if plug-n-play type features just remembered the last setup until I told it "hey I've changed something" or "hey, I'm shutting down now, when I reboot expect the hardware to have changed". Now that's a Device-Detection feature I'd say is worthwhile.

    And yes, I run SuSE on my laptop, and I have a RedHat Sparc too, but some of us have to work on Windows too.

    T

  21. If its like "The Joy of X".... on Joy of Linux · · Score: 2

    .. then I'll buy it.

    The Joy of X is a superb book - a little old but a great book about the hows and (more importantly) the why's of X, and had a better pun in the title (92, before computer books had much of a sense of humour).

    T

  22. OT: Re:Investment bank IT -- on Shared Source? · · Score: 1

    I work for investment banks in the UK, and I've tended to work for the Europeans rather than the US banks, but sure, I can fill you in.

    If want background on investment banking, read Liars Poker by Michael Lewis (for the culture/anecdotes/jargon/bullshit) and An Introduction to Global Financial Markets by Valdez for an intro to how global financial markets work.

    There are loads of other books, but these 2 are cheap, timeless and everyone in the City knows them. If you can't at least mention them in passing then it marks you as a newbie.

    As for the banks, in short, the money's good, the technology is stupid (every snake-oil system ever sold), the bullshit is thick and fast, the politics is somewhat stupid, and the average quality of staff is incredibly low, but they'll be pretty good at pushing you into corners. Oh, and the banks all think they're bleeding edge, they think they're doing the most complex tasks in the world, and they think they're working in "real-time" because they've just dropped overnight batch processing.

    We can move this to an Ask Slashdot, or if you want to mail me I'm happy to discuss more offline... you can guess my email address from the slashdot name and the URL quoted above.

    T

  23. Its rather funny because... on Shared Source? · · Score: 5

    ... when Win2K came out, and was breaking all sorts of software, a guy I met from one of the big US investment banks bent my ear for ages about how great Win2K was and how they had no problems with it at all. This seemed a little strange as most investment banks that I've been at run huge amounts of really badly-hacked, badly-behaved, poorly documented in-house programs (you pay big money, you attract every wide-boy for miles around).

    When I quizzed him in detail he finally admitted that this was because they had the FULL source code from Microsoft and were patching (or at least flagging) their own fixes as they hit problems and giving these back to MS to integrate.

    But he wouldn't trust Linux, or any Open-Source model, and neither would MS....

    Seems some people can have their cake, and eat it, and deny there was any cake there anyway

    T

  24. Said it before... on Casio's Lin-Win Hybrid Laptop To Ship Tomorrow · · Score: 2

    I run an Acer 312T which is about the same size from a couple of years back (800x600 8.4" screen , P233MMX, same size and weight as The Perl Cookbook, V90 modem, 2 PC slots, USB).

    It runs SuSE 7.1 like a dream (I upped the disk to 6Gb and the memory to 80Mb) Small keyboards take a little getting used to, but it makes all those emacs compound keystrokes easier, and using a small laptop like this on a crowded tube train is much easier than one of those behemoths I see people with.

    With APM enabled, and tweaking kflushd to let the disk spin down for long periods of time (once emacs has loaded all my files), I get much better battery life under Linux than I did under Windows (nearer to 2 hours than the less-than-one-hour under Win98).

    This new machine is a bit better from the look of it (battery life, built in network card, and I guess the Cruesoe will make it a bit quicker), but not worth me upgrading yet. So if you can't justify the cost of these but you like the size, look around for a second hand 312T or 313T instead.

    T

  25. Make sure your distrib is newer than your hardware on Laptops That Support FreeBSD/Win/Linux/Solaris? · · Score: 1

    I have a little Acer 312T from a couple of years back (same size and weight as The Perl Cookbook, 233 Pentium, 800x600 screen - does me fine). I tried to put RedHat or SuSe on it when I first got it, but things like the PCMCIA-IDE CD-ROM, APM support, and USB support were a real pain (they worked, but not out of the box, and had odd bugs and needed tweaking).

    After buying a bigger disk for it (you can get into laptops, they're just a little more tricky than most) I did a clean install of SuSE 7.1 and it went straight on like a dream - all those kind developers had contributed code to catch up with laptop hardware - XFree86 4.0.1 supports more video cards, the touchpads are better supported, APM works perfectly (and battery life is much better than with other OSes), USB and PCMCIA are fully supported in default kernels, and I'm even told that the WinModem is supported now.

    So, my advice is, don't buy a machine which has just been released, a machine which has been out for a few months is much more likely to have been sorted out, and I'd recommend SuSE 7.1 of course...

    T