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
# refer to https://gis.stackexchange.com/questions/110117/counting-number-of-points-in-polygon-using-r/270479#270479 | |
# for original code example | |
# Load libraries ---------------------------------------------------------- | |
library(raster) | |
library(sf) | |
library(dplyr) | |
# Get sample data --------------------------------------------------------- |
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
################################################################################## | |
# Import liquor licencing data, geocode and plot | |
# Plot on a NZ map | |
# Show a regional view - some demographics eg population density at SA2 | |
# Import the public NZ Police aggregated crime data | |
# Look at crime harm regional cf liquor outlet distribution | |
# | |
library(readxl) | |
library(rgdal) |
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 version="1.0" encoding="UTF-8"?> | |
<Questionnaire type="referee"> | |
<Section id="referee" label="Your details"> | |
<Section id="identity" label="Identity"> | |
<Input id="name" label="Referee name"> | |
<Input id="firstName" label="First name">Douglas</Input> | |
<Input id="middleName" label="Middle name">Neil</Input> | |
<Input id="surname" label="Surname">Adams</Input> | |
</Input> |
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
import java.time.LocalDateTime | |
import java.time.format.DateTimeFormatter | |
fun main(args : Array<String>) { | |
var value1 = 1 | |
var value2 = "2" | |
var value3 = 3.0 | |
var value4 = 4.0 | |
println(java.lang.String.format("%d, %s, %6f : %3f", value1, value2, value3, value4)) |
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
// Exploring validation approaches | |
// (To start off a no validation option then...) | |
// Firstly by using an Option type to return Some error text or None if ok - well, actually we end up wrapping the output with Result just because we can | |
// Secondly by using a Result type and applicative validation a la https://fsharpforfunandprofit.com/posts/elevated-world-3/#validation | |
open System | |
module Result = | |
let apply fResult xResult = | |
match fResult, xResult with |
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
First should think about this: https://mangelmaxime.github.io/Fulma/#fulma/components/modal | |
But otherwise... | |
In NarrativeModal.fs | |
module Client.NarrativeModal | |
open System | |
open Fable.Core | |
open Fable.Core.JsInterop |
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
argu.5.1.0.nupkg | |
fake.5.2.0.nupkg | |
consoletables.2.2.0.nupkg | |
dapper.1.50.5.nupkg | |
dotnet-saturn.0.7.1.nupkg | |
fsharp.core.4.5.0.nupkg | |
giraffe.1.1.0.nupkg | |
hopac.0.3.23.nupkg | |
http.fs.5.3.0.nupkg | |
microsoft.aspnetcore.2.1.2.nupkg |
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
// I like this active pattern stuff | |
open System.Globalization | |
let (|ShortDate|_|) s = | |
match DateTime.TryParseExact(s, "ddMMMyyyy", CultureInfo.InvariantCulture, DateTimeStyles.None) with | |
| true, d -> Some d | |
| _ -> None | |
let (|LongDate|_|) s = |
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
// 12 step cold-hot colour scale from http://geog.uoregon.edu/datagraphics/color_scales.htm | |
let rowColourClass (x:double) (min:double) (max:double) = | |
let idx = | |
match x with | |
| x when x > max -> 0 | |
| x when x < min -> 12 | |
| _ -> (int)(Math.Round((x - min)/((max - min)/12.))) | |
[|"#002aff"; "#1965ff"; "#3299ff"; "#65ccff"; "#99edff"; "#ccffff"; "#ffffcc"; "#ffee99"; "#ffcc65"; "#ff9932"; "#ff6619"; "#ff2a00"|] | |
|> Array.rev | |
|> fun a -> a.[idx] |
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
# too easy | |
file.size(list.files("c:\\users\\bohdans\\.atom", recursive=T, include.dirs = F, full.names = T)) |