Tutorial by Examples: and

From the Welcome to Android Studio dialogue box, select New Project... to open the Create New Project dialog. In the New Android Application dialog, under Application name, specify an appropriate application name. The remainder of this tutorial uses BasicMapSolution as the application name....
Array Implementation #include<stdio.h> #define MAX 100000 //Global variables int top = -1; int a[MAX]; void push(int x){ if(top == MAX-1){ // Check whether stack is full printf("Stack Overflow\n"); retur...
var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 50); camera.position.z = 25; var renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); document.body.appendChild(renderer.domElemen...
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 ...
One of the ways to think about the commands that should be executed, to edit a text in a certain manner, is as entire sentences. A command is an action performed on an object. Therefore it has a verb: :normal i " insert :normal a " append :normal c " overwrite :normal y ...
The idea is to measure a layout before and after each change and if there is a significant change you can be somewhat certain that its the softkeyboard. // A variable to hold the last content layout hight private int mLastContentHeight = 0; private ViewTreeObserver.OnGlobalLayoutListener keyboa...
//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) (...
# 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...
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 ...
A function can only return a single value but there's one way around that: the parameters are not limited to input parameters. You can declare INPUT, OUTPUT and INPUT-OUTPUT parameters. Unlike INPUT parameters you must specify OUTPUT or INPUT-OUTPUT before the parameters. Some coding conventions m...
Below example shows ways to read and write csv file without any third party libraries. Write CSV public void writeToCsvFile(List<String[]> thingsToWrite, String separator, String fileName){ try (FileWriter writer = new FileWriter(fileName)){ for (String[] strings : thingsToWrit...
Firstly, you'll need to add the crate into your Cargo.toml file as a dependency. [dependencies] rand = "0.3" This will retrieve the rand crate from crates.io. Next, add this to your crate root. extern crate rand; As this example is going to provide a simple output through the term...
To generate characters, you can utilize the thread-local random number generator function, random. fn main() { let tuple = rand::random::<(f64, char)>(); println!("{:?}", tuple) } For occasional or singular requests, such as the one above, this is a reasonable efficien...
The procedures Create, Put_Line, Close from the package Ada.Text_IO is used to create and write to the file file.txt. with Ada.Text_IO; procedure Main is use Ada.Text_IO; F : File_Type; begin Create (F, Out_File, "file.txt"); Put_Line (F, "This string will be writ...
When using "controller as syntax" you would give your controller an alias in the html when using the ng-controller directive. <div ng-controller="MainCtrl as main"> </div> You can then access properties and methods from the main variable that represents our contr...
A keyword is "MONARCHY" then the matrix will look like The matrix is constructed by filling in the letters of the keyword (minus duplicates) from left to right and from top to bottom, and then filling in the remainder of the matrix with the remaining letters in alphabetic order. Plai...
Generally you should always define all variable and parameters as NO-UNDO unless you really need to. DEFINE VARIABLE cString AS CHARACTER NO-UNDO. cString = "HELLO". DISPLAY cString.
Declare @Text nvarchar(max) Declare @Value int SET @Text = 'Text' SET @Value = 0

Page 125 of 153