在商业环境中,绝大多数超越第3范式的设计都是不切实际的。因为应用程序在3NF级别就能变现的相当出色。我们上述的很多例子,将指向箭头反过来就是先了反范式化。所以我们要对整体的结构有个比较深的认识,才确定我们是否范式话或者反范式化,范式化越深的东西越导致表的增多,也就意味着查询的join开销。
     总结一下反范式化的一些准则:
     分离活动和静态的数据,数据可分为独立的物理表,即
      活动和静态表。那些累计的历史数据导致我们占据了绝大多数的空间。这是影响性能的最经常的数据,在数据仓库设计中,我们经常将无效的静态的数据移植到数据仓库中,由于OLAP和数据挖掘。
     在表之间复制字段,在那些不是直接有链接表的之间复制字段,使得我们不必每次进行查询都要通过第3方表,越少的join操作,使得性能的大幅度提升。
     在夫表中建立统计字段,这样可以减去消耗大的聚合操作,但是实时更新会给我们带来另外的麻烦。
     分离繁重和轻松的字段,就像把活动和静态的数据数据表分离一样,这个避免持续物理扫描很少使用的数据字段,尤其是当这些字段不包含空值。这是一个潜在的合理利用4NF在分离表格分为两个表格,相关的一对一关系。
posted @ 2009-11-29 22:54 yuhe7919 阅读(78) | 评论(0) |  编辑

在使用jquery.ui.dialog的过程中,发现position参数有些问题,无法通过position: [PosX, PosY]动态传递位置参数。下面是官方demo 代码:

 $("#dialog").dialog({
                bgiframe: true,
                autoOpen: false,
                position: [PosX, PosY], //alert 出来为:"  ,  "(不含双引号),或者报错,不知什么原因。              
                height: 300,
                modal: true
                buttons: {
                    
'创建新账号'function() {
                        
var bValid = true;
                        allFields.removeClass('ui-state-error');

                        bValid = bValid && checkLength(name, "username"316);
                        bValid = bValid && checkLength(email, "email"680);
                        bValid = bValid && checkLength(password, "password"516);

                        bValid = bValid && checkRegexp(name, /^[a-z]([0-9a-z_])+$/i, "Username may consist of a-z, 0-9, underscores, begin with a letter.");
                        
// From jquery.validate.js (by joern), contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
                        bValid = bValid && checkRegexp(email, /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i, "eg. ui@jquery.com");
                        bValid = bValid && checkRegexp(password, /^([0-9a-zA-Z])+$/, "Password field only allow : a-z 0-9");

                        if (bValid) {
                            $('#users tbody').append('<tr>' +
                            
'<td>' + name.val() + '</td>' +
                            '<td>' + email.val() + '</td>' +
                            
'<td>' + password.val() + '</td>' +
                            
'</tr>');
                            $(this).dialog('close');
                        };
                    },
                    取消: function() {
                        $(this).dialog('close');
                    }
                },

                close: function() {
                    allFields.val('').removeClass('ui-state-error');
                }

            }); 

        后来参考"wind"的为jquery.ui.dialog 增加“自动记住关闭时的位置”的功能。,在他的建议下,完全照葫芦画瓢写了个jquery.ui.dialog的重载方法,实现在鼠标当前位置打开dialog

       代码如下: 

 ///////////////////////////////////

///////////////////////////////////
//
指定 jquery.ui.dialog打开时的位置
//
/////////////////////////////////
(function($) {
    
var originOpen = $.ui.dialog.prototype.open
    $.ui.dialog.prototype.open 
= function() {
        
//var     event= window.event || arguments.callee.caller.arguments[0];
        //var event = event || window.event;
        var event = getEvent();
        
//alert(event) // ie 和 ff下,都显示 "[object]" 
        var PosX = 0;
        
var PosY = 0;
        
if (event.pageX || event.pageY) {
            PosX 
= event.pageX;
            PosY 
= event.pageY;
        }
        
else {
            PosX 
= event.clientX + document.body.scrollLeft - document.body.clientLeft;
            PosY 
= event.clientY + document.body.scrollTop - document.body.clientTop;
        };
        
this.options.position = [PosX, PosY];
        
//alert(this.options.position);
        originOpen.apply(this, arguments);
    };

    
function getEvent() { //同时兼容ie和ff的写法 
        if (document.all) return window.event;
        func 
= getEvent.caller;
        
while (func != null) {
            
var arg0 = func.arguments[0];
            
if (arg0) {
                
if ((arg0.constructor == Event || arg0.constructor == MouseEvent)
                    
|| (typeof (arg0) == "object" && arg0.preventDefault && arg0.stopPropagation)) {
                    
return arg0;
                }
            }
            func 
= func.caller;
        }
        
return null;
    }
})(jQuery);

  

 再次感谢"wind"。感谢 jww测试。(已兼容ie7,8,firefox3.5,chrome4) 

