Skip to content

Instantly share code, notes, and snippets.

View CliffordAnderson's full-sized avatar

Clifford Anderson CliffordAnderson

View GitHub Profile
xquery version "3.1";
let $id := "EB010103"
let $doc := fn:collection()/TEI.2[@id = $id]
let $title := ($doc//body/div/head/data())[1]
let $date := $doc//sourceDesc/bibl/date/text()
let $heft := $doc//titleStmt//title/text() => fn:replace(".*heft *(.), *article *(.)", "$1")
let $article := $doc//titleStmt//title/text() => fn:replace(".*heft *(.), *article *(.)", "$2")
let $author := $doc//docAuthor/text()
let $starting-page := $doc//sourceDesc/bibl/biblScope/text() => fn:replace(".*?(\d+)-(\d+)", "$1")
@CliffordAnderson
CliffordAnderson / women-in-religion-llamaindex.ipynb
Last active July 1, 2025 17:07
women-in-religion-llamaindex.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CliffordAnderson
CliffordAnderson / synthetic-data-generation-of-wikipedia-infoboxes.ipynb
Created June 30, 2025 12:55
synthetic-data-generation-of-wikipedia-infoboxes.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CliffordAnderson
CliffordAnderson / download-hf-dataset-as-jsonl.ipynb
Created June 30, 2025 12:48
download-hf-dataset-as-jsonl.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CliffordAnderson
CliffordAnderson / using-pretrained-abstract-to-tweet-model.ipynb
Last active June 30, 2025 12:56
using-pretrained-abstract-to-tweet-model.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CliffordAnderson
CliffordAnderson / 01-intro.md
Last active February 18, 2025 19:46
Yale Library Coding Meetup

Introduction to Block-Based Programming

Learning Goals

  • Develop facility in block-based programming by creating custom blocks and drawing on the stage.
  • Explore the concept of recursion by encoding the Fibonacci sequence.
  • Understand how block-based programming fosters learning by visualizing units of computation.

A Little Theory

@CliffordAnderson
CliffordAnderson / news-topics.ipynb
Last active December 22, 2025 20:53
news-topics.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CliffordAnderson
CliffordAnderson / convert-date.xqy
Last active July 17, 2022 01:56
XQuery Puzzles from Week 1, Day 5, Session 4 of the Advanced Digital Editions NEH Institute at the University of Pittsburgh
xquery version "3.1";
let $date := "July 15, 2022"
let $tokens := fn:tokenize($date, " ")
let $month :=
switch ($tokens[1])
case "January" return "01"
case "February" return "02"
case "March" return "03"
case "April" return "04"
@CliffordAnderson
CliffordAnderson / fibC.xqy
Created June 29, 2022 00:54
Fibonacci w/continuations
(: Thanks to friends at NashFP, especially Mike K. and Mark Wutka :)
declare function local:fibC($n as xs:integer, $memo as map(*), $con) {
if (map:contains($memo, $n)) then $con(map:get($memo, $n), $memo)
else
local:fibC($n - 1, $memo,
(: n1 = fib(n - 1) :)
function($n1 as xs:integer, $memo as map(*)) {
local:fibC($n - 2, $memo,
(: n2 = fib(n - 2) :)