Tutorial by Examples

FOREIGN KEY constraint can be added on existing tables that are still not in relationship. Imagine that we have Company and Employee tables where Employee table CompanyId column but don't have foreign key relationship. ALTER TABLE statement enables you to add foreign key constraint on an existing c...
FOREIGN KEY columns with constraint can be added on existing tables that are still not in relationship. Imagine that we have Company and Employee tables where Employee table don't have CompanyId column. ALTER TABLE statement enables you to add new column with foreign key constraint that references ...
sys.foreignkeys system view returns information about all foreign key relationships in database: select name, OBJECT_NAME(referenced_object_id) as [parent table], OBJECT_NAME(parent_object_id) as [child table], delete_referential_action_desc, update_referential_action_desc from sys.foreign...
Create a set local set = {} -- empty set Create a set with elements by setting their value to true: local set = {pear=true, plum=true} -- or initialize by adding the value of a variable: local fruit = 'orange' local other_set = {[fruit] = true} -- adds 'orange' Add a member to the ...
Bitwise shifting can be thought as "moving" the bits either left or right, and hence changing the value of the data operated on. Left Shift The left shift operator (value) << (shift amount) will shift the bits to the left by (shift amount) bits; the new bits coming in from the righ...
Abstraction levels help determine when to split things up. Abstraction is achieved by implementing functionality with increasingly detailed code. The entry point of a macro should be a small procedure with a high abstraction level that makes it easy to grasp at a glance what's going on: Public Sub...
Encapsulation hides implementation details from client code. The Handling QueryClose example demonstrates encapsulation: the form has a checkbox control, but its client code doesn't work with it directly - the checkbox is an implementation detail, what the client code needs to know is whether the s...
Polymorphism is the ability to present the same interface for different underlying implementations. The ability to implement interfaces allows completely decoupling the application logic from the UI, or from the database, or from this or that worksheet. Say you have an ISomeView interface that the...
When followed by a qualified name, typename specifies that it is the name of a type. This is often required in templates, in particular, when the nested name specifier is a dependent type other than the current instantiation. In this example, std::decay<T> depends on the template parameter...
Swift let bundleIdentifier = NSBundle.mainBundle().bundleIdentifier() NSUserDefaults.standardUserDefaults().removePersistentDomainForName(bundleIdentifier) Objective-C NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; [[NSUserDefaults standardUserDefaults] removePersi...
This example splits cubic and bezier curves in two. The function splitCurveAt splits the curve at position where 0.0 = start, 0.5 = middle, and 1 = end. It can split quadratic and cubic curves. The curve type is determined by the last x argument x4. If not undefined or null then it assumes the curv...
This is a basic Hello World program in NASM assembly for 32-bit x86 Linux, using system calls directly (without any libc function calls). It's a lot to take in, but over time it will become understandable. Lines starting with a semicolon(;) are comments. If you don't already know low-level Unix sy...
Detailed instructions on getting deep-learning framework set up or installed. Most frameworks supports interfaces in several languages: Caffe (C++, Python, Matlab) Tensorflow (C++, Python) Theano, Theano wrappers (Keras, Lasagne) (Python) Torch (Lua) Matconvnet (Matlab) Every framework i...
git clean -i Will print out items to be removed and ask for a confirmation via commands like the follow: Would remove the following items: folder/file1.py folder/file2.py *** Commands *** 1: clean 2: filter by pattern 3: select by numbers 4: ask each 5: quit...
After installing a Java SDK, it is advisable to check that it is ready to use. You can do this by running these two commands, using your normal user account: $ java -version $ javac -version These commands print out the version information for the JRE and JDK (respectively) that are on your sh...
>>> import os >>> os.stat(path_to_file).st_size == 0 or >>> import os >>> os.path.getsize(path_to_file) > 0 However, both will throw an exception if the file does not exist. To avoid having to catch such an error, do this: import os def is_empty_...
A commonly used utility library is Lodash. To install it into your Aurelia CLI driven application first you need to install it using Npm. npm install lodash --save Now in your preferred IDE/code editor open up the following file in your project directory: aurelia_project/aurelia.json and scroll do...
Boost program options provides a simple and safe way to parse and handle command line arguments. #include <boost/program_options.hpp> #include <string> #include <iostream> int main(int argc, char** argv) { namespace po = boost::program_options; po::variables_map vm; ...
boost::program_options::notify can be used to report any errors in the paramters passing #include <boost/program_options.hpp> #include <string> #include <iostream> int main(int argc, char** argv) { namespace po = boost::program_options; po::variables_map vm; po::op...
A default valued command line argument can be specified easily: // declare options desc.add_options() ("name", po::value<std::string>()->required(), "Type your name to be greeted!") ("rank", po::value<std::string>()->default_value("Dark Kn...

Page 746 of 1336