1
General Programming / How to : compile c with Notepad++
« เมื่อ: 17 ตุลาคม 2012, 01:15:16 »Full Detail : http://www.youtube.com/watch?v=HqRxD8yHIWU
ประยุกต์กับภาษาอื่นก็ได้ครับ :)
ปล. ใครอย่ามาดราม่าให้ไล่ไปใช้ ide แทนนะ -.-*
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
#!/usr/bin/perl
#########################################################################
# ░░░░░░░░░░░░▄▄░░░░░░░░░░░░░░ Copyright (c) 2012 by sornram9254.com
# ░░░░░░░░░░░█░░█░░░░░░░░░░░░░
# ░░░░░░░░░░░█░░█░░░░░░░░░░░░░ This software is open source,
# ░░░░░░░░░░█░░░█░░░░░░░░░░░░░ licensed under the GNU/GPL,v3.0
# ░░░░░░░░░█░░░░█░░░░░░░░░░░░░
# ██████▄▄█░░░░░██████▄░░░░░░░ Basically,
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ this means that you're allowed to modify and
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ distribute this software.
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ However, if you distribute modified versions,
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ you MUST also distribute the source code.
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░
# ▓▓▓▓▓▓█████░░░░░░░░░██░░░░░░ See http://www.gnu.org/licenses/gpl.html
# █████▀░░░░▀▀████████░░░░░░░░ for the full license.
#########################################################################
#example : ~$perl socialcam http://socialcam.com/v/z8hnY0ZJ?autostart=true#_=_
use LWP::Simple;
$ua = LWP::UserAgent->new();
chomp($file=shift);
$contents = $ua->get($file);
$found = $contents->content;
if($found =~ m/<source src=\'(.*?)\'/g){
`wget $1`;
}

