Saturday, October 29, 2016

about local wiki management tool (liki)

People know that wiki is necessary documentation agent, but there are obstacles like...

1) You cannot customize wiki as you prefer for it affects whole team or entire company. (so veto to deployment of plugins occurs often).
2) There sometimes appears necessity to handle trivial document data, locally.
3) Your local documents piled/messed up as time passes and you no longer be able to manage almost all of these documents any longer. It is pretty hard to refer to something embedded in the document saved two years ago on your hard drive, which you ain't remember any more.

The liki emerged for these reasons. We need to create, relate(this part not implemented yet), update, grep, find documents efficiently, locally, as wiki. Keyword-based search easily let user find what they want to look for. This script had to be used solely via terminal because terminal/editor oriented developer always suffered for GUI-based development or third party tool which had disgusted them for a long time.

TODO// See also or tagged-link function. (we need to establish dsl here)

Here is the repository:

Here is the code (in progress)

indentation is dead here so you need to look out github

#!/usr/bin/env python
import os
import sys
from os import listdir

wiki_dir = "/usr/local/etc/liki/pages"

def makeDirs(directory):
if(not os.path.exists(directory)):
return directory

def addChild(node, term):
return (node + "/{0}").format(term)

def getDirectory(rootdir, folder):
return makeDirs(addChild(rootdir, folder))

def getPage(term):
return addChild(getDirectory(wiki_dir, term[0]), term)

def writeToFile(page, text, mode="a"):
f = open(page, mode)
f.write(text + "\n")

def makeText(text, addition, message=""):
return text if (addition == "fin") else makeText(text + addition + "\n", raw_input())

# look for page file
def findPage(keyword=""):
if(keyword == ""):
sys.stdout.write("[find] word: ")
keyword = raw_input()

result_list = [f for f in listdir(getDirectory(wiki_dir, keyword[0])) if f.startswith(keyword)]

True : (lambda x : showPage(x[0])),
False : (lambda x : findPage())
}[len(result_list) == 1](result_list)

def showPage(page):
f = open(getPage(page), "r")

# create page file
def createPage():
sys.stdout.write("[create] word: ")
page = getPage(raw_input())
writeToFile(page, makeText("", "", "text[type fin at EOF]: \n"))

# edit page file

# link page file

# list pages with key

# grep pages

# here is the main execution part.
# if argument does not exist, show help message
if(len(sys.argv) < 2):
print("you need argument")
print("[find] : find page")
print("[create] : create page\n")


# dispatch execution function
"find" : findPage,
"create" : createPage

Friday, October 28, 2016

local wiki management script

This script is in the development process: (written in python)

Network easy access helper 'netw' created

I had been fed up with the trouble.... for there are unnecessary wifi networks I gotta dismiss every time, so I made a script to easily manage networks and its passwords.

the password is currently directly stored therefore needs encryption and decryption implementation.

with this script, you can easily launch/disable target networks via terminal instantly.

Recording conversations on Mac via terminal

 (suppose you are Mac OSX user and already have installed homebrew)

$brew install sox
$rec sample.wav
(now you are recording)

$play sample.wav

Sunday, October 23, 2016

共産主義の日常 33



"If painful programming were the most cost-effective way to produce working software, programmers would be morally obliged to suffer stoically or to find other jobs."
"Fortunately, you do not have to choose between pleasure and productivity. The programming techniques that make code a joy to write overlap with those that most efficiently produce software."

どっかの誰かに聞かせてやりたい ITドカタが正義な国だと無理か....
本気で overlap with じゃなくてconflict with とか most efficiently じゃなくて the matter of preference とか思ってそう... そういう場所がうじゃうじゃあるので、精神を病む人が多い業界になってしまっている 業界を挙げてそもそも誇れないのに、業界のしがらみもクソもない。個人的に「職業プログラマー」という言葉は恥ずかしい単語だと考える「割り切り」みたいだ

