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
| %%bash | |
| # (インストールに3分ぐらいはかかるよ) | |
| # mecab.hのために必要 | |
| apt install mecab libmecab-dev | |
| # crfppダウンロード(cabochaの依存関係) | |
| curl -sL -o CRF++-0.58.tar.gz "https://drive.google.com/uc?export=download&id=1lEwSRLAXpPnlPMPv8fx48y13Xy5eHNU9" | |
| tar -zxf CRF++-0.58.tar.gz | |
| # crfppインストール | |
| cd CRF++-0.58 | |
| ./configure && make && make install && ldconfig |
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
| # -*- coding: utf-8 -*- | |
| import argparse | |
| import dataclasses | |
| from typing import Iterator | |
| @dataclasses.dataclass | |
| class Token: | |
| start: int |
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 | |
| between () { | |
| cat - | tail -n +$1 | head -n `expr $2 - $1 + 1` | |
| } | |
| seq 1 20 | between 3 7 | |
| cat <<EOS | |
| 結果は |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| ※※ 無駄コード多数 | |
| """ | |
| import os | |
| import json | |
| import time | |
| import datetime |
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
| grep -e '\t' -e '^$' ud.conllu | cut -f 2 | perl -pe 's/^$/EOS/g' | perl -pe 's/\n//g' | perl -pe 's/EOS/\n/g' | less |
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
| $ cat test.cabocha | grep -v "^#\!" | grep -v "^* " | cut -f 1 | perl -pe 's/\n//g' | perl -pe 's/EOS/\n/g' |
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
| # -*- coding: utf-8 -*- | |
| """ | |
| encode/decode bookmarklet | |
| """ | |
| import sys | |
| import argparse | |
| import urllib.parse | |
| import requests |
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
| # Ver.1.48.31.2、localizeImageInfoSourceにてファイルのパス変更を確認、 | |
| # そのため、その箇所でroomNumberを現在の鯖のルームナンバーに強制的に変更 | |
| $ diff DodontoFServer.rb DodontoFServer.rb.bk | |
| 3136d3135 | |
| < tagInfo['roomNumber'] = @saveDirInfo.getSaveDataDirIndex | |
| # ただし上記のみだと(なぜか)、画像は削除及びタグ編集などは できるが削除したファイルが「imageInfo.jsonから削除され」ない | |
| # ロードした際、imageInfo.jsonから(意図はなんとなく分かる(他の鯖でも使える用?)が、どこで消えるのか不明)smallImageのパスがjsonファイルから消滅するので |
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/python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| show what hours or minutes are XX seconds | |
| """ | |
| import argparse | |
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/python | |
| import sys | |
| import argparse | |
| import bs4 | |
| def main(args): | |
| print(bs4.BeautifulSoup(args.input_file.read()).prettify().encode('utf-8')) | |
| def get_parser(): |
NewerOlder