12 Greatest Programmers of all Time

A programmer is a person who can create and modify computer programs. No matter what type of programmer one may be, each and every contributes something to the society, no matter how trivial. Yet, there are those few who have … Continue reading 12 Greatest Programmers of all Time

Rate this:

8 Online Payment Options That Aren’t PayPal

When most people think of online payments, one name comes to mind: PayPal. But for all PayPal’s strengths, it’s a bad idea to rely on it as the single system to accept payments on your site. Monopolies are never healthy, and you need to diversify your payment channels. Why You Need PayPal Alternatives There are plenty of reasons why you should support multiple payment options, but here are several of the most important ones: Your partners or customers can’t always make or accept PayPal payments. This is the major reason to offer payment alternatives. There are always people who can’t … Continue reading 8 Online Payment Options That Aren’t PayPal

Rate this:

Top 10 Programming Languages in 2014

1. Java What it is: Java is a class-based, object-oriented programming language developed by Sun Microsystems in the 1990s. It’s one of the most in-demand programming languages, a standard for enterprise software, web-based content, games and mobile apps, as well as the Android operating system. Java is designed to work across multiple software platforms, meaning a program written on Mac OS X, for example, could also run on Windows.   2. C Language What it is: A general-purpose, imperative programming language developed in the early ’70s, C is the oldest and most widely used language, providing the building blocks for … Continue reading Top 10 Programming Languages in 2014

Rate this:

Text to Speech in PHP (API)

// Code Starts here <?php // FileName: tts.php /* *  A PHP Class that converts Text into Speech using Google’s Text to Speech API * * Author: * Voltainc *Contributor : *Awais * https://canvascode.wordpress.com * */ class TextToSpeech {     public $mp3data;     function __construct($text=””) {         $text = trim($text);         if(!empty($text)) {             $text = urlencode($text);             $this->mp3data = file_get_contents(“http://translate.google.com/translate_tts?q={$text}”);         }     }     function setText($text) {         $text = trim($text);         if(!empty($text)) {             $text = urlencode($text);             $this->mp3data = file_get_contents(“http://translate.google.com/translate_tts?q={$text}”);             return $mp3data;         } else { return false; }     }     function saveToFile($filename) {         $filename = trim($filename);         if(!empty($filename)) {             return file_put_contents($filename,$this->mp3data);         } else { return false; }     } } ?> // Code … Continue reading Text to Speech in PHP (API)

Rate this:

Create an image thumbnail on upload

//snippet starts <?php function createThumbnail($imageDirectory, $imageName, $thumbDirectory, $thumbWidth, $quality){ $details = getimagesize(“$imageDirectory/$imageName”) or die(‘Please only upload Images.’); $type = preg_replace(‘@^.+(?<=/)(.+)$@’, ‘$1’, $details[‘mime’]); eval(‘$srcImg = imagecreatefrom’.$type.'(“$imageDirectory/$imageName”);’); $thumbHeight = $details[1] * ($thumbWidth / $details[0]); $thumbImg = imagecreatetruecolor($thumbWidth, $thumbHeight); imagecopyresampled($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $details[0], $details[1]); eval(‘image’.$type.'($thumbImg, “$thumbDirectory/$imageName”‘. (($type==’jpeg’)?’, $quality’:”).’);’); imagedestroy($srcImg); imagedestroy($thumbImg); } foreach ($_FILES[“pictures”][“error”] as $key => $error) { if ($error == UPLOAD_ERR_OK) { $tmp_name = $_FILES[“pictures”][“tmp_name”][$key]; $name = $_FILES[“pictures”][“name”][$key]; move_uploaded_file($tmp_name, “data/$name”); createThumbnail(“/location/of/main/image”, $name, “/location/to/store/thumb”, 120, 80); //120 = thumb width :: 80 = thumb quality (1-100) } } ?> //snippet ends Continue reading Create an image thumbnail on upload

Rate this:

Prevent White Flash While iFrame Loads

Problem <!– NO! Bad! –> {iframe style=”visibility:hidden;” onload=”this.style.visibility = ‘visible’;” src=”../examples/inlineframes1.html” } {/iframe} (since WP dont allow me top place an iframe with <> :p, make sure to replace { } with <>) //———————————————————————————————————————– Solution // Prevent variables from being global  (function () { /* 1. Inject CSS which makes iframe invisible */ var div = document.createElement(‘div’), ref = document.getElementsByTagName(‘base’)[0] || document.getElementsByTagName(‘script’)[0]; div.innerHTML = ‘&shy;<style> iframe { visibility: hidden; } </style>’; ref.parentNode.insertBefore(div, ref); /* 2. When window loads, remove that CSS, making iframe visible again */ window.onload = function() { div.parentNode.removeChild(div); } })(); Just include that on any page (in … Continue reading Prevent White Flash While iFrame Loads

Rate this: