Tutorial by Examples: c

Executors returns different type of ThreadPools catering to specific need. public static ExecutorService newSingleThreadExecutor() Creates an Executor that uses a single worker thread operating off an unbounded queue There is a difference between newFixedThreadPool(1) and newSingleThreadE...
DateTime + Fixnum (days quantity) DateTime.new(2015,12,30,23,0) + 1 # => #<DateTime: 2015-12-31T23:00:00+00:00 ((2457388j,82800s,0n),+0s,2299161j)> DateTime + Float (days quantity) DateTime.new(2015,12,30,23,0) + 2.5 # => #<DateTime: 2016-01-02T11:00:00+00:00 ((2457390j,39600s,...
In Below sample we are creating one global javascript object dojoConfig which will contain all the configuration values. Note: dojoConfig is defined in a script block before dojo.js is loaded. This is of paramount importance—if reversed, the configuration properties will be ignored. <script...
Dojo received a new loader in Dojo 1.7 to accommodate for the toolkit's new AMD module format. This new loader added a few new configuration options that are crucial to defining packages, maps, and more. For details on the loader, see the Advanced AMD Usage tutorial. Important loader configuration p...
Start by installing the OS on the MicroSD card, either NOOBS or Raspbian, both provided by the Raspberry Pi foundation, available on their site. NOOBS, which stands for New Out Of Box Software, is designed for beginners, and is the easiest to install on your SD card. You can either follow their offi...
Make sure the following dependency is added to your app's build.gradle file under dependencies: compile 'com.android.support:design:25.3.1' Then you can use the Bottom sheet using these options: BottomSheetBehavior to be used with CoordinatorLayout BottomSheetDialog which is a dialog with a ...
The Advanced Package Tool, aptly named the 'apt' package manager can handle the installation and removal of software on the Debian, Slackware, and other Linux Distributions. Below are some simple examples of use: update This option retrieves and scans the Packages.gz files, so that information ab...
There are three ways you can access the Unity Asset Store: Open the Asset Store window by selecting Window→Asset Store from the main menu within Unity. Use the Shortcut key (Ctrl+9 on Windows / ⌘9 on Mac OS) Browse the web interface: https://www.assetstore.unity3d.com/ You may be prompted to...
After accessing the Asset Store and viewing the asset you'd like to download, simply click the Download button. The button text may also be Buy Now if the asset has an associated cost. If you are viewing the Unity Asset Store through the web interface, the Download button text may instead display...
NOTE: For brevity, the examples below use the FolderExists function from the Determining If Folders and Files Exist example in this topic. The MkDir statement can be used to create a new folder. It accepts paths containing drive letters (C:\Foo), UNC names (\\Server\Foo), relative paths (..\Foo...
This is useful if you use rust in the backend and elm on the front end enum Complex{ Message(String), Size(u64) } let c1 = Complex::Message("hi"); let c2 = Complex::Size(1024u64); The encoded Json from rust will be: c1: {"variant": "Message", ...
Regular expressions are often used in methods as parameters to check if other strings are present or to search and/or replace strings. You'll often see the following: string = "My not so long string" string[/so/] # gives so string[/present/] # gives nil string[/present/].nil? # gives ...
from paramiko import client ssh = client.SSHClient() # create a new SSHClient object ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) #auto-accept unknown host keys ssh.connect(hostname, username=username, port=port, password=password) #connect with a host stdin, stdout, stderr = ssh.ex...
The Runtime.exec(String ...) and Runtime.exec(String) methods allow you to execute a command as an external process1. In the first version, you supply the command name and the command arguments as separate elements of the string array, and the Java runtime requests the OS runtime system to start th...
Java Virtual Machines (JVMs) can be run with a SecurityManager installed. The SecurityManager governs what the code running in the JVM is allowed to do, based on factors such as where the code was loaded from and what certificates were used to sign the code. The SecurityManager can be installed by ...
This is a screenshot of a video playing. You see a normal 16:9 video like you would expect to see in any modern video solution. This - the aspect ratio that the viewer sees - is what is called the display aspect ratio or DAR. From the illustrated parameters, we see that DAR = 1280:720 = 16:9 = 1....
Internally, all videos are a just series of pictures. Let's take a look at one such picture. That looks odd, right? Indeed. The pictures that make up a video may have an aspect ratio that are different from the DAR, most often for algorithmic reasons (e.g. only sizes that are a multiple of 16 can...
As the picture aspect ratio example indicates, videos are series of pictures that do not necessarily have the same aspect ratio as the final result to be displayed to the user. So how do you get from those stretched pictures to the normally displayed output? You need a stretching factor! This stret...
This is another name for sample aspect ratio and should be avoided, as the natural acronym (PAR) conflicts with picture aspect ratio.
Consider the following list comprehension Python 2.x2.7 i = 0 a = [i for i in range(3)] print(i) # Outputs 2 This occurs only in Python 2 due to the fact that the list comprehension “leaks” the loop control variable into the surrounding scope (source). This behavior can lead to hard-to-find...

Page 492 of 826