control keymgr.dll
Monday, 7 October 2013
Monday, 30 September 2013
Remove error or virus home page from chrome
C:\Users\KMT\AppData\Local\Google\Chrome\User Data\Default
Thursday, 22 August 2013
Tuesday, 2 July 2013
Connect MySql with Java and eclipse
Download and install the eclipse, java and Mysql
Open eclipse
File-->New-->Class
give the class name as JDBCExample
then copy the follwing code
package testPkg;
import java.sql.*;
//import com.mysql.jdbc.Driver;
public class JDBCExample {
public static void main(String[] args) throws ClassNotFoundException,
SQLException {
String username = "root";
String password = "root";
String tablename = "login";
String fieldname = "uname";
String query = "SELECT " + fieldname + " FROM " + tablename + ";";
/* this chunk of code can appear more or less verbatim */
String url = "jdbc:mysql://localhost:3306/database";
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection(url, username, password);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
System.out.println("The contents of field " + fieldname + ":");
while (rs.next())
System.out.print(rs.getString(1) + ", ");
// note that getString anomalously starts counting at 1, not 0
System.out.println();
rs.close();
stmt.close();
con.close();
}
}
It will show the error that com.mysql.jdbc.Driver not found.
To resolve this issue use the following step.
right Click on project-->Build Path-->Use external Archives-->then path that mysql-connector-java-5.1.25-bin File
Then Execute the code.
Friday, 17 May 2013
Wednesday, 15 May 2013
Thursday, 9 May 2013
Wednesday, 8 May 2013
Tuesday, 30 April 2013
Thursday, 25 April 2013
Thursday, 18 April 2013
Tuesday, 16 April 2013
Tuesday, 2 April 2013
How to Create Thumbnail Images using PHP
How to Create Thumbnail Images using PHP
<?php
function createThumbs( $pathToImages, $pathToThumbs, $thumbWidth )
{
// open the directory
$dir = opendir( $pathToImages );
// loop through it, looking for any/all JPG files:
while (false !== ($fname = readdir( $dir ))) {
// parse path for the extension
$info = pathinfo($pathToImages . $fname);
// continue only if this is a JPEG image
if ( strtolower($info['extension']) == 'jpg' )
{
echo "Creating thumbnail for {$fname} <br />";
// load image and get image size
$img = imagecreatefromjpeg( "{$pathToImages}{$fname}" );
$width = imagesx( $img );
$height = imagesy( $img );
// calculate thumbnail size
$new_width = $thumbWidth;
$new_height = floor( $height * ( $thumbWidth / $width ) );
// create a new temporary image
$tmp_img = imagecreatetruecolor( $new_width, $new_height );
// copy and resize old image into new image
imagecopyresized( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height );
// save thumbnail into a file
imagejpeg( $tmp_img, "{$pathToThumbs}{$fname}" );
}
}
// close the directory
closedir( $dir );
}
// call createThumb function and pass to it as parameters the path
// to the directory that contains images, the path to the directory
// in which thumbnails will be placed and the thumbnail's width.
// We are assuming that the path will be a relative path working
// both in the filesystem, and through the web for links
createThumbs("upload/","upload/thumbs/",100);
?>
<?php
function createThumbs( $pathToImages, $pathToThumbs, $thumbWidth )
{
// open the directory
$dir = opendir( $pathToImages );
// loop through it, looking for any/all JPG files:
while (false !== ($fname = readdir( $dir ))) {
// parse path for the extension
$info = pathinfo($pathToImages . $fname);
// continue only if this is a JPEG image
if ( strtolower($info['extension']) == 'jpg' )
{
echo "Creating thumbnail for {$fname} <br />";
// load image and get image size
$img = imagecreatefromjpeg( "{$pathToImages}{$fname}" );
$width = imagesx( $img );
$height = imagesy( $img );
// calculate thumbnail size
$new_width = $thumbWidth;
$new_height = floor( $height * ( $thumbWidth / $width ) );
// create a new temporary image
$tmp_img = imagecreatetruecolor( $new_width, $new_height );
// copy and resize old image into new image
imagecopyresized( $tmp_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height );
// save thumbnail into a file
imagejpeg( $tmp_img, "{$pathToThumbs}{$fname}" );
}
}
// close the directory
closedir( $dir );
}
// call createThumb function and pass to it as parameters the path
// to the directory that contains images, the path to the directory
// in which thumbnails will be placed and the thumbnail's width.
// We are assuming that the path will be a relative path working
// both in the filesystem, and through the web for links
createThumbs("upload/","upload/thumbs/",100);
?>
Monday, 1 April 2013
Thursday, 21 March 2013
Wednesday, 20 March 2013
Tuesday, 19 March 2013
Thursday, 7 March 2013
Wednesday, 6 March 2013
Wednesday, 27 February 2013
Friday, 22 February 2013
Thursday, 21 February 2013
Monday, 18 February 2013
Friday, 15 February 2013
Friday, 8 February 2013
Thursday, 7 February 2013
Tuesday, 5 February 2013
Sunday, 3 February 2013
Saturday, 2 February 2013
Monday, 28 January 2013
Sunday, 27 January 2013
Monday, 21 January 2013
Sunday, 20 January 2013
Saturday, 19 January 2013
Thursday, 17 January 2013
Wednesday, 16 January 2013
Monday, 14 January 2013
Sunday, 13 January 2013
Friday, 11 January 2013
How to Import the Mysql 5.5.8 Version Dump to Mysql 5.5.29
C:\Program Files\MySQL\MySQL Server 5.5\bin> mysql -u root -p<pass> <databse> < D:\<dump>.sql
Wednesday, 9 January 2013
Tuesday, 8 January 2013
Monday, 7 January 2013
Example syntax for Secure Copy (scp)
Example syntax for Secure Copy (scp)
Copy the file "foobar.txt" from a remote host to the local host
| $ scp your_username@remotehost.edu:foobar.txt /some/local/directory |
Subscribe to:
Comments (Atom)


