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
function getHeaders(sheet) { | |
var last_col = sheet.getLastColumn(); | |
var range = sheet.getRange(1, 1, 1, last_col); | |
var headers = range.getValues(); | |
return headers[0]; | |
} | |
function getColumnNumByHeader(sheet, header) { | |
var n = getHeaders(sheet).indexOf(header); | |
if (n < 0) { | |
throw Error("ヘッダーが見つからなかった"); |
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
module goquerytrial | |
go 1.14 | |
require github.com/PuerkitoBio/goquery v1.5.1 |
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
from typing import List, Union | |
import unittest | |
from operator import mul | |
Matrix = List[List[Union[int, float]]] | |
def matmul(mat1: Matrix, mat2: Matrix) -> Matrix: | |
return [[sum(map(mul, row, column)) for column in zip(*mat2)] for row in mat1] |
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
from sagemaker.estimator import Estimator | |
from sagemaker.predictor import RealTimePredictor | |
def get_predictor(training_job_name: str) -> RealTimePredictor: | |
""" | |
ジョブ名から RealTimePredictor を取得して返す | |
すでに訓練ジョブ名と同名のエンドポイントがある場合には、エンドポイントから RealTimePredictor を返す | |
Args: |
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
package di | |
import ( | |
"fmt" | |
"time" | |
) | |
func Hogehoge(fn func()) error { | |
// Do something(Heavy process) | |
time.Sleep(2 * time.Second) |
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
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: vscode-settings-configmap | |
data: | |
settings.json: | | |
{ | |
"terminal.integrated.shell.linux": "/bin/bash" | |
} |
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
let backgroundImageToUrl = bgImage => { | |
const url = bgImage.replace('url(', '').replace(')','').replace(';','').replace('"','').replace('"',''); | |
return url.replace(/c\/[^/]+\//,''); | |
} | |
let setupEnlarging = (btn, panel) => { | |
document.getElementsByTagName('figure').forEach(figureElement => { | |
let imageContainer = Array.from(figureElement.getElementsByTagName('div')).filter(e => e.classList.length > 0 && e.style.backgroundImage)[0]; | |
if (imageContainer) { |
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 | |
from pathlib import Path | |
import sys | |
import argparse | |
from shutil import move | |
import random | |
from logging import getLogger, DEBUG, INFO, StreamHandler | |
logger = getLogger(__name__) | |
logger.setLevel(level=DEBUG) |
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
var a = Array.from(document.querySelectorAll("[aria-label='画像']"), x => {return x.querySelectorAll('[style*="background-image"]')}); | |
a.forEach(x => {var s = `[style*='${x[0].style.cssText}']`;var y = document.querySelector(s);if(y){y.style.cssText += "background-size: contain;";y.parentNode.style.cssText = "margin-bottom:auto;"}}); | |
// Array.from(document.querySelectorAll('[style="padding-bottom: 56.25%;"]'),x => x.style); | |
var c = document.querySelectorAll('[style="padding-bottom: 56.25%;"]'); | |
console.log(c.length); | |
var d = document.getElementsByClassName(c[0].className); | |
var e = Array.from(d).filter(x => {return x.className === c[0].className && x.style.cssText === "padding-bottom: 56.25%;";}); | |
e.forEach(x => {x.style.cssText = "padding-bottom: 100%;"}); |
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
abstract sig Object {} | |
sig File extends Object { | |
} | |
sig Directory extends Object { | |
children: Object | |
} | |
// 親オブジェクトは高々一つしかない | |
fact singleParent { | |
all x : Object | lone children.x |