Wednesday, November 13, 2013

How to Make an Image Downloadable


Create the HTML file to add a link like 'click here to download image'.
code:
<a href="download.php?imgfile=occ.png"><img src="download.png" alt="download image"></a>

Then create the download.php file.Code is given below
<?php
// Force download of image file specified in URL query string and which is in the same directory as this script:
if(!empty($_GET['imgfile']))
{
   $filename = basename($_GET['imgfile']); // don't accept other directories
   $size = @getimagesize($filename);
   $fp = @fopen($filename, "rb");
   if ($size && $fp)
   {
      header("Content-type: {$size['mime']}");
      header("Content-Length: " . filesize($filename));
      header("Content-Disposition: attachment; filename=$filename");
      header('Content-Transfer-Encoding: binary');
      header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
      fpassthru($fp);
      exit;
   }
}
header("HTTP/1.0 404 Not Found");
?>

Monday, October 28, 2013

4 Reasons Why You Should Pick Apple iOS over Android

It’s one of the most contentious questions among smartphone and tablet users: Android or iOS? Everyone seems to have an opinion as to what operating system is the best – or more accurately, what operating system is the worst. 


Recently, I wrote an article about making the switchiOS to Android. But Android devices aren’t right for everyone. There’s a reason why the Apple iPhone is the most popular smartphone in the country right now. And it’s not just good marketing and hype. Are you an Apple person? Itdepends on how important the following four factors are to you. Safety Android is the Wild West of phone operating systems. Stock devices largely come unprotectedattack. Sure, Google checks apps and viruses for malware on the Google Play store, but threats can comeanywhere – even via unsecured Wi-Fi locations. The phones are so vulnerable, in fact, that 32.8 million Android devices were infected with malware last year alone. If Android is the Wild West, Apple’s iOS is moreDisneyland. It’s a tightly controlled experience.apps created for the iPhone or iPad need to go through a rigorous testing process. Sure, the occasional bad seed slips through every now and then, but for the most part, the App Store is a clean, virus-free marketplace. Ease of Use My mother loves technology, but even she’d admit that she’s fara tech expert. So, when she asked my professional advice as to what kind of smartphone she should get, the answer was simple: Get an iPhone. Done. The fact of the matter is that Apple phones are incredibly easy to use. I didn’t need to sit down with my mother to explain how it worked – she was able to figure things out on her own simply by playing with it. Key features are easy to find. To borrow a phrase from Apple’s PR department, “it just works.” Design If you haven’t seen Apple’s iOS 7, you’re really missing out. Under the watchful eye of British designer Jony Ive, the new mobile

Friday, August 23, 2013

Export and Import SQL using Command Line ( C M D)

Sometimes when you have large databases, phpmyadmin or similar tool might fall when it comes to exporting or importing.
The easiest (and fastest) way is to use command line.

To export use this command:
mysqldump -u USER -p PASSWORD DATABASE > filename.sql

To import database from dump file (in this case called filename.sql) use:
mysql -u username -p password database_name < filename.sql

If you are on Windows you will need to open CMD and go to directory where mysql.exe is installed. If you are using WAMP server then this is usually located in:
C:\wamp\bin\mysql\mysql5.1.36\bin (*note the version of mysql might be different)

So you will:
cd C:\wamp\bin\mysql\mysql5.1.36\bin

and then execute one of the above commands.

Tuesday, February 12, 2013

Charge your phone with coffee and beer

 

A new device that can charge your mobile phone with a hot cup of coffee or a cold beer mug has been developed by a US company. 

The company claims that the two-sided Epiphany onE Puck converts the warmth of your hot cocoa or iced beverage into power for your phone. The lightweight device is portable enough to store in your purse or day bag for emergencies. 

The device uses a Stirling engine powered solely by heat disparities to generate the electricity to keep your phone up and running, Gizmag reported. 

Stirling engines were actually invented in 1816 as a rival to the steam engine, but its use was limited to low-power applications for a long time. 

Epiphany Labs is using modern materials to use the technology in a rather different way. The most obvious evolution comes in terms of size. 

The working prototype of the Epiphany onE Puck is not much larger than the bottom of a cup, so it's small enough to carry around easily. 

The device has two sides - a blue side for cold drinks and a red side for hot drinks. According to its creators, a hot drink is the optimal way to charge a device. 

It comes with a USB port that can charge any device that draws 1000mA or less. This means it can charge iPhones, Androids, iPods and other USB-based devices. 

Epiphany Labs claims that, in ideal circumstances, the device would be able to charge your phone at the same speed you would see plugging it in directly to a wall. 

It will also work in less-than-ideal conditions, but if you are not placing a fresh hot drink on the Puck, you will have to wait a little longer for your device to receive a full charge. 

The team from Epiphany Labs has a working prototype, and is turning to Kickstarter to get the funding needed for production.

 

Monday, October 29, 2012

Nokia out of 5 in global market

Finnish mobile handset manufacturer Nokia, which is facing a major crisis in global sales, still tops the list of mobile handset market in India even as it has been displaced from the fifth spot in global sales by the beleaguered BlackBerry maker  Research in Motion (RIM).

According to a report by Cybermedia, Nokia had 22.2 per cent share of the Indian handset market in terms of total unit shipments in the first half of 2012, followed by Samsung with 13 per cent and Micromax in the third spot with 5.5 per cent share.

India's total mobile handset shipments topped 102.43 million units, of which 5.50 million were smartphones, as per the report. Samsung topped the list of smartphone shipments, followed by Nokia and RIM.

The report also revealed that Android (with 56.4% market share) was the leading operating system (OS) in India, followed by Symbian (17.4% share), BlackBerry (12.1% share), Bada (8.5% share), iOS (3.0% share) and Windows Mobile (2.6% share) on a base of 5.50 million units, during the same period.

India is one of the few markets where Nokia still has a hold. As per an IDC report, the Finnish company has now dropped off the Top 5 list of smartphone vendors, which is led by Samsung and Apple at number 1 and 2 positions. Nokia was replaced by RIM at fifth position whose shipment volumes appear to have flattened though the company posted the second-highest year-over-year decline among any the leading vendors.

According to Kevin Restivo, senior research analyst with IDC's Worldwide Quarterly Mobile Phone Tracker, Nokia's share losses and the company's transition away from Symbian to Windows Phone has left ample opportunity for rivals to steal share away from Nokia over the past 18 months.