Google App Engine を弄ってるついでに覚えたメモ。 Python なスクリプトからインタプリタを起動するには、
.NET4.0で追加されたExpandoObjectクラスを使うと実行時にメンバーの追加、削除が出来ます。 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Dynamic; namespace DynamicObjectSample { class Program { static void Main(string args) { dynamic foo = new ExpandoObject(); // プロパティの追加 foo.Name = "mei"; // メソッドの追加 foo.Hi = new Action(() => Console.WriteLine("Hi, {0}!", foo.Name)); // メソッドの追加(引数あ
私の調べもの(MS系技術情報)の場合、googleよりもbingの方が良い結果を返すことも多く、最近はもっぱらいbingを使っていたりします。Bing API 2.0のリファレンスを見たら何やら面白いことができそうなので、ちょっと弄ってみました。とは言っても英語->日本語翻訳ですが。(^^; 出来上がりは、こんなの。相変わらずのてきとーUI。記事が長くなるのでXAMLは省略。 Jsonを使った例になっています。一応、検索のコードも入れておきましたが、翻訳とほとんど一緒です。 using System; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using System.Json; namespace BingSearchSample { public p
C#の場合、多重継承はインタフェースを使うことになりますが、実装クラスへの委譲を書くのがちょっと面倒です。一方、Pythonは実装の多重継承ができるのでこれを利用して委譲の手書きを手抜きできないか試してみました。 まずは、多重継承させるインタフェースを用意します。 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace IronPythonSampleLib { public interface IBasicCalc { double Add(double x, double y); double Sub(double x, double y); } public interface IAdvanceCalc { double Mul(double x,
IronPython is an open-source implementation of the Python programming language which is tightly integrated with .NET. IronPython can use .NET and Python libraries, and other .NET languages can use Python code just as easily. 2.7 2.7.12 released on 2022-01-21 release notes | source 3.4 3.4.1 released on 2023-07-12 release notes | source Experience a more interactive .NET and Python development expe
フリーライドスキー(フリースキー)とアグレッシブインラインスケートとデジタル機器と、時々、日常のマッタリなブログ XmlSerializerクラスの、オブジェクトのプロパティをXMLドキュメントとして保存する「シリアル化」、そこから復元してくれる「逆シリアル化」はiniファイル代わりになって結構便利だったりします。 しかし、String型のプロパティの値に空白や改行が含まれている状態で単純に逆シリアル化をすると空白や改行除去されてしまいます。 シリアル化されたXMLドキュメントを確認すると空白や改行が含まれているんですが、逆シリアル化の際に除去されているよーです。 原因はXmlSerializerクラスのDeserializeメソッドが、XmlDocumentクラスのPreserveWhitespaceプロパティがFalseに相当する方法でXMLドキュメントを読み込むからです。 しかし、X
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く