Monthly Archives: August 2010

linux command for my asus eeePC 1005ha (Bt4 r1)

0
Filed under โลงเลียของนู๋ ... เอ้ย ลินุก ของผม!!
Tagged as , , ,

# The GIMP Toolkit set of widgets for X
# (ibgtk1.2) For uplink [game] :)
apt-get install libgtk1.2

# Adobe Flash Player platform support library for Esound and OSS
# (flashplugin-nonfree-extrasound) For Firefox
apt-get install flashplugin-nonfree-extrasound

# VLC media player is a highly portable multimedia player
# supporting most audio and video formats
# (H.264, Ogg, DivX, MKV, TS, MPEG-2, mp3, MPEG-4, aac, …) from files,
# physical media (DVDs, VCD, Audio-CD), TV capture cards
# and many network streaming protocols.
# (vlc) For play All Media file
apt-get install vlc

# BitTorrent client for KDE
# (ktorrent) For Download torrent file
apt-get install ktorrent

# VoIP chat for online gaming
# (teamspeak-client) for use TS
apt-get install teamspeak-client

# Port of the famous Win32 graphical FTP client
# (filezilla) for FTP Client
apt-get install filezilla

# Captures audio-video data of a Linux desktop session
# (recordmydesktop) for make TUT
apt-get install recordmydesktop

perl map, while, regexp, trick (Simple PROJECT Count TAG code)

0
Filed under รวม code ทั้งมั่วเอง ทั้งจิ๊กชาวบ้านมา
Tagged as ,
my @tags = qw(a h1 h2 h3 h4 h5 h6 img link meta p title);
my %hash = map {lc($_) => 0} @tags;
my $tag_regexp = join ("|", @tags);
while ($line =~ /<(($tag_regexp)([^>]+)?)>/ig){
  my $regex = $1;
  if($regex =~/\s/){
    my ($tag, $option) = split(/\s/, lc($regex),2);
    print "TAG : $tag / Option ($option)\n";
  }else{
    print "TAG : $regex / Option (Null)\n";  
  }
}

Simple FUNCTION EVAL by REGEXP

0
Filed under เรื่อยเปื่อย บ่นๆ ไร้สาระมั่ง ไม่ไร้สาระมั่ง
Tagged as ,
#!/usr/bin/perl
while(1){
  print "Questions :";
  my $input = <STDIN>;
  chomp($input);
  $input =~s /\s|\t|\r|\n|\=|\?|\[|\]|\://ig;# หรือ จะตัดอะไรเพิ่มก็ใส่ลงไป เช่น /\s|\t|\r|\n|\=|\?|\(|\)|\[|\]|\://ig;
  $input =~s /x/\*/ig;# แปลงเครื่องหมาย x เป็น * (คูณ)
  $input =~s /÷/\//ig;# แปลงเครื่องหมาย ÷ เป็น / (หาร)
  while(my ($regex) = $input =~/(\((.{3})\)|(.{2}\(.{2}\))|(\(.{2}\).{2}))/i){
	my $eval_regex = eval $regex;
	$input =~ s/(\((.{3})\)|(.{2}\(.{2}\))|(\(.{2}\).{2}))/$eval_regex/i;
	print "input ($regex) : $input\n";
  }
  my $ans = eval $input if(eval $input); # ป้องกัน error กรณีใส่อะไรที่ คำนวน (eval) ไม่ได้เข้าไป
  print "Answer : $ans\n";
}