Tutorial by Examples: dis

It's quite common to want to check the status of the various partitions/drives on your server/computer to see how full they are. The following command is the one you'll want to run: df -h This will produce output similar to the following: [root@mail ~]# df -h Filesystem Size Used A...
Because Julia function parameter lists are themselves tuples, dispatching on various kinds of tuples is often easier done through the method parameters themselves, often with liberal usage for the "splatting" ... operator. For instance, consider the implementation of reverse for tuples, fr...
Given a CLLocationDistance (simply a Double representing meters), output a user-readable string: let distance = CLLocationDistance(42) let formatter = MKDistanceFormatter() let answer = formatter.stringFromDistance(distance) // answer = "150 feet" Objective-C CLLocationDistance dis...
import Mapkit Set units to one of .Default, .Metric, .Imperial, .ImperialWithYards: formatter.units = .Metric var answer = formatter.stringFromDistance(distance) // "40 m" formatter.units = .ImperialWithYards answer = formatter.stringFromDistance(distance) // "50 yards" ...
This example shows the simplest usage of the Image component to display an image. The Image source property is a url type that can be either a file with an absolute or relative path, an internet URL (http://) or a Qt resource (qrc:/) import QtQuick 2.3 Rectangle { width: 640 height: 4...
function somethingThatReturnsADisposableResource() { return getSomeResourceAsync(...).disposer(resource => { resource.dispose() }) } Promise.using(somethingThatReturnsADisposableResource(), resource => { // use the resource here, the disposer will automatically close it when ...
To give an alert close functionality, all we need is to add data-dismiss="alert" to our close button. <div class="alert alert-info alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria...
dispatch_group_t preapreWaitingGroup = dispatch_group_create(); dispatch_group_enter(preapreWaitingGroup); [self doAsynchronousTaskWithComplete:^(id someResults, NSError *error) { // Notify that this task has been completed. dispatch_group_leave(preapreWaitingGroup); }] dispatch...
To view all elements in the index change the print options that “sparsifies” the display of the MultiIndex. pd.set_option('display.multi_sparse', False) df.groupby(['A','B']).mean() # Output: # C # A B # a 1 107 # a 2 102 # a 3 115 # b 5 92 # b 8 98 # c 2 87 # c 4 104 #...
Sometimes it may be required to find out which directory consuming how much disk space especially when you are used df -h and realized your available disk space is low. du: du command summarizes disk usage of the set of FILEs, recursively for directories. It's often uses with -sh option: -s, --s...
Installation Additional dependencies are required for Redis support. Install both Celery and the dependencies in one go using the celery[redis] bundle: $ pip install -U celery[redis] Configuration Configure the location of your Redis database: BROKER_URL = 'redis://localhost:6379/0' The UR...
The following is the list of all the data structures supported by Redis: Binary-safe strings Lists: collections of string elements sorted according to the order of insertion. Sets: collections of unique, unsorted string elements. Sorted sets: similar to Sets but where every string element is a...
DISPLAY "An error occurred with " tracked-resource UPON SYSERR DISPLAY A, B, C UPON CONSOLE DISPLAY group-data UPON user-device ON EXCEPTION WRITE device-exception-notice NOT ON EXCEPTION WRITE device-usage-log END-DISPLAY UPON CONSOLE is a default, ra...
Objects that are not built-in To print the source code of a Python object use inspect. Note that this won't work for built-in objects nor for objects defined interactively. For these you will need other methods explained later. Here's how to print the source code of the method randint from the ran...
public class RedisPublisher extends RouteBuilder { public static final String CAMEL_REDIS_CHANNEL = "CamelRedis.Channel"; public static final String CAMEL_REDIS_MESSAGE = "CamelRedis.Message"; @Value("${redis.host}") private String redisHost; ...
public class RedisSubscriber extends RouteBuilder { @Value("${redis.host}") private String redisHost; @Value("${redis.port}") private int redisPort; @Value("${redis.channel.mychannel}") private String redisChannel; private Object b...
Checking the Existence of Keys Sometimes you may need to check if a key already exists and proceed accordingly. To do so you can use exists() function as shown below: client.exists('key', function(err, reply) { if (reply === 1) { console.log('exists'); } else { cons...
Format and Usage: echo %cd% %cd% is a system variable that contains the current directory path
If the response has already been created and set on the response object outside the regular rendering process (e.g., in an observer), the 'no-renderLayout' flag can be set on the action controller using Mage::app()->getFrontController()->getAction()->setFlag('','no-renderLayout'); ...
Rust has a default formatter for pointer types that can be used for displaying pointers. use std::ptr; // Create some data, a raw pointer pointing to it and a null pointer let data: u32 = 42; let raw_ptr = &data as *const u32; let null_ptr = ptr::null() as *const u32; // the {:p} mappi...

Page 12 of 18