posted @ 2009-11-24 11:21 yuhe7919 阅读(174) | 评论(1) |  编辑

javascript事件查询



javascript事件查询综合(转)
javascript事件查询综合
click() 对象.click() 使对象被点击。
closed 对象.closed 对象窗口是否已关闭true/false
clearTimeout(对象) 清除已设置的setTimeout对象
clearInterval(对象) 清除已设置的setInterval对象
confirm("提示信息") 弹出确认框,确定返回true取消返回false
cursor:样式 更改鼠标样式 hand crosshair text wait help default auto e/s/w/n-resize
event.clientX 返回最后一次点击鼠标X坐标值;
event.clientY 返回最后一次点击鼠标Y坐标值;
event.offsetX 返回当前鼠标悬停X坐标值
event.offsetY 返回当前鼠标悬停Y坐标值

document.write(document.lastModified) 网页最后一次更新时间
document.ondblclick=x 当双击鼠标产生事件
document.onmousedown=x 单击鼠标键产生事件

document.body.scrollTop; 返回和设置当前竖向滚动条的坐标值,须与函数配合,
document.body.scrollLeft; 返回和设置当前横向滚动务的坐标值,须与函数配合,
document.title document.title="message"; 当前窗口的标题栏文字
document.bgcolor document.bgcolor="颜色值"; 改变窗口背景颜色
document.Fgcolor document.Fgcolor="颜色值"; 改变正文颜色
document.linkcolor document.linkcolor="颜色值"; 改变超联接颜色
document.alinkcolor document.alinkcolor="颜色值"; 改变正点击联接的颜色
document.VlinkColor document.VlinkColor="颜色值"; 改变已访问联接的颜色
document.forms.length 返回当前页form表单数
document.anchors.length 返回当前页锚的数量
document.links.length 返回当前页联接的数量
document.onmousedown=x 单击鼠标触发事件
document.ondblclick=x 双击鼠标触发事件
defaultStatus window.status=defaultStatus; 将状态栏设置默认显示

function function xx(){...} 定义函数
isNumeric 判断是否是数字
innerHTML xx=对象.innerHTML 输入某对象标签中的html源代码
innerText divid.innerText=xx 将以div定位以id命名的对象值设为XX

location.reload(); 使本页刷新,target可等于一个刷新的网页

Math.random() 随机涵数,只能是0到1之间的数,如果要得到其它数,可以为*10,再取整
Math.floor(number) 将对象number转为整数,舍取所有小数
Math.min(1,2) 返回1,2哪个小
Math.max(1,2) 返回1,2哪个大

navigator.appName 返回当前浏览器名称
navigator.appVersion 返回当前浏览器版本号
navigator.appCodeName 返回当前浏览器代码名字
navigator.userAgent 返回当前浏览器用户代标志

onsubmit onsubmit="return(xx())" 使用函数返回值
opener opener.document.对象 控制原打开窗体对象

prompt xx=window.prompt("提示信息","预定值"); 输入语句
parent parent.框架名.对象 控制框架页面

return return false 返回值
random 随机参数(0至1之间)
reset() form.reset(); 使form表单内的数据重置

split("") string.split("") 将string对象字符以逗号隔开
submit() form对象.submit() 使form对象提交数据

String对象的 charAt(x)对象 反回指定对象的第多少位的字母
lastIndexOf("string") 从右到左询找指定字符,没有返回-1
indexOf("string") 从左到右询找指定字符,没有返回-1
LowerCase() 将对象全部转为小写
UpperCase() 将对象全部转为大写
substring(0,5) string.substring(x,x) 返回对象中从0到5的字符
setTimeout("function",time) 设置一个超时对象
setInterval("function",time) 设置一个超时对象

toLocaleString() x.toLocaleString() 从x时间对象中获取时间,以字符串型式存在
typeof(变量名) 检查变量的类型,值有:String,Boolean,Object,Function,Underfined

