วันอาทิตย์ที่ 4 ธันวาคม พ.ศ. 2554

Remove BabyLon Adds

chrome >> home , search
firefox >> search , about:config >search babylon > reset all
uninstall babylon toolbars

><

วันเสาร์ที่ 24 กันยายน พ.ศ. 2554

71 hotkeys have been received in the last xxx ms.


it cause by loop of sending hotkeys it send and it catch by itself.
to fix use SendPlay instead of Send then it will not catch again by itself.

วันศุกร์ที่ 19 สิงหาคม พ.ศ. 2554

WindowsBot#2 Auto Open Program

Topic นี้น่าจะข้ามครับ ไปค้นดูแล้ว window มี task scheduler อยู่แล้ว


















แต่ถ้าใครสนใจก็หน้าตาคล้ายๆนี่ครับ























วันนี้มาแปะอะไรเบาๆที่ช่วยลดเวลาในการเขียนโค้ดละกัน

^!r::Reload
^!p::Pause
^!s::Suspend
^!x::ExitApp

อันแรกรีโหลดใช้เวลาแก้โค้ดแล้วจะรันใหม่
อันที่สองหยุดโค้ดไม่ให้รัน
อันที่สามหยุดการจับคีย์ลัด
อันที่สี่ออกจาก script

จบละ
ครั้งต่อไปก็ยังจะเอาแบบง่ายๆต่อละกัน
เป็นการทำคีย์ลัดเพื่อเขียน signature ทำให้เราไม่ต้องพิมพ์เองยาวๆ

หรือถ้าท่านผู้อ่านอยากได้อะไรแบบอื่นก็โพสมาได้ จะไปช่วยหา

วันพฤหัสบดีที่ 18 สิงหาคม พ.ศ. 2554

WindowsBot #1 Program shortcut

หลายคนคงเคยฝันว่าอยากให้คอมตัวเองนั้นโต้ตอบกับตัวเองได้ มีชีวิตชีวาได้
หลายคนคงเคยลองทำดูบ้างแล้ว ก็อาจจะเป็นว่ามันยังอีกไกลกว่าจะถึงเทคโนโลยีนั้น
แต่ก็ไม่ใช่เรื่องยากที่จะ เติมแต่งให้คอมโต้ตอบกับเราได้มากขึ้น
วันนี้ผมก็จะมานำเสนอวิธีง่ายๆ สนุกๆให้ลองเล่นกัน
โดยใช้โปรแกรม AutoHotkey ซึ่งเป็น freeware

เริ่มต้นก็ไป download program มาลงก่อนเลยครับ















หลังจาก install เสร็จแล้วก็สร้าง ไฟล์ .ahk ที่ไหนก็ได้ครับ







แล้วเปิดเข้าไปเขียนได้เลย
วันแรกเนี่ยมาเขียนอะไรที่มันง่ายๆสั้นๆ แต่มีประโยชน์ก่อนละกันครับ
เอาเป็น shortcut ในการเรียกโปรแกรมละกันครับ


ผมมักจะมีปัญหาอยู่อย่างหนึ่งเวลาจะจับภาพบนหน้าจอ บ่อยๆ
เมื่อก่อนผมมีกระบวนการตามนี้ครับ
1. กด screen capture
2. เปิดโปรแกรม paint
3. กด shortcut ของ crop tools
4. ทำการ crop (เลือกส่วนของภาพที่ต้องการ)
5. กด copy (Ctrl+c)
6. กด shortcut สร้างไฟล์ใหม่ใน paint ( Ctrl+N เพื่อวางรูปที่ crop)
7. วางรูป (Ctrl+v)
8. เซฟไฟล์


ซึ่งซับซ้อนหลายขั้นตอนมาก
แต่หลังจาก windows 7 มา ก็จะเหลือ
1. กดปุ่ม windows
2. พิมพ์ sn (เพื่อเลือก snipping tool)
3. กด enter
4. crop
5. save

