C# – Difference Between abstract and virtual Members – C-Sharp

An abstract member is not implemented in the base class and must be implemented in derived classes in order for the class to compile.

Another type of member is a virtual member. A member defined as virtual must be implemented in the base class, but may be optionally overridden in the derived class if different behavior is required.

C# KeyedCollection – C-Sharp

KeyedCollection is a Hybrid collection of IList and IDictionary. You can access the collection by an index of object’s one of properties. The KeyedCollection class is a hybrid between an IList and IDictionary . Like the IList, KeyedCollection is an indexed list of items. Like the IDictionary, KeyedCollection has a key associated with each item. But unlike dictionaries, KeyedCollection is not a collection of key/value pairs; rather, the item is the value and the key is embedded within the value. As a result, KeyedCollection provides O(1) indexed retrieval and keyed retrieval that approaches O(1), meaning that item lookup is very fast.

The KeyedCollection class is defined in the in the System.Collections.ObjectModel namespace. KeyedCollection is an abstract base class that you must override and implement the GetKeyForItem method, which extracts the key from the item.

C# Country Codes and Country Names

Country codes and names in an array.

private static readonly string[] s_countryCodes = {
“–“, “AP”, “EU”, “AD”, “AE”, “AF”, “AG”, “AI”, “AL”, “AM”, “AN”,
“AO”, “AQ”, “AR”, “AS”, “AT”, “AU”, “AW”, “AZ”, “BA”, “BB”, “BD”,
“BE”, “BF”, “BG”, “BH”, “BI”, “BJ”, “BM”, “BN”, “BO”, “BR”, “BS”,
“BT”, “BV”, “BW”, “BY”, “BZ”, “CA”, “CC”, “CD”, “CF”, “CG”, “CH”,
“CI”, “CK”, “CL”, “CM”, “CN”, “CO”, “CR”, “CU”, “CV”, “CX”, “CY”,
“CZ”, “DE”, “DJ”, “DK”, “DM”, “DO”, “DZ”, “EC”, “EE”, “EG”, “EH”,
“ER”, “ES”, “ET”, “FI”, “FJ”, “FK”, “FM”, “FO”, “FR”, “FX”, “GA”,
“GB”, “GD”, “GE”, “GF”, “GH”, “GI”, “GL”, “GM”, “GN”, “GP”, “GQ”,
“GR”, “GS”, “GT”, “GU”, “GW”, “GY”, “HK”, “HM”, “HN”, “HR”, “HT”,
“HU”, “ID”, “IE”, “IL”, “IN”, “IO”, “IQ”, “IR”, “IS”, “IT”, “JM”,
“JO”, “JP”, “KE”, “KG”, “KH”, “KI”, “KM”, “KN”, “KP”, “KR”, “KW”,
“KY”, “KZ”, “LA”, “LB”, “LC”, “LI”, “LK”, “LR”, “LS”, “LT”, “LU”,
“LV”, “LY”, “MA”, “MC”, “MD”, “MG”, “MH”, “MK”, “ML”, “MM”, “MN”,
“MO”, “MP”, “MQ”, “MR”, “MS”, “MT”, “MU”, “MV”, “MW”, “MX”, “MY”,
“MZ”, “NA”, “NC”, “NE”, “NF”, “NG”, “NI”, “NL”, “NO”, “NP”, “NR”,
“NU”, “NZ”, “OM”, “PA”, “PE”, “PF”, “PG”, “PH”, “PK”, “PL”, “PM”,
“PN”, “PR”, “PS”, “PT”, “PW”, “PY”, “QA”, “RE”, “RO”, “RU”, “RW”,
“SA”, “SB”, “SC”, “SD”, “SE”, “SG”, “SH”, “SI”, “SJ”, “SK”, “SL”,
“SM”, “SN”, “SO”, “SR”, “ST”, “SV”, “SY”, “SZ”, “TC”, “TD”, “TF”,
“TG”, “TH”, “TJ”, “TK”, “TM”, “TN”, “TO”, “TL”, “TR”, “TT”, “TV”,
“TW”, “TZ”, “UA”, “UG”, “UM”, “US”, “UY”, “UZ”, “VA”, “VC”, “VE”,
“VG”, “VI”, “VN”, “VU”, “WF”, “WS”, “YE”, “YT”, “RS”, “ZA”, “ZM”,
“ME”, “ZW”, “A1”, “A2”, “O1”, “AX”, “GG”, “IM”, “JE”, “BL”, “MF”
};