window.event.button==1/2/3 鼠标键左键等于1右键等于2两个键一起按为3
window.screen.availWidth 返回当前屏幕宽度(空白空间)
window.screen.availHeight 返回当前屏幕高度(空白空间)
window.screen.width 返回当前屏幕宽度(分辨率值)
window.screen.height 返回当前屏幕高度(分辨率值)
window.document.body.offsetHeight; 返回当前网页高度
window.document.body.offsetWidth; 返回当前网页宽度
window.resizeTo(0,0) 将窗口设置宽高
window.moveTo(0,0) 将窗口移到某位置
window.focus() 使当前窗口获得焦点
window.scroll(x,y) 窗口滚动条坐标,y控制上下移动,须与函数配合
window.open() window.open("地址","名称","属性")
属性:toolbar(工具栏),location(地址栏),directions,status(状态栏),
menubar(菜单栏),scrollbar(滚动条),resizable(改变大小), width(宽),height(高),fullscreen(全 屏),scrollbars(全屏时无滚动条无参 数,channelmode(宽屏),left(打开窗口x坐标),top(打开窗口y坐标)
window.location = 'view-source:' + window.location.href 应用事件查看网页源代码;


a=new Date(); //创建a为一个新的时期对象
y=a.getYear(); //y的值为从对象a中获取年份值 两位数年份
y1=a.getFullYear(); //获取全年份数 四位数年份
m=a.getMonth(); //获取月份值
d=a.getDate(); //获取日期值
d1=a.getDay(); //获取当前星期值
h=a.getHours(); //获取当前小时数
m1=a.getMinutes(); //获取当前分钟数
s=a.getSeconds(); //获取当前秒钟数


对象.style.fontSize="文字大小";
单位:mm/cm/in英寸/pc帕/pt点/px象素/em文字高
1in=1.25cm
1pc=12pt
1pt=1.2px(800*600分辩率下)

文本字体属性:
fontSize大小
family字体
color颜色
fontStyle风格,取值为normal一般,italic斜体,oblique斜体且加粗
fontWeight加粗,取值为100到900不等,900最粗,light,normal,bold
letterSpacing间距,更改文字间距离,取值为,1pt,10px,1cm
textDecoration:文字修饰;取值,none不修饰,underline下划线,overline上划线
background:文字背景颜色,
backgroundImage:背景图片,取值为图片的插入路径


点击网页正文函数调用触发器:

1.onClick 当对象被点击
2.onLoad 当网页打开,只能书写在body中
3.onUnload 当网页关闭或离开时,只能书写在body中
4.onmouseover 当鼠标悬于其上时
5.onmouseout 当鼠标离开对象时
6.onmouseup 当鼠标松开
7.onmousedown 当鼠标按下键
8.onFocus 当对象获取焦点时
9.onSelect 当对象的文本被选中时
10.onChange 当对象的内容被改变
11.onBlur 当对象失去焦点
onsubmit=return(ss())表单调用时返回的值

直线 border-bottom:1x solid black
虚线 border-bottom:1x dotted black
点划线 border-bottom:2x dashed black
双线 border-bottom:5x double black
槽状 border-bottom:1x groove black
脊状 border-bottom:1x ridge black
posted @ 2009-11-23 15:13 yuhe7919 阅读(45) | 评论(0) |  编辑

New Features

This section describes features that have been introduced in the ASP.NET MVC 2 Beta release.

New RenderAction Method

Html.RenderAction (and its counterpart Html.Action) is an HTML helper method that calls into an action method from within a view and renders the output of the action method in place. Html.RenderAction writes directly to the response, whereas Html.Action returns a string with the output. RenderAction works only with actions that render views.

Strongly Typed UI Helpers

ASP.NET MVC 2 includes new expression-based versions of existing HTML helper methods. The new helpers include the following:

·         ValidationMessageFor

·         TextAreaFor

·         TextBoxFor

·         HiddenFor

·         DropDownListFor

TempDataDictionary Improvements

The behavior of the TempDataDictionary class has been changed slightly to address scenarios where temp data was either removed prematurely or persisted longer than necessary. For example, in cases where temp data was read in the same request in which it was set, the temp data was persisting for the next request even though the intent was to remove it. In other cases, temp data was not persisted across multiple consecutive redirects.

To address these scenarios, the TempDataDictionary class was changed so that all the keys survive indefinitely until the key is read from the TempDataDictionary object. The Keep method was added to TempDataDictionary to let you indicate that the value should not be removed after reading. The RedirectToActionResult is an example where the Keep method is called in order to retain all the keys for the next request.

Client Validation Library

MicrosoftMvcAjax.js now includes a client-side validation library that is used to provide client validation for models in ASP.NET MVC. To enable client validation, include the following two scripts in your view.

·         MicrosoftAjax.js

·         MicrosoftMvcAjax.js

The following example shows a view with client validation enabled.

<script type="text/javascript" src="MicrosoftAjax.js"></script>

<script type="text/javascript" src="MicrosoftMvcAjax.js"></script>

 

<% Html.EnableClientValidation(); %>

<% using(Html.BeginForm()) { %

 //...

<% } %>

“Add Area” Dialog Box

ASP.NET MVC 2 Beta includes a new Add Area context menu item when you right-click either the root project node or the Areas folder (if one exists). If a root Areas folder does not already exist, the command creates one, and it then creates the files and folders for the area that you specify.

Calling Action Methods Asynchronously

The AsyncController class is a base class for controllers that enables action methods to be called asynchronously. This lets an action method call external services such as a Web service without blocking the current thread. For more information, see Using an Asynchronous Controller in ASP.NET MVC In the ASP.NET MVC 2 documentation.

Blank Project Template

In response to customer feedback, an empty ASP.NET MVC project template is now included with ASP.NET MVC 2 Beta. This empty project template contains a minimal set of files used to build a new ASP.NET MVC project.

Multiple Model Validator Providers

ASP.NET MVC 2 Beta lets you register multiple validation providers. The following example shows how to register multiple providers.

protected void Application_Start() {

    ModelValidatorProviders.Providers.Add(new MyXmlModelValidatorProvider());

    ModelValidatorProviders.Providers.Add(new MyDbModelValidatorProvider());

    //...

}

Multiple Value Provider Registration

In ASP.NET MVC 2 Beta, the single value provider that was available in ASP.NET MVC 1.0 has been split into multiple value providers, one for each source of request data. The new value providers include the following:

·         FormValueProvider

·         RouteDataValueProvider

·         QueryStringValueProvider

·         HttpFileCollectionValueProvider

These value providers are registered by default. You can register additional value providers that pull data from other sources. The following example shows how to register additional value providers in the in Global.asax file.

protected void Application_Start() {

    ValueProviders.Providers.Add(new JsonValueProvider());

    //...

}

Other Improvements

The following additional changes have been made to existing types and members for ASP.NET MVC 2 Beta.

·         The build task for multi-project areas has been removed and placed in the ASP.NET MVC Futures project.

·         A new GetDisplayName method was added to the ModelMetadata class.

·         A new IsComplexType property was added to the ModelMetadata class.

·         Default object templates display only top-level properties of a model and do not attempt to recursively display properties of the properties of the model.

·         ViewDataDictionary<T> now allows value types for the Model property.

·         A new HideSurroundingHtml property was added to the ModelMetadata class. This is used to indicate that the HTML “chrome” surrounding a field in a template should not be displayed.

·         Templated helpers now support byte[] and System.Linq.Binary properties on the model. When the HiddenInput UI hint attribute is applied to properties of these types, the editor template will Base-64-encode the value of these properties in a hidden input element.

·         A new AdditionalValues dictionary property was added to the ModelMetadata class.

·         A new RouteLink method overload was added that requires only two parameters, link text and the route name.

·         A new protected virtual CreateTempDataProvider method was added to the Controller class. This allows you to supply a custom derived TempDataProvider object by overriding that method.

·         When the model is binding to a collection, the DefaultModelBinder object no longer requires collection indexes to be an unbroken ascending sequence of positive integers.

·         A new Ajax.Escape method was added that lets you escape JavaScript strings.

·         The default templates for the Decimal type now format values to two decimal places.

·         GenerateUrl is now a public method of UrlHelper.

·         The AccountController class in the default template was updated to make use of the template helpers and data annotations.

·         Modified the default T4 templates for the Add View dialog to emit expression based helpers. Also removed the validation summary.
下载地址:asp.net mvc beta下载

posted @ 2009-11-18 09:37 yuhe7919 阅读(197) | 评论(0) |  编辑
squidclient.exe -p 80 "http://hdc.gzsllzx.cn"
posted @ 2009-11-17 10:35 yuhe7919 阅读(25) | 评论(0) |  编辑
     摘要: 原文地址:squid对应不同端口提供服务/***************************原文*****************************/squid对应不同端口提供服务2009-02-05 10:10转 by 王斌斌 :做为笔记Tool: squid-2.6.STABLE6-4.el5拓扑图如上图,有两个网络:公司内部私有网络:192.168.1.0/24;Internet外...  阅读全文
posted @ 2009-11-16 15:25 yuhe7919 阅读(226) | 评论(0) |  编辑
     摘要: [代码]将上面代码存为vbs文件即可使用。  阅读全文
posted @ 2009-11-13 10:01 yuhe7919 阅读(152) | 评论(0) |  编辑
     摘要: 小项目龙里中学多媒体教室管理系统中后台管理用到了iframe.由于要动态载入内容,所以需要iframe自适应内容页的高度.用谷歌搜索到很多答案,其中成功的是这段代码:[代码]iframe代码:1<iframestyle="z-index:1;visibility:inherit;width:100%;"name="maincontent1"[代码]在IE8下成功实现自适应高度,但在谷歌浏览器...  阅读全文
posted @ 2009-11-04 11:59 yuhe7919 阅读(485) | 评论(4) |  编辑
我的应用测试