Tutorial by Examples: f

Hooks are defined in the application/config/hooks.php file. Each hook is specified as an array with this prototype $hook['pre_controller'] = array( 'class' => 'MyClass', 'function' => 'Myfunction', 'filename' => 'Myclass.php', 'filepath' => 'h...
Static variables and methods are not part of an instance, There will always be a single copy of that variable no matter how many objects you create of a particular class. For example you might want to have an immutable list of constants, it would be a good idea to keep it static and initialize it j...
Select data from a partition SELECT * FROM orders PARTITION(partition_name);
ALTER TABLE table_name MOVE PARTITION partition_name TABLESPACE tablespace_name;
Using some setters, without setting all needed properties in the constructor(s) public final class Person { // example of a bad immutability private final String name; private final String surname; public Person(String name) { this.name = name; } public String ge...
Common Requirements All reports, regardless of how the data is presented, take a path to the report template and a parameter map. The variables are used in all examples that follow: // Parameters passed into the report. Map<String, Object> parameters = new HashMap<>(); // Arbitrary...
(Wikipedia) Bioinformatics is an interdisciplinary field that develops methods and software tools for understanding biological data. As an interdisciplinary field of science, bioinformatics combines computer science, statistics, mathematics, and engineering to analyze and interpret biological dat...
Magento custom module development is a core part of any Magento development or Magento project, because at any stage you may want to integrate your own functionality/module in your existing Magento project. The first thing developers should disable is the system cache. Otherwise developing will bec...
A string resource provides text strings for your application with optional text styling and formatting. There are three types of resources that can provide your application with strings: String XML resource that provides a single string. Syntax: <?xml version="1.0" encoding="...
When working with existing model that is quite big and is being regenerated quite often in cases where abstraction needed it might be costly to manually go around redecorating model with interfaces. In such cases one might want to add some dynamic behavior to model generation. Following example wil...
Some ADO.NET providers (most notably: OleDB) do not support named parameters; parameters are instead specified only by position, with the ? place-holder. Dapper would not know what member to use for these, so dapper allows an alternative syntax, ?foo?; this would be the same as @foo or :foo in other...
It's possible to pass Java objects to Nashorn engine to be processed in Java code. At the same time, there are some JavaScript (and Nashorn) specific constructions, and it's not always clear how they work with java objects. Below there is a table which describes behaviour of native Java objects ins...
User-defined method objects may be created when getting an attribute of a class (perhaps via an instance of that class), if that attribute is a user-defined function object, an unbound user-defined method object, or a class method object. class A(object): # func: A user-defined function object...
angular .module('MyApp', []) .constant('VERSION', 1.0); Your constant is now declared and can be injected in a controller, a service, a factory, a provider, and even in a config method: angular .module('MyApp') .controller('FooterController', function(VERSION) { this.version = V...
If you are unsure which rules to list in your .gitignore file, or you just want to add generally accepted exceptions to your project, you can choose or generate a .gitignore file: https://www.toptal.com/developers/gitignore https://github.com/github/gitignore Many hosting services such as Git...
async.waterfall(tasks, afterTasksCallback) will execute a set of tasks. Each task are executed after another, and the result of a task is passed to the next task. As async.series(), if a task fails, async stop the execution and call immediately the main callback. When tasks are finished successfull...
SELECT name, caption as title, year, pages FROM books UNION SELECT name, title, year, 0 as pages FROM movies When combining 2 record sets with different columns then emulate the missing ones with default values.
extern int var; static int var; /* Undefined behaviour */ C11, §6.2.2, 7 says: If, within a translation unit, the same identifier appears with both internal and external linkage, the behavior is undefined. Note that if an prior declaration of an identifier is visible then it'll have the pri...
Use the yum command to manage packages in Enterprise Linux-based operating systems: yum install php This installs a minimal install of PHP including some common features. If you need additional modules, you will need to install them separately. Once again, you can use yum to search for these pac...
To start, gemfiles require at least one source, in the form of the URL for a RubyGems server. Generate a Gemfile with the default rubygems.org source by running bundle init. Use https so your connection to the server will be verified with SSL. source 'https://rubygems.org' Next, declare the gem...

Page 174 of 457