Tutorial by Examples: f

This query selects all employees not on the Supervisors table. SELECT * FROM Employees WHERE EmployeeID not in (SELECT EmployeeID FROM Supervisors) The same results can be achieved using a LEFT JOIN. SELECT * FROM Employees AS e LEFT JOIN Supervisors AS s ON s.E...
Jasmine can spy on an existing function using the spyOn function. let calculator = { multiply: function(a, b) { return a * b; }, square: function(a) { return this.multiply(a, a); } } describe('calculator', function() { it('squares numbers by multiplying them by the...
The procedure describes how to add an Object library reference, and afterwards how to declare new variables with reference to the new library class objects. The example below shows how to add the PowerPoint library to the existing VB Project. As can be seen, currently the PowerPoint Object library...
In Haskell, data types can have arguments just like functions. Take the Maybe type for example. Maybe is a very useful type which allows us to represent the idea of failure, or the possiblity thereof. In other words, if there is a possibility that a computation will fail, we use the Maybe type ther...
Analog to get a collection for a Stream by collect() an array can be obtained by the Stream.toArray() method: List<String> fruits = Arrays.asList("apple", "banana", "pear", "kiwi", "orange"); String[] filteredFruits = fruits.stream() ....
Table file with header, footer, row names, and index column: file: table.txt This is a header that discusses the table file to show space in a generic table file index name occupation 1 Alice Salesman 2 Bob Engineer 3 Charlie Janitor This is a footer becaus...
Introduction The BufferedReader class is a wrapper for other Reader classes that serves two main purposes: A BufferedReader provides buffering for the wrapped Reader. This allows an application to read characters one at a time without undue I/O overheads. A BufferedReader provides functi...
An array of strings can mean a couple of things: An array whose elements are char *s An array whose elements are arrays of chars We can create an array of character pointers like so: char * string_array[] = { "foo", "bar", "baz" }; Remember: w...
A minimal CMake project file that uses Qt5 can be: cmake_minimum_required(VERSION 2.8.11) project(myproject) find_package(Qt5 5.7.0 REQUIRED COMPONENTS Core ) set(CMAKE_AUTOMOC ON) add_executable(${PROJECT_NAME} main.cpp ) target_link_libraries(${PROJECT_NAME} Qt5::C...
Using the default constructor T variable = Activator.CreateInstance(typeof(T)); Using parameterized constructor T variable = Activator.CreateInstance(typeof(T), arg1, arg2);
Occasionally you'd want to catch an exception and throw it from a different thread or method while preserving the original exception stack. This can be done with ExceptionDispatchInfo: using System.Runtime.ExceptionServices; void Main() { ExceptionDispatchInfo capturedException = null; ...
To install Eclipse RCP follow the steps : Download Eclipse RCP/RAP version from Eclipse.org Eclipse RCP/RAP project downloading URL
Messages printed from NSLog are displayed on Console.app even in the release build of your app, which doesn't make sense for printouts that are only useful for debugging. To fix this, you can use this macro for debug logging instead of NSLog. #ifdef DEBUG #define DLog(...) NSLog(__VA_ARGS__) #els...
To use Leaflet, load its stylesheet and JavaScript file to your page: <link rel="stylesheet" href="/css/leaflet.css" /> <script src="/js/leaflet.js"></script> These resources can be downloaded from a variety of locations such as Leaflet's homepage...
First, import the libraries that work with files: from os import listdir from os.path import isfile, join, exists A helper function to read only files from a directory: def get_files(path): for file in listdir(path): full_path = join(path, file) if isfile(full_path): ...
Syntax: add_months(p_date, integer) return date; Add_months function adds amt months to p_date date. SELECT add_months(date'2015-01-12', 2) m FROM dual; M2015-03-12 You can also substract months using a negative amt SELECT add_months(date'2015-01-12', -2) m FROM dual; M2014-11-12 When the...
public static class ThreadLocalExample { private static final ThreadLocal<SimpleDateFormat> format = ThreadLocal.withInitial(() -> new SimpleDateFormat("yyyyMMdd_HHmm")); public String formatDate(Date date) { return format.get().format(date); ...
where clause By adding a where clause you can restrict the iterations to ones that satisfy the given condition. for i in 0..<5 where i % 2 == 0 { print(i) } // 0 // 2 // 4 let names = ["James", "Emily", "Miles"] for name in names where name.c...
PHP has great official documentation already at http://php.net/manual/. The PHP Manual documents pretty much all language features, the core libraries and most available extensions. There are plenty of examples to learn from. The PHP Manual is available in multiple languages and formats. Best of al...
NSArray *array = @[ @{ @"id": @"7CDF6D22-8D36-49C2-84FE-E31EECCECB71", @"title": @"Jackie Chan Strike Movie", @"url": @"http://abc.com/playback.m3u8&...

Page 79 of 457