自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(113)
  • 问答 (2)
  • 收藏
  • 关注

更新了那个"最小的ruby飞信客户端"

曾经的那个[b]“最小的ruby飞信客户端” [/b][url]http://www.iteye.com/topic/443302[/url] 2012-06-13日更新,又可以工作了 :wink:源码:[url]http://code.google.com/p/fetion-ruby/[/url]登录时rsa加密部分参考了pyfetion([url]http://code.g...

2012-06-13 23:39:51 253

基于web飞信接口的飞信应答机器人

[size=large]fetion-robot是基于web飞信接口的飞信机器人(一小段ruby脚本)。最初目标是做一个可以发新浪微博的飞信机器人。 目前实现了[list][*]登录(验证码)[*][b]收[/b]信息[*]发信息等功能[/list]做[b][color=red]应答机器人[/color][/b]最合适源码仅仅145行--意味着任何人都可以很容易地修改以...

2010-11-25 23:08:44 508

邮件发新浪微博

绑定邮件后,发邮件即可收发新浪微博。请先访问 [url]http://session.im[/url] 授权,使用gmail体验。目前仅支持通过gmail邮箱发微博及图片(附件)。其他邮箱待测试。[list][*][email protected] 授权认证[*][email protected] 发微博[*][email protected] 阅读微博(或者friends_timeline@session...

2010-11-25 22:46:26 1661

原创 获取gmail新邮件---python版

[code="python"]#! /usr/bin/python# -*- coding: utf-8 -*-#author [email protected] httplib2from xml.dom.minidom import parseString#https://user:[email protected]/mail/...

2010-07-29 22:57:03 1554

原创 获取gmail新邮件---ruby版

[code="ruby"]#! /usr/bin/ruby#author [email protected] 'uri'require 'net/http'require 'net/https'require 'rexml/document'#https://user:[email protected]/mail/feed/...

2010-07-29 22:55:07 1211

原创 DOM操作中TextNode惹的麻烦

