This file contains 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
# Python implementation of https://aclanthology.org/P01-1064.pdf | |
# | |
# How to use: | |
# from textseg import textseg | |
# segments = textseg(texts) | |
from math import log2 | |
import unittest | |
This file contains 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
(defun gnus-resume (&optional force) | |
"Resume the last Gnus session or start a Gnus session." | |
(interactive "P") | |
(when (or force | |
(memq major-mode '(gnus-group-mode gnus-summary-mode gnus-article-mode message-mode lsdb-mode)) | |
(let* ((key (+ ?a (random 26))) | |
(inp (read-char (format "Really start or resume Gnus session? Type \"%s\": " (string key))))) | |
(or (char-equal key inp) | |
(progn | |
(message "No reading news is good news") |
This file contains 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
;; 2つ目のフレームを作成する時,1つ目のフレームと重なって表示されてしまうため,重ならないよう場所を指定する | |
(defun my-make-frame-command () | |
"Make a new frame, on the same terminal as the selected frame. | |
If the terminal is a text-only terminal, this also selects the | |
new frame." | |
(interactive) | |
(if (display-graphic-p) | |
(let ((left (cdr (assq 'left (frame-parameters (selected-frame))))) | |
(width (+ (frame-pixel-width) (frame-scroll-bar-width)))) | |
(make-frame (list |
This file contains 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
--- a/internal/pkg/util/fs/mount/mount.go | |
+++ b/internal/pkg/util/fs/mount/mount.go | |
@@ -585,7 +585,10 @@ | |
if sizelimit == 0 { | |
return fmt.Errorf("invalid image size, zero length") | |
} | |
- options = fmt.Sprintf("loop,offset=%d,sizelimit=%d,errors=remount-ro", offset, sizelimit) | |
+ options = fmt.Sprintf("loop,offset=%d,sizelimit=%d", offset, sizelimit) | |
+ if fstype == "ext3" { | |
+ options += ",errors=remount-ro" |
This file contains 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/perl | |
=head1 OBJECT OF THIS SCRIPT | |
Panasonic 製デジタルビデオカメラが,SD カードに動画を格納する時,動画データのファイル名は連番になっている. | |
これを,日付(8桁)-連番というファイル名に変更するために必要な情報を取り出す. | |
=head1 SYNOPSIS | |
perl playlist.pl PRIVATE/AVCHD/BDMV/PLAYLIST/00000.MPL |
This file contains 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
# (0) Replace the gateway server name and the subnet address with your own values. | |
# (1) Put this file into ~/.config/systemd/user/sshuttle.service | |
# (2) Invoke `systemctl --user daemon-reload` | |
# (3) Invoke `systemctl --user start sshuttle.service` | |
[Unit] | |
Description=sshuttle | |
Requires=gpg-agent-ssh.socket | |
After=gpg-agent-ssh.socket |
This file contains 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/perl | |
=head1 NAME | |
auto-responder - 受信したメールに自動返信する | |
=head1 SYNOPSIS | |
C<.forward> の中で |
This file contains 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/python3 | |
""" | |
Parallelize MeCab | |
$ wc -l corpus.txt | |
2761174 corpus.txt | |
$ time ./parallel-mecab.py corpus.txt >/dev/null | |
real 0m12.610s |
This file contains 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
- name: Check multimedia keyring | |
command: dpkg-query -W deb-multimedia-keyring | |
register: multimedia_keyring | |
changed_when: multimedia_keyring.rc == 1 | |
failed_when: multimedia_keyring.rc > 1 | |
check_mode: no | |
- name: Retrieve deb-multimedia-keyring | |
get_url: | |
url: http://www.deb-multimedia.org/pool/main/d/deb-multimedia-keyring/deb-multimedia-keyring_2016.8.1_all.deb |
This file contains 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/sh | |
# Example attachment decoder script. The attachment comes from stdin, and | |
# the script is expected to output UTF-8 data to stdout. (If the output isn't | |
# UTF-8, everything except valid UTF-8 sequences are dropped from it.) | |
# The attachment decoding is enabled by setting: | |
# | |
# plugin { | |
# fts_decoder = decode2text |
NewerOlder