ဒီဘလော့ က ကျနော့်
comment ကို ဒီမှာ ပြန်ပြီး Copy / Paste လိုက်ပါတယ်.. ကျနော် ဘာလို့ Blog မှာရော Forum မှာပါ တင်စေချင်တာလဲဆိုတော့ တစ်ချို့က Blog တွေပဲဖတ်ကြပြီး Forum မဖတ်ကြဘူး.. တစ်ချျို့တွေက ကျတော့ Forum ကိုပဲ မွှေပြီး Blog တွေကို မဖတ်ကြဘူး.. အဲဒါကြောင့် Duplicate လုပ်ထားတဲ့သဘောပါ.. နောက်ပြီး အမေးရှိနေပြီးမှ အဖြေမရှိတာမျိုး ဖြစ်နေမှာစိုးတယ်.... အမေးရှိရင် အဖြေရှိရမှာပေါ့ဗျာ ဟုတ်တယ်မလား.. ကျေးဇူးပါ ကို မိုးတစ္ဆေ ... ဒါမျိုးလေးတွေက ဗဟုသုတ ရစေပါတယ်..
MAGIC #1 ရဲ့အဖြေ
“con”, “prn”, “nul” “com1″ “com2″ “lpt1″ “lpt2″ဆိုတဲ့ name တွေနဲ့ create လုပ်လို့မရဘူးဆိုတာကို ဖတ်ဖူးပါတယ်..
command prompt မှာလည်း
mkdir ၊ md စတဲ့ command တွေနဲ့ ရိုးရိုး Create လုပ်လို့လည်း မရဘူးခင်မျ... ဘာကြောင့် အဲဒိ Name တွေကို ပေးလို့မရလဲဆိုတာကတော့ Internal Device တွေအတွက် အဲဒိ name တွေက သတ်မှတ်ပြီးသားရှိနေလို့ လို့ ဆိုပါတယ်..
ဥပမာ အားဖြင့် .. con ဆိုတာက console in DOS ကို ကိုယ်စားပြုပါတယ်..
prn ဆိုတာက printer ကို ကိုယ်စားပြုပါတယ်..
lpt1 , lpt2 , com1, com2 စတာတွေက Communication Port တွေကို ကိုယ်စားပြုပါတယ်..
Windows တစ်ခုလုံးအတွက် ရေးထားတဲ့ Programming code တွေတိုင်းမှာ အပေါ်က နာမည်တွေကို Constant သတ်မှတ်ထားခဲ့ကြတဲ့အတွက် user တွေအနေနဲ့ ပြင်လို့မရတာဖြစ်ပါတယ်..
Vista မှာက အစ folder တစ်ခုကို rename လုပ်လိုက်ရင် “The specified device name is invalid”. ဆိုပြီးပေါ်ပါတယ်..
command prompt ကနေ create လုပ်လို့ရတဲ့နည်းကတော့ ဒီလိုပါ..
ဥပမာ C drive မှာ con folder ဆောက်ချင်ရင် ..
Create command >>>> md \\.\C:\con
Create လုပ်ပြီးရင်တော့ right click နဲ့သွားပြီး Delete လို့မရဘူး..
ပြန်ဖျက်ဖို့ အတွက ်
Delete command >>>> rd \\.\C:\con
\C:\ နေရာမှာ ကိုယ်သတ်မှတ်ချင်တဲ့ Directory ပေါ့နော်..
MAGIC #2 ရဲ့အဖြေ
Bush hid the facts ကိစ္စကတော့ ကျနော့်ကွန်ပြူတာမှာ တစ်ခါတစ်လေ သက်ရောက်မှုမရှိပါဘူး..
Bill fed the goats ဆိုတာလည်း အတူတူပါပဲ..
this app can break
this api can break
a fake app break
this facts app break စတဲ့ဟာတွေကတော့ ANSI နဲ့ Save ရင် Error က အလုပ်လုပ်နေဆဲပဲ..
အဖြေကတော့ 4 3 3 5 ရယ် 4 5 3 5 ရယ် 1 4 3 3 ရယ် ဖြစ်ပါတယ်..
ဆိုလိုတာက ၄လုံးရိုုက် space ခြား ၃လုံးရိုက် space ခြား ၃ လုံးရိုက် space ခြား ၅လုံးရိုက်.. ပြီး ANSI နဲ့ save လိုက်ရင် တရုတ်စာ တွေလို ပေါ်တယ်.. ဥပမာ ဒီလို String တွေပေါ့..
xxxx xxx xxx xxxxx
ဒါပေမယ့် string တိုင်းလည်းမဟုတ်ပြန်ဘူး..
"Fred led the brats", "brad ate the trees" စတဲ့ အခြား String တွေကျတော့ Error ကလွတ်တယ်.. သူက နောက်ပြီး utf-8 တို့ unicode တို့နဲ့ save ရင်လည်း error မပြဘူး..
ANSI နဲ့ save မှသာ . ဒီ bug error ပြတာပါ... ဘာကြောင့်လဲဆိုတာကတော့ Windows API မှာရှိတဲ့ IsTextUnicode ဆိုတဲ့ function ကြောင့်ပဲဖြစ်ပါတယ်.. အဲဒိ Function က ဘယ်လိုအလုပ်လုပ်သလဲဆိုတော့
text တွေကို အခြေခံတဲ့ Statistical data တွေကို စမ်းသပ်တဲ့ အလုပ်ကိုလုပ်ပါတယ်.. အဲဒိ Function အကြောင်းကို MSDN(Microsoft Developer Network) က ဒီလိုပြောထားပါတယ်..
“The function uses various statistical and deterministic methods to make its determination.. These tests are not foolproof. The statistical tests assume certain amounts of variation between low and high bytes in a string, and some ASCII strings can slip through. For example, if lpBuffer points to the ASCII string 0×41, 0×0A, 0×0D, 0×1D (A\n\r^Z), the string passes the IS_TEXT_UNICODE_STATISTICS test, though failure would be preferable.”
ကျနော် ဘာသာပြန်မပြတော့ပါဘူး..
Wikipedia မှာကတော့ Windows Vista နဲ့ Windows 7 မှာ အဲဒိ Bug error က မဖြစ်တော့ဘူးလို့ အတိအလင်းရေးထားပါတယ်..
MAGIC #3 ရဲ့အဖြေ
MS word ရဲ့ = Rand (paragraph , lines per paragraph) ကတော့ ဘာကြောင့်ဖြစ်တာလဲဆိုတာကို Wiki answer အရ သိခဲ့ရပါတယ်..
word ကို ဖန်တီးခဲ့တဲ့ Programmer တွေ
rand ဆိုတဲ့ random keyword ကို string တစ်ခုခု နဲ့ ကိုယ်စားပြုခဲ့လို့ဖြစ်မယ်..လို့ အရင် က တွေးခဲ့မိတယ်..
တကယ်တော့ alphabet ၂၆ လုံး စုံအောင်ပါတဲ့ The quick brown fox jumps over the lazy dog. ဆိုတဲ့ စာကြောင်းက MS word မှာ Font တွေကို Test လုပ်လို့ရအောင် ဖန်တီးထားတဲ့ ဖြစ်ပြီး စာတွေ ရိုက်နေစရာမလိုပဲ အလွယ်တကူ font တွေကို စမ်းသပ်လို့ရအောင် =rand( ) command နဲ့ အလုပ်လုပ်စေတာဖြစ်ပါတယ်.. Control panel ထဲက font folder ထဲက font တွေကို ဖွင့်ကြည့်ရင်လည်း အဲဒိစာကြောင်းကို Size အမျိုးမျိုးနဲ့ ရေးထားတာကို တွေ့ရမှာဖြစ်ပါတယ်..
ဒီ = rand (paragraph , line ) ဆိုတဲ့ command ကတော့ 2003 မှာပဲအလုပ်လုပ်ပါတယ်..
MS word 2007 မှာ ဆိုရင်တော့ =rand.old( ) ဆိုတော့မှ သာ အလုပ်လုပ်ပါတယ်..
=rand.old(200, 99) ပေါ့..
Maximum paragraph က ၂၀ဝ ထက်ပိုလို့မရပါဘူး.. lines အရေအတွက်ကလည်း ၉၉ ထက်ကျော်လို့မရပါဘူး..
ဥပမာ =rand(300, 100) ဆိုရင် အလုပ်မလုပ်တော့ပါဘူး... နောက် တစ်ခုက =rand(paragraph) ဆိုပြီး parameter တစ်ခုတည်းလည်း ရိုက်လို့ရပါသေးတယ်.. ဥပမာ =rand(200) ဆိုရင်လည်း အလုပ်လုပ်ပါတယ်..
= rand (0, 1), = rand (1, 0) , = rand (0, 1)ဆိုရင်တော့ ပျောက်သွားပါလိမ့်မယ်
= rand (1) , = rand (01), = rand (001) ဆိုရင် တော့ ၅ ကြောင်းပဲပေါ်တယ်..
အမျိုးမျိူး စမ်းသပ်ကြည့်နိုင်ပါတယ်..
The quick brown fox jumps over the lazy dog. ဆိုတာက အင်္ဂလိပ်စာ လက်နှိပ်စက်တွေ စပေါ်တုန်းက လေ့ကျင့်ရတဲ့စာကြောင်းဆိုတာတော့ပြောနိုင်ပါတယ် :D... အဲဒိစာကြောင်းမှာ a ကနေ z အထိ alphabet 26 လုံး အစုံပါပါတယ်.. မယုံရင် သေချာအောင် ရှာကြည့်လို့ရပါတယ်. :P...
Ref: Goodle :D