Javascript 相对文档获取鼠标定位代码

 

function getMousePos(event) {
            var e = event || window.event;
            var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
            var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
            var x = e.pageX || e.clientX + scrollX;
            var y = e.pageY || e.clientY + scrollY;
            //alert('x: ' + x + '\ny: ' + y);
            return { 'x': x, 'y': y };
}

参考链接:http://www.cnblogs.com/dolphinX/archive/2012/10/09/2717119.html

SQL Server 日期转换格式化

Sql Server 中一个非常强大的日期格式化函数
Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06
Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16
Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06
Select CONVERT(varchar(100), GETDATE(), 4): 16.05.06
Select CONVERT(varchar(100), GETDATE(), 5): 16-05-06
Select CONVERT(varchar(100), GETDATE(), 6): 16 05 06
Select CONVERT(varchar(100), GETDATE(), 7): 05 16, 06
Select CONVERT(varchar(100), GETDATE(), 8): 10:57:46
Select CONVERT(varchar(100), GETDATE(), 9): 05 16 2006 10:57:46:827AM
Select CONVERT(varchar(100), GETDATE(), 10): 05-16-06
Select CONVERT(varchar(100), GETDATE(), 11): 06/05/16
Select CONVERT(varchar(100), GETDATE(), 12): 060516
Select CONVERT(varchar(100), GETDATE(), 13): 16 05 2006 10:57:46:937
Select CONVERT(varchar(100), GETDATE(), 14): 10:57:46:967
Select CONVERT(varchar(100), GETDATE(), 20): 2006-05-16 10:57:47
Select CONVERT(varchar(100), GETDATE(), 21): 2006-05-16 10:57:47.157
Select CONVERT(varchar(100), GETDATE(), 22): 05/16/06 10:57:47 AM
Select CONVERT(varchar(100), GETDATE(), 23): 2006-05-16
Select CONVERT(varchar(100), GETDATE(), 24): 10:57:47
Select CONVERT(varchar(100), GETDATE(), 25): 2006-05-16 10:57:47.250
Select CONVERT(varchar(100), GETDATE(), 100): 05 16 2006 10:57AM
Select CONVERT(varchar(100), GETDATE(), 101): 05/16/2006
Select CONVERT(varchar(100), GETDATE(), 102): 2006.05.16
Select CONVERT(varchar(100), GETDATE(), 103): 16/05/2006
Select CONVERT(varchar(100), GETDATE(), 104): 16.05.2006
Select CONVERT(varchar(100), GETDATE(), 105): 16-05-2006
Select CONVERT(varchar(100), GETDATE(), 106): 16 05 2006
Select CONVERT(varchar(100), GETDATE(), 107): 05 16, 2006
Select CONVERT(varchar(100), GETDATE(), 108): 10:57:49
Select CONVERT(varchar(100), GETDATE(), 109): 05 16 2006 10:57:49:437AM
Select CONVERT(varchar(100), GETDATE(), 110): 05-16-2006
Select CONVERT(varchar(100), GETDATE(), 111): 2006/05/16
Select CONVERT(varchar(100), GETDATE(), 112): 20060516
Select CONVERT(varchar(100), GETDATE(), 113): 16 05 2006 10:57:49:513
Select CONVERT(varchar(100), GETDATE(), 114): 10:57:49:547
Select CONVERT(varchar(100), GETDATE(), 120): 2006-05-16 10:57:49
Select CONVERT(varchar(100), GETDATE(), 121): 2006-05-16 10:57:49.700
Select CONVERT(varchar(100), GETDATE(), 126): 2006-05-16T10:57:49.827
Select CONVERT(varchar(100), GETDATE(), 130): 18 ???? ?????? 1427 10:57:49:907AM
Select CONVERT(varchar(100), GETDATE(), 131): 18/04/1427 10:57:49:920AM

Oracle 11G exp 导出空表操作

1、先查询一下当前用户下的所有空表
select table_name from user_tables where NUM_ROWS=0;

2、用以下这句查找空表
select ‘alter table ‘||table_name||’ allocate extent;’ from user_tables where num_rows=0

把第二步查询结果导出的内容在SQL执行后,再导出即可。

[转]在NopCommerce中新建数据表、新建实体Model步骤

本文转自:http://www.cnblogs.com/aneasystone/archive/2012/08/27/2659183.html

在NopCommerce中新增一个Domain Model,需要以下几个步骤:

1. 新建一个Entity Class (Nop.Core.Domain/Entity.cs)

2. 新建一个Mapping Class (Nop.Data/Mapping/EntityMap.cs)

3. 新建一个View Model (Nop.Admin.Models/EntityModel.cs 或 Nop.Web.Models/EntityModel.cs)

4. 新建Model Validator (Nop.Admin.Validators/EntityValidator.cs 或 Nop.Web.Validators/EntityValidator.cs)

5. 为AutoMapper新建映射配置,用来完成Model和Entity之间的转换 (Nop.Admin.Infrastructure/AutoMapperStartupTask.cs 或 Nop.Web.Infrastructure/AutoMapperStartupTask.cs)

6. 编写ToModel和ToEntity (Nop.Admin/MappingExtensions.cs 或 Nop.Web/MappingExtensions.cs)

7. 创建Service和Service Interface (Nop.Services/EntityService.cs 和 Nop.Services/IEntityService.cs)

8. 最后新建的Model创建Controller和View

PS: NopCommerce不支持database migration,需要手动更新数据库。

参考资料:http://www.nopcommerce.com/docs/73/updating-an-existing-entity-how-to-add-a-new-property.aspx

Oracle SQL语句去重查询

1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断

select * from people
where peopleId in (select peopleId from people group by peopleId having count
(peopleId) > 1)

2、删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录

delete from people
where peopleId in (select peopleId from people group by peopleId having count
(peopleId) > 1)
and rowid not in (select min(rowid) from people group by peopleId having count(peopleId
)>1)

3、查找表中多余的重复记录(多个字段)

select * from vitae a
where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having
count(*) > 1)

4、删除表中多余的重复记录(多个字段),只留有rowid最小的记录

delete from vitae a
where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having
count(*) > 1)
and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)

5、查找表中多余的重复记录(多个字段),不包含rowid最小的记录

select * from vitae a
where (a.peopleId,a.seq) in (select peopleId,seq from vitae group by peopleId,seq having
count(*) > 1)
and rowid not in (select min(rowid) from vitae group by peopleId,seq having count(*)>1)

source:http://www.jb51.net/article/34820.htm

IE 兼容性 HTTP 标头

默认使用如下即可:
< meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

无论页面是否包含 指令,均使用 Windows Internet Explorer 7 的标准渲染模式。
< meta http-equiv="X-UA-Compatible" content="IE=7" />

Edge 模式通知 Windows Internet Explorer 以最高级别的可用模式显示内容,这实际上破坏了“锁定”模式
< meta http-equiv="X-UA-Compatible" content="edge" />

XP 远程连接 Windows 2008 以上版本改注册表方法

修改XP注册表以支持使用NLA验证方式进行远程桌面连接。
开始-运行-regedit打开注册表编辑器。
定位到以下注册表键值:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa,双击右侧Security Packages,打开编辑多字符串对话框,在列表中添加 tspkg 。
定位到以下注册表键值:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders,双击右侧的SecurityProviders,打开编辑字符串对话框,在数值数据框中添加 , credssp.dll ,注意逗号后有一个英文的空格。
修改完成重启即可。