Slashdot Mirror


User: wcbarksdale

wcbarksdale's activity in the archive.

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

Comments · 194

  1. Re:Not that new.. on Cornell Implementing Bandwidth Charges · · Score: 1

    Cornell has quotas currently, though they tend to be along the lines of "don't be in the top 1% of bandwidth usage when things get tight, or we'll cut you down". The difference is that here you can get pretty much as much bandwith as you want, if you're willing to pay.

  2. Re:Only internet usage on Cornell Implementing Bandwidth Charges · · Score: 3, Informative

    This is quite true. I was a member of a focus group on this idea, and they said that use of the internal campus network was consistently at about 2% of capacity. External capacity has hit 100% in the past, causing them to limit Resnet traffic to a certain percentage of capacity. They would be quite happy if file-sharing were more internal. (Happy, that is, to the extent allowed by law. Cornell complies (somewhat grudgingly) with the DMCA.)

  3. One of the first back doors on Do You Write Backdoors? · · Score: 3, Interesting

    and the one to which "kt" refers is described here. Truly ingenious. Even looking at every part of the source yourself can't protect you in a case like that.

  4. Why the full title couldn't be printed on Survey says: ELC platform spec will expand use of · · Score: 1

    ELC platform spec will expand use of EPSWEUOE

  5. Fax modem? on Michigander Beats Spammer With "Junk Fax" Law · · Score: 2, Funny

    Suddenly there is a use for those things!

  6. Re:One number...Mod'ed rundundant???? on U.S. Endorses ENUM · · Score: 1

    No, it was because everyone already knows that bind handles DNS lookups.

  7. Re:This is good on U.S. Endorses ENUM · · Score: 1

    I once disliked Java for that very reason, but I have since realized that enum is not as essential as you might think in an object-oriented language.
    Basically the main purpose of enum in a language like C is to provide support for polymorphism. (Please forgive any syntax errors or the like in the following, it has been a long time since I've written in C.) If you were writing a calculator along the lines of dc or whatever, you might have at some level:

    struct expr {
    enum type {NUM, OPER};
    enum binop {PLUS, MINUS, TIMES, DIVIDE};
    type t;
    union {
    enum binop b;
    double value;
    } data;
    struct expr *left;
    struct expr *right;
    };
    double evaluate(struct expr *e) {
    if (e->t == NUM)
    return e->data.value;
    switch(e->data.b) {
    case PLUS:
    return evaluate(left) + evaluate(right);
    case MINUS:
    return evaluate(left) - evaluate(right);
    case TIMES:
    return evaluate(left) * evaluate(right);
    case DIVIDE:
    {
    int x;
    x = evaluate(right);
    if (x == 0.0)
    return 0.0;
    return evaluate(left) / x;
    }
    }
    }
    void print(struct expr *e); /* an analogous recursive function */</ECODE>

    Now, I would argue that this is pretty ugly in and of itself; beyond aesthetics, though, it also leads to bugs. Suppose you later add to your calculator an exponentiation operator. You call it whatever you like in the enum, and add it as one of the statements in the switch. You compile and the evaluation still works fine, but when try printing the original expression you print nothing or crash. Oops, you forgot to add the operator to the print function... In a big enough program, you invariably forget to make the change somewhere that is not tested.
    A bigger problem of the same kind lies in the way you are handling different types of expressions. Suppose you decide to add variables to the language. If you don't change evaluate, you'll treat the data member as a binop (rather than as a variable) and end up doing random unpleasant things.
    Contrast that example with this one in Java:

    abstract class Expression {
    public abstract double evaluate();
    public abstract void print(java.io.PrintStream s);
    }
    class NumericValue extends Expression {
    public NumericValue(double value) {v = value;}
    public abstract double evaluate() {return v;}
    public abstract void print(java.io.Printstream s) {/*...*/}
    double v;
    }
    abstract class Binop extends Expression {
    public Binop(Expression left, Expression right) {
    l = left;
    r = right;
    }
    public void void print(java.io.PrintStream s) {
    s.print(l);
    s.print(this.toString());
    s.print(r);
    }
    Expression l;
    Expression r;
    }
    public class Plus extends Binop {
    public Binop(Expression left, Expression right) {
    super(left,right);
    }
    public String toString() { return "+"; }
    public double evaluate() { return l.evaluate() + r.evaluate(); }
    }
    /* et cetera */

    It's more lines of code, I'll grant that. But it's also considerably easier to maintain. Useful commonality is much easier to factor out, with the print function here for instance. And if you forget to write evaluate() for some class, the compiler will complain about it.
    You give the examples of java.awt.Color and java.util.Calendar. Take another look at Color. The constants defined there are actual Color objects, not just ints. You can't pass 8675309 to a function that expects a Color object, as you sometimes can with C-style enums. In fact, an enum wouldn't be very useful here, as a Color seems to be in essence a 4-tuple. You *could* possibly have an enum that just defined those several colors and handled them specially from a standard 32-bit color, but this would be somewhat inefficient. Having a constant in a class like Color does allows the constant to be initialized when the class is loaded and thereafter treated as any other Color is treated. Calendar, on the other hand, is just a very bizarre class altogether.
    One advantage an enum can have over inheritance that I didn't address here is the ability to use numerical properties of the enumerated type. For instance, you can have a for loop over all types, or define a set of properties that you can use binary operations on.

  8. Re:couldnt delete? on TiVo switches off UK sales · · Score: 2, Informative

    In most of Europe, the broadcasting laws allow only child-friendly programming during the day, but pretty much anything (sometimes porn) at night. I assume that's what they're referring to when they say "watershed".

  9. Re:Breadth: Doesn't cover all online tests on Online Testing Patented · · Score: 1
    You're right, I should have RTFA.

    Now that I look at it again, I wonder what exactly a "means for generating the test" is. Suppose you had a Java applet on the client, and you sent it some data, the order of which the applet then randomized; which computer would be "generating" the test then?

  10. Re:Breadth: Doesn't cover all online tests on Online Testing Patented · · Score: 2, Interesting
    In claim 13: wherein a test-maker and a proprietor of the first computer share the revenues generated by the test-taker taking the test. There must be at least two parties making money of the testing. The first being the test maker and the second being the person who owns testing computer.
    Wouldn't this also mean that a test taker using his own computer would be exempt?
  11. Losing mindshare on Ask Internet Expert Dave Barry · · Score: 5, Funny

    In my local paper, they replaced your column with one about sex. Have you considered the possibility of broadening your appeal by including weekly advice on cunnilingus?

  12. Yes, but on Ant Now A Top Level Apache Project · · Score: 2, Funny

    Will it be patched to work in space?

  13. Re:This is nothing new on Sprint DSL's Security Hole Easy As 1,2,3,4 · · Score: 1
    My solution is to have one password for most of my accounts, which I share with nobody.
    This is a pretty bad idea for anything with a security level you actually care about, because if one password is cracked (which can come about through a variety of ways) all of them are.
  14. Re:The evolution of languages on The D Language Progresses · · Score: 1
    I believe cond is older than if, being part of the original syntax of Lisp. (This is back in the day when programs were written in a different language than data.)

    The Y operator has an essential function in that it is the only way to have recursion in pure lambda calculus. If you've ever tried to write an interpreter for a functional language, you run up against the problem that a recursive call essentially forces you to refer to the function before it is defined. So one way of doing it is to put in a pointer to nothing, and later modify it to point to the function itself. But assignment is annoying because it is temporal (see chapter 3 of SICP for more).

    Also see this lecture, which does about as good of a job explaining Y as can be.

  15. Re:The evolution of languages on The D Language Progresses · · Score: 1
    You are entirely right, I was just trying to explain this principle in a way that would be understood for someone unfamiliar with the language.

    (if a b c)
    can be thought of as syntactic sugar for

    (cond (<I>a</i> <i>b</i>)
    (else <i>c</i>))
  16. Re:The evolution of languages on The D Language Progresses · · Score: 1
    To answer your question about the modification of control structures:

    The language that comes closest to what you want is probably Scheme. This is because the language is extremely small, and the syntax is trivial. The level of freedom the language gives you is such that you are not able to tell whether the form "if" is implemented as part of the "language" (whatever that means) or as a procedure in the same way any user could write it.

  17. What computer? on Urban Exploration Walkware · · Score: 1
    I didn't really see anything like the description implied at the linked site. The only way in which their algorithms became more complex was by assuming the people walking around could store a fair amount of state and perform arithmetic, branching, and repetition - in short, the people were Turing devices themselves.

    I am going to think some more about some constraints that could be put on the problem so that it becomes more interesting.

  18. Re:Penn State, not Penn, Timothy on Pasta Outperforms Computers For Earthquake Modeling · · Score: 1

    Debatable. I go to Cornell, and I think of Princeton and Cornell as roughly equal in engineering, and significantly different from the rest of the Ivy League. I have a CS-centric view of things though. Penn is certainly not a bad school for anything, and Penn State is respectable for engineering. I think of their engineering programs as roughly equal.

  19. Re:Penn State, not Penn, Timothy on Pasta Outperforms Computers For Earthquake Modeling · · Score: 3, Informative

    Disclaimer: I go to Cornell. Blind adherence to the rankings is stupid. The main reason why Cornell's rating is relatively low is that a significant number of classes have more than 50 students, and according to US News & World Report, this is BAD. Apparently it is always better to have 10 classes of 30 students rather than one class of 300 students, regardless of teaching style. My personal experience has been that classes taught "in parallel" are on average not taught as well. Given ten professors (or TAs, as is more likely the case), all of them would teach the class if the lecture sizes were small, but only the best one would teach the class if there were one lecture. In addition, there are communication and coordination problems, because everyone has to cover the same curriculum. The factors that make someone choose one school instead of another are varied and complex. I did not even apply to Penn because I wanted to go to school at least a hundred miles or so away.

  20. Wow... on Tolkien and the Beowulf Saga · · Score: 0, Offtopic

    I thought only dead rappers could make new material.

  21. Well, damn on Nintendo's Playstation Settlement Bombshell (or not...updated) · · Score: 5, Funny

    Maybe we won't see the PlayStation 5 after all.

  22. Fitting... on Genetic Algorithm Improves Shellsort · · Score: 3, Funny

    A paper about genetic algorithms, written by a guy named Gene.

  23. Re:MS == Clones on West Virginia Joins Massachusetts in MS Appeal Bid · · Score: 1

    Evidently moderators go into Godwin mode at the mention of Hitler. The point of that post was to show that the argument "x caused y, and y is good, therefore x is good" is stupid.

  24. Re:MS == Clones on West Virginia Joins Massachusetts in MS Appeal Bid · · Score: 0, Flamebait

    it weren't for MS, we would still be paying an arm and a leg for PCs.

    Okay, but if it weren't for Hitler, the digital computer might never have been invented.

  25. For people in the US on Australian Argues for Freedom of Mooning · · Score: 1

    You can make this possible in the US, too, by donating to moonthewhitehouse.com.