Skip to content

Instantly share code, notes, and snippets.

View technocrat's full-sized avatar

Richard Careaga technocrat

  • Woodinville, WA, USA
  • 18:22 (UTC -12:00)
View GitHub Profile
@technocrat
technocrat / 2020vote.csv
Created March 22, 2024 21:41
Table of 2020 presidential votes
st biden_pop trump_pop biden_col trump_col margin
AL 849624 1441170 0 9 -591546
AK 153778 189951 0 3 -36173
AZ 1672143 1661686 11 0 10457
AR 423932 760647 0 6 -336715
CA 11110639 6006518 55 0 5104121
CO 1804352 1364607 9 0 439745
CT 1080831 714717 7 0 366114
DE 296268 200603 3 0 95665
DC 317323 18586 3 0 298737
@technocrat
technocrat / leaflet.html
Created March 5, 2024 23:22
Leaflet demonstration
<document_content>
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Template</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js">
</script>
<style>
.flex-container {
@technocrat
technocrat / test_json.json
Created January 6, 2024 00:16
Malformed json to be parsed
{
"AAK1": {
"data-turbo_1": [
"```json",
"{",
" \"gene_name\": \"AAK1\",",
" \"brief_summary\": \"AAK1 (AP2 associated kinase 1) is a gene that encodes a protein kinase involved in endocytosis, a process by which cells internalize molecules and particles from their environment. The AAK1 protein regulates the binding of the AP2 complex to clathrin and the plasma membrane, which is crucial for the formation of clathrin-coated vesicles. This process is important for the internalization of proteins and receptors from the cell surface and their subsequent recycling or degradation.\",",
" \"evidence_scores\": {",
" \"This gene is specifically associated with the test case\": 1,",
" \"This gene is specifically associated with the biology of cells\": 1,",
@technocrat
technocrat / precincts.csv
Created November 19, 2023 00:29
Sample of precincts names
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
"precinct"
"1"
"2"
"3"
"4"
"5"
"7"
"16"
"19"
"23"
@technocrat
technocrat / aristotle.R
Created October 14, 2023 06:36
Script for discussion of R programming style focused on the what of each step
# aristotle.R
# author: Richard Careaga
# problem to illustrate analytic programming
# Date: 2023-10-14
# what we have: a text copy of an old fixed-length format tape
# intended to record numeric blocks of data in 20 character increments
# without delimiters; the objective is to divide the text into
# 20 character blocks, find the index of the last "0" in each block
# and record the block sequence number of the block together with the
@technocrat
technocrat / legacy tape
Created October 11, 2023 08:50
Faux data representing a legacy 8-track ASCII tape
6203470630908559238079179977218586086616310689952356453781771040147677896527439641598032294837708419255898328922922869864037616914236374018072015237149505454446573396211404371214962607296138755704843526593762128533768469576038141326462082220683257284558538749081482745010595939575103170856523256755203519343462605049518714674287893169039082729560869618077997971993120241211563035400746489231051799577712707190856442739352376046481294362776401926066301932288860908596808951455449424849622810607405626572629969130715169665862671464095909929908334632270923035870954131337939460568991742087417175233424106357983607940314388408496202261661166086691324622853217191955586297859845186463715763222486177482377230886310535082537816388596680962780375437918682459345393211315846957238820179234557529509116356434769983192598858118663165324860684725228690111245592649981858764444607466434796515906667875400358504326276490834561909204247652182993417403587694309169986557945609913797952549624717584706569058519614479922361578183429812433447

Well, slick

I've been dinking around learning Julia, and by way of procrastination I have begun the usual process of setting up an environment in which to do it. Who says men aren't nestbuilders?

I want something to combine notes and code in a literate programming style. There is comment lines, of course, but what if I want to include something with more heft, such as

$g(x) = ln\Bigl[\frac{\pi(x)6}{1 - \pi(x)}\Big] = \beta_0 +\beta_1x$

For that, there's an IDE like RStudio or VSCode plus RMarkdown or Quarto. Or just settle for lightly formatted text and code with jupyter or pluto. But I was having trouble finding the sweet spot. For one thing, CLI and REPL work helps avoid the sin of Premature PrettyPrinting where it's hard to resist seeing how the output is going to look. Back when we passed paper back and forth instead of texts whole forests were felled in aid of printing out documents with each new paragraph just to check if the page breaks have changed. We never do get over kindergarden.

@technocrat
technocrat / keybase.md
Created June 1, 2023 02:41
Attestation of github ownership

Keybase proof

I hereby claim:

  • I am technocrat on github.
  • I am careaga (https://keybase.io/careaga) on keybase.
  • I have a public key ASDNeDtJHa2iLwfEGS-gnFRc3y4ThLgeA9rrtgybbmvXXwo

To claim this, I am signing this object:

---
title: "Untitled"
author: "Richard Careaga"
date: "2023-05-13"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(ggplot2)
@technocrat
technocrat / tt.md
Created March 24, 2023 03:44
Should TikTok be banned or broken up?

The platform should not be banned on the basis of content because

  1. it not a forum owned by the US government
  2. it is not a forum broadcast over "the public airways" like television and radio that are "affected with the public interest" under the existing scheme of licencing
  3. it is not a forum delivered via a common carrier licensed and regulated under the Commerce Power The platform type may be subject to reasonable time, place and manner regulation as to content and to consumer protection regulation as to terms of service in a manner applicable to similar business

The platform should not be banned up

  1. On the basis of foreign ownership or control without a rationale to distinguish other enterprises operating in the United States also under foreign ownership or control
  2. On the basis of the specific foreign ownership or control that involves no authorization for the imposition of sanctions based on some statutory authority of general applicability that involves specific enumerated conduct such as, for