Python VS PHP

Source code For Zawgyi 2008 TO Zawgyi 2009 Python import sys,re ENC=’utf8′ def zawgyi2new(d): m=open(“zawgyi2new_replace.ini”).read().strip().decode(‘utf8’).replace(“-“,”).replace(‘ ‘,”).split(“\n”) for x in m: x=x.split(“\t”) if x[0]in d: d=d.replace(x[0],x[1]) return d if __name__==’__main__’: infile=sys.argv[1] d=open(infile).read().decode(ENC) d=zawgyi2new(d) outfile=infile[:infile.rfind(“.”)]+”_out.txt” open(outfile,”wb”).write(d.encode(ENC)) PHP $time_start = microtime(true); // get contents of a file into a string $filename = $argv[1]; $handle = fopen($filename, “r”); $d=…More

Python is very faster than PHP

Same Algorithm, Same Logic, နဲ့ရေးထားပြီး 30 MB text file ကို PHP နဲ့ပြောင်းတာ second 29 ကြာပေမယ့် python နဲ့ကတော့ 1 seconds ပဲကြာတယ်။ searching တွေအတွက် crawling တွေအတွက် Giga Bytes လောက်ရှိတဲ့ Filesize တွေ အတွက် PHP ထက် Python က ပိုသင့်တောှတယ်။ Python ကို လေ့လာဖို့တော့ လိုလာပြီ ?????More

Smalltalk about Java (saturngod & Lupyogyi)

ဒီနေ့ Java အကြောင်းလေးနဲ့ ပတ်သက်ပြီး လူပျိုကြီးနဲ့ ပြောမိဆိုမိတာလေးတွေကို ပြန်တင်ပြလိုက်ပါတယ်။ saturngod : java မှာ hello world အတွက် စာတွေ အများကြီးရေးရတယ်.. (system.out bla bla bla) Python မှာဆိုရင် print (“hello world”) နဲ့တင်ပြီးတယ်.. php မှာဆို echo “hello world”; ဆိုပြီး တိုတိုလေး… java က ဘာလို့ ရှည်နေတာလဲမသိဘူး.. လူပျိုကြီး : ကြည့်ရတာ ဒီရက်ပိုင်း ဂျာဗားနဲ့များ ရန်ဖြစ်ထားသလား ဂျာဗားမကြိုက်ရင် စူပါ သို့မဟုတ် မီကို ပဲသောက်ဗျာ။More