Tutorial by Examples: c

UIView *view = [[UIView alloc] init]; [self.view addSubview:view]; //Use the function if you want to use height as constraint [self addView:view onParentView:self.view withHeight:200.f]; //Use this function if you want to add view with respect to parent and should resize with it [self a...
Angular also provides some CSS classes for forms and inputs depending on their state ClassDescriptionng-touchedField has been touchedng-untouchedField has not been touchedng-pristineField has not been modifiedng-dirtyField has been modifiedng-validField is validng-invalidField is invalid You can u...
To help you find and count characters in a string, CharMatcher provides the following methods: int indexIn(CharSequence sequence) Returns the index of the first character that matches the CharMatcher instance. Returns -­1 if no character matches. int indexIn(CharSequence sequence, int sta...
var source = new AutoCompleteStringCollection(); // Add your collection of strings. source.AddRange(new[] { "Guybrush Threepwood", "LeChuck" }); var textBox = new TextBox { AutoCompleteCustomSource = source, AutoCompleteMode = AutoCompleteMode.SuggestAppend, ...
textBox.SelectionStart = textBox.TextLength; textBox.ScrollToCaret(); Applying the same principle, SelectionStart can be set to 0 to scroll to the top or to a specific number to go to a specific character.
// Initialize a stack object of integers var stack = new Stack<int>(); // add some data stack.Push(3); stack.Push(5); stack.Push(8); // elements are stored with "first in, last out" order. // stack from top to bottom is: 8, 5, 3 // We can use peek to see the top elemen...
You can configure the database settings in config/connections.js. Here's an example: postgresql: { database: 'databaseName', host: 'localhost', user: 'root', password: '', port: 5432, poolSize: 10, ssl: false }; Alternatively, you can supply the connection information in U...
Short circuiting is a functionality that skips evaluating parts of a (if/while/...) condition when able. In case of a logical operation on two operands, the first operand is evaluated (to true or false) and if there is a verdict (i.e first operand is false when using &&, first operand is tr...
After turning Lazy loading off you can lazily load entities by explicitly calling Load method for entries. Reference is used to load single navigation properties, whereas Collection is used to get collections. Company company = context.Companies.FirstOrDefault(); // Load founder context.Entry(com...
The most common way is to apply the extension via Config. Example: # File: mysite/_config/config.yml Member: extensions: - MyMemberExtension The extensions config variable is of type "array", so you can add multiple extensions like this: # File: mysite/_config/config.yml Mem...
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"....
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...
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...
In general when making a call to the command line, the program will send the command and then continue its execution. However you may want to wait for the called program to finish before continuing your own execution (ex. The called program will write data to a file and your program needs that to a...
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 ...

Page 396 of 826