Posts Tagged ‘necessary’

Mysql-Understand your engines

Thursday, July 24th, 2008

MySQL has two primary storange engines: MyISAM and InnoDB. Each has its own performance characteristics and considerations. In the broadest sense MyISAM is good for read-heavy data and InnoDB is good for write-heavy data, though there are cases where the opposite is true. The biggest gotcha is how the two differ with respect to the COUNT function.

MyISAM keeps an internal cache of table meta-data like the number of rows. This means that, generally, COUNT(*) incurs no additional cost for a well-structured query. InnoDB, however, has no such cache. For a concrete example, let’s say we’re trying to paginate a query. If you have a query SELECT * FROM users LIMIT 5,10, let’s say, running SELECT COUNT(*) FROM users LIMIT 5,10 is essentially free with MyISAM but takes the same amount of time as the first query with InnoDB. MySQL has a SQL_CALC_FOUND_ROWS option which tells InnoDB to calculate the number of rows as it runs the query, which can then be retreived by executing SELECT FOUND_ROWS(). This is very MySQL-specific, but can be necessary in certain situations, particularly if you use InnoDB for its other features (e.g., row-level locking, stored procedures, etc.).

Mysql-Avoid variable-length column types when necessary

Thursday, July 24th, 2008

For MyISAM tables that change frequently, you should try to avoid all variable-length columns (VARCHAR, BLOB, and TEXT). The table uses dynamic row format if it includes even a single variable-length column.

Introduction to Web Hosting

Wednesday, July 16th, 2008

Just about anybody can create a presence on the Internet. Building a web site can be as simple as using a word processor, but once you have the site you need a way to publish it on the World Wide Web. This is where web-hosting companies come in.

A web host rents you disk space and provides all the services necessary for others to see your web site on the Internet.  Barring technical problems, a web host operates 24 hours a day, 7 days a week so that anybody in the world can access your web site at any time.

There are literally thousands of web hosts to choose from so choosing an appropriate host can be a difficult task. The prices range from free to hundreds of dollars a year. Hosting companies can offer a multitude of services that can be confusing to a newcomer. This series of articles will help you to sort out all the information available and give you the confidence to make the proper decision about choosing a web host.

Free or Paid?

There are plenty of hosting companies that provide free hosting, so why bother paying for it?  The old adage ‘You get what you pay for’ is just as valid in the electronic age as it was 100 years ago. In web hosting, when you pay nothing you sometimes end up with nothing.

Most free web hosts offer limited services. Even though they are not charging you to host your website, they still need to make money. They often do this by placing advertising on your site. You probably won’t have any control over what kind of ads show up – it’s a matter of take it or leave it.

In addition, free hosts may restrict the content you place on your site. You may not be allowed to sell things or have certain content such as videos or music. Finally, your web site could simply disappear overnight. New companies that offer free hosting pop up almost everyday, but they also vanish with astonishing regularity. When your hosting company vanishes, your web site goes with it.

If you are serious about having a web site you need to use a reliable web host. Prices range considerably – some companies offer rates as low as $2 a month while others charge $60 or more. Be careful, though. High rates don’t always translate as high service. Some of the lower priced hosts offer reliable, stable environments that allow your website to be accessed day in day out for years.

Generally speaking the more you pay the more you get. Higher rates should bring you more storage space, more bandwidth to handle Internet traffic, and more services such as databases, email accounts, mass mailers, and the ability to add custom scripts. Higher rates can also mean better technical service if you have problems with your website.

What is a Web Server?

Whichever hosting company you choose, it helps to understand some of the technical details about their service. Every host has dedicated computers called servers which connect to the Internet and ’serve’ pages when they are requested.  That is, whenever anyone wants to see a certain web page by clicking on a link the request is sent to the particular server where that web page is stored. The server responds by sending HTML data across the Internet. A web server must have fast connections to be able to serve pages quickly. For the greatest speed and reliability try to find a host that has multiple high-speed connections as well as reliable back up power supplies in case of power outages.

Using Wildcards

Tuesday, July 15th, 2008

You can use the asterisk (*) character to indicate a wildcard search. This is useful when you are trying to match a term that may or may not be plural or might use one of several verb tenses. For example chemi* will find results containing words that begin with ‘chemi’ (e.g. chemical, chemistry, chemist). You must have at least four non-wildcard characters in a word before you introduce a wildcard. This is not necessary for plurals because a search on cat will also return results containing the word cats, and a search on cats will return results containing the word cat.

Some search engines support two wildcards. The asterisk (*) is used to replace multiple characters and the percent (%) symbol is used to replace only one character. For example psych*ist will find all results which contain words that begin and end with ‘psych’ and ‘ist’ (e.g. psychologist, psychiatrist), and gene%logy will return sites containing words beginning with ‘gene’ and ending with ‘logy,’ separated by a single letter (e.g. genealogy and geneology) which is useful for commonly misspelled words. You can also use multiple wildcards within a single word.

