Slashdot Mirror


User: Reality+Master+101

Reality+Master+101's activity in the archive.

Stories
0
Comments
5,234
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 5,234

  1. Re:One of my favorites on Tech-Interview Riddles · · Score: 2

    Oops... you're right. I knew I shouldn't have posted just before I went to bed. :)

  2. Re:One of my favorites on Tech-Interview Riddles · · Score: 2

    That's an old ASM trick:

    A ^= (B ^ A)
    B ^= A;
    A ^= B;

    The second solution is to use addition/subtraction (which I leave as an exercise to the other readers. :) )

  3. Re:One of my favorites on Tech-Interview Riddles · · Score: 1

    the easy way or the hard way?

    That's pretty much it. The hard, slow way is to loop over the bits, doing one at a time. :)

  4. Re:One of my favorites on Tech-Interview Riddles · · Score: 1

    I'm going to ignore it because as far as the parser knows, it's already been replaced.

    Why would you ignore it? This is a single-pass process with just a table of mappings of input variable names to output variable names. It doesn't matter if one of the output names matches an input names, it's just going to get translated like any other name.

  5. Re:One of my favorites on Tech-Interview Riddles · · Score: 2

    It's simple enough for people who understand bits, but there are a LOT of people out there who don't understand bits and logical operators. Most people write a loop that does it one bit at a time.

    What I like about this question is that it tests whether someone understands bits without being a big "gotcha" question.

    OK, here's another one that I used to test someone's ability to think mathematically:

    Write a subroutine that given month, day and year, returns the day of the week.

  6. Re:One of my favorites on Tech-Interview Riddles · · Score: 2

    Close, but I have to mark you down for assuming that "unsigned" is 32 bits... it's only guaranteed to be at least 16 bits. :)

    Of course, I also prefer the more l33t version...

    return ((a & b) | (b & c) | (a & c));

  7. Re:One of my favorites on Tech-Interview Riddles · · Score: 4, Interesting

    You the man! Here is your honorary degree.

    Now, for this honorary Ph.D., answer this question (another one of my favorites):

    You have a 32 bit unsigned integer. You want it to be really reliable, so you store it three times (triple redundancy). Write a subroutine that takes three unsigned, 32 bit integer arguments, and returns a single unsigned 32 bit integer that is constructed by having the bit in each bit-position "vote" for the corresponding output bit (e.g. if at least two of the low-order bits in the passed in arguments are 1, then the low-order bit in the output is a 1).

    Hint: There's an easy, fast way, and there's a hard, slow way. I'm looking for the easy, fast way.

    I actually got this question on an interview once (and of course figured out the right answer :) ).

  8. Re:One of my favorites on Tech-Interview Riddles · · Score: 1

    Ah well, someone already posted the answer. You may start kicking yourself now. :)

    Don't worry about it, though... it's an easy trap to fall into, and I've caught some really bright people with it.

  9. Re:One of my favorites on Tech-Interview Riddles · · Score: 1

    BZZZZT. Try again and think it through this time... if you still don't get it, I'll give you the answer and you can begin kicking yourself.

  10. One of my favorites on Tech-Interview Riddles · · Score: 5, Interesting

    I used to put this one on my programming tests. It's actually shocking how many people get it wrong...

    You are writing a parser that reads a C program and translates all the variable names into new names of the form "VAR######", where ###### is an integer incremented for each unique variable name. Discuss what is needed for the case where the C program already contains a variable of the form "VAR######".

  11. Re:Squid DO NOT eat whales, whales eat squid on 60' Squid Washes up on Tasmanian Beach · · Score: 2

    If a whale has a sucker scar, it's from a desparate squid trying to escape, not from a brush with death. Look at the sizes of the things: how would a 250kg squid handle a 60 ton whale?

    I don't know what the facts are, but it's not unbelievable. A tiny poisonous spider can take down a pretty large animal in the right circumstances.

    I doubt the squid is going to take down the whale by beating on it with its tentacles, but it may have other weapons at its disposal. :)

  12. Re:Who would buy these? on FBI Arrests 4 College Interns For Stealing Lunar Materials · · Score: 2

    And what kind of idiot wouldn't know that any moon rocks for sale must be stolen property?

    To be honest, I didn't know until now that there weren't any moon rocks in private hands. If you had asked me yesterday, I would've speculated that NASA allowed the astronauts to keep some samples that they brought back. I mean, isn't that the LEAST they could do? I'd be pissed if I went to the moon, but they didn't let me keep any souvenir. :)

    Obviously I would expect some sort of authenticity verification...

  13. Grow some balls on Open Source Politics - Maintaining Your Vision? · · Score: 3, Insightful

    Step 1 is get over the attitude that you need to keep everyone happy. It's your project, run it the way you want to. It doesn't mean you have to be impolite, but just preface every e-mail with "thank you for your interest and submission, but..."

    If someone's code isn't good enough, send them a message that says, "I'm sorry, but that patch doesn't follow the style that I'm trying to enforce for the code."

    If the patch takes it in the wrong direction, say so. If you don't understand the patch, then chances are it wasn't documented well enough. Say "I'm sorry, but your patch isn't documented well enough for me to understand. I only have so much time to look at patches.

    There's no reason you have to accept everyone's contribution. And if someone decides to fork the project, so what? If it's better, then maybe they're doing you a favor and you can use it (and perhaps fork it back in the future). If not, keep plugging away at yours, since presumably it's something that you want.

    But the bottom line is to write code that pleases yourself, and don't worry about pleasing others. To be honest, I have a feeling that this question is really, "How do I get people in the community to like me so that they'll see me as one of the 3l33t?"

  14. Re:The Bright Side on WorldCom to File for Chapter 11 Protection · · Score: 1

    Sheesh, man, we're talking about "cancer the disease", not "cancer the cell type".

    The mechanics of cancer-the-disease is not relevent to the analogy.

  15. Re:The Bright Side on WorldCom to File for Chapter 11 Protection · · Score: 1

    You care so little about how Europeans "hate" Americans that you discuss the issue at the end of every comment on Slashdot you post?

    I "care" about it in the sense that I find it interesting that they do. I don't "care" in the sense that their opinion of us has any value, or induces any emotional reaction to their hating.

  16. Re:The Bright Side on WorldCom to File for Chapter 11 Protection · · Score: 2

    The cancer is probably a good thing! Once the chemo cleans out all the bad cells, I'll be healthier than ever!

    That's not a valid comparison, because Cancer is not a normal part of living. Corruption is a normal part of society.

    A better analogy is that for a healthy body to function, you have to take a dump every now and then to expend the bad stuff your body filters out. Now, if you suddenly stop having to take a dump, are you going to congratulate yourself for having perfect health?

  17. The Bright Side on WorldCom to File for Chapter 11 Protection · · Score: 3, Insightful

    Obviously we would all prefer that these things never happened, but it's actually GOOD that they happen once in a while. The reason? It's proof that the system works.

    What would be worse than the current system is to have corruption take root and never get cured, generation after generation. I'm sure everyone can find innumerable examples of this in the world.

    This probably isn't the end of it; I'm sure more scandals will come to light before it's through. But given the fact that corruption WILL take root whenever you have people, it's good to know that these things are self correcting eventually.

  18. Re:you do have to ask what they need on Rasterman Says Desktop Linux is Dead · · Score: 2

    As a consultant you have to know what they need before you give your answer.

    Just out of curiosity, as a consultant, can you recommendations EVER include Microsoft software? Is there room in your philosophy that Microsoft might have the best solution for many people?

  19. Re:depends upon what you need to run on Rasterman Says Desktop Linux is Dead · · Score: 1, Flamebait

    It is a false statement to say linux is worthless because it will not run applications that users need.

    The arrogance of this statement is incredible, and you don't even realize is. What you're saying is, "it doesn't matter what the user wants to run. If Linux doesn't run what they want to run, it's a problem with the user, not with Linux".

    I have not used Microsoft for any meaningful work for years. [...] When you make a general statement and expect everyone to think it applies to them you only disqualify yourself as a consultant.

    How can you write two sentences so close to each other and not realize the intrinsic hypocracy of them? How cares if you personally can get along without Microsoft software. That's irrelevent to whether the rest of the world *wants* and *can* get along without Microsoft software.

    an office suite and a few other utilities. Those are available for linux.

    You seem to be under the mistaken impression that all software is commodicized, and that if you give a user any substitute for WHAT THEY WANT, they will be happy. They will not be happy when they can't run WHAT THEY WANT.

    Again, your arrogance is incredible. Mom wants the off-the-shelf blackjack program that her friend is running, and she can't run it because Linux "just doesn't work". Your solution is, "well, just run this other one". But she doesn't want that one, and she doesn't want to figure out how to get that one.

    And again, it doesn't matter how much software is available if the user can't figure out how to get it or how to install it. Set up home network with NAT? Trivially simple under XP. Impossible for the average user under Linux.

    You ask the customer what applications they need. Then and only then can you conclude which products might serve those needs.

    Yeah, that would be a great world. The bonehead users have to hire consultants to tell them what applications they need.

  20. Re:absolutely it is alive and well on Rasterman Says Desktop Linux is Dead · · Score: 0, Flamebait

    For $76, StarOffice suggests 5 personal installs.

    You know, StarOffice IS available for Windows, yet people continue to choose to pay for MS/Office. You know, sometimes things are worth paying for, including Microsoft.

    And, right now money favors linux hands down.

    Based on straight dollars, perhaps. But not based on value. For the average person, Linux is completely worthless because it can't run the applications that they want. Yes, if all they do is e-mail and browse the web, then Linux is an OK solution (unless you want to browse with a site with a Flash plugin, and then Linux becomes totally worthless). But if mom wants to run that off-the-shelf blackjack game, or recipe filing program, etc, she is totally out of luck. Even with Wine she is totally out of luck, since there is no way she would be able to install the program to run with Wine. Let's not even talk about setting up a home network with NAT, or installing new hardware.

    The typical consumer simply is unaware of what they can buy and use. That will change.

    The typical consumer is unaware of Linux because Linux is a worthless solution to them. That will never change until Linux becomes a useful solution, and I have my doubts that that will ever change, because the people who work on Linux have no motivation to make easy what John Q. Public considers important. "By geeks, for geeks".

    Your pathological hatred of Microsoft doesn't change the intrinsic value of Microsoft software for the average person.

  21. Re:Silly on Hot-Rod Your CD-RW Drive · · Score: 2

    You mean like what they do with processors?

    Except they don't with processors. When you overclock your processor, you are putting it up to a clock speed that didn't pass the tests for that clock speed. Just because it seems to work doesn't mean it's always going to work. Ask any game support crew how many times they have to tell some l33t overclocker to put the clock speed back to normal when it causes their game to fail ("but it works everywhere else!! it must be your fault, man!").

  22. Re:It wasn't new on Hot-Rod Your CD-RW Drive · · Score: 4, Insightful

    And there's a good reason why the mainframe had a jumper, but the PC doesn't. IBM wants to sell you a future upgrade for the mainframe. They had no after-sale incentive for the PC, since they're just going to try selling you a new PC.

  23. Silly on Hot-Rod Your CD-RW Drive · · Score: 3, Interesting

    I HIGHLY doubt that the exact same TESTED components are used in both drives. It is much more likely that a 40x drive is simply a drive that passed the 40x tests, but not the 48x tests, just like how processors are graded.

    It would be kind of stupid to stamp 40x on a box just to sell it for a lower price. Why not sell a 48x for the lower price and intice the customer further?

  24. Re:Windows Programming: A related question on SSH Secure Services on Windows 2K/XP? · · Score: 1, Flamebait

    On the other hand, we have people who like to code, and don't care so much about the money as much as the respect of their peers and for the beauty of the code.

    Obviously you have never looked at the typical open source program. It is some of the UGLIEST code ever written. I'm sure there are some examples of some clean code out there, but all the ones I've looked at have been horrible, kludgy, undocumented pieces of crap. One in particular was Perl 4. Larry Wall might be a language genius, but his code is TERRIBLE. I think you can count the number of comments on one hand.

  25. Re:Screw him - Libertarian response on John Gilmore Sues Ashcroft et al. for Freedom to Travel · · Score: 2

    to take over the airplane and then crash it into a target. He did so because no one could fend off a knife.

    In this case, yes. But the longer history is that most lunatics try and blow up airplanes, not take them over. Keep in mind that the knife trick can only work once, because everyone expected a simple hijacking.

    Remember that Mr. Shoebomber was only barely thwarted.

    Airlines that allowed guns probably wouldn't allow guns with exploding bullets on board.

    So the airline is supposed to allow guns, but then thoroughly search the passenger and his carry-ons for any sort of "illegal" ammunition? And the airlines are supposed to hire munition experts for this?

    The FAA and many other organizations have tested the idea that a gun could take an airplane down, and that is UNTRUE.

    Maybe it is, maybe it isn't. But the point is that if you starting drawing weapon lines (these weapons are OK, these ones aren't), you make it that much easier to sneak large weapons onboard. Besides, if anyone could carry weapons onboard, I'm sure people can find a way to cripple the plan with relatively light weapons.

    If you want weapons on board and want to advocate sky marshals, then I'm with you. But this idea is just insane.