Skip to content

Instantly share code, notes, and snippets.

@derekmcloughlin
derekmcloughlin / pytid
Created September 11, 2023 15:05 — forked from zombified/pytid
Python File Saver HTTP Server for TiddlyWiki 5
#!/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 has been truncated, but you can view the full file.
<?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&#13;&#10;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>
@derekmcloughlin
derekmcloughlin / import_lobbyists.cypher
Created October 31, 2019 15:46
Importing lobbyist XML data using APOC
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,
# 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
@derekmcloughlin
derekmcloughlin / stats_equations.Rmd
Last active February 21, 2024 15:44
Useful Latex Equations used in R Markdown for Statistics
---
title: "Sample Equations used in Statistics"
output: html_document
---
### Summations
### Without Indices
$\sum x_{i}$
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
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
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