- Iron Python in Action (Manning Publications book)
IronPython in Action offers a comprehensive, hands-on introduction to Microsoft's exciting new approach for programming the .NET framework. It approaches IronPython as a first class .NET language, fully integrated with the .NET environment, Visual Studio, and even the open-source Mono implementation. You'll learn how IronPython can be embedded as a ready-made scripting language into C# and VB.NET programs, used for writing full applications or for web development with ASP. Even better, you'll see how IronPython works in Silverlight for client-side web programming.
- Try Python in the Browser: an IronPython and Silverlight 2 Interactive Interpreter
- IronPython Cookbook
This wiki contains recipes and example code for IronPython. IronPython is a Microsoft port of the Python Programming Language to the .NET framework.
- Contents
- Useful Links
- Downloads
- IronPython in Action
Python is a dynamic language, used for a wide variety of purposes, with an emphasis on clean and expressive code. It allows the maximum flexibility for the developer, whilst maintaining readability of code.
IronPython brings Python to .NET, and allows you native access to the .NET framework and classes. It runs on Microsoft .NET and on Mono, a cross-platform Open Source implementation of the .NET runtime and framework libraries.
programming: July 2008 Archives
Dev102.com poses this programming challenge:
Your input is a string which is composed from bracket characters. The allowed characters are:'(', ')', '['. ']', '{', '}', '<' and '>'. Your mission is to determine whether the brackets structure is legal or not.
Example of a legal expression: "([](<{}>))".
Example of an illegal expression: "({<)>}".
Provide the most efficient, elegant and simple solution for that problem.
It's pretty obvious to me that you push opening brackets on the stack and pop off closing brackets, ensuring that the correct closing bracket is encountered. Like this:
def Evaluate(str):
stack = []
pushChars, popChars = "<({[", ">)}]"
for c in str :
if c in pushChars :
stack.append(c)
elif c in popChars :
if not len(stack) :
return False
else :
stackTop = stack.pop()
balancingBracket = pushChars[popChars.index(c)]
if stackTop != balancingBracket :
return False
else :
return False
return not len(stack)
MemCached
memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.
Danga Interactive developed memcached to enhance the speed of LiveJournal.com, a site which was already doing 20 million+ dynamic page views per day for 1 million users with a bunch of webservers and a bunch of database servers. memcached dropped the database load to almost nothing, yielding faster page load times for users, better resource utilization, and faster access to the databases on a memcache miss.
.NET memcached client library
C#/.NET memcached client library. This library can be used by .NET projects to access memcached servers. Ported from the Java memcached library located at http://www.whalin.com/memcached/.
A guy I play frisbee with turns out to have a cool developer's website, EvanJones.ca. Here are a couple of the cool links I found there:
Python code coverage [via EvanJones.ca]
Yahoo Zookeeper (distributed systems infrastructure) [via EvanJones.ca]Programming challenge #10 has been posted at dev102.com.
If all the numbers 1..n were present, then they would sum to n(n+1)/2. If some x is absent, then they will sum to n(n+1)/2 - x. So to determine which number is missing, subtract the sum of the series from the expected sum.
This python code finds the missing number in the series named values:
def test(values) : max_val = len(values) + 1 expected_sum = max_val*(max_val + 1) / 2 return expected_sum - sum(values)
Here is a complete test:
import random def test(values) : max_val = len(values) + 1 expected_sum = max_val*(max_val + 1) / 2 return expected_sum - sum(values) test_range = 200 for i in range(1,test_range) : a = range(1, i) + range(i+1, test_range+1) random.shuffle(a) x = test(a) if x != i : print "Failed at ", i print a print sum(a) break
