Tutorial by Examples: al

Sample Data: CREATE TABLE table_name ( id, list ) AS SELECT 1, 'a,b,c,d' FROM DUAL UNION ALL -- Multiple items in the list SELECT 2, 'e' FROM DUAL UNION ALL -- Single item in the list SELECT 3, NULL FROM DUAL UNION ALL -- NULL list SELECT 4, 'f,,g' FROM DUAL; -- NULL item...
Often people try to index some content and then find it. If they cannot see the expected result, they try to troubleshoot the whole end-to-end process. The better way is to see whether the content actually indexed in the expected fields. This way it splits the problem into two: indexing and searchin...
var dict = ["name": "John", "surname": "Doe"] // Set the element with key: 'name' to 'Jane' dict["name"] = "Jane" print(dict)
let myAllKeys = ["name" : "Kirit" , "surname" : "Modi"] let allKeys = Array(myAllKeys.keys) print(allKeys)
We can match on lists like any other data type, though they are somewhat unique, in that the constructor for building up lists is the infix function ::. (See the example Creating a list for more on how that works.) matchMyList : List SomeType -> SomeOtherType matchMyList myList = case myL...
Moment is a javascript library that was designed to make working with dates and times less time-consuming and more intuitive. You can easily start using this library by installing it in you web-app by using one of the following guides. Browser You can either download the JS file from the official...
If you're ever dealing with C Binary API's from Perl Code, via the syscall, ioctl, or fcntl functions, you need to know how to construct memory in a C Compatible way. For instance, if you were ever dealing with some function that expected a timespec, you'd look into /usr/include/time.h and find: s...
String literals imply no escaping or interpolation ( with the exception of quoting string terminators ) print 'This is a string literal\n'; # emits a literal \ and n to terminal print 'This literal contains a \'postraphe '; # emits the ' but not its preceding \ You can use alternative quoting...
Step 1. Install Java 7 or 8 Step 2. Download Apache Kafka at: http://kafka.apache.org/downloads.html For example, we will try download Apache Kafka 0.10.0.0 Step 3. Extract the compressed file. On Linux: tar -xzf kafka_2.11-0.10.0.0.tgz On Window: Right click --> Extract here Step 4. Sta...
A common pitfall of child classes is that, if your parent and child both contain a constructor(__construct()) method, only the child class constructor will run. There may be occasions where you need to run the parent __construct() method from it's child. If you need to do that, then you will need to...
Instructions on installing Laravel 5.1 on a Linux/Mac/Unix Machine. Before initiating the installation, check if the following requirements are met: PHP >= 5.5.9 OpenSSL PHP Extension PDO PHP Extension Mbstring PHP Extension Tokenizer PHP Extension Let's begin the installation: Inst...
In the Project.pro file we add : CONFIG += sql in MainWindow.h we write : #include <QMainWindow> #include <QSql> #include <QDebug> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget...
In the Project.pro file we add : CONFIG += sql in MainWindow.h we write : #include <QMainWindow> #include <QSql> #include <QDebug> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget...
Due to logical query processing order, alias can be used in order by. SELECT DisplayName, JoinDate as jd, Reputation as rep FROM Users ORDER BY jd, rep And can use relative order of the columns in the select statement .Consider the same example as above and instead of using alias use the relat...
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): ...
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); ...
Java ThreadLocal is used to create thread local variables. It is known that threads of an Object share it’s variables, so the variable is not thread safe. We can use synchronization for thread safety but if we want to avoid synchronization,ThreadLocal allows us to create variables which are local to...
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...
If you need to call an Objective-C method from C code, you have two ways: using objc_msgSend, or obtaining the IMP (method implementation function pointer) and calling that. #import <objc/objc.h> @implementation Example - (double)negate:(double)value { return -value; } - (doubl...
// *** Find all the objects which is of type movie, Both the syntax are valid *** NSPredicate *filterByMovieType = [NSPredicate predicateWithFormat:@"self.isMovie = %@",@1]; // OR //NSPredicate *filterByMovieType = [NSPredicate predicateWithFormat:@"self.isMovie = %@",[NSNumbe...

Page 50 of 269