Ten Tips to the Top of Google

Saturday, June 28th, 2008

Having a Web site that gets found in Google isn’t hard to do, but it can be difficult to know where to begin. Here are ten tips to get you started.

1. Start out slowly. If possible, begin with a new site that has never been submitted to the search engines or directories. Choose an appropriate domain name, and start out by optimizing just the home page.

2. Learn basic HTML. Many search engine optimization techniques involve editing the behind the scenes HTML code. Your high rankings can depend on knowing which codes are necessary, and which aren’t.

3. Choose keywords wisely. The keywords you think might be perfect for your site may not be what people are actually searching for. To find the optimal keywords for your site, use tools such as WordTracker. Choose two or three highly targeted phrases for each page of your site. Never shoot for general keywords such as “travel” or “vacation.”

4. Write at least 200 - 250 words of visible text copy based on your chosen keywords. This is a crucial component to high rankings and a successful Web site. The search engines need to “read” keyword rich copy on your pages so they can successfully classify your site. Use each keyword phrase numerous times within your copy for best results.

5. Create a killer Title tag. HTML title tags are critical because they’re given a lot of weight with all of the search engines. You must put your keywords into this tag and not waste space with extra words. Do not use the Title tag to display your company name or to say “Home Page.” Think of it more as a “Title Keyword Tag” and create it accordingly. Add your company name to the end of this tag, if you must use it.

6. Create Meaty Meta tags. Meta tags can be valuable, but they are not a magic bullet. Create a Meta Description tag that uses your keywords and also describes your site. The information in this tag often appears under your Title in the search engine results pages.

The Meta Keyword tag isn’t quite as important as the Meta Description tag. Contrary to popular belief, what you place in the keyword tag will have very little bearing on what keywords your site is actually found under, and it’s not given any consideration whatsoever by Google. Use this tag, but do not obsess over.

7. Use extra “goodies” to boost rankings. Things like headlines, image alt tags, header tags <H1><H2>, etc.), links from other pages, keywords in file names, and keywords in hyperlinks can cumulatively boost search engine rankings. Use any or all of these where they make sense for your site.

8. Be careful when submitting to directories such as Yahoo and the Open Directory Project (DMOZ). Having directory listings are a key component to getting your site spidered and listed by Google. Making mistakes in the submission process could cost you dearly as directory listings are difficult to change later in the game. Therefore, it’s important to read Yahoo’s How to Suggest Your Site and How to add a site to the Open Directory before submitting.

9. Don’t expect quick results. Getting high rankings takes time; there’s no getting around that fact. Once your site is added to a search engine or directory, its ranking may start out low and then slowly work its way up the ladder. Some search engines measure “click-through popularity,” i.e., the more people that click on a particular site, the higher its ranking will go. Be patient and give your site time to mature.

10. Don’t constantly “tweak” your site for better results. It’s best not to make changes to your optimization for at least three-to-six months after submission. It often takes the engines at least that long to add your optimized pages to their databases. Submit it, and then forget about it for a while!

If you’ve followed these tips and still can’t find your site in the engines, the first place to “tweak” would be your page copy. If you added less than 250 words of visible text on your pages, this is probably your culprit. Also, double check your keyword density, and make sure that you only targeted two or three phrases per page. Eventually, you’ll see the fruits of your labor with many top ten rankings in Google and the rest of the search engines!

JavaScript Forms

Saturday, June 21st, 2008

Being able to successful create JavaScript forms isn’t a difficult process but it may be one that you are unsure about. The common misconception that creating web pages takes an expert computer programmer just isn’t true. While you will use HTML to create JavaScript, you need to realize that they aren’t exactly the same.

With JavaScript you will have several different handlers that the user can click on to perform the necessary actions. This is very important because the easier your web pages are to navigate the more interested consumers will be in them. Some people are very new to using the internet and others are experts so you want to be able to appeal to the level of skill of everyone.

The various JavaScript forms that you create will have coding inserted behind the scenes where the consumer can’t see them. For example your site may have an opt in form for the user to complete. At the bottom they simply click on the form that says SUBMIT. The codes you have entered behind the scenes work to process the information that they have provided.

In order to have a successful JavaScript form called a widget, you need to have several elements in place. They include the form name, the action you want the user to be able to perform, a method for that information to be processed, and a value for each of the JavaScript forms.

There are many different ways in which you can set up JavaScript forms on your web pages. While a simple box that they click is the easiest you may want to offer a radio box or drop down menu if there is more than one option they can select from. You can also offer a text box if you want the user to be able to type in various information.

Before you put your web pages up for consumers to look at, you want to take the time to validate all of the information you have placed into the various JavaScript forms. The goal is for everything to work exactly as it should on the first try. If you come across JavaScript errors you should check each field of entry again. It is going to take some time to master JavaScript but once you do it will become one of the most valuable tools you have to offer.