Tutorial by Examples

With implicit keys: key: value another key: - some - more - values [1, 2, 3]: last value, which has a flow style key With implicit and explicit keys: ? key : value another key: - some - more - values ? [1, 2, 3] : last value, which has a flow style key key, another ...
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';
Let's say your launch activity is called MainActivity, in your app com.example.myapp. In the manifest: <activity android:name=".MainActivity" > <intent-filter> <action android:name="android.intent.action.MAIN"/> ...
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)...
Bridge pattern decouples abstraction from implementation so that both can vary independently. It has been achieved with composition rather than inheritance. Bridge UML diagram from wikipedia: You have four components in this pattern. Abstraction: It defines an interface RefinedAbstraction: It ...
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, ...
If the value of the href-attribute begins with tel:, your device will dial the number when you click it. This works on mobile devices or on computers/tablets running software – like Skype or FaceTime – that can make phone calls. <a href="tel:11234567890">Call us</a> Most de...
SUB function allows to substitute text inside awk sub(regexp, replacement, target) where regexp could be a full regular expression $ cat file AAAAA BBBB CCCC DDDD EEEE FFFF GGGG $ awk '{sub("AAA","XXX", $0); print}' file XXXAA BBBB CCCC DDDD EEEE FFFF GGGG ...
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...

Page 539 of 1336