Choose random person

I made a little script that choose a random person from a list.

The background is that I got this mail from a reader, who need to  choose a random student from his class to answer questions.

Tom wrote:
I am a teacher and we have to randomly choose students to call and answer questions.  Right now we use popsicle sticks with name on stick.  I would like to be able to set up 4 classes,  type in the names of the students from the class and have the app pick a name out of that class randomly.

Beside choosing persons randomly such a random app  also can be used to random pick all kinds of objects or items from a list. Script is programmed in JavaScript.

Choose random person script

Here’s a very simple but useful script, which choose a random student  from a list of names.

function choose_student(){
// Add your own student names to the class list
var class_list =  ["Marge","Maggie","Lisa",
"Bart","Homer","Apu","Burns"];

// Random numbers are made
var randomNumber = parseInt(Math.random() * class_list.length);

// Student are chosen from the class array with the random number
var name = class_list[randomNumber];

// Name is shown in alert box
alert(name);
}

  1. First you make an array (a list ) with the names of the persons you want to choose from
  2. The Math.random() makes random numbers between 0 and 1. By multiplying it with the numbers of students of the list (found with the length function) and flooring it all with the parseInt() function, we will get a number between 0 and numbers of students in the class minus 1.
  3. The person in the position of the random number is extracted from the list and saved in a variable. (the item in the first position in an array is called with the index number 0 like this: myArray[0])
  4. Finally the chosen students name is shown in JavaScript alert box.

And finally you just need to call the “choose random student”-function from your HTML.

<input type=”button” value=”Chose Random Student” onclick=”choose_student()” />

Download example script

You can download an example choose random person script here. In the script you can find both the above pick random person script and the pick random student script I made for Tom. All is integrated in a complete HTML file ready to launch in your favorite browser.

The example script is integrated roughly into my name generator script, but it should give a good overview over how to accomplish the task of picking random persons from simple lists, and how to integrate a simple random application into a HTML page.

Is it the above method truly random?

In short no, but semi randomness is sufficient and adequate for the purpose of selecting random persons for none scientific reasons.

Read more about true random numbers and names.

clipped from web.archive.org
http://web.archive.org/web/20011027002011/http://dilbert.com/comics/dilbert/archive/images/dilbert2001182781025.gif
blog it

Band name widget

Band name widget at Australian band site entertainya

I was contacted by Aladdin from the  Australian band site entertainya. Aladdin wanted a band name  widget to spice up entertainya.com.au.

Alladin wrote:
My Name is Aladdin, I run and own an Australian online music and entertainment called entertainya. I have been on the hunt for something fresh and exciting to add to my site as i have 1000’s of musicians browsing everyday.
I came across your project and would love for you to consider allowing me to integrate your band name generator onto my site.

I thought the idea sounded exiting and started to develop a band name widget. The band name widget gave the idea to make a free  name generator widget.

Band name generator

The band name generator  widget is a  full copy of the band name generator. Same amount of band name combinations and with a 100%  functionality.

You can see the band widget and how seamless  it integrates with the site.  Entertainya.com.au is based on a  joomla cms.  The band generator code is run locally on the client, so it will work with all blogs, cms as well as ordinary html pages.

Behind the band widget

The band name widget is programmed in JavaScript, HTML and CSS, and Alladin  just needed to add a single line of JavaScript to include on his website.

The widget is compressed to minimize download time, and of course follows the w3.0rg standards for proper HTML and validates as XHTML 1.1.

Do you want a cool name widget too?

Do you want a similar or other specialized cool name widget on your site, blog or  favorite forum? Check out this free name generator widget.

Are you looking for a different kind of cool name widget? Please contact me and let’s see if we can work out something.

Other ways to get a name generator

How to make a name generator

Name generator script

Name generator widget

I continue to give away stuff.  This time it’s a name generator widget.

The name generator widget integrates seamlessly with the web site. The widget contains all the necessary code to run very easily on a web page. Just add a single line of code to your page.

The name generator widget makes code names, that can be used in various ways.  Use the  widget to make code names for bands, projects, blog names etc.

See how the widget works at my sidebar. —–>

How to install the widget

Just insert this line of simple  code, where you want the  name generator to run, and you got a fully functional name generator on your site.

<script type=”text/javascript” src=”http://name-generators.com/widgets/name-generator-widget-beta.js”></script>

The widget takes care of the rest. From name generation to styling.

How to customize the name widget.

