Skip to content

Instantly share code, notes, and snippets.

#
# 対話モード >>> に
# コピペで実行できます。
#
import bisect
import random
import timeit
#
# 1. 関数を定義
<!--
Quick start - CDN の使用
https://vuetifyjs.com/ja/getting-started/quick-start#cdn-%E3%81%AE%E4%BD%BF%E7%94%A8
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!-- Vuetify が使うフォントの CSS -->
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
#
# そのまま対話モード >>> に
# コピペで実行できます。
#
#
# 再帰的に identity を表示する関数
# Effective Python item 26 を参考にしました。
# http://bit.ly/2HgJAyr
#
#
# そのまま対話モード >>> に
# コピペで実行できます。
#
#
# 浅いコピー copy と深いコピー deepcopy の違いを示します。
#
import copy
import json
@niconico25
niconico25 / highlighter.html
Last active March 2, 2019 08:00
はてなブログでマーカーが引けるようになります。
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.7/dist/vue.js"></script>
<script>
// DOM が描画されるまで待つ
setTimeout(vue, 1000);
function vue() {
new Vue({
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<div id="app">
<header>
<button v-on:click="show=!show">切り替え</button>
</header>
set mouse=a
set clipboard+=unnamedplus
set runtimepath+=/Users/ユーザ名/.cache/dein/repos/github.com/Shougo/dein.vim
if dein#load_state('/Users/ユーザ名/.cache/dein')
call dein#begin('/Users/ユーザ名/.cache/dein')
call dein#add('/Users/ユーザ名/.cache/dein/repos/github.com/Shougo/dein.vim')
" ale に乗り換えたい...
call dein#add('scrooloose/syntastic')
class ClassMethod(object):
"Emulate PyClassMethod_Type() in Objects/funcobject.c"
def __init__(self, f):
self.f = f
def __get__(self, obj, klass=None):
... # ここを実装してください。
def __call__(self, *args, **kwargs):
"""Send an email from Gmail.
Before execute this code, you have some tasks.
1) for temporary
Turn on the flag "Allow less secure apps"
from the follwoing link.
https://myaccount.google.com/lesssecureapps
or
# 偶数だけ取得します。
lst = [1, 2, 3, 4, 5, 6, 7]
new_lst = list(filter(lambda x: x % 2, lst))
print(new_lst)
# [1, 3, 5, 7]