デザインパターンの中でもわかりやすいTemplate methodパターン。 Rubyによるデザインパターンで紹介されていたコードをpythonで書いてみた。 AbstractClassであるReportの各メソッドの実装はpassにしてあるけど、必ず実装してもらうためにはNotImplementedErrorをraiseするようにする。 # coding=utf-8 class Report(object): def __init__(self, title, *text): self.title = title self.text = text def output_report(self): self.output_start() self.output_head() self.output_body_start() self.output_body() self.output_bo
Overview¶ This document describes how to secure your communications using TLS (Transport Layer Security) — also known as SSL (Secure Sockets Layer) — in Twisted servers and clients. It assumes that you know what TLS is, what some of the major reasons to use it are, and how to generate your own certificates. It also assumes that you are comfortable with creating TCP servers and clients as described
みなさん、こんにちは。GS2の丹羽です。 本日 Game Server Services は次世代版のベータテストを開始しました。 これまで提供していた GS2 を GS2 Classic と呼び、次世代版 GS2 を単に GS2 と呼びます。 gs2.io GS2 のリリースにあたっては非常に多くの新しいチャレンジを行いました。 それについては少しずつブログや登壇を通じて皆さんにお伝えしていきたいと思います。 今回は、GS2 のマネージメントコンソールをシングルページアプリケーションとして作りました。 しかも、Vue + TypeScript に触れて2週間で。というトピックで振り返ってみようと思います。 なぜ Vue + TypeScript にいたったか GS2 Classic のマネージメントコンソールは Google App Engine を使用していました。 弊社はフルサーバレ
B! 35 0 0 0 GitHubで公開されているJupyter Notebookのファイルは ファイルのURLをちょっと変えるだけで直接Google Colaboratoryで開くことができます。 そのちょっと変えることをやるブックマークレットを用意しました。 Bookmarklet for GitHub to Colaboratory Bookmarklet for GitHub to Colaboratory 以下のリンクをブラウザのブックマークツールバーなどに持っていって ブックマークレット化してください。 GitHub to Colaboratory それで例えば最近公開された 東京大学の松尾研究室のDL4USのノート https://github.com/matsuolab-edu/dl4us/blob/master/lesson0/lesson0_exercise.ipyn
I just finished replacing httplib in a very large project, Apache Libcloud. When httplib was selected, requests wasn’t around (it only hit v1 in 2012). We needed to provide a set of base classes that would handle HTTP and HTTPS REST/JSON, REST/XML and various other bizarre HTTP APIs. Libcloud has over 80 client libraries for every major cloud service out there. Each of those libraries share a sing
The Requests library is the go-to package for making HTTP requests in Python. It abstracts the complexities of making requests behind an intuitive API. Though not part of Python’s standard library, it’s worth considering Requests to perform HTTP actions like GET, POST, and more. By the end of this tutorial, you’ll understand that: Requests is not a built-in Python module—it’s a third-party library
scrapper.py ���!�� ��&"�� import asyncio import aiohttp import bs4 import tqdm @asyncio.coroutine def get(*args, **kwargs): response = yield from aiohttp.request('GET', *args, **kwargs) return (yield from response.read_and_close(decode=True)) @asyncio.coroutine def wait_with_progress(coros): for f in tqdm.tqdm(asyncio.as_completed(coros), total=len(coros)): yield from f def first_magnet(page): sou
目的 エラー(例外)が発生した時、自動的にデバッガ「pdb」を起動して、 その時点のスタックフレームや上流階層に逆上って状況の確認がしたい! でも止めたい箇所が分散していていちいちブレークポイント貼ったりステップ実行とかしてらんない! みたいな状況で役に立つデバッグ手法です。 準備 以下をdebug.pyとして保存しましょう。: 1 import sys 2 3 def hook(type, value, tb): 4 if hasattr(sys, 'ps1') or not sys.stderr.isatty(): 5 sys.__excepthook__(type, value, tb) 6 else: 7 import traceback, pdb 8 traceback.print_exception(type, value, tb) 9 print() 10 pdb.pm()
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く