Tutorial by Examples: ect

The update pattern in D3 version 3 A correct understanding of how the “enter”, “update” and “exit” selections work is fundamental for properly changing the dataviz using D3. Since D3 version 3 (actually, since version 2), this snippet could set the transitions for both “enter” and “update” selecti...
Use the ls() commands to find objects by name: freds = cmds.ls("fred") #finds all objects in the scene named exactly 'fred', ie [u'fred', u'|group1|fred'] Use * as a wildcard: freds = cmds.ls("fred*") # finds all objects whose name starts with 'fred' # [u'fred', u'freder...
Use Update the object name which is stored in reference SYNOPSIS git update-ref [-m <reason>] (-d <ref> [<oldvalue>] | [--no-deref] [--create-reflog] <ref> <newvalue> [<oldvalue>] | --stdin [-z]) General Syntax Dereferencing the symbolic refs, update th...
If you have an attribute that needs to be saved and retrieved to database as an object, then specify the name of that attribute using the serialize method and it will be handled automatically. The attribute must be declared as a text field. In the model you must declare the type of the field (Hash...
Go to Providers > ApplicationOAuthProvider.cs and edit the ValidateClientRedirectUri function. This was a big gotcha to me, as if you don't do this there'll be a fantastically unhelpful error message. By default, this code will make any callbacks to your site invalid unless they're to the site's ...
This example will list the preferred resolution for all the connected monitors. The Code: On Error Resume Next strComputer = "." strQuery = "SELECT PreferredMonitorSourceModeIndex, MonitorSourceModes " & _ "FROM WmiMonitorListedSupportedSourceModes" ...
Vectors are one-dimensional arrays, and support mostly the same interface as their multi-dimensional counterparts. However, vectors also support additional operations. First, note that Vector{T} where T is some type means the same as Array{T,1}. julia> Vector{Int} Array{Int64,1} julia> V...
A C program that wishes to accept network connections (act as a "server") should first create a socket bound to the address "INADDR_ANY" and call listen on it. Then, it can call accept on the server socket to block until a client connects. //Create the server socket int servsoc...
POSIX.1-2008 Given the name of a server as a string, char* servername, and a port number, int port, the following code creates and opens a socket connected to that server. The "name" of the server can either be a DNS name, such as "www.stackoverflow.com," or an IP address in sta...
Sub DisplayExcelVersions() MsgBox "The version of Excel is " & Application.Version MsgBox "The version of the VBE is " & Application.VBE.Version End Sub The use of the Application.Version property is useful for ensuring code only operates on a compatible...
Sometimes you have sensitive information in your VBA (e.g., passwords) that you don't want users to have access to. You can achieve basic security on this information by password-protecting your VBA project. Follow these steps: Open your Visual Basic Editor (Alt + F11) Navigate to Tools -> V...
Wanted version for C and C++ can be specified globally using respectively variables CMAKE_C_STANDARD (accepted values are 98, 99 and 11) and CMAKE_CXX_STANDARD (accepted values are 98, 11 and 14): set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 11) These will add the needed compile options on t...
v-for can be used for iterating over an object keys (and values): HTML: <div v-for="(value, key) in object"> {{ key }} : {{ value }} </div> Script: new Vue({ el: '#repeat-object', data: { object: { FirstName: 'John', LastName: 'Doe', Ag...
Almost any controller needs some external dependencies to work. Here is a way to configure a dependency object (or its factory) and pass it to a controller. Doing so will help to sustain a separation of concerns, keep code clear and testable. Say, we have an interface and its implementation that...
ls() includes a type flag, which lets you find scene nodes of a particular type. For example: cameras = cmds.ls(type='camera') // [u'topShape', u'sideShape', u'perspShape', u'frontShape'] You can search for multiple types in the same call: geometry = cmds.ls(type=('mesh', 'nurbsCurve', 'nu...
/** * Runs user-specified code when the given javascript object is garbage collected */ template<class CALLBACK_FUNCTION> void global_set_weak(v8::Isolate * isolate, const v8::Local<v8::Object> & javascript_object, CALLBACK_FUNCTION function) { struct SetWeakCallbackData{...
The idea is to have one or more control machines from where you can issue ad-hoc commands to remote machines (via ansible tool) or run a sequenced instruction set via playbooks (via ansible-playbook tool). Basically, we use Ansible control machine, this will typically be your desktop, laptop or s...
Basic printing std::ostream_iterator allows to print contents of an STL container to any output stream without explicit loops. The second argument of std::ostream_iterator constructor sets the delimiter. For example, the following code: std::vector<int> v = {1,2,3,4}; std::copy(v.begin(), v...
First we must edit the SSH daemon config file. Though under different Linux distributions this may be located in different directories, usually it is stored under /etc/ssh/sshd_config Use your text editor to change the values set in this file, all lines starting with # are commented out and must ha...
Since ls() finds objects by names, it's a handy way to find out if an object is present in the scene. ls() with a list of objects will only return the ones which are in the scene. available_characters = cmds.ls('fred', 'barney', 'wilma', 'dino') # available_characters will contain only the named...

Page 76 of 99