Tutorial by Examples: ect

Currently there is no one-click-button method to actually enforce any code style guidelines across a team but there are two methods to make sure a certain code style is applied to your product. Import PhpStorm Code Style Schemes The first and more easier solution is to set up a code style scheme o...
db.collection.getIndexes(); Output [ { "v" : 1, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "documentation_db.transactions" }, { "v&quo...
Should we wish to retrieve only a few columns, we can use the Projections class to do so. For example, the following code retrieves the title column // Selecting all title columns List review = session.createCriteria(TravelReview.class) .setProjection(Projections.property("titl...
If we just try the following: import json from datetime import datetime data = {'datetime': datetime(2016, 9, 26, 4, 44, 0)} print(json.dumps(data)) we get an error saying TypeError: datetime.datetime(2016, 9, 26, 4, 44) is not JSON serializable. To be able to serialize the datetime object p...
Even if third-party libraries are good, a simple way to parse the JSON is provided by protocols You can imagine you have got an object Todo as struct Todo { let comment: String } Whenever you receive the JSON, you can handle the plain NSData as shown in the other example using NSJSONSeria...
Check existing partitions on Schema SELECT * FROM user_tab_partitions;
Select data from a partition SELECT * FROM orders PARTITION(partition_name);
When you have multiple subscriptions under your Azure account; it's important that you are selecting the one you wish to operate on (and use this as default); to avoid accidents happening to resources on the wrong subscription. Classic mode Set-AzureSubscription Select-AzureSubscription Resou...
The AND keyword is used to add more conditions to the query. NameAgeGenderSam18MJohn21MBob22MMary23F SELECT name FROM persons WHERE gender = 'M' AND age > 20; This will return: NameJohnBob using OR keyword SELECT name FROM persons WHERE gender = 'M' OR age < 20; This will return: n...
Create a new project with the Leiningen figwheel template: lein new figwheel hello-world Run Figwheel: cd hello-world lein figwheel After a moment it will start a development webserver and open the page in your browser. It also opens a Clojurescript REPL connected to the browser. Try enter...
It's possible to pass Java objects to Nashorn engine to be processed in Java code. At the same time, there are some JavaScript (and Nashorn) specific constructions, and it's not always clear how they work with java objects. Below there is a table which describes behaviour of native Java objects ins...
User-defined method objects may be created when getting an attribute of a class (perhaps via an instance of that class), if that attribute is a user-defined function object, an unbound user-defined method object, or a class method object. class A(object): # func: A user-defined function object...
You can use the header() function to instruct the browser to redirect to a different URL: $url = 'https://example.org/foo/bar'; if (!headers_sent()) { // check headers - you can not send headers if they already sent header('Location: ' . $url); exit; // protects from code being executed afte...
Sometimes you may need additional features from a directive. Instead of rewriting (copy) the directive, you can modify how the directive behaves. The decorator will be executed during $inject phase. To do so, provde a .config to your module. The directive is called myDirective, so you have to con...
Angular js directives can be nested or be made interoperable. In this example, directive Adir exposes to directive Bdir it's controller $scope, since Bdir requires Adir. angular.module('myApp',[]).directive('Adir', function () { return { restrict: 'AE', controlle...
The most important object in the Browser Object Model is the window object. It helps in accessing information about the browser and its components. To access these features, it has various methods and properties. MethodDescriptionwindow.alert()Creates dialog box with message and an OK buttonwindow....
# example data DT = data.table(Titanic) Suppose we only want to see second class: DT[ Class == "2nd" ] # Class Sex Age Survived N # 1: 2nd Male Child No 0 # 2: 2nd Female Child No 0 # 3: 2nd Male Adult No 154 # 4: 2nd Female Adult ...
# example data DT = data.table(Titanic) Suppose we want to see each class only if a majority survived: DT[, if (sum(N[Survived=="Yes"]) > sum(N[Survived=="No"]) ) .SD, by=Class] # Class Sex Age Survived N # 1: 1st Male Child No 0 # 2: 1st Fema...
The DISTINCT clause after SELECT eliminates duplicate rows from the result set. CREATE TABLE `car` ( `car_id` INT UNSIGNED NOT NULL PRIMARY KEY, `name` VARCHAR(20), `price` DECIMAL(8,2) ); INSERT INTO CAR (`car_id`, `name`, `price`) VALUES (1, 'Audi A1', '20000'); INSERT INTO CA...
This example assumes that your lookup column is named MultiLookupColumnName and that you want to set your multi-lookup field to lookup to the items with IDs 1 and 2. Using jQuery AJAX 2010 var listName = "YourListName"; var lookupList = "LookupListName"; var idOfItemToUpdate...

Page 39 of 99