Tutorial by Examples: f

iex(1)> i :ok Term :ok Data type Atom Reference modules Atom iex(2)> x = "mystring" "mystring" iex(3)> i x Term "mystring" Data type BitString Byte size 8 Description This is a string: a UTF-8 encoded binary. It's printed surround...
#You can use pattern matching to run different #functions based on which parameters you pass #This example uses pattern matching to start, #run, and end a recursive function defmodule Counter do def count_to do count_to(100, 0) #No argument, init with 100 end def ...
A standard toast notification appears at the bottom of the screen aligned in horizontal centre. You can change this position with the setGravity(int, int, int). This accepts three parameters: a Gravity constant, an x-position offset, and a y-position offset. For example, if you decide that the toas...
p { margin:1px; /* 1px margin in all directions */ /*equals to:*/ margin:1px 1px; /*equals to:*/ margin:1px 1px 1px; /*equals to:*/ margin:1px 1px 1px 1px; } Another exapmle: p{ margin:10px 15px; /...
g$ The above matches one letter (the letter g) at the end of a string in most regex engines (not in Oniguruma, where the $ anchor matches the end of a line by default, and the m (MULTILINE) modifier is used to make a . match any characters including line break characters, as a DOTALL modifier in ...
my $filename = '/path/to/file'; open my $fh, '<', $filename or die "Failed to open file: $filename"; # You can then either read the file one line at a time... while(chomp(my $line = <$fh>)) { print $line . "\n"; } # ...or read whole file into an arra...
You can use subqueries to define a temporary table and use it in the FROM clause of an "outer" query. SELECT * FROM (SELECT city, temp_hi - temp_lo AS temp_var FROM weather) AS w WHERE temp_var > 20; The above finds cities from the weather table whose daily temperature variation i...
StackExchange.Redis also supports sending bytes over the pub/sub channel, here we use protobuf-net to serialize our message to a byte array before sending it: // definition of a message (marked up with Protobuf attributes) [ProtoContract] public class ChatMessage { [ProtoMember(1)] pub...
Users can add formatting to contenteditable documents or elements using their browser's features, such as common keyboard shortcuts for formatting (Ctrl-B for bold, Ctrl-I for italic, etc.) or by dragging and dropping images, links, or markup from the clipboard. Additionally, developers can use Jav...
If you want to get rid of the username field and use email as unique user identifier, you will have to create a custom User model extending AbstractBaseUser instead of AbstractUser. Indeed, username and email are defined in AbstractUser and you can't override them. This means you will also have to r...
Below you could find the table Employees with a reference to the table Cities. CREATE TABLE Cities( CityID INT IDENTITY(1,1) NOT NULL, Name VARCHAR(20) NOT NULL, Zip VARCHAR(10) NOT NULL ); CREATE TABLE Employees( EmployeeID INT IDENTITY (1,1) NOT NULL, FirstName VARCHA...
You can specify a column that contains dates so pandas would automatically parse them when reading from the csv pandas.read_csv('data_file.csv', parse_dates=['date_column'])
A recursive function is a function that calls itself in its definition. For example the mathematical function, factorial, defined by factorial(n) = n*(n-1)*(n-2)*...*3*2*1. can be programmed as def factorial(n): #n here should be an integer if n == 0: return 1 else: ...
Used to obtain the size in bytes for an unmanaged type int byteSize = sizeof(byte) // 1 int sbyteSize = sizeof(sbyte) // 1 int shortSize = sizeof(short) // 2 int ushortSize = sizeof(ushort) // 2 int intSize = sizeof(int) // 4 int uintSize = sizeof(uint) // 4 int longSize = sizeof(long) // 8 ...
FlashDevelop is a multi-platform open source IDE created in 2005 for Flash developers. With no cost, it's a very popular way to get started developing with AS3. To Install FlashDevelop: Download The Installation File and run the installer Once installation is complete, run FlashDevelop. On the ...
from http://flex.apache.org/doc-getstarted.html Download the SDK installer Run the SDK installer. The first question you will be asked is the installation directory. on a Mac, use /Applications/Adobe Flash Builder 4.7/sdks/4.14.0/ on a PC, use C:\Program Files(x86)\Adobe Flash Builder ...
Swift let frame = CGRect(x: 0, y: 0, width: 100, height: 100) let textField = UITextField(frame: frame) Objective-C CGRect *frame = CGRectMake(0, 0, 100, 100); UITextField *textField = [[UITextField alloc] initWithFrame:frame]; Interface Builder You can also add a UITextField to a storybo...
List.map : (a -> b) -> List a -> List b is a higher-order function that applies a one-parameter function to each element of a list, returning a new list with the modified values. import String ourList : List String ourList = ["wubba", "lubba", "dub",...
List.filter : (a -> Bool) -> List a -> List a is a higher-order function which takes a one-parameter function from any value to a boolean, and applies that function to every element of a given list, keeping only those elements for which the function returns True on. The function that List.f...
def multiply(factor: Int)(numberToBeMultiplied: Int): Int = factor * numberToBeMultiplied val multiplyBy3 = multiply(3)_ // resulting function signature Int => Int val multiplyBy10 = multiply(10)_ // resulting function signature Int => Int val sixFromCurriedCall = multiplyBy3(2) //6...

Page 63 of 457