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
(ns week1.core | |
(:gen-class)) | |
(defn -main | |
"I don't do a whole lot ... yet." | |
[& args] | |
(println "Hello, World!")) | |
(defn sum-x | |
"desc" |
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
<PropertyGroup> | |
<_EnableCleanOnBuildForMvcViews Condition=" '$(_EnableCleanOnBuildForMvcViews)'=='' ">true</_EnableCleanOnBuildForMvcViews> | |
</PropertyGroup> | |
<Target Name="CleanupForBuildMvcViews" Condition=" '$(_EnableCleanOnBuildForMvcViews)'=='true' and '$(MVCBuildViews)'=='true' " BeforeTargets="MvcBuildViews"> | |
<ItemGroup> | |
<_TempWebConfigToDelete Include="$(BaseIntermediateOutputPath)**\Package\**\*" /> | |
<_TempWebConfigToDelete Include="$(BaseIntermediateOutputPath)**\TransformWebConfig\**\*" /> | |
<_TempWebConfigToDelete Include="$(BaseIntermediateOutputPath)**\CSAutoParameterize\**\*" /> | |
<_TempWebConfigToDelete Include="$(BaseIntermediateOutputPath)**\TempPE\**\*" /> | |
</ItemGroup> |
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
Import-Module ActiveDirectory | |
# List members of a group | |
Get-ADGroupMember "Domain Admins" -recursive | Select-Object name | |
# list group memberships for user | |
Get-ADPrincipalGroupMembership "username" | Select-Object name |
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
let date year month day = new System.DateTime(year, month, day) | |
type DayOfWeek = | Monday | Tuesday | Wednesday | Thursday | Friday | Saturday | Sunday | |
exception DayOfWeekError | |
let dayOfWeek (date: System.DateTime) = | |
match date.DayOfWeek with | |
| System.DayOfWeek.Monday -> Monday | |
| System.DayOfWeek.Tuesday -> Tuesday |
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
let combine ys xs = | |
let zipi x = ys |> List.map (fun y -> (x, y)) | |
xs |> List.collect zipi |
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
let fibs() = | |
let rec fibs' a b = | |
seq { | |
yield b | |
yield! fibs' b (a+b) | |
} | |
fibs' 1L 1L | |
fibs() |> Seq.take 10 |> List.ofSeq;; |
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
#r "System.Numerics" | |
open System.Numerics | |
/// Find the roots of ax² + bx + c | |
let quadraticRoots a b c = | |
let ``√ B² - 4ac`` = sqrt (b * b - 4.0 * a * c) | |
let ``2a`` = 2.0 * a | |
(-b + ``√ B² - 4ac``) / ``2a``, (-b - ``√ B² - 4ac``) / ``2a`` |
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
namespace StringTimes | |
{ | |
using System; | |
public class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
const int Iterations = 10000000; |
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
let foldBack folder seq state = | |
let arr = Seq.toArray seq | |
Array.foldBack folder arr state | |
let folder a b = | |
let res = a + b | |
//printfn "fold %A and %A giving %A" a b res | |
res | |
let list = seq [1..1000000] |
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
let createTimer() = | |
let sw = System.Diagnostics.Stopwatch.StartNew() | |
fun () -> | |
sw.Elapsed | |
let timer = createTimer() | |
// Do some stuff to time | |
timer();; |
OlderNewer