Tutorial by Examples: dis

Property scrollEnabled stores a Boolean value that determines whether scrolling is enabled or not. If the value of this property is true/YES, scrolling is enabled, otherwise not.The default value is true Swift scrollview.isScrollEnabled = true Objective-C scrollview.scrollEnabled = YES;
This will load a JSON file from disk and convert it to the given type. public static <T> T getFile(String fileName, Class<T> type) throws FileNotFoundException { Gson gson = new GsonBuilder() .create(); FileReader json = new FileReader(fileName); return gson....
To enable or disable a BroadcastReceiver, we need to get a reference to the PackageManager and we need a ComponentName object containing the class of the receiver we want to enable/disable: ComponentName componentName = new ComponentName(context, MyBroadcastReceiver.class); PackageManager packageM...
Displaying all the logs from the default buffer on the Command Line can be accomplished by: adb logcat This command will show you all the logs from the device's main buffer. Notice that if you use it for the first time, you'll get a lot of information, an enormous stream of data. So you may want...
As with docopt, with [docopt_dispatch] you craft your --help in the __doc__ variable of your entry-point module. There, you call dispatch with the doc string as argument, so it can run the parser over it. That being done, instead of handling manually the arguments (which usually ends up in a high c...
This example shows how a MongoDB collection can be displayed in a React component. The collection is continuously synchronized between server and client, and the page instantly updates as database contents change. To connect React components and Meteor collections, you'll need the react-meteor-data...
PMF FOR THE BINOMIAL DISTRIBUTION Suppose that a fair die is rolled 10 times. What is the probability of throwing exactly two sixes? You can answer the question using the dbinom function: > dbinom(2, 10, 1/6) [1] 0.29071 PMF FOR THE POISSON DISTRIBUTION The number of sandwhich ordered in ...
The Display Logic module allows you to add conditions for displaying or hiding certain form fields based on client-side behavior. This module is incredibly useful to make forms much more professional by showing only the appropriate fields and without adding a lot of custom JavaScript. Example usag...
The Python interpreter compiles code to bytecode before executing it on the Python's virtual machine (see also What is python bytecode?. Here's how to view the bytecode of a Python function import dis def fib(n): if n <= 2: return 1 return fib(n-1) + fib(n-2) # Display the disas...
Recursive type Discriminated unions can be recursive, that is they can refer to themselves in their definition. The prime example here is a tree: type Tree = | Branch of int * Tree list | Leaf of int As an example, let's define the following tree: 1 2 5 3 4 We can defi...
console.dir(object) displays an interactive list of the properties of the specified JavaScript object. The output is presented as a hierarchical listing with disclosure triangles that let you see the contents of child objects. var myObject = { "foo":{ "bar":"d...
Prolog tries alternative clauses for a predicate in the order of appearance: likes(alice, music). likes(bob, hiking). // Either alice likes music, or bob likes hiking will succeed. The disjunction (OR) operator ; can be used to express this in one rule: likes(P,Q) :- ( P = alice , Q = ...
When deploying RethinkDB in production, you want to either turn off or lock down the WebUI. This will only respond to localhost to access the WebUI allowing you to SSH Tunnel to the host machine and access it for diagnostics and troubleshooting. docker run -d \ -v host_data_path:/data \ ret...
The following example illustrates how to use CullingGroups to get notifications according to the distance reference point. This script has been simplified for brevity and uses several performance heavy methods. using UnityEngine; using System.Linq; public class CullingGroupBehaviour : Mono...
You can add bounding distances on top of culling point radius. They are in a manner additional trigger conditions outside the culling points' main radius, like "close", "far" or "very far". cullingGroup.SetBoundingDistances(new float[] { 0f, 10f, 100f}); Bounding ...
To list all configured remote repositories, use git remote. It shows the short name (aliases) of each remote handle that you have configured. $ git remote premium premiumPro origin To show more detailed information, the --verbose or -v flag can be used. The output will include the URL and th...
You can create your own queue using dispatch_queue_create Objective-C dispatch_queue_t queue = dispatch_queue_create("com.example.myqueue", DISPATCH_QUEUE_SERIAL); Swift // Before Swift 3 let queue = dispatch_queue_create("com.example.myqueue", DISPATCH_QUEUE_SERIAL) // ...
CALayer property animations are enabled by default. When this is undesirable, they can be disabled as follows. Swift CATransaction.begin() CATransaction.setDisableActions(true) // change layer properties that you don't want to animate CATransaction.commit() Objective-C [CATransaction be...
This example portrays the most simple ALV creation using the cl_salv_table class and no additional formatting options. Additional formatting options would be included after the TRY ENDTRY block and before the alv->display( ) method call. All subsequent examples using the ABAP Objects approach to...
By default, when an ALV is displayed, the title at the top is just the program name. This method allows the user to set a title of up to 70 characters. The following example shows how a dynamic title can be set that displays the number of records displayed. alv->get_display_settings( )->set_l...

Page 8 of 18