Latest recipes by Ferdinand Jamitzky http://code.activestate.com/recipes/users/98863/new/2006-04-18T13:53:33-07:00ActiveState Code Recipesvery poor man's xml parser and generator (Python)
2006-04-18T13:53:33-07:00Ferdinand Jamitzkyhttp://code.activestate.com/recipes/users/98863/http://code.activestate.com/recipes/476225-very-poor-mans-xml-parser-and-generator/
<p style="color: grey">
Python
recipe 476225
by <a href="/recipes/users/98863/">Ferdinand Jamitzky</a>
(<a href="/recipes/tags/xml/">xml</a>).
Revision 2.
</p>
<p>Sometimes one needs a quick and dirty solution for parsing and generating xml. This recipe uses only the python parser itself for the parsing of xml. xml code is translated to valid python code and then evaluated. The generated objects can then be manipluated within python itself and treated as regular python objects.</p>
Infix operators (Python)
2005-02-17T11:12:04-08:00Ferdinand Jamitzkyhttp://code.activestate.com/recipes/users/98863/http://code.activestate.com/recipes/384122-infix-operators/
<p style="color: grey">
Python
recipe 384122
by <a href="/recipes/users/98863/">Ferdinand Jamitzky</a>
(<a href="/recipes/tags/oop/">oop</a>).
Revision 3.
</p>
<p>Python has the wonderful "in" operator and it would be nice to have additional infix operator like this. This recipe shows how (almost) arbitrary infix operators can be defined.</p>
inline java code into jython (Python)
2004-12-27T12:35:17-08:00Ferdinand Jamitzkyhttp://code.activestate.com/recipes/users/98863/http://code.activestate.com/recipes/360875-inline-java-code-into-jython/
<p style="color: grey">
Python
recipe 360875
by <a href="/recipes/users/98863/">Ferdinand Jamitzky</a>
(<a href="/recipes/tags/jython/">jython</a>).
</p>
<p>This recipe shows how to insert java code into a jython program. The java code is automatically compiled and the resulting class is imported and returned. Compilation only occurs after a change of the java source.</p>
Ruby like syntactic sugar (Python)
2004-03-02T13:44:07-08:00Ferdinand Jamitzkyhttp://code.activestate.com/recipes/users/98863/http://code.activestate.com/recipes/271669-ruby-like-syntactic-sugar/
<p style="color: grey">
Python
recipe 271669
by <a href="/recipes/users/98863/">Ferdinand Jamitzky</a>
(<a href="/recipes/tags/oop/">oop</a>).
</p>
<p>Ruby offers very nice language constructs for loops or for iterating over lists like the following: 5.times { print "Hello World" }. This recipe shows a hack how to implement these features in python.</p>
A generic jython taglib for tomcat (Python)
2003-11-17T14:33:29-08:00Ferdinand Jamitzkyhttp://code.activestate.com/recipes/users/98863/http://code.activestate.com/recipes/252132-a-generic-jython-taglib-for-tomcat/
<p style="color: grey">
Python
recipe 252132
by <a href="/recipes/users/98863/">Ferdinand Jamitzky</a>
(<a href="/recipes/tags/jython/">jython</a>).
Revision 3.
</p>
<p>These java classes implement a jython taglib which can be used to embed jython code into jsp pages. It consists of two tags:
<jython:exec> ...some code... </jython:exec>
and
<jython:get var=.../>
With these two tags you can write active jython pages.</p>
Pickle objects under jython (Python)
2003-11-17T06:11:21-08:00Ferdinand Jamitzkyhttp://code.activestate.com/recipes/users/98863/http://code.activestate.com/recipes/252131-pickle-objects-under-jython/
<p style="color: grey">
Python
recipe 252131
by <a href="/recipes/users/98863/">Ferdinand Jamitzky</a>
(<a href="/recipes/tags/jython/">jython</a>).
</p>
<p>Using the pickle module under jython is a rather slow method for storing data. Using the ObjectOutputStream speeds it up. You can save and restore objects (jython and java) with these functions.</p>
Write a plugin for ImageJ (Python)
2003-11-17T06:01:09-08:00Ferdinand Jamitzkyhttp://code.activestate.com/recipes/users/98863/http://code.activestate.com/recipes/252130-write-a-plugin-for-imagej/
<p style="color: grey">
Python
recipe 252130
by <a href="/recipes/users/98863/">Ferdinand Jamitzky</a>
(<a href="/recipes/tags/jython/">jython</a>).
</p>
<p>ImageJ (<a href="http://rsb.info.nih.gov/ij/" rel="nofollow">http://rsb.info.nih.gov/ij/</a>) is a very good image processing program which can be extended using plugins. It is also possible to write ImageJ plugins in jython and generate a class file. This plugin implements an image inverter.</p>