Slashdot Mirror


User: KnightStalker

KnightStalker's activity in the archive.

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

Comments · 764

  1. Another solution on Open Source Programmers Stink At Error Handling · · Score: 2

    This will probably annoy programmers who started with "pure" C++, Java, or VB.

    int allocate_3(void){
    int *buf, *p1, *p2, *p3 ;

    buf = malloc(3*SOME_NUMBER*sizeof(int)) ;
    if (!buf) { return -1; }

    p1 = buf ;
    p2 = buf + SOME_NUMBER;
    p3 = buf + SOME_NUMBER*2 ;

    /* Here we do something with p1, p2, p3 */

    free ( buf ) ;
    return 0 ;
    }

  2. Re:Excpetions are a key on Open Source Programmers Stink At Error Handling · · Score: 2

    I don't see why. Just test for the exceptions you're interested in and then calling die($@) will pass your exception to the previous eval{} frame. It's really not any more unreadable than most perl code. Perl's lack of a switch() statement makes this a minor hassle of if/elses but that's really no trouble. It's less elegant than C++ but I certainly wouldn't call it "very hard".

    You can die with objects or hash/array references as well as scalars, which adds some flexibility. Furthermore, this fulfills your requirement in another comment that internal methods use the exception handling system. eval{} will catch fatal errors from perl internals.

  3. Re:Excpetions are a key on Open Source Programmers Stink At Error Handling · · Score: 2

    While this is not exactly on topic, exception-like behavior in Perl can be handled using the eval()/die()/$@ syntax.

    Certainly, exception handling in C++ or Python is much more efficient and elegant.

    Example:

    #!/usr/bin/perl
    eval{test(3)};
    if ($@) {
    print "Whoops: $@\n";
    }

    sub test {
    my $bob = shift;
    if ($bob == 1) {
    print "Happy\n";
    } else {
    die("Failure testing \$bob");
    }
    }

  4. Re:Proudly Brainwashing the Masses on Disney's Anti-File Swapping Cartoon · · Score: 2
    >Kids should be watching TV that teaches them to think for themselves and make thier own choices.

    /me wipes away a tear... Thank you. That was the funniest thing I've seen in days.

  5. Re:The net was used on Sept 11... on Net: Now Our Most Serious News Medium? · · Score: 1

    Actually, I was wrong. A "case" as used there is only a gallon and a half. Milk therefore sells slightly more gallonage than all Coke products combined.

  6. Re:The net was used on Sept 11... on Net: Now Our Most Serious News Medium? · · Score: 3, Informative
    Milk is better for you than Coke, but which one sells more?

    This surprised me. I know it's a rhetorical question, but in 2000, milk actually sold more, with 6.5 billion gallons, than Classic Coke, with 2 billion cases (two gallons/case). Coca-Cola soft drinks totalled sell more (4.3 billion cases) than milk, however. And like some other jerk pointed out, milk is probably not better for you than Coke. They're both pretty bad. :-)

    http://www.beverage-digest.com/editorial/010215s.p hp
    http://web.northscape.com/content/gfherald/2001/08 /06/agweek/806MILK.htm

  7. Re:Monopoly for the illiterate... on File Extensions And Monopolies · · Score: 1

    Hear, hear. And if RealPlayer or Netscape or (presumably) Star Office or whatever is run under Windows, it asks to register itself as the default viewer and then (if you check the box) doesn't ask again. How hard is that?

    The Salon article should be moderated -1, Flamebait.

  8. Re:Methodologies are important on Netcraft Survey Updated · · Score: 4, Informative
    See here for server statistics on the top 1000 linked sites.

    Executive summary:
    Apache 41%
    Unknown 18%
    IIS 13%
    Netscape Enterprise 12%

  9. More numbers. on Brazil Breaks Patent to Make AIDS Drug · · Score: 2

    Stupid jackass... are you too terrified to go to web sites on your own? How about Pfizer:

    Selling, informational, and administrative expenses: $11,442,000,000
    R&D expenses: $4,435,000,000

    Merck?

    $6 billion on marketing, $2 billion on R&D.

    GlaxoSmithKline? They call themselves a "research company"...

    $10 billion on "selling, general, and administrative"
    $3.8 billion on R&D.

    I still can't find information on what Bayer spent on marketing.

    All this information is from the companies' annual reports, available for free on their web sites, and this is hardly damning evidence that corps are evil. But it's pretty clear that they do spend way more on marketing than on development.

  10. Re:Here you go... on Brazil Breaks Patent to Make AIDS Drug · · Score: 1

    BTW, I looked at Bayer first, then Roche. I couldn't find marketing expense information on Bayer's site within 5 minutes or so, so I moved on, but I believe their gross profits and R&D costs were on the same order as Roche's. I didn't look at any other companies.

  11. Here you go... on Brazil Breaks Patent to Make AIDS Drug · · Score: 3, Informative

    For Roche themselves, the company mentioned in this article. From part of their 2000 annual report, in a PDF ("Finance") available at: http://www.roche.com/home/investor/inv-finance/inv -reports/inv-reports-2000-annual-report.htm

    Marketing and distribution 8,746 (2000) 7,813 (1999)
    Research and development 3,950 (2000) 3,782 (1999)

    Numbers are in millions of Swiss francs.

    Clear enough?

  12. Re:Watching grass grow on The Plotter Thickens With Volumetric 3-D Display · · Score: 1

    It'd be at least as exciting as the Corn Cam :-)

  13. Re:is government the answer? on Ask Congressman Boucher About Internet Regulations · · Score: 1

    did you know the federal budget allocates enough money to federal highway upkeep each year to pay to pave a single lane of each Interstate in GOLD??)

    I had no idea.

    So I went to the Federal Highway Administration's web site (www.fwha.dot.gov) and found out that there are 43,000 miles of interstate they maintain, and they have a budget of $4.073 billion dollars allocated for interstate maintenance. So I did a little calculation.

    Assumptions:
    A lane is ten feet wide.
    Everyone on the gold-paving project is working for free. The entire infrastructure costs nothing. The *only* cost is the cost of the raw materials (i.e., gold).

    Values:
    Cost of gold: $260/oz
    Miles of interstate: 43000
    Dollars available: 4073000000

    43000 mi (of highway) * 5280 (feet per mi.) * 12 (in per ft) * 2.54 (cm per in) * 10 (feet wide lane) * 12 (in per ft) * 2.54 (cm per in) = approximately 2109270620160 square centimeters total in the Interstate Highway System

    4073000000 (budget) * (1/260) (oz per $) * 480 (g per oz) * (1/19.3) (cc per g) = 389605415.811 (cc)

    389605415.811 (c^3) / 2109270620160 (cm^2) = .00018471096 cm thick

    Yes, folks, that is about two millionths of a meter thick. Damn those wasted dollars.

  14. Re:No shit.... on Even Programmers Get the Job Search Blues · · Score: 1

    Yep, you pegged it. About a year and a half as a webmaster, that's it. (Note to self: Next time, get a new job before quitting your current one.) Still, why do almost all job openings require 5 years experience?

  15. No shit.... on Even Programmers Get the Job Search Blues · · Score: 2


    I'm out of work right now (right out of college - doh) and I've been applying to every job that looks interesting for weeks. I may not be Alan Cox, but I'm not a neophyte who just picked up "Perl for Dummies". In fact I'm damn good at Perl, PHP, C, C++, and hell, I could probably pick up Ada or Smalltalk again if I had to. But no one will even call me back. Jobs that are listed on Monster, Dice, even companies' web sites turn out to be "on hold." What the hell am I doing wrong, or do I just need to quit being picky and go apply for those "experience in Microsoft Internet technology preferred" jobs? This is driving me nuts.
    </rant>

  16. Re: Bagh...Humbug on Microsoft Access As A Client For Free Databases? · · Score: 1

    I'll second that. Besides, this can be answered with about two minutes of looking at the MySQL home page.

  17. Re:Um... on The Opportunity of SOAP · · Score: 1

    > It's written mostly in C and C#.
    > CVS Repository ( 0 commits, 0 adds )

    ITYM "will" be written, especially since C# requires a runtime that doesn't (yet?) exist for anything but Windows :-)

  18. Re:Sounds unfair for the retail chain. on Undercover Sales Consultants? · · Score: 1

    Whack! Reality strikes again. I had no idea. You're right, though, they're now owned by "Tricon Global Restaurants, Inc."

  19. The difference.... on Computer Science vs. Computer Engineering? · · Score: 2

    Computer science: much math-based theory, some programming

    Computer engineering: much hardware design, hardware theory, some programming (assembly, C, C++)

    Software engineering: tiny bit of hardware design, some theory, much programming, some software development process

  20. Re:Sounds unfair for the retail chain. on Undercover Sales Consultants? · · Score: 1

    Hell, Pizza Hut is *owned* by Pepsi.

  21. If you're ever in Bozeman, MT... on The Apollo 11 Guidance Computer · · Score: 3

    the American Computer Museum there actually HAS an Apollo guidance computer, along with a lot of other neat stuff. Very cool. No, they don't let you use it. :-)

  22. Re:The end of scarcity... on Can You Suggest Any Non-Zero Sum Games? · · Score: 1

    Thousands of homes stand empty. And yet we still have homeless people. Why? Because they can't pay for it.

    Actually, a large fraction of homeless people are homeless because they intentionally rejected modern society. Another large fraction are homeless because they are mentally ill or drug addicts -- solveable, but not by giving them homes and job training, and not by imposing "programs" on them. People who are homeless because they just can't get a break exist, but they don't represent the whole population, and probably not more than a small fraction.

    I don't have numbers for this, and they are probably hard to come by... after all, people who avoid society aren't likely to want to participate in a survey.

  23. Re:Enterprise-grade messaging for Linux/Unix on What Mailbox Format Do You Use And Why? · · Score: 1

    The way (to me) an RDBMS makes sense for storing email on the server side are increased speed of retrieval (maybe), and speed of development. It makes more sense to me when you've got 1000 or 10000 clients getting their email all at once... then I think the indexing and concurrency features of the database would make up in speed for the increased complexity.

  24. Re:Enterprise-grade messaging for Linux/Unix on What Mailbox Format Do You Use And Why? · · Score: 1

    A true enterprise-grade message store will use an embedded database with transactions support.

    Why is it important that the database be embedded? I agree that from a client/server standpoint, using an RDBMS makes far more sense than the standard sendmail mbox format. But it seems to me that having an external database would be more flexible than a linked-in system like Berkeley DB.

  25. Re:Drug Companies on Intellectual Property And The AIDS Crisis · · Score: 1

    If you think about it, most of the money to develop those drugs probably already comes from taxes, through Medicare. I'd rather take the companies out of the loop and have the government pay directly for the research. The government is then paying for a larger share of the research costs, but the marketing costs drop to zero, and the results are (hopefully) available, patent-free, to everyone.