2007年11月29日星期四

验证码识别技术 CAPTCHA DECODE

http://www.lafdc.com/captcha/
几乎所有的大型网站都会有某种验证码识别技术来防止机器人注册或对他们的系统进行破坏,上面的网站则给出了一种破解的黑客技术,当然不是免费的,而且根据不同种类的识别码的破解单独还列出了不菲的价格清单。

2007年11月22日星期四

XPATH中定位表格

XPATH中根据表头定位表格
如有个表格如下




aaabbb


要定位不同表头下的表格内容,使内容不受表头位置调换而发生定位错误。














2007年11月21日星期三

Django

Django 是一个快速开发网站项目的Python框架,这世界上什么东西都有。

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Developed and used over two years by a fast-moving online-news operation, Django was designed to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of the experienced Web developers who wrote it. It lets you build high-performing, elegant Web applications quickly.

Django focuses on automating as much as possible and adhering to the DRY principle.

Dive in by reading the overview →

When you're ready to code, read the installation guide and tutorial.

2007年11月20日星期二

微软的宣讲

很多天前在清华开了微软的宣讲,来了几个头头,不过没有开复。
里面几个人,特别是那几个讲台湾普通话的感觉都很有魅力,而一个清华管搜索的感觉特没劲的一个人,说话一点意思都没有。
管人事的大哥也很有趣,说如果你很喜欢你的工作,每天100%的工作时间都是在做自己喜欢做的时,为什么还需要20%的时间干别的事?(这个暗讽谷歌,还有个暗讽百度的,我记性差,过了这么几天就给忘了,总之讽刺得很有才。)

去参加了微软的笔试,才发现与计算机系的学生的差距那么大,什么数据结构、算法分析、编译原理等等都不知道,这类的题都是瞎蒙。最终,没有得到被微软的人当面鄙视的机会。

2007年11月19日星期一

什么是“五险一金”

之前听说过三险一金,今天参加了招聘会,提到了五险一金。上网查了一下,是这样解释的:

《中华人民共和国劳动法》第九章第七十三条规定“劳动者在下列情形下,依法享受社会保险待遇:1、退休,2、患病、负伤,3、因工伤残或者患职业病,4、失业,5、生育。”。
因此,“五险”包括养老保险、医疗保险、工伤保险、失业保险和生育保险,其中养老保险、医疗保险和失业保险,这三种险是由用人单位和个人共同缴纳保费,工伤保险和生育保险完全是由用人单位承担的,个人不需要缴纳。
“一金”指住房公积金。
《国务院关于修改〈住房公积金管理条例〉的决定》第一条中将住房公积金定义为“国家机关、国有企业、城镇集体企业、外商投资企业、城镇私营企业及其他城镇企业、事业单位、民办非企业单位、社会团体及其在职职工缴存的长期住房储金”,住房公积金由用人单位和个人共同缴纳。

四险一金和三险一金都不是全的。

2007年11月18日星期日

KooXoo的技术

今天参加了KooXoo的宣讲会,KooXoo的CEO陈华和技术总监陈欣也参加了。
会前我去厕所,出来的时候还和陈欣擦肩而过。我还以为是个来找工作的博士生。
后来介绍了一下自己的经历和公司的技术,说话挺风趣的。他在百度和微软都工作过,之所以来到刚刚成立的酷讯是因为,在这里他能够得到更多,决定更多;而在百度,股价和自己的收入似乎和自己的努力没有什么关系(这一点,今天刚看到了google的黑板报里面的两位头头给员工的信,里面有对这方面的考虑)。

陈华不知道有没有三十岁,大概和我年龄差不多(在清华熬了9年,自己已经很老了,发现周围都是年轻人)。陈华是所有招聘人员里除了HR之外唯一一个穿着崭新西服,打着还有些发亮的领带的人。陈华站着的时候,两只手垂在两边,对一个没有将军肚的人来说稍显别扭。

KooXoo的HR姐姐(应该是MM)临场发挥的能力可能较差,介绍酷讯的生活工作和待遇的时候基本上都是照着幻灯片念下去,而且对几位公司的头头太过崇拜,显得不够谦虚。不过回答问题时的气质还不错。

酷讯的待遇讲得确实不错,包括股票期权(公司的目标是五年内上市)、五险一补、带薪病假、免费早餐、灵活的上班时间和随意的着装等等。(户口也有尽力争取的承诺。)

最后是问答阶段,有个气鼓鼓的女生一连问了好多问题,不过问题的质量还可以。关于公司的盈利模式和盈利状况,陈华的回答得很直接:还在探索,还没有盈利。

关于技术:酷讯说了很多垂直搜索的细节的技术,比如没有模板的抓取(这个显然是以牺牲数据准确性为代价的)、ajax更新网页的抓取(这个是一个清华的计算机系的人做的,不知道是不是模拟浏览器以抓取数据,这样的数据包括水木社区的内容)、冒泡搜索(这个实际上并不是什么很玄乎的东西,实际上网页浏览的人可能只有中国才有那么多人有闲工夫开着浏览器等新的数据被抓上来)。