Use firebug or other developer tool to see the unique id’s and classes on  all elements.  Just add these to your style sheet with the styles you want. In this way it’s easy to add background images or cool buttons to the widget.

Name widget specs

The widget is programmed in JavaScript. It is minified to minimize the load time for your users.

The name widget  works crossbrowser. It is tested in Firefox, Internet Explorer 7+8, Opera and Chrome.

It follows the XHTML standarad set by the w3.org and validate as XHTML 1.1.

Do you want another name widget?

Do you want a business, superhero or maybe a fantasy name widget on your site, blog or  favorite forum?

Please contact me and let’s see if we can work out something. I’m always interested in some serious text link cooperation. ;)

For another working example check this band name generator widget.

Other free name generator stuff

Also remember to check out the:

How to make a name generator

Name generator script

Talk like a pirate day 2010

We are rapidly closing in on talk like a pirate day in 2010. In 2010 is will be 17′th celebration of the talk like pirate day.

As usually the annual pirate day is held on September the19′th . In 2010 it on a Sunday.  So again this year we got to celebrate the talk like a pirate day away from the office. But hey. When you got a cool family it’s OK. My Sons are 12 and 14 so it’s about time, that the get a closer knowledge of the more adult and humoristic approach to  pirate talk, pirate life and pirate names.

Talk like a pirate resources

Talk like a pirate day website. The official talk like a pirate day homepage. Talk like a pirate day was started by John Baur and Mark Summers  in 1995. In 7 years they were pretty much the only nerds in the world celebrating the annual talk like a pirate day. Today we are many more.

Pirate name generator. Can’t go through the pirate day without a cool pirate name. The pirate name generator uses old pirate expressions and pirate names to generate genuine pirate names. I just gave the pirate name generator a major brush up to make it ready for the talk like a pirate 2011.

Pirate dictionary. If you wanna talk like a real one, you can’t avoid the pirate dictionary.

Pirate day on facebook. Well of course pirate day also got a fan side on facebook. Over 7000 members have joined the group today and the group is rapidly growing.

Now you should be ready to have a cool and groovy talk like a pirate day 2010. Have a fantastic day. :)

Name generator script

I have made a  complete name generator script to download and use as your own. The script contains a full functional HTML page with all necessary JavaScript code, HTML and CSS, and can be run in any browser.

The name generator script is a complete do-it-yourself name generator! Ready to run with or without changes. The script is a simplified version one of the one I use at all my name generators.

The script is thoroughly explained and commented in the download file. So it is very easy  to work with for everybody, even for beginners to web programming. If you like further explanation on how the script works visit my How to make a name generator tutorial, where i you through a only slightly more simple generator script.

To get up and running just download the script, change the text and change the word arrays to your likings.  And you got yourself your own personal name generator.

How to use the name generator script

Getting started

Download the name-generator-script.zip.

Or just visit the name generator script demo, right click the page. Select view source. Copy the source to a text-editor.
Save is at generator.html.

How to run it

It’s easy. Just open the html file with your favorite browser.

How to edit it

To edit this page open it with a text editor with syntax highlighting. I’ll strongly recommend notepadd++ a free, fast and flexible text editor, I also use myself.

Name Generator FAQ

No one yet. Guess the code must be  self-explanatory. ;)   Well seriously… if you need help just ask your questions below. I’ll try my best to help you.

How to get visitors on your new name generator

If you make a cool name generator, I might wanna make a review of it. Just write a comment and I’ll look into it.

How to make a name generator

In this tutorial I’ll show how to make a simple name generator. A sort of  “build your own name generator” to experiment with. You just need to add your own word lists and you’re up and running.  But you can expand and modify the  name generator code to your own likings and abilities.

The name generator tutorial is very simple and are aimed at absolute beginners in web programming.

But enough talk, here is some name generator code that makes superhero names:

function generator(){
  // Add your own words to the wordlist. Be carefull to obey the showed syntax
  var adjectives = ["Cool","Masked","Bloody","Lame"]
  var animals = ["Hamster","Moose","Lama","Duck"]

  // Random numbers are made
  var randomNumber1 = parseInt(Math.random() * adjectives.length);
  var randomNumber2 = parseInt(Math.random() * animals.length);
  var name = adjectives[randomNumber1] + " " + animals[randomNumber2];

  alert(name); //Delete this when the below works            

  //If there's already a name it is removed  
  if(document.getElementById("result")){
    document.getElementById("placeholder").removeChild(document.getElementById("result"));
  }
  // A div element is created to show the generated name.
  //The Name is added as a textnode. Textnode is added to the placeholder.
  var element = document.createElement("div");
  element.setAttribute("id", "result");
  element.appendChild(document.createTextNode(name));
  document.getElementById("placeholder").appendChild(element);
}

