Tutorial by Examples: c

To see all the facts involving the le relation from the prelude: Coq < Search le. le_n: forall n : nat, n <= n le_S: forall n m : nat, n <= m -> n <= S m ... max_l: forall n m : nat, m <= n -> Nat.max n m = n max_r: forall n m : nat, n <= m -> Nat.max n m = m ... ...
Search for all facts involving a pattern in an hypothesis or conclusion: Coq < Search (_ + O). plus_n_O: forall n : nat, n = n + 0 The _ character serves as a wildcard, it can be used multiple times: Coq < Search (S _ <= _). le_S_n: forall n m : nat, S n <= S m -> n <= m le...
Session Types are a way to tell the compiler about the protocol you want to use to communicate between threads - not protocol as in HTTP or FTP, but the pattern of information flow between threads. This is useful since the compiler will now stop you from accidentally breaking your protocol and causi...
uses SysUtils; var S1, S2: string; begin S1 := 'Foo'; S2 := LowerCase(S1); // S2 := 'foo'; S1 := UpperCase(S2); // S1 := 'FOO';
public static int GetProcessAffinityMask(string processName = null) { Process myProcess = GetProcessByName(ref processName); int processorAffinity = (int)myProcess.ProcessorAffinity; Console.WriteLine("Process {0} Affinity Mask is : {1}", processName, ...
public static void SetProcessAffinityMask(int affinity, string processName = null) { Process myProcess = GetProcessByName(ref processName); Console.WriteLine("Process {0} Old Affinity Mask is : {1}", processName, FormatAffinity((int)myProcess.ProcessorAffinity)...
SELECT SYSDATE(); This function returns the current date and time as a value in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS format, depending on whether the function is used in a string or numeric context. It returns the date and time in the current time zone. SELECT NOW(); This function is a...
The dimension attribute on an object specifies that that object is an array. There are, in Fortran 2008, five array natures:1 explicit shape assumed shape assumed size deferred shape implied shape Take the three rank-1 arrays2 integer a, b, c dimension(5) a ! Explicit shape (default ...
- var friends = 10 case friends when 0 p you have no friends when 1 p you have a friend default p you have #{friends} friends Result is: <p>you have 10 friends</p>
example: df = pd.DataFrame({'group1' : ['A', 'A', 'A', 'A', 'B', 'B', 'B', 'B'], 'group2' : ['C', 'C', 'C', 'D', 'E', 'E', 'F', 'F'], 'B' : ['one', np.NaN, np.NaN, np.NaN, ...
A Range cannot be created or populated the same way a string would: Sub RangeTest() Dim s As String Dim r As Range 'Specific Type of Object, with members like Address, WrapText, AutoFill, etc. ' This is how we fill a String: s = "Hello World!" ' But we can...
Gnuplot is able to generate a graphic from a script file which allows for a sequence of commands necessary to draw a graphic to be executed in sequence instead of type in manually. For the purpose of this example we'll create a simple script to draw a sin(x). Create a script file Create a file si...
(This is a request for a good example that shows how to construct a SELECT using CONCAT, then prepare+execute it. Please emphasize the use of @variables versus DECLAREd variables -- it makes a big difference, and it is something that novices (include myself) stumble over.)
# example data DT = data.table(iris) DT[, Bin := cut(Sepal.Length, c(4,6,8))] summary is handy for browsing summary statistics. Besides direct usage like summary(DT), it can also be applied per-group conveniently with split: lapply(split(DT, by=c("Species", "Bin"), drop=TRU...
# example data DT = data.table(iris) DT[, Bin := cut(Sepal.Length, c(4,6,8))] To apply the same summarizing function to every column by group, we can use lapply and .SD DT[, lapply(.SD, median), by=.(Species, Bin)] # Species Bin Sepal.Length Sepal.Width Petal.Length Petal.Width # 1...
To declare a bean, simply annotate a method with the @Bean annotation or annotate a class with the @Component annotation (annotations @Service, @Repository, @Controller could be used as well). When JavaConfig encounters such a method, it will execute that method and register the return value as a b...
In molecular biology and genetics, GC-content (or guanine-cytosine content, GC% in short) is the percentage of nitrogenous bases on a DNA molecule that are either guanine or cytosine (from a possibility of four different ones, also including adenine and thymine). Using BioPython: >>> from...
Enabled directory index means that if someone access to any folder which don't contains index.php , index.html, index.htm or any other default file defined in DirectoryIndex in apache configuration then all files in that folder will be listed in browser if you try to visit that page. Often director...
java.lang.ref package provides reference-object classes, which support a limited degree of interaction with the garbage collector. Java has four main different reference types. They are: Strong Reference Weak Reference Soft Reference Phantom Reference 1. Strong Reference This is the usual...
When expecting someone to reproduce an R code that has random elements in it, the set.seed() function becomes very handy. For example, these two lines will always produce different output (because that is the whole point of random number generators): > sample(1:10,5) [1] 6 9 2 7 10 >...

Page 335 of 826