Tutorial by Examples: by

By creating multiple properties files for the different environments or use cases, its sometimes hard to manually change the active.profile value to the right one. But there is a way to set the active.profile in the application.properties file while building the application by using maven-profiles. ...
The StandardClaims type is designed to be embedded into your custom types to provide standard validation features. You can use it alone, but there's no way to retrieve other fields after parsing. See the custom claims example for intended usage. mySigningKey := []byte("AllYourBase") //...
In this example, a sine curve and a cosine curve are plotted in the same figure by superimposing the plots on top of each other. # Plotting tutorials in Python # Adding Multiple plots by superimposition # Good for plots sharing similar x, y limits # Using single plot command and legend import...
pry is a powerful tool that can be used to debug any ruby application. Setting up a ruby-on-rails application with this gem is very easy and straightforward. Setup To start debugging your application with pry Add gem 'pry' to the application's Gemfile and bundle it group :development, :test ...
Suppose we have this source file that we would like to split: cat -n sourcefile 1 On the Ning Nang Nong 2 Where the Cows go Bong! 3 and the monkeys all say BOO! 4 There's a Nong Nang Ning 5 Where the trees go Ping! 6 And the tea pots jibber jabber joo. 7 On the Nong Ning Nang Comma...
BottomSheet DialogFragment opens up in STATE_COLLAPSED by default. Which can be forced to open to STATE_EXPANDEDand take up the full device screen with help of the following code template. @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { BottomSheetDialog dialog = ...
There are two ways to uninstall a particular version of Ruby. The easiest is to simply remove the directory from ~/.rbenv/versions: $ rm -rf ~/.rbenv/versions/2.1.0 Alternatively, you can use the uninstall command, which does exactly the same thing: $ rbenv uninstall 2.1.0 If this version ha...
Suppose we have this file: test>>cat Hogwarts Harry Malfoy Rowena Helga Gryffindor Slytherin Ravenclaw Hufflepuff Hermione Goyle Lockhart Tonks Ron Snape Olivander Newt Ron Goyle Flitwick ...
import java.util.StringTokenizer; public class Simple{ public static void main(String args[]){ StringTokenizer st = new StringTokenizer("apple ball cat dog"," "); while (st.hasMoreTokens()) { System.out.println(st.nextToken()); } } ...
public static void main(String args[]) { StringTokenizer st = new StringTokenizer("apple,ball cat,dog", ","); while (st.hasMoreTokens()) { System.out.println(st.nextToken()); } } Output: apple ball cat dog
from tensorflow.python.client import device_lib print(device_lib.list_local_devices())
Upon calling a function there are new elements created on the program stack. These include some information about the function and also space (memory locations) for the parameters and the return value. When handing over a parameter to a function the value of the used variable (or literal) is copied...
In our current implementation of merge, we always choose the left set to be the child of the right set, without taking the size of the sets into consideration. Without this restriction, the paths (without path compression) from an element to its representative might be quite long, thus leading to la...
There is a limitation in Acumatica's SOAP Contract-Based API allowing to download attachments only for a top-level entity. Any attempt to use the GetFiles() method to get the attachments of a detail entity will, unfortunately, result in the error "Entity without screen binding cannot be used as...
Another heuristic commonly used instead of union by size is the union by rank heuristic Its basic idea is that we don't actually need to store the exact size of the sets, an approximation of the size (in this case: roughly the logarithm of the set's size) suffices to achieve the same speed as union...
While in combination with path compression, union by rank nearly achieves constant time operations on union-find data structures, there is a final trick that allows us to get rid of the rank storage altogether by storing the rank in out-of-bounds entries of the parentarray. It is based on the follow...
import sys import json # load input arguments from the text file filename = sys.argv[ 1 ] with open( filename ) as data_file: input_args = json.loads( data_file.read() ) # cast strings to floats x, y = [ float(input_args.get( key )) for key in [ 'x', 'y' ] ] print json.dumps( { ...
This is a good step by step guide for setting up asp net Identity and Identity server for authorization and authentication. https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity You can also follow the official docs examples and IdentityServer4 quickstart samples on Github ...
using (SPSite site = new SPSite("http://server/sites/siteCollection")) using (SPWeb web = site.OpenWeb()) { string listUrl = string.Format("{0}{1}", web.ServerRelativeUrl, "Lists/SomeList"); SPList list = web.GetList(listUrl); }
Many argue that Java is ONLY pass-by-value, but it's more nuanced than that. Compare the following C++ and Java examples to see the many flavors of pass-by-value (aka copy) and pass-by-reference (aka alias). C++ Example (complete code) // passes a COPY of the object static void passByCopy(Pa...

Page 22 of 23