This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function IsAllHiragana(cell) | |
Set REG = CreateObject("VBScript.RegExp") | |
REG.Pattern = "^[ぁ-んー]+$" ' there are a couple of more hiragana in unicode, which are ignored | |
Set REGMatch = REG.Execute(cell) | |
If REGMatch.Count > 0 Then | |
IsAllHiragana = True | |
Else | |
IsAllHiragana = False | |
End If | |
End Function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.io.Source | |
// Read CSV create and create Map | |
object DictSource2SeedDict extends App { | |
val csvFile = Source.fromFile("file_path", "utf8") | |
val listDict = Map(csvFile.getLines.toList.map{l => | |
val lc = l.split("\t") | |
(lc(0)->lc(1)) // assume first field is key and second field is value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function MD5Hex(textString As String) As String | |
Dim enc | |
Dim textBytes() As Byte | |
Dim bytes | |
Dim outstr As String | |
Set enc = CreateObject("System.Security.Cryptography.MD5CryptoServiceProvider") | |
textBytes = textString | |
bytes = enc.ComputeHash_2((textBytes)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on 2017/5/25 | |
@author: itakura | |
"Unicode <-> str 変換関連" | |
""" | |
class strutils: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
from boto3.session import Session | |
import time | |
from datetime import datetime | |
import calendar | |
def get_log_events(log_group): | |
"""Generate all the log events from a CloudWatch group. | |
thanks to https://alexwlchan.net/2017/11/fetching-cloudwatch-logs/ | |
:param log_group: Name of the CloudWatch log group. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import matplotlib.pyplot as plt | |
import ipywidgets as widgets | |
# from IPython.core.debugger import set_trace | |
# To run in JuptyerLab, you need to run following in console to enable interactive | |
# jupyter labextension install @jupyter-widgets/jupyterlab-manager | |
class PhotoCapture(): | |
""" | |
Catpture image by camera |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Firestore} from "@google-cloud/firestore"; | |
import fs from "fs"; | |
const firestore = new Firestore(); | |
const keyOriginalPath = "__originalPath__"; | |
const keyDocumentContent = "__documentContent__"; | |
const keyCollectionPath = "__collectionPath__"; | |
const keyCollections = "__collections__"; | |
const keyDocument= "__document__"; | |
if(process.argv.length !== 5){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.truth.Truth.assertThat // https://truth.dev/ | |
import junit.framework.TestCase | |
import kotlinx.coroutines.* | |
import org.junit.Test | |
class SampleAsyncTest : TestCase() { | |
suspend fun sampleFunctionToTest(): String { | |
delay(1000) | |
return "failure" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
import os | |
# Helper functions | |
def pickle_them(pickle_file, *objs): | |
print(f"saving to {pickle_file}") | |
with open(pickle_file, 'wb') as f: | |
for obj in objs: | |
pickle.dump(obj, f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# helper function to matplotlib subplots make pretty and easy to handle. | |
# | |
from matplotlib import pyplot as plt | |
plt.style.use('default') # To avoid chart invisible, due to browser theme etc. | |
# Create raws x cols square subplots, fits to given width | |
# returned axes is 1D array, so that easily handle with simple loop |
OlderNewer