我感觉http://www.mantisbt.org/很不错呢。
http://en.wikipedia.org/wiki/Comparison_of_issue_tracking_systems
…
我感觉http://www.mantisbt.org/很不错呢。
http://en.wikipedia.org/wiki/Comparison_of_issue_tracking_systems
…
在现代的程序开发中,资源的同步是一个比较重要的课题,在.Net中,对这部分有很丰富类库供我们使用,现在总结一下在各种情况下对资源同步的
机制。
1.将字段声明为volatile
当一个字段被声明为volatile时,CLR中一些管理代码和内存的内部机制将负责对字段进行同步,并且总能保证读取到的字段信息都为最新的值,被声明为
volatile的字段必须具备以下特征之一
1.为引用类型
2.一个指针(在不安全代码中)
3.sbyte,byte,short,ushort,int,uint,char,float,bool
4.一个使用底层类型的枚举类型
2.使用System.Threading.Interlocked 类
在许多增对整数的操作中,我们都比较容易忽视线程的问题,例如执行下列代码
i = i + 1;
实际上,上述代码分为3步骤
1). 从内存中,读取i的值
2). 将读取出来的值加1
3). 将新的值写入内存中
在单线程上,这个操作不会有任何问题,但是当i被多个线程访问时,问题就出现了,对i进行修改的线程,在上述的任何一部都有可能被其它读取线程打断,想象一下,
当操作线程执行完第二步,准备将新的值写入内存中时,此时其它读取线程获得了执行权,这时读取到的i的值并不是我们想要的,因此,这个操作不具备原子性,在.Net中,使用Interlocked类能确保操作的原子性,Interlocked类有以下的方法
Increment
Decrement
Exchange
上述的方法的参数都为带ref 标识的参数,因此我们说,这些方法保证了数据的原子性,在多线程中,涉及到整数的操作时,数据的原子性值得考虑,Interlocked的操作代码如下
如何使用log4net在Web中应用?其实很简单,你只要对程序作如何修改即可:
1.在common中加入log4netHelper.cs
public class log4netHelper
{
public static void debug(string message)
{
log4net.ILog log = log4net.LogManager.GetLogger(“Test”);
if (log.IsDebugEnabled)
{
log.Debug(message);
}
log = null;
}
public static void error(string message)
{
log4net.ILog log = log4net.LogManager.GetLogger(“Test”);
if (log.IsErrorEnabled)
{
log.Error(message);
}…
1. 打开新的窗口并传送参数:
传送参数:
response.write(“<script>window.open(‘*.aspx?id=“+this.DropDownList1.SelectIndex+”&id1=“+...+”‘)</script>“)
接收参数:
string a =
Request.QueryString(“id”);
string b =
Request.QueryString(“id1”);
2.为按钮添加对话框
Button1.Attributes.Add(“onclick”,”return
confirm(‘确认
?’)”);
button.attributes.add(“onclick”,
”if(confirm(‘are you sure...?’)){return
true;}else{return false;}”)
3.删除表格选定记录
int intEmpID
= (int)MyDataGrid.DataKeys[e.Item.ItemIndex];
string
…
deleteCmd = “DELETE from Employee where emp_id =
When I reinstall QQ, there is a problem like:
“application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.”
refer to http://www.sevenforums.com/general-discussion/19958-qq-x_x-side-side-config.html
then download:…
1. Setup your Subversion Server;
2. Setup your repository;
3. Using TortoiseSVN to connect to the repository
a)Import: import your local files to repository;
b)Checkout: get files from your repository and SVN will make hidden files and folders in the …
JQuery: Write less Do more…
http://www.atmarkit.co.jp/fsecurity/rensai/struts01/struts01.html…
模 型–视图–控制器(Model-View-Controller,MVC)体系突出了Servlets和JSP的优点,同时也令它们的缺点最小化。在 实现中,用户请求被发送到一个控制器servlet,该servlet决定请求的性质,并且根据请求的类型传送给适合的处理器。每个处理器都和一个特别的 模型相关,里面封装有商业逻辑来执行一些特别的函数集合。处理完毕后,结果会发送回处理器,处理器选择适合的视图显示它。
Struts最早于2002年5月作为Jakarta项目的组成部分问世,Jakata项目由Apache Foundation.运做。项目的创立者希望该项目的研究改进和提高Java Server Pages (JSPs)、servlet、标签库以及面向对象的技术水准。Struts为使用MVC体系来编写应用提供了一个架构。Struts使用 “ActionMapping”,它允许servlet将用户的请求转变为应用行为。ActionMapping通常指定一个请求的路径、在请求上进行动 作的对象类型,以及指定其它需要的属性。 Action对象作为ActionMapping的一个部分使用,负责处理请求,并且发送响应回适合的视图(通常是一个Web浏览器),或者传送请求至适合的模型。 在模型和视图间的桥是一个form bean,它可以通过继承org.apache.struts.action.ActionForm得到。form bean用来保存处理前的用户数据,或者显示返回给用户的模型数据。Struts包含有自定义的标签,它可以由创建的form bean中自动组合字段。 在实践中用户请求JSP页面,控制器servlet接收请求并决定由哪个应用处理它。Action对象传送该请求到包含有接收商业逻辑的 JavaBean中。商业逻辑bean将连接数据库并进行查询,接收结果,然后返回结果给Action对象。Action对象将结果作为请求的一部分存放 到一个form bean中。一旦收集完请求的全部数据,就可以格式化结果并且显示。最后是JavaServer Page以HTML表格的形式将结果显示出来。 |
1 public static DataTable ConvertDataReaderToDataTable(IDataReader reader)
2 {
3 DataTable objDataTable = new DataTable();
4 int intFieldCount = reader.FieldCount;
5 for (int intCounter = 0; intCounter < intFieldCount; ++intCounter)
6 {
7 objDataTable.Columns.Add(reader.GetName(intCounter), reader.GetFieldType(intCounter));
8 }
9
10…