Tutorial by Examples: er

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...
If you need to store images or videos in the column then we need to change the value as needed by your application max_allowed_packet = 10M M is Mb, G in Gb, K in Kb
Let's say you have an image rgbImg, e.g., read in using imread. >> rgbImg = imread('pears.png'); >> figure, imshow(rgbImg), title('Original Image') Use fspecial to create a 2D filter: >> h = fspecial('disk', 7); >> figure, imshow(h, []), title('Filter') Use imfi...
Starting with a binary image, bwImg, which contains a number of connected objects. >> bwImg = imread('blobs.png'); >> figure, imshow(bwImg), title('Binary Image') To measure properties (e.g., area, centroid, etc) of every object in the image, use regionprops: >> stats = reg...
By default, Import-CSV imports all values as strings, so to get DateTime- and integer-objects, we need to cast or parse them. Using Foreach-Object: > $listOfRows = Import-Csv .\example.csv > $listOfRows | ForEach-Object { #Cast properties $_.DateTime = [datetime]$_.DateTime $...
The simple and most obvious way to use recursion to get the Nth term of the Fibonnaci sequence is this int get_term_fib(int n) { if (n == 0) return 0; if (n == 1) return 1; return get_term_fib(n - 1) + get_term_fib(n - 2); } However, this algorithm does not scale for higher ...
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...
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...
You can achieve a Persistent Bottom Sheet attaching a BottomSheetBehavior to a child View of a CoordinatorLayout: <android.support.design.widget.CoordinatorLayout > <!-- ..... --> <LinearLayout android:id="@+id/bottom_sheet" android:elevation...
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...
C# 7.0 adds accessors, constructors and finalizers to the list of things that can have expression bodies: class Person { private static ConcurrentDictionary<int, string> names = new ConcurrentDictionary<int, string>(); private int id = GetId(); public Person(string n...
Files: To determine if a file exists, simply pass the filename to the Dir$ function and test to see if it returns a result. Note that Dir$ supports wild-cards, so to test for a specific file, the passed pathName should to be tested to ensure that it does not contain them. The sample below raises an...
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...
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 ...
Generic arrays in Kotlin are represented by Array<T>. To create an empty array, use emptyArray<T>() factory function: val empty = emptyArray<String>() To create an array with given size and initial values, use the constructor: var strings = Array<String>(size = 5, init ...
A stream wrapper provides a handler for one or more specific schemes. The example below shows a simple stream wrapper that sends PATCH HTTP requests when the stream is closed. // register the FooWrapper class as a wrapper for foo:// URLs. stream_wrapper_register("foo", FooWrapper::class...
Each array instance contains an internal pointer. By manipulating this pointer, different elements of an array can be retrieved from the same call at different times. Using each Each call to each() returns the key and value of the current array element, and increments the internal array pointer. ...
If there is no need for frontend in your next project, you can run sails new with additional flag --no-frontend. sails new NameOfProject --no-frontend This will generate everything needed for backend and will omit view, assets and grunt files. More about command line and sails-new: http://sails...
A chrome extension is seperated into a maximum of 4 parts: the background page the popup page one or more content scripts the options page Each part, since they are innately separate, require individual debugging. Keep in mind that these pages are separate, meaning that variables are not d...

Page 251 of 417