Tutorial by Examples: cs

Create a new project It can be just a Single View Application. Add the code Create a new Cocoa Touch Class file (File > New > File... > iOS > Cocoa Touch Class). Name it MyCollectionViewCell. This class will hold the outlets for the views that you add to your cell in the storyboard. ...
Using generics to define the type in instanceof Consider the following generic class Example declared with the formal parameter <T>: class Example<T> { public boolean isTypeAString(String s) { return s instanceof T; // Compilation error, cannot use T as class type here ...
This option disables the garbage collector strategy changes. Compaction heuristics and nursery size heuristics are not affected by this option. By default, the garbage collection heuristics are enabled. Usage: -XXdisableFatSpin
Consider following html code <ul> <li id=“one” class=“main”>Item 1</li> <li id=“two” class=“main”>Item 2</li> <li id=“three” class=“main”>Item 3</li> <li id=“four”>Item 4</li> </ul> Following dom tree will be constructed ba...
survival is the most commonly used package for survival analysis in R. Using the built-in lung dataset we can get started with Survival Analysis by fitting a regression model with the survreg() function, creating a curve with survfit(), and plotting predicted survival curves by calling the predict m...
An Option is a data structure that contains either a single value, or no value at all. An Option can be thought of as collections of zero or one elements. Option is an abstract class with two children: Some and None. Some contains a single value, and None contains no value. Option is useful in ex...
Fabric is a modular mobile platform that provides useful kits you can mix to build your application. Crashlytics is a crash and issue reporting tool provided by Fabric that allows you to track and monitor your applications in detail. How to Configure Fabric-Crashlytics Step 1: Change your build....
Remember to npm install all the files into devDependencies first. E.g. npm install --save-dev gulp gulp-concat gulp-rename gulp-uglify gulp-uglifycss Gulpfile.js var gulp = require('gulp'); var gulp_concat = require('gulp-concat'); var gulp_rename = require('gulp-rename'); var gulp_uglify = ...
See the below transactions collection. > db.transactions.insert({ cr_dr : "D", amount : 100, fee : 2}); > db.transactions.insert({ cr_dr : "C", amount : 100, fee : 2}); > db.transactions.insert({ cr_dr : "C", amount : 10, fee : 2}); > db.transactions.in...
With generics, it's possible to return whatever the caller expects: private Map<String, Object> data; public <T> T get(String key) { return (T) data.get(key); } The method will compile with a warning. The code is actually more safe than it looks because the Java runtime will d...
Customizing the Shell prompt Default command prompt can be changed to look different and short. In case the current directory is long default command prompt becomes too large. Using PS1 becomes useful in these cases. A short and customized command pretty and elegant. In the table below PS1 has be...
example: df = pd.DataFrame({'group1' : ['A', 'A', 'A', 'A', 'B', 'B', 'B', 'B'], 'group2' : ['C', 'C', 'C', 'D', 'E', 'E', 'F', 'F'], 'B' : ['one', np.NaN, np.NaN, np.NaN, ...
Back references are used to match the same text previously matched by a capturing group. This both helps in reusing previous parts of your pattern and in ensuring two pieces of a string match. For example, if you are trying to verify that a string has a digit from zero to nine, a separator, such as...
ESLint is a code style linter and formatter for your style guide much like JSHint. ESLint merged with JSCS in April of 2016. ESLint does take more effort to set up than JSHint, but there are clear instructions on their website for getting started. A sample configuration for ESLint is as follows: {...
This example goes over how to set up CoreNLP from the latest official release. This example will take you through downloading the package, and running a simple command-line invocation of CoreNLP. Prerequisites: Java JVM 8. The command java -version should complete successfully with a line like: ...
select * from sys.dm_resource_governor_workload_groups select * from sys.dm_resource_governor_resource_pools
SELECT Id, Name FROM Account This will return the Id and Name fields from the Account table. No filtering or sorting will be applied.
HVFL is a language designed to constrain UI elements in a simple and quick fashion. Generally, VFL has an advantage over traditional UI customization in the Interface Builder because it's much more readable, accessible and compact. Here's an example of VFL, in which three UIViews are constrained f...
An HTTP POST request is sent to a URL of the format: "https://api.twilio.com/2xxx-xx-xx/Accounts/[AccountSid]/Messages.json The example below uses a alphanumeric string as the sender. At the time of writing a sender ID can only be added through a service request Twlio. Example Request: To=&q...
0.18.0 Model is passed to subscriptions which means that every state change can modify subscriptions. import Html exposing ( Html, div, text, button ) import Html.Events exposing ( onClick ) import Time main : Program Never Model Msg main = Html.program { init = init ,...

Page 10 of 24