This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Interlaced image loads an early degraded version of the whole image as soon as possible and then progressively renders the image to clear state. | |
Non-interlaced image will load up in tiles showing clear image in each tile as it progresses to load in the image. | |
For .jpg the interlaced = progressive and not interlaced = baseline. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error when try access gmail from php imap solution: | |
Login to your gmail account, enable imap. | |
Let the access here first: https://www.google.com/settings/security/lesssecureapps | |
Go to: https://accounts.google.com/b/0/DisplayUnlockCaptcha and enable access. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class User | |
{ | |
protected $name; | |
protected $surname; | |
protected $password; | |
public function setName($name) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The solution: | |
The two tables must have the same engine i.e. ENGINE=InnoDB. (can be others: ENGINE=MyISAM works too) | |
The two tables must have the same charset. | |
The PK column(s) in the parent table and the FK column(s) must be the same data type. (if the PRIMARY Key in the Parent table is UNSIGNED, be sure to select UNSIGNED in the Child Table field) | |
The PK column(s) in the parent table and the FK column(s), if they have a define collation type, must have the same collation type; | |
If there is data already in the foreign key table, the FK column value(s) must match values in the parent table PK columns. | |
And the child table cannot be a temporary table. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function convertCurrency($amount, $from, $to){ | |
$url = "https://www.google.com/finance/converter?a=$amount&from=$from&to=$to"; | |
$data = file_get_contents($url); | |
preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted); | |
$converted = preg_replace("/[^0-9.]/", "", $converted[1]); | |
return round($converted, 3); | |
} | |
# Call function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getPagesForSpace() { | |
$arr = array(); | |
$result = $this->query("SELECT * FROM pages ORDER BY id ASC"); | |
if($result !== false) { | |
while ($row = $result->fetch_assoc()) { | |
$arr[] = $row; | |
} | |
function buildTree(array $elements, $parentId = 0) { | |
$branch = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* jQuery UI Touch Punch 0.2.3 | |
* | |
* Copyright 2011–2014, Dave Furfero | |
* Dual licensed under the MIT or GPL Version 2 licenses. | |
* | |
* Depends: | |
* jquery.ui.widget.js | |
* jquery.ui.mouse.js | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When building a custom web application you need to consider the type of database that best suits the data. | |
Here's a quick guide on the differences between MySQL (Relational) and MongoDB (Non-Relational / NoSQL). | |
###Data Representation | |
-MySQL represents data in tables and rows. | |
-MongoDB represents data as collections of JSON documents. | |
If you think about it, a JSON document is very much like what you would be | |
working with in your application layer. If you are using javascript, | |
it's exactly what you're working with. If you're using PHP, it's just like an associative array. | |
If you're using python, its just like a dictionary object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hi! I am a complete newbie to RAR files and I want to learn what to do with them. I was just wondering: | |
What is a multipart RAR file? | |
1. A multipart RAR file is a standard RAR file, that was split into many smaller parts. This way, very large Archives can be placed on many small mediums, e.g. CDs. | |
2. The parts of a multipart RAR file are usually named "xyz.part1.rar", "yxz.part2.rar" etc. or "xyz.rar", "xyz.r01", "xyz.r02" etc. Depending on how many parts have been generated, there may be a few or a few hundred of these files. | |
3. A multipart RAR file can additionally be encrypted and protected by a password. Read more on password protection in the protected RAR files section of this FAQ. | |
4. BE CAREFUL: Sometimes multipart RAR files are used for phishing. Learn more in the phishing RAR files section of this FAQ. | |
5. Sometimes a multipart RAR file can be damaged and corrupted. Please take a look at the corrupted RAR files section of this FAQ to learn more. | |
Hi! I am an absolute beginner and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Understanding the differences between Illustrator and Photoshop | |
can range from confusing to downright frustrating for those who are | |
new to graphics and image editing. Which application should you use | |
for your project? Should you use a combination of the two together, or | |
just stick with one? Having a household name as Photoshop does, many people | |
simply turn to Photoshop for all their work, but that may not be the best | |
choice for all your graphics work. | |
It really boils down to having an understanding not only of what you wish to achieve, | |
but also having a firm grasp on the key differences between Photoshop and Illustrator; |