หากใครต้องการแก้ไขข้อความ belongs to : ชื่อตัวเอง ก็สามารถทำได้ตามนี้ครับ
This message is part of a third party application called Antivirus Free.
When you power up your phone it will display: This phone belongs to:protected by antivirus You do not have the ability to disable this feature within the app, however you can add your name.
1.From the main screen, pull (drag) up the icons screen 2. Select antivirus
2.Select the Menu key (second from the left key on the bottom)
3.Select Settings
4.Select Remote Management
5.Select Lost Message
Select Text before to change or overwrite - "This phone belongs to" Select Contact Information to select acontact. Choose yourself and your contact information will displaybetween the two current messages. Select Text after to change or overwrite "protected by antivirus" Once finished close out of the application
แค่นี้ก็เป็นอันเรียบร้อยแล้วครับ
ImageJ คู่มือ ImageJ สอนการใช้งาน โปรแกรม ImageJ ภาษาไทย ที่ครบถ้วนที่สุด สำหรับต่อยอดเทคนิคการประมวลผลภาพ (Image Processing) ImageJ คืออะไร เป็นโปรแกรมประมวลผลภาพ อย่างไรที่นี้มีคำตอบ หากผิดพลาดประการใด ขออภัย ครับ
วันศุกร์ที่ 11 มีนาคม พ.ศ. 2554
วันอังคารที่ 8 มีนาคม พ.ศ. 2554
ยกเลิกการแจ้งเตือน การพิมพ์ จอสั่นของ แอนดรอย (android)
Setting --> Language & Keyboard --> Text Setting
แล้วดูที่ Input method ก่อนว่าตอนนี้เราใช่้ Keyboard ตัวไหนอยู่
พอรู้แล้วก็ไปกดที่เมนู Setting ของ keyboard นั้นๆ
จะเห็นหัวข้อที่ว่า Vibrate on key press ก็ปิดการทำงาน
แล้วดูที่ Input method ก่อนว่าตอนนี้เราใช่้ Keyboard ตัวไหนอยู่
พอรู้แล้วก็ไปกดที่เมนู Setting ของ keyboard นั้นๆ
จะเห็นหัวข้อที่ว่า Vibrate on key press ก็ปิดการทำงาน
วันเสาร์ที่ 26 กุมภาพันธ์ พ.ศ. 2554
Java: generating random number in a range
Hello,
I am trying to generate a random number with Java, but random in a specific range. For example, my range is 5-10, meaning that 5 is the smallest possible value the random number can take, and 10 is the biggest. Any other number in between these numbers is possible to be a value, too.
In Java, there is a function random() in the Math class, which returns a double value between 0.0 and 1.0. In the class Random there is a function nextInt(int n), which returns a random value in the range of 0 (inclusive) and n (exclusive). I couldn't find a method, which returns a random value between two numbers.
I have tried the following things, but I still have problems: (minimum and maximum are the smallest and biggest numbers).
Solution 1 :
randomNum = minimum + (int)(Math.random()*maximum);
problem: randomNum takes is assinged values numbers bigger that maximum
Solution 2 :
Random rn = new Random();
int n = maximum - minimum + 1;
int i = rn.nextInt() % n;
randomNum = minimum + i;
problem: randomNum takes is assigned values smaller than minimum.
Could you suggest how to solve my problem, or point me to some references? I have tried also browsing through the archive, and found:
- http://stackoverflow.com/questions/137783/given-a-function-which-produces-a-random-integer-in-the-range-1-to-5-write-a-fu
- http://stackoverflow.com/questions/288739/generate-random-numbers-uniformly-over-entire-range
but I couldn't solve the problem.
Thank you.
One standard pattern for accomplishing this is:
Min + (int)(Math.random() * ((Max - Min) + 1))
The java Math library function Math.random() generates a double value in the range [0,1). Notice this range does not include the 1.
In order to get a specific range of values first you need to multiply by the magnitude of the range of values you want covered.
Math.random() * ( Max - Min )
This returns a value in the range [0,Max-Min).
For example if you want [5,10] you need cover 5 integer values so you use
Math.random() * 5
This would return a value in the range [0,5)
Now you need to shift this range up to the range that you are targeting. You do this by adding the Min value.
Min + (Math.random() * (Max - Min))
You now will get a value in the range [Min,Max). But this is still doesn't include max and you are getting a double value. In order to get the max value included, you need to add 1 to your range parameter (Max - Min) and then truncate the decimal part by casting to an int. This is accomplished via:
Min + (int)(Math.random() * ((Max - Min) + 1))
And there you have it. A random integer value in the range [Min,Max].
special thank
สมัครสมาชิก:
บทความ (Atom)