Slashdot Mirror


User: mabinogi

mabinogi's activity in the archive.

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

Comments · 1,785

  1. Re:whoops, I made it worse on 64-Bit Windows Releases Now Available · · Score: 1

    > I still don't get the reason for dynamic cast though... assuming I had done the pointer casting "correctly"

    A cast is always required when there is a mismatch between levels of indirection. - ie, assigning a scalar value to a pointer, a "pointer to a pointer" to a "pointer to a scalar" and vice versa.
    That is because in most cases, it is probably not something you want to do. There are very few reasons in modern portable user space code, where you would need to assign a pointer from a value in a scalar, so any instance is almost certainly an indication of either a bug, or bad design.

    However, you'd probably find that most compilers would still compile the code and produce an executable, but they'd almost certainly scream at you as they did so.

    The one common case where a mismatch in indirection is probably OK, as assinging a "pointer to a pointer" to a void pointer, as void pointers are often used as a way of passing around shared data within a system without the system having to know anything about it in advance. It's especially useful for things like callbacks and for providing abstraction.

  2. Re:Rejoice, more like cry on 64-Bit Windows Releases Now Available · · Score: 2, Interesting
    actually, looking at your version again, it's completely wrong, and even more dangerous...
    struct device_info foo=*((struct device_info*)&a_ulDeviceHandle);
    a_ulDeviceHandler is an unsigned long, which apparently has been used to store a pointer.
    your code is then taking the address of the long and casting that to a pointer to struct device_info, and then dereferencing it.

    So even if it were possible to assign a struct by value, the value you'd be assigning here would be completely wrong, and would result in either a segfault (in the best case), or silent corruption (in the medium case), or an exploitable situation in the worst case
  3. Re:Rejoice, more like cry on 64-Bit Windows Releases Now Available · · Score: 3, Insightful
    the simple rule is never store a pointer value in a non pointer variable.

    If you need a variable to store a pointer, but don't know what type it'll be pointing to yet, use void * and cast it to the appropriate pointer type once you do know.

    On a 32 bit system, a pointer will be 32 bits, on a 64 bit system, and pointer will be 64 bits.
    However, there is no gaurantee that on a 64 bit system an int will be 64 bits - it could quite easily be 32.
    int only _has_ to be at least 16 bits. It's usually the word size, which is usually the size of a pointer, but it doesn't have to be.

    char = at least 8 bits.
    short int = at least 16 bits
    int = at least 16 bits
    long int = at least 32 bits

    > also wouldn't he need to do:
    > struct device_info foo=*((struct device_info*)&a_ulDeviceHandle);

    No, I suspect what he meant was
    struct device_info *foo = (struct device_info *)a_ulDeviceHandle
    Your version wouldn't work because you can't assign a struct to another struct, you can only assign a pointer to a struct to another pointer to a struct.

    In C, variables only contain numbers, not objects, as there is no concept of object - only a vague illusion every now and then via pointers - so assigning a struct makes no sense.

    In that sense, C is very weakly typed, and type checking is only done at compile time. That makes casting values of different precision very dangerous, because the cast eliminates the only way through which you would detect these errors.
  4. Re:Applications? on 64-Bit Windows Releases Now Available · · Score: 1

    Cakewalk also have a 64 bit version of Sonar, and a few audio vendors already have 64 bit drivers (M-Audio for instance).

    Given that there are a large number of sample based soft-syths out there that use gigabytes of samples, and currently have to rely on direct from disk streaming techniques, the ability to support large amounts of physical memory could be quite an advantage.

  5. Re:Or on Software V-Chip for PC Games? · · Score: 1

    what the hell are you babbling about?

  6. Re:As long as DMCA lives... on Image Preservation Through Open Documentation · · Score: 1

    Does curing a headache _require_ cutting off your head?

    No.

  7. Re:"High-def" MIDI? on Concert to be Performed from Beyond the Grave · · Score: 1

    The MIDI spec allows for 14 bit resolution for most controllers - including Volume, Expression and Pan.

    It's implemented through using two controller numbers for each controller, a fine and a coarse.
    Most instruments just ignore the fine settings though, so it's more of an implementation issue.

    I think Velocity only has 7 bits though, and it seems to me that would be the setting that would most benefit from higher resolution.

  8. Re:"High-def" MIDI? on Concert to be Performed from Beyond the Grave · · Score: 1

    MIDI (Musical Instrument Digital Interface) is not a file format, it's a hardware interface and a wire protocol.

    a .mid is a file based representation of the protocol, but the hardware interface and the protocol came first.

  9. Re:"High-def" MIDI? on Concert to be Performed from Beyond the Grave · · Score: 4, Informative

    Velocity is a standard part of the MIDI protocol...

    There are a few MIDI things related to volume -

    Channel volume and Key velocity are the most common used.
    Volume just being the output volume.
    Velocity is usually used to affect both volume and timbre.
    There's also Chanel aftertouch and Key aftertouch, which depending on the instrument may affect volume, timbre, pitch, or nothing at all.

    Controller 11 - Expression is often volume related, and there's also the Breath controler (I don't know the number off the top of my head) which can also be used to affect volume and / or timbre, pitch or whatever...

    There's plenty of room in standard MIDI for a wide range of expressiveness, it's usually the instrument that falls short, not the protocol.

  10. Re:Full article link and observations on root on Michael Robertson Says Root is Safe · · Score: 1

    Nice simile.

  11. Re:Problems with "optional" approach on Adobe Buys Macromedia for $3.4B · · Score: 1

    Well, he _did_ say Acrobat reader 7.0

    Looking in my Reader (7.0) directory, there is indeed an "Optional" folder.
    There's no mention of it in the help file, but there is a README in the directory itself which says "Put unused plug-ins in the optional directory."

    Maybe that's the documentation he was talking about?

  12. Re:I dont understand. on Microsoft Releases Public Beta of Data Protection · · Score: 1

    bah!, I previewed twice and still didn't catch it!

    I meant 1.3TB of course ;)

  13. Re:I dont understand. on Microsoft Releases Public Beta of Data Protection · · Score: 1

    that's 500GB. 1.3GB is the compressed value.
    Unless you're storing a bunch of text you're not going to get 1.3GB.

    Also - 500GB SAIT tape - $200
    400GB Hard Drive - $320

    That would make it look like the tape has an advantage - but how about you tell us how much you payed for your SAIT drive?

  14. Re:Cookie Madness on Slashback: Pie, Election, Alarm · · Score: 1

    Yes, I admit it's not really much of a problem.

    >I personally think things should be built to work well and coherantly for the average person, but not screw up the rest of us.
    Definitely - particularly that last bit, which seems to be forgotten by a lot of people who think usuability stops at the first part (see .sig).

    > Ya know what'd be worse? web browsers sharing cookies, then you'd have to use multiple computers.
    heh, part of me cringed at the thought, and the other part thought "that'd be cool".
    Of course if you combined that with Netscape 4.x's remote profile, then you'd be completely screwed, because your cookies follow you around, so even different computers wouldn't help ;)

  15. Re:I think he's right on Linux Can't Kill Windows · · Score: 1

    In my experience, whilst games bundle the Direct X version that was appropriate for them the DX installer was intelligent enough to basically do nothing if you already had that version or later.

    With one exception - there was a 3a or 5a or something version (I can't remember what game it came with), that insisted that I didn't have DX already installed and managed to completely bugger everything up.
    However, that's a bug, not a design flaw.

    There definitely were issues with DLLs being replaced by older versions when you installed software in the past, but it wasn't DX, it was usually things like OCX controls or similar.

  16. Re:Cookie Madness on Slashback: Pie, Election, Alarm · · Score: 2, Insightful

    actually, I dislike cookies as session identifiers, as it limits you to one session per browser.
    A session key in the url allows you to log in multiple times, and possibly as multiple users.

    It's not something that you need to do every day - but when you're trying to set up something like a CMS with varying levels of access control, it becomes a pain in the neck to either have to keep logging in and out to verify the way it looks to different users, or have IE, Opera, Mozilla and Firefox all open at once.

  17. Re:No word yet... on New Mac System Specs · · Score: 1

    um that's because neither Intel nor AMD "Invented" dual-core CPUs.

    Compaines like IBM and Sun (and others) have been making multi core CPUs for years.

    Guess where Apple gets their CPUs from?

    The industry as a whole sees it as time to move to multi processing on the desktop, and Apple is hardly playing "catch up" if they're only a month or two behind in it. Especially since as soon as they announce it, you'll be able to buy them.
    However, that's assuming that they _do_ in fact go dual core. It's pretty hard to base any sort of argument on speculation.

  18. Consistency and Integratioin. on Improving the Windows XP User Interface? · · Score: 3, Interesting

    The two things that people love to say is Windows' advantage are actually things they do really badly.

    Why can't I rename the recycle bin, when I can rename "My Computer", "Network Places" and "My Documents?"

    Why don't I have a "send to" context menu on items in a zip folder?
    In fact, why do zip files act nothing like regular folders at all when explorer presents them as if they are.

    Why do control panel items open up in a dialogue style menu, when you've navigated to them via a web style interface?

    Why does MS-Office _always_ have a totally different look and feel to any existing windows version at the time of its release?

    Why can't I open from and save to WebDav and ftp from any application?

    Why can I use windows networking paths (being able to "cd //servername/sharename") in cygwin of all things, but not in cmd.exe?
    I think they had to actually try to make that one not work, as fopen() in Windows will accept those paths.

    Microsoft loves to introduce an idea - and then not follow through with a complete and useful implementation, but they'll still use their half arsed useless implementation as an example of how innovative they are.
    Innovation is all very well, but it does you fuck all good if you have the worst implementation of your own idea.

    Windows could be an absolutely excellent environment if only Microsoft finished half of what they started.

  19. Re:Percent... on Firefox Site Visits Up 237% · · Score: 1

    that's right, what's your point?

  20. Re:Bleh... Mobile, please! on Intel Ships Dual-Core Chips · · Score: 1

    I think someone swapped his 'a' and 'e' keys if you look at his use of 'then' all over the place too ;)

  21. Re:Simple solution on RIAA Cracks Down on Internet2 File Sharing · · Score: 1

    Fortunately for you, there exists Melodic Metal ;)

  22. Re:grammar nit again - bad advice on Caltech Pranks MIT's Prefrosh Weekend · · Score: 1

    It may be a correct sentence, but it screwed up the meaning, and the meaning is far more important that finer points of style.

    >In reality the guy put the thing up available at that address in the PAST. He's not still putting it up there...

    The original message says nothing about the act of putting up the page - because no one cares about that.
    It tells you where you can find it _now_ - which is what we do care about.

    "was made available at" tells you nothing about where you can get it now.

    You could make two changes to the original sentence that would improve its style without losing the meaning.

    Drop "located" -
    "A full account of the pranks is at www.caltechvsmit.com"
    Or change located to available as you suggested, but without screwing with the tense -
    "A full account of the pranks is available at www.caltechvsmit.com"

    The first is probably preferable as it's more concise.

    In any case, we're talking about a slashdot submission here, it's informal speech and no one cares whether or not it meets the highest levels of style.
    As long as it's clear, says what it means, and spelt right. Bad spelling is far less acceptable than not adhering to a style guide, and attempts to improve the style that sacrifice meaning do not help anyone.

  23. Re:grammar nit again - bad advice on Caltech Pranks MIT's Prefrosh Weekend · · Score: 1

    wha?

    What the hell is wrong with "is located at"?

    "has been located at" doesn't even mean the same thing.
    Unless you're making a weak slashdotting joke by your insistence at past tense, the present tense is perfectly correct, and the use of active voice far preferable to the passive voice you seem to be insisting on.

    Compare the original sentence and your preferred replacement:
    "A full account of the pranks is located at www.caltechvsmit.com"
    "A full account of the pranks has been made available through www.caltechvsmit.com"

    See how much more concise and to the point the original is?
    There are no prizes for wordiness, and "through" is just wrong anyway.
    A web site (note the use of the word "site") is considered to be a location (albeit a virtual one), not a service, therefore "located at" is perfectly fine.

  24. Re:Unix analogue to ACLs... on Longhorn to use UNIX-like User Permissions · · Score: 1

    The time I run in to this problem is with running a web server, with virtual hosts and multiple users being able to edit a single site -

    You want a select group of (but not all) users to be able to write to the directories
    You want the web server to be able to read (and execute where applicable), but not write, and definitely not own the files.
    And ideally you want all other users to have no access.

    If not for the last point, you can do it with 775/664, or if you don't mind the web server having write access you can do 770/660 and put the web server in the group - it then becomes a question of which is more important, not allowing other users to see the data, or preventing possible web server exploits.

    But the Windows ACL system has screwed me up many times. Too often you end up with a situation where the ACL on a rsource becomes just too confusing to deal with. Part of that is lack of familiarity though. I just want ot be able to put some users in a group and chgrp the directory.

  25. Re:Why? on Crack Found in Shuttle Tank · · Score: 2, Interesting

    It worked in 1981, it works now.
    The existence of newer, better stuff doesn't make older stuff automatically stop working.

    Also, I'd be surprised if they really were using all the same computer equipment and software from 1981.