Archives for the Month of May, 2007

ASP.net 2.0 Data Binding Internals

Alexander Jung has a post outlining how ASP.net 2.0 data binding is implemented using code generation. A more detailed look at ASP.net 2.0 databinding internals is available at DotNetDan. Looking at the generated code, it surprised me that the Bind() method doesn’t even appear in the final generated code. Makes one wish that the ASP.net [...]

Why Silverlight May Yet Displace HTML

There’s a live discussion over at sogrady’s blog whether RIA’s will ever gain a foothold on the web. Stephen points out that HTML had been adequate for most online tasks people wish to do today - webmail, search, banking, and that AJAX is useful in filling in the gaps.
On the other hand, David (who works [...]

Paraguay TLD for Python?

I didn’t realize that .py TLD is for Paraguay until today.
You know, that could be really cute for Python software repositories, like Cheeseshop.com.py.

ASP.net Special Tags

Anyone exposed to ASP.net syntax will come to realize
ASP.net is not XML
Here is a page example that contains typical tags (sorry about the space between < and tag names, :

<%@ Page Language=”VB” %>
<html>
  <body>

    <!– #Include virtual=”/include/header.inc” –>

    <%– Server Side Comment –%>
    <script runat=”server”
      language=”VB”>
      
       Dim m_UserName As String = “Chui”
      
       Function MyFunction() As String
         return “Hello”
       [...]

A Joke In the Python Interpreter

>>> import this

>>> love = this
>>> this is love
True
>>> love is True
False
>>> love is False
False
>>> [...]

More Warts in Python Exceptions

I’ve previously blogged about a little Python wart in the way exceptions differ from the way it’s raised.
Here’s another one that may surprise you, especially if you are writing long running processes like servers. But I have a real love/hate relationship with it. On one hand, the behavior makes Python really sweet to work with, [...]

JavaFX

Cedric Beust hates it. Sam Ruby thought that its Excel-like dynamic binding is pretty cool. Dare Obasanjo thought that having choices are good. Srikumar Subramanian over at Lambda The Ultimate thought that it reminded him of AppleScript.
I saw JavaFX back when it was known as F3. If you take a look it’s history, it [...]

Catching Custom Python Exceptions

Python is often described as a language which doesn’t “surprise” people with strange edge cases.
Here’s one for you. Don’t peek at the answer, and try to predict the result.

>>> class NewException(Exception): pass

>>> try:
… raise NewException, ‘Error Message’
… except NewException, message:
… pass
>>> print message
???? you answer [...]

Japanese Tech Diagrams are So Cute

Sorry… I have linkjacked it:

Source: Iandeth

To Japanese Spammer San

Dear Japanese Language Spammer San,

I’m very honoured to have been visited by your bot. Unfortunately, your comment does not remotely meet my criteria for relevancy.
Thank you very much!
P/S It appears although the comment is in Japanese, the site linked to, aptly named seo165.com (please don’t visit the site - McAfee reports it’s running browser [...]

Python Threading Tutorials

(Note: This content was migrated from http://teyc.editthispage.com)
Python has a high level threading module, but there has never been much specific tutorials on how to use it.
Just to get you started, here’s a code example:

import thread

def background(param1, param2, param3):
print “Background thread called with %r %r %r” % (param1, param2, param3)
[...]