It looks like nothing was found at this location. Maybe try one of the links below or a search? Search for:
It looks like nothing was found at this location. Maybe try one of the links below or a search? Search for:
動機 ふと思い立った。簡単なサンプルを書いたつもりだったけど、思わぬところでちょっとはまったからメモ。 方法 サンプルコード 基本的にはこちらの写経。 PythonからCプログラムを呼び出す | 象歩 Cのラッパを書いたのは2度目だけど、前回はバインディング部分はほとんど書いてなかったし、そもそもMacではなかったんで今回は新鮮。コードは上記サイトがなくなった時のために写させてもらいます。 test.c #include <stdio.h> int add(int x, int y) { return x + y; } void out(const char* address, const char* name) { printf("こんちはー、おいどんは%sの%sです。\n", address, name); } testWrapper.c #include "Python.h" ext
こんにちわ、あらびきプログラマー moriyoshi です。 Python が生理的に嫌いな人からよく聞く話として「インデントでブロック構造を表す」ってのがありますね。じゃあ中身はそのままで文法だけ Ruby っぽくしたらどうなるんでしょうかね。Python はトークナイザもパーサも簡単に書き換えられるので、試してみましょう。 例えば次のようなプログラムは class Boo(object): def foo(hoge): try: for i in hoge: with i: if i.fuga: while True: j = i.fuga() if not j: break print j + 2 except HogeException: pass else: pass finally: pass こんな風になってしまうわけです。ああ怖いですね。 class Boo(object)
はてなグループの終了日を2020年1月31日(金)に決定しました 以下のエントリの通り、今年末を目処にはてなグループを終了予定である旨をお知らせしておりました。 2019年末を目処に、はてなグループの提供を終了する予定です - はてなグループ日記 このたび、正式に終了日を決定いたしましたので、以下の通りご確認ください。 終了日: 2020年1月31日(金) エクスポート希望申請期限:2020年1月31日(金) 終了日以降は、はてなグループの閲覧および投稿は行えません。日記のエクスポートが必要な方は以下の記事にしたがって手続きをしてください。 はてなグループに投稿された日記データのエクスポートについて - はてなグループ日記 ご利用のみなさまにはご迷惑をおかけいたしますが、どうぞよろしくお願いいたします。 2020-06-25 追記 はてなグループ日記のエクスポートデータは2020年2月28
日頃より楽天のサービスをご利用いただきましてありがとうございます。 サービスをご利用いただいておりますところ大変申し訳ございませんが、現在、緊急メンテナンスを行わせていただいております。 お客様には、緊急のメンテナンスにより、ご迷惑をおかけしており、誠に申し訳ございません。 メンテナンスが終了次第、サービスを復旧いたしますので、 今しばらくお待ちいただけますよう、お願い申し上げます。
Пинап - топовое онлайн-казино с 2016 года для игроков СНГ. Номер лицензии: №8048/JAZ2018-014 Более 5000 игровых автоматов различных тематик такие как Lucky Streak 3, Bonanza Billion, Aviatrix от ведущих провайдеров (Endorphina, Igrosoft, Play n GO, Playtech, Yggdrasil). Игра на ПК, смартфоне, демо-режим для новичков. Надежные платежные системы (МИР, Visa, Mastercard, Piasrrix, Neteller, Skrill, As
Open Source Developer, Author, Editor. There’s always room for pie. Error reporting and processing through exceptions is one of Python’s key features. Care must be taken when handling exceptions to ensure proper application cleanup while maintaining useful error reporting. Error reporting and processing through exceptions is one of Python’s key features. Unlike C, where the common way to report er
Django Request Response processing by shabda on June 24, 2009 Have you wondered the steps a users request goes through before being responded to by Django? The answer lies in reading django.core.handlers.base and django.core.handlers.wsgi. Here is a diagram explaining what happens. (Click to enlarge.) The steps are. (With Apache/Mod_wsgi, similar steps for other setup.) User’s request comes to Apa
メモ: ・日本語の取り扱いのめも (ソースコードについて) ・バージョンはruby 1.9.1p129,perl v5.10.0,Python 3.0.1 ・バージョンが古いと動かない ruby perl python ソースコード コード冒頭に文字コード指定 基本的にUTF8で書く コード冒頭に文字コード指定 文字列 オブジェクト毎に文字コード定義 バイナリとUTF8フラグ付き文字列 Unicode文字列のみ 参考 bitclust M17N の設計と実装 Encode入門 perl - use encoding; #は黒歴史 @IT記事 ファイル:utf-8、コンソール:utf-8 Ruby #!/usr/bin/ruby1.9 # coding: utf-8 str = "Rubyで日本語表示。" puts str Perl #!/usr/bin/perl use strict; u
メモ: ・日本語の取り扱いのめも その2(文字列長、バイト長について) ・バージョンはruby 1.9.1p129,perl v5.10.0,Python 3.0.1 ・バージョンが古いと動かない ・ついでに 404 Blog Not Found:perl, python & ruby - chr() vs. Unicode と 404 Blog Not Found:perl, python & ruby - ord() vs. Unicode の情報は古いので、今の書き方を書いとく ruby perl python 文字列長 文字コード指定が正しいなら文字数 utfフラグ付きなら文字数 code unit数(文字数でない)*1 configureで--with-wide-unicodeすれば文字数 ※1ただし、コンパイル時のオプションで変えられるらしい 参照:DSAS開発者の部屋:Pyt
トリビアルな例だが、元の関数(func)をデコレート・ラップするmydecoratorというデコレータを書いた時、下のように単純にinnerを返すと、 def mydecorator(func): def inner(*args, **kwds): print "Hi, I'm inner!" return func(*args, **kwds) return inner @mydecorator def hello(to): """ Say hello to somebody """ print "Hello, %s!" % to if __name__ == '__main__': print repr(hello) print hello.__doc__ 結果として、 None のように、デコレートされた元の関数(hello)の関数名やドキュメント文字列が失われてしまう。デコレータを
(oreorebotみたいに)「url送ったらそのページのタイトルを返してくれるボットが欲しいなぁ」と、某IRCで発言したところ、Perl::POEでサクっと作っていただきました。 でも、作りたい衝動を抑えられず、Twisted baseのIRCクライアントを作ってみました。 ソースコード - azukibot - azuki.py Twisted初心者なので、付属していたサンプルのIRCBotを元にしています。 付属のexamples Twisted-2.4.0/TwistedWords-0.4.0/doc/examples/ircLogBot.py サンプルですでにイベントに対応するメソッドが揃っているので、簡単にイベントドリブンなプログラミングができました。 あとはAPIドキュメントをPythonのプロンプトで >>> from twisted.words.protocols imp
In the world of databases and programming, optimizing your workflow can have a huge impact on your productivity and effectiveness. One area in particular where this holds true is in creating views on MySQL databases. Views are a way to create virtual tables from existing tables or create custom queries that join multiple tables together…. Read More In the age of high-tech advancements, Linux is be
Tutorials: season I Java™ に学ぶ Jython プログラミング入門 Java™ Programming Language〔JPL〕の事例を使って、Java と Jython との違いを学びます。 Tutorials: season II Tutorials - Classes and Objects Java で記述したクラスに対して、Jython は便利な機能を提供します。 Classes and Objects, #1 import 文を利用すると、Jython の世界から、Java で作成したクラスを扱えるようになります。 Classes and Objects, #2 。 Tutorials: season III - Collections Java™ に学ぶ Jython プログラミング入門 Java™ Programming Language〔JPL
Twitterで”bpythonがいい”という書き込みを見たので試してみた。ついでに補完でpythonのプログラミングを楽にする方法を自分のためにメモ。 ところで補完ってのは一般の人に通じそうでない通じないIT用語の筆頭格だよね。 vimを使う場合 pydyctionというvimの拡張機能を使います。僕はここをみながらやりました。 ここからダウンロードして。下の設定をvimrcにいれるだけです。簡単。 " Pydictionを読み込む if has("autocmd") autocmd FileType python set complete+=k~/.pydiction/pydiction iskeyword+=.,( endif " has("autocmd") " python supportが有効ならこれでいけるはず. Mac OSは駄目だった。 "autocmd FileType
CleverCSS is a small markup language for CSS inspired by Python that can be used to build a style sheet in a clean and structured way. In many ways it's cleaner and more powerful than CSS2 is. The most obvious difference to CSS is the syntax: it is indentation based and not flat. While this is obviously against the Python Zen, it's nonetheless a good idea for structural styles. Nutshell To get an
We've launched user accounts at EveryBlock, and we faced the interesting problem of needing to cache entire pages except for the "You're logged in as [username]" bit at the top of the page. For example, the Chicago homepage takes a nontrivial amount of time to generate and doesn't change often -- which means we want to cache it -- but at the same time, we need to display the dynamic bit in the upp
Djangoのサイトには「Djangoの設計思想」というドキュメントがあります。どんなフレームワークでもそうですが、設計思想を理解し、その流れをつかむ事で正しい利用への最短ルートです。もし、自分の思想にあわないならば問題です。可能であれば、そのフレームワークの検討を取り止めるべきでしょう。それが出来ないならば利用している時にはそのフレームワークの思想で思考することが求められます。 Djangoの設計思想は、緩く結合し、必要最低限のコードで、だが隠蔽せずに明示するという事です。DjangoではMVT(モデル/ビュー/テンプレート)と呼ばれるMVCに近い構造をとります。それらの3つのレイヤーはお互いに疎な関係を持ち、モデルとテンプレートはデフォルトの実装以外を容易に採用できるようになっています。また、ほどよく規約を適用し必要なコード量は少なくなっていまが、なんでもかんでも裏側で処理せずに、なに
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く