Tutorial by Examples: er

The unary + and - operators are only usable on arithmetic types, therefore if for example one tries to use them on a struct the program will produce a diagnostic eg: struct foo { bool bar; }; void baz(void) { struct foo testStruct; -testStruct; /* This breaks the constraint so mu...
Different countries have different number formats and considering this we can have different formats using Locale of java. Using locale can help in formatting Locale locale = new Locale("en", "IN"); NumberFormat numberFormat = NumberFormat.getInstance(locale); using above fo...
We have a DataListComponent that shows a data we pull from a service. DataListComponent also has a PagerComponent as it's child. PagerComponent creates page number list based on total number of pages it gets from the DataListComponent. PagerComponent also lets the DataListComponent know when user c...
Objective-C Declare a slider property in the ViewController.h or in the interface of ViewController.m @property (strong, nonatomic)UISlider *slider; //Define frame of slider and add to view CGRect frame = CGRectMake(0.0, 100.0, 320.0, 10.0); UISlider *slider = [[UISlider alloc] initWithFrame:...
(defun sum-list-integers (list) (reduce '+ list)) ; 10 (sum-list-integers '(1 2 3 4)) ; 55 (sum-list-integers '(1 2 3 4 5 6 7 8 9 10))
The members of a union share the same space in memory. This means that writing to one member overwrites the data in all other members and that reading from one member results in the same data as reading from all other members. However, because union members can have differing types and sizes, the da...
Customizing error messages The /resources/lang/[lang]/validation.php files contain the error messages to be used by the validator. You can edit them as needed. Most of them have placeholders which will be automatically replaced when generating the error message. For example, in 'required' => '...
Catalan numbers algorithm is Dynamic Programming algorithm. In combinatorial mathematics, the Catalan numbers form a sequence of natural numbers that occur in various counting problems, often involving recursively-defined objects. The Catalan numbers on nonnegative integers n are a set of numbers t...
Viewchild offers one way interaction from parent to child. There is no feedback or output from child when ViewChild is used. We have a DataListComponent that shows some information. DataListComponent has PagerComponent as it's child. When user makes a search on DataListComponent, it gets a data fro...
Aggregation is used to perform complex data search operations in the mongo query which can't be done in normal "find" query. Create some dummy data: db.employees.insert({"name":"Adma","dept":"Admin","languages":["german","f...
Preparing data: create table wf_example(i int, t text,ts timestamptz,b boolean); insert into wf_example select 1,'a','1970.01.01',true; insert into wf_example select 1,'a','1970.01.01',false; insert into wf_example select 1,'b','1970.01.01',false; insert into wf_example select 2,'b','1970.01.01...
The partition of an integer is a way of writing it as a sum of positive integers. For example, the partitions of the number 5 are: 5 4 + 1 3 + 2 2 + 2 + 1 2 + 1 + 1 + 1 1 + 1 + 1 + 1 + 1 Notice that changing the order of the summands will not create a different partition. The partition f...
public class IntegerPartition { public static int[,] Result = new int[100,100]; private static int Partition(int targetNumber, int largestNumber) { for (int i = 1; i <= targetNumber; i++) { for (int j = 1; j <= largestNumber; j++) ...
<?php namespace laravel\Http\Middleware; class CorsHeaders { /** * This must be executed _before_ the controller action since _after_ middleware isn't executed when exceptions are thrown and caught by global handlers. * * @param $request * @param \Closure $next * @pa...
Go to the [https://developers.facebook.com/](https://developers.facebook.com/) and create your app. Click Add product and choose Facebook Login
Persistence is created in docker containers using volumes. Let's create a Limesurvey container and persist the database, uploaded content and configuration in a named volume: docker volume create --name mysql docker volume create --name upload docker run -d --name limesurvey -v mysql:/var/lib/m...
Parameters of these operators are lhs and rhs operator== tests if both elements on lhs and rhs pair are equal. The return value is true if both lhs.first == rhs.first AND lhs.second == rhs.second, otherwise false std::pair<int, int> p1 = std::make_pair(1, 2); std::pair<int, int> ...
# Define which servers to include in the load balancing scheme. # It's best to use the servers' private IPs for better performance and security. upstream backend { ip_hash; server 10.10.10.10 slow_start=30s max_fails=3 fail_timeout=15s; server 10.10.10.12 slow_start=30s max_fa...
XML <House> <LivingRoom> <plant name="rose"/> </LivingRoom> <TerraceGarden> <plant name="passion fruit"/> <plant name="lily"/> <plant name="golden duranta"/> ...
SELECT CURRENT_DATE + '1 day'::INTERVAL SELECT '1999-12-11'::TIMESTAMP + '19 days'::INTERVAL SELECT '1 month'::INTERVAL + '1 month 3 days'::INTERVAL

Page 311 of 417