Tutorial by Examples: sin

module.exports.routes = { 'GET /foo/*': { fn: function(req, res) { res.send("FOO!"); }, skipAssets: true }, };
Consider using Extension Methods as Functions which wrap other code, here's a great example that uses both a static method and and extension method to wrap the Try Catch construct. Make your code Bullet Proof... using System; using System.Diagnostics; namespace Samples { /// <summary&g...
Consider the following struct definitions: struct Foo { my_bool: bool, my_num: isize, my_string: String, } struct Bar (bool, isize, String); struct Baz; Constructing new structure values for these types is straightforward: let foo = Foo { my_bool: true, my_num: 42, my_string: ...
Example showing how to create Guis using functions instead of labels. Gui, Add, Button, gCtrlEvent vButton1, Button 1 Gui, Add, Button, gCtrlEvent vButton2, Button 2 Gui, Add, Button, gGoButton, Go Button Gui, Add, Edit, vEditField, Example text Gui, Show,, Functions instead of labels CtrlEv...
For an instance, if the html source code of an html view or element is wrapped by an iframe like this: <iframe src="../images/eightball.gif" name="imgboxName" id="imgboxId"> <p>iframes example</p> <a href="../images/redball.gif" t...
To switch focus to either main document or first frame of the page. You have to use below syntax. driver.switchTo().defaultContent();
This time we are going to declare a class decorator that will add some metadata to a class when we applied to it: function addMetadata(target: any) { // Add some metadata target.__customMetadata = { someKey: "someValue" }; // Return target ret...
We can wrap a class decorator with another function to allow customization: function addMetadata(metadata: any) { return function log(target: any) { // Add metadata target.__customMetadata = metadata; // Return target return target; ...
PhpStorm can be very slow in large files as its performing so many inspections. One quick and easy way to speed up PhpStorm is to render using OpenGL. Previously in a 5000 line file it would give the 'eye' symbol in the top right for a long time before changing to a tick (or red/yellow box). After O...
The Leaflet package is designed to integerate with Shiny In the ui you call leafletOutput() and in the server you call renderLeaflet() library(shiny) library(leaflet) ui <- fluidPage( leafletOutput("my_leaf") ) server <- function(input, output, session){ out...
In the root of your project, make sure Bower is installed (npm install -g bower) and run bower init. This will create a bower.json file in your project's directory. Create a new file called .bowerrc to your root directory. It should contain the following: { "directory": "public/b...
gunzip -c dbname.sql.gz | mysql dbname -u username -p Note: -c means write output to stdout.
git log --pretty=oneline |wc -l
Using the same example as Evaluating a NodeList in an XML document, here is how you would make multiple XPath calls efficiently: Given the following XML document: <documentation> <tags> <tag name="Java"> <topic name="Regular expression...
In this case, you want to have the expression compiled before the evaluations, so that each call to evaluate does not compile the same expression. The simple syntax would be: XPath xPath = XPathFactory.newInstance().newXPath(); //Make new XPath XPathExpression exp = xPath.compile("/documentat...
Suppose you have a collection elements, and you want to create another collection containing the same elements but with all duplicates eliminated: Collection<Type> noDuplicates = new HashSet<Type>(elements); Example: List<String> names = new ArrayList<>( Arrays....
When executing a Bash script, parameters passed into the script are named in accordance to their position: $1 is the name of the first parameter, $2 is the name of the second parameter, and so on. A missing parameter simply evaluates to an empty string. Checking for the existence of a parameter can...
# app.rb require 'sinatra' get '/' do 'Hello, Universe!' end Install Sinatra: gem install sinatra Run the app: ruby app.rb That's it! Access your app at http://localhost:4567
page.html - source code <html> <head> <script src="loadData.js"></script> </head> <body onLoad="loadData()"> <div class="container"> <table id="data" border="1"> <...
VB.NET offers default Form instances. The developer does not need to create the instance as it is created behind the scenes. However, it is not preferable to use the default instance all but the simplest programs. Public Class Form1 Public Sub Foo() MessageBox.Show("Bar") ...

Page 75 of 161