private static readonly string[] s_countryNames = {
“N/A”, “Asia/Pacific Region”, “Europe”, “Andorra”,
“United Arab Emirates”, “Afghanistan”, “Antigua and Barbuda”,
“Anguilla”, “Albania”, “Armenia”, “Netherlands Antilles”, “Angola”,
“Antarctica”, “Argentina”, “American Samoa”, “Austria”, “Australia”,
“Aruba”, “Azerbaijan”, “Bosnia and Herzegovina”, “Barbados”,
“Bangladesh”, “Belgium”, “Burkina Faso”, “Bulgaria”, “Bahrain”,
“Burundi”, “Benin”, “Bermuda”, “Brunei Darussalam”, “Bolivia”,
“Brazil”, “Bahamas”, “Bhutan”, “Bouvet Island”, “Botswana”,
“Belarus”, “Belize”, “Canada”, “Cocos (Keeling) Islands”,
“Congo, The Democratic Republic of the”, “Central African Republic”,
“Congo”, “Switzerland”, “Cote D’Ivoire”, “Cook Islands”, “Chile”,
“Cameroon”, “China”, “Colombia”, “Costa Rica”, “Cuba”, “Cape Verde”,
“Christmas Island”, “Cyprus”, “Czech Republic”, “Germany”,
“Djibouti”, “Denmark”, “Dominica”, “Dominican Republic”, “Algeria”,
“Ecuador”, “Estonia”, “Egypt”, “Western Sahara”, “Eritrea”, “Spain”,
“Ethiopia”, “Finland”, “Fiji”, “Falkland Islands (Malvinas)”,
“Micronesia, Federated States of”, “Faroe Islands”, “France”,
“France, Metropolitan”, “Gabon”, “United Kingdom”, “Grenada”,
“Georgia”, “French Guiana”, “Ghana”, “Gibraltar”, “Greenland”,
“Gambia”, “Guinea”, “Guadeloupe”, “Equatorial Guinea”, “Greece”,
“South Georgia and the South Sandwich Islands”, “Guatemala”, “Guam”,
“Guinea-Bissau”, “Guyana”, “Hong Kong”,
“Heard Island and McDonald Islands”, “Honduras”, “Croatia”, “Haiti”,
“Hungary”, “Indonesia”, “Ireland”, “Israel”, “India”,
“British Indian Ocean Territory”, “Iraq”,
“Iran, Islamic Republic of”, “Iceland”, “Italy”, “Jamaica”, “Jordan”
, “Japan”, “Kenya”, “Kyrgyzstan”, “Cambodia”, “Kiribati”, “Comoros”,
“Saint Kitts and Nevis”, “Korea, Democratic People’s Republic of”,
“Korea, Republic of”, “Kuwait”, “Cayman Islands”, “Kazakstan”,
“Lao People’s Democratic Republic”, “Lebanon”, “Saint Lucia”,
“Liechtenstein”, “Sri Lanka”, “Liberia”, “Lesotho”, “Lithuania”,
“Luxembourg”, “Latvia”, “Libyan Arab Jamahiriya”, “Morocco”,
“Monaco”, “Moldova, Republic of”, “Madagascar”, “Marshall Islands”,
“Macedonia, the Former Yugoslav Republic of”, “Mali”, “Myanmar”,
“Mongolia”, “Macau”, “Northern Mariana Islands”, “Martinique”,
“Mauritania”, “Montserrat”, “Malta”, “Mauritius”, “Maldives”,
“Malawi”, “Mexico”, “Malaysia”, “Mozambique”, “Namibia”,
“New Caledonia”, “Niger”, “Norfolk Island”, “Nigeria”, “Nicaragua”,
“Netherlands”, “Norway”, “Nepal”, “Nauru”, “Niue”, “New Zealand”,
“Oman”, “Panama”, “Peru”, “French Polynesia”, “Papua New Guinea”,
“Philippines”, “Pakistan”, “Poland”, “Saint Pierre and Miquelon”,
“Pitcairn”, “Puerto Rico”, “” + “Palestinian Territory, Occupied”,
“Portugal”, “Palau”, “Paraguay”, “Qatar”, “Reunion”, “Romania”,
“Russian Federation”, “Rwanda”, “Saudi Arabia”, “Solomon Islands”,
“Seychelles”, “Sudan”, “Sweden”, “Singapore”, “Saint Helena”,
“Slovenia”, “Svalbard and Jan Mayen”, “Slovakia”, “Sierra Leone”,
“San Marino”, “Senegal”, “Somalia”, “Suriname”,
“Sao Tome and Principe”, “El Salvador”, “Syrian Arab Republic”,
“Swaziland”, “Turks and Caicos Islands”, “Chad”,
“French Southern Territories”, “Togo”, “Thailand”, “Tajikistan”,
“Tokelau”, “Turkmenistan”, “Tunisia”, “Tonga”, “Timor-Leste”,
“Turkey”, “Trinidad and Tobago”, “Tuvalu”, “Taiwan”,
“Tanzania, United Republic of”, “Ukraine”, “Uganda”,
“United States Minor Outlying Islands”, “United States”, “Uruguay”,
“Uzbekistan”, “Holy See (Vatican City State)”,
“Saint Vincent and the Grenadines”, “Venezuela”,
“Virgin Islands, British”, “Virgin Islands, U.S.”, “Vietnam”,
“Vanuatu”, “Wallis and Futuna”, “Samoa”, “Yemen”, “Mayotte”,
“Serbia”, “South Africa”, “Zambia”, “Montenegro”, “Zimbabwe”,
“Anonymous Proxy”, “Satellite Provider”, “Other”, “Aland Islands”,
“Guernsey”, “Isle of Man”, “Jersey”, “Saint Barthelemy”,
“Saint Martin”
};

