Instantly share code, notes, and snippets.

View generateQrRodeURL.gs
/**
msg:QRコードに埋め込む内容
fileName:ドライブに保存する
**/
function generateQrRodeURL(msg,fileName) {
var image, response;
response = UrlFetchApp.fetch("http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=" +msg); //
image = response.getBlob().setName(fileName + ".png");
var url =GetSavedImageID(image);
return url;
View nat-masquerade-ftp.txt
nat descriptor masquerade static 201 2 192.168.0.21 tcp 21
ip filter 101081 pass * 192.168.0.21 tcpflag=0x0002/0x0017 * 21
ip filter dynamic 202 * 192.168.0.21 ftp
View nat-masquerade.txt
#サーバー1用
nat descriptor type 200 nat-masquerade
nat descriptor address outer 200 XXX.XXX.XXX.10
nat descriptor address inner 200 192.168.0.10
nat descriptor masquerade static 200 1 192.168.0.10 tcp 80=80
#サーバー2用
nat descriptor type 201 nat-masquerade
nat descriptor address outer 201 XXX.XXX.XXX.11
nat descriptor address inner 201 192.168.0.11
View showJpFontCharOpenCV.cs
var img = new Mat(500, 500, MatType.CV_8UC4, new Scalar(0, 0, 0));
var bitmap = new System.Drawing.Bitmap(200, 100);
Graphics g = Graphics.FromImage(bitmap);
//フォントオブジェクトの作成
Font fnt = new Font("MS UI Gothic", 20);
g.DrawString("日本語。", fnt, Brushes.Red, 0, 0);
var img2 = bitmap.ToMat();
View model_show.py
!apt-get -qq install -y graphviz
!pip install -q pydot
## 上記はGoogle Colabotratory用の設定コマンド
from IPython.display import SVG,display_png,Image
from keras.utils.vis_utils import model_to_dot
from keras.utils import plot_model
#<略>
View settings.yaml
save_credentials: True
save_credentials_backend: file
save_credentials_file: credentials.json
View PIL2CV.py
pil_image = Image.open('C:\\Users\\ochi\\temp\\lenna.jpg')
cv_image = cv2.cvtColor(np.array(pil_image) , cv2.COLOR_RGB2BGR)
cv2.imshow("cv_image",cv_image)
cv2.waitKey(0)
View openMultiTiff.py
from PIL import Image
# Tiff画像を読み込む
image = Image.open('C:\\Users\\ochi\\temp\\sample2.tif')
#ページ数を求める
fLength =image.n_frames
#1ページずつ抜き出して処理
for i in range(0,fLength+1):
image.seek(1)
sImg =image.copy()
View SampleFirstOpenCVPython.py
# -*- coding: utf-8 -*-
import numpy as np
import cv2
# 元の画像を読み込む
img = cv2.imread('C:\\Users\\ochi\\temp\\lena.jpg',cv2.IMREAD_UNCHANGED)
#Matのコピー(クローンみたいなもの)
img2 = img.copy()
View PropertySample.py
class prop:
__x=100
def getX(self):
return self.__x
def setX(self,value):
value=value+1
self.__x=value
x=property(getX,setX)