Tutorial by Examples: ect

The OutputCache directive controls the output caching policies of a web page or a user control. The basic syntax of OutputCache directive is: <%@ OutputCache Duration="15" VaryByParam="None" %>
You can select elements with different selectors : by tag : "div" by class : ".class" by id : "#id" by attribute : "[color=blue]" multiple selectors (OR): "div1, div2, class1" multiple selectors (AND): "div1 div2 class1"
Sometimes when you make a game you need to create and destroy a lot of objects of the same type over and over again. You can simply do this by making a prefab and instantiate/destroy this whenever you need to, however, doing this is inefficient and can slow your game down. One way to get around thi...
Predicates that produce side effects leave the realm of pure logic. These are for example: writeq/1 read/1 format/2 Side effects are phenomena that cannot be reasoned about within the program. For example, deletion of a file or output on the system terminal.
Given a C++ source file main.cpp defining a main() function, an accompanying CMakeLists.txt file (with the following content) will instruct CMake to generate the appropriate build instructions for the current system and default C++ compiler. main.cpp (C++ Hello World Example) #include <iostream...
Redirect any naked domain to www.[your_domain].tld: # Start Apache Rewriting engine RewriteEngine On # Make sure you're not already using www subdomain # and that the host string is not empty RewriteCond %{HTTP_HOST} !^$ RewriteCond %{HTTP_HOST} !^www\. # We check for http/https connection ...
Bash indirection permits to get the value of a variable whose name is contained in another variable. Variables example: $ red="the color red" $ green="the color green" $ color=red $ echo "${!color}" the color red $ color=green $ echo "${!color}" the ...
To create a JAR containing all of its dependencies, it is possible to use the built-in descriptor format jar-with-dependencies. The following example configures an execution of the Assembly Plugin bound to the package phase, using this built-in descriptor and declaring a main class of com.example: ...
{ echo "contents of home directory" ls ~ } > output.txt
Install jquery via npm : npm install jquery --save Install typings for the library: To add typings for a library, do the following: typings install jquery --global --save Add jquery to angular-cli-build.js file to vendorNpmFiles array: This is required so the build system...
Use a signal's connect method to connect a function to a signal. When a signal is sent, each connected function is called with the sender and any named arguments the signal provides. from flask import template_rendered def log_template(sender, template, context, **kwargs): sender.logger.in...
To select siblings of an item you can use the .siblings() method. A typical example where you want to modify the siblings of an item is in a menu: <ul class="menu"> <li class="selected">Home</li> <li>Blog</li> <li>About</li&...
superman-directive.js angular.module('myApp', []) .directive('superman', function() { return { // restricts how the directive can be used restrict: 'E', templateUrl: 'superman-template.html', controller: function() { this.message = "I'm superman!&qu...
As well as allowing module entities to have access control (being public or private) modules entities may also have the protect attribute. A public protected entity may be use associated, but the used entity is subject to restrictions on its use. module mod integer, public, protected :: i=1 en...
Asynchronously var fs = require('fs'); fs.stat('path/to/file', function(err) { if (!err) { console.log('file or directory exists'); } else if (err.code === 'ENOENT') { console.log('file or directory does not exist'); } }); Synchronously here, we must wr...
There may be situations where you have setup a pool of MySQL connections, but you have a number of queries you would like to run in sequence: SELECT 1; SELECT 2; You could just run then using pool.query as seen elsewhere, however if you only have one free connection in the pool you must wait un...
Dependencies can also be injected by setters. interface Logger { public function log($message); } class Component { private $logger; private $databaseConnection; public function __construct(DatabaseConnection $databaseConnection) { $this->databaseConnection = $...
PHP 5.x5.4 When you build REST API's, you may need to reduce the information of an object to be passed to the client application. For this purpose, this example illustrates how to use the JsonSerialiazble interface. In this example, the class User actually extends a DB model object of a hypotetica...
Laravel allows user work on multiple database connections. If you need to connect to multiple databases and make them work together, you are beware of the connection setup. You also allow using different types of database in the same application if you required. Default connection In config/dat...
We can use the Service Container as a Dependency Injection Container by binding the creation process of objects with their dependencies in one point of the application Let's suppose that the creation of a PdfCreator needs two objects as dependencies; every time we need to build an instance of PdfCr...

Page 21 of 99