how to add snow to a photo in photoshop

Here in this article, we will show you, how to add snow to a photo in photoshop. we given some very simple steps with shortcuts and screenshots.

how to add snow to a photo in photoshop

This very easy tutorial will tell you how you can add snow to your photo. I’m using a city at night photo.

Step 1: Open your file (file>open or ctrl+o)

how to add snow to a photo in photoshop
how to add snow to a photo in photoshop

Step 2: Create a new layer (layer>new>layer or shift+ctrl+N)


Step 3: Change the layer mode to screen

Step 4: Filling the layer with black by changing the foreground layer into black, and click on layer2 in your layer pallete, and press Alt +Backspace

Step 5: Apply the graphic pen filter (filter>sketch>graphic pen), below is my setting. You can experiment with stroke pen & light/dark balance to get the best result.

Step 6: Apply the gaussian blur filter (filter>blur>gaussian blur), I put 1.5 pixel radius, but again..you can play around with it to get the best result.

Step 7: Now lower the opacity to around 70%, and you’re done!

Final output will be like this.

how detect ie7 or ie8 with php and every language

In daily development we face lot of cross browser issues and sometimes conditional css will never work as excepted. We can detect I7 and I8 browser using every language. Using PHP language I need to use the browser So I written following code.

How to detect ie7 or ie8 with php

We can detect ie7 or ie8 with php and every language. Using PHP language I need to use browser So I written code snippet which is useful for PHP developer.

In this article I will show how to detect IE browser and IE 7 and IE8 using php language.

Following function you can use for detecting the IE browsers.


function detect_ie($navigator_user_agent)
{
 if (stristr($navigator_user_agent, "MSIE"))
 {
 return true;
 } else return false;
}

detect_ie($_SERVER['HTTP_USER_AGENT']);

//detect IE7 browser

function detect_ie7($navigator_user_agent)
{
 if (stristr($navigator_user_agent, "msie 7"))
 {
 return true;
 } else return false;
}

detect_ie7($_SERVER['HTTP_USER_AGENT']);

function detect_ie8($navigator_user_agent)
 {
 if (stristr($navigator_user_agent, "msie 7"))
 {
 return true;
 } else return false;
 }

detect_ie8($_SERVER['HTTP_USER_AGENT']);

How to detect ie7 or ie8 with php
How to detect ie7 or ie8 with php

Solved forgot password is not working with drupal

If your website created in drupal cms the you click on forgot password link. you got the email from your website to reset the password.

When I used drupal functionality I got weird issue with durpal cms. I got the email from website but when I tried to login with url. We solved forgot password is not working with drupal issue.

Solved forgot password is not working with drupal

the email notification doesn’t work for me at all. I did google around for this issue but did not get any solution for this issue.

Then I tired to solve this issue my own and I found the hack to solve this issue.

Go to your drupal installation and open “user.pages.inc” file from following location

Solved forgot password is not working with drupal
Solved forgot password is not working with drupal

File : modules/user/user.pages.inc

Find function called  “user_pass_reset()” in file. You need to modify that function.

Put the following line :
$action = ‘login’;
before if ($action == ‘login’)  line. This code will solve the forgot password and authentication with url issue.

If you want more drupal tutorials than visit here

How to take mysql backup from file system

This method or trick is important when your database crash and you are not able connect to database. Still your will be able to take mysql backup from file system. Many times we fail to restore the mysql dump from command line.

How to take mysql backup from file system

If your mysql server crash. Follow my steps to take mysql backup from file system without database connection.

First go to your filesystem.
Here I am using the fedora OS for this example

In linux go to /var/lib/mysql path

In that folder each folder means separate database.

Copy that all folders to your local machine.
again go to your mysql local installation and paste that folder into your mysql folder.

For in each database folder file you will find following types of files in the folder
db.opt
test.frm
test.MYD
test.MYI

just copy and paste in your system

how to change wordpress post order category wise

When we need to re-arrange my recent post in wordpress. they go Ascending/Descending order category wise. Code for change wordpress post order category wise. We can easily achieve this using wordpress api.

how to change wordpress post order category wise

how to change wordpress post order category wise
how to change wordpress post order category wise

use following code:


<!--?php

//The Query
query_posts('cat=1,3,3&posts_per_page=15&order=ASC');

//The Loop
if ( have_posts() ) : while ( have_posts() ) : the_post();
 ..
endwhile; else:
 ..
endif;

?-->

wordpress 3.0 documentation for wordpress developers

We all know wordpress 3.0 beta is out and wordpress 3.0 will be out in May 2010. You can find the list of many of the enhancements and fixes.