The script is a simplified version of the one I use to make superhero names with my superhero generator.

The name generator piece by piece

The arrays

The most important part of  the name generator is the word lists. The more words in the list the more variety in the output. So the first part to do is to create a couple of arrays holding all our cool words:

var adjectives = ["cool","masked","bloody","lame"];
var animals = ["hamster","moose","lama","duck"]

To retrieve data  from the list we call the name of array with the count of the word as a parameter in a square bracket.  Be aware that counting in programming almost always starts at zero and not at 1.

So adjectives[0] is cool and  animals[1] gives moose

Randomness

We of course want random names, so we need to replace the hard coded numbers with random numbers. In our case numbers between 0 and 3 because we have 4 words in our lists. Instead of counting the words ourself, we do that we let the JavaScript length function do the counting. Then we multiply it with a random floating-point number between 0 and 0.9999999999999. Finally we use the parseInt funktion to make the floating-point number into a integer.

All sounds a bit complicated but code wise  it’s  quite easy.

randomNumber1 = parseInt(Math.random() * adjectives.length);
randomNumber2 = parseInt(Math.random() * animals.length);

The output

The most simple way to output the name is using the alert function. I use it only to check the generated name cause,  the alert box is  very annoying. So just delete the line, when the code below is up an running.

We will use 7 extra lines to integrate the result into the web page in a more natural way.

But before we begin you need to make an empty div tag in your HTML:

<div id=”placeholder”></div>

And here are the 7 lines that write the result in the page..

if(document.getElementById("result")){
  document.getElementById("placeholder").removeChild(document.getElementById("result"));
}

element = document.createElement("div");
element.setAttribute("id", "result");
element.appendChild(document.createTextNode(name));
document.getElementById("placeholder").appendChild(element);

In short it works like this:

  1. If there’s already a result it is removed
  2. Then a new div element to hold the result  is created
  3. The name is added as a text node
  4. Finally the element is appended to a placeholder in the HTML.

When this part works, you can delete the alert(name) from the script.

Putting it all together

The generator function can either be included in the head of the HTML document or you can place it in a external JavaScript file.

Now you can call the function from your HTML page.  I always do it 2 places. First in the body tag with an onload event. The generator function then also runs when the page is loaded.

<body onload=”generator()”>

And then I also call the JavaScript function on a button:

<input type=”button” onclick=”generator()” />

Download the name generator script

Download name generator script here and read the description of how to make the name generator script work.

Want a review of your name generator?

Write a comment if  you make a cool name generator with this script. I might very well  write a review of it.  :)

Also remember to visit my name generators to see  how I make superhero names with the superhero generator.

Easy online spell checking

One of the most important things when it comes to writing and publishing stuff on the Internet is spell checking. Spell checking can with the right tools be done in a few minutes and it it will increase the credibility of your work tremendously. No need to say that spell checking is even more important for non native English speakers like myself.

In this post I have collected the best tools for precise, fast and easy spell checking.

Online spell checking

Orangoo spell check is my favorite online spell checker. I just copy all my text from my code editor, paste it in the Orangoo and start the spell checker. When done, I copy the edited text and paste it back into my editor. Very easy and intuitive to use, and a great example of a simple online web application, that does the job in an easy way. No complicated configurations and choices to make. Just pure functionality.

Orangoo online spell checkers handles close to 30 different languages.

Alternatively Orangoo also offers a complete spell checking scan of your website. Type in the URL of your site and your e-mail, and you’ll receive a complete report of the entire website for spelling mistakes and typos.

Browser spell check

Spell checking in your browser is a lot easier that the online counterpart. It makes it a lot simpler to spell check blog posts, online articles, web-based emails and  posts on forum, facebook, myspace or whatever social networks and online communities you’re using.

Firefox has been offering build-in and inline spell checking since Firefox 2.0. It’s easy to change language of the spell checker and to download new language packages. All is done with a right click in your browser on the text area you wanna check for mistakes and typos. The Firefox spell checker performs a live spell checking. Just like we know it from our word processing software.

For Internet Explorer I highly recommend the ieSpell. ieSpell is a free Internet Explorer browser plug-in, that spell checks text input boxes on webpages. Opposed to Firefox ieSpell does not perform live spell checking, but need to be activated from the browser menu or a tool bar.  I have used this easy tool in many years and only have nice things to say about the plug-in.