Array of Countries and Array of States in Php

Here is an array of Countries and States mapping in Php.

$states = array(
‘AL’    =>    ‘Alabama’,
‘AK’    =>    ‘Alaska’,
‘AZ’    =>    ‘Arizona’,
‘AR’    =>    ‘Arkansas’,
‘CA’    =>    ‘California’,
‘CO’    =>    ‘Colorado’,
‘CT’    =>    ‘Connecticut’,
‘DC’     =>    ‘District of Columbia’,
‘DE’    =>    ‘Delaware’,
‘FL’    =>    ‘Florida’,
‘GA’    =>    ‘Georgia’,
‘HI’    =>    ‘Hawaii’,
‘ID’    =>    ‘Idaho’,
‘IL’    =>    ‘Illinois’,
‘IN’    =>    ‘Indiana’,
‘IA’    =>    ‘Iowa’,
‘KS’    =>    ‘Kansas’,
‘KY’    =>    ‘Kentucky’,
‘LA’    =>    ‘Louisiana’,
‘ME’    =>    ‘Maine’,
‘MD’    =>    ‘Maryland’,
‘MA’    =>    ‘Massachusetts’,
‘MI’    =>    ‘Michigan’,
‘MN’    =>    ‘Minnesota’,
‘MS’    =>    ‘Mississippi’,
‘MO’    =>    ‘Missouri’,
‘MT’    =>    ‘Montana’,
‘NE’    =>    ‘Nebraska’,
‘NV’    =>    ‘Nevada’,
‘NH’    =>    ‘New Hampshire’,
‘NJ’    =>    ‘New Jersey’,
‘NM’    =>    ‘New Mexico’,
‘NY’    =>    ‘New York’,
‘NC’    =>    ‘North Carolina’,
‘ND’    =>    ‘North Dakota’,
‘OH’    =>    ‘Ohio’,
‘OK’    =>    ‘Oklahoma’,
‘OR’    =>    ‘Oregon’,
‘PA’    =>    ‘Pennsylvania’,
‘RI’    =>    ‘Rhode Island’,
‘SC’    =>    ‘South Carolina’,
‘SD’    =>    ‘South Dakota’,
‘TN’    =>    ‘Tennessee’,
‘TX’    =>    ‘Texas’,
‘UT’    =>    ‘Utah’,
‘VT’    =>    ‘Vermont’,
‘VA’    =>    ‘Virginia’,
‘WA’    =>    ‘Washington’,
‘WV’    =>    ‘West Virginia’,
‘WI’    =>    ‘Wisconsin’,
‘WY’    =>    ‘Wyoming’
);

