lamp

May 2009 - Posts

JSON Extension Methods
30 May 09 10:55 PM | Frederick.Chapleau | 1 comment(s)

Just a little sample, modified from the ScottGu…

public static class JSONHelper
{
    public static string ToJSON(this object obj)
    {
        JavaScriptSerializer serializer = new JavaScriptSerializer();
        return serializer.Serialize(obj);
    }

    public static string ToJSON(this object obj, int recursionDepth)
    {
        JavaScriptSerializer serializer = new JavaScriptSerializer();
        serializer.RecursionLimit = recursionDepth;
        return serializer.Serialize(obj);
    }
}

-f.

Filed under:
Windows 7 is Windows 6.1
28 May 09 08:33 AM | Frederick.Chapleau | with no comments

Hum... and then everybody imagine, that Windows 7 is a completely new operating system!

Really a great marketing boom.

-f.

Filed under:
Running Python 3 extensions on IIS 6
28 May 09 12:19 AM | Frederick.Chapleau | with no comments

Python files can be run, without using Iron Python on IIS.

The first step is to install... Python 3.

After that you must enable the extension by going to Web Service Extensions and Allowing “All unknown CGI Extensions”

Third and last step, is a modified version of the MS Article... that date back to 2006.

Verify that application mapping for .py files is set up. To do this, perform the following steps:

  1. In the ISM, under Internet Information Server, right-click the computer name, and then click Properties.
  2. From the Master Properties drop-down list, click WWW Service and then click Edit.
  3. Click the Home Directory tab, and then click Configuration.
  4. To add the application mapping, click Add, and then create a new mapping by using the following information (substituting the correct path on your computer):
    • Executable: "C:\Python3\python.exe” %s %s (The two "%s" after the executable are required for console-based script interpreters but would not be required for an Internet Server API [ISAPI]-based script interpreter).
    • Extension: .py
    • Script engine: selected.
    • Check that File Exists: selected (for security) Click OK.

 

-f.

Filed under:
"Object of type 'System.EventHandler' cannot be converted to type 'System.EventHandler`1"
11 May 09 02:32 PM | Frederick.Chapleau | with no comments

Ok, that really, really a big issue in the .NET Framework.

You cannot use a generic event handler, with a name ending by “changing”, when it is used as a data binding object on a form.

Really disappointing that those guy rely on event names.

No Comments.

-f.

Ref: http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/51cce2f7-04c8-4703-882f-6c72ee6a1f8b

Filed under: