- Open the editor and go to menu
Tools->Build System
- This will open a new file named
untitled.sublime-build
- Add the path to your Groovy installation directory as show below.
{ "cmd": ["C:/Users/kulkan02/.gvm/groovy/2.3.0/bin/groovy.bat", "$file"] }
start | |
= any | |
any | |
= multiplicative | |
/ divisive | |
/ power | |
/ additive | |
/ subtractive | |
/ primary |
// Node.js CheatSheet. | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html |
/* | |
* Simple Arithmetics Grammar | |
* ========================== | |
* | |
* Accepts expressions like "2 * (3 + 4)" and computes their value. | |
*/ | |
{ | |
function combine(first, rest, combiners) { | |
var result = first, i; |
def inputFile = new File("org_chart.in") | |
def outputFile = new File("org_chart_.out") | |
outputFile.delete() | |
int lineCount = 0 | |
def orgCharts = [] | |
inputFile.eachLine { line -> | |
def orgChart = [:] | |
def employees = [:] |
def product(func: Int => Int)(a: Int, b: Int): Int = { | |
if (a > b) | |
1 | |
else | |
func(a) * product(func)(a + 1, b) | |
} | |
product((x) => (x + x))(1, 3) | |
def fact(a: Int): Int = { |
// sqrt(x) = y = x / y | |
// sqrt(x) -> fixed point of function (y => x/y) | |
// with damping => sqrt(x) = ( y = (((y + x) / y) / 2) (1.0) | |
// def sqrt(x : Double) = fixedPoint(y => ((y + x) / 2)) (1.0) | |
import math.abs | |
val tolerance = 0.0001 | |
def isCloseEnough(a: Double, b: Double): Boolean = { | |
abs((a - b) / a) / a < tolerance |
class Rational(x: Int, y: Int) { | |
require(y != 0, "denominator must be non zero") | |
def this(x: Int) = this(x, 1) | |
private def gcd(a: Int, b: Int): Int = if (b == 0) a else gcd(b, a % b) | |
private val g = gcd(x, y) |
# Usage: powershell ExportSchema.ps1 "SERVERNAME" "DATABASE" "C:\<YourOutputPath>" | |
# Start Script | |
Set-ExecutionPolicy RemoteSigned | |
# Set-ExecutionPolicy -ExecutionPolicy:Unrestricted -Scope:LocalMachine | |
function GenerateDBScript([string]$serverName, [string]$dbname, [string]$scriptpath) | |
{ | |
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers