Tutorial by Examples: ase

This method will work on modern versions of Arch, CentOS, CoreOS, Debian, Fedora, Mageia, openSUSE, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, Ubuntu, and others. This wide applicability makes it an ideal as a first approach, with fallback to other methods if you need to also identify o...
First define the service (in this case it uses the factory pattern): .factory('dataService', function() { var dataObject = {}; var service = { // define the getter method get data() { return dataObject; }, // define the setter method ...
By default, migrations are applied to the same database specified by the db application component. If you want them to be applied to a different database, you may specify the db command-line option like shown below: yii migrate --db=db2
Uppercase and lowercase letters of the alphabet are equivalent in the Fortran character set. In other words, Fortran is case insensitive. This behavior is in contrast with case-sensitive languages, such as C++ and many others. As a consequence, the variables a and A are the same variable. In princ...
To support a given application, you often create a new role and database to match. The shell commands to run would be these: $ createuser -P blogger Enter password for the new role: ******** Enter it again: ******** $ createdb -O blogger blogger This assumes that pg_hba.conf has been prope...
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(QWid...
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...
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...
// *** Case Insensitive comparison with exact title match *** NSPredicate *filterByNameCIS = [NSPredicate predicateWithFormat:@"self.title LIKE[cd] %@",@"Tom and Jerry"]; NSLog(@"Filter By Name(CIS) : %@",[array filteredArrayUsingPredicate:filterByNameCIS]);
// *** Case sensitive with exact title match *** NSPredicate *filterByNameCS = [NSPredicate predicateWithFormat:@"self.title = %@",@"Tom and Jerry"]; NSLog(@"Filter By Name(CS) : %@",[array filteredArrayUsingPredicate:filterByNameCS]);
// *** Case Insensitive comparison with matching subset *** NSPredicate *filterByName = [NSPredicate predicateWithFormat:@"self.title CONTAINS[cd] %@",@"Tom"]; NSLog(@"Filter By Containing Name : %@",[array filteredArrayUsingPredicate:filterByName]);
A basic custom element is created in Aurelia based on naming conventions, by simply adding the suffix CustomElement to the name of a class. This suffix will automatically be stripped out by Aurelia. The remaining part of the class name will be lowercased and separated using a hyphen and can then be ...
For ease of testing, sklearn provides some built-in datasets in sklearn.datasets module. For example, let's load Fisher's iris dataset: import sklearn.datasets iris_dataset = sklearn.datasets.load_iris() iris_dataset.keys() ['target_names', 'data', 'target', 'DESCR', 'feature_names'] You can ...
When it comes to geographic data, R shows to be a powerful tool for data handling, analysis and visualisation. Often, spatial data is avaliable as an XY coordinate data set in tabular form. This example will show how to create a spatial data set from an XY data set. The packages rgdal and sp provi...
macro(set_my_variable _INPUT) if("${_INPUT}" STREQUAL "Foo") set(my_output_variable "foo") else() set(my_output_variable "bar") endif() endmacro(set_my_variable) Use the macro: set_my_variable("Foo") message(STATUS ${my_outpu...
case {1, 2} do {3, 4} -> "This clause won't match." {1, x} -> "This clause will match and bind x to 2 in this clause." _ -> "This clause would match any value." end case is only used to match the given pattern of the particular data...
Enumerating dictionaries allows you to run a block of code on each dictionary key-value pair using the method enumerateKeysAndObjectsUsingBlock:(void (^)(id key, id obj, BOOL *stop))block Example: NSDictionary stockSymbolsDictionary = @{ @"AAPL":...
Encoding //Create a Base64 Encoded NSString Object NSData *nsdata = [@"iOS Developer Tips encoded in Base64" dataUsingEncoding:NSUTF8StringEncoding]; // Get NSString from NSData object in Base64 NSString *base64Encoded = [nsdata base64EncodedStringWithOptions:0]; // Print the B...
Vector based graphics are represented by a plethora of data that must be computed by the CPU (vector points, arcs, colors, etc). Anything other than simple shapes with minimal points and straight lines will consume vast amounts of CPU resource. There is a "Cache as Bitmap" flag that can b...

Page 7 of 40