Alternatives

When in doubt I sometimes use the Google search for a simple test. Their  “did you mean”-service is brilliant if you wanna spell check a single word or a simple phrase.

I also like to mention WordWeb. WordWeb is a English dictionary, thesaurus, and word finder software for Windows. The application is free for private use and is a great tool when you’re working with the English Language.

Feel free to add a comment if  I missed out on other easy spell checkers or methods.

Blog name generator

A friend of mine suggested that I made a blog name generator. Why? I already have a great blog name generator.  ;)

Code Name – Blog Name Generator?

No reason to start all over. The  Code and Blog Name Generator makes cool  ideas for blog names.  By design it of course is originally a code name creator, but  the results is useful in a wide variety of areas. And many of the generated code names would also work great as blog names. What would you say to blog names like:

  • Rough Heart
  • Scarlet Moving Pens
  • Autumn Confidential
  • Subtle Knife

I think they could be pretty cool blog names. So from today instead of  reinventing the wheel, I simply claim the code generator to also be a Blog Name Generator.

Making names

The names are made by 2 and 3 word combinations from word list specially chosen for making code names. Words with lots of  meaning a strong ability of creating  images. The results is powerful, inspiring and creative code and cool blog names.

An algorithmic program gives variation and up to 5 million different code or blog names.

Whats in a good blog name

Well it really depends on the he subject of the blog and the personalty of the blogger. But a good blog name could be

  • describing for the content of articles and subjects
  • content important keywords
  • memorable
  • catchy and cool

A blog name generator can’t do much for you if you’re looking for specific and descriptive title like the title of my blog. But if you’re looking for catchy, cool, funny, subtle or humorous names a blog name generator can help you in the process.

Idea generator

Don’t expect too much. A name generator is basically an idea generator. It does not necessarily make the perfect names. A simple artificial intelligence of a rather simple script don’t get the subtle meanings in certain word combinations. And it’s often  the subtle nuances and meanings that separates the good blog name from the bad one.

The strength of a generator is that it can come up with endless combinations, cool ideas and a lot of suggestions.

You just have to take the good ideas and form them into you personal blog name.

Go to the Code and Blog Name Generator.

Better vampire names

I have made a major update to the vampire names generator. It was one of my first name generators, so it needed a serious overhaul. The vampire names was generally too long and needed so serious tightening up.

Try the better vampire names.

More and better names

I have increased the number of names. I have recycled the fantasy names with the most East European sound and feel. And i have added both new vampire names for girls and boys.  In return some of the least suited boys and girls vampire names also has been removed.

The effect of the increased numbers of name is many more possible unique name combinations. And the effect of the added fantasy names is more mystic, cryptic and devious vampire names.

Changed algorithms

I have also changed the algorithms of the generator. The names are now shorter and more powerful. Also the variation in names has increased because of  more complex random algorithms.

Overall the consequence is much cooler and better vampire names.

Vampire background

Finally I have also added a few new links to other vampire resources and updated the articles with some vampire background and history.

Bad vampire names?

And the usual disclaimer. I still make bad names. Sorry but I have to take chances to surprise. Bear with me and just generate a bunch of vampire names and only choose the best ones.

Go and get the new and improved vampire names!

Alternative use of name generators

Spicing things up with a name generator

In  this article by the Dutch photographer Michael Van der Tol: photographic project names,  he gives ideas for alternative uses of name generators. He tells about the slump you often get into. Things get uninspired and you often end up doing the same things over and over again.

You need new inputs to get new ideas. Use a project name generator to generate ideas for new exiting photographically projects.

Michael Vander Tol:

If you’re like me the project rarely comes before the photographs; and actually, the project title comes last. So I’m proposing you mix things up a bit and start with the project title.

Generate ideas and names for writing

Inspired by Michael van der Tools idea we  can also use name generators to generate ideas for writing. Ideas to use for novels, essay, short stories etc.

What about letting “yellow foot” be the secret code name of a military operation of  “alpha beat” could be the name of upcoming pop group, or the state of the first hearts beats after a time travel in a science fiction short story.

(“yellow foot” is the project name for user interface using the Summa search engine.  “alpha beat” is the  name of an upcoming pop group ;)  not generated by the project name generator, but might as well been)

T-shirts and cool names

Another alternative use of cool names would be as a t-shirt text. Strange t-shirt text are usually some cool icebreakers in many contexts.

Opportunities are abundant.