Skip to content

Instantly share code, notes, and snippets.

おちラボ ochilab

Block or report user

Report or block ochilab

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ochilab
ochilab / firebaseClientCredential.py
Created Mar 30, 2020
PythonでFirebaseを用いる際のサービスアカウント情報の設定
View firebaseClientCredential.py
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
import os
#環境変数
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = './xxxxx-credentials.json'
#credentialsの読み込み
cred = credentials.Certificate('xxxxx-credentials.json')
@ochilab
ochilab / tkOpenCVCamera.py
Last active Mar 9, 2020
Tkinterでのカメラ映像表示
View tkOpenCVCamera.py
root=tk.Tk()
root.title("RGB Recorder")
root.geometry("800x600")
root.resizable(width=False, height=False)
canvas=tk.Canvas(root, width=640, height=480, bg="white")
canvas.pack()
def update():#update
global img
global camera
@ochilab
ochilab / opencvCameraRecord.py
Last active Mar 6, 2020
Python: OpenCVでウェブカメラ表示と録画
View opencvCameraRecord.py
#!/usr/bin/env python
from PIL import Image
import cv2 as cv
# FPS
fps = 30
# Frame size
WIDTH=1920
HEIGHT=1080
size = (WIDTH, HEIGHT)
@ochilab
ochilab / csvRead.py
Created Mar 6, 2020
Python: CSVデータのファイル書き読み処理
View csvRead.py
import csv
#読み込み
with open('sample.csv') as f:
#リストとして読み込み
csvdata = csv.reader(f, delimiter=',') #delimterの指定はなくてもよい
for row in csvdata:
print(row)
@ochilab
ochilab / realsenseSimpleViewer.py
Created Feb 17, 2020
RealsenseでRGBとデプスの映像を表示する
View realsenseSimpleViewer.py
import pyrealsense2 as rs
import numpy as np
import cv2
# Realsenseの設定
config = rs.config()
config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30)
config.enable_stream(rs.stream.color, 640, 480, rs.format.bgr8, 30)
# 開始
@ochilab
ochilab / SetPhonetic.vbs
Created Feb 4, 2020
Excelでルビ振り設定をする
View SetPhonetic.vbs
Sub test()
With Range("A1:A10")
.SetPhonetic
.Phonetics.Visible = True
End With
End Sub
@ochilab
ochilab / removeDuplicate.gs
Created Jan 8, 2020
GASで重複チェックをしながらファイル名リストを保存する(種類をPDFファイルに限定)
View removeDuplicate.gs
var exist ={}; //重複チェックするための連想配列
var pdfList=[];
for(i in files){
var tmp = files[i].getName();
if(!exist[tmp]){ //重複してなければ
exist[tmp]=true;
//PDFファイルでかつファイルサイズが0以上のもの
if(files[i].getMimeType()=="application/pdf" && files[i].getSize()>0){
pdfList.push(tmp);
}
@ochilab
ochilab / modifyEnterCode.gs
Last active Nov 7, 2019
改行コードを修正する(コピペした英文をグーグル翻訳かける前の前処理用)
View modifyEnterCode.gs
function modifyEnterCode(str){
//改行削除
str = str.replace(/\r?\n/g, '');
//ピリオド修正(ピリオド後のスペース削除)
str = str.replace(/\.\s/g, '.');
//連続スペース削除
str = str.replace(/\s\s+/g, ' ');
//ピリオド後の改行処理
str = str.replace(/\./g, ".\n");
return str;
@ochilab
ochilab / MaterialDesignApp.xaml
Created Oct 25, 2019
MaterialDesignInXamlToolkitを適用するためのApp.xamlの書き方
View MaterialDesignApp.xaml
<Application x:Class="TestMaterial.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:TestMaterial"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
@ochilab
ochilab / materialdesignMainWindows.xaml
Created Oct 25, 2019
MaterialDesignInXamlToolkitを適用するためのMainWindows.xamlの書き方
View materialdesignMainWindows.xaml
<Window x:Class="TestMaterial.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:TestMaterial"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
You can’t perform that action at this time.