Category 'D'


Sort an array of arrays in PHP

vista in WordPress: ordinare una serie di post per un campo qualsiasi può essere utilizzata facilmente anche per ordinare array di array . PHP function usort ( ) seen in Wordpress: order a series of posts for any field can be used to easily sort arrays of arrays. For example if we have:

1
2
3
4
5
6
7
8
9
array ( $ Args = array (
'nome' => 'mike' , 'anno' => 2001 ) , array ('name' => 'Mike', 'year' => 2001),
'nome' => 'frank' , 'anno' => 2010 ) , array ('name' => 'Frank', 'year' => 2010),
...
);

$args , function ( $a , $b ) { usort ($ args, function ($ a, $ b) {
$a [ 'anno' ] > $b [ 'anno' ] ) ; return ($ a ['year']> $ b ['year']);
});

Continued ...

The rule of the AND logic in CSS

A characteristic of the style sheets that few know and use is the ability to define the rule of "competition" of classes! A tag, in fact, may possess one or more associated classes, which makes the latter extremely versatile, as well as my favorite. How many developers use to do, I tend to associate the IDs few CSS rules, if any. Ideally, logically, would enter the ID only for scripting purposes, because it uniquely identifies an element within the DOM.

Continued ...

With multiple video AVQueuePlayer

The class MPMoviePlayerController has the big drawback of not properly handle multiple concurrent video, as well as make it difficult to create a video sequence, one after another. che è una sottoclasse di AVPlayer ), appartenente al framework più a basso livello AVFoundation , è invece estremamente più versatile, nonostante mantenga egualmente una semplicità nell'implementazione. The class AVPlayer (or AVQueuePlayer which is a subclass of AVPlayer ) belonging to the lower-level framework AVFoundation , but it is extremely versatile, equally despite maintaining simplicity in implementation.

Frameworks Block Diagram

Continued ...

Fixed bug: jQuery UI on the calendar year range

The calendar widget for jQuery UI , the so-called DatePicker , allows many settings, including the one to decide a range of years to show in the drop-down menu.

Continued ...

Very short snippet: set the log files on WordPress

si attivano i log a video prodotti da PHP, riempiendo lo schermo di Notice, Warning e quant'altro. By setting the file wp-config.php define the define('WP_DEBUG', true); logs are activated by PHP-screen products, filling the screen, Notice, Warning, and more. If controls for "flying" this can be useful in situations of exercise is highly recommended, for obvious reasons. Luckily, WordPress allows her to "convey" these logs to a file, which by default is placed in /wp-content/debug.log .

Continued ...

MySQL: select random paging

Select a range of rows from a table at random is as easy to use ORDER BY RAND() in our select statement. Some also prefer to use different techniques, ranging from the use of PHP to write the select special. The reason is that ORDER BY RAND() is slow because MySQL creates a temporary table with all the results and then assigns each row a random index, returning a result ordered (random)!

Continued ...

Very short trick: maintenance mode via IP

When developing a product (website, Blog, Facebook application) online, if you have not been able to build an infrastructure development / operation may be necessary under certain circumstances to "off-line" service, for updates, debugging or interventions maintenance. WordPress, for example, can be deactivated with simple and convenient Plugins as Maintenance Mode .

Continued ...

GitHub for Mac

If you are registered on GitHub , like me , might make you comfortable this application for OS X for Mac GitHub . It allows you to manage the repository so simple, thanks to the excellent minimal and intuitive GUI. Nice thing is that the application can be activated directly from the page when you want to clone a GitHub repository:

GitHub

Continued ...

Objective-C: how best to use the property list files

One of the advantages of the Property list files, which are simply text files that follow the XML standard, is that you can instantly be transformed into objects (such as array or dictionary) Objective-C. When you create a file list Property:

Property List

Continued ...

Very short trick: log JavaScript objects

If you are to develop in an environment where it is impossible to use the debugging tools like FireBug , such as the Apple iPhone simulator in Xcode, it can become frustrating to find problems, including an incorrect access to all properties of an object. Here is that the use of works alert() is fundamental!

Continued ...



Stop SOPA