Skip to content

Instantly share code, notes, and snippets.

@atuyosi
atuyosi / not_contains_level2.txt
Created February 17, 2016 18:30
tesseract-ocr 3.04 日本語未収録漢字のうち、JIS第二水準漢字の一覧
@atuyosi
atuyosi / detail_segfault_text2image#195
Created February 19, 2016 06:28
text2image Segfault on MacOSX(related with #195)
(lldb) run --text=eng.training_text --outputbase=./eng.dejavu.exp0 --font='DejaVu Sans Thin' --fonts_dir=~/Library/Fonts
There is a running process, kill it and restart?: [Y/n] y
Process 50212 exited with status = 9 (0x00000009)
Process 50237 launched: '/usr/local/bin/text2image' (x86_64)
Process 50237 stopped
* thread #1: tid = 0xc2291, 0x0000000100b98358 libpangoft2-1.0.0.dylib`pango_fc_font_get_glyph + 25, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000100b98358 libpangoft2-1.0.0.dylib`pango_fc_font_get_glyph + 25
libpangoft2-1.0.0.dylib`pango_fc_font_get_glyph:
-> 0x100b98358 <+25>: movq (%rcx), %rdi
0x100b9835b <+28>: testq %rdi, %rdi
@atuyosi
atuyosi / switch-image-threshold-method
Created April 14, 2016 11:40
Example for "preprocessedImageForTesseract"
func preprocessedImageForTesseract(tesseract: G8Tesseract!, sourceImage: UIImage!) -> UIImage! {
var filteredImage = UIImage()
switch threshold_mode {
case ThresholdMode.AdaptiveThreshold :
// Using AdaptiveThreshold
let adaptiveFilter = GPUImageAdaptiveThresholdFilter()
adaptiveFilter.blurRadiusInPixels = 4.0
@atuyosi
atuyosi / check_h1tag.rb
Created June 12, 2016 04:49
対象のはてなブログの各エントリにおいて、見出しにh1タグが使われているURLを見つけ出すやっつけ作業スクリプト
# /usr/bin/env ruby
require 'open-uri'
require 'nokogiri'
baseurl = "対象のはてなブログURL"
year = [ 2015,2016 ] # 必要に応じて追加
month = *1..12
@atuyosi
atuyosi / cmake_output_raspbian_opencv3.2.txt
Created December 30, 2016 14:58
CMake configuration for OpenCV 3.2 (with contrib) 2016/12/30 on Raspbian jessie
-- General configuration for OpenCV 3.2.0 =====================================
-- Version control: unknown
--
-- Extra modules:
-- Location (extra): /home/pi/workspace/build_opencv/opencv_contrib-3.2.0/modules
-- Version control (extra): unknown
--
-- Platform:
-- Timestamp: 2016-12-30T12:09:59Z
-- Host: Linux 4.4.38-v7+ armv7l
@atuyosi
atuyosi / building_inkscape_for_macOS_ja.md
Last active February 12, 2017 08:29
Inkscapeパッケージ(macOS)作業メモ

macOS Native (Gtk2/Quartz) のパッケージ(Inkscape.dmg)を作成する

  • Inkscape 0.92
  • Gtk 2
  • App bundle
  • Inkscape.dmg

必要なもの

  • Xcode
@atuyosi
atuyosi / do_ocr_ms.py
Created March 15, 2017 17:25
Modified Python Script for MS Computer Vision API (OCR)
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import http.client, urllib.request, urllib.parse, urllib.error, base64
# https://dev.projectoxford.ai/docs/services/56f91f2d778daf23d8ec6739/operations/56f91f2e778daf14a499e1fc
import http.client, urllib.request, urllib.parse, urllib.error, base64
import os, json, argparse
@atuyosi
atuyosi / page_extract.py
Created August 22, 2017 18:55
PDF Analyze and Extract text
#! /usr/bin/env python
# encoding: utf-8
#
import sys
from pdfminer.pdfparser import PDFParser
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
@atuyosi
atuyosi / convert.rb
Created August 24, 2016 12:51
To convert the cmudict from arpabet format to IPA format.
#! /usr/bin/env ruby
require 'csv'
require 'json'
mt = Hash.new
newdict = Hash.new
MAPFILE = "map_to_ipa_from_arpabet.tsv"
@atuyosi
atuyosi / illegal_company_list-20170815.tsv
Last active September 15, 2017 18:37
厚生労働省ブラック企業リスト(2017年8月15日版)
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 8 columns, instead of 7. in line 8.
北海道労働局 平成29年7月31日 いわみざわ農業協同組合 北海道岩見沢市 H28.10.4 労働安全衛生法第21条,労働安全衛生規則第431条 はいの崩壊を防止する措置を講じることなく労働者に作業を行わせたもの H28.10.4送検
北海道労働局 平成29年7月31日 (株)タムラ建設工業 北海道留萌市 H28.10.18 労働安全衛生法第31条,労働安全衛生規則第653条 高さ6.8mの屋根の端に手すり等を設けることなく請負人の労働者に作業を行わせたもの H28.10.18送検
北海道労働局 平成29年7月31日 西村建設 北海道留萌市 H28.10.18 労働安全衛生法第21条,労働安全衛生規則第519条,労働者派遣法第45条 高さ6.8mの屋根の端に手すり等を設けることなく労働者に作業を行わせたもの H28.10.18送検
北海道労働局 平成29年7月31日 小川重機土木(有) 北海道旭川市 H28.10.19 労働安全衛生法第21条,労働安全衛生規則第519条,労働者派遣法第45条 高さ8mの屋根上で安全帯を使用させることなく労働者に雪下ろし作業を行わせたもの H28.10.19送検
北海道労働局 平成29年7月31日 (有)伊藤造林 北海道紋別市 H28.11.28 労働安全衛生法第20条,労働安全衛生規則第155条 ドラグ・ショベルの作業計画を定めることなく労働者に作業を行わせたもの H28.11.28送検
北海道労働局 平成29年7月31日 (株)日洋フレッシュ 釧路工場 北海道釧路市 H29.1.16 労働安全衛生法第20条,労働安全衛生規則第130条の9 食品加工用圧縮機に覆い、囲い等を設けることなく労働者に作業を行わせたもの H29.1.16送検
北海道労働局 平成29年7月31日 (株)アイスライン 北海道札幌市白石区 H29.2.1 最低賃金法第4条 労働者6名に、2か月間の定期賃金合計約280万円を支払わなかったもの H29.2.1送検
北海道労働局 平成29年7月31日 長栄堂 北海道美唄市 H29.3.3 最低賃金法第4条 労働者5名に、5か月間の定期賃金合計約250万円を支払わなかったもの H29.3.3送検
北海道労働局 平成29年7月31日 (株)松村興業 北海道旭川市 H29.3.7 労働安全衛生法第61条,労働安全衛生法施行令第20条 トラクター・ショベルの運転を無資格の