Tutorial by Examples: sin

new Vue({ el:"#app", data:{ foo: "bar" }, methods:{ // This is wrong! Arrow functions capture "this" lexically // and "this" will refer to the window. doSomething: () => this.foo = "baz" } })
You might need a v-model on a computed property. Normally, the v-model won't update the computed property value. The template: <div id="demo"> <div class='inline-block card'> <div :class='{onlineMarker: true, online: status, offline: !status}'></div> ...
Value types simply contain a value. All value types are derived from the System.ValueType class, and this includes most of the built in types. When creating a new value type, the an area of memory called the stack is used. The stack will grow accordingly, by the size the declared type. So for exa...
Reference types are comprised of both a reference to a memory area, and a value stored within that area. This is analogous to pointers in C/C++. All reference types are stored on what is known as the heap. The heap is simply a managed area of memory where objects are stored. When a new object is ...
Gates are closures that determine if a user is allowed to perform a certain action on a resource. Gates are typically defined in the boot method of AuthServiceProvider and succinctly named to reflect what it's doing. An example of a gate that allows only premium users to view some content will look ...
On the machine where you'd like to make the backup, jump to the Redis CLI: redis-cli Password? If your master Redis DB (the one you want to replicate) has a password: config set masterauth <password> Start replication Run the following to begin replication: SLAVEOF <host> <...
navigator.mediaDevices is the common method adapted in Chrome and FF to getUserMedia as of now. A promised based call back which returns local stream on success navigator.mediaDevices.getUserMedia({ audio: true, video: true }) .then(stream => { // attach this stream to window obje...
This example uses Icarus and GTKWave. Installation instructions for those tools on OSx are provided elsewhere on this page. Lets begin with the module design. This module is a BCD to 7 segment display. I have coded the design in an obtuse way simply to give us something that is easily broken and...
You should create functions in a controller like insert, update, delete, and clear cart etc. eg : for insert new item in cart write below code that accepts value. $cartItem = array( 'id' => 'MOTOG5', 'qty' => 5, 'price' => 100.99, 'name' => 'Motorola Moto G5 - 16 GB',...
This example is based on this post: TensorFlow - numpy-like tensor indexing. In Numpy you can use arrays to index into an array. E.g. in order to select the elements at (1, 2) and (3, 2) in a 2-dimensional array, you can do this: # data is [[0, 1, 2, 3, 4, 5], # [6, 7, 8, 9, 10, 11], # ...
Open your jenkins instance script console http://yourJenkins:port/script following is an example for how to get information about this instance. copy the code to the console and click "Run". /* This scripts shows how to get basic information about Jenkins instance */ def jenkins = Jenki...
First of all you'll need to have a key pair. If you don't have one yet, take a look at the 'Generate public and private key topic'. Your key pair is composed by a private key (id_rsa) and a public key (id_rsa.pub). All you need to do is to copy the public key to the remote host and add its contents...
select cst.constraint_schema, cst.constraint_name,                        fk.table_name, fk.ordinal_position, fk.column_name,                pk.table_name, pk.column_name                                 from qsys2.syscst cst join qsys2.syskeycst fk                         on fk.constraint_sc...
The QTimer::singleShot is used to call a slot/lambda asynchronously after n ms. The basic syntax is : QTimer::singleShot(myTime, myObject, SLOT(myMethodInMyObject())); with myTime the time in ms, myObject the object which contain the method and myMethodInMyObject the slot to call So for exampl...
To set up a simple hibernate project using XML for the configurations you need 3 files, hibernate.cfg.xml, a POJO for each entity, and a EntityName.hbm.xml for each entity. Here is an example of each using MySQL: hibernate.cfg.xml <?xml version="1.0" encoding="utf-8"?> &...
This is an example of how you would do a one to many mapping using XML. We will use Author and Book as our example and assume an author may have written many books, but each book will only have one author. Author class: public class Author { private int id; private String firstName; ...
With the help of West Wind's wwDotNetBridge, you can easily have access .NET code within a VFP program. The white paper has all the details, but this concise example will help illustrate the basic steps to running a method in a .NET assembly. Note that wwDotNetBridge can directly access simple pro...
This example shows how to manipulate button ideal size by specifying a fixed size. class ButtonSubclass { public: ButtonSubclass(HWND hWndButton) { SetWindowSubclass(hWndButton, MyButtonSubclassProc, 1, (DWORD_PTR) this); } ~ButtonSuclass() { RemoveWindowSubclass...
I would describe %LET as being the most simple way to creating a Macro Variable in SAS. %LET variableName = variableValue; Now, anywhere you use &variableName, it will resolve to variableValue. NOTE:you may want to consider that variableValue all on its own might bring you syntax errors, ...
Using PROC SQL is a good way to get quick results from a table and throw them into variables. I usually find that when I want to get a count of records I just loaded to a table, I can get that count into a variable with a quick PROC SQL call. PROC SQL; SELECT COUNT(*) INTO:aVariable FROM ...

Page 143 of 161