Tutorial by Examples: o

Traditional way interface MathOperation{ boolean unaryOperation(int num); } public class LambdaTry { public static void main(String[] args) { MathOperation isEven = new MathOperation() { @Override public boolean unaryOperation(int num) { ...
A class can have non-static member functions, which operate on individual instances of the class. class CL { public: void member_function() {} }; These functions are called on an instance of the class, like so: CL instance; instance.member_function(); They can be defined either ins...
A simple EntitySystem that processes each entity of a given family in the order specified by a comparator and calls processEntity() for each entity every time the EntitySystem is updated. This is really just a convenience class as rendering systems tend to iterate over a list of entities in a sort...
One can verify whether a method was called on a mock by using Mockito.verify(). Original mock = Mockito.mock(Original.class); String param1 = "Expected param value"; int param2 = 100; // Expected param value //Do something with mock //Verify if mock was used properly Mockito.veri...
Detailed instructions on getting plesk set up or installed.
Our first element directive will not do much: it will just calculate 2+2 and will be called in html like this: <my-calculator></my-calculator> Notice the name of the directive is myCalculator (in CamelCase), but in html it's used as my-calculator (in lisp-case). Since we want our di...
Hide/show printed information: Control verbosity of the logging: Disable/enable opening log window when starting run/debug application
Factory Method is one of creational design patterns. It is used to deal with the problem of creating objects without specifying exact result type. This document will teach you how to use Factory Method DP properly. Let me explain the idea of it to you on a simple example. Imagine you're working in ...
Detailed instructions on getting websphere set up or installed.
set alpha {a 1 b 2 c 3} dict get $alpha b # => 2 dict get $alpha d # (ERROR) key "d" not known in dictionary If dict get is used to retrieve the value of a missing key, an error is raised. To prevent the error, use dict exists: if {[dict exists $alpha $key]} { set result [d...
The DatePicker class has a property, SelectedDate, which enable you to get or set the selected date. If there is none selected, it means its value will be null. if (datePicker.SelectedDate == null) { // Do what you have to do }
You call use Thread.kill or Thread.terminate: thr = Thread.new { ... } Thread.kill(thr)
Android developers(mainly beginners) have been confused regarding Internal & External storage terminology. There are lot of questions on Stackoverflow regarding the same. This is mainly because of the fact that terminology according to Google/official Android documentation is quite different to...
iOS 6 Within a single line, we can get an UUID like below: Swift let UDIDString = UIDevice.currentDevice().identifierForVendor?.UUIDString Objective-C NSString *UDIDString = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; The identifierForVendor is an unique identifier that st...
var client = new MongoClient("mongodb://localhost:27017"); var database = client.GetDatabase("test"); var collection = database.GetCollection < Interactions > ("Interactions"); var newItem = new Interactions{ SiteName = "Example", Pages = ...
var client = new MongoClient("mongodb://localhost:27017"); var database = client.GetDatabase("test"); var collection = database.GetCollection < Interactions > ("Interactions"); var result = IMongoCollectionExtensions .AsQueryable(collection) ...
var client = new MongoClient("mongodb://localhost:27017"); var database = client.GetDatabase("test"); var collection = database.GetCollection < Interactions > ("Interactions"); var update = MongoDB.Driver .Builders .Update.Set(s => s.SiteName, "New Ex...
var client = new MongoClient("mongodb://localhost:27017"); var database = client.GetDatabase("test"); var collection = database.GetCollection < Interactions > ("Interactions"); collection.DeleteOne(s => s.SiteName == "New Example");
To add a child view controller: - (void)displayContentController:(UIViewController *)vc { [self addChildViewController:vc]; vc.view.frame = self.view.frame; [self.view addSubview:vc.view]; [vc didMoveToParentViewController:self]; } To remove a child view controller: - (void)hid...
First let's create an ExchangeManager object, where the constructor will connect to the services for us. It also has a GetOofSettings method, which will return the OofSettings object for the specified email address : using System; using System.Web.Configuration; using Microsoft.Exchange.WebServic...

Page 506 of 1038