Tutorial by Examples: ti

Let's say we want to eliminate duplicated subsequence element from a string (it can be more than one). For example: 2,14,14,14,19 and convert it into: 2,14,19 Using gsub, we can achieve it: gsub("(\\d+)(,\\1)+","\\1", "2,14,14,14,19") [1] "2,14,19" ...
iex(1)> [x, y] = ["String1", "String2"] iex(2)> "#{x} #{y}" # "String1 String2"
Instead of invoking the Angular’s bootstrap code directly, wrap the bootstrap code into a function and export the function. This function can also accept parameters. import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; import { AppModule } from "./src/app&quot...
In android, every developer uses Anonymous Class (Runnable) at least once in a project. Any Anonymous Class has a reference to its parent (activity). If we perform a long-running task, the parent activity will not be destroyed until the task is ended. Example uses handler and Anonymous Runnable cla...
Sometimes you would want to start or remove an action on a specific node at a certain time. For example, you might want to stop a moving object when the user taps the screen. This becomes very helpful when a node has multiple actions and you only wants to access one of them. let move = SKAction.mov...
Objectives: Using the Spring CLI, we will create a new Spring Boot application to be deployed to Elastic Beanstalk. We will edit the generated Spring Boot application so that it will: Create a jar named aws-eb-demo.jar. Listen on port 5000. Include a single web page named index.html. ...
Sample Data: CREATE TABLE table_name ( id, list ) AS SELECT 1, 'a,b,c,d' FROM DUAL UNION ALL -- Multiple items in the list SELECT 2, 'e' FROM DUAL UNION ALL -- Single item in the list SELECT 3, NULL FROM DUAL UNION ALL -- NULL list SELECT 4, 'f,,g' FROM DUAL; -- NULL item...
Code the_title( ); Output The title of the current post or page
Code the_title( '<h1>', '</h1>' ); Output The title of the current post or page in h1 tags
Use dynamic_cast for converting pointers/references within an inheritance hierarchy. Use static_cast for ordinary type conversions. Use reinterpret_cast for low-level reinterpreting of bit patterns. Use with extreme caution. Use const_cast for casting away const/volatile. Avoid this unless you ar...
Code get_the_title(); Output The title of the current post or page
Code get_the_title( 44 ); Output The title of the post id:44.
In mathematics, especially Set Theory, we have a collection of things which is called set and we name those things as elements. We show a set with its name like A, B, C, ... or explicitly with putting its member on brace notation: {a, b, c, d, e}. Suppose we have an arbitrary element x and a set Z, ...
After you have set a few data to database and have get a structure consisting of several nodes like this; "user" : { "-KdbKcU2ptfYF2xKb5aO" : { "firstName" : "Arthur", "lastName" : "Schopenhauer", "userName&q...
Create enum of custom errors enum RegistrationError: Error { case invalidEmail case invalidPassword case invalidPhoneNumber } Create extension of RegistrationError to handle the Localized description. extension RegistrationError: LocalizedError { public var errorDescription...
Type Families are not necessarily injective. Therefore, we cannot infer the parameter from an application. For example, in servant, given a type Server a we cannot infer the type a. To solve this problem, we can use Proxy. For example, in servant, the serve function has type ... Proxy a -> Server...
Sometimes, we want some fields in the JSON string to be optional. For example, data Person = Person { firstName :: Text , lastName :: Text , age :: Maybe Int } This can be achieved by import Data.Aeson.TH $(deriveJSON ...
The expiration values of a key can be managed by a user outside of the update commands. Redis allows a user to determine the current time to live (TTL) of a key using the TTL command: TTL key This command will return the TTL of a key in seconds or will return the special values -1 or -2. A -1 ...
The following example demonstrates using Lumen in WAMP / MAMP / LAMP environments. To work with Lumen you need to setup couple of things first. Composer PHPUnit git (not required but strongly recommended) Assuming you have all these three components installed (at least you need composer), f...
Simple Hello World Application: using System; namespace HelloWorld { class Program { static void Main(string[] args) { Console.WriteLine("Hello World"); } } } Equivalent IL Code (which will be JIT compiled) // Microsoft (R) ...

Page 435 of 505