Subroutines are created by using the keyword sub followed by an identifier and a code block enclosed in braces.
You can access the arguments by using the special variable @_, which contains all arguments as an array.
sub function_name {
my ($arg1, $arg2, @more_args) = @_;
# ...
}
Sin...
Basic table usage includes accessing and assigning table elements, adding table content, and removing table content. These examples assume you know how to create tables.
Accessing Elements
Given the following table,
local example_table = {"Nausea", "Heartburn", "Indigesti...
You can pass data to a template in a custom variable.
In your views.py:
from django.views.generic import TemplateView
from MyProject.myapp.models import Item
class ItemView(TemplateView):
template_name = "item.html"
def items(self):
""" Get all Ite...
CMake generates build environments for nearly any compiler or IDE from a single project definition. The following examples will demonstrate how to add a CMake file to the cross-platform "Hello World" C++ code.
CMake files are always named "CMakeLists.txt" and should already exis...
Creating ***bold italic*** text is simply a matter of using both
**bold** (two asterisks) and *italic* (one asterisk) at the same time,
for a total of three asterisks on either side of the text you want to format at once.
Creating bold italic text is simply a matter of using both
bold (two a...
Once you have a Dockerfile, you can build an image from it using docker build.
The basic form of this command is:
docker build -t image-name path
If your Dockerfile isn't named Dockerfile, you can use the -f flag to give the name of the Dockerfile to build.
docker build -t image-name -f Dockerfi...
You can embed another template body into your template via {{template "mysharedtemplate" .}} to reuse shared components. Here is an example that creates a header template that can be reused at the top of all other template bodies. It also uses CSS to stylize the output so that it is easier...
Using .Graph will filter the results to only include those that match the tagset for the alert. For instance an alert for os.low.memory{host=ny-web01} would only include series with the host=ny-web01 tags. If multiple series match then only the first matching result will be used.
template graph.tem...
Using .GraphAll will include all the results in the graph.
template graph.template {
subject = ...
body = `{{template "header" .}}
<strong>GraphAll</strong>
<div>{{.GraphAll .Alert.Vars.graph}}</div>
<strong>GraphAll With Y Axis...
If you want to graph two series on one graph, you can use the Merge function. This can also be combined with the Series function to manipulate the Y axis (like forcing it to start at zero).
template graph.template {
subject = ...
body = `{{template "header" .}}
<stro...
This uses the Dropbox Java SDK to create a shared link for a file at the Dropbox path /test.txt:
try {
SharedLinkMetadata sharedLinkMetadata = client.sharing().createSharedLinkWithSettings("/test.txt");
System.out.println(sharedLinkMetadata.getUrl());
} catch (CreateSharedLinkW...
This example uses the Dropbox .NET library to get a shared link for a file, either by creating a new one, or retrieving an existing one:
SharedLinkMetadata sharedLinkMetadata;
try {
sharedLinkMetadata = await this.client.Sharing.CreateSharedLinkWithSettingsAsync (path);
} catch (ApiException...
This returns information about a specific classifier ID you have trained. This includes information about its current status (i.e., if it is ready or not).
'use strict';
let watson = require('watson-developer-cloud');
var visualRecognition = watson.visual_recognition({
version: 'v3',
ap...
The following examples use the Item Sales and Customers sample databases.
Note: The BETWEEN operator is inclusive.
Using the BETWEEN operator with Numbers:
SELECT * From ItemSales
WHERE Quantity BETWEEN 10 AND 17
This query will return all ItemSales records that have a quantity that is gr...
The examples below fill in a PhoneNumber for any Employee who is also a Customer and currently does not have a phone number set in the Employees Table.
(These examples use the Employees and Customers tables from the Example Databases.)
Standard SQL
Update using a correlated subquery:
UPDATE
...