$countries = array(

‘us’ =>’United States’,
‘af’ =>’Afghanistan’,
‘al’ =>’Albania’,
‘dz’ =>’Algeria’,
‘as’ =>’American Samoa’,
‘ad’ =>’Andorra’,
‘ao’ =>’Angola’,
‘ai’ =>’Anguilla’,
‘aq’ =>’Antarctica’,
‘ag’ =>’Antigua and Barbuda’,
‘ar’ =>’Argentina’,
‘am’ =>’Armenia’,
‘aw’ =>’Aruba’,
‘ac’ =>’Ascension Island’,
‘au’ =>’Australia’,
‘at’ =>’Austria’,
‘az’ =>’Azerbaijan’,
‘bs’ =>’Bahamas’,
‘bh’ =>’Bahrain’,
‘bd’ =>’Bangladesh’,
‘bb’ =>’Barbados’,
‘by’ =>’Belarus’,
‘be’ =>’Belgium’,
‘bz’ =>’Belize’,
‘bj’ =>’Benin’,
‘bm’ =>’Bermuda’,
‘bt’ =>’Bhutan’,
‘bo’ =>’Bolivia’,
‘ba’ =>’Bosnia and Herzegovina’,
‘bw’ =>’Botswana’,
‘bv’ =>’Bouvet Island’,
‘br’ =>’Brazil’,
‘io’ =>’British Indian Ocean Territory’,
‘bn’ =>’Brunei Darussalam’,
‘bg’ =>’Bulgaria’,
‘bf’ =>’Burkina Faso’,
‘bi’ =>’Burundi’,
‘kh’ =>’Cambodia’,
‘cm’ =>’Cameroon’,
‘ca’ =>’Canada’,
‘cv’ =>’Cap Verde’,
‘ky’ =>’Cayman Islands’,
‘cf’ =>’Central African Republic’,
‘td’ =>’Chad’,
‘cl’ =>’Chile’,
‘cn’ =>’China’,
‘cx’ =>’Christmas Island’,
‘cc’ =>’Cocos (Keeling) Islands’,
‘co’ =>’Colombia’,
‘km’ =>’Comoros’,
‘cd’ =>’Congo, Democratic Republic of the’,
‘cg’ =>’Congo, Republic of’,
‘ck’ =>’Cook Islands’,
‘cr’ =>’Costa Rica’,
‘hr’ =>’Croatia/Hrvatska’,
‘cu’ =>’Cuba’,
‘cy’ =>’Cyprus’,
‘cz’ =>’Czech Republic’,
‘dk’ =>’Denmark’,
‘dj’ =>’Djibouti’,
‘dm’ =>’Dominica’,
‘do’ =>’Dominican Republic’,
‘tp’ =>’East Timor’,
‘ec’ =>’Ecuador’,
‘eg’ =>’Egypt’,
‘sv’ =>’El Salvador’,
‘gq’ =>’Equatorial Guinea’,
‘er’ =>’Eritrea’,
‘ee’ =>’Estonia’,
‘et’ =>’Ethiopia’,
‘fk’ =>’Falkland Islands (Malvina)’,
‘fo’ =>’Faroe Islands’,
‘fj’ =>’Fiji’,
‘fi’ =>’Finland’,
‘fr’ =>’France’,
‘gf’ =>’French Guiana’,
‘pf’ =>’French Polynesia’,
‘tf’ =>’French Southern Territories’,
‘ga’ =>’Gabon’,
‘gm’ =>’Gambia’,
‘ge’ =>’Georgia’,
‘de’ =>’Germany’,
‘gh’ =>’Ghana’,
‘gi’ =>’Gibraltar’,
‘gr’ =>’Greece’,
‘gl’ =>’Greenland’,
‘gd’ =>’Grenada’,
‘gp’ =>’Guadeloupe’,
‘gu’ =>’Guam’,
‘gt’ =>’Guatemala’,
‘gg’ =>’Guernsey’,
‘gn’ =>’Guinea’,
‘gw’ =>’Guinea-Bissau’,
‘gy’ =>’Guyana’,
‘ht’ =>’Haiti’,
‘hm’ =>’Heard and McDonald Islands’,
‘va’ =>’Holy See (City Vatican State)’,
‘hn’ =>’Honduras’,
‘hk’ =>’Hong Kong’,
‘hu’ =>’Hungary’,
‘is’ =>’Iceland’,
‘in’ =>’India’,
‘id’ =>’Indonesia’,
‘ir’ =>’Iran (Islamic Republic of)’,
‘iq’ =>’Iraq’,
‘ie’ =>’Ireland’,
‘im’ =>’Isle of Man’,
‘il’ =>’Israel’,
‘it’ =>’Italy’,
‘jm’ =>’Jamaica’,
‘jp’ =>’Japan’,
‘je’ =>’Jersey’,
‘jo’ =>’Jordan’,
‘kz’ =>’Kazakhstan’,
‘ke’ =>’Kenya’,
‘ki’ =>’Kiribati’,
‘kp’ =>’Korea, Democratic People\’s Republic’,
‘kr’ =>’Korea, Republic of’,
‘kw’ =>’Kuwait’,
‘kg’ =>’Kyrgyzstan’,
‘la’ =>’Lao People\’s Democratic Republic’,
‘lv’ =>’Latvia’,
‘lb’ =>’Lebanon’,
‘ls’ =>’Lesotho’,
‘lr’ =>’Liberia’,
‘ly’ =>’Libyan Arab Jamahiriya’,
‘li’ =>’Liechtenstein’,
‘lt’ =>’Lithuania’,
‘lu’ =>’Luxembourg’,
‘mo’ =>’Macau’,
‘mk’ =>’Macedonia, Former Yugoslav Republic’,
‘mg’ =>’Madagascar’,
‘mw’ =>’Malawi’,
‘my’ =>’Malaysia’,
‘mv’ =>’Maldives’,
‘ml’ =>’Mali’,
‘mt’ =>’Malta’,
‘mh’ =>’Marshall Islands’,
‘mq’ =>’Martinique’,
‘mr’ =>’Mauritania’,
‘mu’ =>’Mauritius’,
‘yt’ =>’Mayotte’,
‘mx’ =>’Mexico’,
‘fm’ =>’Micronesia, Federal State of’,
‘md’ =>’Moldova, Republic of’,
‘mc’ =>’Monaco’,
‘mn’ =>’Mongolia’,
‘ms’ =>’Montserrat’,
‘ma’ =>’Morocco’,
‘mz’ =>’Mozambique’,
‘mm’ =>’Myanmar’,
‘na’ =>’Namibia’,
‘nr’ =>’Nauru’,
‘np’ =>’Nepal’,
‘nl’ =>’Netherlands’,
‘an’ =>’Netherlands Antilles’,
‘nc’ =>’New Caledonia’,
‘nz’ =>’New Zealand’,
‘ni’ =>’Nicaragua’,
‘ne’ =>’Niger’,
‘ng’ =>’Nigeria’,
‘nu’ =>’Niue’,
‘nf’ =>’Norfolk Island’,
‘mp’ =>’Northern Mariana Islands’,
‘no’ =>’Norway’,
‘om’ =>’Oman’,
‘pk’ =>’Pakistan’,
‘pw’ =>’Palau’,
‘ps’ =>’Palestinian Territories’,
‘pa’ =>’Panama’,
‘pg’ =>’Papua New Guinea’,
‘py’ =>’Paraguay’,
‘pe’ =>’Peru’,
‘ph’ =>’Philippines’,
‘pn’ =>’Pitcairn Island’,
‘pl’ =>’Poland’,
‘pt’ =>’Portugal’,
‘pr’ =>’Puerto Rico’,
‘qa’ =>’Qatar’,
‘re’ =>’Reunion Island’,
‘ro’ =>’Romania’,
‘ru’ =>’Russian Federation’,
‘rw’ =>’Rwanda’,
‘kn’ =>’Saint Kitts and Nevis’,
‘lc’ =>’Saint Lucia’,
‘vc’ =>’Saint Vincent and the Grenadines’,
‘sm’ =>’San Marino’,
‘st’ =>’Sao Tome and Principe’,
‘sa’ =>’Saudi Arabia’,
‘sn’ =>’Senegal’,
‘sc’ =>’Seychelles’,
‘sl’ =>’Sierra Leone’,
‘sg’ =>’Singapore’,
‘sk’ =>’Slovak Republic’,
‘si’ =>’Slovenia’,
‘sb’ =>’Solomon Islands’,
‘so’ =>’Somalia’,
‘za’ =>’South Africa’,
‘gs’ =>’South Georgia and the South Sandwich Islands’,
‘es’ =>’Spain’,
‘lk’ =>’Sri Lanka’,
‘sh’ =>’St. Helena’,
‘pm’ =>’St. Pierre and Miquelon’,
‘sd’ =>’Sudan’,
‘sr’ =>’Suriname’,
‘sj’ =>’Svalbard and Jan Mayen Islands’,
‘sz’ =>’Swaziland’,
‘se’ =>’Sweden’,
‘ch’ =>’Switzerland’,
‘sy’ =>’Syrian Arab Republic’,
‘tw’ =>’Taiwan’,
‘tj’ =>’Tajikistan’,
‘tz’ =>’Tanzania’,
‘th’ =>’Thailand’,
‘tg’ =>’Togo’,
‘tk’ =>’Tokelau’,
‘to’ =>’Tonga’,
‘tt’ =>’Trinidad and Tobago’,
‘tn’ =>’Tunisia’,
‘tr’ =>’Turkey’,
‘tm’ =>’Turkmenistan’,
‘tc’ =>’Turks and Caicos Islands’,
‘tv’ =>’Tuvalu’,
‘um’ =>’US Minor Outlying Islands’,
‘ug’ =>’Uganda’,
‘ua’ =>’Ukraine’,
‘ae’ =>’United Arab Emirates’,
‘uk’ =>’United Kingdom’,
‘uy’ =>’Uruguay’,
‘uz’ =>’Uzbekistan’,
‘vu’ =>’Vanuatu’,
‘ve’ =>’Venezuela’,
‘vn’ =>’Vietnam’,
‘vg’ =>’Virgin Islands (British)’,
‘vi’ =>’Virgin Islands (USA)’,
‘wf’ =>’Wallis and Futuna Islands’,
‘eh’ =>’Western Sahara’,
‘ws’ =>’Western Samoa’,
‘ye’ =>’Yemen’,
‘yu’ =>’Yugoslavia’,
‘zm’ =>’Zambia’,
‘zw’ =>’Zimbabwe’
);

