Welcome, Guest
Please login or register
May 18, 2012, 08:04:42 AM
Topic: AScripter's Journal: random numbers  (Read 3580 times)
Author
AScripter's Journal: random numbers
Adrian.B
Global Moderator

*****
Posts: 260



« on: July 21, 2009, 09:56:45 AM »

I'll post here whenever I find something interesting.
Today, let me tell you about generating random numbers. Actionscript offers two functions for this:

random(value:Number), which is a global function and is deprecated as not being as reliable as Math.random()

Note that any computational way of generating random numbers is based on an algorythm (that takes into consideration CPU frequency, current time etc), and since the process stil depends on Something and the generated numbers are "calculated", they are called "pseudo-random".

The use of these functions is very hard to debug, due to the enability to assess, during runtime, if the series of generated numbers is actually even or not (an even distribution is when all elements of that distribution have the same probability to occur).

Here are a few observations that may help you avoid a lot of time consuming debugging:

  • The global function random needs an integer as parameter, and will return a value between 0 and less than the specified integer. Say you want to get a random integer between 0 and 5. You will have:

    randomInteger = random(6);

  • The more used function Math.random() returns a number greater than or equal to 0 and less than 1. Say you want to get an integer between 1 and 5.
    The obvious way would be:

    randomInteger = Math.round(Math.random()*4+1);

    Although this will indeed return an integer between 1 and 5, this is not an even distribution. 2, 3 and 4 will have 1/4 chances to occur, but 1 and 5 only have 1/8 chances.

    To get an even distribution, use Math.floor instead of Math.round, and increment the factor you multiply:

    randomInteger = Math.floor(Math.random()*5+1);

I hope you find this useful.

« Last Edit: July 22, 2009, 01:55:23 AM by Admin »
carpinteyrognk
*
Posts: 1

« Reply #1 on: April 26, 2012, 05:14:33 AM »

If you already have a website, you surely know that a top position in the search engines is vital for success. By reading this article, you will learn some of the best ideas for improving your search engine rankings.
 
It is important that you know what SEO is before you begin your SEO venture. <a href=http://www.cheapjordanslive.com/>cheap jordans online</a> Algorithms and formulas are used to rank sites. The following post gives you quite a few ideas on how to adjust your site to help it place better in the search engine results.
 
Several things are considered by the search engine when it ranks your site. Firstly, they may look at the keywords of your webpage. <a href=http://www.airjordanstown.com/>air jordan shoes</a>They also factor in site activity and links from, to and between pages of your site.
 
It will take time and effort to improve your search engine position. Your visitors' interests and convenience should be your first priority in designing your website. <a href=http://www.topairjordan2012.com/>cheap air jordan shoes</a>Include many descriptive keywords in the titles, headings and throughout your website's content. Search engine algorithms will use these keywords to relate your website to search terms and assign your site a higher ranking on SERPs.
 
There is no way to directly buy a high placement on a search engine. However, companies can pay to have their site featured in a certain space. <a href=http://www.airjordanshoesmart.com/>jordans for sale</a> Usually, three websites appear as "featured" results for every search. For the most part only the larger corporate sites can afford to pay for this service.
 
Optimizing your website for search engines is more than just having the right phrases sprinkled throughout your text. If you add more links within your pages, as well as links to other websites, your site will be ranked higher. Writing articles for other sites and trading content are both ways to build the links that you need.
 
When you attempt to attract a certain type of person to your website, they are often called targeted visitors. Some people do just click on to your site without any prior engagement, but they probably are going to click away just as quickly. If you want these types of clients, you need good keywords. Another way to increase targeted traffic is to purchase links on websites that are related to the products and services that you sell. Visitors on these websites are more likely to be interested in what you're selling.
 
Websites are so cheap that every business should have one, especially those that sell something that could easily be shipped worldwide. An ideal website can be easily created by following the advice given to you here.
 

bolouboutinthe
*
Posts: 12

« Reply #2 on: Yesterday at 12:27:18 PM »


