This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
$Id: markers.html,v 1.4 2013/10/28 08:44:55 gaudenz Exp $ | |
Copyright (c) 2006-2014, JGraph Ltd | |
Demonstrates creating a custom edge in mxGraph | |
--> | |
<html> | |
<head> | |
<title>Custom edge example for mxGraph</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
write-host "check administator rights" | |
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
write-Warning "This setup needs admin permissions. Please run this file as admin." | |
exit | |
} | |
write-host "check os and powershell" | |
if (-NOT ([Environment]::Is64BitProcess)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Return the "pivot index" of the given array of numbers. The pivot index is | |
// the index where the sum of the numbers on the left is equal to the sum of | |
// the numbers on the right. | |
function pivot(numbers) { | |
validateInput(numbers); | |
// Find a pivot index by testing each index | |
for (var i = 0; i < numbers.length; i++) { | |
var leftSum = sum(numbers.slice(0, i)); | |
var rightSum = sum(numbers.slice(i + 1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"net/url" | |
"runtime" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### CONFIGURATION | |
### require administator rights | |
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { | |
write-Warning "This setup needs admin permissions. Please run this file as admin." | |
break | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To run this file you will need to open Powershell as administrator and first run: | |
# Set-ExecutionPolicy Unrestricted | |
# Then source this script by running: | |
# . .\install_python.ps1 | |
$save_dir=Resolve-Path ~/Downloads | |
$project_dir = "C:\Projects" | |
$virtualenv_dir = $project_dir + "\virtualenvs" | |
$client = New-Object System.Net.WebClient |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
write-host "`n ## NODEJS INSTALLER ## `n" | |
### CONFIGURATION | |
# nodejs | |
$version = "4.4.7-x64" | |
$url = "https://nodejs.org/dist/latest-v4.x/node-v$version.msi" | |
# git | |
$git_version = "2.9.2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create the datadog user with select only permissions: | |
# CREATE USER datadog WITH PASSWORD '<complex_password>'; | |
# | |
# Grant select permissions on a table or view that you want to monitor: | |
# GRANT SELECT ON <schema>.<table> TO datadog; | |
# | |
# Grant permissions for a specific column on a table or view that you want to monitor: | |
# GRANT SELECT (id, name) ON <schema>.<table> TO datadog; | |
# | |
# Let non-superusers look at pg_stat_activity in a read-only fashon. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main(){ | |
var n int = 10 | |
var chs = make([]chan int, n) | |
var worker = func(n int, c chan int){ | |
for i:=0;i<n;i++{ | |
c<-i | |
} | |
close(c) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Package main serves as an example application that makes use of the observer pattern. | |
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
type ( | |
// Event defines an indication of a point-in-time occurrence. |