Archive for July, 2012
asp.net performance monitoring / debuging
Posted by allenkwc in .net, Technology on July 26, 2012
Performance Analysis of Logs (PAL) Tool
Analysis Performance Monitor Data
Debug Diagnostic Tool v1.2
http://www.microsoft.com/en-us/download/details.aspx?id=26798
Network Monitoring
http://www.microsoft.com/en-us/download/details.aspx?id=4865
Download and Install Debugging Tools for
Windows
http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx
Steps to Deploy WordPress From Localhost To Your Web Server
- Export your DB from the localhost using phpMyAdmin as a .zip
- Extract the zip locally somewhere for editing
- Open the .sql file in jEdit (or equivalent UTF-8 capable editor) and do a string search for localhost
- Find the string you need to replace, usually http://localhost/your-site depending on how you’ve setup your local server.
- Do a global string replace using the replacement string you found and replace it with your new domain, something like http://your-domain.com
- Save in UTF-8 format. You might want to save as a new file just in case you need to revert.
- Using phpMyAdmin on your destination web server create a database and import the new .sql file. With some cPanel hosts like Bluehost it’s easier to create using cPanel’s tools then edit in phpMyAdmin for importing the file. If all is okay you should now have your database setup.
- Using FileZilla (or equivalent FTP program) upload your website’s files to the web server.
- While the upload is happening, it’s time to create the wp-config.php file for your production instance, make a copy of the existing wp-config.php file in your WP root directory.
- Open and change the database value to the name of your web server’s database for your site. Also, change the username and password for the database as required.
- Save this as wp-config.production.php and upload to your web server.
- Once all uploading is complete, using FileZilla rename the existing wp-config.php file on your web server to wp-config.development.php and also rename wp-config.production.php to wp-config.php. Your new config file is now in effect.
- Before you get all happy and try to visit your website you need to login to the WordPress admin and navigate to the Permalink settings. Once there just click the save button (don’t change anything, just re-save it). This resets the permalinks to your new URLs so the links to pages and posts will work throughout your site.
http://www.codemyownroad.com/13-steps-to-deploy-wordpress-from-your-localhost-to-a-live-web-server/
- Make sure that jQuery library loads before the other (non jQuery) libraries.
- Insert the jQuery.noConflict(); after the main jQuery library is loaded, but before the other (non jQuery) libraries. In my case, when I viewed the source code of my WP pages, the jQuery.noConflict() was already loaded, so I didn’t have to do it manually. But, the mootools libraries of the FCG plugin were loaded before the jQuery.noConflict(); and we need to move it below. In order to achieve that:
- I placed the following function, in the functions.php of my theme, to remove the FCG JS libraries from loading the way they were originally programmed:
function remove_featured_gallery_scripts() { remove_action('wp_head', 'gallery_styles'); } add_action('init','remove_featured_gallery_scripts', 1);
- Then I added this function to load the FCG JS scripts last in general script loading order:
function addscripts_featured_gallery() { if(!function_exists(gallery_styles)) return; gallery_styles(); } add_action('wp_head', 'addscripts_featured_gallery', 12);
- Make sure that after inserting those function you clear your browser’s cache and refresh you page.
- Again, the order of our JS libraries should be the following:
- jQuery.
- jQuery.noConflict(); function.
- All other JS scripts and libraries including non-jQuery ones.
- I placed the following function, in the functions.php of my theme, to remove the FCG JS libraries from loading the way they were originally programmed:
WordPress
in theme’s functions.php
add the following php code
add_theme_support(post-thumbnails’);
Making WordPress as Web Site
1. Make a tailor made template
Template: http://codex.wordpress.org/Stepping_Into_Templates
Following is the code for index.php or page.php, which is the empty theme for every page…
<!--?php get_header(); ?--></pre> <div id="head_content"></div> <pre> <!--?php while ( have_posts() ) : the_post() ?--> <!--?php the_content(); ?--> <!--?php endwhile; ?--> <!--?php get_footer(); ?-->
WordPress looks for several Page template files in your active WordPress Theme based upon the Template Hierarchy. The first one it finds will be used to display any given Page. WordPress will look for files in the following order:
- The Page’s selected “Page Template”
- page.php
- index.php
The WordPress Template Hierarchy also recognized specific Pages or posts automatically without the need to assign them to a specific Page template file. If the Page with ID or slug in the template file name is automatically generated by the user, the appropriate Page template file is used.
- page-{id}.php
- page-{slug}.php
If the Page ID number is 42, the page-42.php template file is automatically used. If the Page slug is “About,” the page-about.php template file is used.
2. Using Permalink: http://codex.wordpress.org/Using_Permalinks
Need to enable apache mod_rewrite !!