Slashdot Mirror


User: RetroGeek

RetroGeek's activity in the archive.

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

Comments · 1,000

  1. Re:Anything you say will be taken down and used .. on Darl Goes to Harvard · · Score: 1

    char amessage[] = "now is the time"; /*an array*/

    This tells the C compiler that you want to set up an address space to hold 16 char spaces. The C compiler does this, then assigns a memory space named amessage which holds the start address of the 16 char spaces.

    char *pmessage = "now is the time"; /* a pointer */

    This tells the C compiler that you want to set up an address space to hold 16 char spaces. The C compiler does this, then assigns a memory space named pmessage which holds the start address of the 16 char spaces.

    Both statements are equivalent, and both Xmessage variables can be used in interchangable ways:
    *amessage is the same as amessage[0]
    *pmessage is the same as pmessage[0]

    and given that a char is 1 byte in size:
    *(amessage + 1) is the same as amessage[1]
    *(pmessage + 1) is the same as pmessage[1]

    There are NO arrays as such in C. An array in C is the start of a contiguous memory space. When you use an indice in the "array" such as amessage[2], then the C compiler examines the sizeof() of the variable type, then moves the pointer sizeof * indice bytes. In the case of a char (1 byte) amessage[2] wil point to amessage + 2 bytes.

    If amessage was a struct with a sizeof 30 bytes, then amessage[2] would be amessage + (30 * 2).

  2. Re:Anything you say will be taken down and used .. on Darl Goes to Harvard · · Score: 1

    I never said it was good practise! C lets you shoot yourself. This is both good AND bad.

    The original point was that:

    if ( somepointer == "A string" )

    IS valid code.

  3. Complete Internet on Embedded Ethernet and Internet Complete · · Score: 1, Funny

    You mean I can buy the Internet?

    I wonder if the book includes a CD?

  4. Re:Reminds me of a Spam FIlter... on DARPA Funds Internet Tracking Scheme · · Score: 1

    "Make it idiot proof, and someone will make a better idiot."

    "No program is foolproof, because fools are so ingenious."

  5. Re:Anything you say will be taken down and used .. on Darl Goes to Harvard · · Score: 1

    I know that #define is a macro. That is why I said pre-processor.

    I started with C many years ago. Probably the modern compilers no longer do this. There used to be a concern with the amount of RAM and disk space apps required.

  6. Re:Anything you say will be taken down and used .. on Darl Goes to Harvard · · Score: 1

    The comparison is between two pointers, one of which has been created on the fly. This would work, but it wouldn't be very much use:

    Which is what I said. Memory address comparison.

    But it depends on the compiler. Some will optimize memory use by providing a single address to all identical strings (char arrays).

    You can have a statement such as
    #define MY_NAME "RetroGeek"
    Then use this everywhere. The pre-processor will replace all MY_NAME with "RetroGeek", which could be in many places.

    Which can be bad if your code alters the string on the fly.

  7. Re:Anything you say will be taken down and used .. on Darl Goes to Harvard · · Score: 3, Informative

    No, this is valid code. It will even work since most compilers will find all instances of identical strings and equate their locations:

    char *UserName = "DarylMcB";

    if (UserName=="DarylMcB")
    //do something everytime!

    It works because UserName is set to the address of the static char array "DarylMcB".

  8. Re:Name gripe on Spirit and Opportunity Now Operational · · Score: 3, Insightful

    Am I the only one disapointed by the names of these probes?

    Well, we are not there in actuality, but in Spirit

    And NASA had the Opportunity to build and send two.

  9. Re:Don't blame Andy! on Author signs MyDoom virus · · Score: 1

    give the user community a wake-up call./i

    Stupid users keep hitting the snooze button. They NEVER wake up.

  10. Re:Already working? on Microsoft, Yahoo Investigate Spam Solution · · Score: 1

    Emails to her have to be completely devoid of usable content to get through.

    But isn't that the definition of SPAM?

  11. Re:Easy Hack on California Cybercafe Regulation Decision Released · · Score: 1

    dixie chicks?

  12. Re:ideas for nanotechnology on A Review of Nanotech's Future · · Score: 1

    just suck your thumb and you'll find out how drunk you are

    That works for me right now. I suck my thumb, and if I bite myself, I'm drunk!

  13. Re:good and bad on A Review of Nanotech's Future · · Score: 3, Insightful

    bring horrors to match its benefits

    Which pretty well describes ANY technological advance, from the first person to rub two sticks together to produce fire, to the latest Gee-whiz technology.

    And once it has been discovered (or invented?), it is here to stay. Once Pandora's box has been opened, you cannot stuff the contents back in.

    The best we can do is get the best understanding we can of it, then manage it.

    People WILL die, but somewhere down the line it will benefit more people than will die from it.

    Which really sucks if your one of the dead :-(

  14. Re:Unstoppable on A Review of Nanotech's Future · · Score: 1

    Or perhaps even nuclear AA batteries

    Gives new meaning to that Energiser Bunny.

    It keep going/2 and going/2 and going/2, and ...

  15. Re:The ultimate vaporware... on A Review of Nanotech's Future · · Score: 1

    Sounds like the salesman I overheard explaining WinME.....

  16. Re:Unstoppable on A Review of Nanotech's Future · · Score: 5, Insightful

    new technology that has been abandoned, or even significantly delayed, through alleged (or real) risks

    Nuclear energy.

  17. Re:I've got one ... on The 101 Dumbest Moments in Business · · Score: 1

    While I am not sure if you are kidding

    Only half kidding.

    There are some days when I really hate the world, today must be one of them......

  18. Re:WTF? on The 101 Dumbest Moments in Business · · Score: 1

    Some can actual be removed by a downward tog.

    Damn, I want one of these togs.

    Hey, when you use it does it tug?

  19. Re:I've got one ... on The 101 Dumbest Moments in Business · · Score: 1

    Relax, there are idiots everywhere.

    And the more popular something becomes, the more idiots flock to it, just to be "leet".

    Maybe we need Slashdot/2, with an intelligence test before you can become a member. Only members can post (thought they can post AC).

    Or only people who have a karma above X, and have # of comments above X can become members.

    Hey, there's a thought! Maybe Slashcode can be adjusted so that we can filter comments from people with high karma.

  20. Re:Marketing on KISS · · Score: 1

    While the influence of the marketing department varies

    I would bet that the Marketing Head has more influence with the CEO than the Engineering Head.

    Among other things, the function of the marketing department is more understandable to the CEO than engineering. Plus, to the CEO, the Engineering head is nothing more than a super-geek, and he remembers THOSE from school.

    The world is a crazy place where the people making the decisions are usually popular, while the people doing the actual work are not.

  21. Marketing on KISS · · Score: 4, Informative

    What can be done to make manufacturers get their heads into the real world?

    Fire the marketing department.

    No, really. Some marketing genius does a study, asks some set of people "Hey, we can do this really neat thing, do you want it?". Each marketing genius in the department does this. Now the department goes to the C level and says "All our studies say that people want x, y, z, and also w".

    Then the engineering dept gets the WORD FROM ABOVE, and creates the product. Instant plethora of features. The product gets built, goes to stores, and the MAJORITY of people say "whoa, too complicated".

    Why do you think that Windows has a dumbed down menu set?

  22. Re:Yes, but is it off by default? on Anti-Virus Companies: Tenacious Spammers · · Score: 2, Insightful

    Why put such a dangerous feature in a program?

    Because when the apps were first created we did not have a SPAM problem.

    So a legitimate email might have contained a virus and it was good Internet community help to inform the sender about the virus.

    Now we have viruses and SPAM which feed off each other and the feature becomes a pain.

  23. Re:if only it always worked on Ctrl-Alt-Del Inventor To Retire From IBM · · Score: 1

    I ended up wiring in a big amp relay through a small power supply. You turn on the switch to the power supply and it kicks in the relay.

    It also gives you an OOPS factor. The power supply had a rather large capacitor. You could turn off the switch and the capacitor would take 2-3 seconds to drain off enough to release the relay.

    So, hit the switch, ..., OH SHIT - hit the switch, and nothing had yet turned off. Saved me a couple of times.

  24. Re:Salute! on Ctrl-Alt-Del Inventor To Retire From IBM · · Score: 1

    And to quickly test a MODEM (external):

    copy con com1:
    ATH1
    ATDT911
    ATH0
    ^Z

    You also get to test the emergency services :-))

  25. Re:if only it always worked on Ctrl-Alt-Del Inventor To Retire From IBM · · Score: 1

    I used to do that.

    Until the switch on the power bar fused (after 4 years of on/off).