Tutorial by Examples: er

Visual Studio also features an available Bundler and Minifier Extension that is capable of handling this process for you. The extension allows you to easily select and bundle the files you need without writing a line of code. Building Your Bundles After installing the extension, you select all of ...
At its most basic level, Unit Testing in any language provides assertions against some known or expected output. function assert( outcome, description ) { var passFail = outcome ? 'pass' : 'fail'; console.log(passFail, ': ', description); return outcome; }; The popular assertio...
To run multiple processes e.g. an Apache web server together with an SSH daemon inside the same container you can use supervisord. Create your supervisord.conf configuration file like: [supervisord] nodaemon=true [program:sshd] command=/usr/sbin/sshd -D [program:apache2] command=/bin/bash...
uses System.Generics.Collections, { TArray } System.Generics.Defaults; { TComparer<T> } var StringArray: TArray<string>; { Also works with "array of string" } ... { Sorts the array case insensitive } TArray.Sort<string>(StringArray, TComparer<string>...
Elm allows the definition of custom infix operators. Infix operators are defined using parenthesis around the name of a function. Consider this example of infix operator for construction Tuples 1 => True -- (1, True): (=>) : a -> b -> ( a, b ) (=>) a b = ( a, b ) Most of t...
Value constructors are functions that return a value of a data type. Because of this, just like any other function, they can take one or more parameters: data Foo = Bar String Int | Biz String Let's check the type of the Bar value constructor. :t Bar prints Bar :: String -> Int -> Foo...
Type constructors can take one or more type parameters: data Foo a b = Bar a b | Biz a b Type parameters in Haskell must begin with a lowercase letter. Our custom data type is not a real type yet. In order to create values of our type, we must substitute all type parameters with actual types. Be...
A lot of Vim users find the Esc too hard to reach, and end up finding another mapping that's easy to reach from the home row. Note that Ctrl-[ may be equivalent to Esc on an English keyboard, and is much easier to reach. jk inoremap jk <ESC> This one is really easy to trigger; just smash...
Strict mode does not allow you to use duplicate function parameter names. function foo(bar, bar) {} // No error. bar is set to the final argument when called "use strict"; function foo(bar, bar) {}; // SyntaxError: duplicate formal argument bar
;Sends the keystroke for the letter "a" every 3 seconds. #Persistent SetTimer, SendLetterA, 3000 return SendLetterA() { Send, a }
This is an example of something that would have been straight up impossible with labels. If you execute the same label multiple times at the same time and they rely on variables that are being defined within them, they very likely interfere and cause unexpected behavior. Here is how to do it with f...
The ref keyword is used to pass an Argument as Reference. out will do the same as ref but it does not require an assigned value by the caller prior to calling the function. Ref Parameter :-If you want to pass a variable as ref parameter then you need to initialize it before you pass it as ref param...
In Swift, memory management is done for you automatically using Automatic Reference Counting. (See Memory Management) Allocation is the process of reserving a spot in memory for an object, and in Swift understanding the performance of such requires some understanding of the heap and the stack. The h...
Assume we want to create a data type Person, which has a first and last name, an age, a phone number, a street, a zip code and a town. We could write data Person = Person String String Int Int String String String If we want now to get the phone number, we need to make a function getPhone :: P...
defmodule ATest do use ExUnit.Case [{1, 2, 3}, {10, 20, 40}, {100, 200, 300}] |> Enum.each(fn {a, b, c} -> test "#{a} + #{b} = #{c}" do assert unquote(a) + unquote(b) = unquote(c) end end) end Output: . 1) test 10 + 20 = 40 (Test.Test) t...
With ASP.NET Core the Microsoft team also introduced the Options pattern, which allows to have strong typed options and once configured the ability to inject the options into your services. First we start with a strong typed class, which will hold our configuration. public class MySettings { ...
This error occurs when tables are not adequately structured to handle the speedy lookup verification of Foreign Key (FK) requirements that the developer is mandating. CREATE TABLE `gtType` ( `type` char(2) NOT NULL, `description` varchar(1000) NOT NULL, PRIMARY KEY (`type`) ) ENGINE=InnoD...
When testing for any of several equality comparisons: if a == 3 or b == 3 or c == 3: it is tempting to abbreviate this to if a or b or c == 3: # Wrong This is wrong; the or operator has lower precedence than ==, so the expression will be evaluated as if (a) or (b) or (c == 3):. The correct w...
My.Computer.Network.DownloadFile("ftp://server.my/myfile.txt", "donwloaded_file.txt") This command download myfile.txt file from server named server.my and saves it as donwloaded_file.txt into working directory. You can specify absolute path for downloaded file.
My.Computer.Network.DownloadFile("ftp://srv.my/myfile.txt", "donwload.txt", "Peter", "1234") This command download myfile.txt file from server named srv.my and saves it as donwload.txt into working directory. You can specify absolute path for downloaded fil...

Page 173 of 417