Tutorial by Examples: c

A UserForm is a class module with a designer and a default instance. The designer can be accessed by pressing Shift+F7 while viewing the code-behind, and the code-behind can be accessed by pressing F7 while viewing the designer. Work with a new instance every time. Being a class module, a form i...
The QueryClose event is raised whenever a form is about to be closed, whether it's via user action or programmatically. The CloseMode parameter contains a VbQueryClose enum value that indicates how the form was closed: ConstantDescriptionValuevbFormControlMenuForm is closing in response to user act...
Here are simplified steps (based on the official documentation) required to create a Firebase project and connect it with an Android app. Add Firebase to your app Create a Firebase project in the Firebase console and click Create New Project. Click Add Firebase to your Android app and fol...
From dataframe: mtrdd <- createDataFrame(sqlContext, mtcars) From csv: For csv's, you need to add the csv package to the environment before initiating the Spark context: Sys.setenv('SPARKR_SUBMIT_ARGS'='"--packages" "com.databricks:spark-csv_2.10:1.4.0" "sparkr-shel...
The Phalcon Incubator can be used by the community to experiment with new features or expand onto the existing Phalcon adapters, prototypes or functionalities. Anything in the Incubator can be potentially corporated into the framework. Github repository: https://github.com/phalcon/incubator
This is an example of a simple GET API call wrapped in a promise to take advantage of its asynchronous functionality. var get = function(path) { return new Promise(function(resolve, reject) { let request = new XMLHttpRequest(); request.open('GET', path); request.onload = resolve; ...
SQL Server 2008 R2 SET TRANSACTION ISOLATION LEVEL READ COMMITTED This isolation level is the 2nd most permissive. It prevents dirty reads. The behavior of READ COMMITTED depends on the setting of the READ_COMMITTED_SNAPSHOT: If set to OFF (the default setting) the transaction uses shared l...
Use list() to quick assign a list of variable values into an array. See also compact() // Assigns to $a, $b and $c the values of their respective array elements in $array with keys numbered from zero list($a, $b, $c) = $array; With PHP 7.1 (currently in beta) you will be able to use s...
Foreign keys enables you to define relationship between two tables. One (parent) table need to have primary key that uniquely identifies rows in the table. Other (child) table can have value of the primary key from the parent in one of the columns. FOREIGN KEY REFERENCES constraint ensures that valu...
Let's assume that we have one row in Company table with companyId 1. We can insert row in employee table that has companyId 1: insert into Employee values (17, 'John', 1) However, we cannot insert employee that has non-existing CompanyId: insert into Employee values (17, 'John', 111111) Msg ...
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...
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...
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...
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; ...

Page 461 of 826