Slashdot Mirror


User: dobratzp

dobratzp's activity in the archive.

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

Comments · 14

  1. Re:What's wrong with a while loop? on Sneak Peak at Java's New Makeover · · Score: 2, Informative

    The problem is that i is outside the scope of the loop. However, it is only needed within the loop. If you don't have any other loops in the vicinity, then you are okay, but consider this:

    Iterator i = obj.iterator();
    while (i.hasNext()) { ...
    }
    ...
    Iterator i = obj.iterator();
    while (i.hasNext()) { ...
    }

    Whoops, this doesn't compile. There's a few ways out of this:

    Iterator i = obj.iterator();
    while (i.hasNext()) { ...
    }
    ...
    i = obj.iterator();
    while (i.hasNext()) { ...
    }

    The problem with this is that if you delete the first loop, you have the remember to change the second loop. (This is why reusing variables to do different things is not a good idea.) Here's another approach:

    Iterator i = obj.iterator();
    while (i.hasNext()) { ...
    }
    ...
    Iterator i2 = obj.iterator();
    while (i2.hasNext()) { ...
    }

    The problem with this is that you might forget to change all references from i to i2. Now consider the "standard" solution:

    for(Iterator i = obj.iterator(); i.hasNext();) { ...
    }
    ...
    for(Iterator i = obj.iterator(); i.hasNext();) { ...
    }

    Here, each Iterator is in its own scope and you can easily refactor one loop without dealing with the other.

  2. how to really improve your console's image quality on Console Image Quality Guide · · Score: -1, Offtopic

    Recompile your kernel with VESA VGA graphics console. Then add the following line to your lilo.conf for a 1024x768x64k graphics console:

    vga=0x317
  3. import statements on Building Java Enterprise Applications, Volume I · · Score: 2, Informative

    Explicit import statements are generally preferred for a number of reasons. Consider the following:

    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import javas.jms.*;

    If you see a reference in the code to Session, you will either

    1. know exactly that they are referring to javax.jms.Session and either know its API or be able to look it up in the docs. In this case, you don't care about the import statements.
    2. or have never heard of Session, and decide to look up its documentation. If you see at the top of the file import javax.jms.Session, then you know exactly where to look. If you just have a bunch of wildcard import statements, you have to check through potentially all the packages for java.util.Session, java.sql.Session, etc.

    Also, when someone reads your code, they can browse the imports to check for specific classes you use that they are unfamiliar with. No one is going to read the entire documentation for all the packages you may have used if they only need to understand a few classes.

    The gripes about typing are somewhat unfounded. Any reasonable java-aware editor will be able to automatically manage you import statements.

    Remember: "Any fool can write code that a computer can understand. Good programmers write code that humans can understand." (Martin Fowler)

  4. practicing what they preach? on Ars Technica Reviews Mozilla · · Score: 4, Insightful
    From page 2 on web standards:
    The worst problem with the current internet landscape is the proliferation of "table-based" layouts.

    But what does view source reveal?

    <!-- CONTENT TABLE -->
    <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
    <TR>

    Look no further than the HTML header for the culprit:

    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">

    Now that they have recognized the problem, are they or their resident Microsoft weenie going to fix it? Probably not.

  5. Those new keyboards do work in Linux on A Selective History Of The Keyboard · · Score: 3, Informative

    There have been a number of posts complaining about how they have a new keyboard and it doesn't work in Linux. Well, though the Keyboard HOWTO doesn't mention it, these new keyboards work without modification to the standard X setup. That is to say, when you press an "internet" key, the X server recognizes this and recieves the scancode. All you have to do is map that scancode to a useful key, and presto, you have a functional internet keyboard.

    Step by Step:
    1. Swap keyboards (no need to reboot here)
    2. Run xev. Make note of the desired key's scancode
    3. Edit your .Xmodmap file to map the key to something useful (X provides the symbolic names F13 and above for situations like this)
    4. Run xmodmap .Xmodmap to tell your X server about your new keys.
    5. Configure your applications to recognize these new keys. For example, in enlightenment you can edit keybindings.cfg so that F13 starts XMMS.
  6. doesn't look like it will be mainstream on ReplayTV 4000 Series Shares TV Over Net · · Score: 2, Interesting

    from the faq...

    Q. I don't have a home network. Will I need to get one?
    A. Yes. ReplayTV 4000's are enabled by an Ethernet connection only. There are also all kinds of incredible features that work only when your ReplayTV is connected to your PC. But don't worry, home networks are relatively inexpensive and easy to install. And, to make this even easier, ReplayTV is providing, for a limited time, a choice of promotional offers including a Free NETGEAR Home Network (a $100 value), with the purchase of an RTV4080, RTV4160 or RTV4320.

    The fact that you can bypass commercials still will affect a very limited number of users. Yes, home networks are relatively inexpensive (less than $2000), but your average consumer will not want to set up a firewall/router and a home network just to watch TV. Looks like the mainstream is still bound to low quality "VHS" technology for a little while longer.

  7. so does google on SBC/Pacbell To Filter 90% Of alt.binaries Groups · · Score: 2, Informative

    Of course the alt.binaries groups contain a lot of warez/pr0n and gernally questionably legal material. However, there is the occasional alt.binaries.calc-ti, but even google doesn't have the alt.binaries.* hierarchy. This is probably because of it's massive size yet thorough lack of textual information.

  8. crash? on Why Redhat Choose ext3 For 7.2 · · Score: 1

    After an unclean system shutdown (unexpected power failure, system crash)...

    Power failures have been known to occur sometimes, but I've never had Linux crash.

  9. can you say "Java?" on The D Programming Language · · Score: 5, Insightful

    from the overview page...

    features to keep:
    • compile/link/debug development model
    • Exception handling
    • Runtime Type Identification
    • link compatibility with the C calling conventions

    All except the last is contained in Java.

    features to drop:
    • C source code compatibility
    • Link compatibility with C++
    • Multiple inheritance
    • Templates
    • Namespaces
    • Include files
    • Creating object instances on the stack. In D, all objects are by reference.
    • Trigraphs and digraphs
    • Preprocessor
    • Operator overloading
    • Object oriented gradualism
    • Bit fields of arbitrary size
    • Support for 16 bit computers

    This seems to be precisely the parts of C++ that Java also does away with. Furthermore, the C preprocessor is not strictly part of the C language and in fact many other programming projects use cpp for simple cut and paste includes of their favorite language. When I first read about trigraphs, I couldn't wait to try them out to make some extra obfuscated code, but alas the C compiler I was using didn't support them. In fact the lack of standards compliance is one of the main drawbacks to programming in C++ and C. If my Java code compiles on sun's compiler, then I can be assured that it will also compile on any other compiler claiming to compile Java code.

    The author also mentions that D will not have any bytecodes. From a strict perspective, the Java programming language and the Java VM are two different standards and just because you typically compile Java code into (confusingly named) Java byte codes, doesn't mean you can't use one without the other. For example, anyone (who is insane) can pick up a copy of the Java Virtual Machine Specification and a hex editor and make some syntactiacally correct class files. More realistically though, java bytecodes are often targets for compiler construction classes. Also, if you use the GNU Java Compiler you can compile programs written in the Java programming language directly into machine code.

    While 90% of the description of this language screams Java, there seem to be some of the more useful features of C++ thrown in (typedefs, scope operator, etc.). The only way for this to be successful, is to finish standardizing the language as soon as possible and get a reference compiler for it so it leaves the realm of theoretical vaporware. Perhaps Java might have looked more like this if the language design was revisited. However, Java has lots compilers which are much much more likely to conform to the standard than the C++ equivalents.

  10. the real motive on A Motley Crew Beams No-Cost Broadband In New York · · Score: 2, Funny

    ...scanning the adult playground the place becomes on hot summer evenings. Where else, he asks, can you walk around with a computer, surf the Web, and go utterly unnoticed?

    adult playground... hot summer evenings... go utterly unnoticed... sounds like somebody got kicked out of the house for looking at pr0n.

  11. this is old news on Embedding Chips Into Paper Money · · Score: 1

    Didn't anyone see the movie Conspiracy Theory?

    Tracking devices have obviously been in our money since the introduction of the new money.

  12. Settlers of Catan on Can You Suggest Any Non-Zero Sum Games? · · Score: 1

    This is a German board game that is less well known in the states, but is distributed here by Mayfair games.

    This game is very well designed. The board is composed of hexagons that are shuffled each time. You have to aquire resources to build settlements, which in turn allows to build more. It has been dubbed a cross between simCity and monopoly, but is more entertaining than either of those.

  13. beaucoup d'information on Foreign Language Education Software For Linux? · · Score: 1

    One way to learn about french is by reading things in French. All worthwhile software is usually released with French translations:

    Debian
    GNU

    But of course if you don't know any French this won't help. You can however, check out this tutorial.

  14. Re:Perfect pitfall game? on First Ever Pitfall Perfection? · · Score: 1

    There are 254 screens that wrap around Atari 2600 style. Every time you travel underground, you advance 3 screens at a time, so a seemingly impossible game becomes possible. This map can be found at one of the better atari 2600 sites.

    Once you study the map and memorize the optimal route, you just have to master the art of jumping on crocs heads and over scorpions. Since the barrels roll from right to left, it is easier to travel in that direction, but you will need to practise travelling against barrels if you hope to get the perfect score (you loose points every time you get knicked by a barrel).