Tutorial by Examples: er

iex> [1, 2, 3] -- [1, 3] [2] -- removes the first occurrence of an item on the left list for each item on the right.
Use in operator to check if an element is a member of a list. iex> 2 in [1, 2, 3] true iex> "bob" in [1, 2, 3] false
{ "name": "your/package", "license": "proprietary", "type": "project", "description": "How to load an external private Composer package.", ... "require": { "your/priv...
The Kotlin Standard Library also provides numerous useful functions to iteratively work upon collections. For example, the map function can be used to transform a list of items. val numbers = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 0) val numberStrings = numbers.map { "Number $it" } One of...
Ordering the results and setting a limit can easily be achieved with 2 additional lines added to the chain, like so: $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*') ->from('#__users') ->where('username = '. $db->q('John')) ->ord...
A simple query that selects all users from the #__users table with a username that matches John $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*'); $query->from('#__users'); $query->where('username = '. $db->q('John')); $db->setQuery($query); ...
POSIX/IEEE Open Group Base Specification says: [2addr] s/BRE/replacement/flags Substitute the replacement string for instances of the BRE in the pattern space. Any character other than backslash or newline can be used instead of a slash to delimit the BRE and the replacement. Within the BRE a...
Encapsulation is a basic concept in OOP. It is about wrapping data and code as a single unit. In this case, it is a good practice to declare the variables as private and then access them through Getters and Setters to view and/or modify them. public class Sample { private String name; privat...
In order to ssh into a server your identity's public key has to be added to the list of trusted keys. Most commonly this is done per-user: ssh-copy-id -i ~/.ssh/<identity>.pub <user>@<hostname> Which can be also done manually: cat ~/.ssh/<identity>.pub | ssh <user>...
Coming from imperative languages many developers wonder how to write a for-loop that exits early as F# doesn't support break, continue or return. The answer in F# is to use tail-recursion which is a flexible and idiomatic way to iterate while still providing excellent performance. Say we want to ...
The Oracle Java Style Guide states: Modifiers should not be written out when they are implicit. (See Modifiers in Oracle Official Code Standard for the context and a link to the actual Oracle document.) This style guidance applies particularly to interfaces. Let's consider the following code ...
This example shows how PLINQ can be used to calculate the even numbers between 1 and 10,000 using multiple threads. Order will be maintained in the resulting list, however keep in mind that AsOrdered may hurt performance for a large numbers of elements, so un-ordered processing is preferred when pos...
Ordered sequences may hurt performance when dealing with a large number of elements. To mitigate this, it's possible to call AsUnordered when the sequence order is no longer necessary. var sequence = Enumerable.Range(1, 10000).Select(x => -1 * x); // -1, -2, ... var evenNumbers = sequence.AsPar...
Derives from Object Key members public Dispatcher Dispatcher { get; } Summary Most objects in WPF derive from DispatcherObject, which provides the basic constructs for dealing with concurrency and threading. Such objects are associated with a Dispatcher. Only the thread that the Dispatcher w...
A typical use case for SpriteKit is where the SKView fills the whole screen. To do this in Xcode's Interface Builder, first create a normal ViewController, then select the contained view and change its Class from UIView to SKView: Within the code for the View Controller, in the viewDidLoad metho...
In case your activities, fragments and UI require some background processing a good thing to use is a MockWebServer which runs localy on an android device which brings a closed and testable enviroment for your UI. https://github.com/square/okhttp/tree/master/mockwebserver First step is including t...
This is the basic HTML file that can be used as a boilerplate when starting a project. This boilerplate uses orbit controls with damping (camera that can move around an object with deceleration effect) and creates a spinning cube. <!DOCTYPE html> <html> <head> <t...
One of the most common errors in compilation happens during the linking stage. The error looks similar to this: $ gcc undefined_reference.c /tmp/ccoXhwF0.o: In function `main': undefined_reference.c:(.text+0x15): undefined reference to `foo' collect2: error: ld returned 1 exit status $ So l...
UIBezierPath using to create a circular path ShapeLayer CAShapeLayer *circleLayer = [CAShapeLayer layer]; [circleLayer setPath:[[UIBezierPath bezierPathWithOvalInRect: CGRectMake(50, 50, 100, 100)] CGPath]]; circleLayer.lineWidth = 2.0; [circleLayer setStrokeColor:[[UIColor redColor] CGColor]];...
Const baseString As String = "Hello World" Dim charLength As Long charLength = Len(baseString) 'charlength = 11

Page 151 of 417