Goodspeed

导航

2011年11月12日 #

个人宣言

该文被密码保护。 阅读全文

posted @ 2011-11-12 21:16 Goodspeed 阅读(3) 评论(0) 推荐(0) 编辑

2011年11月11日 #

在ep.io上建立一个站点

摘要: ep.io是一个基于python的云托管服务商。创始人Andrew (python最流利web框架Django的主要贡献者),现在的技术层面的支持都是他在。目前是邀请质,你需要留个email给他,他过一段时间就会帮你开通了。现在让我们来看看如何在ep.io上如何写一个Hello world站点。因为不是很喜欢Django那种很重的框架,所以选用Flask.你一步是确保你的机器安装了下面的组件sudo apt-get gitsudo apt-get python-pipsudo apt-get openssh-client安装epio的管理组件pip install epio之后再來就是 dep 阅读全文

posted @ 2011-11-11 17:10 Goodspeed 阅读(648) 评论(0) 推荐(0) 编辑

2011年11月10日 #

如何搭建领导班子,最为困难的地方是什么

该文被密码保护。 阅读全文

posted @ 2011-11-10 23:14 Goodspeed 阅读(3) 评论(0) 推荐(0) 编辑

2011年11月8日 #

Python中序列化处理之——marshal和cPickle篇

摘要: #!/usr/bin/python#coding=utf-8import osimport marshal,cPickle"""marshal只能序列化有限的类型而cPickle能够序列化自定义的类型"""class Foo: def __init__(self, name): self.name = name def __str__(self): return self.nameo=range(0,10)L = Foo("Goodspeed")cls = [marshal,cPickle]for c in cls 阅读全文

posted @ 2011-11-08 14:51 Goodspeed 阅读(1208) 评论(0) 推荐(0) 编辑

Python中时间的处理之——calendar篇

摘要: #! /usr/bin/python# coding=utf-8import calendar"""返回的某个月的日历返回类型是字符串型"""cal = calendar.month(2011, 11)"""返回一年的日历"""cal = calendar.calendar(2011)cal = calendar.HTMLCalendar(calendar.MONDAY)"""打印出一个月日历"""cal.forma 阅读全文

posted @ 2011-11-08 10:38 Goodspeed 阅读(5225) 评论(0) 推荐(0) 编辑

2011年11月7日 #

Python中时间的处理之——tzinfo篇

摘要: #! /usr/bin/python# coding=utf-8from datetime import datetime, tzinfo,timedelta"""tzinfo是关于时区信息的类tzinfo是一个抽象类,所以不能直接被实例化"""class UTC(tzinfo): """UTC""" def __init__(self,offset = 0): self._offset = offset def utcoffset(self, dt): return tim 阅读全文

posted @ 2011-11-07 11:24 Goodspeed 阅读(13831) 评论(0) 推荐(0) 编辑

Python中时间的处理之——date和time篇

摘要: #! /usr/bin/python# coding=utf-8from datetime import datetime,date,time"""date类型顾名思义就是只表示日期,而time只表示time"""today = date.today()attrs = [("year","年"),( 'month',"月"),( 'day',"日")]for k,v in attrs: "today.%s = %s 阅读全文

posted @ 2011-11-07 10:28 Goodspeed 阅读(3314) 评论(0) 推荐(0) 编辑

2011年11月6日 #

Python中时间的处理之——timedelta篇

摘要: #! /usr/bin/python# coding=utf-8from datetime import datetime,timedelta"""timedelta代表两个datetime之间的时间差"""now = datetime.now()past = past = datetime(2010,11,12,13,14,15,16)timespan = now - past#这会得到一个负数past - nowattrs = [("days","日"),( 'seconds' 阅读全文

posted @ 2011-11-06 22:50 Goodspeed 阅读(55962) 评论(0) 推荐(1) 编辑

Python中时间的处理之——datetime篇