#!/usr//bin/perl
#########################################################################
# ░░░░░░░░░░░░▄▄░░░░░░░░░░░░░░ Copyright (c) 2012 by sornram9254.com
# ░░░░░░░░░░░█░░█░░░░░░░░░░░░░
# ░░░░░░░░░░░█░░█░░░░░░░░░░░░░ This software is open source,
# ░░░░░░░░░░█░░░█░░░░░░░░░░░░░ licensed under the GNU/GPL,v3.0
# ░░░░░░░░░█░░░░█░░░░░░░░░░░░░
# ██████▄▄█░░░░░██████▄░░░░░░░ Basically,
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ this means that you're allowed to modify and
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ distribute this software.
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ However, if you distribute modified versions,
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ you MUST also distribute the source code.
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░
# ▓▓▓▓▓▓█████░░░░░░░░░██░░░░░░ See http://www.gnu.org/licenses/gpl.html
# █████▀░░░░▀▀████████░░░░░░░░ for the full license.
#########################################################################
use Tk;
use LWP::Simple;
$mw = new MainWindow; $mw->title("Perl GUI :)"); $mw->geometry('200x70');
$mw->Label(-text => "IP Information")->pack;
$mw->Button(-text => "Check", -command => \&get_ip )->pack(-ipadx => 40,-ipady => 5);
sub get_ip {
my $ua = LWP::UserAgent->new();
my $contents = $ua->get('http://www.melissadata.com/lookups/iplocation.asp');
my $found = $contents->content;
while( $found =~ m/<span style=\"font-size:12px;\">Your IP Address: (.*?)<\/span>/g ) {
$ip=$1;
print "IP : $1 \n";
$mw = new MainWindow; $mw->geometry('400x200'); $mw->title("Check IP : Result");
my $frm_name = $mw -> Frame() -> pack(); #New Frame
my $ent = $frm_name -> Entry(-text => "IP => $1") -> pack (-ipadx => 100,-ipady => 5);
#------------------------------------------------------------------------------------------------------------------------------------------
my $content = $ua->get('http://www.melissadata.com/lookups/iplocation.asp?ipaddress='.$ip)->content;
my ($isp) = ($content =~ m/<td class=\'columresult\'>ISP<\/td><td align=\'left\'><b>(.*?) <\/b>/g);
print "ISP : $1 \n";
my ($city) = ($content =~ m/City<\/td><td align=\'left\'><b>(.*?)<\/b>/g);
print "City : $1 \n";
my ($state) = ($content =~ m/State or Region<\/td><td align=\'left\'><b>(.*?)<\/b>/g);
print "State or Region : $1 \n";
my ($country) = ($content =~ m/Country<\/td><td align=\'left\'><b>(.*?)<\/b>/g);
print "Country : $1 \n";
my ($la1,$la2) = ($content =~ m/Latitude & Longitude<\/td><td align=\'left\'><b>(.*?) (.*?)<\/b>/g);
print "Latitude : $1 .::.::. Longitude : $2 \n";
my $ent = $frm_name -> Entry(-text => "ISP => $isp") -> pack (-ipadx => 100,-ipady => 5);
my $ent = $frm_name -> Entry(-text => "City => $city") -> pack (-ipadx => 100,-ipady => 5);
my $ent = $frm_name -> Entry(-text => "State or Region => $state") -> pack (-ipadx => 100,-ipady => 5);
my $ent = $frm_name -> Entry(-text => "Country => $country") -> pack (-ipadx => 100,-ipady => 5);
my $ent = $frm_name -> Entry(-text => "Latitude => $la1 .::. Longitude => $la2") -> pack (-ipadx => 100,-ipady => 5);
#------------------------------------------------------------------------------------------------------------------------------------------
}
}
MainLoop;
#!/usr/bin/perl -w
#########################################################################
# ░░░░░░░░░░░░▄▄░░░░░░░░░░░░░░ Copyright (c) 2012 by sornram9254.com
# ░░░░░░░░░░░█░░█░░░░░░░░░░░░░
# ░░░░░░░░░░░█░░█░░░░░░░░░░░░░ This software is open source,
# ░░░░░░░░░░█░░░█░░░░░░░░░░░░░ licensed under the GNU/GPL,v3.0
# ░░░░░░░░░█░░░░█░░░░░░░░░░░░░
# ██████▄▄█░░░░░██████▄░░░░░░░ Basically,
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ this means that you're allowed to modify and
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ distribute this software.
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ However, if you distribute modified versions,
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░ you MUST also distribute the source code.
# ▓▓▓▓▓▓█░░░░░░░░░░░░░░█░░░░░░
# ▓▓▓▓▓▓█████░░░░░░░░░██░░░░░░ See http://www.gnu.org/licenses/gpl.html
# █████▀░░░░▀▀████████░░░░░░░░ for the full license.
#########################################################################
use Tk;
use LWP;
use Digest::MD5 qw(md5_hex);
$mw = new MainWindow; $mw->geometry('300x150'); $mw->title("Perl GUI");
########## Encode MD5 ##########
$mw->Label(-text => "Encode MD5")->pack;
$mw -> Entry(-textvariable => \$put_en_md5) -> pack;
$mw->Button(-text => "Gen", -command => \&en_md5 )->pack;
sub en_md5 {
my $md5_hash = $put_en_md5;
my $md5_generated = md5_hex($md5_hash);
print "Encode MD5 : Result => $md5_generated\n";
########## Create New Form ##########
$mw = new MainWindow; $mw->geometry('350x70'); $mw->title("Encode MD5 : Result");
$mw->Label(-text => "$put_en_md5")->pack;
my $frm_name = $mw -> Frame() -> pack(); #New Frame
my $ent = $frm_name -> Entry(-text => $md5_generated) -> pack (-ipadx => 60,-ipady => 5);
}
########## Decode MD5 ##########
$mw->Label(-text => "Decode MD5")->pack;
$mw -> Entry(-textvariable => \$put_de_md5) -> pack;
$mw->Button(-text => "Gen", -command => \&de_md5 )->pack;
sub de_md5 {
my $md5 = $put_de_md5;
$lwp = LWP::UserAgent->new;
$lwa = $lwp->get('http://md5.rednoize.com/?p&s=md5&q='.$md5);
$hash = $lwa->content;
print "Decode MD5 : Result => $hash\n";
########## Create New Form ##########
$mw = new MainWindow; $mw->geometry('350x70'); $mw->title("Decode MD5 : Result");
$mw->Label(-text => "$put_de_md5")->pack;
my $frm_name = $mw -> Frame() -> pack(); #New Frame
my $ent = $frm_name -> Entry(-text => $hash) -> pack (-ipadx => 60,-ipady => 5);
}
MainLoop;
ความจริงมีเยอะกว่านี้ แต่เอาแค่นี้ก่อน เกรงใจครับ 
อ้างถึง
อ้างถึง
อ้างถึง
อ้างถึง
อ้างถึง
อ้างถึง
อ้างถึง
อ้างถึง
|
#python2.6 <
from math import log
def getDigit(num, base, digit_num):
# pulls the selected digit
return (num // base ** digit_num) % base
def makeBlanks(size):
# create a list of empty lists to hold the split by digit
return [ [] for i in range(size) ]
def split(a_list, base, digit_num):
buckets = makeBlanks(base)
for num in a_list:
# append the number to the list selected by the digit
buckets[getDigit(num, base, digit_num)].append(num)
return buckets
# concatenate the lists back in order for the next step
def merge(a_list):
new_list = []
for sublist in a_list:
new_list.extend(sublist)
return new_list
def maxAbs(a_list):
# largest abs value element of a list
return max(abs(num) for num in a_list)
def radixSort(a_list, base):
# there are as many passes as there are digits in the longest number
passes = int(log(maxAbs(a_list), base) + 1)
new_list = list(a_list)
for digit_num in range(passes):
new_list = merge(split(new_list, base, digit_num))
return new_list
http://en.wikipedia.org/wiki/Radix_sortอิอิอิ ไม่เกี่ยวหรอกค่ะ เพราะถึงแม้เวปนั้นจะมี มหีแฟลช ก็ไม่มีผลต่อซีพียูหรอค่ะ. เพราะโดยบราวเซอร์ปกติ(เล่นเวปต้องผ่านบราวเวอร์)..มันรองรับพวกนี้..ในอาการปกติอยู่แล้วค่ะ
อย่าลืมเรื่องภาษาต่างๆที่ใช้ในการเขียนเวป มันต้องซัพพอร์ท และรองรับกับบราวเซอร์![]()


http://www.facebook.com/groups/CompTechno
)![new [$01$]](http://www.zone-it.com/forum/Smileys/default/25c.gif)
ผิดถูกอย่างไรก็ขออภัยด้วยครับ ตอบตามประสบการณ์ ![[$6$] [$6$]](http://www.zone-it.com/forum/Smileys/default/emoo2068.gif)
ลองตรวจสอบที่ encoding ดูนิดนะครับว่าตั้งค่าเป็นอะไรไว้ ลองปรับเป็น UTF-8 นะครับ