ก็จะไม่ยากเท่าใหร่
แต่เราจะมาลดจากกด window แล้วพิมพ์ sn แล้ว enter ให้เหลือการกดปุ่มครั้งเดียว
ซึ่งจะสะดวกกว่ากันเยอะอยู่ครับสำหรับคนที่ crop ภาพบ่อยๆ

ก็กลับมาที่ file .ahk ของเราครับ
เปิดขึ้นมามันจะมี text อะไรซักอย่าง จะข้ามหรือจะลบออกก็ได้ครับ เกี่ยวกับเรื่อง performance
จากนั้นลองใส่โค้ดตามเลยครับ

;crop screen
^!s::
Run, %A_WinDir%\system32\SnippingTool.exe
return

บรรทัดแรก เป็นการคอมเม้นต์บอกว่าเราจะทำอะไร ทุกคอมเม้นต์จะขึ้นด้วย ; ครับ
บรรทัดที่สองเป็นการบอกว่าจะใช้ shortcut อะไรซึ่งอันนี้เป็นจุดเด่นของ autohotkey ครับ ถ้าเป็นภาษาอื่นจะต้องเขียนหลายบรรทัดกว่านี้หน่อย ในตัวอย่างนี้ คือการกด ^ (control) + ! (alt) + s เพื่อเป็นการสั่งให้ทำงานบรรทัดต่อไปครับ
บรรทัดที่สาม เป็นการสั่งเปิดโปรแกรม snippingtool ครับ
บรรทัดที่สี่ ก็ให้จบการทำการ crop screen ซึ่งถ้าไม่มีก็แน่นอนครับว่ามันจะไปบรรทัดข้างล่างต่อ (ถ้ามี)

วิธีรันก็ง่ายๆ ดับเบิลคลิกที่ไฟล์ .ahk ได้เลยครับ
จะขึ้นไอคอนที่ tray






จากนั้นก็ลองใช้ shortcut ได้เลยครับ

นอกจากนั้นคำสั่ง Run สามารถใส่คำสั่งอื่นๆก็ได้เหมือนหน้าต่างๆที่มาจากการกด Window+R เลยครับ

คราวหน้าก็มาต่อกันว่า ถ้าผมขี้เกียจกดเรียกโปรแกรม
แต่จะเปลี่ยนเป็นตั้งเวลาแทนล่ะจะทำไง

วันพุธที่ 4 สิงหาคม พ.ศ. 2553

The second times I solve the same question in probability field .. Long distance calling ...

1st page2nd page

The question I encounter 2 times (first in bachelor degree learning)

Original Question.
"Long distance calling plan A offers flat rate service at 10 cents per minute. Calling plan B charges 99 cents for every call 20 minutes; for calls over 20 minutes, the charge is 99 cents for the first 20 minutes plus 10 cents for every additional minute. (Note that hese plans measure your call duration exactly, without rounding to the next minute or even second. If your long-distance calls have exponential distribution with expected value t minutes, which plan offers a lower expected cost per call?"

from
Probability and Stochastic Processes: A Friendly Introduction for Electrical and Computer Engineers Roy D. Yates , David J. Goodman

Second Meet Question
"Long-distance calling plan A offers rate service at 3 Baht per minute. Calling plan B changes 25 Baht for every call under 20 minutes; for calls over 20 minutes, the charge is 25 Baht for the first 20 minutes plus 3 Baht for every additional minutes (Note that these plans measure your call duration exactly, without rounding to the next minutes or even second.) If your long-distance calls have exponential distribution with expected value beta minutes, which plan offers a lower expected cost per call?"

The seconds times is on those pictures. The question is rather the same. It is changed only the numbers. and call extected value as beta.

In this solution I describe a 3 way to solve expected cost of plan B. E[B]

The First Solution is the cleverest method.
(the lower part of 1st page)

First , we observe the T variable that T is exponential then we find the probability for 0<=t<=20
P[0<=t<=20] = F(20)-F(0) = 1-e^(-20/beta) << Mass1
this is the first mass then the left mass is 1-(1-e^(-20/beta)) = e^(-20/beta) << Mass2

The part I call the clever is that this approach is use the property of Memoryless of exponential distribution
then we can cut out Many calculations.

