Tutorial by Examples: a

Case 1: While using in the place of method arguments. If a method requires an object of wrapper class as argument.Then interchangeably the argument can be passed a variable of the respective primitive type and vice versa. Example: int i; Integer j; void ex_method(Integer i)//Is a valid statem...
You can access the command line arguments passed to your program using the std::env::args() function. This returns an Args iterator which you can loop over or collect into a Vec. Iterating Through Arguments use std::env; fn main() { for argument in env::args() { if argument == &qu...
For larger command line programs, using std::env::args() is quite tedious and difficult to manage. You can use clap to handle your command line interface, which will parse arguments, generate help displays and avoid bugs. There are several patterns that you can use with clap, and each one provides ...
Jersey (2) uses HK2 as its dependency injection (DI) system. We can use other injection systems, but its infrastructure is built with HK2, and allows us to also use it within our applications. Setting up simple dependency injection with Jersey takes just a few lines of code. Let say for example we ...
To list available login shells : cat /etc/shells Example: $ cat /etc/shells # /etc/shells: valid login shells /bin/sh /bin/dash /bin/bash /bin/rbash
Say you have a Parent class and a Child class. To construct a Child instance always requires some Parent constructor to be run at the very gebinning of the Child constructor. We can select the Parent constructor we want by explicitly calling super(...) with the appropriate arguments as our first Chi...
This is same as reading a manual for a command: man /path/to/man/file
Simple way to share a message or link, copy text to clipboard, or open a browser in any Xamarin or Windows app. Available on NuGet : https://www.nuget.org/packages/Plugin.Share/ XAML <StackLayout Padding="20" Spacing="20"> <Button StyleId="Text" Text...
A TabbedPage is similar to a NavigationPage in that it allows for and manages simple navigation between several child Page objects. The difference is that generally speaking, each platform displays some sort of bar at the top or bottom of the screen that displays most, if not all, of the availabl...
Spring Boot is a bootstrapping framework for Spring applications. It has seamless support for integrating with Jersey also. One of the advantages of this (from the perspective of a Jersey user), is that you have access to Spring's vast ecosystem. To get started, create a new standalone (non-wepapp)...
Why annotations? Generally we use annotation to facilitate the development and to make the code more clear and clean. What are annotations? Java 5 annotations provide standardization of metadata in a general goal. This metadata associated with Java features can be exploited in the compilation or ...
Create managed bean To create a manage bean you need the annotation @ManagedBean for example: @ManagedBean public class Example {} You need the package: import javax.faces.bean.ManagedBean; Managed bean Scope We use annotations to define the scope in which the bean will be stored. There...
1 dimensional To integrate a one dimensional function f = @(x) sin(x).^3 + 1; within the range xmin = 2; xmax = 8; one can call the function q = integral(f,xmin,xmax); it's also possible to set boundarys for relative and absolute errors q = integral(f,xmin,xmax, 'RelTol',10e-6, 'AbsTo...
This example uses Angular 2.0.0 Final Release registration-form.component.ts import { FormGroup, FormControl, FormBuilder, Validators } from '@angular/forms'; @Component({ templateUrl: "./registration-form.html" }) export class ExampleComponent { ...
The pandas.DataFrame.apply() method is used to apply a given function to an entire DataFrame --- for example, computing the square root of every entry of a given DataFrame or summing across each row of a DataFrame to return a Series. The below is a basic example of usage of this function: # create...
The iv is prefixed to the encrypted data aesCBC128Encrypt will create a random IV and prefixed to the encrypted code. aesCBC128Decrypt will use the prefixed IV during decryption. Inputs are the data and key are Data objects. If an encoded form such as Base64 if required convert to and/or from in ...
You should have a plain CMake project myproject, and we are going to make an Eclipse workspace outside of it: myproject/ .git/ CMakeLists.txt src/ main.cpp workspace/ myproject/ Release/ Debug/ Qt (optional) Get latest Eclipse ...
Here is how to create a simple Time Series. import pandas as pd import numpy as np # The number of sample to generate nb_sample = 100 # Seeding to obtain a reproductible dataset np.random.seed(0) se = pd.Series(np.random.randint(0, 100, nb_sample), index = pd.date_ran...
A very handy way to subset Time Series is to use partial string indexing. It permits to select range of dates with a clear syntax. Getting Data We are using the dataset in the Creating Time Series example Displaying head and tail to see the boundaries se.head(2).append(se.tail(2)) # 2016-09-2...
The following is the list of all the data structures supported by Redis: Binary-safe strings Lists: collections of string elements sorted according to the order of insertion. Sets: collections of unique, unsorted string elements. Sorted sets: similar to Sets but where every string element is a...

Page 772 of 1099