Tutorial by Examples: current

Swift UIApplication.sharedApplication().preferredContentSizeCategory Objective-C [UIApplication sharedApplication].preferredContentSizeCategory; This returns a content size category constant, or an accessibility content size category constant.
This example inserts/sends the current day of the week's full name (e.g. Sunday) whenever Ctrl + Alt + D is pressed: ^!d::Send, %A_DDDD%
Normal mode Ctrl-wo Ex mode :only or short :on
It is sometimes required for a process to concurrently write and read the same "data". The ReadWriteLock interface, and its ReentrantReadWriteLock implementation allows for an access pattern that can be described as follow : There can be any number of concurrent readers of the data. If...
In this example, we'll create a simple echo server that will listen on the specified port, and being able to handle new connections: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/socket.h> #include <sys/types.h> #include <arpa/inet.h&...
$ pwd /home/bob/somedir1/somedir2/somedir3 $ pushd /home/bob/otherdir1/otherdir2 /home/bob/otherdir1/otherdir2 /home/bob/somedir1/somedir2/somedir3 $ popd /home/bob/somedir1/somedir2/somedir3 $ pushd /usr /usr /home/bob/somedir1/somedir2/somedir3 $ pushd /var /var /usr /home/bob/som...
Here a simple portable way to get the current device family: /// <summary> /// All the device families /// </summary> public enum DeviceFamily { Desktop, Mobile, Iot, Xbox, } /// <summary> /// The helper to get the current device family /// </summ...
If you want to clear your current Activity stack and launch a new Activity (for example, logging out of the app and launching a log in Activity), there appears to be two approaches. 1. Target (API >= 16) Calling finishAffinity() from an Activity 2. Target (11 <= API < 16) Intent intent ...
To determine the version of Azure PowerShell that you have installed, run the following: Get-Module -ListAvailable -Name Azure -Refresh This command returns the installed version even when you haven't loaded the Azure PowerShell module in your current PowerShell session.
Here is a very simple example to illustrate how to write a NIF. Directory structure: nif_test ├── c_src │   ├── Makefile │   └── nif_test.c ├── rebar.config └── src ├── nif_test.app.src └── nif_test.erl This structure can be easily initialized using Rebar3: $ rebar3 new lib nif_...
import java.util.stream.IntStream; public class Concurrent { public static void printAndWait(String s) { System.out.println(s); try { Thread.sleep(1000); } catch (Exception e) {} } public static void main(String[] args) { Threa...
$ printf '%(%F)T\n' 2016-08-17
$ printf -v now '%(%T)T' $ echo "$now" 12:42:47
Uname is the short name for unix name. Just type uname in console to get information about your operating system. uname [OPTION] If no OPTION is specified, uname assumes the -s option. -a or --all - Prints all information, omitting -p and -i if the information is unknown. Example: > unam...
Getting the effective execution policy for the current session: PS> Get-ExecutionPolicy RemoteSigned List all effective execution policies for the current session: PS> Get-ExecutionPolicy -List Scope ExecutionPolicy ----- --------------- MachinePolicy Undefined...
SELECT IDENT_CURRENT('dbo.person'); This will select the most recently-added identity value on the selected table, regardless of connection or scope.
In the .bashrc or .bash_profile, adding: export MYSQL_PS1="\u@\h [\d]>" make the MySQL client PROMPT show current user@host [database].
To get the current date and time, use the now function: julia> now() 2016-09-04T00:16:58.122 This is the local time, which includes the machine's configured time zone. To get the time in the Coordinated Universal Time (UTC) time zone, use now(Dates.UTC): julia> now(Dates.UTC) 2016-09-04...
$categoryName = Mage::registry('current_category')->getName(); foreach ($categoryName as $_category): $categoryName = $_category->getName(); endforeach;

Page 4 of 7