Tutorial by Examples: c

This code uses the top level Application object to minimize the main Excel window. Sub MinimizeExcel() Application.WindowState = xlMinimized End Sub
You can view help for a specific parameter using: Get-Help Get-Content -Parameter Path
Cassandra will not require users to login using the default configuration. Instead password-less, anonymous logins are permitted for anyone able to connect to the native_transport_port. This behaviour can be changed by editing the cassandra.yaml config to use a different authenticator: # Allow anon...
By default each user will be able to access all data in Cassandra. You'll have to configuring a different authorizer in your cassandra.yaml to grant individual object permissions to your users. # Grant all permissions to all users # authorizer: AllowAllAuthorizer # Use object permissions manage...
Capabilities of the Canvas Canvas lets you programmatically draw onto your webpage: Images, Texts, Lines and Curves. Canvas drawings can be extensively styled: stroke width, stroke color, shape fill color, opacity, shadowing, linear gradients and radial gradients, font face, font ...
Recycling can be used in a clever way to simplify code. Subsetting If we want to keep every third element of a vector we can do the following: my_vec <- c(1,2,3,4,5,6,7,8,9,10) my_vec[c(TRUE, FALSE)] [1] 1 3 5 7 9 Here the logical expression was expanded to the length of the vector. ...
Private Sub Get_Last_Used_Row_Index() Dim wS As Worksheet Set wS = ThisWorkbook.Sheets("Sheet1") Debug.Print LastCol_1(wS) Debug.Print LastCol_0(wS) End Sub You can choose between 2 options, regarding if you want to know if there is no data in the worksheet :...
The simplest way to refer to a single cell on the current Excel worksheet is simply to enclose the A1 form of its reference in square brackets: [a3] = "Hello!" Note that square brackets are just convenient syntactic sugar for the Evaluate method of the Application object, so technicall...
To save a reference to a cell in a variable, you must use the Set syntax, for example: Dim R as Range Set R = ActiveSheet.Cells(3, 1) later... R.Font.Color = RGB(255, 0, 0) Why is the Set keyword required? Set tells Visual Basic that the value on the right hand side of the = is meant to be ...
os.path.abspath(os.path.join(PATH_TO_GET_THE_PARENT, os.pardir))
context.globalAlpha=0.50 You can change the opacity of new drawings by setting the globalAlpha to a value between 0.00 (fully transparent) and 1.00 (fully opaque). The default globalAlpha is 1.00 (fully opaque). Existing drawings are not affected by globalAlpha. // draw an opaque rectangle co...
appendToFile: Append single src, or multiple srcs from local file system to the destination file system. Also reads input from stdin and appends to destination file system. Keep the as - hdfs dfs -appendToFile [localfile1 localfile2 ..] [/HDFS/FILE/PATH..] cat: Copies source paths to stdout. ...
The command pattern encapsulates parameters to a method, current object state, and which method to call. It is useful to compartmentalize everything needed to call a method at a later time. It can be used to issue a "command" and decide later which piece of code to use to execute the comma...
The pattern (p1, p2) is strict in the outermost tuple constructor, which can lead to unexpected strictness behaviour. For example, the following expression diverges (using Data.Function.fix): fix $ \(x, y) -> (1, 2) since the match on (x, y) is strict in the tuple constructor. However, the fo...
It is the basic usage of the TextInputLayout. Make sure to add the dependency in the build.gradle file as described in the remarks section. Example: <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wra...
The TextInputLayout has a character counter for an EditText defined within it. The counter will be rendered below the EditText. Just use the setCounterEnabled() and setCounterMaxLength methods: TextInputLayout til = (TextInputLayout) findViewById(R.id.username); til.setCounterEnabled(true); til...
int i; int n = 1000000; double area = 0; double h = 1.0 / n; #pragma omp parallel shared(n, h) { double thread_area = 0; // Private / local variable #pragma omp for for (i = 1; i <= n; i++) { double x = h * (i - 0.5); thread_area += (4.0 / (1.0 ...
double area; double h = 1.0 / n; #pragma omp parallel for shared(n, h, area) for (i = 1; i <= n; i++) { double x = h * (i - 0.5); #pragma atomic area += (4.0 / (1.0 + x*x)); } pi = h * area; In this example, each threads execute a subset of the iteration count and they accumula...
double area; double h = 1.0 / n; #pragma omp parallel for shared(n, h, area) for (i = 1; i <= n; i++) { double x = h * (i - 0.5); #pragma omp critical { area += (4.0 / (1.0 + x*x)); } } double pi = h * area; In this example, each threads execute a subset of the iteratio...
int i; int n = 1000000; double area = 0; double h = 1.0 / n; #pragma omp parallel for shared(n, h) reduction(+:area) for (i = 1; i <= n; i++) { double x = h * (i - 0.5); area += (4.0 / (1.0 + x*x)); } pi = h * area; In this example, each threads execute a subset of the iteration...

Page 487 of 826