Tutorial by Examples: ch

In C++, you may not skip initializations with goto or switch. The following is valid in C, but not C++: goto foo; int skipped = 1; foo; These bugs may require redesign.
class Node(object): def __init__(self, val): self.l_child = None self.r_child = None self.val = val class BinarySearchTree(object): def insert(self, root, node): if root is None: return node if root.val < node.val: ...
In a Searched Case statement, each option can test one or more values independently. The code below is an example of a searched case statement: DECLARE @FirstName varchar(30) = 'John' DECLARE @LastName varchar(30) = 'Smith' SELECT CASE WHEN LEFT(@FirstName, 1) IN ('a','e','i','o','u') ...
One of the best Linux distributions currently for Raspberry Pi (from now on, "RPi") is Arch Linux. This web shows the installation for: RPi2. ARMv7 architecture (32 bits). RPi3. There are two options: ARMv7 architecture (32 bits) or AArch architecture (64 bits). This t...
If you have multiple asynchronous tasks that needs to occur one after the other, you will need to chain together their promise objects. Here is a simple example: function First() { console.log("Calling Function First"); return $.get("/ajax/GetFunction/First"); } fu...
ng-inspect is a light weight Chrome extension for debugging AngularJS applications. When a node is selected from the elements panel, the scope related info is displayed in the ng-inspect panel. Exposes few global variables for quick access of scope/isolateScope. $s -- scope of the select...
Since both R and regex share the escape character ,"\", building correct patterns for grep, sub, gsub or any other function that accepts a pattern argument will often need pairing of backslashes. If you build a three item character vector in which one items has a linefeed, another a tab ch...
Example 1, Query: SELECT char_length('ABCDE') Result: 5 Example 2, Query: SELECT character_length('ABCDE') Result: 5
The following Less div.paragraph{ color: blue; } *.paragraph{ color: green; } .otherClass.paragraph{ color: red; } .paragraph.otherClass{ color: darkgrey; } .parent{ .nestedParagraph{ &:extend(.paragraph); } } Will compile into div.paragraph { colo...
In this example the microcontroller echos back the received bytes to the sender using UART RX interrupt. #include "stm32f4xx.h" UART_HandleTypeDef huart2; /* Single byte to store input */ uint8_t byte; void SystemClock_Config(void); /* UART2 Interrupt Service Routine */ void...
By default, NuGet restores packages into the packages folder in the solution root. This folder is shared between all solution projects. In some cases it is useful to change the location of the restored packages (for instance, to share them between several solutions). Its can be achieved by creating...
In case you need different settings for your various applications, there is (as of Flink 1.2) no easy way to do that. If you use the one-yarn-cluster-per-job mode of flink (i.e. you launch your scripts with: flink run -m yarn-cluster ...), here is a workaround : create a conf directory somewhe...
Sometimes you want to switch off all previously registered listeners. //Adding a normal click handler $(document).on("click",function(){ console.log("Document Clicked 1") }); //Adding another click handler $(document).on("click",function(){ console.log(&q...
<!doctype html> <html> <head> <title>Page Title</title> <meta charset="UTF-8"> <meta name="viewport" content="initial-scale=1.0"> <script src="vue.js"></script> <style> ...
The default configuration <C-b> is not the easiest to use. It'd be better to use something like ctrla. To do so, add this to tmux.conf # remap prefix from 'C-b' to 'C-a' unbind C-b set-option -g prefix C-a bind-key C-a send-prefix
In GraphQL the Schema defines the root execution queries and mutations as well as the types for your data. Schema Object Type The Person type has two fields, one is a standard Scalar type and the other represents a relationship to a list of other Person types that are 'friends'. Linking other type...
Using sequence function you can easily describe a message that calls a list of other messages. It's useful when dealing with semantics of your messages. Example 1: You are making a game engine, and you need to refresh the screen on every frame. module Video exposing (..) type Message = module Vid...
The andThen function allows update call composition. Can be used with the pipeline operator (|>) to chain updates. Example: You are making a document editor, and you want that each modification message you send to your document, you also save it: import Update.Extra exposing (andThen) import U...
# General syntax: # grep(<pattern>, <character vector>) mystring <- c('The number 5', 'The number 8', '1 is the loneliest number', 'Company, 3 is', 'Git SSH tag is [email protected]', 'My personal site is w...
var config = {}; var timeout = 120000; config.framework = 'jasmine2'; config.allScriptsTimeout = timeout; config.getPageTimeout = timeout; config.jasmineNodeOpts.isVerbose = true; config.jasmineNodeOpts.defaultTimeoutInterval = timeout; config.specs = ['qa/**/*Spec.js']; config.browserName...

Page 98 of 109