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
#! /usr/bin/env python3 | |
from sys import stderr, argv | |
if len(argv) <= 1: | |
stderr.write("No file names are specified.\n") | |
exit(1) | |
prev = '' |
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
Q1.1 sed -n '/\\begin{figure}/,/\\end{figure}/p' | sed '/figure/d' | |
Q1.2 sed -n '/\\begin{figure}/,/\\end{figure}/p' | sed '/figure/d' | sed -n '/include\|caption/p' | sed 's/.*{\(.*\)}.*/\1/' | tac | xargs -l2 | tac | |
Q2 sed '/^%/d' | sed -n '/\\section/,/。/p' | sed 's/\([^。]*\)。.*/\1。/' | |
Q3 sed 's/%.*//' | tr '\n' '%' | sed 's/footnote{/\n/g' | tail -n+2 | sed 's/\([^{}]*\({[^}]*}[^{}]*\)*\)}.*/\1/' | tr % '\n' | |
Q4 # for i in $(cat contents.tex | sed 's/\(.*\\section.*\)/IRUYAN\n\1/' | sed '0,/IRUYAN/d' | tr '\n' ';' | tr ' ' '`' | sed 's/IRUYAN/\n/g'); do; echo $i; done # j=$(echo $i | sed 's/}.*//' | sed 's/.*{//' | tr '`' _); echo $j; done # $i | tr ';' '\n' | echo $j; done # tee $j >/dev/null; done | |
Q5 grep -Po '(\p{Han}|\p{Katakana})+座標系' | sort -u | |
Q6 sed 's/%.*//' | sed 'N;s/^\n\(.\)/\n \1/' | sed '1i\\' | sed 'N;s/^\n\(.\)/\n \1/' | sed '1d' | sed 's/ \(.*\(section\|begin\|includegraphics\|label\).*\)/\1/' | |
Q7 sed 's/^%.*//' | sed -ze 's/\n\n/;;/g' -ze 's/;\n/;;/g' -ze ' |
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
#! /bin/bash | |
# usage watch -n<sec> backup <filename> | |
set -eu | |
: $1 | |
dir=$1.backup | |
mkdir -p $dir | |
touch $dir/00_00_00_00_00_$1 |
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 assign.sh 座席表 名簿 [置換対象の文字列] | |
set -eu | |
: $1 $2 | |
sep=${3:-ps} | |
tmp_file=$(mktemp) && cp $1 $tmp_file | |
cat $2 | shuf | sed -e "s/ /\\\\ /g" | xargs -I {} sed -i "0,/$sep/s/$sep/{}/" $tmp_file | |
trap "cat $tmp_file && rm $tmp_file" 0 |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define N 10000 | |
void swap(int *a,int *b) | |
{ | |
int temp = *a; | |
*a = *b; |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<script src='hoge.js'> </script> | |
<script> | |
console.log('hello world!') | |
</script> | |
</head> | |
<body> | |
</body> |
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
JOI予選問題のソースコード |
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
\documentclass[12pt]{ltjsarticle} | |
\usepackage{notemode} | |
\begin{document} | |
\newcommand{\ms}[1]{$\displaystyle \mathrm{#1}$} | |
%\subsection*{重要:以下の事項は2015/11/21現在に化学の授業で学習している範囲での話である。 | |
%今後の学習、及び編入試験などで以下の事項が覆されても責任は一切負わない。} | |
\section*{前提} | |
\subsection*{液性} |
NewerOlder