Niro* by cho45

#11 Riddance of anti-social networking services

Current SNS are actually anti-social, because they impound users on private area in its services. It's very silly that they promote "social" but actually "anti-social".

The REAL "social" exist already. It is REAL. We all already are friends. We just need to register the people who are NOT friends. It's double work that is register friends.

#10 CUI screensaver: Terminal progressbars festa

#!/usr/bin/env perl
use strict;
use warnings;
use utf8;

use Curses::UI;
use Time::HiRes 'sleep';
use AnyEvent;

my $cui = Curses::UI->new(-color_support => 1);
my $win = $cui->add('progressbars', 'Window');
my $colors = [qw/red green yellow blue magenta cyan white/];

while (1) {
	my $cv = AnyEvent->condvar;
	my $bars = [];
	my $n = 0;
	for my $name (1 .. $ENV{LINES}) {
		$win->delete('progressbar-' . $name);
		my $bar = $win->add(
			'progressbar-' . $name,
			'Progressbar',
			-max          => 100,
			-pos          => 0,
			-nocenterline => 1,
			-border       => 0,
			-y            => $n++,
			-fg           => $colors->[int(rand() * @$colors)],
			-bg           => $colors->[int(rand() * @$colors)],
		);

		$bar->draw;
		$cv->begin;
		push @$bars, $bar;

		my $t; $t = AnyEvent->timer(
			interval => 0.01,
			after    => 3 * rand,
			cb       => sub {
				if ($bar->get < 100) {
					$bar->pos($bar->get + rand() * 3);
					$bar->draw;
				} else {
					undef $t;
					$cv->end;
				}
		} );
	}

	$cv->recv;
}

#9 Line numbers programming in Perl (FizzBuzz)

Using Filter::Simple with one line and write line numbers program like BASIC. It is very good that perl feels history of programming.

#/usr/bin/perl
BEGIN { use Filter::Simple sub { s{^(\d+)}{";L$1:";}gme; s{goto (\d+)}{goto L$1}gm }; __PACKAGE__->import };

100		$i++;
110		sleep 0.5;
120		goto 999 if $i > 30;
130		goto 180 if $i % 15 == 0;
140		goto 200 if $i %  5 == 0;
150		goto 220 if $i %  3 == 0;
160		print $i, "\n";
170		goto 100;
180		print "Fizz Buzz\n";
190		goto 100;
200		print "Buzz\n";
210		goto 100;
220		print "Fizz\n";
230		goto 100;
999

#8 MATRIX in your Terminal

#7 Auto install cpan modules by cpanm

login