Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?

Slashdot videos: Now with more Slashdot!

  • View

  • Discuss

  • Share

We've improved Slashdot's video section; now you can view our video interviews, product close-ups and site visits with all the usual Slashdot options to comment, share, etc. No more walled garden! It's a work in progress -- we hope you'll check it out (Learn more about the recent updates).


Comment: Re:Really? (Score 1) 215

by alantus (#49054921) Attached to: Japan Now Has More Car Charging Points Than Gas Stations

And yet I live in Tokyo and I have never seen a charging point there. Can anyone tell me where there is a public point?

Every Nissan dealer has at least one charging station.
You leave the car there while you go inside and enjoy free drinks, snacks, games for your kids, etc.
Of course, that is as long as you are a Nissan owner.

Comment: Re:Self-Inflicted Damage (Score 4, Insightful) 369

Just recently Israel was fighting against Hamas, who was launching rockets while hiding behind civilians that they were purporting to represent. They really don't care about the people they "represent".

Suicide terrorists are glad to blow themselves up if they take a few infidel's lives with them. They believe they get rewarded with a number of virgins in heaven.

El Che Guevara is hailed as a hero for dying for his cause, even when he was directly responsible for the killing and misery of so many, especially his own people. You can buy one of "Che" iconic t-shirts almost anywhere, they sell like hotcakes.

Comment: Skype disappointments (Score 2) 267

by alantus (#47619063) Attached to: Skype Blocks Customers Using OS-X 10.5.x and Earlier

Skype has been a continues stream of disappointments over the last few years.

First they started with this policy of taking away your credits if you haven't used them in a few years. They are still kind enough to let you "reactivate" them. This is like a bank taking your savings because you haven't used them in a while, but allowing you to get them back by dropping by. Its immoral and should be illegal.

Recently they also blocked access from the linux skype client without any warning whatsoever, suddenly you just can't connect. And after updating to the latest version (, it crashes every time. Turns out you have to do some changes to the sqlite database that holds your history (couldn't they do that automatically?).

Unfortunately opensource IM isn't much better. With so many usability issues, slow development (thinking about pidgin and gajim), and now Google turning their back on openness by disabling XMPP federation, the landscape of opensource IM looks gloomy.

Comment: Re:This is true (Score 2) 194

by alantus (#46316129) Attached to: Internet Shutdown Adds To Venezuela's Woes

How is it that Maduro and his allies can continue to persist with economic policies so patently stupid that even an undergraduate student of economics at any American or European university can predict and explain their inevitable failures?

Stupid or genius? Depends on the goal.
If its to improve the economy and life quality, plain stupid. If its to stay in power forever, genius!

1. Ruin the economy, make people poor and easy to manipulate
2. Create many social programs to "help" the poor, the poor depend on the state
3. Confiscate and nationalize everything, the state must run as much as possible, have everyone working for the state
4. Make it clear that they have to support and vote for you, or they lose their job and "hard earned" state benefits
6. Profit! You get all the votes from the poor, and most people are poor now :)

This strategy worked well for Chavez, and now his golem, Maduro.

Read this enlightening interview with the ex CEO of PDVSA (the oil company):
For the Spanish-impaired, a google translation is quite decent:

Here is an interesting bit of this interview, just in case the page is removed (because Globovision is now controlled by the government):

"Look General, you still don't understand the revolution! Let me explain: This revolution aims to make a cultural change in the country, change the way of thinking and living, and those changes can only done being in power [in office]. So the most important thing is staying in power to make the change. We get the political floor from the poor: they are the ones who vote for us, that is the reason for our speech of defending the poor.
So, THE POOR MUST CONTINUE TO BE POOR, WE NEED THEM LIKE THAT, until we can achieve a cultural transformation. Later, we can talk about economy of production and wealth distribution. Meanwhile, we must keep them poor and with hope."

Comment: Re:My solution (Score 1) 243

My script is can save some I/O and cpu cycles, but has to keep more files open at a time (could run out of filedescriptors in extreme cases).
The script you describe must be shorter and easier to understand, but I would only use it for smaller files, where discarding duplicates before reading the whole file doesn't make a big difference.
The next step is to create some UI that allows deleting duplicates easily.

Comment: My solution (Score 2) 243

# $Id: findDups.pl 218 2014-01-24 01:04:52Z alan $
# Find duplicate files: for files of the same size compares md5 of successive chunks until they differ
use strict;
use warnings;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use Fcntl;
use Cwd qw(realpath);

my $BUFFSIZE = 131072; # compare these many bytes at a time for files of same size

my %fileByName; # all files, name => size
my %fileBySize; # all files, size => [fname1, fname2, ...]
my %fileByHash; # only with duplicates, hash => [fname1, fname2, ...]

if ($#ARGV < 0) {
    print "Syntax: findDups.pl <file|dir> [...]\n";

# treat params as files or dirs
foreach my $arg (@ARGV) {
    $arg = realpath($arg);
    if (-d $arg) {
    } else {

# get filesize after adding dirs, to avoid more than one stat() per file in case of symlinks, duplicate dirs, etc
foreach my $fname (keys %fileByName) {
    $fileByName{$fname} = -s $fname;

# build hash of filesize => [ filename1, filename2, ...]
foreach my $fname (keys %fileByName) {
    push(@{$fileBySize{$fileByName{$fname}}}, $fname);

# for files of the same size: compare md5 of each successive chunk until there is a difference
foreach my $size (keys %fileBySize) {
    next if $#{$fileBySize{$size}} < 1; # skip filesizes array with just one file
    my %checking;
    foreach my $fname (@{$fileBySize{$size}}) {
        if (sysopen my $FH, $fname, O_RDONLY) {
            $checking{$fname}{fh} = $FH; # file handle
            $checking{$fname}{md5} = Digest::MD5->new;   # md5 object
        } else {
            warn "Error opening $fname: $!";
    my $read=0;
    while (($read < $size) && (keys %checking > 0)) {
        my $r;
        foreach my $fname (keys %checking) { # read buffer and update md5
            my $buffer;
            $r = sysread($checking{$fname}{fh}, $buffer, $BUFFSIZE);
            if (! defined($r)) {
                warn "Error reading from $fname: $!";
                close $checking{$fname}{fh};
                delete $checking{$fname};
            } else {
        $read += $r;
        FILE1: foreach my $fname1 (keys %checking) { # remove files without dups
            my $duplicate = 0;
            FILE2: foreach my $fname2 (keys %checking) { # compare to each checking file
                next if $fname1 eq $fname2;
                if ($checking{$fname1}{md5}->clone->digest eq $checking{$fname2}{md5}->clone->digest) {
                    $duplicate = 1;
                    next FILE1; # skip to next file
            if (!$duplicate) { # remove unique file
                close $checking{$fname1}{fh};
                delete $checking{$fname1};
    # these are duplicates, but there might be more than one group of md5 sums
    foreach my $fname (keys %checking) {
        close $checking{$fname}{fh};
        push(@{$fileByHash{$checking{$fname}{md5}->b64digest}}, $fname);

# resultBySize: {fname}{hash} = array(file1,file2,...)
my %resultBySize;
foreach my $hash (keys %fileByHash) {
    $resultBySize{ $fileByName{${$fileByHash{$hash}}[0]} } {$hash} = $fileByHash{$hash};

# print report
foreach my $size (sort { $a <=> $b } keys %resultBySize) {
    foreach my $hash (keys %{$resultBySize{$size}}) {
        print "$size\t",join("\t", sort @{$resultBySize{$size}{$hash}}),"\n";

# add directory's content (recursively)
sub addDir {
    my $dir = $_[0];

    if (!(opendir DIR, $dir)) {
        warn "Error opening $dir: $!";
    my @dents = readdir(DIR);
    foreach my $dent (@dents) {
        next if ($dent eq '.' || $dent eq '..');
        $dent = $dir . '/' . $dent;
        if (-d $dent) {
        } else {

# add a file
sub addFile {
    $fileByName{$_[0]} = 0 if -f $_[0]; # only add regular files

Comment: Lenovo black friday "sale" (Score 3, Informative) 189

by alantus (#45546157) Attached to: Ask Slashdot: Top Black Friday Tech Picks?

I'm in the process of customizing/buying a Lenovo X230 for a family member, despite their BIOS whitelist shenanigans.

The Lenovo store always has a super special e-coupon discount, they are kind enough to give you the code right there in the checkout process.

A few days ago the laptop in my cart, with the coupon, was $1,037.
Now, after applying the new black friday e-coupon (10% discount), the price is $1,061.10

Perhaps I should buy it now, before they have an even better Christmas "sale".

Comment: Re:Get some facts first, or wait til dust settles (Score 1) 702

by alantus (#45410553) Attached to: Venezuela: Cheap Television Sets For All!

And did Venezuela stop being able to import groceries after they seized El Exito? Was the country ruined?

Yes, and yes.
There is a huge scarcity of even the most basic imported products, such as milk, corn flour (a staple product in Venezuela), toilet paper, etc.

Hunger and poverty have gone down significantly since 1999. Even the anti-Chavez people accept this.


In case you can't read Spanish, the debt since 1999 until the end of 2012 has been increased by $275,300,000,000.
After googling for a while I found the 1999 debt was of $31,484,000,000.
So the debt before/after Chavez:
1999: $31,484,000,000 <--- I didn't miss a digit
2012: $306,784,000,000

And right after Chavez died, Maduro asked China for a new loan, in which the terms are a mystery. The government has a number of secret funds, and a share from oil imports go directly there. Nobody knows how much money is there, or how is it used exactly. The perceived risk in Venezuela is so high that the bond interest for any new debt would be valued above 13%, among the highest in the world.

I would also like to point that this happened during a period of historically high oil prices. In 1999 the price was around $18 per barrel. After 1999 the price soared and nowadays its around $100. In 1999 Venezuela was the 5th largest oil exporter. What has happened since then? Where did all the money go? Most experts predict the price to decrease in the following years, if so, Venezuela missed the boat.

Chavez also seized the oil companies, and stopped Venezuela's biggest resource being a cash cow for foreign companies.

Where did you get that from? Did Chavez say so?
The oil industry was nationalized in 1976. What he did in 2003 was to fire most of the employees that PDVSA after a general strike. These were highly trained specialists that are now working in countries such as Saudi Arabia, Kuwait, etc.

I've never been there. It's probably the country I most want to visit, and one of the main reasons is because it's so hard for a foreigner to know what the country is really like. I just read the Venezuelan newspapers and talk to Venezuelans sometimes here in Europe (mostly rich Venezuelans who don't like Chavez).

Sure, you are welcome. Just watch your back, don't go out after 6pm. And when you go out, try to stay in the eastern part of the city. Also, don't exchange your currency in the airport or any official place, as the policy is to rip off tourists. Ahhh, don't forget to bring your own toilet paper too.

If at first you don't succeed, you must be a programmer.