Posts

Showing posts with the label xml

A Good Mix 31: Texas Holdem, IronScheme, Indigo Cheminformatics, IronRuby and bridge xml

More IronPython and DLR related projects, articles and news from around the web. Texas Holdem Hand Equity Calculation in IronPython  Greg Bray has been experimenting with using Resolver One to write Texas Holdem calculating spreadsheets with IronPython. In this blog entry he shows the IronPython code for calculating hand equity: This year I have been working in my free time to create easy to use Texas Holdem poker spreadsheets based on IronPython using Resolver One. These spreadsheets can be used to calculate Win/Tie/Loss odds, but some people like to use hand equity instead since it represents a player’s overall stake in the pot. Equity of 1.0 or 100% means that they will win the entire pot, where as equity of 0.5 (50%) or 0.25 (25%) means that they will split the pot with other players. You can again use Monte Carlo analysis to run a number of trials before all of the board cards are dealt to estimate a player’s current equity in the hand. This means that if during 4 trials ...

A Good Mix 14: Open Source, XML, XNA and more

Another selection of blog entries and articles on IronPython and the DLR. Microsoft and Open Source A Korean translation of a presentation about the future of Open Source at Microsoft by Harry Pierson, the IronPython program manager. IronPython, and its two companion projects IronRuby and the Dynamic Language Runtime, are at the forefront of pushing the adoption and acceptance of open source in the corporate behemoth we all know and love. bridge version 0.3.8 released bridge is an open source Python library for handling XML that works with CPython and IronPython. Its homepage describes it as: " a Python XML library trying to provide a high level and clean interface for manipulating XML documents. " bridge allows you to write code dealing with XML that will run unmodified on both CPython and IronPython. Most common Python packages for dealing with XML rely on C extensions not available on IronPython (except through Ironclad ) although the FePy project contains an implementat...

A Good Mix 12: Upcoming Presentations, XML Namespaces, ArcGIS and the Hungarian Phrasebook

