use re.escape("lol") to escape strings use re.search(pattern, string) to search for a match use importlib.reload(module) to reload in python 3.4
This file contains 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 ( | |
"encoding/json" | |
"fmt" | |
"reflect" | |
) | |
type T1 struct { | |
Field1 string |
This file contains 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 "fmt" | |
import "time" | |
import "sort" | |
func main() { | |
fmt.Println("Sorting an array of time") | |
const shortForm = "Jan/02/2006" | |
t1, _ := time.Parse(shortForm, "Feb/02/2014") |
This file contains 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
//--------------------------------------------------------------------------- | |
// variables | |
//--------------------------------------------------------------------------- | |
var width = 512; // bl.ocks.org viewport width | |
var height = 512; // bl.ocks.org viewport height | |
var cellwidth = 32;//128; // cellWidth | |
var cellheight = 32;//128; // cellHeight | |
var mode = false // toggle mode on mousedown/mouseup |
This file contains 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
a > b | |
a = foo(c) | |
b = 2 | |
b = foo(b) | |
foo | |
bar | |
foobar | |
b = foo(v) |
This file contains 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
// computes a random number in the specified interval centered in zero. | |
func randInInterval(min int, max int) float64 { | |
r := rand.New(rand.NewSource(time.Now().UnixNano())) | |
size := float64(max - min) | |
return r.Float64()*size + float64(min) | |
} |
This file contains 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
sentiment | population | |
---|---|---|
positive | 50 | |
negative | 20 | |
neutral | 30 |
This file contains 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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<title>Bar Chart with Negative Values</title> | |
<style> | |
.bar.positive { | |
fill: #B9E397; | |
} | |
.bar.negative { |
This file contains 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" | |
"encoding/base64" | |
"flag" | |
"html/template" | |
"image" | |
"image/color" | |
"image/draw" |
This file contains 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
param([String]$server="yourservername", | |
[String]$sqlServerVersion="sql2014", | |
[String]$dbToDrift="yourdbtodrift", | |
[String]$tableToDrift="yourtabletodrift") | |
$previousLocation = Get-Location | |
Import-Module "sqlps" -DisableNameChecking | |
SQLSERVER: | |
$directory = "\sql\{0}\{1}\databases\{2}" -f $server, $sqlServerVersion, $dbToDrift |
OlderNewer