Rss Feed
Tweeter button
Facebook button
Linkedin button
2009
10.09

I actually download lots of stuff through torrents, and i know some basic of how torrents work. Torrents work in a fashion very much similar to local network’s file and printer sharing.

The first stage is creating a torrent. This must be done the first time by someone. Most Bit Torrent clients allow you to create a torrent. Basically you should gather all your files in one folder (preferable) and create a torrent file out of it. You must specify a tracker for the same. Once the .torrent file is created you can upload this .torrent file to any torrent masters such as mininove, piratebay, etc.

The next step is to load this torrent file in the torrent client (e.g. Vuze) and it starts seeding.

Anyone looking for the specific file (inside the torrent) or the torrent itself will hit the torrent site through google search and download the .torrent file. He/she will then load the torrent in the client and the torrent starts downloading – with you being the peer/seed and the other person being the peer/leach.

The contents of the torrent are divided into many pieces of equal size (256KB to 1 MB being most common). Any seeding or downlaoding is done piece by piece. The torrent tracker keeps track of what piece is owned by who. This way, piece by piece, the torrent contents are downloaded until all the pieces are with you. Once done, the torrent client automatically shifts the mode from ‘downloading’ to ’seeding’.

Some Basic terms of .torent files are like follwing when you download files

Leeches - People who download files but do not share files on their own computer with others

Seed or seeder - A computer with a complete copy of a BitTorrent file (At least one seed computer is necessary for a BitTorrent download to operate.)

2009
08.27

Page Peel Ads or Peel Away Ads are a non-distracting form of advertising. You have seen the corner ads that tempt you to peel them away to see what is underneath. Mostly websites like selling single software product or forums uses this.

First we check how it works.

Here’s How It Works.

The customer sees a small animated “peel” on the top right corner of a page.
image_1

Once he or she passes his mouse over it the Web site”Peels Away” to show the Ad.
image_2

Now here is code which i have taken from lots of website and modified it according to my need. This code works perfect in IE 6 & 7, Mozilla and Chrome. I have not tested other browsers.

I am not claiming that this code is purely mine and i have developed it totally but it was free and i did modification and put on this website for help of people who wants to make such type of advertisement on their website without paying a single penny.

First Download code from here

Unpacked Zip archive on your hard disk.

Create two image with size of 75×75 pixel and 500×500 pixel in .gif format.

Edit the file corner.js with a text editor. Change the URLs to the .swf files and the .gif images. For example, if you want to set up on http://www.my_site_name.com/, the URLs must point there.

Include corner.js file in html file after and before tag. If you add it before tag, it won’t work on Internet Explorer
example of code will be like

Here is once again explanation of which code to change in corner.js file


var jcorner987 = new Object();
jcorner987.ad_url = escape('Link');
jcorner987.small_path = 'http://www.my_site_name.com/small.swf';
jcorner987.small_image = escape('http://www.my_site_name.com/11.gif');
jcorner987.small_width = '100';
jcorner987.small_height = '100';
jcorner987.small_params = 'ico=' + jcorner987.small_image;
jcorner987.big_path = 'http://www.my_site_name.com/big.swf';
jcorner987.big_image = escape('http://www.my_site_name.com/1.gif');
jcorner987.big_width = '650';
jcorner987.big_height = '650';
jcorner987.big_params = 'big=' + jcorner987.big_image + '&ad_url=' + jcorner987.ad_url;

If you like my efforts and script, than a back link would be nice.

2009
08.04

Few days ago i get 15MB .sql file in which only one table was there with data. My task is to just import those data in database. Now i have phpMyAdmin but it can allow me 8MB of file. Even i do not have any other support on server. So now i have to write my code or find some code on internet. I tried but dont get any proper solution. so i decided to write my own code. I have used this code to import full databases also for testing.

Here is code


<?php

// file name to import
$sqlfile = 'myfile.sql';
$mysql_host = 'localhost';
$mysql_username = 'root';
$mysql_password = '';
$mysql_database = 'database_name';

mysql_connect($mysql_host, $mysql_username, $mysql_password);
mysql_select_db($mysql_database);

// define Temporary variable.
$temp = '';

// read file
$lines = file($sqlfile);

