Tutorial by Examples: ee

This code takes advantage of the Sort class in the Microsoft Excel Object Library. For further reading, see: Copy a range to a virtual range How to copy selected range into given array? Sub testExcelSort() Dim arr As Variant InitArray arr ExcelSort arr End Sub Private Su...
For example if the input is: Output should be false: As 4 in the left sub-tree is greater than the root value(3) If the input is: Output should be true
struct tree{ int a; tree* right; tree* left; }; tree* root=NULL; void insert(tree*& in, int b){ if(in){ if(in->a<b) insert(in->right,b); else if(in->a>b) insert(in->left,b); ...
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 ...
Glass.Mapper.Sc allows you to move your data from Sitecore and into your code seamlessly using strongly typed objects. The framework allows you to map data on to c# classes and interfaces without any additional mark-up. As the data is mapped to your target objects it is converted to the target type...
For example if the inputs are: Example:1 a) b) Output should be true. Example:2 If the inputs are: a) b) Output should be false. Pseudo code for the same: boolean sameTree(node root1, node root2){ if(root1 == NULL && root2 == NULL) return true; if(root1 == NULL ...
PDO::setAttribute sets an attribute on the database handle. Desctiption of setAttribute is: public bool PDO::setAttribute ( int $attribute , mixed $value ) PDO::ATTR_ERRMODE: This attribute is used for error reporting. It can have one of the following values. PDO::ERRMODE_SILENT: If the ATTR...
# Print the working directory import os print os.getcwd() # C:\Python27\Scripts # Set the working directory os.chdir('C:/Users/general1/Documents/simple Python files') print os.getcwd() # C:\Users\general1\Documents\simple Python files # load pandas import pandas as pd # read a csv d...
The source code can be cloned or downloaded from GitHub to test it. node('iOS Node') { stage('Checkout/Build/Test') { // Checkout files. checkout([ $class: 'GitSCM', branches: [[name: 'master']], doGenerateSubmoduleConfigurations: fa...
A number of the demonstration macros within this part requires a function which I will explain later. For the moment, please just copy GetFldrNames() to a suitable module. I use this function frequently and keep it, and other like it that I use in many different macros, in a module named “ModGloba...
Objective C AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc]init]; AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@"Some text"]; [utterance setRate:0.2f]; [synthesizer speakUtterance:utterance]; Swift let synthesizer = AVSpeechSynthesizer...
The Search API provides access to recent tweets*. This is as opposed to the Stream API, which provides search results in real-time. <example> *Note that "the Search API is focused on relevance and not completeness" - Twitter Search API
The Stream API provides access to tweets in real-time. Streams can be filtered based on keywords, language, location, and more. Here's a simple example to track mentions of the word "tweepy": #set up a new class using tweepy.StreamListener class SimpleListener(tweepy.StreamListener): ...
app.module.ts import {routes} from "./app.routes"; @NgModule({ declarations: [AppComponent], imports: [BrowserModule, mainModule.forRoot(), RouterModule.forRoot(routes)], providers: [], bootstrap: [AppComponent] }) export class AppModule { } app.routes.t...
Recursion is easy - RUN the procedure itself from inside the procedure. However if you recurse too far the stack will run out of space. A procedure calculation the factorial. PROCEDURE factorial: DEFINE INPUT PARAMETER piNum AS INTEGER NO-UNDO. DEFINE OUTPUT PARAMETER piFac AS INTEG...
Incorrect Code Sub DoSomething() GoSub DoThis DoThis: Debug.Print "Hi!" Return End Sub Why doesn't this work? Execution enters the DoSomething procedure, jumps to the DoThis label, prints "Hi!" to the debug output, returns to the instruction immediately afte...
Incorrect code Sub DoSomething() Dim row As Integer For row = 1 To 100000 'do stuff Next End Sub Why doesn't this work? The Integer data type is a 16-bit signed integer with a maximum value of 32,767; assigning it to anything larger than that will overflow the type and ...
Incorrect code Sub DoSomething() Dim foo(1 To 10) Dim i As Long For i = 1 To 100 foo(i) = i Next End Sub Why doesn't this work? foo is an array that contains 10 items. When the i loop counter reaches a value of 11, foo(i) is out of range. This error occurs whenever...
Incorrect code Public Sub DoSomething() DoSomethingElse "42?" End Sub Private Sub DoSomethingElse(foo As Date) ' Debug.Print MonthName(Month(foo)) End Sub Why doesn't this work? VBA is trying really hard to convert the "42?" argument into a Date value. When it ...
Incorrect code Sub DoSomething() Dim foo As Collection With foo .Add "ABC" .Add "XYZ" End With End Sub Why doesn't this work? Object variables hold a reference, and references need to be set using the Set keyword. This error occurs whenever ...

Page 44 of 54