Tutorial by Examples

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...
GNU make This pairmap function takes three arguments: A function name First space-separated list Second space-separated list For each zipped tuple in the lists it will call the function with the following arguments: Tuple element from the first list Tuple element from the second list ...
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 { ...
To add a code block, surround it with #+BEGIN_SRC language and #+END_SRC. language should correspond to the major mode for the language in question, e.g. the major mode for Emacs Lisp is emacs-lisp-mode, so write #+BEGIN_SRC emacs-lisp. #+BEGIN_SRC emacs-lisp (defun hello-world () (interactive)...
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...
When you need to find the bounding rectangle of a quadratic bezier curve you can use the following performant method. // This method was discovered by Blindman67 and solves by first normalising the control point thereby reducing the algorithm complexity // x1,y1, x2,y2, x3,y3 Start, Control, and ...
Introduction Sometimes migrations conflict, resulting in making the migration unsuccesful. This can happen in a lot of scenerio's, however it can occur on a regular basis when developing one app with a team. Common migration conflicts happen while using source control, especially when the feature-...
We will present some examples to show how to apply happens-before reasoning to check that writes are visible to subsequent reads. Single-threaded code As you would expect, writes are always visible to subsequent reads in a single-threaded program. public class SingleThreadExample { public in...
A CSV file itself requires no installation as it is just a plain text file, usually with .csv extension. A CSV file usually contains records. Each line represents one record and is separated by a delimiter, most commonly a comma; but semicolons and tabs are also frequently used. Each line should ha...
All communications between Fragments must go via an Activity. Fragments CANNOT communicate with each other without an Activity. Additional Resources How to implement OnFragmentInteractionListener Android | Communicating With Other Fragments In this sample, we have a MainActivity that hosts t...
If you have an elixir file; a script or a module and want to load it into the current IEx session, you can use the c/1 method: iex(1)> c "lib/utils.ex" iex(2)> Utils.some_method This will compile and load the module in IEx, and you'll be able to call all of it's public methods. ...
Add react-rails to your Gemfile: gem 'react-rails' And install: bundle install Next, run the installation script: rails g react:install This will: create a components.js manifest file and a app/assets/javascripts/components/ directory, where you will put your components place the follo...
React.js builds You can pick which React.js build (development, production, with or without add-ons) to serve in each environment by adding a config. Here are the defaults: # config/environments/development.rb MyApp::Application.configure do config.react.variant = :development end # conf...
react-rails includes a view helper (react_component) and an unobtrusive JavaScript driver (react_ujs) which work together to put React components on the page. You should require the UJS driver in your manifest after react (and after turbolinks if you use Turbolinks). The view helper puts a div on t...

Page 947 of 1336