摘要: #! /usr/bin/python# coding=utf-8import datetime"""datetime的功能强大能支持0001年到9999年""""""当前时间返回的是一个datetime类型now方法有个参数tz,设置时区类型。如果没有和方法today的效果一样"""now = datetime.datetime.now()#UTC时间datetime.datetime.utcnow()attrs = [("year","年&qu 阅读全文

posted @ 2011-11-06 22:35 Goodspeed 阅读(23058) 评论(0) 推荐(0) 编辑

Python中时间的处理之——Time篇

摘要: #! /usr/bin/python# coding=utf-8import timefrom datetime import datetime"""表示日常所用时间的类,是用C实现的内嵌类。功能比较简单,但效率高。表示的时间范围有限1970年1月1日到2038年1月19日。""""""当前时间 返回的一个float型,以一个固定时间epoch(1970年1月1日0时起经过的秒数)因为time终究是以float型来表示的,所以对于timespan的问题,基本就成了数字问题。""&quo 阅读全文

posted @ 2011-11-06 21:46 Goodspeed 阅读(23361) 评论(0) 推荐(0) 编辑

2011年10月31日 #

python小技巧汇总

摘要: # -*- coding: UTF-8 -*-#!/usr/bin/env pythondef pairwise(iterable): """ 交叉形成字典 """ itnext = iter(iterable).next while True: yield itnext(),itnext()def distinct(seq): """ 对序列进行去重 """ return dict.fromkeys(L).keys() if __name__ == '__main_ 阅读全文

posted @ 2011-10-31 17:37 Goodspeed 阅读(379) 评论(0) 推荐(0) 编辑

2011年10月24日 #

使用Lambda实现递归

摘要: 本文介绍如何用lambda实现一个递归。包括整个思考的过程。供大家参考。 阅读全文

posted @ 2011-10-24 10:35 Goodspeed 阅读(3167) 评论(0) 推荐(0) 编辑

2011年7月26日 #

ServiceStack.Redis的问题与修正

摘要: 本文皆在尝试ServiceStack.Redis在大并发下可能碰到链接数和存储冗余问题的解决方案。文章给出相关代码修改示例、分析代码及原因。 阅读全文

posted @ 2011-07-26 16:05 Goodspeed 阅读(8446) 评论(5) 推荐(2) 编辑

2011年6月20日 #

supervisor 3.0a8-1 安装失败

摘要: 在ubuntu 11.04上安装supervisorsudo apt-get install supervisor会得到以下错误Reading package lists... DoneBuilding dependency treeReading state information... Donesupervisor is already the newest version.0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.1 not fully installed or removed.After this ope 阅读全文

posted @ 2011-06-20 16:09 Goodspeed 阅读(2997) 评论(0) 推荐(0) 编辑

2011年6月9日 #

asp.net mvc去掉无用的http header

摘要: 1 X-AspNetMvc-Version在Global.asax的Application_Start方法中加入 MvcHandler.DisableMvcResponseHeader=true;2 X-AspNet-Versionweb.config中<httpRuntimeenableVersionHeader="false"/>3 X-Powered-Byweb.config中<httpProtocol><customHeaders><removename="X-Powered-By"/></c 阅读全文

posted @ 2011-06-09 17:26 Goodspeed 阅读(1790) 评论(0) 推荐(0) 编辑

2011年5月24日 #

Mercurial host fingerprint warning

