Posts filed under ‘Web Programming’

python2.6, email and py2exe

To make email module work with py2exe:

1. Use new lower case module names, not old ones. For example, email.mime.image.MIMEImage, instead of email.MIMEImage.MIMEImage.

2. import email.iterators, email.generator, and other staff that your exe complained missing.

Advertisements

July 2, 2009 at 7:28 pm 1 comment

My own app wall

Download and run your own App Wall.

Continue Reading June 24, 2009 at 6:10 am 7 comments

Openfire and Jwchat on Ubuntu

I spent a whole afternoon to install onpenfire and jwchat. This post works for me. But to apply it on Ubuntu, you need to do a little bit more.

1) install apache2, jdk, etc.
2) install openfire. I didn’t use ubuntu package since I want to do some development later. Download it and extract to any folder would work.
3) sudo a2enmod proxy; sudo a2enmod proxy_http
4) enable and setup mod_proxy. Add the following code to your <VirtualHost>. I use /etc/apache2/site-available/default
<VirtualHost *>
….
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
AddDefaultCharset UTF-8
ProxyPass /http-bind/ http://yoursite.com:7070/http-bind/
</VirtualHost>
Note: Don’t try to access yoursite.com:7070 from browser, you will get 400 or 404. This is fine.

5) Disable SASL in Jwchat.
In jsjac.js, change the following line:
var JSJACHBC_USE_BOSH_VER  = true; // change it to false

In jwchat.html, insert
oArg.authtype = ‘nonsasl’;
before
con.connect(oArg);

6) Log into openfire console and add the following 2 server properties.
xmpp.httpbind.client.requests.polling = 0
xmpp.httpbind.client.requests.wait = 10

7) Restart openfire and run /etc/init.d/apache2 force-reload

May 1, 2009 at 1:28 am 2 comments

Object in Javascript, a C++ programmer’s point of view

Explain Javascript OOP, which can be confusing for C++ users.

Continue Reading March 20, 2009 at 4:59 am 1 comment


Calendar

September 2017
M T W T F S S
« Aug    
 123
45678910
11121314151617
18192021222324
252627282930  

Posts by Month

Posts by Category