Showing posts with label computer tips. Show all posts
Showing posts with label computer tips. Show all posts

How to improve page load speed of your php website?

1. Use include at the place of include_once for including files

2.Remove Blank Spaces from your php code.You can use this function:

function removeBlankLines($string)
{
return preg_replace("/(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+/", "\n", $string);
}


3. Use , (comma) at the place of . (period) and single quote(') at the place of double quote(") wherever possible in echo statements.
For ex.
Before:
echo "my name is". $this->name."and your is".$this->your_name;
After:
echo 'my name is',$this->name,'and your is',$this->your_name;

4. Provide width and height of image tags. For eg width="10" height="10"

5. Use CDN for external Javascript files.

6. If you are using jquery or any other popular js technologies, then use google library service. 

7.Compress your css with css compressor.

8. Use minified version of javascript libraries, if not available then create one for yourself using sites like javascript compressor.

9.If possible write css files on page itself i.e inline, if file is too large then write css for visible content first on webpage and import css file in footer.

10. Import Javascript files in footer and not in header.

11. Load Javascript and other content Asynchronously or with the help of Ajax.

12. For image which are not above the fold, you can use lazyload javascipt to delay their loading.Read more about Lazy Load Plugin.

13. Compress your images using Yahoo Smush it. 

14. Use Gzip for compressing webpage.
Use this code before doctype to enable gzip compression on linux servers
 if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start();

15. Remove errors and warning from your code.

16. Use only required variables, if possible use values instead of variable.
For ex.
Before:
$j=10;
for($i=1;$i<$j;$i++) {   } // do something
After
for($i=1;$i<10 do="" font="" i="" nbsp="" something="">

17. Use microtime function of php to measure time taken by php to execute any specific function. For eg. if I want to measure time taken by first_function, I can measure it with the following code:
 
$time_start = microtime(true);
// Call your function
first_function();
$time_end = microtime(true);
$time = $time_end - $time_start;

echo "Total time to execute first function is $time seconds\n";

18. Use HTTP Caching : For PHP Website you can use header function or mod_expires

19. Avoid using SQL queries in loops(While or For), instead of that use array inside the loop and use implode function to append that array in SQL query.

20. Optimize CSS by using common declarations: 
Before
h1 { padding-top: 10px; }
p { padding-top: 10px; }
After
h1, p { padding-top: 10px; }


21. Use complex query instead of multiple queries to reduce number of requests.
Before:
Select * from products where pid=1;
Select * from text where pid=1; 
After:
Select * from products,text where products.pid = text.pid

22. You can use mysql procedure's at the place of php function. It will enhance your website security and performance.

How to Convert any webpage into pdf format?



PDF( Portable Document Format) is very useful way of saving docs because once saved, format and font of document remains same for any platform or machine such as computer, Tablet PC or even Mobiles.Moreover, it is very common and popular format. Most of the professionals like to save there documents only in this format .

Even though, many tools and extensions are available to convert any document or webpage into pdf but with help of google chrome you can save web page into pdf format at free of cost.

How to do it?

Step 1. Open any web page in your chrome browser

Step 2. Now, give print command (Ctrl + P)

Step 3. Next, change destination to Save as PDF .

Step 4. Click on Save

What about my email attachments?

Yes , if you have gmail account , please click on view option given with attachment and then click print command.


I hope that helps!

How to connect two computers using LAN ?

Step 1 .

For windows XP users :

Start ->Settings->Network Connections

Search Local Area Network icon and right click and select properties

Select Internet protocol (TCP/IP) and click on properties button.

Set IP address for both the computers. Remember they must be unique for both of them. For eg if you choose "192.168.1.1" for your first computer then choose "192.168.1.2" for other computer. IP address is address of computer from which it is recognized in networks.

Below the IP Address there is box called Subnet Mask, put 255.255.255.0 in it and click ok.

Please Note, You need to do above steps in both the computers.


Windows 7 :

Start -->Control Panel -> Network and Internet-->Network and Sharing Centre

Click on Change Adapter Settings

There will be icon of Local Area Networking , right click on it and follow the steps given above for windows XP.

Step 2 :

Build a Work Group :

Windows XP :

Start --> Control Panel --> System

In the dialog box click on Computer Name Tab .

Give the name for your computer such as Home1 , or Laptop1 etc.Do the same thing for your other computer.
Also give name to your workgroup such as Home Workgroup or Office workgroup.

After giving name to the computers , in the bottom of dialog box at  Member of Workgroup , type the name of your new workgroup as mentioned in above step.Follow the same procedure in both the computers.Remember both the computers have different name, different IPs but it workgroup name should be the same for both the computers.

Now Restart both the computers.

For Windows 7 :

Start -->Control Panel -->System and Security -->System and click on change settings. Follow the same procedure as we did in windows XP above.

Step 3 : Test your LAN

Start -->Settings-->Network Settings and click on My Network Places ad then click on Entire Network and the double click on Microsoft windows network.

You will see Workgroup Name. When you will double click on it , you will see the name of your other computer.Congratulations your both computers are connected now.

Windows 7 :

Start -->Control Panel-->Network and Internet -->Home Group You will see the name of other computer.

I hope it helped!

how to flip computer screen ?

If your computer screen has been flipped and you want it back to its current position then press CTRL+ALT+ Up arrow

Similarly if you want to flip your screen then

Press CTRL + ALT + Direction of arrow towards which you wanna flip.


I hope it helps

how to remove startup programs in windows xp ?


Start ---> Run--> type "msconfig"

click on start up-->remove the tick and click apply.

Format xp or 7 using usb

Concept: We are using two concepts , In first concept we will build bootable pen drive and in second we will assign this pen drive as our first preference when computer boots(we will change bios setting for that)

Note : Remember to type command without colon

Step 1. Plug USB Pen drive into your computer.

Step 2. Click Start -->Run-->Type cmd











Step3. In command prompt type without colon  : "diskpart" and press enter

Step4. Type "list disk" without colon and press enter again.

Step5. Your connected Usb will be listed here , type command "select disk 1" to select usb. 

Step6. Type "clean" without colon

Step7.Type "create partition primary" 

Step8. Type "select partition 1"

Step9. Type "active"

Step10.Type  "format fs=NTFS"

Step11.Type "assign"

Step12.Type "exit"

USB has become bootable at this point.

Step 13. copy the windows xp/7/vista dvd to this usb and restart

Step 14. Go to Bios-->Boot Option-->Select boot from USB and press enter

Step 15. Its done, now you can format your computer using usb

Upload multiple photos on facebook at once














1.You can upload multiple photos on facebook in a snap using picasa uploader.

Download Picasa from here..

Installation and usage instruction

2.  Bloom : another facebook photo uploader

3. Keebler Flickr uploader

How to transfer photos from iphone to mac computer?

Transfer or Sync Photos and Videos with Your Computer :

On a Mac, you can transfer photos with Aperture or iPhoto 4.0.3 or later, and videos with iPhoto 5 or later.

On a PC, you can sync photos with Adobe Photoshop Elements 3.0 or later.

You can also sync photos and videos from any folder on your Mac or PC that contains images.

How to compile a java program ?

1.Open command prompt using Start-->Run---> type cmd

2.In command prompt type cd c:\ java ( or your java directory path name)

3.Now type javac Xyz.java ( replace Xyz with your file name)

4.If compiled successfully type java Xyz

5.Done.

Helpful articles :

Hello Word for Microsoft windows

Related Video :

How to Run ISO file from Hard Drive ?

To run ISO file from hard disk drive :

1. Download winrar

2. Open winrar and then browse to iso file and click it.

3.Copy all files to any folder.

4.Open folder and run it.

How to find ip address of computer?

Do you wanna find out yours computer ip , its very easy.

1. Open Start-->Run and type cmd

2. Type netstat -n

3. There are two addresses, local address is your ip.


Related

Learn to find Ip address of Website.

How to transfer files or songs in blackberry?

Transferring files from blackberry to computer is not as difficult as it appears. To transfer file you need to have Blackberry desktop manager. You will find this software in a kit which comes with blackberry or you can download it from here.  After downloading , follow these steps :
  1. Connect your device to your computer.
  2. Open the BlackBerry Desktop Manager.
  3. Click Media Manager.
  4. Drag a file or folder from one location to another
This method can be used for various other purposes such as transfer files from :

Nokia to Blackberry or vice versa :

First of all sync your nokia files using Nokia Pc Suite or Ovi solution. Open "My Computer"  , you will find new disk drive for Nokia Phone.

Open it and transfer files from Nokia Phone to computer and with the above method transfer them to Blackberry.

Blackberry to iPhone : 

Transfer files with the help of above method to your PC. After that sync these files in ipod using iTunes.

Related :
 Change country code in Blackberry

How to Clean LCD Screens , safely?


Many homeowners across the city buy Liquid Crystal Display(LCD) television sets because not only are they beautiful and sleek to look at but are a wonderful way of saving that much valued commodity space. LCD screens are one of most important and  most expensive entertainment accessories in a home today."Consumers throw often notice that they are very sensitive to dust and finger printing smudges. Moreover, they are rather susceptible to scratches and buyers generally need to take some additional care while dealing with them".

Cleaning a LCD screen is quit a difficult task though as opposed to older CRT TV screens with glass screens."Those monitors were quit simple to clean and could be clean with a piece of dry lint free cloth but using the same technique here could prove hazardous to your LCD screens because they are sensitive that they can get scratch from even the dust particles explains Jitendra from Bijainagar. Several Manufacturer have there own list of dos and dont's and very often provide there own set of recommendation for that particular LCD tv model. The general rule though always remain the same. Buying proper LCD cleaning solution or kit is one option for consumers who like to do things by the book. Buyers need to buy cleaning solutions that have especially been formulated for LCD screens. Countless people often make a grievous mistake of buying just about any cleaning solution can get there hands on. Cleaning solutions vary in strength and seeing. That your LCD is probable as a delicate as a babies skin. You have to treat it with the at most care. He explains the biggest advantage of ready made LCD cleaning products is that along with cleaning solutions. They also come with there own soft cloth which is guaranteed to be safe for the screan.

Moreever, the solutions have great evaporative properties that are a great plus, specially if the solution accidentally gets into the LCD unit. While cleaning solution manufacture as a general rule are always careful, You should also be cautious on your part and check the contents before buying your solution. Avoiding the solution that contain ethanol , acetone, toluene , ammonia, ethyl acid  and methyl chloride, another options for buyers is to prepare there own cleaning solutions , preparing the solution is fairly easy and is also quit cost effective.

The first ingredient is distilled water which can be purchased at any chemist "Distill water is one of the best cleaning agents even better than mineral water and way better than tab water because these might have dissolved salt and mineral which could leave white marks on the screens". saying by Naresh from bijainagar.

This could be mixed with vinegar and then spread on the cloth.The best cloth use here is any old clean cotton and anchor chief.

"Stay away from newspaper , tissue paper and other soft looking but abrasive materials because they have been now to scratch screens permanently and leave screen looking like you have used sand paper or a utensil scrubber on them." he warns.

Never spray any cleaning solution directly on the screen. Instead, moisten the cloth with this home made solution and then gently rub on the screen applying only a light touch. To get the best results, always run in one direction: top to bottom and avoid scrubbing motions. These tips and tricks are a great way of keeping your LCD screen looking all shiny and new.

How to Format and Reinstall Win Xp in computer?

Step 1. Boot your computer using Win Xp CD.

Step 2. Wait for approx 3-5 minutes.

Step3. Click enter.

Step4. Press F8 to agree the agreement by windows.

Step5. Press Esc at the repair option screen.

Step6. Press delete to select "delete partition".

Step6.Press enter to delete partition.

Step 7.Enter to Install or C to Create new partition.


Video of above Steps