Tutorial by Examples: e

There are three possibilities to insert Elm code into a existing HTML page. Embed into the body tag Supposing you have compiled the Hello World example into elm.js file, you can let Elm take over the <body> tag like so: <!DOCTYPE html> <html> <body> <scri...
Placing date_default_timezone_set('Asia/Kolkata'); on config.php above base URL also works. PHP List of Supported Time Zones application/config.php <?php defined('BASEPATH') OR exit('No direct script access allowed'); date_default_timezone_set('Asia/Kolkata'); Another way I have found...
The best way to get started with Salesforce is to get your own Developer Edition. Developer Edition (often referred to as a "DE org") is a fully-featured development environment with limits on data and users. Developer Edition is where you can get familiar with the environment, try out st...
The following functions allow you to build SQL SELECT statements. $this->db->get() This runs the selection query and returns the result. Can be used by itself to retrieve all records from a table: $query = $this->db->get('tablename'); // Produces: SELECT * FROM tablename The sec...
In order to use libraries in CodeIgniter, you need to create a library. class Pro { function show_hello_world() { return 'Hello World'; } } In this library, which is called is pro.php, this file must be added to the following path. Path: \xampp\htdocs\project\application\librarie...
Html has beginnerProgram mostly for learning purposes. beginnerProgram is not capable of handling Subscriptions or running Commands. It is only capable of handling user input from DOM Events. It only requires a view to render the model and an update function to handle state changes. Example Con...
Example demonstrates component composition and one-way message passing from parent to children. 0.18.0 Component composition relies on Message tagging with Html.App.map 0.18.0 In 0.18.0 HTML.App was collapsed into HTML Component composition relies on Message tagging with Html.map Example ...
We'll use the popular eslint-config-airbnb as a starter as well as Meteor specific rules using eslint-import-resolver-meteor. We also need to install babel-parser to lint Meteor enabled ES7 features such as async/await. cd my-project npm install --save-dev eslint-config-airbnb eslint-plugin-impor...
Edit your package.json to add the following script : { "scripts": { "lint": "eslint .;exit 0" } } Then run it using npm run lint We use exit 0 as a trick to gracefully terminate the script when linting fails, otherwise npm will use eslint return code an...
This will create a timer to call the doSomething method on self in 5.0 seconds. [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(doSomething) userInfo:nil repeats:NO]; Setting the repeats parameter to false/NO indicates that we...
[timer invalidate]; timer = nil; This will stop the timer from firing. Must be called from the thread the timer was created in, see Apple's notes: You must send this message from the thread on which the timer was installed. If you send this message from another thread, the input source associ...
[timer fire]; Calling the fire method causes an NSTimer to perform the task it would have usually performed on a schedule. In a non-repeating timer, this will automatically invalidate the timer. That is, calling fire before the time interval is up will result in only one invocation. In a repeat...
Two erlang processes can communicate with each other, wich is also known as message passing. This procedure is asynchronous in the form that the sending process will not halt after sending the message. Sending Messages This can be achieved with the construct Pid ! Message, where Pid is a valid pr...
It is possible to register a process (pid) to a global alias. This can be achieved with the build in register(Alias, Pid) function, where Alias is the atom to access the process as and Pid is the process id. The alias will be globally available! It is very easy to create shared state, wich is usu...
Each process in erlang has a process identifier (Pid) in this format <x.x.x>, x being a natural number. Below is an example of a Pid <0.1252.0> Pid can be used to send messages to the process using 'bang' (!), also Pid can be bounded to a variable, both are shown below MyProcessId =...
Subroutines hold code. Unless specified otherwise, they are globally defined. # Functions do not (have to) specify their argument list sub returns_one { # Functions return the value of the last expression by default # The return keyword here is unnecessary, but helps readability. return 1...
using System.Text.RegularExpressions; string pattern = ":(.*?):"; string lookup = "--:text in here:--"; // Instanciate your regex object and pass a pattern to it Regex rgxLookup = new Regex(pattern, RegexOptions.Singleline, TimeSpan.FromSeconds(1)); // Get the match from y...
using System.Text.RegularExpressions; List<string> found = new List<string>(); string pattern = ":(.*?):"; string lookup = "--:text in here:--:another one:-:third one:---!123:fourth:"; // Instanciate your regex object and pass a pattern to it Regex rgxLookup = ...
class Product(models.Model): name = models.CharField(max_length=20) price = models.FloatField() To Get average price of all products: >>> from django.db.models import Avg, Max, Min, Sum >>> Product.objects.all().aggregate(Avg('price')) # {'price__avg': 124.0} To ...
Subtracting the values of two pointers to an object results in a signed integer *1. So it would be printed using at least the d conversion specifier. To make sure there is a type being wide enough to hold such a "pointer-difference", since C99 <stddef.h> defines the type ptrdiff_t. ...

Page 446 of 1191