Archive for the ‘Remoting’ Category

SQLAlchemy and Flash: Addressbook example

Monday, March 16th, 2009

SQLAlchemy logo

Dave Thompson created a new address book example that uses the new SQLAlchemy adapter that was added in the latest release of PyAMF. PyAMF provides Action Message Format (AMF) support for Python, mainly used in the Adobe Flash Player for RPC communication.


Get Adobe Flash player



You can browse or download the source from the Subversion repository. You can find instructions on how to run the example yourself on the documentation page.

Ohloh API and Python

Saturday, April 26th, 2008

Ohloh is a website which provides a web services suite and online community platform that aims to map the landscape of open source software development. The Ohloh API is a free, REST-based programming interface to the Ohloh open source directory. You can use the Ohloh API to create your own applications and web services based on Ohloh data. There’s a Python example client and additional examples are available for Java, Ruby, Bash, Perl, PHP and C++.

I decided to create a simple AMF gateway using PyAMF that pulls the account data from Ohloh and then passes it to a Flex application. The reason I use a AMF gateway is because I don’t want to hardcode and expose my API key in the Flex client application, which could be decompiled easily, allowing others to abuse my key.

You can test their API by entering the emailaddress of a registered Ohloh user in the input text-field below, click Submit, and it will display the user’s general account info and load the user’s avatar.

(more…)

Twisted Guestbook Example

Saturday, April 12th, 2008

We created a Guestbook Example to demonstrate a full featured application using Flex, Twisted, and PyAMF of course. Check it out after the jump!

(more…)

Authentication

Sunday, January 13th, 2008

In this tutorial, I’ll run through how to get a remoting server setup that deals with authentication. I’ll assume that you already have the latest version of PyAMF installed (at the time of writing, 0.1b is the most recent version).

I am going to build a WSGI remoting gateway, but you can use the principles applied here to any of the other supported gateway implementations (Django or Twisted). Check out the examples for more info.

(more…)

GeoIP example

Friday, January 11th, 2008

Check out the Flex example using the GeoIP APIs:

You can browse or download the source from the Subversion repository. You can find instructions on how to run the example yourself in the documentation.

ByteArray example

Thursday, January 10th, 2008

We have created a simple PyAMF example for the ByteArray class in ActionScript which provides methods and properties to optimize reading, writing, and working with binary data. The PyAMF equivalent of this class is also called ByteArray that provides the same basic functionality. (more…)

When is NaN not a number with Python 2.4?

Saturday, November 24th, 2007

From Wikipedia:

The IEEE Standard for Binary Floating-Point Arithmetic (IEEE 754) is the most widely-used standard for floating-point computation, and is followed by many CPU and FPU implementations.

Included in this specification is the ability to denote intangible numbers such as positive and negative infinity, and NaN (Not a Number). A floating point number is represented either by 32 or 64 bits (depending on how much precision you require). These bits are split up into 3 sections: a fraction, an exponent and a signed bit. More information on the structure of the floating point numbers can be found on Wikipedia.

We use EchoTest against PyAMF to ensure that what is sent to the server is returned verbatim, this way we can check things like data types, references, class mappings etc. We generally use Python 2.5 to run the server but Thijs Triemstra noticed that some numeric tests were failing when using Python 2.4, specifically NaN.

(more…)