Tutorial by Examples: er

Random UUID Swift func randomUUID() -> NSString{ return NSUUID.UUID().UUIDString() } Objective-C + (NSString *)randomUUID { if(NSClassFromString(@"NSUUID")) { // only available in iOS >= 6.0 return [[NSUUID UUID] UUIDString]; } CFUUIDRef uuidRef = ...
server { server_name example.com; return 301 $scheme://example.net$request_uri; }
Locally created images can be pushed to Docker Hub or any other docker repo host, known as a registry. Use docker login to sign in to an existing docker hub account. docker login Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https...
To get the IP address of a docker machine, you can do that with this command : docker-machine ip machine-name
If you have the version tag v2.3 you can display all commits since that tag. gitk v2.3..
Java provides a conditional-and and a conditional-or operator, that both take one or two operands of type boolean and produce a boolean result. These are: && - the conditional-AND operator, || - the conditional-OR operators. The evaluation of <left-expr> && <righ...
Take a close look at these two property files which are seemingly completely identical: except they are really not identical: (screenshots are from Notepad++) Since trailing whitespace is preserved the value of lastName would be "Smith" in the first case and "Smith " in th...
Consider the Node class having 3 members data, left child pointer and right child pointer like below. public class Node { public int data; public Node left; public Node right; public Node(int data){ this.data = data; } } We can traverse the tree construct...
You will need to set your base URL in application/config/config.php If it is not set, then CodeIgniter will try to guess the protocol and path to your installation, but due to the security concerns the hostname will be set to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise. The auto...
CAShapeLayer *circle = [CAShapeLayer layer]; [circle setPath:[[UIBezierPath bezierPathWithOvalInRect:CGRectMake(100, 100, 150, 150)] CGPath]]; [circle setStrokeColor:[[UIColor blueColor] CGColor]]; [circle setFillColor:[[UIColor clearColor] CGColor]]; [[self.view layer] addSublayer:circl...
Channel uses a Buffer to read/write data. A buffer is a fixed sized container where we can write a block of data at once. Channel is a quite faster than stream-based I/O. To read data from a file using Channel we need to have the following steps- We need an instance of FileInputStream. FileInput...
This variable will give you a total number of fields in the current input record. awk -F',' '{print NF}' file.csv Example: $ cat file.csv col1,col2,col3,col4 col1,col2,col3 col1,col2 col1 col1,col2,col3,col4,col5 $ awk -F',' '{print NF}' file.csv 4 3 2 1 5
mpicc -o my_prog my_prog.c
You can do things like this: [[ $s = 'something' ]] && echo 'matched' || echo "didn't match" [[ $s == 'something' ]] && echo 'matched' || echo "didn't match" [[ $s != 'something' ]] && echo "didn't match" || echo "matched" [[ $s -eq...
Will provide the total number of records processed in the current awk instance. cat > file1 suicidesquad harley quinn joker deadshot cat > file2 avengers ironman captainamerica hulk awk '{print NR}' file1 file2 1 2 3 4 5 6 7 8 A total on 8 records were processed in th...
Provides the total number of records processed by the awk instance relative to the files awk is processing cat > file1 suicidesquad harley quinn joker deadshot cat > file2 avengers ironman captainamerica hulk awk '{print FNR}' file1 file2 1 2 3 4 1 2 3 4 Each file had...
Provides the number of columns or fields in each record (record corresponds to each line). Each line is demarcated by RS which defaults to newline. cat > file1 Harley Quinn Loves Joker Batman Loves Wonder Woman Superman is not dead Why is everything I type four fielded!? awk '{print NF}' ...
Press controlr and type a pattern. For example, if you recently executed man 5 crontab, you can find it quickly by starting to type "crontab". The prompt will change like this: (reverse-i-search)`cr': man 5 crontab The `cr' there is the string I typed so far. This is an incremental s...
If you need to add custom headers to your volley requests, you can't do this after initialisation, as the headers are saved in a private variable. Instead, you need to override the getHeaders() method of Request.class as such: new JsonObjectRequest(REQUEST_METHOD, REQUEST_URL, REQUEST_BODY, RESP_L...
Most of the built-in operators (including conversion operators) can be overloaded by using the operator keyword along with the public and static modifiers. The operators comes in three forms: unary operators, binary operators and conversion operators. Unary and binary operators requires at least o...

Page 154 of 417