2009年9月24日 星期四

Visionary Reloaded

I used this template on this blog and still modifying it.

Add Google Analytics to My Blogger Blogs

I follow Andy Wibbels's How to Add Google Analytics to Your Blogger Blogon ㄚ琪的Blogger部落格 and nokia 5800. Good articles and I will monitor the result of the Google Analytics.

2009年9月23日 星期三

TOP POSTS

Recently My site http://job.achi.idv.tw always crashed. So I focus on the blogger and buid a new template. I imitate http://john-chow-blogger-template.blogspot.com/. When I want to have the function of "TOP POSTS", I found the site Top Posts Widget for Blogger and http://feed2js.org/.
I test them, but feed2js.org seems to be good because we can immediately use it.

2009年9月17日 星期四

Blogger Trackback

I think this script is useful for use firefox to post blogger's articles.But if we use IE, we can not use the script.So I think it is not very good.

App Engine Blog

I use micolog and fix the problems from

2009年9月16日 星期三

Retest proxy pppcfg.py

Finally, I find we need upgrade python to 2.6, fix the two programs urllib2.py and httplib.py and set http_proxy and https_proxy.
It would upload app successfully.

ERROR appcfg.py:1235 An unexpected error occurred. Aborting

Scanning files on local disk.
Initiating update.
Email: XXX@gmail.com
Password forXXX@gmail.com:
2009-09-17 09:03:56,855 ERROR appcfg.py:1235 An unexpected error occurred. Abort
ing.
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.p
y", line 1213, in DoUpload
missing_files = self.Begin()
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.p
y", line 1009, in Begin
version=self.version, payload=self.config.ToYAML())
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengin
e_rpc.py", line 312, in Send
self._Authenticate()
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengin
e_rpc.py", line 344, in _Authenticate
super(HttpRpcServer, self)._Authenticate()
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengin
e_rpc.py", line 233, in _Authenticate
auth_token = self._GetAuthToken(credentials[0], credentials[1])
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengin
e_rpc.py", line 177, in _GetAuthToken
response = self.opener.open(req)
File "C:\Python25\lib\urllib2.py", line 381, in open
response = self._open(req, data)
File "C:\Python25\lib\urllib2.py", line 399, in _open
'_open', req)
File "C:\Python25\lib\urllib2.py", line 360, in _call_chain
result = func(*args)
File "C:\Python25\lib\urllib2.py", line 1115, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "C:\Python25\lib\urllib2.py", line 1082, in do_open
raise URLError(err)
URLError:
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\appcfg.py", line 60, in >
run_file(__file__, globals())
File "C:\Program Files\Google\google_appengine\appcfg.py", line 57, in run_fil
e
execfile(script_path, globals_)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.p
y", line 1974, in
main(sys.argv)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.p
y", line 1965, in main
result = AppCfgApp(argv).Run()
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.p
y", line 1418, in Run
self.action(self)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.p
y", line 1879, in __call__
return method()
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.p
y", line 1669, in Update
lambda path: open(os.path.join(basepath, path), "rb"))
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.p
y", line 1213, in DoUpload
missing_files = self.Begin()
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.p
y", line 1009, in Begin
version=self.version, payload=self.config.ToYAML())
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengin
e_rpc.py", line 312, in Send
self._Authenticate()
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengin
e_rpc.py", line 344, in _Authenticate
super(HttpRpcServer, self)._Authenticate()
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengin
e_rpc.py", line 233, in _Authenticate
auth_token = self._GetAuthToken(credentials[0], credentials[1])
File "C:\Program Files\Google\google_appengine\google\appengine\tools\appengin
e_rpc.py", line 177, in _GetAuthToken
response = self.opener.open(req)
File "C:\Python25\lib\urllib2.py", line 381, in open
response = self._open(req, data)
File "C:\Python25\lib\urllib2.py", line 399, in _open
'_open', req)
File "C:\Python25\lib\urllib2.py", line 360, in _call_chain
result = func(*args)
File "C:\Python25\lib\urllib2.py", line 1115, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "C:\Python25\lib\urllib2.py", line 1082, in do_open
raise URLError(err)
urllib2.URLError:

How to solve the problem?

How to solve no proxy in appcfg.py

The problem is very Strange.But I google the question and find the solution. Look at the page:http://code.google.com/p/googleappengine/issues/detail?id=126
I follow sachingm's comment and success.
The content post blew:
Hi

Finally got my app to upload to the server. :)

My machine is Win XP with Python 2.6 and my proxy requires user/password authentication.

I had to apply the Python patch AND use ntlmaps proxy (doing only 1 of either gets
you misleading errors. Btw alexander.trakhimenok, I too got those infinite dots on
the NTLSMaps console but this was resolved when I did the patch).
I tried arthurfreeman's appcfg.py (and added yaml) but it did NOT help - so I
reverted to the original appcfg.py.

Final Steps:
1) Install the Python patch from http://bugs.python.org/issue1424152.
Its not just urllib2.py that needs to be patched but httplib.py as well. I've
attached both these PATCHED files for Python 2.6. Just replace your corresponding
files with these.

2) Download the latest ntlmaps proxy (v0.9.9?) from http://ntlmaps.sourceforge.net/
(its only 71kb!).
Change the following attributes in server.cfg: PARENT_PROXY, NT_DOMAIN, USER, PASSWORD.
You can leave the password empty and it will prompt you when you start ntlmaps.

3) Set the following environment values:
set HTTP_PROXY=localhost:5865
set HTTPS_PROXY=localhost:5865
(5685 is the default port used by ntlsmaps which can be changed in server.cfg)

4) Start up the ntlsmaps proxy by running runserver.bat (you might have to edit the
bat file to point to your actual python executable).

5) Test whether ntlsmaps is working by changing your browser proxy to point to
localhost:5865, and try to access some sites. If this fails, your proxy is probably
not understood by ntlsmaps or vice versa - try to finetune ntlsmaps some more.

6) Finally run your upload command:
appcfg.py update xyz/
Hopefully you should get something like this:
...\appcfg.py:40: DeprecationWarning: the sha
module is deprecated; use the hashlib module instead
DIR_PATH,
Scanning files on local disk.
Initiating update.
Email: xyz@gmail.com
Password for xyz@gmail.com:
Cloning 2 static files.
Cloning 5 application files.
Deploying new version.
Checking if new version is ready to serve.
Will check again in 1 seconds.
Checking if new version is ready to serve.
Closing update: new version is ready to start serving.
Uploading index definitions.

Thanks A ZILLION to all the above posters...
urllib2.py
48.7 KB Download
httplib.py
44.7 KB Download

But I test if I do not run ntlmaps, it seems to be ok. I need to retest.

2009年9月10日 星期四

Yuren's Info Area: java + mysql + unicode

Yuren's Info Area: java + mysql + unicode
Recently I use the site "部落格觀察" to look at large amounts of information that has been collected on a computer and using it to provide new information. I used htmlparser class and it is a very useful tool to parse html. Then I need to use the useUnicode=true and characterEncoding=utf8 parameters to insert records to MySQL.
Good article!