在DOM遍历中,IE会忽略空白文本节点,但是firefox、chrome等现代浏览器会把空白文本节点识别为TextNode,在访问诸如[b]childNodes、firstChild、lastChild、nextSibling、previousSibling[/b]等节点时,可能会遇到TextNode。 解决方法大致有2种:[list][*]以nodeType过滤(一般过滤掉no...

2010-01-19 22:13:42 638

原创 给gmai邮箱发邮件的一段python小脚本

[code="python"]import smtplibfrom email.MIMEText import MIMETextfromaddr = '[email protected]'toaddrs = ['[email protected]','[email protected]']msg = MIMEText("test content", "plain")msg['Subjec...

2010-01-12 21:26:43 565

原创 Net::OICQ 还可以登录qq

[code="shell"]perl -MCPAN -e shellCPAN> install Module::BuildCPAN> install Crypt::OICQCPAN> install Net::OICQ[/code][url]http://perl-oicq.sourceforge.net/[/url]

2010-01-12 21:17:37 203

原创 使用chrome浏览器开发如何清除dns缓存

使用firefox开发太占资源,使用chrome开发速度很快,可是没有类似firefox的network.dnsCacheExpiration的配置选项可以控制dns不缓存(因为实际开发中经常需要修改hosts文件,在几个host间切换),也没有什么插件可以辅助。经过探索,发现一招可用:[list][*]把chrome dns prefetch功能关闭[*]执行sudo /et...

2009-12-30 11:26:08 175

IE浏览器不支持相对路径的cursor

IE6、IE8均如此。所以为了跨浏览器,还是统一用绝对完全路径吧,如下:cursor:url(http://xxx.com/images/common/big.cur)

2009-12-04 13:29:53 317

javascript:void();在IE下会报告语法错误

javascript:void();在IE下会报告语法错误(见test2),而firefox不会报错。并且当该错误发生时,microsoft script editor或者IE8自带的debugger都帮不了你(根本不会自动定位错误)。[code="html"]function test(){ alert(1);}test1test2test3[...

2009-12-03 13:35:41 272

vertical-align对齐checkbox

vertical-align对齐checkbox,比如javaeye的登录框如果加入vertical-align:-3px;就可以和文字对齐啦!今天同事教的。以前自己摸索的什么解决方法忘记了,可惜!

2009-11-27 18:34:00 158

原创 Opera Unite可以不经代理,真正P2P直连

Opera Unite allows you to share your data using direct connections to your computer, if available. This can make loading speeds for your services faster, as they will bypass the proxy server.官方Opera U...

2009-11-24 09:47:45 203

python中urllib和urllib2不同的调试方法

使用urllib发http请求时:[code="python"]import urllib, httplibhttplib.HTTPConnection.debuglevel = 1urllib.urlopen(”http://google.com”) [/code]使用urllib2发http请求时:[code="python"] import urllib2...

2009-11-23 10:11:31 89

App Engine上ajax请求python中文乱码问题

python对utf-8编码的支持真让人恼火。在Google App Enginea上发ajax请求时,有中文字符时,乱码问题很让人头痛。尝试了一种解决方法是可行的:[list][*]浏览器端使用encodeURIComponent或者encodeURI编码中文字符;[*]服务器端使用urllib模块的unquote方法:[/list][code="python"]st...

2009-11-19 12:29:12 146

飞信给自己发测试短信时sip指令必须改成SENDCatSMS

飞信给自己发测试短信时sip指令必须改成SENDCatSMS,不是SENDSMS可可熊的PyFetion有漏洞,可以这样调用fetion.send_msg(sms,None,"SENDCatSMS");默认flasg是“SENDSMS”。我的ruby fetion单独提供给自己发短信的接口了补充一下:send_msg(sms,"自己的飞信号")也可以给自己发消息...

2009-11-19 11:22:58 116

if $0 == _FILE_

[code="python"]if __name__ == "__main__": main ()[/code] 与之等价的ruby写法如下: [code="ruby"] if $0 == __FILE__ main end [/code]快速单元测试的一条路。

2009-11-18 09:56:45 181

原创 python资料收集(幻灯片)

python作者Guido van Rossum历年发表的幻灯片:[url]http://www.python.org/doc/essays/ppt/[/url]python会议幻灯片:[url]http://wiki.europython.eu/TalkMaterials[/url][url]http://wiki.python.org/moin/EuroPython2004...

2009-11-09 14:00:15 100

手机+电视遥控器

手机+电视遥控器,不知道有没有这样的东西

2009-11-09 09:09:57 132

搜狗云输入法和ibus的结合

搜狗云输入法和ibus拼音引擎结合起来,肯定是很有意思的应用。linux上的中文拼音输入法问题就不大了。

2009-11-09 09:02:41 359

使IE8以下的IE浏览器也支持图片的data协议

参见[url]http://www.phpied.com/mhtml-when-you-need-data-uris-in-ie7-and-under/[/url]测试页面:[url]http://phpied.com/files/mhtml/mhtml.html[/url]原理是使用MHTML(Multipurpose Internet Mail Extensions HyperTe...

2009-11-06 14:34:02 459

IE css hack

[code="html"] #margin1{*margin:10px;*border:1px solid red;} #margin2{_margin:10px;_border:1px solid blue;} #margin3{^margin:10px;^border:1px solid yellow;} *mar...

2009-10-30 15:43:05 83

pushd和popd命令

[code="shell"]root@ubuntu:~# pwd/home/dywroot@ubuntu:~# pushd /opt/lampp//opt/lampp ~root@ubuntu:/opt/lampp# lsbackup error icons libexec modules RELEASENOTES tmpbin ...

2009-10-28 09:24:11 643

ipython和pydev都很不错

关于ipython,目前可以见到的中文介绍可参考[url]http://forum.ubuntu.org.cn/viewtopic.php?p=447255[/url]。[quote]tab补全,对象自省,强大的历史机制,内嵌的源代码编辑,集成Python调试器,%run机制,宏,创建多个环境以及调用系统shell的能力[/quote]确实非常强大。pydev也非常不错了,代码自动完成,d...

2009-10-28 09:09:45 131

当前目录打开console及反向操作

[list][*]在当前目录打开console需要安装nautilus-open-terminal(sudo aptitude install nautilus-open-terminal),安装以后右键菜单里就会出现Open In Terminal的选项。[*]从console的当前路径打开文件,则可以使用gnome-open命令:"gnome-open ."[/list]...

2009-10-22 16:45:58 170

原创 配置irb支持tab自动补全

编辑~/.irbrc,输入下面内容即可使irb支持tab自动补全。[code="ruby"]require 'irb/completion'IRB.conf[:PROMPT_MODE] = :SIMPLE[/code]

2009-10-20 14:34:16 288

原创 vimim--内嵌的vim中文输入法

[url]http://maxiangjiang.googlepages.com/vimim.html[/url]最酷的vim插件,支持各种中文输入法词库和输入习惯,不依赖操作系统的输入法。和在线的拼音输入法思路比较像(前段时间我在google app engin上搞了个在线的拼音输入法)。...

2009-10-20 11:49:25 198

ActionScript 类型反射

[code="java"]import flash.utils.describeType;trace(describeType(flash.net.NetStream));[/code]以debug模式运行,在console控制台会打印输出NetStream的所有属性和方法(需保证安装的是debugger版本的 flash 播放器):[code="xml"] ...

2009-10-12 11:47:32 103

使用LVPM迁移ubuntu到硬盘的笔记

如果使用wubi之类的工具在虚拟硬盘上安装了ubuntu,则可以使用LVPM把它迁移到真正的硬盘分区上。 由于新系统的menu.lst(/boot/grub/menu.lst)和旧系统一样,所以必须在grub中编辑启动项:把root = ()/ubuntu/disks 改成迁移目标分区,如root = (hd0,5)然后按b(boot)继续启动新系统。 启动以后必须...

2009-10-11 16:46:04 157

使用firebug跟踪调试flash

[code="actionscript"]import flash.external.ExternalInterface;ExternalInterface.call("console.log",{a:11,b:22},"log var");[/code]这种方式比使用trace的好处是不需要使用debugger版本的flash player;且firebug的强大能力也值得f...

2009-10-11 16:23:51 164

莫名其妙的javascript效果--期待合理解释

在浏览器地址栏输入下面的文本,回车。看看在IE(6)、firefox(3.5)、opera(10)中的效果---是不是很奇妙?!但是chrome·4和Safari4都没有反应。[code="javascript"]javascript:/a]b/g;[/code]为啥效果好像是调用了document.write("/a]b/g");哪?令我很不解,期待合理解释。...

2009-09-24 16:31:14 78

原创 XSS-跨站攻击

最全的XSS跨站攻击方式:[url]http://ha.ckers.org/xss.html[/url]

2009-09-21 14:19:32 76

MSN批量添加联系人

MSN的联系人导出格式为后缀为.ctt,是xml。创建一个符合该xml文件格式的文件,即可添加联系人。美中不足的是无法添加昵称。有时间试试rubymsn。。[code="xml"] [email protected] [email protected] [email protected] ... [/code]...

2009-09-18 13:34:28 211

原创 ThunderBird支持导入csv格式通讯录了

2.0.0.23版本支持从文本文件导入。原本还想写个插件哪,没有想到可以这么容易导入,庆贺一下。雷鸟的邮件签名也可以自定义(文本格式即可,txt和html都可以,html还可以定义样式)。以前太笨了,不知道还有这么多功能哪。...

2009-09-17 16:56:30 616

-moz-zoom-in 和-moz-zoom-out

[code="css"]/*光标样式--自定义图片,多个备选光标样式可以","号分隔,前面的优先生效*/.imgBig{cursor:url(http://xxx.com/big.cur),-moz-zoom-in}.imgSmall{cursor:url(http://xxx.com/small.cur),-moz-zoom-out}[/code]firefox从1.0开始支...

2009-09-16 08:59:55 260

原创 Asynchronous Flash and XML

[url]http://www.aflax.org/[/url][quote]Aflaxtm stands for Asynchronous Flash and XML. Defined simply, Aflax is a development methodology which combines Ajax and Flash to create more dynamic web base...

2009-08-19 21:25:46 95

原创 ruby-sms

出处:[url]http://raa.ruby-lang.org/project/ruby-sms/[/url][code="ruby"]#!/usr/local/bin/ruby require "serialport.so"require "socket"class SMSController def initialize(bluetoothDevic...

2009-08-19 19:55:09 95

原创 A simple full-text search engine in 200 lines of Ruby

[url]http://eigenclass.org/hiki/simple+full+text+search+engine[/url]

2009-08-18 23:25:30 104

原创 最小的ruby飞鸽客户端--仅可以发消息

飞鸽(IPMSG)在企业局域网内应用还是非常广泛的,我本来想用ruby写个程序可以与之交互,网上一番搜索,发现一日本程序员已经实现了一个ruby版的,略改一下,测试效果不错(原文参见:[url]http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/10343[/url]):[code="ruby"]require "sock...

2009-08-18 21:51:29 104

原创 SVN--POST_COMMIT hook

[code="shell"]@echo offset TEMPDIR=C:\tempset REPOS=%1set REV=%2set RD=%RANDOM%set SVNTOOL=C:\Program Files\Subversion\bin\svn.exeset SVNLOOKTOOL=C:\Program Files\Subversion\bin\svnlook....

2009-08-17 19:18:28 90

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除