- bool: 真偽値 (
true
またはfalse
) を表します。 - int: 整数型を表します。
- long: 長整数型を表します。通常、intよりも大きい値を扱う際に使用されます。
- real: 浮動小数点数型を表します。
- decimal: 10進数型を表します。高精度な小数点数計算に使用されます。
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 datetime | |
import time | |
total = 60 | |
total_width = len(str(total)) | |
s = datetime.datetime.now() | |
while True: | |
c = datetime.datetime.now() | |
t = int(total - (c - s).total_seconds()) | |
if t <= 0: |
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
// Require `PhoneNumberFormat`. | |
const PNF = require('google-libphonenumber').PhoneNumberFormat; | |
// Get an instance of `PhoneNumberUtil`. | |
const phoneUtil = require('google-libphonenumber').PhoneNumberUtil.getInstance(); | |
function test(text) { | |
// Parse number with country code and keep raw input. | |
let number = phoneUtil.parseAndKeepRawInput(text, 'JP'); | |
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 pptx | |
from pptx.enum.shapes import MSO_SHAPE_TYPE | |
import os | |
# extract all images in the pptx file | |
def extract_images(pptx_path, output_dir): | |
i = 0 | |
ppt = pptx.Presentation(pptx_path) | |
for slide in ppt.slides: |
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
# HMAC with SHA-256 | |
def sha256(message): | |
# SHA-256 implementation | |
import hashlib | |
return hashlib.sha256(message).digest() | |
def xor(a, b): | |
# XOR two byte strings | |
return bytes([x ^ y for x, y in zip(a, b)]) |
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
# メッセージをビット列に変換する関数 | |
def message_to_bitstring(message): | |
bitstring = "" | |
for char in message: | |
# ASCII コードを 8 ビットのビット列に変換する | |
bit = bin(ord(char))[2:].zfill(8) | |
bitstring += bit | |
return bitstring | |
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
""" | |
This is a sample to call API management operation with OAuth based on Azure AD. | |
""" | |
import msal | |
import logging | |
import requests | |
if __name__ == "__main__": |
WhatWG(Web Hypertext Application Technology Working Group)は、ウェブ技術の進化と標準化に関するグループであり、主にHTMLと関連するテクノロジーの開発と標準化に取り組む組織です。WhatWGは、特にHTML5仕様の開発を主導し、ウェブブラウジング体験を向上させるための新機能や改良を提案・実装してきました。
一方、W3C(World Wide Web Consortium)は、国際的な標準化団体であり、ウェブに関連する技術やプロトコルの標準を策定することを目指しています。W3CはHTMLやCSSなどのウェブ技術の標準を定めており、インターネット上の情報をよりアクセス可能で持続可能なものにするための取り組みを行っています。
WhatWGとW3Cの違いは以下のような点にあります。
特徴 | WhatWG | W3C |
---|
秘密鍵の形式ごとに、使用するクラスが違う(C#)
“BEGIN RSA PRIVATE KEY” => RSA.ImportRSAPrivateKey
“BEGIN PRIVATE KEY” => RSA.ImportPkcs8PrivateKey
“BEGIN ENCRYPTED PRIVATE KEY” => RSA.ImportEncryptedPkcs8PrivateKey
“BEGIN RSA PUBLIC KEY” => RSA.ImportRSAPublicKey
“BEGIN PUBLIC KEY” => RSA.ImportSubjectPublicKeyInfo
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
<!-- | |
When the computer browser shows 2nd and 3rd paragraphs in the same format, | |
but the mobile browser shows 2nd and 3rd ones differently. | |
--> | |
<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body> | |
<p style="line-height: 1em; margin: 1em; background: rgba(0, 0, 0, 0.1);"> | |
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa |
NewerOlder