Twisted Web Framework – User timeout caused connection failure.

I have been using twisted web framework for one of my side project. Twisted Framework was meant to be a one stop solution for your asynchronous networking needs. For example, there is a limit numbers of network connection you can make before your network port starts to crap out. Twisted makes sure that this does not happen.

However there are exceptions.

Recently I’ve made some small changes to the code, and the worst part of this is I’ve changed soe parameters such that the application connects to some other servers that have zero connectivity. Surprisingly, while twisted framework did report the timeout connection error, the exception holds on to some resource on the IO side, and makes the server hardly operational after a few thousand timeout attempts. I tried searching Google and nothing really comes up. My guess is Twisted holds on to some reference of the faulty connection and never bothered to clear resource used by it. While this is my wild guess, my fix to exclude bad connections does seem to work.

For the record I was running Twisted 10.2 with Python 2.7 on a Ubuntu 11.04 32-bit server.

 

Use wikipedia during the blackout.

Disable javascript is all you need. Wikipedia is usable once again. You’re welcome.

Kinect Mouse Controller Source code released!

As promised (from long time ago), here’s the source code of the kinect mouse controller.
I didn’t have time to clean it up but please feel free to explore around with it.
This code works with CL-NUI Platform drivers, some work might be required to get it compatible with Microsoft’s Kinect SDK, but it would not be too hard.

https://github.com/zeviance/Kinect-Mouse-Controller

Kinect + Hand = Mouse

For the past couple hours I was doing some hacking with Kinect and I figured out it would be nice to show you guys how Kinect really works in the background.

Currently there are two major platforms where you can get the drivers for Kinect. Open Kinect provides C/C++/python interfaces and Code Laboratories NUI driver provides C /C++ and C#.

==========MORE TO FOLLOW====……..

You can also find my code here:

Many thanks for “L14M333” for releasing his source code in the wild, CL and OpenKinect for opening the door for kinect hacking.

Source:
Code Laboratories NUI Kinect Drivers: http://codelaboratories.com/nui
Open Kinect Github:https://github.com/OpenKinect/libfreenect
Open Kinect:http://openkinect.org/wiki/Main_Page
Original Code:http://codelaboratories.com/forums/viewthread/416/P15/

What’s wrong with Android?

From an apple’s fan boy point of view:
1. It’s not an iphone.
2. It doesn’t have a name that starts with I
3. It was not designed in California, and MIC
4. It is a death star against the good people in infinite loop.
5. (In first order logic/predicate logic syntax) For all things that are not available from Apple Store is bad.
(x AvailableAtAppleStore(x) -> Bad(x))

Couple things from my side
a. Although the Android Operation System is not branded as a game platform, we can definitely see there are more gaming application that are available on the App Store than the App Market. Given casual gaming has become part of the daily routine, I think android requires more time to catch up (With more OpenGL integrations, better API design, better API demo, ready-made game engine etc etc.)

b. The variations on hardware makes it very hard for developers to unify all the application in terms of user experience. Let’s face it, segmentation has been a problem and will be a problem. Part of the root cause of the problem relies to the frequency of the system OS updates. It’s not often to see OEM had a hard time catching up the latest branch of the android source code when they were still working on the UI layer for the last update iteration.

c. Stock Android UI is good but still far from iPhone’s.

d. Deep integration with Google/Facebook becomes a problem when the integration becomes toooooooo deep in which users can no longer pull the plug by their will.

e. Android machines need better touch screens.

NTS: Projects to be done.

Exam is coming up and I have no choice but to put my development life on hiatus and focus on my text books. ( CS 245 Logic and Computation is actually fun) Anyway, here is a list of stuff that I have worked on and planning to finish them up during the semester break after exam until the start of next school semester in September.

Iron-Cook.com
Iron cook ‘s main objective is to provide a portal for anyone to randomize their meal plan for the week and have the grocery list generated on their mobile devices. It’s the CS446 course project that me and my group mates have been working on since May 2010 and currently we have the back-end web service and android client cores ready.

