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 mallocNodeSample0.c
// ConsoleApplication1.cpp : アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include <stdlib.h>
// 構造体Nodeの定義
typedef struct _node {
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 showMultiTiff.cs
private void showMultiTiff(string tiffFileName){
FileStream tifFS = new FileStream( tiffFileName , FileMode.Open , FileAccess.Read ) ;
Image gim = Image.FromStream( tifFS ) ;
FrameDimension gfd = new FrameDimension(gim.FrameDimensionsList[0]);
int pageCount = gim.GetFrameCount( gfd ) ;//全体のページ数を得る
System.Diagnostics.Debug.WriteLine(pageCount);
Graphics g = pictureBox1.CreateGraphics();
for(int i=0;i<pageCount;i++){
gim.SelectActiveFrame(gfd, i);
g.DrawImage(gim, 0,0, pictureBox1.Width, pictureBox1.Height);//PictureBoxに表示してます
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()