Tutorial by Examples

o1 = ones(5); % Create a 5-by-5 matrix of ones o2 = ones(1,3); % Create a 1-by-3 matrix / vector of size 3
i1 = eye(3); % Create a 3-by-3 identity matrix i2 = eye(5,6); % Create a 5-by-6 identity matrix
<ul> <li *ngFor="let item of items">{{item.name}}</li> </ul>
<div *ngFor="let item of items"> <p>{{item.name}}</p> <p>{{item.price}}</p> <p>{{item.description}}</p> </div>
<div *ngFor="let item of items; let i = index"> <p>Item number: {{i}}</p> </div> In this case, i will take the value of index, which is the current loop iteration.
Angular2 provides several exported values that can be aliased to local variables. These are: index first last even odd Except index, the other ones take a Boolean value. As the previous example using index, it can be used any of these exported values: <div *ngFor="let item of item...
A thread-local object gets initialized on its first use in a thread. And as the name suggests, each thread will get a fresh copy independent of other threads. use std::cell::RefCell; use std::thread; thread_local! { static FOO: RefCell<f32> = RefCell::new(1.0); } // When this mac...
Sometimes we don't want to load the entire XML file in order to get the information we need. In these instances, being able to incrementally load the relevant sections and then delete them when we are finished is useful. With the iterparse function you can edit the element tree that is stored while ...
Detailed instructions on getting Nexus Repository Manager 3.x set up or installed.
add the following function into .bash_profile, save and exit function wekaflstart() { export R_HOME=/Library/Frameworks/R.framework/Resources java -Xss10M -Xmx4096M -cp :weka.jar weka.gui.knowledgeflow.KnowledgeFlow "$1" } inside a directory with a weka.jar file, open its termin...
required: understanding Bitmap and Bitmap data what is threshold This adjustment takes all the pixels in an image and…pushes them to either pure white or pure black what we have to do here is a Live Demo of this example with some additional changes like using a UI to changing th...
bitcoin.conf The bitcoin.conf file allows customization for your node. Create a new file in a text-editor and save it as bitcoin.conf in your /bitcoin directory. Location of your /bitcoin directory depends on your operation system. Windows XP C:\Documents and Settings\<username>\...
This design pattern is called Strategy Pattern. It is used to define a family of algorithms, encapsulates each one, and make them interchangeable. Strategy design pattern lets an algorithm vary independently from clients that use it. For example, animals can "walk" in many different w...
To use the method of inflector helper, first load the helper like all other helper with the following code: $this->load->helper('inflector');
Function singular($string), convert a plural word to singular. To get perfect result parameter $string should be a single word. The function will return string. echo singular("books"); //prints 'book'
is_countalbe($string) is use for checking a word has plural form or not. Return type will be boolean means if the given word has plural form it will return true, otherwise will return false. is_countable('book'); // Returns TRUE
For getting plural form of any English word the plural($string) function is handy. Like singular($string), the function plural($string) also return string result. echo plural("book"); //prints 'books'
Camel Case is the practise of writing compound words or phrases where every word begins with Capital letter, without space between word. The function camelize($string) helps to make a string camelized. It converts a string of words separated by spaces or underscores to camel case. echo camelize('Mc...
Remove delimiter The function humanize($words), takes multiple words separated by underscores and adds spaces for underscores with capitalized each word. echo humanize('mac_donald'); // Prints 'Mac Donald' The function can also replace any declared separator/delimiter. In this case, delimiter w...
PLEASE NOTE: ONLY PUT THIS CODE IN THE HEADER OF THE PAGE, OTHERWISE IT WILL NOT WORK! <?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); echo 'Text to send if user hits Cancel button';...

Page 1044 of 1336