Tutorial by Examples: access

For the character entity character(len=5), parameter :: greeting = "Hello" a substring may be referenced with the syntax greeting(2:4) ! "ell" To access a single letter it isn't sufficient to write greeting(1) ! This isn't the letter "H" but greeting(1:...
The complex entity complex, parameter :: x = (1., 4.) has real part 1. and complex part 4.. We can access these individual components as real(x) ! The real component aimag(x) ! The complex component x%re ! The real component y%im ! The complex component The x%.. form is new to F...
The process.env property returns an object containing the user environment. It returns an object like this one : { TERM: 'xterm-256color', SHELL: '/usr/local/bin/bash', USER: 'maciej', PATH: '~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', PWD: '/Users/maciej', EDITOR: 'vi...
A common usecase for the ready() hook is to access the DOM, e.g. to initiate a Javascript plugin, get the dimensions of an element etc. The problem Due to Vue's asynchronous DOM update mechanism, it's not guaranteed that the DOM has been fully updated when the ready() hook is called. This usually ...
The C-API is the most powerful way to access PostgreSQL and it is surprisingly comfortable. Compilation and linking During compilation, you have to add the PostgreSQL include directory, which can be found with pg_config --includedir, to the include path. You must link with the PostgreSQL client s...
Use charAt() to get a character at the specified index in the string. var string = "Hello, World!"; console.log( string.charAt(4) ); // "o" Alternatively, because strings can be treated like arrays, use the index via bracket notation. var string = "Hello, World!";...
Sometimes, you don't want to trigger metamethods, but really write or read exactly the given key, without some clever functions wrapped around the access. For this, lua provides you with raw table access methods: -- first, set up a metatable that allows no read/write access local meta = { __i...
Access the nth element of a list (zero-based): list = [1 .. 10] firstElement = list !! 0 -- 1 Note that !! is a partial function, so certain inputs produce errors: list !! (-1) -- *** Exception: Prelude.!!: negative index list !! 1000 -- *** Exception: Prelude.!!: inde...
When you bind a service to your application credentials become available through the VCAP_SERVICES environment variable. This environment variable contains JSON containing the credentials for all bound services. Example VCAP_SERVICES environment variable { "push-reappt": [ { ...
Use 403 Forbidden when a client has requested a resource that is inaccessible due to existing access controls. For example, if your app has an /admin route that should only be accessible to users with administrative rights, you can use 403 when a normal user requests the page. GET /admin HTTP/1.1 ...
using (new Sitecore.SecurityModel.SecurityDisabler()) { var item = Sitecore.Context.Database.GetItem("/sitecore/content/home"); }
var user = Sitecore.Security.Accounts.User.FromName("sitecore/testname", false); using (new Sitecore.Security.Accounts.UserSwitcher(user)) { var item = Sitecore.Context.Database.GetItem("/sitecore/content/home"); }
Problem: Some data needs to be passed to a scene loaded from a fxml. Solution Specify a controller using the fx:controller attribute and get the controller instance created during the loading process from the FXMLLoader instance used to load the fxml. Add methods for passing the data to the contr...
class Vector { double x double y } def points = [ new Vector(x: 10, y: -5), new Vector(x: -17.5, y: 3), new Vector(x: -3.3, y: -1) ] assert points*.x == [10, -17.5, -3.3] Note: The * is optional. We could also write the above statement as in the below line and Groov...
Installing aws cli in Ubuntu / Debian Instance sudo apt-get install -y python-dev python-pip sudo pip install awscli aws --version aws configure Installing aws cli using python Using pip you can install aws cli in windows, OS X and Linux sudo pip install awscli Configuring the AWS Comman...
The password in a credential object is an encrypted [SecureString]. The most straightforward way is to get a [NetworkCredential] which does not store the password encrypted: $credential = Get-Credential $plainPass = $credential.GetNetworkCredential().Password The helper method (.GetNetworkCrede...
If efficiency is important, a fast way to iterate over pixels in a cv::Mat object is to use its ptr<T>(int r) method to obtain a pointer to the beginning of row r (0-based index). According to the matrix type, the pointer will have a different template. For CV_8UC1: uchar* ptr = image.ptr&...
The List API has eight methods for positional access operations: add(T type) add(int index, T type) remove(Object o) remove(int index) get(int index) set(int index, E element) int indexOf(Object o) int lastIndexOf(Object o) So, if we have a List: List<String> strings = new ArrayL...
Member member/2 has signature member(?Elem, ?List) and denotes true if Elem is a member of List. This predicate can be used to access variables in a list, where different solutions are retrieved through backtracking. Example queries: ?- member(X, [1,2,3]). X = 1 ; X = 2 ; X = 3. ?- member(X...
Using the dataset property The new dataset property allows access (for both reading and writing) to all data attributes data-* on any element. <p>Countries:</p> <ul> <li id="C1" onclick="showDetails(this)" data-id="US" data-dial-code="1&q...

Page 4 of 12