the memoryless property lead to the equation at bottom of 1st page
the equation is E[B] = (The Mean position of Mass1)*(amount of Mass1) + (The Mean position of Mass2)*(amount of Mass2)
we left only the mean position of Mass2
from the memoryless property we got the mean of Mass2 is far from the starting of Mass2 as 3*beta (same as plan A) then we can conclude that the mean position of Mass2 is 25+beta (see graph 5th)

the left is the foundamental math to solved.


The Second Solution is the shortest method.

we know for E[B(t)] = integral ( B(t) f(t) dt )
then the after is straight forward. (the upper part of 2nd page)

The Third Solution is the straight method.

This method is just follow the step of other ordinary other questions.
(see the upper part of 1st page)
  • First we consider the cost function.
  • Second we consider the T random variable.
  • Third we derive the B to the T random variable in CDF form.
    then we got the mixed random variable.
  • Fourth change the CDF form to PDF form.
  • Fifth we directly find the E[B] (see the lower part of 2nd page)

วันอังคารที่ 13 กรกฎาคม พ.ศ. 2553

error: extra qualification ‘Item::’ on member ‘Item’

Today I download some fp growth source code from some site.

and compile them and got this error.

error: extra qualification ‘Item::’ on member ‘Item’.

I think it may cause by new compiler didn't want Item:: (class meaning)ahead of Item (function meaning).

วันจันทร์ที่ 21 มิถุนายน พ.ศ. 2553

The annoying adaptor , Tunnel adapter Local Area Connection




After you type "ipconfig /all" in command line in window 7 (or vista).
you may see these Tunnel Adapter

I am very annoy about these adapter It now show 94th adapter on my computer.

I guess these Tunnel adapter is come from Teredo Tunneling Pseudo-Interface.

http://webbosworld.co.uk/blog/?p=30

To solve them. there has several method.

