Skip to content

Instantly share code, notes, and snippets.

View naghbIQtIqHom's full-sized avatar

naghbIQtIqHom

View GitHub Profile
@naghbIQtIqHom
naghbIQtIqHom / matrix_production.py
Last active December 18, 2023 00:07
To Generate the N-switch by calculating the nth power of a matrix.
from collections import Counter
def multiply_matrices_symbolic(m1, m2, n):
"""
Multiplies two n x n matrices symbolically, considering empty strings and combining like terms.
Terms that result in '' or '[]' when multiplied are omitted.
:param m1: First matrix as a list.
:param m2: Second matrix as a list.
:param n: Size of the matrices (n x n).
:return: Resultant matrix as a list after multiplication.
@naghbIQtIqHom
naghbIQtIqHom / Dockerfile
Last active August 15, 2023 00:57
for awsclie
FROM python:3
USER root
RUN apt-get update
RUN apt-get -y install locales && \
localedef -f UTF-8 -i ja_JP ja_JP.UTF-8
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8
ENV TZ JST-9
@naghbIQtIqHom
naghbIQtIqHom / look-up-in-perseus-tufts.el
Last active January 19, 2020 04:51
To look up a latin word in Perseus project.
(require 'cl)
(defun perseus-tufts-latin-dictionary ()
"looking up a word in http://www.perseus.tufts.edu/hopper/"
(interactive)
(let ((editable (not buffer-read-only))
(pt (save-excursion (mouse-set-point last-nonmenu-event)))
(original-buffer (current-buffer))
beg end)
@naghbIQtIqHom
naghbIQtIqHom / xmindtodot.py
Last active February 23, 2018 03:22
To generate a nested treemap from a treemap of xmind
# -*- coding:utf-8 -*-
"""
If you use a unix like environment, set an environment variable LANG:
export LANG=ja_JP.UTF-8
Usage:
python3 xmindtodot.py foo.xmind
This command generates dot files and graphviz images for each sheet.
@naghbIQtIqHom
naghbIQtIqHom / install.bat
Last active December 31, 2015 01:08
In order to install tc in Windows without Network or behind proxy with authentic, I write these scripts. Bushu Gōsē Henkan doesn't work. If you know the reason, show me it. All files are put a top directory in the extracted tc-master or cloned from github. To execute install.bat, just double click this batchfile or call in the cmd.exe.
set |findstr ^EMACS= >nul 2>nul
if NOT {%ERRORLEVEL%} == {0} set EMACS=emacs.exe
set |findstr ^LISPDIR= >nul 2>nul
if NOT {%ERRORLEVEL%} == {0} set LISPDIR=%USERPROFILE%\tc\lisp
set |findstr ^DATADIR= >nul 2>nul
if NOT {%ERRORLEVEL%} == {0} set DATADIR=%USERPROFILE%\tc\tcode
set SRCDIR=%~dp0
echo current is %BATCHDIR%.
@naghbIQtIqHom
naghbIQtIqHom / tlhIngan.feature
Last active December 30, 2015 16:58
I'm trying to translate gherkin into tlhIngan Hol and add tlhIngan words into it. I'd like to know any suggestion about keyword translation.
#language:en
feature: Using cucumber in tlhIngan Hol
In order to use tlhIngan Hol for cucumber
As a user
I can write specs and run these specs properly.
Background:
Given some developers translated gherkin words into thIngan Hol,
Scenario: wrting specs in tlhIngan Hol