Tutorial by Examples: el

WScript.Echo "Hello world!" This displays a message on the console if run with cscript.exe (the console host) or in a message box if run with wscript.exe (the GUI host). If you're using VBScript as the server-side scripting language for a web page (for classic ASP, for example), Respo...
When creating a subscription for a user, you first need to create and activate a billing plan that a user is then subscribed to using a billing agreement. The full process for creating a subscription is detailed in the remarks of this topic. Within this example, we're going to be using the PayPal N...
object HelloWorld extends App { println("Hello, world!") } Live demo By extending the App trait, you can avoid defining an explicit main method. The entire body of the HelloWorld object is treated as "the main method". 2.11.0 Delayed Initialization Per the official d...
Print element at index 0 echo "${array[0]}" 4.3 Print last element using substring expansion syntax echo "${arr[@]: -1 }" 4.3 Print last element using subscript syntax echo "${array[-1]}" Print all elements, each quoted separately echo "${array[@...
class MultiIndexingList: def __init__(self, value): self.value = value def __repr__(self): return repr(self.value) def __getitem__(self, item): if isinstance(item, (int, slice)): return self.__class__(self.value[item]) r...
Import the ElementTree object, open the relevant .xml file and get the root tag: import xml.etree.ElementTree as ET tree = ET.parse("yourXMLfile.xml") root = tree.getroot() There are a few ways to search through the tree. First is by iteration: for child in root: print(child.ta...
println("Hello, World!") To run Julia, first get the interpreter from the website’s download page. The current stable release is v0.5.0, and this version is recommended for most users. Certain package developers or power users may choose to use the nightly build, which is far less stabl...
Let's say you've got a list of restaurants -- maybe you read it from a file. You care about the unique restaurants in the list. The best way to get the unique elements from a list is to turn it into a set: restaurants = ["McDonald's", "Burger King", "McDonald's", &qu...
$ git branch -d dev Deletes the branch named dev if its changes are merged with another branch and will not be lost. If the dev branch does contain changes that have not yet been merged that would be lost, git branch -d will fail: $ git branch -d dev error: The branch 'dev' is not fully merged...
To remove an element inside an array, e.g. the element with the index 1. $fruit = array("bananas", "apples", "peaches"); unset($fruit[1]); This will remove the apples from the list, but notice that unset does not change the indexes of the remaining elements. So $fr...
One of the most common tasks is retrieving an existing element from the DOM to manipulate. Most commonly these methods are executed on document, because it is the root node, but all these methods work on any HTML element in the tree. They will only return children from the node it is executed on. R...
An element can be cloned by invoking the cloneNode method on it. If the first parameter passed to cloneNode is true, the children of the original will also be cloned. var original = document.getElementsByTagName("li")[0]; var clone = original.cloneNode(true);
Appending an element at the end of a vector (by copying/moving): struct Point { double x, y; Point(double x, double y) : x(x), y(y) {} }; std::vector<Point> v; Point p(10.0, 2.0); v.push_back(p); // p is copied into the vector. C++11 Appending an element at the end of a vector ...
There are two primary ways of accessing elements in a std::vector index-based access iterators Index-based access: This can be done either with the subscript operator [], or the member function at(). Both return a reference to the element at the respective position in the std::vector (unles...
The jQuery function (usually aliased as $) can be used both to select elements and to create new elements. var myLink = $('<a href="http://stackexchange.com"></a>'); You can optionally pass a second argument with element attributes: var myLink = $('<a>', { 'href': 'h...
Assuming the page includes an HTML element like: <p class="small-paragraph"> This is a small <a href="https://en.wikipedia.org/wiki/Paragraph">paragraph</a> with a <a class="trusted" href="http://stackexchange.com">link</a>...
String html = "<!DOCTYPE html>" + "<html>" + "<head>" + "<title>Hello world!</title>" + "</head>" + "<body>" + ...
The underlying title label, if one exists, can be fetched using Swift var label: UILabel? = button.titleLabel Objective C UILabel *label = button.titleLabel; This can be used to set the font of the title label, for example Swift button.titleLabel?.font = UIFont.boldSystemFontOfSize(12) ...
To mark text as inserted, use the <ins> tag: <ins>New Text</ins> To mark text as deleted, use the <del> tag: <del>Deleted Text</del> To strike through text, use the <s> tag: <s>Struck-through text here</s>
What follows is an excerpt from a REPL session with Common Lisp in which a "Hello, World!" function is defined and executed. See the remarks at the bottom of this page for a more thorough description of a REPL. CL-USER> (defun hello () (format t "Hello, World!~%")...

Page 6 of 145