Forgot your password?

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: 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: <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.

Comment: Re:Sidebar the differentiator - really? (Score 1) 238

by alantus (#44368131) Attached to: Apache OpenOffice 4.0 Released With Major New Features

I hope you know that you did not address my argument at all but merely attacked me personally.

Dude, you forgot the "ad hominem" crap from your other 100 posts ;)

Seriously though, I appreciate the contributions that you and other developers of both OpenOffice and LibreOffice are doing.

But take a chill pill, even with all those long words, some of your posts here look rather childish.

Comment: Re:A conspiracy... (Score 1) 470

by alantus (#44058483) Attached to: 2 Men Accused of Trying To Make X-Ray Weapon

Except that the terrorists are not jewish.

Has anyone said they're not Jewish? Or that they are Jewish?

Yes, FatLitteMonkey said they are jewish, as well as others posting on this story.

It lookes like the slashdot editor (samzenpus) is either trying to discredit the jews on purpose

How? By not implying that they're Jewish?

The summary does imply that they are Jewish, which is why FatLittleMonkey and others are confused.

or is too stupid to write a decent summary.

a) samzenpus didn't write it b) samzenpus probably didn't read it

My bad, gurps_npc was too stupid to write a decent summary, samzenpus was too lazy to read it before posting it.

Comment: Re:Supremely Irresponsible Reporting. Shame on /. (Score 3, Insightful) 470

by alantus (#44057739) Attached to: 2 Men Accused of Trying To Make X-Ray Weapon

How were you modded informative? From the article:

"Crawford approached Jewish organizations last year looking for funding and people to help him with technology that could be used to surreptitiously deliver damaging and even lethal doses of radiation against those he considered enemies of Israel."

How are they not pro-Israel? Not everything that you disagree with is anti-semitic. Really the only bias evident is your own.

And if they wanted to request funding from Iran they would have offered to use their weapon against the enemies of Iran.
Would that mean they are pro-Iran?

I don't know if you are anti-semitic or not, but an anti-semitic would jump to the same conclusion you did without a really thinking about it. Perhaps you are not anti-semitic, you just don't really think.

Comment: Re:A conspiracy... (Score 5, Insightful) 470

by alantus (#44057695) Attached to: 2 Men Accused of Trying To Make X-Ray Weapon

Bitch, please. Muslim terrorists build bombs out of pressure cookers. These Jewish terrorists wanted to build a fucking death ray.

Except that the terrorists are not jewish. They were trying to get funding by jewish organizations by promising to target enemies of Israel.
Instead of funding them, the jewish organizations contacted the FBI.

So no, the jews in this story are not the terrorists, in fact, they are the heroes.

It lookes like the slashdot editor (samzenpus) is either trying to discredit the jews on purpose or is too stupid to write a decent summary.

"Right now I feel that I've got my feet on the ground as far as my head is concerned." -- Baseball pitcher Bo Belinsky