Slashdot Mirror


Learning Java Through Violence

Joe writes: "Someone introduced me to a new game called Robocode and now I'm hooked as well as my 17 year old son. We are both learning Java while playing the game or I should say while building our Java robots. The game is setup to teach you how to handle events, how to create inner classes, and other Java techniques to build more sophisticated Java bots. I have a c++ background so I've been helping my son with his bots, but he's catching on very fast. It's turning out to be a cool and easy way to get the kid clued into programming and best of all its free." I'll bet if the little Logo turtles shot at each other, I would have had more fun programming as a kid.

26 of 225 comments (clear)

  1. THIS IS THE POST BEFORE # 2 by Anonymous Coward · · Score: -1, Offtopic

    GUESS The weekend is pretty slow, huh

  2. Slashcode revisited! Bumper Double Issue! by Surviving+O.+P.+P. · · Score: -1, Offtopic

    It's been a couple of weeks since my last analysis of slashcode's deficiencies. We've all seen the evidence of Taco's totalitarian methods. Now let's look a little deeper at his incompetence and short-sightedness as a coder. To paraphrase Taco's words to Anne Tomlinson, was he dropped on his head at birth?

    Part 1: Why is Slashdot the only site on the internet that DOS's itself?

    I'm sure you've all noticed the frequent protracted outages over the last couple of weeks. Many have demanded an explanation, or at least an acknowledgement that something has gone wrong. Slashdot has been down for hours at a time, but the editors act as if nothing had happened. Since Rob "Cmdr. Whitewash" Malda and friends aren't willing to open up to their readers, it's up to me to give you the dope on why Slashdot is such a piece of crap.

    The problem is of course, MySQL, as we have always suspected. mod_perl is another slice of the problem, with the last factor in the equation being unscaleable hardware.

    MySQL + mod_perl + PC hardware = crash

    MySQL has long been a favourite among people who want to set up a database backed web page, but are too cheap to pay for oracle. It has a reputation for serving up pages quickly, which it does admirably on sites that have low loads. As the number of connections to the DB increase past 50, MySQL seems to lose a lot of stability. In fact, it is not uncommon for it to crash and lose data in some circumstances.

    In most circumstances, this isn't a problem for slashdot. It's rare for the site to reach more than 50 connections, however it does happen. It is at these times that slashdot has an increased tendency to experience the slashdot effect firsthand. The reason is that while mod_perl isn't quite a replacement for a proper middleware layer. mod_perl includes persistent database connections, but these are irrelevant. MySQL is known for it's high connection speed, and persistent connections don't really lift it's game much. They also don't solve the problem of handling excessive connections. When mod_perl runs out of open connections, it just opens another one. In other words, mod_perl does nothing to protect the MySQL database from overload.

    The other problem is the hardware. A site like slashdot, receiving approximately 600 connections per minute should be running on high end enterprise hardware, not PC hardware. Taco has tried to overcome this with clustering, but this has limitations in an IO intensive area like running a website. PCs are not known for having good network performance, and this is one area that cannot help but cause a bottleneck, particularly when the site is running under load. One advantage of running on Sun or IBM hardware is that you get good IO performance combined with the ability to utilise multiprocessing. Running your site spread over 12+ low-end machines in a network just isn't anywhere near as good.

    Compare slashdot to any other high traffic site. Amazon.com for instance. Have you ever seen amazon go down for four solid hours without being DOSed by canadian hackers? Amazon copes with their load because they run a sensible database, a well-designed front-end and hardware that can cope with the load. Thanks to the open-source ideology of this site, only one of these options are open to the administrators. PostGreSQL would reduce the number of crashes, however it is about 3 times at dealing with individual connections as slow as MySQL.

    Essentially, we have a situation where the site is periodically hit with a large number of simultaneous connections, and they cause the database to keel over and die. This does not reflect well on Open Source software, and puts this site in the ironic position of bringing disrepute upon Open Source though their success at evangelism. It's no wonder the slashdot editors are unwilling to acknowledge their site's incredibly fragile nature.

    I'd like to make it clear at this point that I don't actually know for sure that this is what's happening. For all I know, Taco is working on the code that is running on the actual slashdot server, and keeps breaking it. I'm just making educated guesses here.

    As a bonus final note to the first half of this bumper double issue, has it occurred to anyone else that this site's codebase shares it's name with a slang term for homoerotic fan fiction? Linux gay conspiracy indeed!

    Part 2: What in holy fuck?! search.pl under the microscope.

    I have conclusive proof that Cmdr. Taco. is a gibbon. search.pl and Search.pm. Here's something cool for you to try at home: go to the search page, and search for all comments containing the word "competent". Now wait a few seconds. Wait a few minutes. Go grab a bite to eat. When you come back, it should be done.

    Yep, this is the slowest search page in the universe. If you didn't believe me last time I told you that Malda has all the coding ability of a starving five year old from Ghana, you will believe me soon.

    OK, you don't need to look at search.pl. All the meat is in Search.pm, and this time it's nicely placed at the top. Find the _keysearch function. Notice the for loop in there. What that loop is doing is constructing a "LIKE" clause to insert in a query string. It surrounds every word you entered into the search field with wildcards and uses them to search against comment text and title. This is then used in the findComments function as a clause in a select query which searches the entire comment database.

    I have two major problems with what Taco has done here. They are as follows:

    1. Even retards are laughing at him for writing code this fucken stupid.

    2. LIKE queries are slow. They are text substring searches. They can't be optimized very well by databases like MySQL. These systems simply aren't designed with this sort of thing in mind, because for applications that aren't designed by twits, this functionality is seldom needed, and best implemented in an application specific way. Let me reiterate what's going on here. Slashcode is performing a substring search on every comment and comment title in the entire database. That is, too put it mildly, a shitload of text to search through. It cannot be done quickly, as our little demonstration should have proven to you. It is an idiotic thing to implement in a web page like slashdot, and Taco should be hanged by his testicles for having even had the idea.

    You're probably thinking, "Hey, wait! Doesn't google do this sort of thing all the time, with incredible speed?" Yes, google does, but google's developers actually took the time to implement data storage methods geared towards fast search and retrieval of data based on substrings. Examples of this, for those who care, would be digital search tries and ternary trees. These are the best methods I know of off-hand for implementing the type of search slashdot is providing. Evidently Taco doesn't know of them, but that's hardly surprising, since gibbons can't read or study computer science. I also doubt that they can be implemented efficiently in perl.

    I didn't think I'd be able to find a clear, simple example to top the postercomment compression filter's ability to demonstrate what an imbecile taco is, but I guess I understimated him. This is without a doubt, the dumbest thing I have ever seen in code anywhere.

    XXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXX
    XXX XXXX XX X
    X X XX XXXX XXXXXXX
    X XXX XXXXXXX XXXXXX
    X XXX XX XX X
    X XXX XX XXXXXXXXXXXX
    X X XXX X X
    XXX XXX XX XX
    XXXXXXXXX XXXXX XXXXX

  3. well well. by Anonymous Coward · · Score: -1, Offtopic

    java=coffee.

  4. So is this like, national michael-posting day? by Anonymous Coward · · Score: -1, Offtopic

    Oh well, at least everything he posts is spelled right...Taco :P

  5. glilkklkl by Anonymous Coward · · Score: -1, Offtopic

    slashdot sucks. Man I HA?TE YOU LOSERS

  6. Java is a CowboyNeal by Anonymous Coward · · Score: -1, Offtopic

    It slows your car down and eats all the groceries.

  7. Michael's Childhood by Anonymous Coward · · Score: -1, Offtopic
    Judging from Michael's Environmentally Profitable posting at 7:04 and this one, it kinda looks like Michael had a pretty miserable childhood.


    What gives, man? Seek therapy or something.

  8. down they go. by SubtleNuance · · Score: 2, Offtopic

    wow, weve /.ed IBM.

    Bend to our will IBM l0z3rzz.

    1. Re:down they go. by revscat · · Score: 2, Offtopic

      Y'know, I think that /. should set that up as a motto somewhere. "News for Nerds. Stuff that matters. And we took down IBM's webservers, so watch it, bucko."

  9. Re:Moral implications... by DickBreath · · Score: 2, Offtopic

    There is enough sex and violence present in the media already without intermingling it with education.

    I disagree on both counts. You say for both sex and violence that there is "enough". How much is enough?

    There is too much violence in media.

    There is not enough sex in media.

    And your idea of intermingling with education is a great concept. Now that you've mentioned it already, is it too late to patent it?

    --

    I'll see your senator, and I'll raise you two judges.
  10. metamod by Anonymous Coward · · Score: -1, Offtopic

    damn it why won't slashdot let me metamod? my uid is under the bottom 90%...and yes i have an account, i'm posting this anonymously cuz i don't want to lose karma

  11. ** FAG ALERT! ** by Anonymous Coward · · Score: -1, Offtopic

    I regret to inform you that you, sir, are a raging homosexual.

  12. Re:This is how i learned C, too by Anonymous Coward · · Score: -1, Offtopic

    holy shit, the nitpick police are out in force today.

  13. FAG by Anonymous Coward · · Score: -1, Offtopic

    I regret to inform you that you, sir, are a raging homosexual.

    1. Re:FAG by Anonymous Coward · · Score: -1, Offtopic

      You're right, fucker. Now bend over already, you pussy.

  14. RAGING HOMOSEXUAL by Anonymous Coward · · Score: -1, Offtopic


    .=~~~~~~~=.
    {:.. }
    `~| O |~`
    .'`~~~~~~~`'. YOU'VE GOT MORE
    / o o \ JIZZ IN YOUR MOUTH
    : )(_)( ; RIGHT NOW THAN
    \ '.___.' / I COULD POSSIBLY
    `.,__`=' _,.' BELIEVE
    /__\V/__\
    /\\
    / / \
    jgs \/`\/


    I regret to inform you that you, sir, are a raging homosexual.

  15. **WARNING! WARNING! FAG ALERT** by Anonymous Coward · · Score: -1, Offtopic

    1 R3GR37 70 1NF0RM J00 7H47 J00, 51R, 4R3 4 R461N6 H0M053XU41!!!!!!!!!!!!11111111

    anal filter encountered. buttfuck aborted!

  16. Re:This is how i learned C, too by Anonymous Coward · · Score: -1, Offtopic
    YHBT. YHL. HAND.

    I can't believe people still fall for that shit.

  17. ripping off ascii spork by Anonymous Coward · · Score: -1, Offtopic


    O )) ( ( \ \_.-' \ O )) ( ( \ \_.-
    \_.' | `. \ __ | \_.' | `. \ THIS IS A CROSS
    \#_/ `-._/ . / _`. \#_/ `-._/ BETWEEN ESCHER
    -' \ O )) ( ( \ \_.-' \ O . AND A STIFF
    __ | \_.' | `. \ ' __ | \_/ DICK UP THE ASS
    . / _`. \#_/ `-._/ . / _`. \#_/
    )) ( ( \ \_.-' \ O )) ( ( \ \_.-'
    ' | `. \ ' __ | \_.' | `. \ '
    `-._/ . / _`. \#_/ `-._/ .
    \ O )) ( ( \ \_.-' \ O )) (
    __ | \_.' | `. \ ' __ | \_.' |
    / _`. \#_/ `-._/ . / _`. \#_/ `-._
    ( ( \ \_.-' \ O )) ( ( \ \_.-'
    `. \ ' __ | \_.' | `. \ ' __
    _/ . / _`. \#_/ `-._/ . / _`.
    \ O )) ( ( \ \_.-' \ O )) ( ( \ \
    | \_.' | `. \ ' __ | \_.' | `. \
    \#_/ `-._/ . / `. \#_/ `-._/ fL


    I regret to inform you that you, sir, are a raging homosexual.

    Your cock violated CmdrTaco's anal filter. Buttfuck aborted!

  18. Re:WHO GIVES A FLYING FUCK? by Anonymous Coward · · Score: -1, Offtopic

    ha ha.

  19. oooohhhh yeah that cock up my ass feels soo good! by Anonymous Coward · · Score: -1, Offtopic


    _
    \"-._ _.--"~~"--._
    \ " ^. ___
    / \.-~_.-~
    .-----' /\/"\ /~-._ / IF YOU THINK MY HAIR
    / __ _/\-.__\L_.-/\ "-. LOOKS FUNNY YOU SHOULD
    /.-" \ ( ` \_o>"<o_/ \ .--._\ SEE MY CROTCH
    /' \ \: " :/_/ "`
    / /\ "\ ~ /~"
    \ I \/]"-._ _.-"[
    ___ \|___/ ./ l \___ ___
    .--v~ "v` ( `-.__ __.-' ) ~v" ~v--.
    .-{ | : \_ "~" _/ : | }-.
    / \ | ~-.,___,.-~ | / \
    ] \ | | / [
    /\ \| : : |/ /\
    / ^._ _K.___,^ ^.___,K_ _.^ \
    / / "~/ "\ /" \~" \ \
    / / / \ _ : _ / \ \ \
    .^--./ / Y___________l___________Y \ \.--^.
    [ \ / | [/ ] | \ / ]
    | "v" l________[____/]________j -Row }r" /
    }------t / \ /`-. /
    | | Y Y / "-._/
    }-----v' | : | 7-. /
    | |_| | l | / . "-._/
    l .[_] : \ : r[]/_. /
    \_____] "--. "-.____/

  20. Flamebait? by Anonymous Coward · · Score: -1, Offtopic

    Just wanted to take this opportunity to say

    THE MODERATORS ARE ON CRACK!!!

    Thank you. Have a nice day. Drive through.

  21. Re:Hmmmm. by Anonymous Coward · · Score: -1, Offtopic

    Larry King, is that you?

  22. Re:Learning violence through Java by Anonymous Coward · · Score: -1, Offtopic

    Linux sucks.

    Your comment violated the postercomment compression filter. Comment aborted

    Important Stuff:
    Please try to keep posts on topic.
    Try to reply to other people comments instead of starting new threads.
    Read other people's messages before posting your own to avoid simply duplicating what has already been said.
    Use a clear subject that describes what your message is about.
    Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated. (You can read everything, even moderated
    posts, by adjusting your threshold on the User Preferences Page)

  23. Re:Learning violence through Java by Anonymous Coward · · Score: -1, Offtopic

    Moderators, you suck: You just CAN'T HANDLE THE TRUTH.

    Write you next program for work in Java. Hope you get fired, motherfucker!

    Java just plain sucks, grow up, admit it, and just use C.

    Heck even C# is probably better from a technical perspective.

  24. Your sig by reverius · · Score: 0, Offtopic

    Leftist - force the world to work together, thus violating human nature.

    Liberal - ask the world to work together, thus getting no response.

    Libertarian - allow corporations to enslave humanity without government intervention.

    :)