Slashdot Mirror


User: ZorroXXX

ZorroXXX's activity in the archive.

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

Comments · 280

  1. Recommended NTP clients on NTP Pool Project Reaches 500 Servers · · Score: 2, Informative
    Since nobody has mentioned anything about clients yet, here are my suggestions:

    • Linux: Chrony. Works very well for dial-up when you not are connected all the time.
    • Windows: NetTime. Although no longer an active project, this program still works perfectly and is in my opinion better than the "official" windows service.
  2. Re:Conflicts with other studies on Burned CDs Last 5 years Max -- Use Tape? · · Score: 1
    This is a well known strategy:

    "Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it ;)"
    - Linus Torvalds

  3. Re:slightly offtopic, but... on Australian IT Workers Concerned About Migrants · · Score: 1
    There is no such thing as illegal immigrants, only illegal Governments...

    Colour Line by Asian Dub Foundation

  4. Re:It's useful enough... on Turn an Optical Mouse into a Scanner · · Score: 3, Interesting
    A bar code reader also stuck me as a useful modification. I wrote C code for interpreting the pulse from a bar code pen/wand as part of a project the last year of my engineering education, and replacing the pen with an optical mouse will more or less give an identical project, so this should by all means doable.

    Because of that I did learn a bit about the different types of bar codes. This was in 1995 so the following is just based on memory, I might have some minor errors in the following. The bar code type that is used to identify products is called EAN-13 (European Article Numbering, 13 digits). An EAN-13 bar code usually looks like the following (footnote 1):


    9 || 780201 || 708424 ||

    Both the black and "white" lines in the bar code are used. Lines are either thin or thick (as far as I remember thick lines are either exactly two times the width of the thin ones or slightly thicker (maybe it was 2.5 times?)). The bar code start with three thin lines (start sync) and the the black sync lines are usually printed slightly longer than the rest. In the middle there are some additional sync lines as well as at the end.

    Each digit is encoded as five bars (black and white) in a 2+3 mix of thick/thin. There are defined three groups of different 2+3 combinations, Number Group A, B and C, i.e. Number Group A contains 10 different 2+3 combinations, B contains 10 others and C yet 10 others, The six first digits are either number group A or B, the six last are always number group C. The 2+3 combinations in number group C is the same as those in A but backwards. This means that if the six first digits decoded from the pulses from the bar code reader all are number group A, then you know that you are reading the bar code backwards.

    The combination of A and B used on the six first digits determines the 13th digit, so only 12 of the digits are coded directly with bars.

    Footnote 1
    Originally I wrote an ascii art drawing here, but slashdot complained "Lameness filter encountered. Post aborted! Reason: Please use fewer 'junk' characters." so I had to remove it... :(

  5. Re:Three Books to Read on How to Write Comments · · Score: 1
    In my opinion there are three ways to write code:

    1. write unreadable code
    2. write unreadable code, but try to comment it readable
    3. write readable code

    Example:

    1. if (uFileHeader & 0xFF1234)

    2. if (uFileHeader & 0xFF1234) // check if the file header is valid

    3. #define VALID_FILE_HEADER 0xFF1234
      ...
      if (uFileHeader & VALID_FILE_HEADER)

    This second way is the same as Martin Fowler in his book Refactoring refers to as writing comments as using deodorant to cover up that the code stinks. This is a great book, highly recommended. The Pragmatic Programmer is also very good (I have not read the two other books mentioned in the parent post).

    As a rule of thumb (in my personal experience), the majority of all one-line comment are deodorant.

    Note that even though the comment by itself might be enlightening and add (even great) value to the code (like "// check ..." above), the code is "always" better of if what the comment expresses is incorporated directly into the code instead.

    One way to increase the quality of comments is to literally put a price tag on them. If you were to pay a consultant to insert the comment, how much would you be willing to pay him/her? Use a 10-based scale, say $100, $10, $1, 10cent (and also consider the negative side of scale, i.e. if a given comment exists, how much would you pay him/her to remove the comment?). Then remove all comments below a given value, say $1.

    How many of you could have argued that spending say $1 to add the comment below would be a good investment?

    while (! feof(stream)) {
    do();
    what();
    ever();
    with();
    the();
    file();
    } // end while

    On the other hand, you might sometime stumble over great comments that you could defend spending $100 to get written if they did not exist (these are multi-line comments/stories perhaps on the form "We tried earlier to do things in such and such way but that did not work out very well because of whatever. An besides blah blah..." or something similar. ).

    I often complain about comments written by my colleagues so I have a reputation of being opposed to writing comments. But I am not against writing comments; I am against writing valueless comments.

    --
    When comments lie about the code, both are probably wrong.

  6. Re:First Amendment versus Sanctioned Legal Monopol on Doctors Sue Patients for Online Complaints · · Score: 1
    That's an interesting correlation. The more the government has gotten involved in health care and health insurance industries, the worst the quality of the service has gotten.

    There probably is a correlation, but that does not imply that there is a direct cause relation (i.e. more government involvement leads to worse quality).

    I think that the link here is that USA's government previously have had a low involvement in public health care and the industry is exploiting the profit possibilities that now show up combined with inexperienced (in this matter) politicians.

    The health care system in most European countries have heavy governmental involvement and are working reasonably well. There are of course variations, but I think most people agree on that those health care system works better than the one in USA. For an extreme comparison look to Cuba which has one of the worlds better health care systems with only governmental involvement.

    PS Yes, in this post I state some opinions that I do not back up further, and while this generally is bad I think that they should be clear enough.

  7. Re:Read 'erode' as 'trample on' on Some Rights May Have To Be 'Eroded' For Safety · · Score: 1
    I think generally we mostly agree, but I disagree with the following:

    Our Constitution provides our government certain specific powers to appropriate certain specific rights of ours onto them. Reducing inherent rights is an impossibility in the States.

    While Hobbes' society view favors an absolute governing power and is in some ways far out, I think it is a relevant inspiration source for forming a definition of the role of a government:

    A government's ultimate task is to put ((relatively) minor) restrictions on the citizens (individual or all) for the benefit of the whole society. I.e. create rules for the citizens to follow (and any rule is a restriction of some unlimited behaviour).

    Do you think that you have "full" freedom of speech? If you do then think again, because you are not. No countries have. There are always certain things that you risk being punished for saying (threats, insults, untrue marketing claims, etc), but the perhaps greatest restriction is that in most countries it is illegal to lie in court.

    Think about that. In a certain setting you are not allowed to lie. That is an enormous restriction of your freedom of speech. And I am not trying to imply that is bad, just trying to set things in perspective.

    So what is the optimal value of freedom (in its widest and most general meaning)?

    • Is it minimum? NO
    • Is it maximum? NO
    • Is it somewhere between, but very, very close to maximum? YES

    Consider the following summary of software licenses:

    • MS: sharing is theft
    • BSD: sharing is not theft
    • GPL: not sharing is theft

    Why is Public Domain missing in the above? Should not that really represent maximum freedom? Why are people writing free software generally not using that? Public Domain does indeed imply maximum freedom, but people are not using it because it is not the optimal value of freedom. Not that maximum freedom is bad in this case, just not optimal.

    So trying to summarize my point of view:

    Restrictions of freedom are never bad per se, but you can always argue that a specific case is based on your view point. So what is the optimal value of freedom? That is a subjective opinion. There is no absolute, objective optimum.

    Links: Thommas Hobbes, per se

  8. Everybody Needs a 303... on TB-303 Give-Aways from Propellerheads and d-lusion · · Score: 1

    ... at least according to Fatboy Slim.

  9. waaaaay to accurate numer on An Open Letter from Darl McBride · · Score: 1
    >...accounting for 65.64% of all...

    That is four digits. Such a number implies accuracy down to 1/1000 parts. This is almost never possible (that is, if you are seeking a serious result).

    Generally I think that almost all statistics express a higher accuracy than the material allows for (control question, how much statistics express less accuracy than the material allows for?).

  10. int *(*(*i)[5])(int*) on Brain Teasers for Coders? · · Score: 1
    One test is to ask: Given the following declaration:
    int *(*(*i)())[5];
    what is i?

    To do this by hand you can use the right-left rule for reading c-declarations:
    1) locate the innermost identificator and classify this first.
    2) classify next balanced expression to the right
    3) and continue reading clockwise (i.e. to the left)
    4) ...directed outwords

    However if you stumble upon some cryptic code written by others that you do not understand there exists this wonderful, litle known tool named cdecl to help you with that:

    cdecl> explain int *(*(*i)())[5]
    declare i as pointer to function returning pointer to array 5 of pointer to int
    cdecl>

    It can also translate in the oposite direction:

    cdecl> declare i as pointer to pointer to pointer to pointer to pointer to int
    int *****i
    cdecl>
  11. water level sensor project on Simple-to-use ZigBee Hardware · · Score: 1
    I have had a project in mind for some time that perhaps could use this device and I would love to get some advice (I have not really done any project of this type since I was finished with my engineering education).

    The water supply to my parent's house is a well,and they are restrictive with water usage, especially in the summer, in order not to risk that the well becomes emptied (because if it does then one gets air into the pipe which then must be removed (by pumping water (from somewhere else) from the end of the pipe back into the well)).

    My idea is that it would be very nice to have a water level meter in the well so that my parents could read exactly out how much water there is left in the well from within the house. It is not practically possible to have wires between the house and the well, so that implies wireless. I guess the distance is about 200 meters, with some trees inbetween.

    The bandwidth required for this should be negligible and one-way communication would also probably be sufficient. Current consumption is not critical because I could use an old car battery or something like that. The challenges will be price, range, low operating temperature/out door robustness and my time.

    Does anyone have any ideas/tips?

  12. Re:Open Source on The First Annual Underhanded C Contest · · Score: 1
    But then I ask myself "but, self, what if the code is written by someone really clever, I mean somebody who's smart enough to use a buffer overrun or mangled pointer or some such to do it on the sly?

    But even if the source is clean, you still have to trust the compiler. And you cannot actually do that unless you verify the source code of the compiler. But then you of course also have to verify the compiler that was used to compile the first compiler etc. And what about the operating system or processor. Can you really trust them?

    So it boils down to that for some boundary you just have to trust whatever it is depending on.

  13. Re:locate -r \/usr\/stupidity.* on Keyboards are Good; Mouses are Dumb · · Score: 1
    for ALL in `seq -w firstvar lastvar`;do wget http://somesite/gallery/DSC$ALL.jpg;done

    Wget is a nice tool that I often use, but for this kind of action (i.e save all/most/some images from a web page) the Down Them All extension to firefox is really great.

  14. record company executives on Extending Pop Music Copyrights · · Score: 5, Funny
    I think Douglas Adams was quite on spot in one of the Hitchhiker's Guide to the Galaxy books where he describes a bar populated with somewhat less attractive clients:

    He glanced around at the motley collection of thugs, pimps and record company executives that skulked on the edges of the dim pools of light with which the dark shadows of the bar's inner recesses were pitted. They were all very deliberately looking in any direction but his now, carefully picking up the threads of their former conversations about murders, drug rings and music publishing deals.

  15. Re:Side story of IP Ridiculosity on Lexmark's DMCA-Abuse Case Coming To An End · · Score: 1
    Physical property ownership carries certain rights. ... Now with software, I don't have ownership rights.

    Of course you have the same ownership rights. If you buy (a copy of) some copyrighted work, say a book, you buy an exclusively, unlimited piece of ownership for that single copy while the author still holds the ownership of the original.

    This (copy) ownership is exclusively; it is your and only your book/copy. Only you get to decide how to use it. Not the author. Not the publisher. Not some author interest organization. Not the police. Not your mom. You. Only you.

    And it is unlimited. You can do whatever you want with your book. If it is a murder mystery book, you can read the last pages to find out who the murder is first no matter how wrong the author would find that. You can use the pages as wallpaper or toilet paper. If you seriously dislike it you can burn the book publicly as a protest. The book/copy is your property and you can do whatever you like with it (from a ownership point of view).

    Now, there are certain things you cannot do with your book. You cannot go to a publisher and try to publish the book in your name instead. However, this restriction is a general restriction imposed by the authorities and is completely independent of your ownership; it does not matter if the book comes from your or your neighbors book shelf. Also, the police might have some objections to you burning books publicly, but again. This is a general restriction, it would not make a difference if you burnt books you had written yourself.

    Computer software is in no way different from books (which Borland has had in their No-Nonsense License Statement for a long time (newer versions not as good as the old versions) ). So you have ownership to software in the exact same way as everything else you own. Anything else would be unjust.

  16. Yes, global variables are bad on Object-Oriented 'Save Game' Techniques? · · Score: 2, Insightful
    and you should always avoid using them if you can. There are exceptions when using global variables are ok, but it should not be your normal style of programming.

    Now why are global variables evil? Because they hide information flow. With global variables any function might change them. For instance:

    int x = 1, y = 1;
    if (global_var != 0) {
    x = some_func();
    y = x + (x / global_var);
    }
    How do you know that some_func does not change global_var (possibly to zero)? You do not know that without knowing the complete inner behaiour of some_func.

    If the global variables do not change (only initialised once) then there is no big problems, because then there is no information flow hidden, they are merely some kind of constants. Example:

    const char *argv0;
    int main(int argc, char *argv[])
    {
    argv0 = argv[0];
    ...
    }

    void usage()
    {
    printf("Usage: %s <arg1> <arg2> [arg3]\n", argv0);
    }
  17. Re:One excellent way to increase the control on Norway Considers New Copyright Laws · · Score: 1
    of governmental and commercial organization over private citizens is to pass laws that make _everyone_ a criminal upon close inspection.

    "So, you aren't very fond of our actions, huh? Well let's just check you desktop computer... shouldn't be a problem for you, right? Your'e just a law abiding citizen...

    "Oh, wait a minute. Look what I just found! Seems like your going down, buddy. You sure are sorry you messed with us now, huh, punk?!"

    This is not new: "It's so convenient to have a system where everyone is a criminal" - A. Hitler

  18. no, no, no: embrace change! on NIST Releases Study Of CD/DVD Longevity · · Score: 1

    I think you all misunderstand. As covered before, a little bit of entropy might give new interesting results. Just imagine your old family pictures with brand new colours (this might not be art though).

  19. Re:Media is fallible... on NIST Releases Study Of CD/DVD Longevity · · Score: 2, Informative
    One small thing, which I've yet to see but maybe some slashdotter can point me to - is there any way, under windows, to automagically mirror a folder on one drive, to another folder (on another drive). I don't mean a full RAID1 of the entire disk, but the few 100mbs that are crucial. Sacrificing 160GB HDD space just for that seems like overkill.

    You should try out unison which can be used for file-synchronization either locally or remote and is avaliable both for windows and unix.

    I use it for synchronising my laptop and my stationary pc, and it works wonderfully for that. For a couple of years I had looked into and partly tried coda, intermezzo, openafs, etc but it always stranded on that it was complex and that the kernel had to be patched so I had more or less given up the thought until I stumbeled over unison.

  20. Re:Get rid of 10 "managers"... on Planning For Mozilla 2.0 · · Score: 1
    Nice idea.

    I would like to have some granularity on some of the current warnings like security.warn_entering_secure -- which I really like and have on as default -- because for some sites (especially my webmail and my internet bank) it is very annoying that all new windows/tabs comes up with this warning.

    So if I could in some way indicate "for sites my.web.mail and my.internet.bank, do not trigger security.warn_entering_secure" then I would be very happy and I think your idea might be used for this.

  21. Re:Profiling is GOOD on American Passports to Have RFID Chips · · Score: 1
    Please read this paper analyzing the security effect of the Computer Assisted Passenger Screening system (CAPS).

    After you have read it, I would very much like to hear a comment from you about what you think of that analysis. How much or how little do you agree with their conclusion? Has reading the report made you change your view in any way?

  22. Re:Look, I program in Perl on Foundations of Python Network Programming · · Score: 1
    >$name = ;
    Not so easy, wtf does this do?

    A couple of bracets are missing (due to slashdot html filtering). The code should read

    $name = <>;
    In perl
    <FILE_HANDLE>
    means reading from that file and without any specified filehandle it (usually) means stdin.

    >chomp $name;
    What the hell is chomp and how does it relate to reading input? Doesn't make any sense, stupid inside jokes about "eating" DO NOT belong to core language.

    chomp is for stripping of the "\n" at the end of the line.

  23. Re:Good code... on Alan Cox on Writing Better Software · · Score: 1
    > (which is a reasonably harmless thing to do, you must admit)

    No it is not harmless. It adds noice to the source code which decreases the signal to noice ration and makes the code harder to read. That is an unforgivable sin. Code is written just once (or rather in the range 1 to 10 times taking editing into account) by one or a few persons. However code is easily read thousands of times by many many people. Having code that is easily readable is essensial and several orders of magnitude more important than writing the code.

    >...because later it could easily look like:

    There you hit the nail on the head. You shall not add add commets now that maybe perhaps might be usefull sometime in the future (see YAGNI or here ).

    In your example the "// NEED_WHATEVER" comment is acceptable while "// BUG_NOT_FIXED_YET" is not. My personal perception of this is that with more than half a screen height between ifdef and endif, adding comments is ok. With only one line inbetween it is absolutely not.

  24. Re:Good code... on Alan Cox on Writing Better Software · · Score: 1
    As written in Refactoring by Martin Fowler:
    Don't worry, we aren't saying that people shouldn't write comments. ... The reason that we mention comments here is that comments often are used as a deodorant. It's surprising how often you look at thickly commented code and notice that the comments are there because the code is bad.

    The best type of code is that kind that does not need to be commented. In my oppinion there are three ways to write code:

    1. Write unreadable code:
    2. if (some_var == 0x4D) {
      do_whatever();
      }
    3. Write unreadable code and comment it readable:
    4. if (some_var == 0x4D) { // 0x4D means WHATEVER
      do_whatever();
      }
    5. Write readable code:
    6. enum {WHATEVER = 0x4D};
      ...
      if (some_var == WHATEVER) {
      do_whatever();
      }

    One thing that annoys me tremendously is people that write comments on #endif even when the #ifdef is two lines above! What is the difference between

    #ifdef NEED_WHATEVER
    #include "whatever.h"
    #endif // NEED_WHATEVER

    and

    i++; // increment i by one

    ? The comment adds no value and is just noice.

  25. Re:Plain Engrish? on Blizzard Stomps Bnetd in DMCA Case · · Score: 1
    On a side note - if someone has written or can provide me with a pointer to a "license agreement" that basically says there is no license, you're bound by copyright law alone, here's a summary of your rights and restrictions I would be grateful, because I'm lousy at writing that stuff myself.

    Back in the days when Borland really was best in class for not treating their customers like criminals and did not not cripple their software (like many other companies did), they used the following text (written of my old paper copy of Turbo C Reference Guide (European Version) (for Turbo C 1.0 in 1987)) (the italics and bold not added by me):

    Borland's No-Nonsense License Statement
    This software is protected by both United States Copyright Law and International Treaty provisions. Therefore, you must treat this software just like a book with the following single exception: Borland International authorizes you to make archival copies of Turbo C for the sole purpose of backing up your software and protecting your investment from loss.

    By saying, "just like a book", Borland means, for example, that this software may be used by any number of people and may be freely moved from one computer location to another so long as there is no possibility of its being used at one location while it's being used at another. Just like a book that can't be read by two different people in two different places at the same time, neither can the software be used by two different people in two different places at the same time. (Unless, of course, Borland's copyright has been violated.)