Tutorial by Examples: ecto

In general, there are two types of Bash scripts: System tools which operate from the current working directory Project tools which modify files relative to their own place in the files system For the second type of scripts, it is useful to change to the directory where the script is stored. T...
As mentioned in another example a subset of the elements of an array, called an array section, may be referenced. From that example we may have real x(10) x(:) = 0. x(2:6) = 1. x(3:4) = [3., 5.] Array sections may be more general than this, though. They may take the form of subscript trip...
matrix-vector(A,x) n = A.lines y = Vector(n) //create a new vector of length n parallel for i = 1 to n y[i] = 0 parallel for i = 1 to n for j = 1 to n y[i] = y[i] + A[i][j]*x[j] return y
Each fundamental opencl type has a vector version. You can use the vector type by appending the number of desired components after the type. Supported number of components are 2,3,4,8 and 16. OpenCL 1.0 does not offer three components. You can initialize any vector using two ways: Provide a sing...
Small object optimization is a technique which is used within low level data structures, for instance the std::string (Sometimes referred to as Short/Small String Optimization). It's meant to use stack space as a buffer instead of some allocated memory in case the content is small enough to fit with...
The example below is taken from the full docs, available here (GitHub) or here (NPM). Installation npm install --save activedirectory Usage // Initialize var ActiveDirectory = require('activedirectory'); var config = { url: 'ldap://dc.domain.com', baseDN: 'dc=domain,dc=com' }; va...
When you group CSS selectors, you apply the same styles to several different elements without repeating the styles in your style sheet. Use a comma to separate multiple grouped selectors. div, p { color: blue } So the blue color applies to all <div> elements and all <p> elements. Wit...
I get the file path from document directory and read that file in chunks of 1024 and save (append) to NSMutableData object or you can directly write to socket. // MARK: - Get file data as chunks Methode. func getFileDataInChunks() { let doumentDirectoryPath = NSSearchPathForDirectoriesI...
Ensure you met all requirements, as per Requirements Mount the temporary API filesystems: cd /location/of/new/root mount -t proc proc proc/ mount --rbind /sys sys/ mount --rbind /dev dev/ mount --rbind /run run/ (optionally) If you need to use an internet connection in the c...
Create an Azure AD B2C Directory Note the Domain name, it'll be used as the tenantName. Register your application Follow the instructions to create an application and enable both Web App and Native client. Refer Register a web application and Register a mobile/native application Enter th...
Refer the example here: https://github.com/NewtonJoshua/Azure-ADB2C-Angularjs-sample Azure AD B2C Azure AD B2C is a cloud identity management solution for your web and mobile applications. It is a highly available global service that scales to hundreds of millions of identities. Mobile app - ADAL...
Refer the example in https://github.com/NewtonJoshua/Azure-ADB2C-Angularjs-sample Web app implementation uses Hello.js that performs identity management with Azure AD B2C . Hello.js is a client-side JavaScript SDK for authenticating with OAuth2 web services and querying REST APIs. jwtHelper of ang...
-- loop-based version function hw_loop(v: std_logic_vector) return natural is variable h: natural; begin h := 0; for i in v'range loop if v(i) = '1' then h := h + 1; end if; end loop; return h; end function hw_loop; -- recursive version function hw_tree(v: std_...
php -S localhost:80 -t project/public router.php PHP 7.1.7 Development Server started at Fri Jul 14 15:22:25 2017 Listening on http://localhost:80 Document root is /home/project/public Press Ctrl-C to quit.
├───models │ ├───user.model.js ├───routes │ ├───user.route.js ├───services │ ├───user.service.js ├───controllers │ ├───user.controller.js For modular code structure the logic should be divided into these directories and files. Models - The schema definition of the Model Rou...
(let [xf (comp (map inc) (filter even?))] (transduce xf + [1 2 3 4 5 6 7 8 9 10])) ;; => 30 This example creates a transducer assigned to the local xf and uses transduce to apply it to some data. The transducer add's one to each of it's inputs and only returns the ...
When you run mix phoenix.gen.html or mix phoenix.gen.json from command line, migrations are created in priv -> repo -> migrations in your project folder. To run migrations type mix ecto.migrate. To generate migrations for your project mix ecto.gen migrations <model_name> To generate m...

Page 13 of 13