Yet another selection of blog entries and articles relating to IronPython from the last few weeks. Upcoming Presentations - Summer Edition The Coding Geekette (Sarah Dutkiewicz) is a regular at .NET and Python conferences speaking, amongst other things, about IronPython. In this blog entry she lists her forthcoming talks: Cleveland .NET group (Python 101 for .NET developer) PyOhio 2009 (Pumping Iron into Python + IronPython Show & Tell) devLink (going cross-platform with C#) There is also quite a bit of IronPython content at the forthcoming EuroPython 2009 in Birmingam (28th June to 4th July): an IronPython tutorial , ArcGIS and IronPython talk , Introduction to IronPython talk , Ironclad talk and a general Python VM panel discussion . IronPython and XHTML A Japanese blog demonstrating how to load and save XML from IronPython - using the .NET APIs and working with namespaces. In this case he is iterating through a directory of XHTML files and adding valid namespace declarations...

Searching for Tweets with IronPython

Posts by Saveen Reddy have featured regularly on this blog, most recently his series of posts on automating Visio from Powershell and IronPython . He is back, and this time he is having fun with the Twitter Search API , using IronPython to search for tweets. IronPython: Searching for Tweets This simple example shows you how simple it is to search for tweets using Twitter’s Search API. Key techniques demonstrated in this sample code Using System.Net.WebClient to download a file Searching for nodes in System.Xml using namespaces Simple ATOM-feed parsing

Writing Xml with IronPython, XmlWriter and the 'with' statement

One of the best things about IronPython 2 is that it is based on Python 2.5 rather than 2.4. Amongst other goodies this means that the with statement is available. The with statement is the equivalent of C#'s using statement , although the Python context management protocol methods give a finer degree of control over exception handling. The with statement makes resource initialization and clean up simpler, and it will be nice to start using it throughout the Resolver One code base. It can often be used to replace the use of decorators or explicit try finally blocks, and many objects in the Python standard library have the necessary context manager methods to be used with "with". Luis Diego Fallas has written a great blog entry demonstrating 'with' with the XML classes provided by System.Xml : Writing Xml with IronPython, XmlWriter and the 'with' statement He creates a small wrapper class that provides the __enter__ and __exit__ methods used by the co...

Bridge, Kamaelia and XMPP on IronPython

Kamaelia is a Python concurrency library that uses Python coroutines (generators). Despite being pure Python it is powerful enough for streaming audio and video. Bugs in IronPython 1 prevented Kamaelia running on IronPython, but that doesn't seem to be the case for IronPython 2... Sylvain Hellegouarch has a Python library called headstock for communicating over XMPP: XMPP and IronPython 2 using headstock, bridge and Kamaelia For a while IronPython had severe shortcomings that prevented it running simple Kamaelia applications. Today I was able to run a simplechat demo using a vanilla IP2 on Windows with only one single modification to the logging module (thanks Seo). To be honest I didn’t expect it to go through :) The chat demo is simple enough but means more complex examples using XMPP PubSub will work as well (they are all based on the same framework). Now this isn’t production ready or anything. For instance the TLS support is broken (hopefully something easy enough to fix) so...

DevHawk: IronPython and Linq to XML

Continuing his IronPython and Microsoft Technologies series, Harry Pierson has posted four articles on working with XML and Linq from IronPython. Part 1: Introduction Part 2: Screen Scraping Part 3: Consuming Atom Feeds Part 4: Generating XML Linq stands for Language Integrated Query and is part of .NET 3. It adds first class support for querying data sources to C# and VB.NET. Underlying this are libraries that can be used from any .NET language (whether it has syntactic support for Linq or not.) In its basic form, "Linq over objects" is remarkably similar to Python list comprehensions and generator expressions. IronPython doesn't have syntactic support for Linq, but you can use the libraries. Part 2 of this series does exactly this: LINQ to objects works just fine from IronPython, with a few caveats. First, IronPython doesn’t have extension methods, so you can’t chain calls together sequentially like you can in C#. So instead of collection.Where(…).Select(…), you have t...

Simple IronPython Example Using XML, Oracle and SQL Server

From the " Head Above The Clouds Blog ": This is an IronPython example of using .NET classes to load a XML document, query it with a simple XPath expression, and then using the results to transfer data from an Oracle to a SQL Server database. Simple IronPython Example Using XML, Oracle and SQL Server

Invoking a SOAP Based Web Service with Powershell

In something of a mix of technologies, Kevin Hazzard explains how to use his 'ProxyForWsdl' project to invoke SOAP based webservices from Powershell. The relevance to IronPython is that the ProxyGen part of this project makes good use of IronPython in the test harness: Invoking a SOAP Based Web Service with Powershell

Deserializing XML with IronPython

Having worked on stream processing XML with IronPython, Harry Pierson now turns his attention to deserialization. He choooses an interesting approach, dynamically creating classes to represent nodes: Deserializing XML with IronPython

Stream Processing XML in IronPython

Harry Pierson likes the xml.dom.pulldom API from the Python standard library, but it doesn't work with IronPython because it requires the pyexpat C extension module. (There is however an IronPython compatible version of pyexpat in FePy .) In order to use a similar API, Harry has written a module called ' ipypulldom ' that wraps .NET functionality: Stream Processing XML in IronPython

Make Twitter Talk with IronPython

More code from Davy Mitchell. This time showing how to use the Twitter XML API from IronPython: Make Twitter Talk with IronPython

New Entries in the IronPython Cookbook

Recent additions to the IronPython Cookbook include: Creating a Shortcut File with WSH Interop Reading the Target of a Shortcut with Shell32 Interop Invoking onto the Control Thread (Windows Forms) Reading and Writing JPG Metadata with .NET 3 Transform XML Files with XSL Message Queuing Enumerating Installed Fonts

amplee on IronPython and .NET

Sylvain Hellegouarch shows how to use amplee with IronPython and Mono to create an Atom store implementation. It uses IPCE 's WSGI adaptor to host the implementation under xsp2. http://trac.defuze.org/wiki/AmpleeIronPython

elementtree 1.2.7 preview

ElementTree 1.2.7 preview is released. It's ElementTree 1.2.6 plus integrated support for IronPython 1.0 and later. http://online.effbot.org/#elementtree-127-preview

ElementTree IronPython Support

Fredrik Lundh (effbot) the author of CPython ElementTree mentions IronPython support is coming. "ElementIron is a (somewhat experimental) implementation of ET's parse, iterparse, and fromstring/XML functions for (guess what!) IronPython. I'll probably do an ElementTree 1.2.X maintenance release with native IronPython support in a not too distant future. (unfortunately, ElementIron is a lot slower than the CPython tree builder. I haven't benchmarked against stock ET running with Seo Sanghyeon's pyexpat implementation for IronPython, but it seems as if the main overhead is in the C#/IronPython interface layer, not in the builder itself. ideas for how to speed this up are welcome!)" http://online.effbot.org/#20061118

Amplee v.0.3.0, A Python-based/IronPython-compatible Atom Publishing Protocol Implementation Now Available!

David Peterson posts about Sylvain Hellegouarch's release of the next version of Amplee, a Python/IronPython Atom Publishing Protcol implementation, using bridge to enable compatibility with a variety of XML document types, including System.Xml-based document types. http://www.oreillynet.com/xml/blog/2006/11/sylvain_hellegouarchamplee_amp.html

ANN: bridge 0.1.0 a general Python and IronPython XML library

Sylvain Hellegouarch announced the release of bridge, a general purpose XML library for Python and IronPython. http://groups.google.com/group/comp.lang.python.announce/browse_thread/thread/e68b4c3f8f3f336e