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
| #!/bin/bash | |
| # usage: emptyspark.sh blah | |
| # Result: project is created at /Users/timvw/src/blah | |
| # Inspired by: https://gist.github.com/alvinj/3194379 | |
| project=$1 | |
| basedir="/Users/timvw/src" | |
| targetdir="$basedir/$1" | |
| scalaversion="2.11.6" | |
| sparkversion="1.4.0" |
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
| open System | |
| open System.IO | |
| open System.Text.RegularExpressions | |
| let getAssemblyVersionFiles path = | |
| Directory.GetFiles(path, "AssemblyVersions.cs", SearchOption.AllDirectories) | |
| let assemblyVersionPattern = "AssemblyVersion\(\"(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+).(?<build>\d+)\"\)" | |
| let assemblyFileVersionPattern = "AssemblyFileVersion\(\"(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+).(?<build>\d+)\"\)" |
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
| #!/bin/bash | |
| function gitfetch { | |
| cd $1 | |
| git fetch | |
| } | |
| for repo in $(find /c/src -type d -maxdepth 1 -name icteam-\*); do gitfetch $repo; done | |
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
| function [accuracy, precision, recall, f1] = classify(X) | |
| % X is a matrix with the following data: | |
| % X(1,1) we predict that it is true, it is true - true positive | |
| % X(1,2) we predict that it is true, it is false - false positive | |
| % X(2,1) we predict that it is false, it is true - false negative | |
| % X(2,2) we predict that it is false, it is false - true negative | |
| accuracy = ( X(1,1) + X(2,2) ) / sum(sum(X)) | |
| precision = X(1,1) / ( X(1,1) + X(1,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
| # define parameters | |
| $baseDir = "c:\temp" #"%system.agent.work.dir%" | |
| $username = "ICTEAM\TIMVW" | |
| $password = "Password" | |
| $teamcityUrl = "http://teamcity.icteam.be" | |
| $branchName = "feature/MS-001" #$branchName = "<default>" | |
| $buildTypeIds = @( | |
| "MS_Nightly_Module1", | |
| "MS_Nightly_Module2", |
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
| ([xml](Get-Content 'packages.config')).packages.package |% { install-package $_.id -version $_.version } |
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
| mbpro:~ timvw$ which keepass | |
| mbpro:~ timvw$ keepass | |
| [1] 12681 | |
| mbpro:~ timvw$ which keepass | |
| [1]+ Exit 1 mono ~/src/keepass/Build/KeePass/Debug/KeePass.exe > /dev/null 2>&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
| FROM windowsservercore | |
| LABEL Description="chocolatey on windows" Vendor="icteam" Version="0.1.0" | |
| RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://ch | |
| ocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin |
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
| def using[T <: { def close(): Unit }, S](obj: T) | |
| (operation: T => S) = { | |
| val result = operation(obj) | |
| obj.close() | |
| result | |
| } |
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
| object Demo { | |
| def map[A, B](xs: List[A], f: A => B): List[B] = | |
| for (x <- xs) yield f(x) | |
| def flatMap[A, B](xs: List[A], f: A => List[B]): List[B] = | |
| for (x <- xs; y <- f(x)) yield y | |
| def filter[A](xs: List[A], p: A => Boolean): List[A] = | |
| for (x <- xs if p(x)) yield x | |
| } |