Tutorial by Examples: dse

This is a mistake that causes real confusion for Java beginners, at least the first time that they do it. Instead of writing this: if (feeling == HAPPY) System.out.println("Smile"); else System.out.println("Frown"); they accidentally write this: if (feeling == HAP...
Use .get(key) to get value by key and .set(key, value) to assign a value to a key. If the element with the specified key doesn't exist in the map, .get() returns undefined. .set() method returns the map object, so you can chain .set() calls. const map = new Map(); console.log(map.get(1)); // und...
If we want to test JavaScript on a website, we'll need to use something a bit more powerful than Goutte (which is just cURL via Guzzle). There are a couple of options such as ZombieJS, Selenium and Sahi. For this example I'll use Selenium. First you'll need to install the drivers for Mink: $ compo...
Following are the Prerequisites for installing Cookiecutter: pip virtualenv PostgreSQL Create a virtualenv for your project and activate it: $ mkvirtualenv <virtualenv name> $ workon <virtualenv name> Now install Cookiecutter using: $ pip install cookiecutter Change dire...
To install React Router, just run the npm command npm install --save react-router And you're done. This is literally all you have to do to install react router. Please Note : react-router is dependent on react, So make sure you install react as well. To set up: using an ES6 transpiler, like bab...
void main() { var cat = new Cat(); print("Is cat hungry? ${cat.isHungry}"); // Is cat hungry? true print("Is cat cuddly? ${cat.isCuddly}"); // Is cat cuddly? false print("Feed cat."); cat.isHungry = false; print("Is cat ...
ShouldPerformSegueWithIdentifier: func shouldPerformSegueWithIdentifier(_ identifier:String, sender sender:AnyObject?) -> Bool Determines whether the segue with the specified identifier should be performed. Parameters Identifier: String that identifies the triggered segue Sender: The...
If the administrator creates your database for you when setting up your permissions, you can begin using it. Otherwise, you need to create it yourself: mysql> CREATE DATABASE menagerie; Under Unix, database names are case sensitive (unlike SQL keywords), so you must always refer to your datab...
Downloading the Bundle: The easiest way to download the required GTK Bundle is to search and download it using this link: https://git.gnome.org/browse/gtk+ (GNOME GIT Repository) GNOME GIT Repository provides the bundles for different versions and you can easily find the desired version by scrolli...
Unity networking provides the High Level API (HLA) to handle network communications abstracting from low level implementations. In this example we will see how to create a Server that can communicate with one or multiple clients. The HLA allows us to easily serialize a class and send objects of ...
Start by installing the OS on the MicroSD card, either NOOBS or Raspbian, both provided by the Raspberry Pi foundation, available on their site. NOOBS, which stands for New Out Of Box Software, is designed for beginners, and is the easiest to install on your SD card. You can either follow their offi...
Smack (Java) Using Smack 4.1 It is recommended to include Smack as Maven dependency in your project (e.g. by using gradle or Maven). Otherwhise the following Smack artifacts/jars have to be added manually to the classpath: smack-core, smack-extensions, smack-experimental, smack-im, smnack-tcp,...
Installation Installation of Log4j2 is as simple as putting log4j2 jar in application classpath. Though you might want to customize logs output through additional config file Configuration maven To add log4j to project in maven, add it's dependency: In pom.xml add following dependency: <dep...
This uses the SwiftyDropbox library to upload a file from a NSFileHandle to the Dropbox account using upload sessions, handling every error case: import UIKit import SwiftyDropbox class ViewController: UIViewController { // filled in later in doUpload: var fileHandle : NSFileHandle?...
You'll need to add the following to your dependencies: compile 'com.google.firebase:firebase-ads:10.2.1' and then put this in the same file. apply plugin: 'com.google.gms.google-services' Next you'll need to add relevant information into your strings.xml. <string name="banner_ad_unit_id...
require(['N/search'], function(SEARCHMODULE){ var savedSearchId = 'customsearch_mySavedSearch'; var mySearch = SEARCHMODULE.load(savedSearchId); var resultset = mySearch.run(); var results = resultset.getRange(0, 1000); for(var i in results){ var result = results[i]...
Getters and setters are methods that are behaved like properties. it means they have function structure but when used, they are used same as properties: Structure of getter functions: they should have get keyword after function keyword and before function name, with no argument, a return type spec...
require(['N/search'], function(SEARCHMODULE){ var savedSearchId = 'customsearch_mySavedSearch'; var mySearch = SEARCHMODULE.load(savedSearchId); var resultset = mySearch.run(); var results = resultset.getRange(0, 1000); for(var i in results){ var result = results[i]...
function calculatorService() { const service = {}; service.add = function(a,b) { return a + b } return service; } angular.module('app').factory('calculatorService', calculatorService); Testing describe('calculator service', function() { var calcula...
To create the serialVersionUID for a class in Kotlin you have a few options all involving adding a member to the companion object of the class. The most concise bytecode comes from a private const val which will become a private static variable on the containing class, in this case MySpecialCase: ...

Page 6 of 10