tiffany
tiffany coIt's also been years seeing that blogging continues to be practiced. But it's just that it is often considered as one of the addicting programmes. Many young people have resorted that will blogging as a possible outlet for emotions, slightly online space where they could blurt released whatever really bugs these products or any makes these people feel elated. Savvy marketers have found that blogging is probably the best Search engine marketing methods that will not cost that you cent.
Precisely what is blogging? Blog could be the widely put to use term that represents web fire wood. tiffany and coBasically, a blog can be an online record. A blog could possibly be set close to no cost in any respect, and can be utilized for used just for the fun of computer or for the purpose of business arguments.
Blogging to your Internet online business is a single surefire strategy to boost your visibility to your products. Here undoubtedly are a few solutions to boost your online advertising with the aid of a web log:
1. Make ones own clients as well as customers abreast on your own website's modifiation. Your new releases and web websites could also be announced through your site.
tiffany jewelry stroe
a couple of. Keep tabs on your online business objectives and even plans throughout open authoring. Your blog site content may be easily put away through microfiche. What could possibly be better when compared to searchable information that might be easily contacted by everybody browsing online, right?
3. Oxygen your feedback, advice or simply reviews at specific products or services that are relating to your online business.
discount tiffany sliverPublishing can be a very uncomplicated process by means of blogging.
some. Include links that may fetch backlinks and afterwards improve a ranking on search engine listings. This can be better made through applying well-written articles with your website. Affiliate links could also be included ?nside your blog that will earn more extra money.
5. gold banglesCollect response from the ability for blogs to help you fetch comments from the blog people. You will learn and even improve your products through considering the feedback through your readers.
6. Hook up easily through other web owners. When different bloggers notice which you have something good within your blog, they are going to put you inside their favorite lists they'll automatically link someone to their blogging. cheap tiffany bangles
Thus, how you set " up " a webpage? Here are a number of the options you may create use for to exploit this fun tactic to advertise your web business.
Either people load a good blogging software system or please let a writing hosting service take action for an individual. Host services for instance LiveJournal in addition to Blogger. com are the most used in this specific field. Those hosts provides you with easy instructions how to organize your web log. That title will sound like it's really a little arrogant, doesn't it again? Yet, through a moment looking at the minute word and additionally nothing else you'll find the technique of on the web moneymaking accomplishment. gold banglesPeople aren't focused on what you are hawking right up until they view what it may do for the kids.
Look into pharmaceutical companies' adverts on tv on pc. They're merchandising medication, junk for unwell people; nothing can be more undesirable and harder distribute. However, that ads will not show frustrated people; some people show content, beautiful strong people. Who find themselves sick desire to appear like those in this ad. tiffany pendant necklaceSo, the pharmaceutical drug company wouldn't show sick folks who need their product. They indicate healthy individuals that are healthy because of the product. The would-be buyer sees a principal benefit to purchasing the medicine. The business makes some sale.
Now techniques use the identical principle with your online moneymaking business? Techniques sell an immediate benefit to all your prospective customers rather than just selling a products or services? If one can find the step to that issue, you often is the one watching your website explode.
The techniques used is almost always to reward your visitors for in your site and purchasing your supplements. tiffany and co braceletsIn inclusion, you can easily reward these products for recommendations to others. Special is aware of that thank you for the purchase and / or offering a tiny discount as long as they come back again or refer your business to a pal are all great strategies to increase an individual's profit border. Another method is if your customer signs up at your own sight will automatically send affirmation messages of which their obtain was acquired though as an alternative for simply just saying, "we have obtained your request" add a little extra inside. This is an effective time to present them anything extra from your very own sight or a discount from there future purchase, be creative and will also be amazed from the responses you may receive.
It's less hard as you've probabably heard. Put yourself inside the mind with the client. How are able to your service make his life easier? Once you might have that, you have got the basis of one's marketing strategy. It's been said any time you built an improved mousetrap people would defeat a road to your house. Why? Achieve people need a mousetrap who badly? As expected not, some people just will not want any sort of mice difficulties. Approach your own clients with a answer on their mice problem including your online money making business has to be great achievements. .

  bangles  blog

bangles 

About tiffanyltd.com blog

Pages: 1
 

Community

What's hot on the forums

hi Bogdan, and everyone,

first, i was wondering if the players were pulled off on the flashcomponents site. I purchased VPIII from there, ...

News

Stay up to date

We've launched a new cool project called VisionFlow.

Like it? Share it!

Tell your friends about us

Do you like our products or our site? We would be very grateful if you shared them with your friends, colleagues, parents, pets and spread the word about our awesome products.

Share to Facebook Share to Twitter Stumble It Email This More Share...