HKGolden Samurai
Another web service for exposing HK Golden API to native clients. As of now, the caching mechanism has been implemented and more UI work has to be done. The final product will be consumed by HKG maize, which is the first (and only) client for HK Golden on android devices.

University of Waterloo Login
A simple portal for passing the username + password when logging in the uw-wireless network. (Credentials are needed everytime a client joins the network and Firefox/Chrome doesn’t allow users to store their credentials on the browser)

GuruOnFire
After working on iron-cook.com extensively for the past 3 months I noticed a rewrite is required to follow the django/python/app-engine convention.

StudyTimer
StudyTimer is a small utility I wrote for myself. Basically it’s a timer that switches between “study period” and “break period”. Currently the skeleton of the client application is there and I have yet to implement the server side stuff.

Haskell + OpenGL ES/DirectX – I have always wanted to learn functional programming and do some geometry work with openGL/DirectX (XNA on Xbox360, windows phone 7) , hopefully the 30 days vacation is enough to learn these stuff.

Parent module ‘PIL’ not loaded.

Just a quick note, I was playing around with Google App Engine 1.3.5 with PIL 1.17 installed on my Windows 7 machine. Django Framework was complaining that the PIL module cannot be found from the system path when I was trying to resize an image using the Image module from Google App Engine. Since we call the Image module from Google App Engine and not using it directly, the only way to fix it is to uninstall PIL 1.1.7 and install 1.1.6 instead.

Google IO Conference + HTC Evo 4G hands on.

I’ve just got back from the io2010 conference and I must say this is one of the best conferences i have ever been. (not to mention free food + freebies + free phones)

All participants of the io conference received a new HTC EVO 4G handset as a compliment from google. I took mine for some test tonight and I’d really like this android handset. Compare to nexus one it has a larger screen and better social integration ( HTC Sense UI). However, it is not a GSM phone, which means it won’t work on Roger’s network. :(

Hopefully HTC will bring a GSM version sometime later this year.

Small Update

A small update from my side.

Work has been going pretty good so far. I was assigned a new project and I am aiming to do a terrific job. I haven’t made up my mind on what tool to use but I am expecting the end product will be very python/java/jython orientated.

Work aside, since I have started this blog I didn’t get time to upload some of my pics. I am currently in the stage of redesigning my photo gallery so to make it more “portfolio” styled. There will be nice pics I promise :)

As for GuruOnFire, the project is still alive  but it will take more time than I expected. I  hope a very early preview will be ready before mid-May.

Setting up Thunderbird for UW newsgroup

Long story short, back in CS 241 and 251 I was using google groups to access the newsgroup from waterloo. (uw.cs.cs241/251). However, searching for cs350 on google doesn’t do the trick and I was forced to setup a newsgroup client to serve my purpose. During my adventure, I stumbled upon this website from loo and basically they ask you to setup putty as a tunnel so that your thunderbird can pass thru this tunnel and grap the threads from the newsgroup. Of course, this is not a very smart thing to do because you need to fire putty up every single time and I don’t think that’s feasible for anyone who goes on to the newsgroup on an hourly basis.

Here’s my solution.

Follow the Configuring Thunderbird tutorial to the point where you enter name of the news server. Put “news.uwaterloo.ca” instead of “localhost”. (localhost is a unique keyword which means looking for on itself, since the tutorial uses putty to establish a connection to the server, pointing thunderbird to “itself” will utilize that connection and allows you to fetch stuff thru the tunnel).
Capture

After you’re done there should be a subscribe window pops up and asks you to subscribe certain group. In our case, we want uw.cs.cs350. Click done and you’re good to go.  In case it’s not working, you can always verify it from thunderbird -> Tools -> Account Settings -> Your Account Name -> Server Settings and make sure Server Name is “news.uwaterloo.ca” and the Port is 119.
Capture2

P.S. I found using the thread tool very useful to follow a long discussion. You can do that by clicking on the top-left button in your thread view.

Get Adobe Flash player
 
Powered by Wordpress. Design by Bingo