<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>可可熊的窝 &#187; 编程相关</title>
	<atom:link href="http://cocobear.info/blog/category/my-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://cocobear.info/blog</link>
	<description>K.I.S.S</description>
	<lastBuildDate>Sat, 10 Dec 2011 16:11:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>使用Django Admin做一个简单的应用</title>
		<link>http://cocobear.info/blog/2011/03/16/make-app-with-django-admin/</link>
		<comments>http://cocobear.info/blog/2011/03/16/make-app-with-django-admin/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 06:29:44 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=872</guid>
		<description><![CDATA[使用Django 的admin做一个简单的应用： 一、安装WSGI 官方推荐使用WSGI模式，而不是mod_python方式在Apache上运行Django。拿Fedora为例，直接: yum install mod_wsgi 就可以完成WSGI的安装 二、配置Apache 安装好mod_wsgi后，Apache的服务器配置里面会自动加入mod_wsgi的调用，所以只需要配置Django相关的部分： #add for mod_wsig Alias /media &#8220;/usr/lib/python2.5/site-packages/django/contrib/admin/media/&#8221; AllowOverride All Options None Order allow,deny Allow from all WSGIScriptAlias /mmq /var/www/Django/mmq/apache/django.wsgi 这里我们假定项目名为mmq，位置在/var/www/Django/mmq 服务器访问的根目为/mmq(比如你访问这个应用需要使用地址:http://127.0.0.1/mmq/mmq/) Alias /media是指定了Django访问静态文件的位置，因为我这里用到Django admin，所以需要把它指向Django admin静态文件的位置；当然你自己项目里面的模版文件会自动覆盖上面的设置。比如你可以mmq\templates\admin在这个位置创建一个index.html文件来自定义自己的admin主界面。 三、配置Django项目 刚才我们在http.conf文件中指定了一个django运行的根脚本，现在我们需要创建这个脚本： django.wsgi: import os import sys sys.path.append(&#8216;/var/www/Django&#8217;) os.environ['DJANGO_SETTINGS_MODULE'] = &#8216;mmq.settings&#8217; import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() urls.py配置： from django.conf.urls.defaults import * [...]]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2011/03/16/make-app-with-django-admin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PyFetion 2010</title>
		<link>http://cocobear.info/blog/2010/09/21/pyfetion-2010/</link>
		<comments>http://cocobear.info/blog/2010/09/21/pyfetion-2010/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 07:14:13 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[PyFetion]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=857</guid>
		<description><![CDATA[年初就看到飞信更新新的版本，但是原来的版本还是照常能用，就一直没理它，最近2008版本的协议据说很多地方用不了，抽空更新了一下PyFetion。移动官方于2010年9月15号发布了飞信2010正式版，所以新的PyFetion也将基于这个版本实现。 网上飞信的实现很多，不过很多要不是不开源，要不是实现过于麻烦；用 Python写这个飞信，的目的是为了方便一些用户订制，把飞信的功能折腾进自己的程序里、部署在服务器上做一些好玩的东西。 很多网上的飞信实现了http://xxx.xx.xx/api?p=136xxxxxxxx&#038;pw=xxxx&#038;t=136xxx&#038;sms=hello这样的WEB接口， 为了安全起见大家在使用这样的接口的时候还是要多加留心。其实在dreamhost之类支持Python的主机上部署一个Python的应用还是很方便的，GAE上使用HTTP方式也是可以的。 svn更新记录： http://code.google.com/p/pytool/source/detail?r=83 打包下载： http://code.google.com/p/pytool/downloads/list 大概试了一下登录，发送消息，收消息都可以。还有不太完善的地方我会慢慢修正。]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2010/09/21/pyfetion-2010/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>PyFetion更新</title>
		<link>http://cocobear.info/blog/2010/09/16/update-pyfetion-2/</link>
		<comments>http://cocobear.info/blog/2010/09/16/update-pyfetion-2/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 09:35:22 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[PyFetion]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=850</guid>
		<description><![CDATA[更新说明： 原引援引移动官方网站的说明： 尊敬的用户： 为了提升飞信系统安全性，于2010年7月25日起，飞信平台将停止对3.3及以下的低版本PC客户端提供支持，您将无法使用3.3及以下的低版本PC客户端登录飞信。您可以访问飞信官网下载频道http://feixin.10086.cn/download/下载并安装最新版本PC客户端后再次尝试登录。 对此给您带来的不便我们深表歉意，期待您一如既往的关注飞信！ 飞信官方网站 2010-07-19 原引我飞信发布说明： PyFetion?新版本发布，协议根据移动09.11.04的飞信版本：Fetion2008 3.5.2(安全加强版) 也就是说08版本的飞信还是能用的，（大家可以试着用08版的官方客户端登录一下）包括原有的登录验证方式，之所以这段时间不能用是移动增加了一个新的登录验证地址：https://uid.fetion.com.cn/ssiportal/SSIAppSignInV2.aspx，移动官方是使用XML的方式来传递这个参数，他们是新下传了一个ssi-app-sign-in-v2，我的程序没有很详细的分析XML，所以出错，现在解决的办法就是把PyFetion.py里面的 self.__sipc_url = &#8220;https://uid.fetion.com.cn/ssiportal/SSIAppSignIn.aspx&#8221; 改为： self.__sipc_url = &#8220;https://uid.fetion.com.cn/ssiportal/SSIAppSignInV2.aspx&#8221; 一切正常。 收到好多邮件，还有博客上的留言，不过最近其它的事情比较多，而且很多人直接说都得换新协议了，所以怕没时间整，今天抽空看了下，发现没那么严重，我一向认为移动还是没腾讯那么狠的。 请移步：http://code.google.com/p/pytool/source/detail?r=79 PS： amoblin同学修改的主要是针对Linux平台，所以我另外放了一个目录。 tanjelly同学的修改我就删掉了，新的协议似乎整的加密算法太多了，其实安全这个东西，没那么严重:-) PS： 刚测试发现登录的时候密码简单要求输入验证码，以前只有官方客户端才要求输入，现在看来是强制了，我一会儿再改一下代码，把验证码存起来。但是还是建议改一具复杂点的密码，不然每次输入验证码可就惨了。]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2010/09/16/update-pyfetion-2/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>最近PyFetion不能登录-已更新</title>
		<link>http://cocobear.info/blog/2010/08/03/update-pyfetion/</link>
		<comments>http://cocobear.info/blog/2010/08/03/update-pyfetion/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 03:18:29 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[PyFetion]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=842</guid>
		<description><![CDATA[tanjelly同学更新了PyFetion，原因是移动对认证方式的一些小的变化，并不是以前的协议完全不可以用了。具体的细节可以参考上面的连接。 google code的Issue怎么没有邮件通知呢？还是别人发邮件我才知道的:-(]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2010/08/03/update-pyfetion/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>给草儿同学写了个查询系统</title>
		<link>http://cocobear.info/blog/2010/01/13/write-web-query-system/</link>
		<comments>http://cocobear.info/blog/2010/01/13/write-web-query-system/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 09:07:20 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Js]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=775</guid>
		<description><![CDATA[主要实现查询、添加、修改、删除、导入功能; 可以对Excel文件导出的csv文件直接导入，使用ajax使操作简单化。 用到的技术关键词 PHP MySQL Ajax JavaScript Jquery Vim 共计一个文件600行代码]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2010/01/13/write-web-query-system/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>更新百度搜藏导出工具</title>
		<link>http://cocobear.info/blog/2009/12/15/update-cang2html/</link>
		<comments>http://cocobear.info/blog/2009/12/15/update-cang2html/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 14:35:26 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[PyFetion]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/2009/12/15/%e6%9b%b4%e6%96%b0%e7%99%be%e5%ba%a6%e6%90%9c%e8%97%8f%e5%af%bc%e5%87%ba%e5%b7%a5%e5%85%b7/</guid>
		<description><![CDATA[可以支持分类(或者叫标签)的导出了。 PyFetion在google code页面加了一个下载连接，方便没有svn时直接下载代码;使用的是r49的版本 这似乎是一篇微博&#8230;]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2009/12/15/update-cang2html/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>GAE上使用PyFetion做一个应用</title>
		<link>http://cocobear.info/blog/2009/12/15/app-use-pyfetion-on-gae/</link>
		<comments>http://cocobear.info/blog/2009/12/15/app-use-pyfetion-on-gae/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 06:22:14 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[PyFetion]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=759</guid>
		<description><![CDATA[GAE上有一个cron jobs的功能，类似于Linux下的crontab，可以实现在指定规则的时间里去运行程序。利用这个功能和飞信的短信功能就完成一些简单的小应用，比如天气预报，服务器监控，股票大盘实时行情提醒等等。 拿服务器监控来说，我们先注册一个GAE账户，然后创建一个Application，下载一份GAE 的SDK，接下来就写代码了。 (以上过程请自行google之) monitor.py: #!/usr/bin/env python # -*- coding: utf-8 -*- #MIT License #By : cocobear.cn@gmail.com # from google.appengine.api import urlfetch from PyFetion import * def get(): print('&#60;html&#62;&#60;body&#62;') url = 'http://61.236.244.162' result = urlfetch.fetch(url) if result.status_code == 200: print('OK') else: fetion = PyFetion('136xxxx','123456','HTTP') i = 0 while True: try: fetion.login(FetionOnline) fetion.send_sms('服务器掉了!') fetion.logout() except: [...]]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2009/12/15/app-use-pyfetion-on-gae/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>手动生成X509证书</title>
		<link>http://cocobear.info/blog/2009/10/19/make-x509-cert/</link>
		<comments>http://cocobear.info/blog/2009/10/19/make-x509-cert/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 03:24:04 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[编程相关]]></category>
		<category><![CDATA[x509]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=737</guid>
		<description><![CDATA[X509证书的详细描述在rfc2459中。 简单的来说X509证书是这样的： Certificate ::= SEQUENCE { tbsCertificate TBSCertificate, signatureAlgorithm AlgorithmIdentifier, signatureValue BIT STRING } TBSCertificate ::= SEQUENCE { version [0] EXPLICIT Version DEFAULT v1, serialNumber CertificateSerialNumber, signature AlgorithmIdentifier, issuer Name, validity Validity, subject Name, subjectPublicKeyInfo SubjectPublicKeyInfo, issuerUniqueID [1] IMPLICIT UniqueIdentifier OPTIONAL, &#8212; If present, version shall be v2 or v3 subjectUniqueID [2] IMPLICIT UniqueIdentifier OPTIONAL, [...]]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2009/10/19/make-x509-cert/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>网页前端编程</title>
		<link>http://cocobear.info/blog/2009/08/25/web-front-dev/</link>
		<comments>http://cocobear.info/blog/2009/08/25/web-front-dev/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 08:23:17 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Not Language]]></category>
		<category><![CDATA[Js]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=730</guid>
		<description><![CDATA[IE6竟然不能连接向同一个网页发请求[做个按钮使用ajax请求一个网址 你们在服务器上发现 其实IE6只发了一次 但是ajax返回确是成功的] IE7对iframe标签的支持竟然有问题&#8211;>http://zhengrenchi.blogbus.com/logs/23056446.html IE6与IE6 div标签的默认值不一样。 JS代码报错的位置竟然不是真正出错的位置！ &#8230;&#8230;. 就这些简单的问题折腾了我好几天。web前端编程太麻烦了，这么痛苦的开发环境，真是受不了。]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2009/08/25/web-front-dev/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Google Map</title>
		<link>http://cocobear.info/blog/2009/08/04/google-map/</link>
		<comments>http://cocobear.info/blog/2009/08/04/google-map/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 01:22:56 +0000</pubDate>
		<dc:creator>可可熊</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[map]]></category>

		<guid isPermaLink="false">http://cocobear.info/blog/?p=723</guid>
		<description><![CDATA[Google Map的算法分析见:http://www.codeproject.com/KB/scrapbook/googlemap.aspx Google Map使用http://mt[0-3].google.cn/mt/v=cn1.11&#038;hl=zh-CN&#038;x=%d&#038;y=%d&#038;z=%d&#038;s=Galile这样的URL来表示一个放大等级中最小的地图分块。 mt0&#8212;-mt3是四个Google Map的服务器 v=cn1.11 是当前地图的版本 一直在变化中 x,y,z分别代表当前分块所在位置和放大等级，Z=19为最大的放大等级，目前很多城市都可以查看到该等级下的地图 在某个放大等级z下，整个地球被分成2^z分块 x,y可以根据经纬度来计算;x的计算比较好理解(longitude->经度)： longitude=180+longitude #修正经度值到0-360 因为经度的表示是从-180&#8212;>180 longTileSize=360.0/(pow(2,zoom)) #计算每个分块所占的角度数 tilex = longitude/longTileSize #计算当前经度所在的分块位置 y的计算要牵扯到墨卡托投影这个地图算法，比较麻烦没看懂。不过并不影响使用，相应的代码上面已经给出来了，然后就可以用Python下载地图分块，使用PIL库把分块合并。 代码见Google Code (这个是西安地图)： #GMap2Png(108.80824,34.37075,109.10316,34.15366,16) 参数为你需要确定的图片左上角的经纬度和右下角的经纬度 最后一个是放大的等级 使用的时候需要注意如果你选择的经纬度范围较大，那么放大等级就不能太大，不然要生成一个巨大图片，PIL会报MemoryError的错误。 还有些问题我在CPyUG记录了下来，不过没使用好的解决方案。]]></description>
		<wfw:commentRss>http://cocobear.info/blog/2009/08/04/google-map/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