The one solution rather brute force solution (but I still select to do it with this method = =")
is
1. open device manager
2. select view > show hidden devices
3. then you will see
then I manually right click at each adapter and choose uninstall option.
Wish this may help.

and Then if you didn't want to see them again you can disable Teredo adapter by follow this instruction.
http://www.mydigitallife.info/2007/09/09/how-to-disable-tcpipv6-teredo-tunneling-in-vista/

Ubuntu Running in low graphic mode

the cause of this problem is the graphic driver is override by some other software update.

you should download some driver that suit your graphic card and then reinstall.

1. press Ctrl+Alt+F2 (Ctrl+Alt+F8 and BackSpace I can't remember meaning)
then close x server by command "/etc/init.d/gdm stop"
2. sudo ./your driver.run
3. "etc/init.d/gdm start or restart"

Finish then "sudo shutdown now" if you can't back to normal graphic mode = ="

วันเสาร์ที่ 17 เมษายน พ.ศ. 2553

Solve Password for Start-dfs.sh


if you set hadoop command in permission folder then you can't run this command.

my method is "move all of hadoop to home folder".

this may solve.

or if you should insert password 2 times don't tired to type.

the first for datanode and the second for secondary namenode.


วันจันทร์ที่ 22 กุมภาพันธ์ พ.ศ. 2553

My Stupid about Grave accent

I have one problem can't solved for a long time.
That is I can't type ~ in windows 7.

To solve this only hold that key (shift + ~)
if not hold it then it will change your language.

วันอังคารที่ 19 มกราคม พ.ศ. 2553

Installing NVIDIA NEXUS for Debug CUDA , OpenCL

When installing, Nexus Beta 1 says that the required version of Visual Studio is not detected. But Visual Studio 2008 SP1 is installed! What is wrong?

Nexus Beta 1 looks at keys in the Windows registry in order to determine if Visual Studio 2008 SP1 is installed.

The registry keys read by the Nexus Beta 1 installer are:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0 where key ApplicationID has the value: REG_SZ “VisualStudio”

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevDiv\VS\Servicing\9.0 where key SP has the value: REG_DWORD 0x00000001


If your registry does not have those values in those keys, then unfortunately, Nexus Beta 1 will not install.

text from http://supportcenteronline.com/ics/support/KBAnswer.asp?questionID=70

วันเสาร์ที่ 16 มกราคม พ.ศ. 2553

C1083 cuda error

solved by go to C/C++ > Precompiled Headers > Not Using Precompiled Header

or if you need to use

C/C++ > Precompiled Headers

: Created Precompiled Header (/Yc)
: StdAfx.h
: $(IntDir)\$(TargetName).pch

วันจันทร์ที่ 23 พฤศจิกายน พ.ศ. 2552

How Different In Learning English By Game and Book and Movie

I just play some English (with human sound) Game.

and after I read a English book too.

something come into my mind.

Yeah , That is how I feel "Desire to want to use English".

The game give me a feeling expression but reading the book is not.

Same as the movie give but poorly english skill like me can't follow all word in movie.

Little different about game is I can control some part I want to follow like in a strategy talking.

But in the movie you should follow as fast as they talk.

Finally , I think the best learn is learn everything mix together then you will got every skill needed. :)

วันศุกร์ที่ 20 พฤศจิกายน พ.ศ. 2552

Weird about libstdc++.so.5 Error

Yesterday , I try to setup Hadoop on eclipse on Ubuntu in Virtual Box.

I found Error about Missing some class. It say
"BUILD FAILED
build.xml :316: Unable to find a javac compiler
com.sun.tools.javac.Main is not on the classpath.
Perhaps JAVA_HOME does not point to the JDK.
It is currently set to "/usr/lib/jvm/java-6-openjdk/jre
"
".

First , you should download JDK from sun micro system and install it's packages.
Don't forget to "chmod +x " if you can't run install command.
or you may can "sudo apt-get install " that something I don't know too.

if you encounter problem about
"./java_ee_sdk_linux.bin: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory"
or similar to this you may get the wrong .bin file.
Try to download Other file that not the same as old one.

If you got the right .bin file now. Don't forget to "chmod +x " if you can't run install command.
then run "./".
Additionally , you may move the JDK folder to the well-manner category "/usr/lib/jvm".
(If you can't use copy command then omit it. use move instead it then finish successful.)

After you finish install jdk then do the last step to let's Ant correctly run.

Lastly , Add tools.jar to Ant Runtime Classpath.The Problem solved.

วันอังคารที่ 3 พฤศจิกายน พ.ศ. 2552

AVG Setting Virus Scan

The state of the problem is how to use avg scan after download files by other programs.

The answer is in this URL.
http://www.avg.com/us-en/90495

ในที่นี้จะเขียนเป็นภาษาไทยเลยละกันเพราะภาษาอังกฤษมีใน URL แล้ว
1. ถ้าเป็น OS แบบ 32bit (x86)
จะใช้ path
"C:\Program Files\AVG\AVG8\AVGSCANX.EXE" /scan=%file% /clean /arc
โดยมี parameter ตามด้านหลังเลยครับ

2. ส่วนถ้าเป็น 64bit ก็ตามนี้ครับ
"C:\Program Files (x86)\AVG\AVG8\AVGSCANA.EXE" /scan=%file% /clean /arc

ส่วนแต่ละ program อาจจะไม่ใช้ %file% ก็ต้องเปลี่ยนไปตามแต่ละ program
Each Program may not use "%file%" to reference file path you should follow each program instruction to set this.


This tutorial will show example in Internet Download Manager
First , select OptionsSecond , select DownloadThird , Look at Virus Checking and put address and parameter in textbox.
Ah this picture !! I forgot one parameter "/arc".
Finally , Don't Forget to change %file% to [File]


After Scan Downloaded files you can see Result in AVG.
Select History > Scan resultsYou will see Scan Result in Command line scan.For more Addition if you know how to call Shell scan please notify me too. I still don't know that too.

More Example I will show how to set AVG virus scan in Firefox+Download Status Bar Add-on
First , select Tools > Add-ons
Second , select Options of StatusbarThird , select Vir Then Fourth , Tick Manually scan completed downloads Checkbox and put Scanner Address in Anti-Virus program location and put Parameter to Arguments.
Remember that Don't forget to change %files% to %1 as the recommend text below.