// get line by line loop from file
foreach ($lines as $line)
{
	// we have to omit comment.
	if (substr($line, 0, 2) == '--' || $line == '')
		continue;

	// if it not comment than save it in $temp variable
	$temp. = $line;

	// If we get a semicolon at the end of line than
	if (substr(trim($line), -1, 1) == ';')
	{
		// Perform the query
		mysql_query($temp);
		// set temp variable to empty
		$temp = '';
	}
}
?>
2009
07.21

I am not a designer but sometime we programmer have to face situation of handling images and  other stuffs also. Few months ago i was asked by one person who is desinger for solution of PNG images in IE6. He was able to display foreground images in webpage properly but in background repet images he was failed.

I will give you both solution in this article here.

1. For Foreground images.
Download pngfix.js file from http://homepage.ntlworld.com/bobosola and follow instruction. This is best way to display images directly associated with IMG tag of HTML.

2. For Backgound repeted images.
for this we need to create one class. This class has location to images from root folder of website. Once all path are correct than you can use this class in your DIV or TABLE Tag.
Here is Class

If you want to use PNG non repeat:

width:10px;
height:10px;
_width: 10px;
_height: 10px;
background: url(whatever.png) top left no-repeat transparent;
_background-image: none;
filter:progid:DXImageTransform.Microsoft.
AlphaImageLoader(src=’whatever.png’,sizingMethod=’scale’);

if you want to use PNG with repeat:
display: block;
width: 10px;
background: url(whatever-repeat.png) top left repeat-y transparent;
_background-image: none;
filter:progid:DXImageTransform.Microsoft.
AlphaImageLoader(enabled=’true’, sizingMethod=’scale’, src=’whatever-repeat.png’);

The idea is very simple just use filter:progid:DXImageTransform.Microsoft.
AlphaImageLoader(enabled=’true’, sizingMethod=’scale’, src=’the-image-you-want-to-repeat.png’ ) and make sure you properly apply the other CSS rules. This technique uses scaling instead of repeating but for shadows and other cool effects it is sufficient.

One important note. Here this class is made in CSS file which is in images folder. set your path of .png images according to that in your class.

2009
05.14

Most of us get spam every day. Some of us get a little, and some of us get a lot, but if you have an e-mail account it is always there.

Spam is incredibly annoying, time-consuming, especially in large quantities. If you have a e-mail address which is public than you can receive hundreds of spam messages.

To understand where this spam mail comes we have to find out first that Where does all of this spam e-mail come from? Why is there so much of it?

Here are some reasons that how spammers get our e-mail address.

  • Main source for e-mail addresses is the Web itself. There are tens of millions of Web sites, and spammers can create search engines that spider the Web specifically looking for “@” sign that indicates an e-mail address. The programs that do the spidering are often called spam bots.

    TIP : Never post your full e-mail address where it is publicly displayed. Post it like abc (at-the-rate) yahoo (dot) com. If you own website than try to place image of e-mail address and do not post your email in alt tag of image.

    • Other primary sources are newsgroups and chat rooms. People (especially first-time users) often use their screen names, or leave their actual e-mail addresses, in newsgroups. Spammers use pieces of software to extract the screen names and e-mail addresses automatically.

      TIP : Try to use different screen name, and if you want to provide your e-mail address to other user please provide it like abc (at-the-rate) yahoo (dot) com.

      • Next is sites created specifically to attract e-mail addresses. For example, a spammer creates a site that says, “Win $1 million!!! Just type your e-mail address here!”. Once you enter your detail and your e-mail is stored in spammer list.

      TIP : Never post your e-mail address on such a sites. If you still wants to go than first try to enter some invalid e-mail address. If they ask for verification than only post your actual e-mail address.

      • In the past, lots of large sites also sold the e-mail addresses of their members. Or the sites created “option” e-mail lists by asking, “Would you like to receive e-mail newsletters from our partners?” If you answered yes, your address was then sold to a spammer.

      TIP : If you find such a option in any site while registration. Try to avoid this option.

      • Probably the most common source of e-mail addresses, however, is a “dictionary” search of the e-mail servers of large e-mail hosting companies like MSN, AOL or Hotmail.

      TIP : Try to make your profile private. Also do not post your e-mail address on such a profile. Most importantly if possible than use different profile name than your e-mail address prefix.

      E-mail addresses generally are not private. Once a spammer gets a hold of your e-mail address and starts sharing it with other spammers, you are likely to get a lot of spam.

      Try to avoid this basic sorces from where spammer get your e-mail adderss. This tips will surely make difference to minimize your spams.