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
module Main where | |
import Control.Parallel | |
import Control.Parallel.Strategies (rseq, rpar, Strategy, using, runEval) | |
import Data.Time.Clock | |
import Text.Printf | |
import System.Environment | |
-- <<fib |
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 Data.Tree | |
type State = Int | |
data ST a = S (State -> (a, State)) | |
apply :: ST a -> State -> (a,State) | |
apply (S f) x = f x | |
instance Monad ST where |
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 Data.List | |
import Data.Ord | |
import Test.QuickCheck | |
import Test.HUnit | |
getSubSeries :: [Int] -> Int -> [Int] | |
getSubSeries [] _ = [] | |
getSubSeries series threshold = head [x | x <- sortBy (flip $ comparing length) $ subLists series, | |
sum x <= threshold] | |
where |
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
--- | |
title: "Sample Equations used in Statistics" | |
output: html_document | |
--- | |
### Summations | |
### Without Indices | |
$\sum x_{i}$ |
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
# scaled features. | |
# x = square feet | |
# y = sale price | |
x <- c(1, 2, 4) | |
y <- c(2, 2.5, 3) | |
# function to calculate the predicted value | |
h <- function(x, t0, t1) | |
{ | |
result = t0 + t1 * x |
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
with '2015_1_1_1.xml' as url | |
CALL apoc.load.xml(url) YIELD value as publicFilings | |
UNWIND publicFilings._children as filing | |
MERGE (f:Filing {fid: filing.ID, type: filing.Type}) | |
with filing, f | |
unwind filing._children as item | |
with filing, f, item, | |
[c in item where c._type = "Client" | c] as clients, | |
[r in item where r._type = "Registrant" | r] as registrants, | |
[lo in item where lo._type = "Lobbyists" | lo] as lobbyists, |
This file has been truncated, but you can view the full file.
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
<?xml version="1.0" encoding="UTF-8"?> | |
<PublicFilings> | |
<Filing ID="14AFF42F-8974-478F-A22E-83915A603154" Year="2014" Received="2014-12-31T22:40:17.727" Amount="20000" Type="FOURTH QUARTER TERMINATION" Period="4th Quarter (Oct 1 - Dec 31)" TerminationEffectiveDate="2014-12-31T00:00:00"> | |
<Registrant xmlns="" RegistrantID="313715" RegistrantName="Capitol Counsel LLC" GeneralDescription="Government affairs." Address="700 13th Street NW, 2nd Floor Washington, DC 20005" RegistrantCountry="USA" RegistrantPPBCountry="USA"/> | |
<Client xmlns="" ClientName="Tompkins Strategies, LLC" GeneralDescription="Government Relations Firm" ClientID="1005255" SelfFiler="FALSE" ContactFullname="Tracey A. Gray" IsStateOrLocalGov="TRUE" ClientCountry="USA" ClientPPBCountry="USA" ClientState="DISTRICT OF COLUMBIA" ClientPPBState=""/> | |
<Lobbyists> | |
<Lobbyist xmlns="" LobbyistName="O'Neill, John J Jr" LobbyistCoveredGovPositionIndicator="NOT COVERED" OfficialPosition="" ActivityInformation="B"/> | |
</Lobbyists> |
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
#!/usr/bin/env python3 | |
""" | |
TiddlyWiki 5 saver in the form of a Python 3 http.server. | |
Start script in directory with TiddlyWiki's, go to http://localhost:8181, | |
select the TiddlyWiki you want, and this server should handle saving via | |
TiddlyWiki 5 PUT save method. | |
Based on: https://gist.github.com/jimfoltz/ee791c1bdd30ce137bc23cce826096da | |
- why not just use the Ruby one? some environments don't have Ruby, some |
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
{"name":"Active Search","method":"url","files":[{"location":"./playgrounds/activesearch/server.js","filename":"server.js","builtin":true,"contents":"import { faker } from 'https://cdn.skypack.dev/@faker-js/[email protected]';\nimport Fuse from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/fuse.mjs'\n\nfaker.seed(42)\n\nlet contacts = []\n\nfor (let i = 0; i < 300; i++) {\n contacts.push({\n firstName: faker.name.firstName(),\n lastName: faker.name.lastName(),\n })\n}\n\nconst fuse = new Fuse(contacts, {\n keys: ['firstName', 'lastName'],\n includeScore: true\n})\n\non.get(\"/\", (request) => {\n return render(request, 'index.html', {\n results: []\n })\n})\n\non.post(\"/search\", async (request) => {\n let formData = await request.formData()\n let query = formData.get('search')\n\n let results = fuse.search(query)\n\n await sleep(500);\n\n return render(request, 'results.html', {\n results: results.slice(0, 8)\n })\n})\n"},{"location":"./playground |
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
-- Install packer | |
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim' | |
local is_bootstrap = false | |
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then | |
is_bootstrap = true | |
vim.fn.system { 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path } | |
vim.cmd [[packadd packer.nvim]] | |
end | |
require('packer').startup(function(use) |