Comment: Re:then why didn't they write it (Score 3, Interesting) 478
It's such a short and simple function that you could conceivably get two different people to write it and they'd end up with exactly the same code. The code reads:
private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) {
if (fromIndex > toIndex)
throw new IllegalArgumentException("fromIndex(" + fromIndex + ") > toIndex(" + toIndex+")");
if (fromIndex < 0)
throw new ArrayIndexOutOfBoundsException(fromIndex);
if (toIndex > arrayLen)
throw new ArrayIndexOutOfBoundsException(toIndex);
}
There's nothing you could really remove or change about it. Sure, you could put the checks in a different order, but it wouldn't fundamentally alter the code.
Comment: Re:Why So Many Problems? (Score 1) 378
Comment: Re:There is a new better tech for this! (Score 2) 378
Comment: The perfect voting machine should be open. (Score 1) 378
Here's how you do it.
- A public monolithic and government-controlled repository for the code, so everyone can see it.
- Patches to the tree accepted only after review by government-appointed programmer/team. So, rather like Firefox, for example, or the Linux kernel.
- Voting machines then use the government-approved code only.
- Voting machines are sealed boxes, with all external ports secured with lock and key.
- Machines are connected to the central tallying machine at each location by hard-wired ethernet (behind said lock-and-key port).
- A single "monitoring station" is with the adjudicator, which shows votes being cast successfully (but anonymously, so it shows "a vote has been placed in this booth", but not what that vote was), to ensure that people's votes are accepted successfully, that only one vote per person is accepted, and no votes are cast when there is nobody in the booth.
- Every voter gets a printed record of their vote, each machine keeps a printed receipt for itself, as well as a digital copy of all the votes it has received, as well as submitting those votes to the central tallying machine in real-time, which also keeps a paper record, along with passing it's results to the central system in real-time over a secured link (SSL or something similar).
- Each update is sent with a cryptographic signature, which is accepted if the signature matches correctly (and re-requested if they do not). The response is a count of all the votes received through that link thus far - If the amounts differ, there's fraud somewhere, and the system creates an alert.
- Vote counts are displayed in real-time on a/several government-run public website(s) with feeds publicly available for news networks and the like.
Of course, it'll never happen, but one can dream.
Comment: Re:Is IrDA Korean? (Score 4, Insightful) 157
Comment: Re:c# what a lousy name (Score 1) 351
Comment: Not the first (Score 4, Informative) 40
Comment: Re:The big fix... (Score 1) 75
Comment: Re:The big fix... (Score 2) 75
Okay, so you run dumbfucktown.net, and you have connections through comcast and vzw.
vzw starts advertising that they can get to thisnet.com faster with an announcement.
Your router:
- Sends a traceroute to thisnet.com through vzw
- Sends a traceroute to thisnet.com through comcast
- Compares the two results, to see which completes, and which is faster.
- Pings thisnet.com through vzw, with a comcast return route
- Pings thisnet.com through comcast, with a vzw return route
If any of these fail, the new route is rejected completely. If they succeed, the route is classified and entered into the preference list based on it's performance.
If a route starts failing/returning errors, the requests are retried on the next available route in the list, continuing down the list until it is exhausted.
All dumbfucktown.net cares about is if the packets get there, and how fast. It doesn't care who owns the route, how new or old it is, or anything else.
This isn't foolproof, but it would work, I believe.
Disclaimer: IANANE