Tuesday, November 4, 2014

Xampp version on Windows

Add this line to xampp\phpmyadmin\config.inc.php

$cfg['ExecTimeLimit'] = 6000;

And Change xampp\php\php.ini to

post_max_size = 750M

upload_max_filesize = 750M

max_execution_time = 5000

max_input_time = 5000

memory_limit = 1000M

And change xampp\mysql\bin\my.ini

max_allowed_packet = 200M

Tuesday, September 2, 2014

Choosing a data format for Javascript

HTML snippets require very little work to implement. The external data can be loaded
and inserted into the page with one simple method that does not even require a
callback function. No traversal of the data is necessary for the straightforward task
of adding the new HTML into the existing page. On the other hand, the data is not
necessarily structured in a way that makes it reusable for other applications. The
external file is tightly coupled with its intended container.

JSON files are structured for simple reuse. They are compact and easy to read. The
data structure must be traversed to pull out the information and present it on the
page, but this can be done with standard JavaScript techniques. Since modern
browsers parse the files natively with a single call to JSON.parse(), reading in a
JSON file is extremely fast. Errors in the JSON file can cause silent failure or even
side effects on the page, so the data must be crafted carefully by a trusted party.

JavaScript files offer the ultimate in flexibility, but are not really a data storage
mechanism. Since the files are language-specific, they cannot be used to provide
the same information to disparate systems. Instead, the ability to load a JavaScript
file means that behaviors that are rarely needed can be factored out into external
files, reducing code size unless and until it is needed.

While XML has fallen out of favor in the JavaScript community, with most developers
preferring JSON, it is still so common that providing data in this format makes it very
likely that the data can be reused elsewhere. Indeed, many web services, such as Yahoo
Weather (http://developer.yahoo.com/weather/), export XML representations
of their data, which has allowed many interesting mashups of their data to arise. The
XML format is somewhat bulky, and can be a bit slower to parse and manipulate than
other options.

Tuesday, August 26, 2014

fadeIn() VS slideDown

The fading animations are very useful for items that are outside the flow of the
document. For example, these are typical effects to apply to "lightbox" elements
that are overlaid on the page. However, when an element is part of the document
flow, calling .fadeIn() on it causes the document to jump to provide the real estate
needed for the new element, which is not always aesthetically pleasing.

Friday, August 15, 2014

Convert DMG to CDR or ISO with Disk Utility

hdiutil convert /path/imagefile.dmg -format UDTO -o /path/convertedimage.iso

hdiutil convert /path/imagefile.cdr -format UDTO -o /path/convertedimage.iso

Friday, August 1, 2014

JavaScript Tips

In JavaScript, functions are objects.

Function arguments are the real values received by the function when it is invoked.