Tutorial by Examples: amp

A live example for this can be found here.
For Example: echo Hello! pause >nul :Name echo What Is Your Name set /p Input=Name: echo so %Input% Is Your Name, right? echo Rename? echo 1 For Yes echo 2 For No set /p Input=Rename: if %Input%=1 goto Name Another Example: @echo off echo 1 or 2? set /p input=Choice: if %input...
Going to its roots, Logstash has the ability to parse and store syslog data. This example shows a basic configuration that gets you to that. input { file { path => [ "/var/log/syslog", "/var/log/auth.log" ] type => "syslog" } }...
To avoid unsightly #DIV/0 errors in a spreadsheet, a custom function can be used. /** * Divides n by d unless d is zero, in which case, it returns * the given symbol. * * @param {n} number The numerator * @param {d} number The divisor * @param {symbol} string The symbol to display...
First you have to create a file constants.php and it is a good practice to create this file inside app/config/ folder. You can also add constants.php file in compose.json file. Example File: app/config/constants.php Array based constants inside the file: return [ 'CONSTANT' => 'This...
Abstract Class : package base; /* Abstract classes cannot be instantiated, but they can be subclassed */ public abstract class ClsVirusScanner { //With One Abstract method public abstract void fnStartScan(); protected void fnCheckForUpdateVersion(){ System....
Simple Hello World Application: using System; namespace HelloWorld { class Program { static void Main(string[] args) { Console.WriteLine("Hello World"); } } } Equivalent IL Code (which will be JIT compiled) // Microsoft (R) ...
var EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = function(defaults) { var app = new EmberApp(defaults, { // Add options here datatables: { core: true, style: 'bs', extensions: [ { name: 'buttons', extensions: ['colVi...
import sys from PyQt4.QtCore import * from PyQt4.QtGui import * def window(): app = QApplication(sys.argv) win = QDialog() b1 = QPushButton(win) b1.setText("Button1") b1.move(50,20) b1.clicked.connect(b1_clicked) b2 = QPushButton(win) b2.setText(&quot...
Let's say we have some server that registers new users and greets them with some message. And we want to monitor this server and change some of it's parameters. First, we need an interface with our monitoring and control methods public interface UserCounterMBean { long getSleepTime(); ...
<?xml version="1.0" encoding="UTF-8"?> <mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" ...
In your activity layout activity_main.xml specify WebView component as following: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" ...
The following is an example of using an user-defined function to be called multiple(∞) times in a script with ease. import turtle, time, random #tell python we need 3 different modules turtle.speed(0) #set draw speed to the fastest turtle.colormode(255) #special colormode turtle.pensize(4) #siz...
This example implements a linked list with many of the same methods as that of the built-in list object. class Node: def __init__(self, val): self.data = val self.next = None def getData(self): return self.data def getNext(self): return self.ne...
Following is the example of QLabel that displays use of texts,images and hyperlinks. import sys from PyQt4.QtCore import * from PyQt4.QtGui import * def window(): app = QApplication(sys.argv) win = QWidget() l1 = QLabel() l2 = QLabel() l3 = QLabel() l4 = QLabel()...
from bs4 import BeautifulSoup import requests main_url = "https://fr.wikipedia.org/wiki/Hello_world" req = requests.get(main_url) soup = BeautifulSoup(req.text, "html.parser") # Finding the main title tag. title = soup.find("h1", class_ = "firstHeading&qu...
An example project (Git repo) that can be used as a starting point for doing some 3D rendering. The code for setting up OpenGL and the shaders is quite long and tedious so it wont fit well under this example format. Later pieces of it can be shown in separate examples detailing what exactly is going...
You can see the running demo by clicking here. HTML: <p> <span>Counter State</span><br /> (<em>Will increase each minute</em>): <p> <span id="counter-state" style="font-weight: bolder"></span> </p> &l...
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="${http.port}" doc:name="HTTP Listener Configuration"/> <db:mysql-config name="MySQL_Configuration" host="${db.host}" port="${db.port}"...
The example assumes you have successfully run and fully understand the tutorial of MNIST(Deep MNIST for expert). %matplotlib inline import matplotlib.pyplot as plt # con_val is a 4-d array, the first indicates the index of image, the last indicates the index of kernel def display(con_val, kern...

Page 36 of 46