Java Tutorial

Below is a link to a brief and short Java Tutorial

http://www.tutorialspoint.com/java/java_quick_guide.htm

MySQL optimization – 2

[client]
#password       = your_password
port            = 3306
socket          = /var/lib/mysql/mysql.sock

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
port=3306
#skip-networking
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
skip-locking
key_buffer = 128M
max_allowed_packet = 256M
table_cache =  512
sort_buffer_size = 512M
net_buffer_length = 8K
read_buffer_size = 1M
read_rnd_buffer_size = 256M
myisam_sort_buffer_size = 512M
query_cache_size= 512M
log-slow-queries = /var/log/mysqlslow.log
long_query_time = 5
max_connections = 500

##Inno DB
innodb_data_home_dir = /var/lib/mysql/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /var/lib/mysql
innodb_log_arch_dir = /var/lib/mysql
innodb_file_per_table
# You can set .._buffer_pool_size up to 50 – 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 1G
innodb_additional_mem_pool_size = 24M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 64M
innodb_log_buffer_size = 8M
# Write to log but don’t flush on commit (it will be flushed every “second”)
innodb_flush_log_at_trx_commit = 2
innodb_lock_wait_timeout = 50
innodb_support_xa = 1
# innodb_doublewrite
innodb_fast_shutdown = 1

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# required unique id between 1 and 2^32 – 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id=1217616777

# Replication Slave (comment out master section to use this)
#master-host=<hostname>
#master-user=<username>
#master-password=<password>
#master-port=<port>

# Point the following paths to different dedicated disks
#tmpdir         = /tmp/
#log-update     = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 64M
#bdb_max_lock = 100000

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

Speeding up Web sites

  • Minimize http requests: due to the latency and RTT (round trip time), high number of HTTP request increases page loading times. Several There are techniques and ways to reduce the HTTP requests made to a site, such as CSS Sprites, Combining and compressing JavaScript files.
  • Use a CDN (Content delivery network). CDN allows users to download static media files much faster. Simply using a CDN increases the speed of you website.
  • Add an expires or a Cache-Control Header, cache items.
  • Gzip Components, use compression.
  • Compress, minify stylesheets and javascripts
  • Put stylesheets at the top of the page
  • put the scripts at the bottom of the page.
  • Make JavaScript and CSS in external files.
  • Use Image Sprites.
  • Reduce DNS lookup due to network delay, latency
  • Avoid redirects
  • Cache your pages
  • Minimize, avoid IFrames,
  • Reduce Cookie Size
  • Use Cookie free domains for static files
  • Minimize DOM access

More to read on :

http://developer.yahoo.com/performance/rules.html