摘要: The problem:Recently I have updated my system and also mecrurial. Today I tried to do some work with a repository hosted in another machine and I got the following warning:warning: bitbucket.org certificate with fingerprint 81:2b:08:90:dc:d3:71:ee:e0:7c:b4:75:ce:9b:6c:48:94:56:a1:fe not verified(che 阅读全文

posted @ 2011-05-24 22:40 Goodspeed 阅读(605) 评论(0) 推荐(0) 编辑

2011年3月20日 #

docky模式下背景不透明

摘要: docky模式下背景不透明的解决办法:由于ubuntu10.10-netbook采用了unity界面,所以,安装完Docky后,屏幕下方会出现一条黑边,并提示需安装混合管理器以启用Docky。解决方法:打开配置编辑器(press Alt-F2 to open the Run Application dialog and type gconf-editor),依次apps–>metacity–>general,在general中compositing_manager后打勾,即可正常使用Docky! 阅读全文

posted @ 2011-03-20 15:52 Goodspeed 阅读(559) 评论(0) 推荐(0) 编辑

2011年3月12日 #

Dell vostro 1088 在ubuntu上的耳机故障

摘要: 现象:在Dell vostro 1088上装上ubuntu 10.10 桌面版64位。发现当耳机插入后,耳机没有声音,喇叭依然发声。解决方法在/etc/modprobe.d/alsa-base.conf 插入options snd-hda-intel model="olpc-xo-1_5"保存后重启就ok了 阅读全文

posted @ 2011-03-12 22:32 Goodspeed 阅读(344) 评论(0) 推荐(0) 编辑

2011年3月5日 #

Rdesktop 1.6.0 and Windows Server 2008 SP2

摘要: 在Linux下使用rdesktop链接windows server 2008 sp2时,每当尝试使用共享文件时,就会有提示框出来说设备断开。同时在Linux这边,rdesktop会报一个"NOT IMPLEMENTED: IRP Query Volume Information class: 0x7".幸好还有一个补丁放出,不过目前的发行版本还没有把这个补丁加上。http://csiuo.com/drupal/sites/csiuo.com/files/rdesktop-1.6.0.patched.2022945.tar.bz2下载下来sudo ./configuresud 阅读全文

posted @ 2011-03-05 21:21 Goodspeed 阅读(370) 评论(0) 推荐(0) 编辑

2011年1月10日 #

$(".class")后到底发生了什么 -- jquery选择器分析

摘要: $(".class")到底发生了什么。让我们一步一步来看注意rootjQuery其实就是$(document),绕了半天$(".class")就是$(document).find(".class")。接着看注意下面这行代码jQuery.find = Sizzle;也就是说jQuery.find默认是由Sizzle引擎提供的。那么开始进入Sizzle的代码了。先从简单的说起好的,这就很明白了,如果你的浏览器支持document.querySelectorAll,那么jQuery就直接用document.querySelectorAll来做了。有点区别的是IE8需要在document上设个id(如 阅读全文

posted @ 2011-01-10 14:42 Goodspeed 阅读(2872) 评论(0) 推荐(0) 编辑

2011年1月7日 #

python 安装 MySqlDB会碰到的问题

摘要: 碰到 command 'gcc' failed with exit status 1 阅读全文

posted @ 2011-01-07 18:55 Goodspeed 阅读(226) 评论(0) 推荐(0) 编辑

2011年1月4日 #

nginx使用HttpImageFilterModule

摘要: 下载最新的nginx源码sudo ./configure --sbin-path=/usr/sbin/nginx --with-http_image_filter_module --prefix=/usr/sbin --conf-path=/etc/nginx/nginx.confsudo makesudo make install 阅读全文

posted @ 2011-01-04 16:08 Goodspeed 阅读(969) 评论(0) 推荐(0) 编辑

2010年12月10日 #

python下载图片并查看图片宽度和高度

摘要: [代码] 阅读全文

posted @ 2010-12-10 11:33 Goodspeed 阅读(644) 评论(0) 推荐(0) 编辑

2010年7月28日 #

一堆DLL中找一个类

摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Reflection;usingSystem.Linq; namespaceSampleConsole{ classProgram {staticvoidMain(string[]args){stringfind="SessionState";stringd... 阅读全文

posted @ 2010-07-28 15:37 Goodspeed 阅读(334) 评论(0) 推荐(0) 编辑

2010年7月20日 #

扩展Array方法

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--Array.prototype.where=function(callback){vararray=[]for(vari=0;i<this.length;i++){if(callback.apply... 阅读全文

posted @ 2010-07-20 15:37 Goodspeed 阅读(266) 评论(0) 推荐(0) 编辑