Tutorial by Examples: f

Use the rel="alternate" attribute to allow discoverability of your Atom/RSS feeds. <link rel="alternate" type="application/atom+xml" href="http://example.com/feed.xml" /> <link rel="alternate" type="application/rss+xml" href=&quo...
Software needed: Arduino IDE Setup Most Arduino-compatible boards have a USB port and come with a USB cable. Plug in the Arduino using the USB cable, and start up the Arduino IDE. Arduino IDE will start with a new sketch, typically with an emtpy setup() and loop() functions. This is enough to u...
A simple if statement: if a == b { // do something } Note that there are no parentheses surrounding the condition and that the opening curly brace { must be on the same line. The following will not compile: if a == b { // do something } An if statement making use of else: if...
You can add wildcards in string resources and populate them at runtime: Edit strings.xml <string name="my_string">This is %1$s</string> Format string as needed String fun = "fun"; context.getString(R.string.my_string, fun);
For full description of patterns, see SimpleDateFormat reference Date now = new Date(); long timestamp = now.getTime(); SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy", Locale.US); String dateStr = sdf.format(timestamp);
Floating point numbers of type real cannot have any real value. They can represent real numbers up to certain amount of decimal digits. FORTRAN 77 guaranteed two floating point types and more recent standards guarantee at least two real types. Real variables may be declared as real x double prec...
This example shows how to create a simple notification that starts an application when the user clicks it. Specify the notification's content: NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.ic_launcher) // notification icon .se...
iex(1)> a = 10 10 iex(2)> b = 20 20 iex(3)> a + b 30 You can get a specific row passing the index of the row: iex(4)> v(3) 30 You can also specify an index relative to the current row: iex(5)> v(-1) # Retrieves value of row (5-1) -> 4 30 iex(6)> v(-5) # Retrieves...
All these are shell commands. docker-machine env to get the current default docker-machine configuration eval $(docker-machine env) to get the current docker-machine configuration and set the current shell environment up to use this docker-machine with . If your shell is set up to use a proxy, yo...
The following (trivial) example function simply returns the constant INT value 12. DELIMITER || CREATE FUNCTION functionname() RETURNS INT BEGIN RETURN 12; END; || DELIMITER ; The first line defines what the delimiter character(DELIMITER ||) is to be changed to, this is needed to be s...
Assumptions: An Oracle JDK has been installed. The JDK was installed to the default directory. Setup steps Open Windows Explorer. In the navigation pane on the left right click on This PC (or Computer for older Windows versions). There is a shorter way without using the explorer in...
Selenium Grid Node configuration resides on the Node itself and holds the information about network configuration and Node capabilities. The configuration can be applied in various ways: Default Configuration JSON Configuration Command line Configuration JSON Configuration The node configur...
There are several R packages to read excel files, each of which using different languages or resources, as summarized in the following table: R packageUsesxlsxJavaXLconnectJavaopenxlsxC++readxlC++RODBCODBCgdataPerl For the packages that use Java or ODBC it is important to know details about your s...
if let Combines a pattern match and an if statement, and allows for brief non-exhaustive matches to be performed. if let Some(x) = option { do_something(x); } This is equivalent to: match option { Some(x) => do_something(x), _ => {}, } These blocks can also have e...
The following types are defined as integral types: char Signed integer types Unsigned integer types char16_t and char32_t bool wchar_t With the exception of sizeof(char) / sizeof(signed char) / sizeof(unsigned char), which is split between § 3.9.1.1 [basic.fundamental/1] and § 5.3.3.1 [ex...
Background threads cannot modify the UI; almost all UIKit methods must be called on the main thread. From a subclass of NSObject (including any UIViewController or UIView): InvokeOnMainThread(() => { // Call UI methods here }); From a standard C# class: UIApplication.SharedApplicat...
# example data test_sentences <- c("The quick brown fox", "jumps over the lazy dog") Is there a match? grepl() is used to check whether a word or regular expression exists in a string or character vector. The function returns a TRUE/FALSE (or "Boolean") vecto...
Simple LOOP form without special keywords: (loop forms...) To break out of the loop we can use (return <return value>) ` Some examples: (loop (format t "Hello~%")) ; prints "Hello" forever (loop (print (eval (read)))) ; your very own REPL (loop (let ((r (read))) ...
Combining typedef with struct can make code clearer. For example: typedef struct { int x, y; } Point; as opposed to: struct Point { int x, y; }; could be declared as: Point point; instead of: struct Point point; Even better is to use the following typedef struct Poin...
The emptiness of a list is associated to the boolean False, so you don't have to check len(lst) == 0, but just lst or not lst lst = [] if not lst: print("list is empty") # Output: list is empty

Page 54 of 457