关于数据的质量,看了酷讯的招聘信息后发现,他们还有专门打电话核实房源的人,不过在中国这样的信息混乱到处可能是骗子的时候,人肉搜索似乎有其存在的必要性。不过,提到了电话与房源或者火车票的起始地点不在同一个地方的可能是骗子的想法倒是很新颖。

2007年11月13日星期二

Transform XML and apply XSLT in C#

I searched the internet and found two articles:
first from MSDN
using System;
using System.Xml;
using System.Xml.Xsl;
namespace XSLTransformation
{
/// Summary description for Class1.
class Class1
{
static void Main(string[] args)
{
XslTransform myXslTransform;
myXslTransform = new XslTransform();
myXslTransform.Load("books.xsl");
myXslTransform.Transform("books.xml", "ISBNBookList.xml");

}
}
}


The second is from CodeProject

This one is long and you should check it yourself.

2007年11月11日星期日

学习的三个途径:Three ways to learn

参加了一个宣讲会,里面介绍了HR的PPT上面有个关于学习的说法:
10%的课堂学习
20%的边教边学
70%的边干边学

嗯,有点意思。

2007年11月10日星期六

Get the visitor's IP address

http://www.developerfusion.co.uk/show/1626/
James Crowley

Whenever a browser sends a request for a page, it also sends a number of other headers to the script, containing information such as the browser type. It also includes information such as the visitors IP address. This can be particularly useful when creating an online security scan, or logging their IP address in an online forum.

There are two server variables of interest; REMOTE_ADDR and HTTP_X_FORWARDED_FOR. As many visitors access the internet via a third party (ie their ISP), REMOTE_ADDR does not always contain their IP address... it contains their ISP's address. If this is the case, most browsers then store the users IP address in the HTTP_X_FORWARDED_FOR variable. So, first, we check HTTP_X_FORWARDED_FOR, and then if that is empty, we try REMOTE_ADDR instead:

Dim sIPAddress

sIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If sIPAddress="" Then sIPAddress = Request.ServerVariables("REMOTE_ADDR")

One other thing worth bearing in mind. If the user also accesses the internet via a Proxy server, then HTTP_X_FORWARDED_FOR will contain the Proxy's IP address. If this is the case, there is no way to get the users 'real' IP address.


怎样得到访问者的IP地址,比如你想根据IP地址的不同为用户显示不同的内容或者做用户统计。这个量通常存储在ReMOTE_ADDR中,如果这里面没有数据,那么就在HTTP_X_FORWARDED_FOR中。

可以使用下面的函数得到IPAddress

Function IPAddress()
IPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If IPAddress="" Then IPAddress = Request.ServerVariables("REMOTE_ADDR")
End Function

使用下面的函数隐藏最后一位

Function IPAddress2(IPAddress)
IF IsNull(IPAddress) Then
IPAddress2=""
Else
IPAddress2=Left(IPAddress,InStrRev(IPAddress,"."))&"*"
End IF
End Function

2007年11月5日星期一

openlaszlo - 有一个开源网页开发平台

http://www.openlaszlo.org/
OpenLaszlo is the leading open source platform for the development and delivery of rich Internet applications on the World Wide Web.


image
Cinematic user experience™

Applications developed on OpenLaszlo provide a dramatically improved online user experience featuring advanced interfaces delivered on a single Web page. By bringing true application behavior to the Web, OpenLaszlo makes a new generation of online communications, commerce and content services viable for the first time. (more...)


image
Rapid XML development approach

OpenLaszlo applications are written in LZX, a standards-driven XML and JavaScript description language that enables a declarative, text-based development process. LZX supports rapid prototyping, collaborative software development and long term code maintenance. (more...)


image
Scalable deployment architecture

Depending on requirements, OpenLaszlo applications can be deployed either SOLO (Standalone OpenLaszlo Output) or from the OpenLaszlo Server. SOLO deployment supports most use cases and works from any HTTP Web server. OpenLaszlo Server deployment supports additional data integration options, persistent connections and run-time media transcoding. The OpenLaszlo server is Java-based and works with leading J2EE application servers and Java Servlet Containers. OpenLaszlo's standards-based architecture delivers exceptional reliability and scalability, proven in deployments serving millions of users to date. (more...)


Benefits

  • Develop standards-based rich Internet Applications that support any web browser with a single code base in XML and JavaScript

  • Deploy them from any HTTP Web server in SOLO mode, or from a J2EE application server or Java servlet container running the OpenLaszlo Server under Linux, UNIX, Windows or Mac OS X

  • Display them in any Web browser enabled with the Flash 6 Player or above, reaching 96% of all Web-enabled desktops