Tutorial by Examples: ar

PostmarkMailSender.java public class PostmarkMailSender implements MailSender{ private static Logger logger = Logger.getLogger("com.postmark"); private String serverToken; private static Gson gson; static { GsonBuilder gsonBuilder = new GsonBuilder(); ...
Numeric literals of more than a few digits are hard to read. Pronounce 7237498123. Compare 237498123 with 237499123 for equality. Decide whether 237499123 or 20249472 is larger. C++14 define Simple Quotation Mark ' as a digit separator, in numbers and user-defined literals. This can make it ...
There are many ways to use MaterializeCSS framework. Few things to keep in mind before going to installation It is not a CSS only framwork, though it has CSS name in it. We can use its SCSS too It is not built for Angular It is a component framework too built on jquery. Though we are not supp...
As we can add multiple elements in Cart array and then add it to cart session, but there are 4 basic elements which Cart class requires to add data successfully in cart session. id (string) qty (number) price (number, decimal) name (String) And if you want to add more options regardin...
You can show cart items by loop through cart or you can display single item from cart. $cartContents = $this->cart->contents(); This will return an array of cart items so you can loop through this array using foreach loop. foreach ($cartContents as $items){ echo "ID : ". ...
Rowid : The row ID is a unique identifier that is generated by the cart code when an item is added to the cart. The reason a unique ID is created is so that identical products with different options can be managed by the cart. Every item in cart has a rowid element and by rowid you can update cart ...
By using rowid element you can delete an item from cart. you just have to set item's qty to 0 $deleteItem = array( 'rowid' => 'b99ccdf16028f015540f341130b6d8ec', 'qty' => 0 ); $this->cart->update($data); this will delete item with this rowid.
Let's first recap how to initialize a 1D ruby array of integers: my_array = [1, 1, 2, 3, 5, 8, 13] Being a 2D array simply an array of arrays, you can initialize it like this: my_array = [ [1, 1, 2, 3, 5, 8, 13], [1, 4, 9, 16, 25, 36, 49, 64, 81], [2, 3, 5, 7, 11, 13, 17] ]
You can go a level further down and add a third layer of arrays. The rules don't change: my_array = [ [ [1, 1, 2, 3, 5, 8, 13], [1, 4, 9, 16, 25, 36, 49, 64, 81], [2, 3, 5, 7, 11, 13, 17] ], [ ['a', 'b', 'c', 'd', 'e'], ['z', 'y', 'x', 'w', 'v'] ], [ [] ...
Accessing the 3rd element of the first subarray: my_array[1][2]
Given a multidimensional array: my_array = [[1, 2], ['a', 'b']] the operation of flattening is to decompose all array children into the root array: my_array.flatten # [1, 2, 'a', 'b']
#include <stdio.h> #include <pthread.h> void *thread_func(void *arg) { printf("I am thread #%d\n", *(int *)arg); return NULL; } int main(int argc, char *argv[]) { pthread_t t1, t2; int i = 1; int j = 2; /* Create 2 threads t1 and t2 wit...
/** * Apply a radial mask (vignette, i.e. fading to black at the borders) to a bitmap * @param imageToApplyMaskTo Bitmap to modify */ public static void radialMask(final Bitmap imageToApplyMaskTo) { Canvas canvas = new Canvas(imageToApplyMaskTo); final float centerX = imageToApply...
Request:"http://example.com" GET / HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 Accept: text/html,application/xml;q=0.9,*/*;q=0.8 Accept-Charset: UTF-8, iso-8859-1;q=0.8, *;q=0.5 Accept-Language: en-US,en;q=0.5 Acc...
Sub Array_clarity() Dim arr() As Variant 'creates an empty array Dim x As Long Dim y As Long x = Range("A1", Range("A1").End(xlDown)).Cells.Count y = Range("A1", Range("A1").End(xlToRight)).Cells.Count ReDim arr(0 To x, 0 To y) 'fixing the size of...
Middleware may be assigned to the controller's routes in your route files: Route::get('profile', 'UserController@show')->middleware('auth'); However, it is more convenient to specify middleware within your controller's constructor. Using the middleware method from your controller's constructor,...
This is an Angular 2 wrapper library for Dropzone. npm install angular2-dropzone-wrapper --save-dev Load the module for your app import { DropzoneModule } from 'angular2-dropzone-wrapper'; import { DropzoneConfigInterface } from 'angular2-dropzone-wrapper'; const DROPZONE_CONFIG: Dropzon...
To ensure that a GPU version TensorFlow process only runs on CPU: import os os.environ["CUDA_VISIBLE_DEVICES"]="-1" import tensorflow as tf For more information on the CUDA_VISIBLE_DEVICES, have a look to this answer or to the CUDA documentation.
To use a particular set of GPU devices, the CUDA_VISIBLE_DEVICES environment variable can be used: import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"]="0" # Will use only the first GPU device os.en...
The widget ttk.progress is useful when dealing with long computations so that the user knows that the program is running. Following, an example updating a progressbar each 0.5 seconds is given: Function updating the progressbar def progress(currentValue): progressbar["value"]=curren...

Page 210 of 218