Tutorial by Examples: pre

Consider the Binary Tree: Pre-order traversal(root) is traversing the node then left sub-tree of the node and then the right sub-tree of the node. So the pre-order traversal of above tree will be: 1 2 4 5 3 6 7 In-order traversal(root) is traversing the left sub-tree of the node then the node ...
CIDER function cider-insert-last-sexp-in-repl can be used to execute the the code while editing the code inside the buffer and get the output pretty printed in a different buffer. This function is by default binded to C-c C-p. CIDER manual says C-c C-p will Evaluate the form preceding point and ...
//MySingletonClass.h @interface MYSingletonClass : NSObject + (instancetype)sharedInstance; -(instancetype)init NS_UNAVAILABLE; -(instancetype)new NS_UNAVAILABLE; @end //MySingletonClass.m @implementation MySingletonClass + (instancetype)sharedInstance { static MySingleto...
An anonymous function can be defined without a name through a Lambda Expression. For defining these type of functions, the keyword lambda is used instead of the keyword defun. The following lines are all equivalent and define anonymous functions which output the sum of two numbers: (lambda (x y) (...
DEFINE QUERY q1 FOR Customer. OPEN QUERY q1 FOR EACH Customer. GET FIRST q1. loop: REPEAT: IF AVAILABLE Customer THEN DO: DISPLAY Customer.NAME CustNum WITH FRAME frClient TITLE "Client data". DISPLAY "(P)revious" SKIP ...
In this example we will use the Business layer in Presentation layer. And we will use MVC as example of Presentation layer (but you can use any other Presentation layer). We need first to register the IoC (we will use Unity, but you can use any IoC), then write our Presentation layer 3-1 Register ...
Python includes a profiler called cProfile. This is generally preferred over using timeit. It breaks down your entire script and for each method in your script it tells you: ncalls: The number of times a method was called tottime: Total time spent in the given function (excluding time made in c...
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(pullToRefresh:) forControlEvents:UIControlEventValueChanged]; self.scrollView.alwaysBounceVertical = YES; [self.scrollView addSubview:refreshControl]; - (void)pullToRefresh:(UIRe...
Set createVBScriptRegExObject = CreateObject("vbscript.RegExp") Tools> References> Microsoft VBScript Regular Expressions #.# Associated DLL: VBScript.dll Source: Internet Explorer 1.0 and 5.5 MSDN-Microsoft Beefs Up VBScript with Regular Expressions MSDN-Regular Expression ...
$ grep root /etc/passwd root:x:0:0:root:/root:/bin/bash operator:x:11:0:operator:/root:/sbin/nologin
$ egrep '^(0|1)+ [a-zA-Z]+$' searchfile.txt 011 AaBBS
$ fgrep "." .bashrc # will match lines with a dot.
How To Choose A Theme Each WordPress install comes with a pre-installed theme. You manage your themes from the Dashboard. Go to Appearance > Themes to install, preview, delete, activate, and update Themes. The current theme is found in the upper left corner of this menu. Hovering over the theme...
This method will create a new Excel Spreadsheet. Pass in the fileName which is a full file path name. using DocumentFormat.OpenXml; using DocumentFormat.OpenXml.Packaging; using DocumentFormat.OpenXml.Spreadsheet; using System; .... void Create(string fileName) { using (Sp...
If you need to extract information from a text response, the easiest way is to use Regular Expressions. The matching pattern is very similar to the one used in Perl. Let’s assume we want to test a flight ticket purchase workflow. The first step is to submit the purchase operation. The next step is t...
Returns the expression as an array. @(Get-ChildItem $env:windir\System32\ntdll.dll) Will return an array with one item @(Get-ChildItem $env:windir\System32) Will return an array with all the items in the folder (which is not a change of behavior from the inner expression.
This is an example of an attribute that I created to validate that required parameters have been assigned in the request object receive in a POST route. I decided on this approach because the standard ModelState.IsValid approach was not valid. This is because the required attributes vary based on wh...
[HttpPost] [Route("api/Fitbit/Activity/Stats")] public async Task<HttpResponseMessage> ActivityStats(FitbitRequestDTO request) { if (string.IsNullOrEmpty(request.PatientId) || string.IsNullOrEmpty(request.DeviceId)) ret...
A very common use-case in web applications is performing multiple asynchronous (eg. HTTP) requests and gathering their results as they arrive or all of them at once (eg. in Angular2 with the HTTP service). 1. Gathering async responses one by one as they arrive This is typically done with mergeMap(...
See Missing values for details. > TRUE & NA [1] NA > FALSE & NA [1] FALSE > TRUE || NA [1] TRUE > FALSE || NA [1] NA

Page 30 of 34