Swap out AccountSid, AuthToken, ToPhoneNumber and FromPhoneNumber for your credentials/intended recipients. You need to ensure that if the ToPhoneNumber and FromPhoneNumber have + in them, they are urlencoded (ie: as %2B)
notification sms {
post = https://{AccountSid}:{Authtoken}@api.twilio.co...
This example assumes Ruby is installed.
Place the following in a file named hello.rb:
puts 'Hello World'
From the command line, type the following command to execute the Ruby code from the source file:
$ ruby hello.rb
This should output:
Hello World
The output will be immediately di...
Serialization with Gson is easy and will output correct JSON.
public class Employe {
private String firstName;
private String lastName;
private int age;
private BigDecimal salary;
private List<String> skills;
//getters and setters
}
(Serialization)
...
SQL injection is a kind of attack that allows a malicious user to modify the SQL query, adding unwanted commands to it. For example, the following code is vulnerable:
// Do not use this vulnerable code!
$sql = 'SELECT name, email, user_level FROM users WHERE userID = ' . $_GET['user'];
$conn->...
// Create a block with an asynchronous action
var block = new ActionBlock<string>(async hostName =>
{
IPAddress[] ipAddresses = await Dns.GetHostAddressesAsync(hostName);
Console.WriteLine(ipAddresses[0]);
});
block.Post("google.com"); // Post items to the block's ...
There are two Dockerfile directives to specify what command to run by default in built images. If you only specify CMD then docker will run that command using the default ENTRYPOINT, which is /bin/sh -c. You can override either or both the entrypoint and/or the command when you start up the built im...
Requirements: 64-bit version of Windows 7 or higher on a machine which supports Hardware Virtualization Technology, and it is enabled.
While the docker binary can run natively on Windows, to build and host containers you need to run a Linux virtual machine on the box.
1.12.0
Since version 1.12 y...
The typical way to begin writing webservers in golang is to use the standard library net/http module.
There is also a tutorial for it here.
The following code also uses it. Here is the simplest possible HTTP server implementation. It responds "Hello World" to any HTTP request.
Save the...
A Table View is a list of rows that can be selected. Each row is populated from a data source. This example creates a simple table view in which each row is a single line of text.
Add a UITableView to your Storyboard
Although there are a number of ways to create a UITableView, one of the easiest...
Auto layout is used to arrange views so that they look good on any device and orientation. Constraints are the rules that tell how everything should be laid down. They include pinning edges, centering, and setting sizes, among other things.
Auto layout is enabled by default, but you can double chec...
CREATE TABLE Person (
PersonID INT UNSIGNED NOT NULL,
LastName VARCHAR(66) NOT NULL,
FirstName VARCHAR(66),
Address VARCHAR(255),
City VARCHAR(66),
PRIMARY KEY (PersonID)
);
A primary key is a NOT NULL single or a multi-column identifier whic...
CREATE TABLE Account (
AccountID INT UNSIGNED NOT NULL,
AccountNo INT UNSIGNED NOT NULL,
PersonID INT UNSIGNED,
PRIMARY KEY (AccountID),
FOREIGN KEY (PersonID) REFERENCES Person (PersonID)
) ENGINE=InnoDB;
Foreign key: A Foreign Key (FK) is either a single col...
Instantiate a XMLWriter object:
$xml = new XMLWriter();
Next open the file to which you want to write. For example, to write to /var/www/example.com/xml/output.xml, use:
$xml->openUri('file:///var/www/example.com/xml/output.xml');
To start the document (create the XML open tag):
$xml->...
To show all staged and unstaged changes, use:
git diff HEAD
NOTE: You can also use the following command:
git status -vv
The difference being that the output of the latter will actually tell you which changes are staged for commit and which are not.
apply is used to evaluate a function (maybe an anonymous one) over the margins of an array or matrix.
Let's use the iris dataset to illustrate this idea. The iris dataset has measurements of 150 flowers from 3 species. Let's see how this dataset is structured:
> head(iris)
Sepal.Length Sep...
A while loop executes the block while the given condition is met:
i = 0
while i < 5
puts "Iteration ##{i}"
i +=1
end
An until loop executes the block while the conditional is false:
i = 0
until i == 5
puts "Iteration ##{i}"
i +=1
end
Default behaviour is when the merge resolves as a fast-forward, only update the branch pointer, without creating a merge commit. Use --no-ff to resolve.
git merge <branch_name> --no-ff -m "<commit message>"
Code first allows you to create your entities (classes) without using a GUI designer or a .edmx file. It is named Code first, because you can create your models first and Entity framework will create database according to mappings for you automatically. Or you can also use this approach with existin...
Even just reading the value of a pointer that was freed (i.e. without trying to dereference the pointer) is undefined behavior(UB), e.g.
char *p = malloc(5);
free(p);
if (p == NULL) /* NOTE: even without dereferencing, this may have UB */
{
}
Quoting ISO/IEC 9899:2011, section 6.2.4 §2:
...