Tutorial by Examples: c

Normally, we opt this approach if we want complete encapsulation and don't want to make our methods public. Ascx <div style="width: 100%;"> <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click"></asp:butto...
void parallelAddition (unsigned N, const double *A, const double *B, double *C) { unsigned i; #pragma omp parallel for shared (A,B,C,N) private(i) schedule(static) for (i = 0; i < N; ++i) { C[i] = A[i] + B[i]; } } This example adds two vector (A and B into...
#include <omp.h> #include <stdio.h> int main (void) { int t = (0 == 0); // true value int f = (1 == 0); // false value #pragma omp parallel if (f) { printf ("FALSE: I am thread %d\n", omp_get_thread_num()); } #pragma omp parallel if (t) { printf (&quo...
#include <omp.h> #include <unistd.h> #include <iostream> #include <list> static void processElement (unsigned n) { // Tell who am I. The #pragma omp critical ensures that // only one thread sends data to std::cout #pragma omp critical std::cout <...
How to write a query to get all departments where average age of employees making less than or $70000 is greather than or equal to 35? In order to that we need to write a query to match employees that have a salary that is less than or equal to $70000. Then add the aggregate stage to group the empl...
Let's create a process which is rather long to complete : $ sleep 1000 To pause the process, type Ctrl + Z : ^Z [1]+ Stopped sleep 1000 You can use jobs to see the list of processes running or stopped in the current terminal : $ jobs [1]+ Stopped sleep 10...
To get a list of the processes running in the current terminal, you can use ps : $ sleep 1000 & $ ps -opid,comm PID COMMAND 1000 sh 1001 sleep 1002 ps To kill a running process, use kill with the process ID (PID) indicated by ps: $ kill 1001 $ ps -opid,comm PID COMMAND 1000 sh...
Here is a basic class documentation example: /// Class description class Student { // Member description var name: String /// Method description /// /// - parameter content: parameter description /// /// - returns: return value description func say...
SAML specifies three key roles: The Identity Provider (IdP) The party which provides and maintains the identity of the users. This can be a directory service like ADFS or a custom database solution. The Service Provider (SP) The Service Provider is the actual service which the user tries...
When a new documentation tag is created, StackOverflow automatically generates an introductory topic, acting as a placeholder for the first actual topic. The introductory topic contains placeholder texts and pointers to point contributors in the right directions for helping expanding on the new doc...
Nginx configuration to detect request from mobile user-agent and redirect them to mobile site. location / { #mobile site handling as per user agent set $mobile_rewrite do_not_perform; // variable to store action. default set to not perform redirection to mobile site. if ($htt...
@at-root directive can be used to localize variables. $color: blue; @at-root { $color: red; .a { color: $color; } .b { color: $color; } } .c { color: $color; } is compiled to: .a { color: red; } .b { color: red; } .c { color: blue; }
Define the variables within a formula field: Shared NumberVar x := 1000; Shared NumberVar y; Assigning the values is optional. To display the variable in a second formula later on in the report, the call is nearly identical: Shared NumberVar x; x
Ucto is a rule-based tokeniser for multiple languages. It does sentence boundary detection as well. Although it is written in C++, there is a Python binding python-ucto to interface with it. import ucto #Set a file to use as tokeniser rules, this one is for English, other languages are availabl...
In many application it is necessary to compute the function of two or more arguments. Traditionally, we use for-loops. For example, if we need to calculate the f = exp(-x^2-y^2) (do not use this if you need fast simulations): % code1 x = -1.2:0.2:1.4; y = -2:0.25:3; for nx=1:lenght(x) for n...
Custom matchers can be added in jasmine using the syntax: jasmine.addMatchers([ toMatch: function () { return { compare: function (actual, expected) { return { pass: actual===expected, message: "Expected actual to match expected...
How to interact with the BIOS The Basic Input/Output System, or BIOS, is what controls the computer before any operating system runs. To access services provided by the BIOS, assembly code uses interrupts. An interrupt takes the form of int <interrupt> ; interrupt must be a literal number, n...
Protractor can selectively run groups of tests using fdescribe() instead of describe(). fdescribe('first group',()=>{ it('only this test will run',()=>{ //code that will run }); }); describe('second group',()=>{ it('this code will not run',()=>{ //code...
A TypeScript function can take in parameters of multiple, predefined types using union types. function whatTime(hour:number|string, minute:number|string):string{ return hour+':'+minute; } whatTime(1,30) //'1:30' whatTime('1',30) //'1:30' whatTime(1,'30') //'1:30' wha...
Custom matchers will have their pass value negated when using 'not'. Custom matchers can have a negative compare attribute to explicitly handle cases where their negation is desired: toMatch: function () { return { compare: function (actual, expected) { return...

Page 585 of 826