Wednesday, June 30, 2010

Get current page URL along with SSL protocal and port number In PHP

Hi, Below code will get the current page URL along with SSL protocal and port number

function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
echo curPageURL();
?>

Search features in eclipse editor

Simple search and replace
Ctrl + F

Advanced search and replace
Ctrl + H

When you press Ctrl + H then search window will open in eclipse editor

Containing text: which text do you want to find. Ex: if you don't know some function was defined, then simply you can search for function funname(

File name patterns
*.php will search in all php files
*.* will search win all files

Scope
Workspace OR Enclosing Projects
Workspace means search in all projects
Enclosing Projects means search in current working project

Phonegap - an opensource framework for developing iphone and other applications

Phonegap is an open source framework for developing different mobile applications. By using HTML, CSS and Javascript we can create appliations with core features of iPhone, Ipad, Android, Palm, Symbian, Blackberry etc.,,

Sample code
http://github.com/sintaxi/phonegap

Official website
http://www.phonegap.com/

Tuesday, June 29, 2010

Open new tab in browser using js

//open new tab with blank address
window.open('', '_blank', 'toolbar=0,location=0,menubar=0');

//open new tab with url
window.open('http://www.google.com', '_blank', 'toolbar=0,location=0,menubar=0');

Sunday, June 27, 2010

Wordpress plugin development

Hi Friends,

Here is very good information provided for wp plugin developement, it explained in a very easy way.

http://www.problogdesign.com/wordpress/a-novice-guide-to-wordpress-plugin-development/

Thursday, June 24, 2010

Visual way to provide feedback and ask your employee to do necessary changes

Visual way to provide feedback and ask your employee to do necessary changes either on design or content of the webpage. To get started sign up at http://www.notableapp.com/

Jquery selectors reference for beginners

Hi Friends,

Jquery selectors are used to apply effects for all elements or some or group of elements by using classes or IDs and tag names.

Ex: $(‘#id’); This selector selects an element with the given ID.
$(‘.class’) The class selector will gather all elements in the document with the given class name
:first $(‘ul li:first’); Returns the first element in a result set


You can see the complete information at below url.
http://www.pamaya.com/jquery-selectors-and-attribute-selectors-reference-and-examples/

Wednesday, June 23, 2010

Tricky interview questions revealed by yahoo

When it comes to appearing for a job interview, we all prepare ourselves by finding out about our potential employers, but at times we are asked an off-the-wall question that leaves us stumped.

In order to help us prepare for such questions, Glassdoor.com, a two-year-old Sausalito, Calif. website that bills itself as "the TripAdvisor for careers", compiled a list of some of the top oddball interview questions.

Glassdoor gets its information directly from employees who work at 84,000 companies, reports ABC News.

According to Rusty Rueff, a consultant at Glassdoor, who is the author of Talent Force: A New Manifesto for the Human Side of Business and former head of human resources said ninety percent of people don't know how to deal with them.

Rueff advises, first you have to realize that the interviewer isn't trying to make you look stupid, as stupid as the question may seem.

With a question like "How many hair salons are there in Japan", the interviewer is giving you an opportunity to demonstrate your thought processes.

Rueff says you should think out loud, like the contestants on Who Wants to be a Millionaire? You might start by saying, we'd have to know the population of Japan, and then we'd have to figure out what percentage of them get their hair done and how often.

Rueff says it's fine to pull out a pen and paper and start doing some calculations right there in the interview.nother example, which may seem equally impossible to answer: Why are manhole covers round?

Just start thinking through the question, out loud, Connie Thanasoulis-Cerrachio, a career services consultant at Vault.com advises.

"I would say, a round manhole cover could keep the framework of the tunnel stronger, because a round frame is much stronger than a square frame," she suggested.

Other weird-seeming questions, like "If you were a brick in a wall, which brick would you be and why," or "If you could be any animal, what would you be and why," are really just invitations to show a side of your personality.

Thanasoulis-Cerrachio says a friend who is chief executive of a market research company used to ask applicants what kind of car they would be.

"She wanted someone fast, who thought quickly. She wanted someone who wanted to be a Maserati, not a Bentley," Thanasoulis-Cerrachio said.

For the brick question, Thanasoulis-Cerrachio advises saying something like, "I would want to be a foundational brick because I'm a solid person. You can build on my experience and I will never let you down." (ANI)

Thursday, June 17, 2010

Move Wordpress to another host

Simple process to get work.

Wordpress application run in another host or another url.

Wordpress will configure all the paths in database only, ex: when you upload any image, its absolute path stored in database. And all content will reside in wp-content folder.

New host
1. First install new wordpress in new host

Old host
2. Take mysql backup from old site. or goto Tools -> Import in wp-admin.
This should be used later for running old application

Old host
3.
Login admin panel of old site, Goto settings -> General
change WordPress address (URL) and Blog address (URL) against new host and click "Save Changes"
Now the database will updated with new host urls.

4. Old host
Goto phpmyadmin and export the database or goto Tools -> Export in wp-admin.

5. Old host
Revert back the database with old one, i.e we took backup on step-2.

New host
6. Import the old application's database which we get from step 4.

New host
7. Copy the wp-content folder from old host and pasted it into new host.

Now, upon completion of these steps we can sucessfully run the same application in both the hosts.

( OR )

You can copy all the files from old server and pasted it in new server and follow below process.

wp-config.php is the main configuration file for database connections and others.

Edit wp-config.php file to suit with your database
//DB_USER etc.,

Open database goto wp_options table and change the below two rows

option_value='your-new-url' where option_name='site url' and
option_value='your-new-url' where option_name='home'.

If you didn't change this siteurl value in this table your site will connect to old site when you try to access admin panel.

After done, goto /wp-admin section through browser and enter admin details.
Then goto Settings -> General -> change urls.
Now site configured and worked properly in new server or localhost.

In database replace every occurance of http://oldserver/wp-content links with http://newserver/wp-content. So that image links are worked currectly.

Some settings are fixed in wp-settings.php file.


Complete Reference

http://www.dollarshower.com/move-wordpress-blog-to-another-host-server/

http://support.hostgator.com/articles/pre-sales-questions/how-to-transfer-your-wordpress-blog-from-one-host-to-another-host

http://www.makeuseof.com/tag/move-wordpress-blog-host/







Custom fields in wordpress
http://codex.wordpress.org/Using_Custom_Fields

Move Wordpress to another host

http://www.dollarshower.com/move-wordpress-blog-to-another-host-server/

http://support.hostgator.com/articles/pre-sales-questions/how-to-transfer-your-wordpress-blog-from-one-host-to-another-host

http://www.makeuseof.com/tag/move-wordpress-blog-host/



Bigdump used to import large databases
http://www.ozerov.de/bigdump.php