エンジニアの職場環境や理念として、「楽しく」「生き生きと」「新しいものを積極的に取り入れ」「可能な限り楽をしようとする」という大原則から大幅に外れることがあってはならない。「新しい言語は覚えたくないけど大変なことをするのは得意です」って人をあまりにも多く見てきた。そんなエコシステムが生み出す幸福などありえない。デスマーチの根本原因だ。気づいてない。昔「私はphpに明るくない」なんてことを言われたりもしたが、phpなんて覚えるのに2、3時間もかからない。その2, 3時間を惜しむ意味がわからない。だから仕事量が増えている。Java をJavaでリプレイスする意味もわからない。明らかに金をドブに捨てている。一つの言語を覚える時間の方が、無駄な仕事をたくさん量産してデスマーチに突っ込んで、毎日意味もなく10時まで居残って仕事をするよりも結果的に、等比級数的に、時間も工数もcost-effectiveである。


class Model1 {
    * 顧客ナンバー
  public String empNo() ;

   * 日付更新追加区分
  public String dtUpdWCtgr();

  @annotation3(size = 3)
    * 日付フラグ二次長
  public String dtFlgNxtLen();


   * 顧客ナンバーをセットする
  public void setEmpNo(String empNo){
     this.empNo = empNo;

 / *
   * 顧客ナンバーを取得する
  public String getEmpNo(){
      return this.empNo;

    * 日付更新追加区分をセットする
  public void setDtUpdWCtgr(String dtUpdWCtgr){
     this.dtUpdWCtgr = dtUpdWCtgr;

 / *
   * 日付更新追加区分を取得する
  public String getDtUpdWCtgr(){
      return this.dtUpdWCtgr;

 / *
   */   public void setDtFlgNxtLen(String dtFlgNxtLen){
     this.dtFlgNxtLen = dtFlgNxtLen;

 / *
   * 日付フラグ二次長を取得する
   */  public String getDtFlgNxtLen(){
      return this.dtFlgNxtLen;




だから例えば誰かのつるのひとこで日付フラグ二次長 じゃなくて 日付フラグ二次って名前に変えてー と言われたら関連するとこを全部洗い出して一個一個手で変えていかないといけない。そんなのが半永久的に降ってくる感じ



ファイル名 : model1.dsl
employeeNumber             | S  |   顧客ナンバー             |  @annotation {1,2,3} | @action {}
categoryOfUpdatedDate   |  I  |  日付更新追加区分    |   @annotation {4,5  } |  @action {x}
dateFlagSecondaryLength | I | 日付フラグ二次長    |   @annotation {1,2,3}| @action {}

class <T> ReadData {
    public  T get(String key, Integer index,  List<T> options){
        List<String> values = ReadDsl.getDSL(FILE_PATH).getValues(key);
        return assignValueWithType(values.get(index), values.get(1));

    public void set(String key, Integer index, List<T> options){
        // set  

    public Tuple getAll(Integer index){
        Tuple t = new Tuple(); 
        ReadDsl.getDSL(FILE_PATH).getAllValues(index){ (value, type) =>
             t.add(assignValueWithType(value, type));
        return t;

   public void setAll(Integer index){
        // set all

    public assignValueWithType(String value, String type){
        switch (type){
           case "S":
               return value.toString();
           case "I":
               return value.toInteger();
               throw Exception();


class ReadDsl{
    public static Map<String, List<String>> getDSL {
         // parse model1.dsl into multi-dimentional array
         // convert array into map
         // return map









Friday, October 21, 2016


菅野契 a.k.a. Keita Roimo | Track 怨念


It was the last day of attending my current company

I am so glad to be part of the new company.  

I've read part of the codes provided as open source, and these were really sophisticated, smart, intellectually stimulative,  and makes me excited.

Probably I am weird in my own country for indigenous language often looks nothing but contraption, for instance, I had to convert each indigenous documents or conversations into international one for it is really hard to process logically in my cranium originally.

Sometimes I encountered with a sort of culture shock in Japanese technical community, for they have their own indigenous customs. They loved excel. Verbose coding. Verbose document handling.

Auto-testing or regression test never existed. They wrote each test cases and corresponding dataSets, expectations, and commands in excel spread sheets. It was totally insane for me so I personally implemented regression test in Python. (terminal-base development is worthy because it is easy to be automated).

If you have thousand test cases, these have to be examined with a single hit of Enter button, nothing more, nothing less. If the labor or academic approach to eliminate the repetitive manual operations is spared, and if the expert guy who is so good at handling bulk of manual repetitions would be regarded as "bonus est", the workplace is never gonna be an ecosystem attractive to highly-skilled or well-sophisticated developers/engineers, in my arrogant opinion.

I am sloppy guy, my cranium forgets details often. But because of this biological facts, my development and coding never trust human memory. It always take the possibilities of human errors into account. This is my belief in coding.

Productivity is correlated with the laziness. You do not want to repeat something, then you make something as script. You do not want checking errors, then you simulate the review process with coding.

If you are not lazy, you never question what you are doing. You never question the repetition and bulk of operations and information which you keep in your cranium.

Code syntax have to be precisely written because you are lazy enough not want to memorize these.
If you gonna memorize these bulk of information, you are bureaucratic Japanese Software Engineer.

If there is the following database (example):

Table : SALES
Column1: BALANCE
Column2:  INCOME
Column3:  EXPENSE


In Japan, you see the following syntax:

Tables: URIAGE


... This occurs everywhere and the reason why thousands of failures and unnecessary extra work hours of my people happens is this indigenous way of syntax. (I know the abbreviation required sometimes, but the flood of Japanese abbreviations collapses everything)

Excel, Excel, Excel... Many Japanese Engineers are totally religious to excel.  Often misspelled and misused English terms are found anywhere and allows verbose coding, on the other hand, their mindsets are very precise and detail-nazi (but write the same code everywhere at the same time). It is one of the biggest problem in our indigenous technical society.

Tuesday, October 18, 2016

Project Maturi: まだ開発段階ですが.... インストーラを追加しました

Project Maturi: まだ開発段階ですが.... インストーラを追加しました: まだ version 0.0 ですが、 対象OS MaxOSX 10以降 1. インストーラの追加  2. Firefoxブラウザの簡易参照機能の追加(オマケ機能) 3. READM...





(1) 核心に迫らない(核心は一番最後の情報商材を買え、ということ)

(2) いかにもそれっぽいことを非論理的にグダグダ並べることで視聴者の知覚を混乱させ、 振り回すこと。

(3) 中身の薄っぺらい情報の切れ端のパッチワークであること。

(4) 文字をただ羅列して右から左に流していくことであえて論理的にわかりにくくさせること


1. 何を言いたいかの総括 (Summary)

2.  総括の詳細 (Body)

3. 結論、1.から逸脱しないパラフレーズ (Conclusion)









社会貢献しようよ..... と思うおじさんであった





「チャンス待ち型 」と「しっかり計画する型」なら後者が上手くいく、とかそこらの小学生の坊やでもわかることじゃないのか?それで金を取る?んんん?



Wednesday, October 12, 2016






 (1) 小便時、貞操帯が最大限汚れない
 (2) 大便時、貞操帯が汚れない(貞操帯が肛門までリーチしない)
 (3) 皮膚との親和性(湿度や摩擦によりむれないこと、皮膚を傷めないこと)
 (4) 可能な限り軽量であること
 (5) 壊すのに時間がかかること
 (6) 上から下着を履けること(目立たないこと)
 (7) 着用者自らが、好きな時にとりはずしできること。(認証による)

 (8) 破壊を察知すると、ネットワーク経由で通信し、GPSなどから場所を特定して警察に通報、関係者にも即時アラート
 (9) 破壊を察知すると、大音量が鳴る(アラート機能)


一見アホみたいに見えるが、 6, 7まで巻き込むとバカにできないくらい犯罪被害が減少すると思う








Monday, October 10, 2016

CLIP STUDIOのアニメーションを使ってみた



Sunday, October 9, 2016

Project Maturi: Maturi、全体の概要(要件定義Requirement)

Project Maturi: Maturi、全体の概要(要件定義Requirement): (1) 現状 EMPLOYEE(被雇用者)は、書類を作成や更新を行う際、一つのドキュメントあたりWの仕事(手間)をするとする。 そして、 Wを W' (作成そのもの)と W''(セルフチェック)に分解することができる。 W = W' ...

Saturday, October 8, 2016





(1)マイクロソフト系の非常に機械処理のしにくいデータを Rubyの "yomu" というライブラリを使用して読み込みます

(2) レビュアーのおっさんの脳みそを、機械的に実装します(DSLとかパターンマッチングでアプローチ)

(3) 叱る

(4) 自動で量産しなきゃいけないところはある程度肩代わりしてあげる


そこで価値のないレビューやレビューバックの時間(無駄な工数稼ぎ、詐欺) が起こります。








How to set up tmux pane resize option (OSX)

 you gonna add below to your .tmux.conf file:

set-option -g prefix C-s
bind j resize-pane -U 2
bind k resize-pane -D 2
bind h resize-pane -L 2
bind l resize-pane -R 2

C means simply control-key.

in your .tmux.conf file.

then you gonna reload the tmux for it is not automatically going to be reloaded:

$ tmux source-file .tmux.conf


If you push button [Control + s(meta key)] then [ j] , your pane is going to move upwards by 2 degrees.

Else, the same


菅野契 a.k.a. Keita Roimo | 足袋 -tabi -

Sunday, October 2, 2016

How creation works

  Fyodor Dostoyevsky noted in one of his novels, people are generally defined in two categories, one is the people who are good at ordinary work, the other is who are proficient in generating/creating/innovating something.
  Of course, each feature has degrees and parameters and the tendency of single person's character is defined as product of these two. Tbh, it is sometimes hard for me to put so much information provided via the verbal communication into my cranium, rather, I prefer document as catalyst to transfer info.
  Creativity is a feature hard to evaluate its quantity, even quality. However, the mechanism of creativity could be described to some extent.
   Creativity, as well as Ordinal Output is analogous to and part of the system of biology, that is, it contains "rationality" in nature. It is normally corresponding to the environment. It is a solution. Creativity is uniqueness. Race is one good example of creativity, which is a collection of necessity and attitude to the external world/needs. Race itself is deducted into a bundle of features. Male in general have to be bigger than female because male has to face with the external violence directly. Spicy food is part of creativity for they had to preserve it from serious deterioration.
  Therefore creativity is part of our DNA, creativity is sort of extension to meet the demands in the severe animal world and complicated human societies, so it is not whimsical in general, but necessary. We, human race has been survived through the attitude named as "diversity", some selected and some survived. Art is sometimes able to be regarded as byproduct or, main function to drive another part of human activity into evolution.

  Creation has following process:
1) Inputs
2) Idea enhancement
3) Expression of idea
4) Self-Consumption  & Criticizing/Evaluation
5) Modification of the expression
6) Repetition of the 4) - 5)
7) Launching

If team is involved, the discussion phase would be added to above.

Creativity has goals. It is simply rephrased as a <key-value> pairs of issue-and-solution. We have issue, then create, to solve.

The creativity is evaluated as follows:

1) How many people consume your expression?
2) How much you can earn by it?
3) How far the product affects society? (Politics, Culture, Religion, Public Mood, etc...)

 My point is creativity could be evaluated in quantity. For it is one aspect of human/animal nature, it is closely related with social evolution and selection, therefore has great impact on our society. Please be nice to be creators! (This is the message to Japanese society....)