What is Clearsilver?
Clearsilver is a fast, powerful, and language-neutral HTML template system. In both static content sites and dynamic HTML applications, it provides a separation between presentation code and application logic which makes working with your project easier.
The design of Clearsilver began in 1999, and evolved during its use at onelist.com, egroups.com, and Yahoo! Groups. Today many other projects and websites using it.
Why use Clearsilver?
High Performance and Language Neutral. Because Clearsilver is written as a C-library, and exported to scripting languages like Python, Perl, Java and Ruby via modules, it is extremely fast. This also means you can work with the same template system independent of the language your project is in.
Pluggable Look and Feel. Clearsilver makes it easy to face lift a site by providing a new set of templates. It is possible to easily run more than one look and feel at once, and share components with a base look and feel to reduce maintenance.
Internationalization Support. Clearsilver makes it trivial to support internationlization. You write your templates in your native language and included tools automatically extract and catalog language strings for translation.
Advanced features. Built in support for advanced features such as gzip compression, smart whitespace stripping, parametric macros, online debugging mode, url and javascript string escaping, and more.
How can I learn more?
The Clearsilver documentation explains both the theory of operation for Clearsilver itself, the C-api, and the extension module APIs.
2007年12月26日星期三
Clearsilver HTML template system
用户登录的管理
http://pajhome.org.uk/crypt/md5/auth.html
Introduction
The most common use of the hash scripts is to protect login passwords. Here I explain how do this in a way that provides as much security as possible.
Improved Persistent Login Cookie Best Practice
Charles Miller's article, "Persistent Login Cookie Best Practice," describes a relatively secure approach to implementing the familiar "Remember Me" option for web sites. In this article, I propose an improvement that retains all the benefits of that approach but also makes it possible to detect when a persistent login cookie has been stolen and used by an attacker.
网站布局设计的相关分析
Layout Design Requirements Analysis Conduct a layout design requirements analysis before you actually design the layout. This will ensure that you create a website look and feel that not only looks good but hits the mark.
- Do you have a logo ready? If not, this is a priority as the site style and colors will have to blend with the logo.
- Do you have a byline ready?
- What do you want the site to communicate?
- What do you want a visitor to do on the site? List the sequence of events you would like the visitor to go through.
- How will you define the success of the site?
- Who is your target audience?
- What kind of colors would your target audience like?
- What kind of graphic style would your target audience like?
- Are there any competitor sites that you would like to use as a benchmark? What are they doing well on their site?
- Are there any sites that have a look and feel that is attractive to your target audience? List them.
- Based on the above criteria have you selected any graphics you would like to use? This is an important step as the layout colors may need to blend with the graphics.
- Have you got the site plan ready? What will be the main menu and sub menu items?
- What should be highlighted throughout the site and on the homepage in particular?
- Will there be a site search? If so, what are the fields and how much space will it occupy?
- Will there be a newsletter signup or login? Will these fields appear on all pages?
- Will you have advertising on the site, if so is there a specified area and size to be allocated for this?
Trac Project Management
一个项目管理系统,用网页作为界面。
http://trac.edgewall.org/
Trac is a lightweight project management tool that is implemented as a web-based application. Trac is written in the Python programming language and needs a database (either SQLite, PostgreSQL, or MySQL works). For HTML rendering, Trac uses the ClearSilver templating system.
2007年12月24日星期一
How to kill a process under DOS/WINDOWS?
http://www.tech-recipes.com/rx/446/xp_kill_windows_process_command_line_taskkill
Use taskkill command.
>>help taskkill
TASKKILL [/S system [/U username [/P [password]]]]
{ [/FI filter] [/PID processid | /IM imagename] } [/T] [/F]
Description:
This tool is used to terminate tasks by process id (PID) or image name.
Parameter List:
/S system Specifies the remote system to connect to.
/U [domain\]user Specifies the user context under which the
command should execute.
/P [password] Specifies the password for the given user
context. Prompts for input if omitted.
/FI filter Applies a filter to select a set of tasks.
Allows "*" to be used. ex. imagename eq acme*
/PID processid Specifies the PID of the process to be terminated.
Use TaskList to get the PID.
/IM imagename Specifies the image name of the process
to be terminated. Wildcard '*' can be used
to specify all tasks or image names.
/T Terminates the specified process and any
child processes which were started by it.
/F Specifies to forcefully terminate the process(es).
/? Displays this help message.
Filters:
Filter Name Valid Operators Valid Value(s)
----------- --------------- -------------------------
STATUS eq, ne RUNNING |
NOT RESPONDING | UNKNOWN
IMAGENAME eq, ne Image name
PID eq, ne, gt, lt, ge, le PID value
SESSION eq, ne, gt, lt, ge, le Session number.
CPUTIME eq, ne, gt, lt, ge, le CPU time in the format
of hh:mm:ss.
hh - hours,
mm - minutes, ss - seconds
MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB
USERNAME eq, ne User name in [domain\]user
format
MODULES eq, ne DLL name
SERVICES eq, ne Service name
WINDOWTITLE eq, ne Window title
NOTE
----
1) Wildcard '*' for /IM switch is accepted only when a filter is applied.
2) Termination of remote processes will always be done forcefully (/F).
3) "WINDOWTITLE" and "STATUS" filters are not considered when a remote
machine is specified.
Examples:
TASKKILL /IM notepad.exe
TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
TASKKILL /F /IM cmd.exe /T
TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*"
TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe
TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM *
TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"
2007年12月20日星期四
FeedPowered Advertising
http://www.pheedo.com/
Advertising, it's time to meet RSS.
Transform your RSS feeds into high-powered advertising
Pheedo’s FeedPowered™ advertising platform converts your RSS feeds into rich, dynamically updating advertising that engages your audience. Leverage your existing RSS assets to extend your brand, drive traffic, and acquire new feed subscribers.
Ads that update...automatically
Pheedo retrieves your RSS feed several times an hour and updates your FeedPowered advertisements with any newly published items. Great for time-sensitive content and frequently updated offers.
Unlock the power of social media
Pheedo's Engagement Triggers™ make it easy for your audience to interact with your brand and share your content and offers with friends - directly from the ad unit.
Video meets RSS
Using RSS to syndicate your video content? Pheedo can super-charge your video distribution efforts with our FeedPowered™ video services.
什么是OpenCV
OpenCV是Intel®开源计算机视觉库。它由一系列 C 函数和少量 C++ 类构成,实现了图像处理和计算机视觉方面的很多通用算法。
[编辑]
重要特性
OpenCV 拥有包括 300 多个C函数的跨平台的中、高层 API。它不依赖于其它的外部库——尽管也可以使用某些外部库。
OpenCV 对非商业应用和商业应用都是免费(FREE)的。(细节参考 license)。
OpenCV 为Intel® Integrated Performance Primitives (IPP) 提供了透明接口。 这意味着如果有为特定处理器优化的的 IPP 库, OpenCV 将在运行时自动加载这些库。 更多关于 IPP 的信息请参考: http://www.intel.com/software/products/ipp/index.htm
http://rssad.jp/ RSS广告
RSS広告社はRSS関連広告、コンテンツ連動型広告のスペシャリストとして、より高い効果のマッチング広告を提供していきます
RSS広告社は、「創造性」と「技術力」をベースに、インターネット広告の世界でイノベーションを起こし続けていく企業です。我々は常に「次に来る波」を追いかけつつ、インターネット広告の新しい可能性を追求していきます。
コンテンツ連動型広告とはhttp://rssad.jp/enlighten.html
Zenoss - Open Source Application, Server, and Network Management
http://www.zenoss.com/product/
Zenoss provides a complete suite of software and services help you succeed in monitoring your IT infrastructure. Our software provides a single, integrated solution for monitoring your entire IT infrastructure - network, servers, applications, across the full lifecycle - inventory, configuration, availability, performance, events.
Through our unique approach our goal is to overcome the common hurdles to achieving effective IT monitoring and management.
RRDTool - logging and graphing Tools
开源的日志和图表工具,Linux下,可以用很多种脚本语言来建立相应的应用程序。
http://oss.oetiker.ch/rrdtool/index.en.htmlLogging & Graphing
RRDtool is the OpenSource industry standard, high performance data logging and graphing system for time series data. Use it to write your custom monitoring shell scripts or create whole applications using its Perl, Python, Ruby, TCL or PHP bindings.
http://www.bugfree.org.cn/
和bugzilla类似的一个中文的Bug管理系统,开源世界似乎喜新厌旧。不过这个是中文用户做的,可能更容易被中国的开发人员接受。
这是一个自由软件,他们甚至在网站上声明不会在任何地方放置广告。
它和Bugzilla的区别在:
BugFree 的7种解决方案都来自于微软内部的bug管理工具Product Studio。按照多年的使用经验,基本涵盖了所有的可能。对比如下:
BugFree Bugzilla 说明 Fixed Fixed 已修复 By Design Invalid 不是问题,设计需求就是这么设计的 Won’t Fix Wontfix 无法修改 Duplicate Duplicate 重复的问题. Not Repro Worksforme 无法重现 External Moved 表示外部原因(比如浏览器、操作系统、其他软件)造成的问题 Postponed Later 以后版本解决 Remind 保留 除了Remind (作为是一种临时的状态,作用不大)是Bugzilla独有的一个解决方案,其他只是名字不同,但作用大致是相同的。
TaskCN.com 任务中国
所谓任务就是某项工作,比如设计公司logo,开发网站,甚至是一句话广告的征集。
在这个网站上明码标价,注册用户可以承接竞标。
适合于各种自由职业的人参与。
2007年12月19日星期三
用javascript禁止右键等盗取网页内容的技巧
http://topic.csdn.net/t/20061220/16/5244445.html
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table oncontextmenu="return(false)"><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="return false;" 防止复制
5. <link rel="Shortcut Icon" href="favicon.ico"> IE地址栏前换成自己的图标
6. <link rel="Bookmark" href="favicon.ico"> 可以在收藏夹中显示出你的图标
7. <input style="ime-mode:disabled"> 关闭输入法
8. 永远都会带着框架
<script language="JavaScript"><!--
if (window == top)top.location.href = "frames.htm"; //frames.htm为框架网页
// --></script>
9. 防止被人frame
<script language="JAVASCRIPT"><!--
if (top.location != self.location)top.location=self.location;
// --></script>
10. 网页将不能被另存为
<noscript><iframe src="">";</iframe></noscript>
11. <input type=button value=查看网页源代码
onclick="window.location = "view-source:"+ "http://www.williamlong.info"">
12.删除时确认
<a href="javascript:if(confirm(" location="boos.asp?&areyou=删除&page=1">删除</a>
13. 取得控件的绝对位置
//Javascript
<script language="Javascript">
function getIE(e){
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent)
alert("top="+t+"/nleft="+l);
}
</script>
//VBScript
<script language="VBScript"><!--
function getIE()
dim t,l,a,b
set a=document.all.img1
t=document.all.img1.offsetTop
l=document.all.img1.offsetLeft
while a.tagName<>"BODY"
set a = a.offsetParent
t=t+a.offsetTop
l=l+a.offsetLeft
wend
msgbox "top="&t&chr(13)&"left="&l,64,"得到控件的位置"
end function
--></script>
14. 光标是停在文本框文字的最后
<script language="javascript">
function cc()
{
var e = event.srcElement;
var r =e.createTextRange();
r.moveStart("character",e.value.length);
r.collapse(true);
r.select();
}
</script>
<input type="text" name="text1" value="123" onfocus="cc()">
15. 判断上一页的来源
javascript:
document.referrer
破解的方法,以上的方法都是利用javascript的相关函数取代一些默认操作的反应,那么如果禁止javascript,整个网页就是不设防的了,你想怎么拷贝就怎么拷贝。
2007年12月17日星期一
PayPal Accounts Review Department.
the link
https://www.paypal.com/us/cgi-bin/webscr?cmd=_login-run
links to another position:http://72-17-174-93.wpb.fdn.com/www.paypal.com/cgi-bin/index.php
which is reported to be a phishing site and blocked by firefox.
Hopefully you don't get hacked!
We recently noticed one or more attempts to log in to your PayPal account from a foreign IP address.
If you recently accessed your account while traveling, the unusual log in attempts may have been initiated by you. However if you are the rightful holder of the account,click on the link below to log into the account and follow the instructions.
https://www.paypal.com/us/cgi-bin/webscr?cmd=_login-run
If you choose not to complete the request, you give us no choice but to suspend your account temporary.
It takes at least 72 hours for the investigation in this case and we strongly recommend you to verify your account at that time.
If you received this notice and you are not the authorized account holder, please be aware that it is in violation of PayPal policy to represent oneself as an other PayPal user.Such action may also be in violation of local, national, and/or international law. PayPal is committed to assist law enforcement with any inquires related attempts to missapropriate personal information with the intent to commit fraud or theft. Information will be provided at the request or law enforcement agencies to ensure that perpetrators are prosecuted to the fullest extent of the law.
Thanks for your patience as we work together to protect your account.
PayPal Account Review Department.
--------------------------------------------------------------------------------
Please do not reply to this email. This mailbox is not monitored and you will not receive a response.
For assistance, log in to your PayPal account and click the Help link located in the top right corner of any PayPal page.
--------------------------------------------------------------------------------
PayPal Email ID PP00145
2007年12月16日星期日
web.archieve.org 网页档案馆
2007年12月13日星期四
怎样修改google的广告?NO!
今天收到了google Adsense的来信,说网站上的搜索框,修改了原来的代码。
为了检索方便,我在google原来的搜索框中添加了默认的关键字,修改了搜索按钮的名字,还有的搜索框,我把google的图标定向到了我们网站的搜索页面。所有的这些都给用户提供了方便,因为用户可以省去输入关键字的麻烦,但是所有这些都违反了Google Adsense的规定。
不过还好,google adsense说给72小时处理,因为有的广告上会马上取消你的帐号,不再让你登录了,你之前的所有收入也都会蒸发掉。
怎样做对google来说比较友好的网页呢,google提供了很多建议,如下面的链接就给出了google给网站管理员的建议。
http://www.google.com/support/webmasters/bin/topic.py?topic=8456
2007年12月9日星期日
2007年12月6日星期四
Chart API
前段时间找到了一个JavaScript的Chart绘图表的代码库,叫做PlotKit
PlotKit is a Chart and Graph Plotting Library for Javascript. It has support for HTML Canvas and also SVG via Adobe SVG Viewer and native browser support.
PlotKit is fully documented and there is a quick tutorial to get you started.
PlotKit is a complete rewrite of CanvasGraph. It is better structured and supported.
这里也有一个画图表的JavaScript Diagram Builder
http://www.lutanho.net/diagram/
The JavaScript Diagram Builder v. 3.3 is a library of some objects and functions, which can help you to display a coordinate diagram (resp. a chart or graph) in your webpage in an easy way. The file 'diagram.js' contains all the necessary objects and functions. This file must be included in the header of your webpage:
今天发现原来google也提供了Chart API http://code.google.com/apis/chart/
而且已经有了中文版的文档,http://labs.cloudream.name/google/chart/api.html
还有图形化生成图片URL代码的网站
http://charts.hohli.com/
还有一个也是在code.google中的JavaScript的Plot库,http://code.google.com/p/flot/
Flot is a pure Javascript plotting library for jQuery. It produces graphical plots of arbitrary datasets on-the-fly client-side.
The focus is on simple usage (all settings are optional), attractive looks and interactive features like zooming.
Although Flot is easy to use, it is also advanced enough to be suitable for Web 2.0 data mining/business intelligence purposes which is its original application.
The plugin is targeting all newer browsers. If you find a problem, please report it. Drawing is done with the
这个库的例子包括官方的例子
http://people.iola.dk/olau/flot/examples/
使用Flot的网站:http://aegis.ucolick.org/products/MTR/explore.html
今天又查了一下YUI,Yahoo提供的免费的一个库,里面也有不错的Chart Control,生成的是swf的图片,有较好的互动效果,如鼠标指的位置显示相应的数据说明。
这里是一个数据说明,当然,缺点是需要用户安装了swf才能看到你的图片结果。
http://developer.yahoo.com/yui/examples/charts/charts-quickstart.html
2007年12月5日星期三
Java Web层框架比较
标 题: Java Web层框架比较 zz
发信站: 水木社区 (Thu Dec 6 00:22:49 2007), 站内
http://hi.baidu.com/darcywang/blog/item/e58c540690d4b078020881ae.html
Java Web层框架比较—— 比较JSF、Spring MVC、Stripes、Struts 2、Tapestry和Wicket2007年11月22日星期四 上午 10:58 【译者按】这是Matt Raible在今年6月24-27号召开的JA-SIG夏季会议上所作的主题演讲,Matt从众多方面对Java Web层框架做了一个全面、深入的比较。笔者认为这是一份及时的文档,它对开发者如何判定一个Web层框架的好坏、如何选择适合自己项目的框架有极大的指导作用。本文是对Matt Raible演讲稿的整理归纳。
【作者介绍】Matt Raible,开源框架AppFuse的发起者、主要开发者;《Professional JSP 2.0》、《Spring Live》等书的作者;众多会议的演讲者,MySQL User Conference, ApacheCon, ApacheCon EU等;现任Raible Designs的CEO。
首先,Matt以自己的实践经验,指出了Java Web层框架——JSF、Spring MVC、Stripes、Struts 2、Tapestry和Wicket他们各自的优、缺点:
JSF
优点:
Java EE标准,这意味着有很大的市场需求和更多的工作机会
上手快速并且相对容易
有大量可用的组件库
缺点:
大量的JSP标签
对REST和安全支持不好
没有一个统一的实现。既有SUN的实现,又有Apache的实现——MyFaces。
Spring MVC
优点:
对覆盖绑定(overriding binding)、验证(validation)等提供生命周期管理
与许多表示层技术/框架无缝集成:JSP/JSTL、Tiles、Velocity、FreeMarker、Excel、XSL、PDF等
便于测试——归功于IoC
缺点:
大量的XML配置文件
太过灵活——没有公共的父控制器
没有内置的Ajax支持
Stripes
优点:
不需要书写XML配置文件
良好的学习文档
社区成员很热心
缺点:
社区比较小
不如其他的项目活跃
ActionBean里面的URL是硬编码的
Struts 2
优点:
架构简单——易于扩展
标记库很容易利用FreeMarker或者Velocity来定制
基于控制器或者基于页面的导航
缺点:
文档组织得很差
对新特征过分关注
通过Google搜索到的大多是Struts 1.x的文档
Tapestry
优点:
一旦学会它,将极大地提高生产率
HTML模板——对页面设计师非常有利
每出一个新版本,都会有大量的创新
缺点:
文档过于概念性,不够实用
学习曲线陡峭
发行周期长——每年都有较大的升级
Wicket
优点:
对Java开发者有利(不是Web开发者)
页面和显示绑定紧密
社区活跃——有来自创建者的支持
缺点:
HTML模板和Java代码紧挨着
需要对OO有较好的理解
Wicket逻辑——什么都用Java搞定
接着,Matt通过采访这些框架的作者,与他们讨论各种开源的Java Web框架,并且突出各个框架的长处、听取框架作者对其他框架的看法,希望借此了解这些框架的未来发展方向。
下列是一些被采访者:
JSF, Jacob Hookom
RIFE, Geert Bevin
Seam, Gavin King
Spring MVC, Rob Harrop
Spring Web Flow, Rob Harrop and Keith Donald
Stripes, Tim Fennell
Struts 1, Don Brown
Tapestry, Howard Lewis Ship
Trails, Chris Nelson
Struts 2, Patrick Lightbody
Wicket, Eelco Hillenius
Matt对采访做了如下总结:
JSF:
如果你想让web应用具有类似桌面程序的功能性,那么JSF的标准规范和大量第三方组件库的支持值得你 信赖。
Spring MVC:
综合了许多不同的技术,这使得它可以被广泛地应用到不同类型的项目中去;它可以被当作web应用开发的一个基础平台。
Stripes:
可以被应用到存在大量复杂数据交互的程序中;有强大的类型转换、绑定和验证功能;可以使管理大的复杂表单以及直接映射它们到域对象变得简单……
Tapestry:
在中到大型项目中,表现突出(当然,你也可以只把它应用到单个页面上),在这些项目中,你可以通过简单地创建新的组件起到杠杆作用。
Struts 2:
通常更适合于那些希望可以真正开始做事并且愿意花费大量时间来学习他们使用的开源工具的小项目组。Struts 2的目标不是那些更喜欢拖放式开发的“扶手椅程序员”。
Wicket:
非常适合于这样的内/外部网应用:UI很复杂并且你希望可以充分利用你的开发者资源。
上面的总结,基本是突出了各个框架的长处。然而,哪些又是他们不好的地方呢?
Matt提出了评价一个框架好坏与否的标准:
Ajax支持 是不是内置了?是否便于使用?
书签能力 用户能否将某个页面收藏起来并且可以方便地返回到该页面?
验证 使用是否简单?是否支持客户端(JavaScript)验证?
可测试性 脱离容器测试控制器,是否足够简单?
提交和重定向 框架如何处理重复提交问题?
国际化 如何支持国际化?控制器利用国际化信息,是否容易?
页面修饰 框架支持哪种类型的页面修饰/组成机制?
社区和技术支持 提出问题,能否被快速地、恭敬地回答?
开发工具 是否有支持这个框架的好的工具,尤其是IDE?
市场需求 学习了这个框架,它能否帮你找到份工作?
岗位数量 在dice.com和indeed.com上,对这个框架技能的需求如何?
笔者认为这个评价标准,值得大家借鉴。
然后,Matt按照这些评价标准,对各个框架做了以下阐述:
Ajax支持
JSF:没有内置的Ajax支持,需要使用ICEfaces和Ajax4JSF
Stripes:没有对应的类库,支持流输出
Struts 2:内置Dojo,有用于GWT和JSON的插件
Spring MVC:没有对应的类库,需要使用DWR和Spring MVC扩展
Tapestry:Tapestry 4.1中,有内置的Dojo
Wicket:有Dojo和Script.aculo.us支持
书签能力
JSF:可以任意提交——URL甚至不被考虑
Stripes:使用约定,但是你可以不加理会
Struts 2:有命名空间的概念,这使得收藏某个页面并返回变得容易
Spring MVC:允许完全的URL控制
Tapestry:依然存在一些丑陋的URL
Wicket:允许装配(mount)页面/URL
验证
JSF:默认的国际化信息丑陋,但是配置简单
Stripes和Wicket:用Java类进行验证——不支持客户端验证
Struts 2:使用OGNL完成强大的表达式验证功能;只有在Action上指定了规则,才支持客户端验证。
Spring MVC:允许你使用公共验证器——这是一种成熟的解决方案
Tapestry:有健壮的验证功能——不需自定义就有漂亮的国际化信息
可测试性
Spring MVC和Struts 2:允许利用mocks(例如EasyMock、jMock和Spring Mocks)简单地进行测试
Tapestry:测试困难,因为页面类被抽象、具体类被简化
JSF:页面类可以方便地被测试,实际上很像Struts 2 中的actions
Wicket:有WicketTester——一个强大的解决方案
Stripes:有Servlet API Mocks和MockRoundtrip
提交和重定向
解决重复提交问题的最简单方法是:在提交后重定向
Spring MVC:允许你将参数加到重定向URL上
Stripes、Tapestry和Wicket:有“flash式”的支持
Struts 2:需要一个自定义的解决方案
JSF:需要一个自定义的解决方案,国际化信息很难加入到页面bean中
国际化
JSTL的
Stripes、Spring MVC和JSF:每个地区使用一个资源绑定文件
Struts 2、Tapestry和Wicket:提倡把每个页面/action用到的资源文件分开
JSF:需要在每个页面上定义资源绑定信息
Tapestry:标签比较可怕
页面修饰
Tiles能够用于Struts 2、Spring MVC和JSF中;需要对每个页面进行配置。
SiteMesh能够用于所有的这些框架中(不推荐在JSF、Tapestry或者Wicket中使用);在设置完成后, 只需要很少的维护。
开发工具
Spring MVC:Spring IDE,但是只做XML校验,不是一个UI/web工具
Struts 2:Eclipse
Tapestry:Spindle,对编码者非常有利
JSF:众多IDE支持,并且做得越来越好
Stripes和Wicket:没有任何官方工具
NetBeans目前支持Struts *、JSF(+Facelets)、Tapestry和Wicket,尚不支持Stripes和Spring MVC
市场需求
Struts 1:需求依然很大并且被广泛使用
Spring MVC:越来越受关注,但大部分是因为Spring框架的一些其他特征
JSF:很快地变得流行起来
Struts 2:正在获得地盘,但是相关的工作机会很少
Tapestry:在过去的数年里,受欢迎程度不断增加
Wicket和Stripes:还是未知数
通过以上的比较,我想大家对在自己的项目中应该选择哪种Web层框架,应该有了更清醒的认识。
最后,Matt列出了一些相关资源,也供读者参考。
Struts - http://struts.apache.org
StrutsTestCase: http://strutstestcase.sf.net
Spring MVC - http://www.springframework.org
Spring IDE: http://www.springide.org
Gaijin Studio: http://gaijin-studio.sf.net
Struts 2 - http://opensymphony.org/webwork
Eclipse Plugin: http://sf.net/projects/eclipsework
?IDEA Plugin: http://wiki.opensymphony.com/display/WW/IDEA+Plugin
Tapestry - http://tapestry.apache.org
http://spindle.sourceforge.net
JSF - http://java.sun.com/j2ee/javaserverfaces and http://myfaces.apache.org
Java Studio Creator: http://sun.com/software/products/jscreator
MyEclipse: http://myeclipseide.com
IDEA: http://www.jetbrains.com/idea
SiteMesh: http://opensymphony.com/sitemesh
Testing Frameworks
JUnit: http://junit.org
EasyMock: http://easymock.org
jMock: http://jmock.org
jWebUnit: http://jwebunit.sourceforge.net
Canoo WebTest: http://webtest.canoo.com
Tapestry Test Assist: http://howardlewisship.com/blog/2004/05/tapestry-test-assist.html
AppFuse - http://appfuse.org
演讲的最后,Matt以一句“If it works, use it!”作为结尾,可谓精辟!
通过此文,相信大家可以拨开当前Java Web层框架选用上的“迷雾”,见得“月明”了。
原演讲稿请参见:http://raibledesigns.com/rd/entry/ja_sig_comparing_java_web。
DOS command for Batch file.
The start command is an internal command that is available in the below Microsoft Operating Systems.
http://www.computerhope.com/starthlp.htm
For some command for the batch file see:
http://www.aumha.org/a/batches.php
2007年11月29日星期四
验证码识别技术 CAPTCHA DECODE
几乎所有的大型网站都会有某种验证码识别技术来防止机器人注册或对他们的系统进行破坏,上面的网站则给出了一种破解的黑客技术,当然不是免费的,而且根据不同种类的识别码的破解单独还列出了不菲的价格清单。
2007年11月22日星期四
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的技术
会前我去厕所,出来的时候还和陈欣擦肩而过。我还以为是个来找工作的博士生。
后来介绍了一下自己的经历和公司的技术,说话挺风趣的。他在百度和微软都工作过,之所以来到刚刚成立的酷讯是因为,在这里他能够得到更多,决定更多;而在百度,股价和自己的收入似乎和自己的努力没有什么关系(这一点,今天刚看到了google的黑板报里面的两位头头给员工的信,里面有对这方面的考虑)。
陈华不知道有没有三十岁,大概和我年龄差不多(在清华熬了9年,自己已经很老了,发现周围都是年轻人)。陈华是所有招聘人员里除了HR之外唯一一个穿着崭新西服,打着还有些发亮的领带的人。陈华站着的时候,两只手垂在两边,对一个没有将军肚的人来说稍显别扭。
KooXoo的HR姐姐(应该是MM)临场发挥的能力可能较差,介绍酷讯的生活工作和待遇的时候基本上都是照着幻灯片念下去,而且对几位公司的头头太过崇拜,显得不够谦虚。不过回答问题时的气质还不错。
酷讯的待遇讲得确实不错,包括股票期权(公司的目标是五年内上市)、五险一补、带薪病假、免费早餐、灵活的上班时间和随意的着装等等。(户口也有尽力争取的承诺。)
最后是问答阶段,有个气鼓鼓的女生一连问了好多问题,不过问题的质量还可以。关于公司的盈利模式和盈利状况,陈华的回答得很直接:还在探索,还没有盈利。
关于技术:酷讯说了很多垂直搜索的细节的技术,比如没有模板的抓取(这个显然是以牺牲数据准确性为代价的)、ajax更新网页的抓取(这个是一个清华的计算机系的人做的,不知道是不是模拟浏览器以抓取数据,这样的数据包括水木社区的内容)、冒泡搜索(这个实际上并不是什么很玄乎的东西,实际上网页浏览的人可能只有中国才有那么多人有闲工夫开着浏览器等新的数据被抓上来)。
关于数据的质量,看了酷讯的招聘信息后发现,他们还有专门打电话核实房源的人,不过在中国这样的信息混乱到处可能是骗子的时候,人肉搜索似乎有其存在的必要性。不过,提到了电话与房源或者火车票的起始地点不在同一个地方的可能是骗子的想法倒是很新颖。
2007年11月13日星期二
Transform XML and apply XSLT in C#
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日星期日
2007年11月10日星期六
Get the visitor's IP address
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 - 有一个开源网页开发平台
OpenLaszlo is the leading open source platform for the development and delivery of rich Internet applications on the World Wide Web.
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...)
Rapid XML development approachOpenLaszlo 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...)
Scalable deployment architectureDepending 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
2007年10月18日星期四
PlotKit
PlotKit
PlotKit is a Javascript graph plotting library. It is aimed at web applications that require plotting series of data in modern web browsers.
PlotKit requires MochiKit. (1.3 or higher)
PlotKit supports both HTML Canvas and SVG, along with an emulated canvas for Internet Explorer.
PlotKit is easily extensible to include other rendering engines, styles and layouts. Please pursue the documentation for more information.
PlotKit is licensed under the BSD License, so you can include it in your free or commercial applications without worrying.
jQuery
jQuery is a new type of JavaScript library.
jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.
"You start with 10 lines of jQuery that would have been 20 lines of tedious DOM JavaScript. By the time you are done it's down to two or three lines and it couldn't get any shorter unless it read your mind." - Dave Methvin
You can find a useful visual reference here :http://visualjquery.com
2007年10月17日星期三
openCascade - 3D modeling & numerical simulation
In short, Open CASCADE Technology Public License is LGPL-like with certain differences. ...
Areas of use
Whether you are a software vendor or an industrial company, a research institute or a University, or an individual developer you will encounter similar issues when developing specific technical and scientific applications.
No matter what your business profile is, Open CASCADE Technology brings you numerous competitive advantages over other modeling kernels. Using Open CASCADE will increase your productivity and will solve very special problems.
To help you evaluate whether Open CASCADE Technology is the right tool for developing your specific applications, we list a few typical examples of applications and show what Open CASCADE offers to speed up their development (see "More about...").
These typical needs can appear in various industrial domains, such as aerospace or automotive sectors, in scientific research or commercial software edition. Discover these and other domains where Open CASCADE Technology has already been successfully applied. Find out about leading companies that already benefited from using it. See our customer list at www.opencascade.com.
A Visual Explanation of SQL Joins
A Visual Explanation of SQL Joins
I thought Ligaya Turmelle's post on SQL joins was a great primer for novice developers. Since SQL joins appear to be set-based, the use of Venn diagrams to explain them seems, at first blush, to be a natural fit. However, like the commenters to her post, I found that the Venn diagrams didn't quite match the SQL join syntax reality in my testing.
I love the concept, though, so let's see if we can make it work. Assume we have the following two tables. Table A is on the left, and Table B is on the right. We'll populate them with four records each.
id name id name
-- ---- -- ----
1 Pirate 1 Rutabaga
2 Monkey 2 Pirate
3 Ninja 3 Darth Vader
4 Spaghetti 4 NinjaLet's join these tables by the name field in a few different ways and see if we can get a conceptual match to those nifty Venn diagrams.
SELECT * FROM TableA
INNER JOIN TableB
ON TableA.name = TableB.name
id name id name
-- ---- -- ----
1 Pirate 2 Pirate
3 Ninja 4 NinjaInner join produces only the set of records that match in both Table A and Table B.
SELECT * FROM TableA
FULL OUTER JOIN TableB
ON TableA.name = TableB.name
id name id name
-- ---- -- ----
1 Pirate 2 Pirate
2 Monkey null null
3 Ninja 4 Ninja
4 Spaghetti null null
null null 1 Rutabaga
null null 3 Darth VaderFull outer join produces the set of all records in Table A and Table B, with matching records from both sides where available. If there is no match, the missing side will contain null.
SELECT * FROM TableA
LEFT OUTER JOIN TableB
ON TableA.name = TableB.name
id name id name
-- ---- -- ----
1 Pirate 2 Pirate
2 Monkey null null
3 Ninja 4 Ninja
4 Spaghetti null nullLeft outer join produces a complete set of records from Table A, with the matching records (where available) in Table B. If there is no match, the right side will contain null.
SELECT * FROM TableA
LEFT OUTER JOIN TableB
ON TableA.name = TableB.name
WHERE TableB.id IS null
id name id name
-- ---- -- ----
2 Monkey null null
4 Spaghetti null nullTo produce the set of records only in Table A, but not in Table B, we perform the same left outer join, then exclude the records we don't want from the right side via a where clause.
SELECT * FROM TableA
FULL OUTER JOIN TableB
ON TableA.name = TableB.name
WHERE TableA.id IS null
OR TableB.id IS null
id name id name
-- ---- -- ----
2 Monkey null null
4 Spaghetti null null
null null 1 Rutabaga
null null 3 Darth VaderTo produce the set of records unique to Table A and Table B, we perform the same full outer join, then exclude the records we don't want from both sides via a where clause.
There's also a cartesian product or cross join, which as far as I can tell, can't be expressed as a Venn diagram:
SELECT * FROM TableA
CROSS JOIN TableBThis joins "everything to everything", resulting in 4 x 4 = 16 rows, far more than we had in the original sets. If you do the math, you can see why this is a very dangerous join to run against large tables.
[advertisement] Axosoft's OnTime 2007 allows software development teams to collaborate and ship software on time. It manages projects hierarchically, tracking defects, requirements, tasks, and help desk incidents in one place. Hosted or installed. Windows or Web. Free SDK and Free single-user license.
Posted by Jeff Atwood Comments (79) 106 blog reactions
Web Development Tutorials
These tutorials are designed to support college-level classes in Web development, but they can provide introductions to these topics for anyone interested. All are works in progress and are being expanded as time permits. They run under Microsoft Server 2003 and .NET Framework 2.0, and have been tested using Microsoft Internet Explorer 6.0 under Windows XP. The current URL is http://it.maconstate.edu/tutorials.These tutorials earned the 2006 MERLOT (Multimedia Educational Resource for Learning and Online Teaching) Information Technology Classics Award for Exemplary Online Learning Resources: http://www.merlot.org. (Awarded August 2006)
Students and professionals world-wide who have taken time to offer constructive comments and suggestions for improving and expanding the materials.
一个在线的教程,有XHTML/CSS, JScript,XML, ASP.NET 2.0 ASP.NET 1.1, PHP和VB等
2007年10月9日星期二
MooTools Javascript开发框架
MooTools is a compact, modular, Object-Oriented JavaScript framework designed for the intermediate to advanced JavaScript developer. It allows you to write powerful, flexible, and cross-browser code with its elegant, well documented, and coherent API.
MooTools code respects strict standards and doesn't throw any warnings. It's well commented and has meaningful variable names: a joy to browse and a snap to understand.这是一个javascript开发框架,良好的跨平台代码,有各种动态效果。
2007年10月8日星期一
fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
fatal error C1083: Cannot open include file: 'windows.h': No such file or directorySolution: You must be using Express Edition of Visual Studio which does not include the win32 SDK:
go to Visual C++ Express Edition home, cilck using Platform SDK, do what ms tells you to do .
2007年10月7日星期日
网站安全快速检查清单
这里是从http://www.googlechinawebmaster.com/转来的一篇文章
网站安全快速检查清单
2007年10月5日 上午 10:01:00
发表者: Nathan Johns, 搜索质量组
原文:Quick security checklist for webmasters
发表于: 2007年9月18日,星期二,12:34AM
最近几个月,失密网站的数量明显增多。一种解释是黑客黑掉了一些网站来发布恶意软件或制造垃圾搜索结果。不论是何原因,这是我们为站长们提供一些网站安全方面的小技巧的好时机。
免责声明:虽然我们收集了很多小贴士以及链接,我们也鼓励管理员“请在家中尝试以下方法”,但是这绝不是一个保护你网站安全的完整清单。我们希望它有帮助,但我们也建议您要对网站安全进行更深入的研究。
- 检查你的服务器配置
- 总是使用最新的软件更新和补丁
人们经常犯的的错误是在自己的网站上安装一个论坛或博客软件,然后就再也不管了。就像你的车总是要保养一样,保持对你安装的任何软件的最新更新也是很重要的。需要一些小贴士?Mark Blair的博客上有一些很好的,包括为你网站上所有的软件和插件列个清单,并跟踪版本号和更新历史。他还建议利用任何软件开发者网站提供的feed。
- 经常留意你的日志文件
养成这个习惯有很多好处,其中之一就是安全性的增加。你可能会对你的发现有些惊讶。
- 检查你的网站,看看有没有常见漏洞
避免存在有开放权限的目录。这几乎就像把你家的前门敞开,门前的垫子上写着“来吧,请随意!” 你也要检查任何xss(跨站点脚本)和SQL注入漏洞。最后,选择好密码。你可以依循Gmail支持中心的一个很好的指南,它会帮助你选择一个密码。
- 警惕第三方内容提供商
如 果你正考虑安装一个由第三方提供的应用软件,例如一个控件,计数器,广告网络,或网络统计服务,一定要非常小心。虽然网络上有很多非常好的第三方内容,有 些提供商也可 能利用这些应用软件来干坏事,例如对你的访客有危险的脚本。要确保应用软件来自有信誉的提供者。他们有一个合法网站吗?他们提供技术支持吗?他们有联系信 息吗?有其他管理员用过该软件吗?
- 尝试在Google上用site:搜索来看看Google索引了你的什么网页
这看似有点明显,但它经常被忽视。对你的网站做一个例检并确保一切正常总是有好处的。不熟悉site:搜索操作?它是一个让你只在一个具体网站上搜索的方法。举例说,搜索 site:googleblog.blogspot.com只会返回谷歌官方(英文)博客的结果。
- 使用谷歌的站长工具
谷歌的站长工具是免费的。它还有各种各样的好功能。譬如,它有关于你的网站的状态数据和管理Googlebot抓取您网站的工具。另一个亮点是,如果谷歌认为你的网站已被攻陷并被放置了恶意软件, 我们的站长控制台会显示更详细的信息,如一些有害网址的样本。一旦你认为恶意软件已经被删除,你可以通过站长工具来要求重新审查。
- 使用安全协议
数据传输应该用SSH和SFTP,而不是象telnet或FTP的纯文本协议。 SSH和SFTP会加密,也就更安全。关于这个和其他许多有用的小技巧,请参考StopBadware.org的清除和保护你的网站的小技巧。
- 阅读谷歌在线安全博客
这个博客上有很多很好的关于线上安全的内容并有指向有用资源的链接。建议你把它加到你的Google Reader Feeds。:)
- 从您的网站寄存服务公司寻求支持
许多网站寄存服务公司都有技术服务组。如果你觉得有点儿不对劲,或者仅仅想确保你的网站是好的,你可以访问他们的网站或给他们打一个电话。
我们希望你能从我们的小贴士中发现有用的信息。如果您想分享你自己的技巧,请为这篇文章发表评论,或者在谷歌站长帮助小组开一个讨论。立即动手,让你的网站更安全!
2007年10月5日星期五
VBScript:object required error
Set a="asdfa"
语句有时会遇到这样的错误:
Microsoft VBScript runtime エラー '800a01a8'
Object required: '[string: "asdfa"]'
/yourfile.asp, 行 36
解决方法:
这里不需要使用set,赋值时直接用等号就可以了,如果是指定对象才用set.
Dim a
a="asfda"
2007年9月25日星期二
HideLinks - Shorten long web addresses and hide bookmarks with a password! favorites-links. export-favorites. add-favorites. favourites-manager.
2007年9月23日星期日
Copy File in C/C++
1) Use System command.
system("copy sourcefile.txt destinyfile.txt");
2)
#include
#include
int main() {
std::ifstream infile("src.dat", std::ios_base::binary);
std::ofstream outfile("dest.dat", std::ios_base::binary);
outfile << infile.rdbuf(); }
3)
使用copy函数,file.copy("fromfile.txt","toFile.txt");
4)
http://groups.google.com/group/perfo/msg/8a74465da4c4e9bb
上面是最详细的使用各种方法进行文件拷贝的介绍,以及速度测试。
2007年9月19日星期三
In Class defined Function are inline function
另外,如果inline函数的调用超过上万次,可能会导致编译出来的代码过长,程序体积过大。
2007年9月14日星期五
MoinMoin Wiki 的源代码加亮功能
http://moinmoin.wikiwikiweb.de/ParserMarket
找到文件后(如找到sql.py, xml.py等等),将这些py文件拷贝到你的wiki目录下的data/plugin/parser
目录下,就可以了。
2007年9月13日星期四
http://www.dynamicdrive.com/
Welcome to Dynamic Drive, the #1 place on the net to obtain free, original DHTML & Javascripts to enhance your web site! Including:
Online Tools
- Image Optimizer
- FavIcon Generator
- Email Riddler
- .htaccess Password
- .htaccess Banning
- Gradient Image
- Button Maker
Support Us
http://www.dynamicdrive.com/
uncaught exception: Permission denied to call method XMLHttpRequest.open
这里有一个解释:
http://www.captain.at/howto-ajax-permission-denied-xmlhttprequest.php
If you want to do cross-domain scripting with XMLHttpRequest, e.g. fetching data from a remote location but you're on a local page or local XUL application (file:///), you need to tell Mozilla/Firefox about that, otherwise you get the infamous error:Error: uncaught exception: Permission denied to call method XMLHttpRequest.open
意思就是说请求外部的一个url的时候,浏览器需要特别的授权。
xmlHttpRequest is not "allowed" to connect to a different website from the one it is running on.
其它的页面也有一些解决方案,就是将浏览器的安全等级降低。
http://blog.monstuff.com/archives/000262.html
但是这个问题实际上无法解决,如果你就是想请求外部的某个连接返回的地址的话。
Compare cURL Features with Other Download Tools
curl
Manual -- curl usage explained
LATEST VERSION
You always find news about what's going on as well as the latest versions
from the curl web pages, located at:
http://curl.haxx.se
SIMPLE USAGE
Get the main page from Netscape's web-server:
curl http://www.netscape.com/
Get the README file the user's home directory at funet's ftp-server:
curl ftp://ftp.funet.fi/README
Get a web page from a server using port 8000:
curl http://www.weirdserver.com:8000/
Get a list of a directory of an FTP site:
curl ftp://cool.haxx.se/
Get the definition of curl from a dictionary:
curl dict://dict.org/m:curl
Fetch two documents at once:
curl ftp://cool.haxx.se/ http://www.weirdserver.com:8000/
Get a file off an FTPS server:
curl ftps://files.are.secure.com/secrets.txt
or use the more appropriate FTPS way to get the same file:
curl --ftp-ssl ftp://files.are.secure.com/secrets.txt
Get a file from an SSH server using SFTP:
curl -u username sftp://shell.example.com/etc/issue
Get a file from an SSH server using SCP using a private key to authenticate:
curl -u username: --key ~/.ssh/id_dsa --pubkey ~/.ssh/id_dsa.pub \
scp://shell.example.com/~/personal.txt
DOWNLOAD TO A FILE
更多内容请查看官方网站上的
http://curl.haxx.se/docs/manual.html
2007年9月12日星期三
JavaScript Error : form submit is not a function under Firefox
There must be an input named "submit":
name="submit" value="1">
so that the browser doesnot know it should action on this button or submit the form.
SOLUTION:
change the input's name into something else.
全角到半角转换的 JavaScript 函数。
function whole2half(text)
{
var txt = "";
for(var i=0; ivar c = text.charCodeAt(i);
if (c >= 0xff01 && c <= 0xff5e) // ASCII 0x21 - 0x7e
txt += String.fromCharCode(0x21 + c - 0xff01);
else if(c == 0x3000) //space
txt += " ";
else
txt += text.charAt(i);
}
return txt;
}
2007年9月11日星期二
RSS Reader - RSS 阅读器的编写
在网上搜索了一下,下面是几个链接。
ASP Based RSS Reader
Taken from http://www.weather.gov/alerts/wwarssget.php?zone=NJZ026 mm
Here is an excellent example of simple coding. Added to our intranet to show recent changes to our Open Wiki
http://www.openwiki.com/ow.asp?p=ASP_Based_RSS_Reader&a=print
A MegaTokyo RSS Feed Reader (ASP)
by John Peterson
The other day, one of my favorite online comics, MegaTokyo, finally added an RSS feed. Being the MT junkie that I am, I instantly decided that I needed to put this on my start page.
If you're not familiar with RSS, you might find XML Files's RSS section helpful.
As I've mentioned in the past, because I spend so much of my time in a browser, I've taken the time to build my own customized start page that runs on my local web server. It contains a number of things that I use on a fairly regular basis. These include search forms for my favorite search engines, a page containing dns, ip addresses, and connection details for my servers, links to sites I visit daily, links to my router config screens, etc. So what's the point? The point is that now it's going to contain the latest headlines from MegaTokyo as well.
Why MegaTokyo?
There are RSS feeds for everything these days. So why did it take me this long to write an ASP script to read one? Simple... because I'm lazy and until now there wasn't a feed I wanted on my homepage. Why did I use classic ASP instead of ASP.NET? Two reasons: there are already scripts everywhere to do this in ASP.NET, and my homepage is still running on classic ASP. I know I could easily convert it, but I think the answer to the first question already adequately covers why I haven't.
To be honest, there's nothing special about the code... it'll work with most any RSS feed. I've done a few things specific to MegaTokyo's feed (like replacing
s with
s for XHTML compliance), but there's really no reason you couldn't use this script with any RSS feed. In fact, we use a very similar script on our homepage to pull in the headlines from DevX's .NET feed. (Before you write, asking me to add headlines for your site, please note that DevX is also owned by Jupitermedia).
http://www.asp101.com/articles/john/megatokyo/default.asp
kwRSS: RSS Reader & Writer
The main aim of this project is to allow easy manipulation of RSS (RDF Site Summary) files, both writing and reading them, in 2 version, the widely used version 0.91 (in FullXML, PHP-nuke, etc), and the latest official version 1.0 (based on RDF specifications by W3C).
kwRSS became popular as it seems to be the only free RSS reader/writer for ASP, it has also been mention in the book "The ABC of Seo" by David George (Lulu Press, February 28, 2005).
kwRSS is made up of 2 ASP classes, one for the reader and the other for the writer. Information on how to used them are in the provided example files in the zip file, easy to understand.
The RSS feeds that are generated are RSS/RDF complaint, and a proof is by clicking on the following link to validate the test feed:
http://www.kattanweb.com/webdev/projects/index.asp?ID=7
2007年9月6日星期四
TinyMCE - web based HTML Editor
TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.
这里是一个例子。
GEOCODE 住所・地名 to Lat Lng
http://pc035.tkl.iis.u-tokyo.ac.jp/~sagara/geocode/
街区レベル位置参照情報本サイトは、東京大学空間情報科学研究センターが提供する「CSVアドレスマッチングサービス」および「シンプルジオコーディング実験」の紹介と使い方を説明します。これらのサービス・実験を初めてご利用の際には、必ず一度下の「CSVアドレスマッチングサービスの紹介」および「シンプルジオコーディング実験の紹介」をご一読下さい。
また、右上の「新規登録」からユーザ登録していただくと、サービス停止などのお知らせをメールで受信したり(設定が必要です)、ご自分のサイトなど関連リンクを追加することができます。
http://nlftp.mlit.go.jp/ksj/
国土数値情報
http://nlftp.mlit.go.jp/isj/
2007年9月5日星期三
开源界面库 Open Source Ultimate Toolbox
We are very happy to announce that we have made the decision to offer our commercial lineup of MFC libraries, including Ultimate Toolbox, Ultimate Grid, and Ultimate TCP/IP to The Code Project community free of charge. These are the full and complete libraries including source code, documentation, samples and examples. The Ultimate Toolbox and line of related MFC libraries products have been powering professional MFC applications for more than 10 years. We realize that there is a very large number of users who are still coding new applications in Visual C++ and MFC and who are looking for effective and proven libraries to enhance their applications, as well as those with legacy Ultimate Toolbox, Ultimate Grid and Ultimate TCP/IP come with full source code, and are compatible with Microsoft Visual Studio versions 6.0 through 2005. By releasing these long standing MFC libraries to The Code Project community we hope that the libraries will continue to grow, evolve and provide a library of useful controls to the development community through the auspices of The Code Project and its members.
iText.NET - Free PDF Library for .NET Framework
What's iText .NET
iText, Java-PDF library, is developed by Mr. Bruno Lowagie, Mr. Paulo Soares and co-workes. This library is available under MPL/LGPL license. iText .NET is iText poring on .NET Framework by J#.
In addition, GNU Classpath, JUnit, and Xerces are ported on the way. Refer iText.NET as an example of transferring Java to .NET.
There are several iText port available. Try iTextSharp and original iText on IKVM along with iText.NET. I recommend you to use iTextSharp for a new .NET project. I'm also using iTextSharp.
2007年9月1日星期六
在ASP中得到网址域名的命令
host=lcase(request.servervariables("HTTP_HOST"))
这样就可以得到HOST名字,例如 www.google.com 或者 localhost:8080
我这样做是为了在网站中的不同二级域名下使用google maps api。
有了上面的函数就可以根据二级域名选择不同的google maps api的key了。
参考网址:http://www.learnasp.com/freebook/asp/server2.aspx
2007年8月30日星期四
Standard Documentation Formats - 参考文献格式的一些介绍
Printable PDF Version
Fair-Use Policy
Traditional Endnotes or Footnotes
MLA Parenthetical System | APA Parenthetical System
Numbered-Note System | Electronic Sources
Different disciplines use their own systems to set out information about sources, but learning one or two of them should serve for most of your studies. These samples of the four main systems show the items of information that different disciplines consider important, as well as the different details of punctuation and indentation they use.
For more thorough advice, see the manuals mentioned with each system or look at general handbooks such as Hacker, Canadian Writer's Reference (PE 1408 H33) or Northey and Procter, Writer's Choice: A Portable Guide for Canadian Students (LB 2369 N677 1998).
(NOTE: The appearance of the examples may be altered by your browser. If in doubt about matters such as spacing or indentation, check the reference works mentioned.) Please note also that many of the examples cited are fictional.
2007年8月28日星期二
RewriteRule ISAPI_rewrite URL rewriting Reference
Here is part of the docs
Introduction
ISAPI_Rewrite is a powerful regular expressions-based URL manipulation engine. It acts mostly like Apache's mod_Rewrite, but it is designed especially for Microsoft Internet Information Server and Microsoft Security and Acceleration Server 2004. If you ever wanted to change your web site's URL scheme, this product is for you!
Some key benefits of ISAPI_Rewrite:
* Speed
ISAPI_Rewrite is extremely fast and highly scalable solution. It is written by using only pure C/C++ code, Win32 API and ISAPI. It uses intelligent configuration cache mechanism. All work is done just in one stage and there are no recursively requests or any other operations that may take a long time.
* Security
ISAPI_Rewrite is designed for operation in a shared environment. It can serve as many sites as you have. ISP and hosting providers can safely permit their users to configure ISAPI_Rewrite and be sure that any configuration changes will affect only local user's environment. ISAPI_Rewrite can even solve many security problems, for example, block an access to some folders or file extensions or create more complex rules.
* Power
Flexibility and power of ISAPI_Rewrite come from its regular expression nature. With regular expressions you don't need to write a thousands check strings. The comparison and replace of URLs can be done with a few string patterns. So, ISAPI_Rewrite can do many things that cannot be done using other solutions available for IIS. See examples section for more information.
Here is something about
Create Dynamic Sub-domains in (Windows/IIS) using isapi_rewrite
Introduction
Do you have a web site that is hosted on a Windows Server that has been growing and now it makes more sense to redefine the architecture and separate that web site into subdomains? In this article, we will be discussing two methods of setting this up. And later in the article, we'll provide you with a comparison analysis and our conclusions.
Requirements
1. Ability to update DNS records
2. IIS web server admin access
3. isapi_rewrite component (for Solution 2)
Solution 1: Create Multiple IIS Web Sites
Setup DNS Server
You have two options. Since you probably have a limited number of subdomains to manage, you can either list them out individually or just use a wildcard.
Wildcard method: Add the following entry into your DNS server and change the domain and IP address accordingly.
*.example.com IN A 1.2.3.4
Declare manually: Add an entry for each of the subdomains.
sub1.example.com IN A 1.2.3.4
sub2.example.com IN A 1.2.3.4
sub3.example.com IN A 1.2.3.4
Setup the Web Server
First make sure you have created a root directory for each of the subdomains, as if you are working with a new web site. Your directory might look like the following:
d:\inetpub\wwwroot\example.com\sub1\
d:\inetpub\wwwroot\example.com\sub2\
d:\inetpub\wwwroot\example.com\sub3\
d:\inetpub\wwwroot\example.com\js\
d:\inetpub\wwwroot\example.com\css\
d:\inetpub\wwwroot\example.com\img\
Next, we create a web site for each of the subdomains. Let's create the first one and you can repeat this for all others.
* Open IIS Management Console
* Click on the Web Sites folder and select New : Web Site
* Click on Next to continue.
* Enter the description for your site then click Next. An example would be: sub1.example.com.
* On the IP Address and Port Setting, enter sub1.example.com into the Host header for this Web site field.
* On the next page, enter the path d:\inetpub\wwwroot\example.com\sub1\
* On the next page, select your options click Next and you're done.
Now here's the fun part. Since you have created a new site for each subdomain, but there are files that are shared across them, such as javascript, style sheets, and images, what you could do is to create a virtual directory to link them to each of the web sites. Here's how you do it.
* Right click on the subdomain you have just created in IIS Management Console and select New : Virtual Directory
* As an example we'll share the style sheet folder (css). Click on Next and enter css in the Alias field.
* Enter the path d:\inetpub\wwwroot\example.com\css\ into the Path field and click on Next.
* Specify the permission on the next page and you're done.
Solution 1: Summary
What we have accomplished here is we have separated your web site into multiple subdomains, while still keeping only one copy of the shared files across them.
Solution 2: Using isapi_rewrite
Whoa! That's a lot of steps to create all the subdomains I want. Is there an easier way? Well there is an alternative way. Let's get started first then we'll run the comparisons.
Setup DNS Server
Add the following entry into your DNS server and change the domain and IP address accordingly.
*.example.com IN A 1.2.3.4
Setup the Web Server
We are assuming that you already have a web site created for your main site: www.example.com. So let's just double check to make sure it will be able to accept all variations of the subdomains.
* Open IIS Management Console and select your web site.
* Right click on it and select Properties.
* Click on Web Site tab.
* Click on Advanced button.
* Make sure there is one entry under the Multiple identities for this Web Site with Host Header Name field blank. This entry will intercept all requests that comes to this IP address.
* Make sure the IP address is only used by this web site.
Setup httpd.ini for isapi_rewrite
Add the following code to your httpd.ini in the web root. Make sure they are in the right order.
# Convert http://example.com to http://www.example.com/
RewriteCond Host: ^example.com
RewriteRule (.*) http\://www\.example.com$1 [I,RP]
# Assuming we have limited number of shared folders.
# We will execute them accordingly regardless of the subdomain.
# Example: http://sub1.example.com/img/logo.jpg -> /img/logo.jpg
# Example: http://www.example.com/img/logo.jpg -> /img/logo.jpg
RewriteRule (/css/.*) $1 [I,O,L]
RewriteRule (/js/.*) $1 [I,O,L]
RewriteRule (/img/.*) $1 [I,O,L]
#Redirect all other subdirectories not matching
#to the list above as subdomains
#example: www.example.com\sub1 -> sub1.example.com
RewriteCond Host: www\.highspeed\.com
RewriteRule /(\w*)/(.*) http\://$1\.example\.com$2 [I,RP]
# If the web site starts with www then point the file to the root folder
# If you specifically created a folder /www/ then you can comment out this section.
RewriteCond Host: (?:www\.)example.com
RewriteRule (.*) $1 [I,O,L]
# Any web site starts other than www will be re-mapped to //
# Example: http://sub1.example.com/default.asp -> /sub1/default.asp
# Note: if the folder does not exists, then the user will get a 404 error automatically.
RewriteCond Host: (.*)\.example.com
RewriteRule (.*) /$1$2 [I,O,L]
#Fix missing slash char on folders
#This has to be at the end because if invalid dir exists,
#we should show 404 first
RewriteCond Host: (.*)
RewriteRule ([^.?]+[^.?/]) http\://$1$2/ [I,RP]
Test the Subdomains
Assuming we have the company website and two subdomains created: sub1, sub2.
URI ヲ Location on Server
http://www.example.com ヲ /
http://sub1.example.com/img/logo.jpg ヲ /img/logo.jpg
http://sub2.example.com ヲ /sub2/
http://abc.example.com ヲ /abc/ -> 404 Not Found
Solution 2: Summary
The second solution is easier to implement and only requires one instance of the website, the user has to be careful about creating the folders. For example, the user can not create a folder d:\inetpub\wwwroot\example.com\sub1\img\ because it would conflict with the isapi_rewrite Rule of (/img/.*). Therefore the files in that folder will not be accessible.
Comparisons
Multiple IIS Webs - Pros
* No conflicts to worry about between folders.
* Separate log files to track them individually.
* Can be setup for server farms and load balancing easily.
Multiple IIS Webs - Cons
* Need to create new site per subdomain.
* Requires access to IIS server.
isapi_rewrite - Pros
* Easy to setup.
* One server instance and log file.
* To add a subdomain, just add a new folder.
isapi_rewrite - Cons
* Need to keep track of directories to avoid conflicts.
* Need dedicated IP address.
* Additional resource for processing each file.
* Need to find server that supports isapi_rewrite.
Conclusion
While isapi_rewrite solution is much easier to implement, it is recommended for smaller sites with one development team. This is because of added resource and exceptions that the team has to keep track of. For a larger site, even though the admin has to setup multiple instances of the servers, these only need to be done once. Plus, the subdomains are probably developed by different teams and are distinct enough to warrant their own web instance.
So which one should you choose? Give the isapi_rewrite a try first. When you think your sites are big enough you can always switch to the other method anytime.
Happy coding!
2007年8月27日星期一
Javascript Reference and Tutorial
http://www.moko.ru/doc/Java_Script/index.html
JavaScript is a compact, object-based scripting language for developing client and server Internet applications. Netscape Navigator interprets JavaScript statements embedded in an HTML page, and LiveWire enables you to create server-based applications similar to Common Gateway Interface (CGI) programs. This book describes the JavaScript language and its use in Navigator. For information on developing server-based JavaScript applications, see the LiveWire Developer's Guide.
2007年7月21日星期六
Sitemaps of Yahoo, Google
http://siteexplorer.search.yahoo.com/
Submit your site or your feed
https://siteexplorer.search.yahoo.com/submit
Generete Yahoo site map
http://www.sitemappro.com/yahoo-sitemap-text-file.html
这里有一些关于 sitemaps的东西,网站比较全。
http://www.xml-sitemaps.com/
谷歌专用的sitemaps 生成工具。
http://gsitecrawler.com/en/download/
http://www.sorrowman.org/sitemap-tools/
Google, Yahoo and Microsoft Agree to Standard Sitemaps Protocol
In an encouraging act of collaboration, Google, Yahoo and Microsoft announced tonight that they will all begin using the same Sitemaps protocol to ...
2007年7月18日星期三
怎样禁止页面图片的右键点击?
这里的OnContextMenu的值设为你希望对方点击右键请求显示上下文目录时要做的事,这里简单地返回失败,所以用户不会看到任何反应。
如果填入 "alert('no right click allowed');return false;"则会弹出警告。
但是这种编码事实上并没有完全隐藏图片,因为图片地址仍然在网页的源代码中。
2007年7月14日星期六
SpiderinNET
微软网站上的一个Spider代码,用VB.NET编写的。有源代码和程序下载。
SUMMARY
Visual Basic .NET comes loaded with features not available in previous versions, including a new threading model, custom class creation, and data streaming. Learn how to take advantage of these features with an application that is designed to extract information from Web pages for indexing purposes. This article also discusses basic database access, file I/O, extending classes for objects, and the use of opacity and transparency in forms.
Conclusion
My company's clients currently use Spider to retrieve information from local, state, and national sites. With some tweaking, the spider can be used to get address listings from public Yellow Pages, or articles related to certain topics from all over the Web. It could even be used to retrieve newsgroup postings from a news server. Any Web page can be crawled (as long as you obtain permission for copyrighted material first). Information obtained can be placed in a database for later analysis.
Visual Basic .NET comes with many new and exciting features. With time and a little perseverance, you'll learn when to use each. Improved array and error handling, GUI tricks, and stream support are just some of the tools that you have at your disposal when programming in Visual Basic .NET. Go out and discover some more for yourself.
Back to top
2007年7月12日星期四
Genghis Group Tools - C# WinForms 库
Genghis is a set of extensions built on top of .NET and integrated with WinForms to provide application-level services in the same flavor as the Microsoft Foundation Classes. Genghis gets its name as the functional heir to Attila, a similar set of functionality built on top of ATL.
Genghis is written in C#. Building Genghis requires Visual C# or Visual Studio.NET. Visual Studio.NET solution and project files (*.sln and *.csproj) are provided to build Genghis and all the samples. You should be able to load any solution file into Visual C#/Visual Studio.NET and build the project for yourself.
它包括如下的类
Command line parser
Completion combo
Control hosting status bar
Cursor changer
Custom check state treeview
Custom XP theming controls
File Search Engine
FileDocument class (doc/dirty bit management)
FindReplaceDialog
FolderNameDialog
HandleCollector for the world
Header group box control
Image combo
More robust validation ala WebForms
Most-Recently-Used (MRU) files support
MSN Messenger-style popup window
Multiple Top-Level Windows
Multiple-instance detection
Path resolution b/w UNC, local (including SUBST, etc)
Retrieving mapped drives
Retrieving shares
Screen Saver class
Scrollable Picture Box
Sorting listview (including the little triangle thingy)
Splash Screen class
Status Bar Extender
WebCommandLineHelper
Window serializer
Wizard framework
HtmlLinkLabel class
User-resizable panel
Gradient Progress Bar
Command updating
Cool bars/Cool menus
Docking App Bar
下载地址在这里 http://www.codeplex.com/genghis/Release/ProjectReleases.aspx?ReleaseId=4759
2007年7月4日星期三
TortoiseSVN 教程
TortoiseSVN是一个简单的Windows桌面客户端。和Windows资源管理器结合地比较好。能够用图标反映文件的状态。
下面链接对应的教程是个简单的,针对单机开发者的SVN教程,图文并茂,非常详细。
链接地址如下:
http://www.codeproject.com/gen/work/XTortoiseSVN.asp
ankhsvn - SVN plugin for VS .NET
AnkhSVN: A Subversion addin for Microsoft Visual Studio .NET
一个 Microsoft Visual Studio .NET的版本管理插件,使用的是现在比较流行的SVN.
下载在这里
http://ankhsvn.tigris.org/servlets/ProjectDocumentList?folderID=7315
更多屏幕截图:http://ankhsvn.tigris.org/screenshots.html
AnkhSVN is a Visual Studio .NET addin for the Subversion version control system. It allows you to perform the most common version control operations directly from inside the VS.NET IDE. Not all the functionality provided by SVN is (yet) supported, but the majority of operations that support the daily workflow are implemented.
2007年7月3日星期二
Tools to Backup your blog in blogger 备份你的Blogger
工具是开源的。
备份之后可以使用Blogger's API 来把 Blogger 再恢复过来。
http://googlesystem.blogspot.com/2007/07/tool-for-backing-up-blogger-blog.html
2007年6月30日星期六
Quirks mode 比较好和全的CSS教程
这里是一个比较好的CSS教程的链接,同一个网站上还有站长的其它的信息。
2007年6月27日星期三
Release 和 Debug的另外两篇文章
By Joseph M. Newcomer.
Learn about the issues and differences between Debug and Release builds.
另一篇是
Release mode debugging with VC++
2007年6月20日星期三
Debug Error! HEAP CORRUPTION DETECTED: before Normal block...
Debug Error!
Program: ...
HEAP CORRUPTION DETECTED: before Normal block(#-1840241472) at 0x004E1550.
CRT detected that the application wrote to memory before start of heap buffer.
Correct the usage of b[-1].
还是动态分配内存的问题,但是用MSVC或Microsoft Visual C++ Express,报错的地方为
delete[] a;
但是,最终找到的出错的地方并不一定和a有关系,错误是另一个动态分配的数组调用时使用了 b[-1],所以上面的错误是 "before Normal..."
2007年6月19日星期二
UNIX Job Control
上网查了一下,答案在下面的文章里找到了,原来Control-Z不仅仅对Emacs有效,而是Unix系统里面控制作业进程的通用命令,而将后台的程序调到前台,则需要用%emacs来实现,可以用 jobs 或者 ps查询正在后台执行的作业或进程。
http://www.bu.edu/cc/support/aboutunix/general/jobcontrol/
UNIX Job Control
Any command or any sequence of commands joined by semicolons or by a pipeline is known as a job. Jobs can be suspended and resumed later or they can run "in the background." Background jobs are programs which have been executed in such a way that they return the shell prompt to you while they continue to operate, independent of the shell where they were created. The C shell has a number of built-in functions which enable you to control multiple jobs interactively. Note: running jobs in the background can be useful but may put an excessive load on the system if overused. The 'jobs' command will give you a list of active jobs.
Background and foreground jobs
A program can be run in the background by executing its command line with '&' at the end. For example, you could compile a 'c' program in the background.
% cc other.c -o oter &
%
Then, while the compilation proceeds, you could do some other work, such as edit some files with Emacs.
Later, you might have a new idea and decide that you want to change the source program for your c program to include the new idea. If you don't need the c program to finish its compilation, you could suspend Emacs with ^Z and then stop the compiler by using the kill command.
^Z (Suspend emacs)
Stopped (shell acknowledges)
% jobs
[1] Running cc other.c -o oter (jobs responds)
% kill %1
[1] Killed cc other.c -o oter (kill responds)
While you are at the shell prompt, you could pause to look for mail before resuming emacs:
No mail for you (mail responds)
% jobs
[1] +Stopped emacs (jobs responds)
% %1 (resume emacs)
In other words, you can resume a job that is stopped by typing %n where 'n' is its job number (the number that the 'jobs' command prints between [ and ]), and you can kill a suspended or stopped job. In fact, if you find yourself caught in a program and don't know how to get out of it, you can suspend the job and then kill it when you get back to the shell prompt. The scope of the 'jobs' command is limited to the shell that it runs under. Job numbers are con- venient references to processes under the control of a single shell.
If you have a job running under another shell that you want to stop, such as at another terminal (for example, you left a job running in the background -- some jobs will keep running), you can use the 'ps' command to find its Process ID (PID, a unique number used by the operating system to identify each process). You can then use the PID to kill the job with the 'kill' command.
% ps
PID TT STAT TIME COMMAND
23444 h4 R 0:00 ps
7158 ic R N 12:33 lisp
%
% kill 7158 (kill a procees by its PID number)
% ps
PID TT STAT TIME COMMAND
23555 h4 R 0:00 ps
%
If you try this method and the job still isn't gone, more drastic methods are needed. Add the -KILL (0r '-9' on some systems) flag as in:
% kill -KILL 7158
No program under UNIX can trap the KILL signal. Just 'kill' sends a -TERM (terminate) signal. This usually works, but if not, -KILL is a sure hit.
Command summary
& run in the background
Z suspend the current job
C interrupt (usually kill) current job
(some programs, such as editors trap
this -- so that a typo won't abruptly
terminate your editing session, losing
your most recent, unsaved work.)
D signal end of input
(log off shell, if issued at top level)
jobs display jobs running from this shell
ps display jobs you are running
ps -g display all jobs and login shells also
kill %n kill a job by job number
kill PID kill a job by process id number
kill -KILL PID a sure kill
('kill -9 PID' on some UNIX versions)
Notes
1. You cannot kill processes you don't own, but you can log in from another terminal and kill a job that has "locked up" your current terminal.
2. Killing your login shell (try 'ps -g') will log you out (Remember, you could force yourself off from a different terminal. When you examine the output of ps, look for the '-csh' commands. If you had an edit session active, you might try 'kill -HUP ###' as that simulates hanging up the 'phone' and most editors will try to preserve interrupted work.)
References
For further information, see the online manual pages or one of the many general books on using the UNIX files system. Information Technology sponsors tutorials on UNIX and other subjects during the academic year and distributes printed handouts on a selection of related subjects.