Skip to content

Instantly share code, notes, and snippets.

@masao
masao / index.html
Last active February 21, 2025 12:34
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>教科書関係可視化</title>
<script src="https://d3js.org/d3.v7.min.js"></script>
<style>
#graph {
width: 100%;
height: 600px;
#!/usr/bin/env ruby
require_relative "ext-coscode-hier.rb"
ttl2html = App.new()
include TTL2HTML
["teachingUnit-AA-body.ttl", "teachingUnit-AB.ttl"].each do |ttl|
fname = find_turtle(ttl)
ttl2html.load_turtle(fname)
end
#!/usr/bin/env ruby
if $0 == __FILE__
file = ARGV[0]
time = ARGV[1]
if file.nil? or time.nil?
puts "#{$0} file.txt time"
exit
end
seconds = 0
@masao
masao / sukilam-search.html
Created November 23, 2023 17:20
JP-COS + S×UKILAM連携
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" crossorigin="anonymous"></script>
<script type="application/javascript">
function sem_search() {
let cos = document.getElementById("cos");
#!/usr/bin/env ruby
require "pp"
require "roo"
if ARGV.size < 2
puts "USAGE: #$0 competence.xlsx SIR201911xxx.xlsx"
exit
end
subject_mappings = {
#!/usr/bin/env ruby
require "benchmark"
require "rubygems"
if ARGV.size < 1
puts <<-EOF
USAGE:
#$0 "~> 3.2.0"
or
layout title tags comments
post
Call For Proposals - Code4Lib JAPAN Conference 2022

日本語版はこちら

This year's Code4Lib JAPAN Conference will be held online over two days, Saturday, September 3rd and Sunday, September 4th, 2022, following last year's conference. We invite presentations on a variety of initiatives, including software applications in libraries, archives, and museums, and new ideas related to use of community-based library resources and technologies.

#!/usr/bin/env ruby
require "open-uri"
require "csv"
require "nokogiri"
CSV.foreach(ARGV[0], { headers: true, col_sep: "\t" }) do |row|
iss_url = row["manifestation_identifier"]
manifestation_id = row["manifestation_id"]
creators = []
#!/usr/bin/env rubyt
require "roo"
@codes = {}
xlsx = Roo::Excelx.new(ARGV[0], {headers: true})
xlsx.default_sheet = "all_数字はAに"
xlsx.each_row_streaming(pad_cells: true, headers: true, offset: 4) do |row|
#p row
#p row[7]
require_relative "ext-hlv.rb"
ARGF.each do |line|
bibid, hlv, = line.chomp.split(/\t/)
hlv.expand_hlv.each do |vol|
puts [bibid, vol].join("\t")
end
end