Tutorial by Examples

npm install --global yarn If you didn't have npm installed before, check there website documentation for more details. https://yarnpkg.com/en/docs/install
For the most of it, if you know NPM, you’re already set! That adds a ‘package.json’ file in the root of your project npm init === yarn init These are all the same: npm link === yarn link npm outdated === yarn outdated npm publish === yarn publish npm run === yarn run npm cache clean === ya...
Yarn can check the licenses of your dependencies and can also generate a license based on your package's dependencies. yarn licenses yarn licenses generate
yarn why package-name will identify why a package is installed and which other packages depend upon it. yarn why react
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...
BeautifulSoup allows you to filter results by providing a function to find_all and similar functions. This can be useful for complex filters as well as a tool for code reuse. Basic usage Define a function that takes an element as its only argument. The function should return True if the argument m...
To illustrate how to use regr_slope(Y,X), I applied it to a real world problem. In Java, if you don't clean up memory properly, the garbage can get stuck and fill up the memory. You dump statistics every hour about memory utilization of different classes and load it into a postgres database for anal...
Lets first understand the problem, consider this figure- We want to calculate ϴ, where we know A, B & O. Now, if we want to get ϴ, we need to find out α and β first. For any straight line, we know- y = m * x + c Let- A = (ax, ay), B = (bx, by), and O = (ox, oy). So for the line OA- oy =...
Content Negotiation can be defined as the process of selecting best representation for a given resource. So Content negotiation means the client and server can negotiate between them so that client can get data according to their required format. There are three points on which internet depends, ...
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{...
When a Component is resolved from the Windsor container it must have a definition of the scope it is in. By scope meaning if and how it is reused and when to release the object for the Garbage Collector to destroy. This is the LifeStlye of the Component. The way to specify a LifeStyle is by registe...
By implementing your custom IScopeAccessor you can create different types of scopes. For the following example I have the two classes Foo and Bar in which Bar will be registered with a custom LifeStyle. Each have an Id to assist with testing public class Foo { public Guid FooId { get; } = G...
In order to typeset text in bold, use \textbf: \textbf{This text is typeset in bold.}
Define a new basic command A macro can be defined using \newcommand. For example: \newcommand{\foo}{Just foo, you see?} defines a macro \foo that expands to Just foo, you see?. It can then be used like any built-in command, for example after that definition: He said: ``\foo'' expands to He...
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...
# create a window with a button that closes the window when clicked window = cmds.window(title='example window') # create the window layout = cmds.columnLayout(adjustableColumn=True) # add a vertical layout def close_window(*_): cmds.deleteUI(window) # delet...
Reading a text file line-by-line A proper way to read a text file line-by-line till the end is usually not clear from ifstream documentation. Let's consider some common mistakes done by beginner C++ programmers, and a proper way to read the file. Lines without whitespace characters For the sake o...
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...

Page 1010 of 1336