演算子 | 種類 |
---|---|
+,-,*,/ | 加算,減算,乗算,除算 |
&,|,^ | 論理演算(and,or,xor) |
\ |
割り算の余り |
=,<,>,! | 条件式(同じ,小さい,大きい,同じでない) |
This file contains hidden or 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
def print_attrs(value): | |
from functools import reduce | |
mro = type(value).mro() | |
attrsets = [set(dir(x)) for x in mro] + [set()] | |
ownattrsets = [x - attrsets[i+1] for i,x in enumerate(attrsets) if i < len(mro)] | |
for type_, ownattrset in zip(mro, ownattrsets): | |
print(type_.__name__) | |
print(' ', list(ownattrset)) |
This file contains hidden or 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
javascript:(()=>{ | |
const orders = Array.from(document.querySelectorAll('#ordersContainer > .order')); | |
let records = orders.flatMap(order => { | |
const id = order.querySelector('.yohtmlc-order-id .value').textContent.trim(); | |
const date = order.querySelector('.a-span3 .value').textContent.trim(); | |
const total = order.querySelector('.yohtmlc-order-total .value').textContent.trim(); | |
const itemTitles = Array.from( | |
order.querySelectorAll('.yohtmlc-item > .a-row:nth-child(1)')). | |
map(e => e.textContent.trim()); |
This file contains hidden or 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
#define global _while(%1) repeat : if (%1) == 0 : break | |
#define global _for(%1,%2=0,%3=0,%4=1) %1=(%2) %c repeat %c if cnt {%1+=(%4)} %c if (%1) == (%3) {break} | |
mes "break/continueを使えるwhileのサンプル" | |
i = 0 | |
_while i < 4 | |
mes i | |
i++ | |
loop |
This file contains hidden or 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
# usage: | |
# python main.py --loglevel <level> | |
# | |
# level: | |
# CRITICAL | |
# ERROR | |
# WARNING | |
# INFO | |
# DEBUG |
This file contains hidden or 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
{ | |
"version": 1, | |
"disable_existing_loggers": false, | |
"formatters": { | |
"default": { | |
"format": "%(levelname)s:%(name)s:%(message)s" | |
} | |
}, | |
"handlers": { | |
"console": { |
This file contains hidden or 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
Sub IterateThroughTableContainingMergedCells() | |
Dim t As Table | |
Dim i As Long | |
Dim j As Long | |
For i = 1 To ActiveDocument.Tables.Count | |
Set t = ActiveDocument.Tables(i) | |
Debug.Print "Table(" & i & "): rows=" & t.Rows.Count & ", columns=" & t.Columns.Count |
This file contains hidden or 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
@echo off | |
if "%~1" == "addpath" goto ADDPATH | |
if "%~1" == "help" goto HELP | |
if "%~1" == "-h" goto HELP | |
if "%~1" == "--help" goto HELP | |
if "%~1" == "/?" goto HELP | |
if "%~1" == "-?" goto HELP | |
goto :EOF |
This file contains hidden or 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
@explorer shell:RecycleBinFolder |
This file contains hidden or 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
Sub 指定したシートにジャンプ() | |
Dim SheetPattern As String | |
Dim s As Variant | |
SheetPattern = LCase(InputBox("シート名を入力", "指定したシートにジャンプ", "")) | |
If SheetPattern = "" Then | |
Exit Sub | |
End If | |
For Each s In ActiveWorkbook.Sheets |