Scarpy recommands using Pillow instead of PIL to get image things done. But under Windows, if you install Pillow directly by

pip install pillow

, there will be an error while you download item images in Scrapy. The error is:

exceptions.IOError: decoder jpeg not available

If you are using Linux, the solution is very simple, just fix this by installing libjpeg and re-installing Pillow.

But under Windows, it is very exhausted to re-compile libjpeg with Pillow or PIL. In this suituation, I recommand to use pre-compiled PIL instead. Just install the pre-compiled PIL library, then you won’t get the above error.

(0) Comments    Read More   
Posted on 07-09-2013
Filed Under (Technology) by bigbang

When I start a Win32 service, it provides an error code of 1053.

I think It means it can’t find a dll library.

You can try to run the service exe file under it’s folder to find out what kind of library it is missing.

(0) Comments    Read More   
Posted on 07-09-2013
Filed Under (Technology) by bigbang
  1. Fasest way: shared memory

    If you need fast IPC between two processes on one machine, you should look into whatever form of shared memory the platform offers. A simple protocol based around shared memory and locks or semaphores is by far the fastest technique.

  2. Socket

    If you do decide to use sockets, bind the “server” socket to ‘localhost’. On most platforms, this will take a shortcut around a couple of layers of network code and be quite a bit faster.

(0) Comments    Read More   
Posted on 07-09-2013
Filed Under (Technology) by bigbang

I am building my application using MFC Dialog application framework. I have printed logs in my output window by using TRACE. Now I want to print my logs on my Dialog, for example, in an Edit box or list box.

If we can transport the logs printed by TRACE into this control on my Dialog, it will be wonderful!

The list box is best for this. Make sure you turn off its ‘Sort’ property so the strings will be displayed in the order you add them. Call the list box AddString to add each line.

(0) Comments    Read More