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) ...
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();
...
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()...
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...
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...