Tutorial by Examples: e

library(gpuR) # gpuMatrix objects X <- gpuMatrix(rnorm(100), 10, 10) Y <- gpuMatrix(rnorm(100), 10, 10) # transfer data to GPU when operation called # automatically copied back to CPU Z <- X %*% Y
library(gpuR) # vclMatrix objects X <- vclMatrix(rnorm(100), 10, 10) Y <- vclMatrix(rnorm(100), 10, 10) # data always on GPU # no data transfer Z <- X %*% Y
From MSDN Use the CInt function to provide conversions from any other data type to an Integer subtype. For example, CInt forces integer arithmetic when currency, single-precision, or double-precision arithmetic would normally occur. Assuming that you have 1 button and 2 textbox. If you type...
TRACE and DEBUG log levels are there to be able to convey high detail about the operation of the given code at runtime. Setting the log level above these is usually recommended, however some care must be taken for these statements to not affect performance even when seemingly "turned off"....
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ /$1/ [L,R=301] The first RewriteCond helps exclude the files. The second RewriteCond checks if there is already a trailing slash. If the case is so RewriteRule is not applied. If you have any URL that s...
Download the Apache Felix Framework Distribution and extract it into a directory: $ tar xf org.apache.felix.main.distribution-5.4.0.tar.gz $ cd felix-framework-5.4.0 And then start the framework with the following command: $ java -jar bin/felix.jar ____________________________ Welcome to...
In most cases, it is illegal to access an object of one type as though it were a different type (disregarding cv-qualifiers). Example: float x = 42; int y = reinterpret_cast<int&>(x); The result is undefined behavior. There are some exceptions to this strict aliasing rule: An obj...
Consider writing a "hello world!" program in c. Lets say our source code is in a file called source.c, now in order to run our program we need to compile it, typically on Linux (using gcc) we would need to type $> gcc source.c -o output where output is the name of the executable to be g...
This example will call the windows calculator. It's important to notice that the exit code will vary accordingly to the program/script that is being called. package process.example; import java.io.IOException; public class App { public static void main(String[] args) { try { ...
The ProcessBuilder class makes it easy to send a command through the command line. All it requires is a List of Strings that make up the commands to be entered. You simply call the start() method on your ProcessBuilder instance to execute the command. If you have a program called Add.exe which take...
Launching external processes from Java using the raw java.lang.ProcessBuilder API directly can be a little cumbersome. The Apache Commons Exec library makes it a little easier. The ch.vorburger.exec library further extends upon Commons Exec to make it truly convenient: ManagedProcess proc = new ...
The ngPaste directive specifies custom behavior to run when a user pastes content <input ng-paste="paste=true" ng-init="paste=false" placeholder='paste here'> pasted: {{paste}}
This proxy simply appends the string " went through proxy" to every string property set on the target object. let object = {}; let handler = { set(target, prop, value){ // Note that ES6 object syntax is used if('string' === typeof value){ target[prop] = valu...
Laravel's events allows to implement the Observer pattern. This can be used to send a welcome email to a user whenever they register on your application. New events and listeners can be generated using the artisan command line utility after registering the event and their particular listener in App...
Here's a way to show a GIF preloader while an AJAX call is executing. We need to prepare our add and remove preloader functions: function addPreloader() { // if the preloader doesn't already exist, add one to the page if(!document.querySelector('#preloader')) { var preloaderHTML = '<...
Get current time: Time.now Time.new # is equivalent if used with no parameters Get specific time: Time.new(2010, 3, 10) #10 March 2010 (Midnight) Time.new(2015, 5, 3, 10, 14) #10:14 AM on 3 May 2015 Time.new(2050, "May", 3, 21, 8, 16, "+10:00") #09:08:16 PM on 3 May 2050...
DATA: <TABLE NAME> TYPE <SORTED|STANDARD|HASHED> TABLE OF <TYPE NAME> WITH <UNIQUE|NON-UNIQUE> KEY <FIELDS FOR KEY>. Standard Table This table has all of the entries stored in a linear fashion and records are accessed in a linear way. For large table sizes, ...
Notice, this is only for angular-cli up to 1.0.0-beta.10 version ! Some libraries or plugins may not have typings. Without these, TypeScript can't type check them and therefore causes compilation errors. These libraries can still be used but differently than imported modules. Include a scr...
For example: ActiveRecord::Base.transaction do david.withdrawal(100) mary.deposit(100) end This example will only take money from David and give it to Mary if neither withdrawal nor deposit raise an exception. Exceptions will force a ROLLBACK that returns the database to the state before ...
Though the transaction class method is called on some ActiveRecord class, the objects within the transaction block need not all be instances of that class. This is because transactions are per-database connection, not per-model. In this example a balance record is transactionally saved even though ...

Page 565 of 1191