Posts Tagged ‘your’
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.).
Tags: count, engines, features, generally, MySQL, necessary, primary, storange engines:, structured, understand, Well, your
Posted in MySQL, tricks | No Comments »
Thursday, July 24th, 2008
Often your choice of indices will make or break your database. For those who haven’t progressed this far in their database studies, an index is a sort of hash. If we issue the query SELECT * FROM users WHERE last_name = ‘Goldstein’ and last_name has no index then your DBMS must scan every row of the table and compare it to the string ‘Goldstein.’ An index is usually a B-tree (though there are other options) which speeds up this comparison considerably.
You should probably create indices for any field on which you are selecting, grouping, ordering, or joining. Obviously each index requires space proportional to the number of rows in your table, so too many indices winds up taking more memory. You also incur a performance hit on write operations, since every write now requires that the corresponding index be updated. There is a balance point which you can uncover by profiling your code. This varies from system to system and implementation to implementation.
Tags: Balance, corresponding, implementation, Indices, learn, MySQL, now, operations, performance, Select, Space, updated, your
Posted in MySQL, tricks | No Comments »
Thursday, July 24th, 2008
Often you have a table in which only a few columns are accessed frequently. On a blog, for example, one might display entry titles in many places (e.g., a list of recent posts) but only ever display teasers or the full post bodies once on a given page. Horizontal vertical partitioning helps:
CREATE TABLE posts (
id int UNSIGNED NOT NULL AUTO_INCREMENT,
author_id int UNSIGNED NOT NULL,
title varchar(128),
created timestamp NOT NULL,
PRIMARY KEY(id)
);
CREATE TABLE posts_data (
post_id int UNSIGNED NOT NULL,
teaser text,
body text,
PRIMARY KEY(post_id)
);
The above represents a situation where one is optimizing for reading. Frequently accessed data is kept in one table while infrequently accessed data is kept in another. Since the data is now partitioned the infrequently access data takes up less memory. You can also optimize for writing: frequently changed data can be kept in one table, while infrequently changed data can be kept in another. This allows more efficient caching since MySQL no longer needs to expire the cache for data which probably hasn’t changed.
Tags: accessed, blog, changed, Create, Data, Frequently, infrequently, MySQL, needs, Optimizing, Partition, probably, reading, Table, Tables, your
Posted in MySQL, tricks | No Comments »
Tuesday, July 15th, 2008
Your website is not ranked as a whole. Keywords are used to determine the relevancy of your website for particular subjects. So, before buiding your site, make sure you have a relevant set of keywords. Check competing websites for keywords / search terms and use the good ones for yourself.
Tags: buiding, get, keywords, relevant, SEO, subjects, website, your, your site, yourself
Posted in SEO, google, tricks | No Comments »
Monday, July 14th, 2008
Frames can either compliment a web site or make it look unprofessional.
If you must use frames, use them sparingly. If not used properly, frames can make your content very difficult to view.
Avoid making your visitors have to scroll from side to side to view your content. This can be very irritating and cause your visitors to leave and never return.
Consider using small borderless frames at the top or bottom of your page that blend in with the rest of your web site.
In addition, try to only use a couple of framesets. A web site divided up into several frames not only looks bad, but is also very difficult to view and navigate.
In addition, web sites using frames are very difficult for the Search Engines to index.
If you must use frames, offer your visitors a choice — Frames verses no frames.
Tags: borderless, compliment, content very, Frames, html, irritating, Navigate, page, properly, unprofessional, Using, web site, your
Posted in web designing | No Comments »
Monday, June 30th, 2008
I came to a point where I needed to filter the user input (not just tell the user something like : “The username isn’t in the right format” or “Please choose a valid name for your username”), I mean let him to input in the form anything he wanted too but in the end what we store in the database is his processed input (only A-Z, a-z and 0-9).
I had the Visual Basic and C++ thinking .. I must do that and that and that to get rid of unwanted characters. It was a little time consuming and I was in hurry so I googled and I reached the ereg_replace help page on PHP.net website. Suddenly all became much much easier :D, just write a regular expression (ohh, by the way .. if someone asks I can write a small tutorial on regular expressions) like this : “[^A-Za-z0-9]” and that was it :).
Below is a small example on how to filter (remove all characters except uppercase/lowercase letters and numbers)
1. <?php
2. //our string
3. $str = “nek#$#hbet|20&&07″;
4. $filtered = ereg_replace(”[^A-Za-z0-9]“, “”, $str);
5. print $filtered; // will print ‘nekhbet2007′
6. ?>
PHP is a strong language with a lot of functions that help us to decrease the development time. So before thinking how to do a certain thing just take a look first at www.php.net and see if what you need isn’t already done
Tags: anything, C, characters, Data, database, functions, googled, name, PHP, Protect, user input, username, valid, your
Posted in PHP | No Comments »
Thursday, June 26th, 2008
1. Update Any Scripts and Plugins - Look at WordPress, Joomla and any other scripts or services you have installed and see if it is time to give them an upgrade. You should be doing this more often than every spring but now is a good time to check and make sure.
2. Do Your E-mail Addresses Work? - I recently got an e-mail from a friend who told me, “Sorry I didn’t get back to you I just figured out I had major problems with my e-mail account”. Send yourself a dummy message to make sure you don’t fall into the same boat.
3. Clean up Your Sidebars - This ‘bit of advice would be mainly for blogs. I have seen some people become really addicted to having sidebar widgets and gadgets. If you have more than five per sidebar, might be time to ditch some or at least make them look pretty again.
4. Review your Terms of Service - Make sure your terms of service and acceptable use policy are up to date and include everything you wish to include there. You may have made some changes to your web site and business since the last time you reviewed it so check it out now to make sure all your bases are still covered.
5. Check and Update your Sitemaps - If you have a Google Webmaster Tools account, it might be a good time to login and check to make sure Google didn’t find any errors, which would keep them from indexing certain parts of your web site.
6. Is Your Contact Information Correct? - Check out your contact page and make sure that the numbers, e-mail addresses and postal addresses listed there are up to date and show the correct information.
7. Renew Your Domains - When does your domain name run out of date? Might need to check and also be sure that you have all your hosting bills paid up too. This also makes for a good time to upgrade your hosting account to one with a few more perks.
8. Test Your Web Site Links - Are all your web site links working? Check your error logs in your various stats packages to see where people are finding 404s and try to fix all the broken links or non-existent pages you can find.
9. How Out of Date is Your “About Us” Section? - Checking out my own about us page on one of my other web sites I see I pretty much haven’t updated it since the launch of the site. Always good to keep this up to date because well, this is how people lean more about you and what you do.
10. Spellcheck Your Web Site Content - How many grammar errors can you find on your web site? If you don’t want to read through everything you have posted - you might try just going through a few of the most popular ones and making sure they are correct. Bad spelling really peeves some people, so best not to get on anybody’s bad side.
Tags: 10, boat, Cleaning, e-mail, errors, google, indexing, Plugins, scripts, services, Sidebars, Sitemaps, Spring, sure, time, update, upgrade, web site, webmaster, WordPress, your
Posted in web designing | No Comments »
Saturday, June 21st, 2008
n the search engine optimization industry it is well known that there are 3 types of hats that an seo may wear. There is the white hat seo who is on the up and up and does their job in a ethical manner. The black hat seo who does things in a not so ethical manner and normally does their optimization in a manner that the search engines state is not proper. Last but not least is the gray hat seo who is somewhere in the middle of the white and black hat seo.
It behooves me to say that most black hat seo companies are fly-by-night operations that stop doing business when the heat gets too hot. They close their operations only to start up somewhere else under a newly assumed company name. These companies make promises to their customers that they can’t deliver. We’ve all seen the promises like: “We guarantee you the #1 position on all the search engines for your industry keywords”. No one can make this guarantee, so don’t believe it.
So the moral to the story for companies out there who are looking to optimize their web sites is to make sure to deal with reputable companies. Make sure they have been in business for some time, check references, and ask them to show keyword results for work they have done to optimize web sites. Don’t be fooled by companies that send you spam mail with false promises to get your business. SEO is hard and rewarding work when done correctly!
Tags: business, Color, companies, correctly, ethical, guarantee, Hat, keywords, mail, manner, normally, optimization, reputable, SEO, spam, your
Posted in SEO | No Comments »
Thursday, June 19th, 2008
Keyword in links have more importance than simple text.
Use your primary and secondary keywords in the anchor text of links when linking to other blog posts or to other pages on your main site.
Link keywords where they naturally appear in the body text, but again, don’t overdo it, or you’ll end up with spammy looking pages.
Tags: again, anchor, appear, blog, End, importance, keywords, linking, links, looking pages, main site, overdo, primary, secondary, simple, spammy, Text, the, Use, your
Posted in Uncategorized | No Comments »
Thursday, June 19th, 2008
Technorati is the first place that you should be tagging posts. I actually recommend having the tags right on your page, pointing to the Technorati searches that you’re targeting. There are other good places to ping - del.icio.us and Flickr being the two most obvious (the only other one is Blogmarks, which is much smaller). Tagging content can also be valuable to help give you a “bump” towards getting traffic from big sites like Reddit, Digg & StumbleUpon (which requires that you download the toolbar, but trust me - it’s worth it). You DO NOT want to submit every post to these sites, but that one out of twenty (see tactic #18) is worth your while.
Tags: actually, Blogmarks, bump, content, DO, good, most, places, pointing, post, posts, recommend, Reddit, Right, sites, Tag, tagging, these, towards, traffic, twenty, Want, your
Posted in Uncategorized | No Comments »