wordpress 3.0 documentation for wordpress developers

wordpress 3.0 documentation for wordpress developers
wordpress 3.0 documentation for wordpress developers

All wordpress developers are looking for wordpress 3.0 documentation for development.

The WordPress 3.0 Codex is very good place to start working on wordpress 3.0

http://codex.wordpress.org/Version_3.0

Here I am giving the list of major changes of wordpress 3.0

* New menu management feature
* Improved custom post types (try the Custom Post Type UI plugin to see the possibilities)
* Improved custom taxonomies including hierarchical (category-style) support (again, try the Custom Post Type UI plugin to see the possibilities)
* New theme “Twenty Ten” is the only theme in the WordPress distribution, and is now designated the ‘fallback’ theme
* Improved child theme support; child theme use is highly encouraged and as described in the Child Themes article, very simple to accomplish
* The Default (Kubrick), and Classic themes, are no longer included in the WordPress distribution, but are available in the Theme repository
* Bulk theme update ability
* Standalone WordPress and WPMU code merged (Note: extra domain stuff remains plugin territory for this version)
* Configure a Network (multisite/WPMU) using wp-config.php file

how to create multi level unique id in mysql

Multi level unique is very important feature in mysql. This feature is present all databases. Using composite unique key we can achieve multilevel uniqueness. In article for create multi level unique id in mysql. Using this composite unique key we can achieve multilevel uniqueness.

create multi level unique id in mysql

create multi level unique id in mysql
create multi level unique id in mysql

Here I am going to give you how to create the composite unique key in mysql.

mysql> alter table `user` add unique `DATE_uuid` (`date`, `uuid`)

how to check indexes on table
mysql> show index from user;
+—————-+————+————+————–+————-+———–+————-+———-+——–+——+————+———+
| Table          | Non_unique | Key_name   | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+—————-+————+————+————–+————-+———–+————-+———-+——–+——+————+———+
| user |          0 | PRIMARY    |            1 | user_id         | A         |           0 |     NULL | NULL   |      | BTREE      |         |
| user |          0 | DATE_uuid |            1 | date        | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| user |          0 | DATE_uuid |            2 | uuid       | A         |           0 |     NULL | NULL   |      | BTREE      |         |
+—————-+————+————+————–+————-+———–+————-+———-+——–+——+————+———+
3 rows in set (0.01 sec)

mysql>

how to install php-pear on centos or redhat

centos is linux based operating system which is used for server purpose. in this article I given the detailed information about, install php-pear on centos or rehat os.

For this example I used the RHEL 5.3 edition. If server is new then use follwoing commands to keep server up to date.
When I tried to install php-pear lib in server I am not able to install all the pear libs. Then I Used following commands for installing the php-pear fully.

install php-pear on centos

# yum update
# up2date -u
# yum install lighttpd-fastcgi php-cli php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mapserver php-mbstring php-mcrypt php-mhash php-mssql php-shout php-snmp php-soap php-tidy php-pear php-devel httpd-devel mysql-server mysql-devel

The 2 RPMs which we need are:
epel-release and remi-release

# wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
# rpm -Uvh epel-release-5-3.noarch.rpm

# wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
# rpm -Uvh remi-release-5.rpm

# yum install php-pear*

# /sbin/service httpd start
# /sbin/service mysqld start

# php -v

install php-pear on centos
install php-pear on centos

find duplicate values in an array using php

Many times we need to find duplicate values in an array using php. Using php language this is very easy. For checking the duplicate array value array_unique function is very useful.

There too many array and string functions available in php. PHP itself gives very useful methods for finding the duplicate values from array element.

There are multiple ways to find the duplicate strings. you can use loop and strpos method but using following code snippet, it is very easy to find the duplicate values from an array.

find duplicate values in an array using php

find duplicate values in an array using php
find duplicate values in an array using php

Here I am giving you very simple php example:


<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
 $array1 = array("banana","apple","pear","banana");

 if (count(array_unique($array1)) < count($array1))
 echo 'Duplicate entry found in array';
 else
 echo 'No Duplicate values found in array';
 ?>

Output:  Duplicate entry found in array

php check if file exists if not create

Many times we got requirement of check file from specific directory. PHP tutorial for, php check if file exists if not create. Following code will work in all the system like (Mac, Linux and Windows). we given code snippet for checking file exists or not.

php check if file exists if not create
php check if file exists if not create

Using following php code you can check file is present or not in specific directory.


<?php
 $filename = '/var/www/html/test/test.txt';

 if (file_exists($filename)) {
 echo "The file $filename exists";
 } else {
 echo "The file $filename does not exist";
 }

?>