Create a programming-langague-independent API for a modern headless archival digital repository for an academic research library. Start with an overall list of the major functions that need to be supported text that explains what the general functionality area covers, then list individual endpoints under each heading along with possible arguments and error conditions that would need to provide feedbasck via the return values.
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
| usage: rapid-mlx serve [-h] [--served-model-name SERVED_MODEL_NAME] | |
| [--force-disk-check] [--host HOST] [--port PORT] | |
| [--listen-fd FD] | |
| [--log-level {DEBUG,INFO,WARNING,ERROR}] | |
| [--max-num-seqs MAX_NUM_SEQS] | |
| [--max-concurrent-requests MAX_CONCURRENT_REQUESTS] | |
| [--prefill-batch-size PREFILL_BATCH_SIZE] | |
| [--completion-batch-size COMPLETION_BATCH_SIZE] | |
| [--enable-prefix-cache] [--disable-prefix-cache] | |
| [--prefix-cache-size PREFIX_CACHE_SIZE] |
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
| const fs=require('fs'); | |
| const t=fs.readFileSync('captures/test/index.html','utf8'); | |
| const r=fs.readFileSync('captures/reference/index.html','utf8'); | |
| const idxs=[]; | |
| for(let i=0;i<t.length;i++) if(t[i]==='�') idxs.push(i); | |
| console.log('replacement count',idxs.length); | |
| for(const i of idxs){ | |
| const pre=t.slice(Math.max(0,i-40),i); | |
| const post=t.slice(i+1,i+40); | |
| const marker=pre+post; |
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
| //----------- STRINGS --------------- | |
| fun string_stuff() { | |
| // fstring / text blocks | |
| val name = "Alice" | |
| val age = 30 | |
| val message = "Hello, $name, you are $age. In ten years you'll be ${age + 10}." | |
| val longer = """ | |
| This is a much longer string. It can also do interpolation. |
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
| require "benchmark/ips" | |
| require "marc" | |
| require "../lib/marc/jsonl_reader" | |
| require "zinzout" | |
| source_file = "/Users/dueberb/devel/mlibrary/data/search_full_bibs/all.jsonl.gz" | |
| temp_file = "/tmp/500k.bat" | |
| require "pathname" | |
Summarize the algorithm described between START and STOP
START
This is the process:
-
Take the first 12 digits of the 13-digit ISBN
-
Multiply each number in turn, from left to right by a number. The first digit is multiplied by 1, the second by 3, the third by 1 again, the fourth by 3 again, and so on to the eleventh which is multiplied by 1 and the twelfth by 3.
-
Add all of the 12 answers.
This is a very simple, self-contained (well, except for benchmark-ips) benchmark. Conceptually, it does the following:
- Create an array-of-arrays, each element being a 20-element array of integers
- Write it out to a file as JSON
- Write it out to a gzipped file as JSON
- Read them both back in as strings
- Compare how long it takes to JSON.parse the never-gzipped (plain) string vs the previously-gzipped string
Usage via slow_gzip_bench.rb -h
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
| # frozen_string_literal: true | |
| # # Simple example -- get ids and titles of all items without an author | |
| # | |
| # rsolr = RSolr.connect(url: 'http://localhost:8025/solr/catalog') | |
| # stream = rsolr.streamer(handler: 'select') do |s| | |
| # s.filter = 'NOT author:[* TO *]' | |
| # s.sort = 'id asc' | |
| # s.fields = ['id', 'title'] | |
| # s.batch_size = 2_000 |
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"?> | |
| <collection> | |
| <record> | |
| <leader>00000nas a2200000 i 4500</leader> | |
| <controlfield tag="001">990155606890206381</controlfield> | |
| <controlfield tag="005">20190626105359.0</controlfield> | |
| <controlfield tag="008">170919c20179999miuuu p 6 0 a0eng d</controlfield> | |
| <datafield tag="035" ind1=" " ind2=" "> | |
| <subfield code="a">(MiU)015560689MIU01</subfield> | |
| </datafield> |
A basic run through of how things move through SLIP.
- slip_rights: (one row per item). A copy-ish of rights_current with additional information about when an item was last updated. Populated/updated from vufind solr.
- slip_queue: (one row per item-to-update). A list of HTIDs along with slots to hold information about which (if any) process is
NewerOlder