Tutorial by Examples: f

Generally execute() command is used for fire and forget calls (without need of analyzing the result) and submit() command is used for analyzing the result of Future object. We should be aware of key difference of Exception Handling mechanisms between these two commands. Exceptions from submit() ar...
Cross-site request forgery, also known as one-click attack or session riding and abbreviated as CSRF or XSRF, is a type of malicious exploit of a website where unauthorized commands are transmitted from a user that the website trusts. Learn more To enable CSRF protection, add the CsrfViewMid...
First, add the HTML File to your Project (If you are asked to choose options for adding the file, select Copy items if needed) The following line of code loads the content of the HTML file into the webView webView.loadRequest(NSURLRequest(URL: NSURL(fileURLWithPath: NSBundle.mainBundle().pathForRe...
Images and files can be uploaded/submitted to server by setting enctype attribute of form tag to multipart/form-data. enctype specifies how form data would be encoded while submitting to the server. Example <form method="post" enctype="multipart/form-data" action="uplo...
C99 Since C99 the C library has a set of safe conversion functions that interpret a string as a number. Their names are of the form strtoX, where X is one of l, ul, d, etc to determine the target type of the conversion double strtod(char const* p, char** endptr); long double strtold(char const* p...
Official documentation: http://erlang.org/doc/tutorial/nif.html NIFs were introduced in Erlang/OTP R13B03 as an experimental feature. The purpose is to allow calling C-code from inside Erlang code. NIFs are implemented in C instead of Erlang, but they appear as any other functions in the scope of ...
The Collections class provides a way to make a list unmodifiable: List<String> ls = new ArrayList<String>(); List<String> unmodifiableList = Collections.unmodifiableList(ls); If you want an unmodifiable list with one item you can use: List<String> unmodifiableList = Col...
Starting with Java 8, you can use lambda expressions & predicates. Example: Use a lambda expressions & a predicate to get a certain value from a list. In this example every person will be printed out with the fact if they are 18 and older or not. Person Class: public class Person { p...
A DataFrame can be created from a list of dictionaries. Keys are used as column names. import pandas as pd L = [{'Name': 'John', 'Last Name': 'Smith'}, {'Name': 'Mary', 'Last Name': 'Wood'}] pd.DataFrame(L) # Output: Last Name Name # 0 Smith John # 1 Wood Mary Missin...
You can use the filter operator to filter out items from the values stream based on a result of a predicate method. In other words, the items passing from the Observer to the Subscriber will be discarded based on the Function you pass filter, if the function returns false for a certain value, that ...
CREATE TYPE MyUniqueNamesType as TABLE ( FirstName varchar(10), LastName varchar(10), CreateDate datetime default GETDATE() PRIMARY KEY (FirstName,LastName) )
This example finds an array of approximately evenly spaced points along a cubic Bezier curve. It decomposes Path segments created with context.bezierCurveTo into points along that curve. // Return: an array of approximately evenly spaced points along a cubic Bezier curve // // Attribution: Stack...
This example finds an array of approximately evenly spaced points along a quadratic curve. It decomposes Path segments created with context.quadraticCurveTo into points along that curve. // Return: an array of approximately evenly spaced points along a Quadratic curve // // Attribution: Stackove...
This example finds an array of approximately evenly spaced points along a line. It decomposes Path segments created with context.lineTo into points along that line. // Return: an array of approximately evenly spaced points along a line // // pxTolerance: approximate spacing allowed between point...
This example finds an array of approximately evenly spaced points along an entire Path. It decomposes all Path segments created with context.lineTo, context.quadraticCurveTo and/or context.bezierCurveTo into points along that Path. Usage // Path related variables var A={x:50,y:100}; var B={x:12...
Formula in A1 ={"Item name","Quantity";"Apples",2;"Blueberries",5} Important: In certain countries the comma is used as a decimal separator (e.g: €1,00). If that's your case, you would need to use backslashes ( \ ) instead: (Docs) ={"Item name"\...
Modules are defined in a file named module-info.java, named a module descriptor. It should be placed in the source-code root: |-- module-info.java |-- com |-- example |-- foo |-- Foo.java |-- bar |-- Bar.java Here is a simple module descri...
For expressing the power of 2 (2^n) of integers, one may use a bitshift operation that allows to explicitly specify the n. The syntax is basically: int pow2 = 1<<n; Examples: int twoExp4 = 1<<4; //2^4 int twoExp5 = 1<<5; //2^5 int twoExp6 = 1<<6; //2^6 ... int twoEx...
The "right-left" rule is a completely regular rule for deciphering C declarations. It can also be useful in creating them. Read the symbols as you encounter them in the declaration... * as "pointer to" - always on the left side [] as "array of" ...
To check if an element with a specified key exits in a WeakMap, use the .has() method. It returns true if it exits, and otherwise false. const obj1 = {}, obj2 = {}; const weakmap = new WeakMap([[obj1, 7]]); console.log(weakmap.has(obj1)); // true console.log(weakmap.has(obj2)); // false...

Page 245 of 457