Tutorial by Examples: dis

If you are using the default bash prompt on Linux, you should see the name of the virtual environment at the start of your prompt. (my-project-env) user@hostname:~$ which python /home/user/my-project-env/bin/python
Create a .gitattributes file in the project root containing: * -text This is equivalent to setting core.autocrlf = false.
A simple way of selecting between functions at compile time is to dispatch a function to an overloaded pair of functions that take a tag as one (usually the last) argument. For example, to implement std::advance(), we can dispatch on the iterator category: namespace details { template <clas...
With this example, we will see how to load a color image from disk and display it using OpenCV's built-in functions. We can use the C/C++, Python or Java bindings to accomplish this. In C++: #include <opencv2/core.hpp> #include <opencv2/highgui.hpp> #include <iostream> usi...
unique drops duplicates so that each element in the result is unique (only appears once): x = c(2, 1, 1, 2, 1) unique(x) # 2 1 Values are returned in the order they first appeared. duplicated tags each duplicated element: duplicated(x) # FALSE FALSE TRUE TRUE TRUE anyDuplicated(x) >...
It is possible to create a function that accepts objects that implement a specific trait. Static Dispatch fn generic_speak<T: Speak>(speaker: &T) { println!("{0}", speaker.speak()); } fn main() { let person = Person {}; let dog = Dog {}; generic_speak(...
Adding the DebuggerDisplay Attribute will change the way the debugger displays the class when it is hovered over. Expressions that are wrapped in {} will be evaluated by the debugger. This can be a simple property like in the following sample or more complex logic. [DebuggerDisplay("{StringPr...
The display CSS property is fundamental for controlling the layout and flow of an HTML document. Most elements have a default display value of either block or inline (though some elements have other default values). Inline An inline element occupies only as much width as necessary. It stacks horiz...
There are few approaches available there: You can subscribe for keyboard appearance events notifications and change offset manually: //Swift 2.0+ override func viewDidLoad() { super.viewDidLoad() NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(YourVCClas...
Look at the contents of /etc/redhat-release cat /etc/redhat-release Here is the output from a Fedora 24 machine: Fedora release 24 (Twenty Four) As mentioned in the debian-based response, you can also use the lsb_release -a command, which outputs this from a Fedora 24 machine: LSB Version: ...
The random number generator can (and should) be used for multiple distributions. #include <iostream> #include <random> int main() { std::default_random_engine pseudo_random_generator; std::uniform_int_distribution<int> int_distribution(0, 9); std::uniform_real_dis...
Function DisableShift() 'This function disable the shift at startup. This action causes 'the Autoexec macro and Startup properties to always be executed. On Error GoTo errDisableShift Dim db As DAO.Database Dim prop As DAO.Property Const conPropNotFound = 3270 Set db = C...
In AS3, display assets are not visible until they are added to the Display List. The AIR/Flash runtime has a hierarchical display structure (parent child relationship where children can have their own children), with the stage being the top level parent. To add something to the display list, you u...
Grand Central Dispatch works on the concept of "Dispatch Queues". A dispatch queue executes tasks you designate in the order which they are passed. There are three types of dispatch queues: Serial Dispatch Queues (aka private dispatch queues) execute one task at a time, in order. They a...
3.0 To run tasks on a dispatch queue, use the sync, async, and after methods. To dispatch a task to a queue asynchronously: let queue = DispatchQueue(label: "myQueueName") queue.async { //do something DispatchQueue.main.async { //this will be called in main t...
Display multiple plots in one image with the different facet functions. An advantage of this method is that all axes share the same scale across charts, making it easy to compare them at a glance. We'll use the mpg dataset included in ggplot2. Wrap charts line by line (attempts to create a square l...
<!DOCTYPE html> <html> <head> <meta charset='utf-8' /> <title></title> <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> <!-- find the latest library and style versions here: https://www.mapbox.com/m...
EXTENDED_ARG = 145 # All opcodes greater than this have 2 operands HAVE_ARGUMENT = 90 # All opcodes greater than this have at least 1 operands cmp_op = ('<', '<=', '==', '!=', '>', '>=', 'in', 'not in', 'is', 'is ... # A list of comparator id's. The indecies are used as opera...
To disassemble a Python module, first this has to be turned into a .pyc file (Python compiled). To do this, run python -m compileall <file>.py Then in an interpreter, run import dis import marshal with open("<file>.pyc", "rb") as code_f: code_f.read(8) # M...
Swift Ctrl + Drag from the UItextfield in MainStoryboard to the ViewController Class and create a UITextField Outlet After that select the UItextField again and Ctrl+drag in ViewController class but this time select Action connection and on storage select Did End On Exit then click connect. ...

Page 2 of 18