Tutorial by Examples

Detailed instructions on getting filemaker set up or installed.
PHP is able to parse a number of date formats. If you want to parse a non-standard format, or if you want your code to explicitly state the format to be used, then you can use the static DateTime::createFromFormat method: Object oriented style $format = "Y,m,d"; $time = "2009,2,26&...
Messages can be written with; Write-Verbose "Detailed Message" Write-Information "Information Message" Write-Debug "Debug Message" Write-Progress "Progress Message" Write-Warning "Warning Message" Each of these has a preference variable; $Ve...
Utilizing .Net System.Security.Cryptography.HashAlgorithm namespace to generate the message hash code with the algorithms supported. $example="Nobody expects the Spanish Inquisition." #calculate $hash=[System.Security.Cryptography.HashAlgorithm]::Create("sha256").ComputeHas...
Here is an example of how to define a different action for each Marker's InfoWindow click event. Use a HashMap in which the marker ID is the key, and the value is the corresponding action it should take when the InfoWindow is clicked. Then, use a OnInfoWindowClickListener to handle the event of a ...
Data providers allow creating multiple test inputs to be run within a test. Let's consider a test which verifies that numbers are doubled correctly. To create data provider provide a static method which returns either Object[][] or Iterator<Object[]> (the latter allows for lazy computation of ...
To alias a command in you ~/.zshrc file, you can use the following syntax: alias [alias-name]="[command-to-execute]" For example, it is common to execute the command ls -a. You can alias this command as la as such: alias la="ls -a" After reloading the ~/.zshrc file, you w...
zsh loads configuration from the ~/.zshrc file on startup. If you make changes to that file, you can either restart zsh or run the following command to reload the configuration. . ~/.zshrc You can alias this useful command in your ~/.zshrc like this: alias reload=". ~/.zshrc"
Detailed instructions on getting yarn set up or installed. If you have npm installed on your system: npm install --global yarn On macOS: via Homebrew: brew install yarn via MacPorts: sudo port install yarn (node will be installed if not present) On Windows: via Chocolatey: choco install...
Some Java programmers have a general aversion to throwing or propagating exceptions. This leads to code like the following: public Reader getReader(String pathname) { try { return new BufferedReader(FileReader(pathname)); } catch (IOException ex) { System.out.println(&q...
mod_rewrite must be enabled before being used on an Apache server. Debian/Ubuntu Run a2enmod rewrite Then restart Apache with service apache2 restart General case Add or uncomment the following line in the static configuration file (such as httpd.conf): LoadModule rewrite_module modules/mod_re...
There are many time zones around the world, it is important to make sure your server is set to the right one. This is done in .htaccess by using: SetEnv TZ America/Indianapolis A few example of possible other time zones: America/Los_Angeles America/Los_Angeles - Pacific Time Pacific/Honolulu...
ExecutorService ExecutorService executor = Executors.newFixedThreadPool(50); It is simple and easy to use. It hides low level details of ThreadPoolExecutor. I prefer this one when number of Callable/Runnable tasks are small in number and piling of tasks in unbounded queue does not increase m...
Let's have a look at various options to wait for completion of tasks submitted to Executor ExecutorService invokeAll() Executes the given tasks, returning a list of Futures holding their status and results when everything is completed. Example: import java.util.concurrent.*; import ja...
Entity class @Entity @Table(name = "USER") public class User { @Id @Column(name = "ID") private Long id; @Column(name = "USERNAME") private String username; @ManyToOne @JoinColumn("ORGANIZATION_ID") pr...
If a class is intended to be used polymorphically, with derived instances being stored as base pointers/references, its base class' destructor should be either virtual or protected. In the former case, this will cause object destruction to check the vtable, automatically calling the correct destruc...
We can also specify that a virtual function is pure virtual (abstract), by appending = 0 to the declaration. Classes with one or more pure virtual functions are considered to be abstract, and cannot be instantiated; only derived classes which define, or inherit definitions for, all pure virtual fun...
PHP 4+ supplies a method, format that converts a DateTime object into a string with a desired format. According to PHP Manual, this is the object oriented function: public string DateTime::format ( string $format ) The function date() takes one parameters - a format, which is a string Format T...
Creating a reverse ssh tunnel takes just one switch -R to the original command. Command line Let's assume you are connecting to the example.com as a user guest using a command ssh [email protected]. Opening reverse tunnel can look like this: ssh -R 2222:localhost:22 [email protected] It will o...
#include <pthread.h> #include <stdio.h> #include <string.h> /* function to be run as a thread always must have the same signature: it has one void* parameter and returns void */ void *threadfunction(void *arg) { printf("Hello, World!\n"); /*printf() is speci...

Page 794 of 1336