ホットトピックス インスタは批判の嵐、YouTubeは強化、TikTokは鈍化。大混戦「短編動画」市場のゆくえ
ホットトピックス インスタは批判の嵐、YouTubeは強化、TikTokは鈍化。大混戦「短編動画」市場のゆくえ
Years ago John Aycock's SPARK introduced the idea of using docstring to store the pattern and rule definitions for a parser generator. Rather, that's where I first heard of it; someone else could have been first. Here's part of the scanner definition from Biopython for parsing GenBank locations: def t_caret(self, input): r" \^ " self.rv.append(Token("caret")) def t_comma(self, input): r" \, " self
[[ Spyce ]] Web development is fun again! Spyce will not waste your time with Clunky code reuse constructs XML, YAML, or a templating language you've never seen before; everything is Python Manually accessing GET and POST page parameters Writing boilerplate code for form validation Editing multiple files for each user-visible page Writing SQL queries by hand Rolling your own authentication framewo
rubyco(るびこ)の日記 - 呼び出し側のアスタリスクを読んで、「あ、そうか、それを使えば頭から二つずつ取ることができるか」とGame Scripting Memo - 続・パスカルの三角形のことを思い出しました。 >>> def get2(f, a, b, *rest): result = [f(a, b)] if rest: result += get2(f, *rest) return result >>> from operator import add >>> def dup(aList): return reduce(add, [[v, v] for v in aList]) >>> dup([1,2,3]) [1, 1, 2, 2, 3, 3] >>> def sandwich(bread, meat): return [bread] + meat + [bread] >
驚きました。 rubyco(るびこ)の日記 - デフォルト引数は明示的に評価されると同じことをPythonで書いた場合、関数定義の時点で評価されます。 >>> def default(n): print "default", n return n + 1 >>> def foo(x, y = default(5)): print x, y default 5 Rubyでは関数が呼ばれた時にデフォルト引数を評価するようです。しかも遅延評価とかではないようで、何度も関数を呼べば何度も実行されます。つまりPythonで書けば >>> def foo(x, y = None): if y == None: y = default(5) print x, y に相当する状態のようです。
Many people use Python because, like other scripting languages, it is a portable, platform-independent and general-purpose language that can perform the same tasks as the database-centric, proprietary 4GL tools supplied by database vendors. Like 4GL tools, Python lets you write programs that access, display and update the information in the database with minimal effort. Unlike many 4GLs, Python al
沖ソフトウェア株式会社は、沖通信システム株式会社および株式会社沖インフォテックと平成22年10月1日をもって合併いたしました。新会社名は、株式会社OKIソフトウェアとなります。3社が行っております事業は新会社にて従来通り継続いたします。
Closures in Python (part 1) Martin Fowler (obligitary Fowlbot namedrop) recently blogged about the power of closures in languages that support them. Here's a translation of Martin's Ruby code into Python. [Initial sentence and table structure copied from Joe Walnes] (not knowing how to get this to format correctly is my fault. I want to write a part 2, but that'll have to wait as I have other comm
How to Think Like a Computer Scientist Learning with Python 2nd Edition by Jeffrey Elkner, Allen B. Downey and Chris Meyers illustrated by Udit Bhatnager and Chris Schmeelk Foreword Preface Contributor List Chapter 1 -- The way of the program Chapter 2 -- Variables, expressions, and statements Chapter 3 -- Functions Chapter 4 -- Conditionals Chapter 5 -- Fruitful functions Chapter 6 -- Iteration
お知らせ: 最近の事情に合わせて新しく書き直した「さくらのレンタルサーバに Python モジュールをインストール」のページを用意しました。今後はまずそちらをご参照下さい。(2013年2月8日) さくらインターネットの「さくらのレンタルサーバ」サービスで Python の外部モジュールを導入・利用するための覚え書きです。 イントロダクション 外部モジュールをホームディレクトリ下にインストールする インストールした外部モジュールをインポートする シェルから使う CGI から使う まとめ おまけ:CGI プログラムが動かない…… スクリプトの改行コードを確認する 改訂履歴 免責・ライセンス イントロダクション さくらインターネットのホスティングサービス、「さくらのレンタルサーバ」では、CGI として Python を利用できます。Python には標準モジュールのほかにも、PyPI などで豊富
毎回実装するのがさほど苦にならないので、ついつい毎回実装してしまったりするタブ区切りデータの出力ですが、やっぱりたまに改行をつけ忘れたりstrで文字列にするのを忘れたりすることがあるので、まとめてみることにしました。 class TSVFile(file): def write(self, v): file.write(self, "\t".join(map(str, v)) + "\n") これは普通のfileを継承して、writeだけ独自のものに差し替えたクラスです。こうすると、以下のように普通のファイルを扱っている気分で、タブ区切りでの出力が出来ます。 fo = TSVFile("c:\\test.txt", "w") fo.write((1,2,3)) fo.write((4,5,6)) fo.close() ただし、タブ区切りじゃなくてカンマ区切りでもよくて、数字やアルファベット
Python-jpのchmファイルを見ようと思い、http://www.python.jp/Zope/ から、chmファイルをDLする。 が、何でか知らないが表示しない。orz Python23jp.chm Python234jp.chm …おい。表示しねぇぞ。 慌てて、他のchmファイルを表示させるが、ちゃんと表示されるな。どうやら ここでリリースされたファイルのみ異常なようだ。 (MSKBに対応方法書いてなかったっけ?一応調べてみたんだが うまくいかんので諦めた) しょうがないので、 pdf版をDLする…。見難い(印刷すりゃいいんだろうが)。 info版…。見方知らない。 html版…。検索しにくい。 だめじゃん。 段々腹が立ってきたので、自分でCHMファイルを作る事にする。幸い、やり方は ここに書いてある。 [Python-doc-jp 1319] Re: 翻訳ドキュメントのchm
NISHIO Hirokazu's website > NISHIO HIROKAZU # Archived COREBlog これは2004年11月4日から2006年2月18日までZopeで運用していたCOREBlogの静的なアーカイブです。 新しい日記は「西尾泰和の日記」で運用しています。 Pythonでメモ化 結城さんの日記を読んで「メモ化って何だろう」と思いました。 もともとのK.Inabaさんのエントリは読んでみたけれどもメモ化の説明はなかったのでよくわからず…nobsunさんによる、HaskellのMemoiseにはメモ化の説明が書いてありました。 ふむふむ、つまり再帰的に定義されたフィボナッチ関数を呼び出すと、同じ引数で同じ関数が何度も呼び出されて効率が悪い、と。 def fib(x): print "fib(%d) was called" % x if x == 0 or
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く