08 2012 档案

摘要:Refer to http://www.martinwilley.com/net/code/nhibernate/query.html#ToC3E.g.Paging and avoid sql injectionIQuery q = s.CreateQuery("from Job as j where j.ServiceId in (:serviceIds)");q.SetParameterList("serviceIds", ids).SetFirstResult(10).SetMaxResults(10); 阅读全文
posted @ 2012-08-31 13:45 webglcn 阅读(182) 评论(0) 推荐(0) 编辑
摘要:In short, mapping the properties of multiple entity classes to columns in one table.Refer to http://ayende.com/blog/3937/nhibernate-mapping-component<component/> is an interesting feature of NHibernate, which map more or less directly into the notion of a Value Type in DDD. This is a way to cr 阅读全文
posted @ 2012-08-30 16:13 webglcn 阅读(212) 评论(0) 推荐(0) 编辑
摘要:1. Download nhibernate (version 3.1.0 GA, latest 3.3.1 doens't have lazy loading related dlls) from http://sourceforge.net/projects/nhibernate/files/NHibernate/2. Create a console application by adding following dlls3. Create a class named namespace TstDBConnection.Entities{ public class Course{ 阅读全文
posted @ 2012-08-30 13:32 webglcn 阅读(134) 评论(0) 推荐(0) 编辑
摘要:<?xml version="1.0"?><configuration> <configSections> <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/> <section name="log4net" type="log4net.Config.Log4NetConfigurationSecti 阅读全文
posted @ 2012-08-30 13:23 webglcn 阅读(200) 评论(0) 推荐(0) 编辑
摘要:1. Find the XML schema directory of your VS2010 Express (Beta 2, at this time) installation Tools->Options will point you to the right place. Do not forget to select the Show all settings checkbox at the left bottom of the window:2. Then, go to the folder you extracted the nhibernate binaries int 阅读全文
posted @ 2012-08-29 09:51 webglcn 阅读(158) 评论(0) 推荐(0) 编辑
摘要:publicclassArrayJsonResult:System.Web.Mvc.JsonResult{ publicoverridevoidExecuteResult(ControllerContext context) { if(context ==null) { thrownewArgumentNullException("context"); } if(JsonRequestBehavior==JsonRequestBehavior.DenyGet&& String.Equals(context.HttpContext.Request.... 阅读全文
posted @ 2012-08-29 09:02 webglcn 阅读(318) 评论(0) 推荐(0) 编辑
摘要:Refer to http://stackoverflow.com/questions/9610214/pass-complex-json-object-to-an-mvc-3-actionvar testViewModel ={ Name: ko.observable("Joe Bob"), Locations: ko.observableArray([ { ID:1,Name:"Salem, OR"}, { ID:2,Name:"Big Bear Lake, CA"}, { ID:3,Name:"Big Bear Cit 阅读全文
posted @ 2012-08-24 16:40 webglcn 阅读(258) 评论(0) 推荐(0) 编辑
摘要:1. Ajax call Asp.net MVC actionfunction save() { var data = { 'Name': $('#name').val(), 'Age': $('#age').val() }; $.ajax({ url: '/user/Detail', //'@Url.Action("Detail", "user")', data: JSON.stringify(data), type: 'POST', con 阅读全文
posted @ 2012-08-24 16:34 webglcn 阅读(1534) 评论(0) 推荐(0) 编辑
摘要:http://yui.2clics.net/ 阅读全文
posted @ 2012-08-21 16:34 webglcn 阅读(121) 评论(0) 推荐(0) 编辑
摘要:IE就是一坨屎 不要使用原生的Javascript去画HTML. 使用类库,比如Juqery. 千万别手贱!原因之一 JS 通过CreateElement 动态生成的代码,使用setAttribute插入已有CSS样式不起作用 (IE 6 - 8). 阅读全文
posted @ 2012-08-21 15:46 webglcn 阅读(350) 评论(0) 推荐(0) 编辑
摘要:Refer to http://stackoverflow.com/questions/94037/convert-character-to-ascii-code-in-javascriptThe second answer"ABC".charCodeAt(0)// returns 65String.fromCharCode(65,66,67);// returns 'ABC' 阅读全文
posted @ 2012-08-21 13:40 webglcn 阅读(343) 评论(0) 推荐(0) 编辑
摘要:Reference from http://www.codeproject.com/Articles/18148/SQL-Server-2005-Paging-ResultsWith Cust AS ( SELECT CustomerID, CompanyName, ROW_NUMBER() OVER (order by CompanyName) as RowNumber FROM Customers )select *from CustWhere RowNumber Between 20 and 30 阅读全文
posted @ 2012-08-17 16:26 webglcn 阅读(200) 评论(0) 推荐(0) 编辑
摘要:The slice() method selects the elements starting at the given start argument, and ends at, but does not include, the given end argument.1. Array.prototype.removeAt = function (index) { var part1 = this.slice(0, index); var part2 = this.slice(index + 1); return part1.concat(part2);}var a = [10, 11,12 阅读全文
posted @ 2012-08-16 15:08 webglcn 阅读(175) 评论(0) 推荐(0) 编辑
摘要:Refer to http://stackoverflow.com/questions/122102/what-is-the-most-efficient-way-to-clone-a-javascript-object// Shallow copyvar newObject = jQuery.extend({}, oldObject);// Deep copyvar newObject = jQuery.extend(true,{}, oldObject); 阅读全文
posted @ 2012-08-16 13:36 webglcn 阅读(250) 评论(0) 推荐(1) 编辑
摘要:C:\Documents and Settings\<user account>\Local Settings\Application Data\Microsoft\Outlook 阅读全文
posted @ 2012-08-16 09:05 webglcn 阅读(126) 评论(0) 推荐(0) 编辑
摘要:refer to http://stackoverflow.com/questions/2190850/javascript-create-custom-callbackfunctionThing(name){ this.name = name;}Thing.prototype.doSomething =function(callback, salutation){ // Call our callback, but using our own instance as the context callback.call(this, salutation);}function foo(sa... 阅读全文
posted @ 2012-08-15 16:43 webglcn 阅读(190) 评论(0) 推荐(0) 编辑
摘要:Part of the code refer to http://hi.baidu.com/ligq/blog/item/103115df9cdc390563279800.html MyClass = function () { var param = 2; // private this.m = 3; // public MyClass.staticCount = 5; // static this.publicMethod = function () { alert(param); // "this" is function publicMethod, invoke c 阅读全文
posted @ 2012-08-15 15:47 webglcn 阅读(145) 评论(0) 推荐(0) 编辑
摘要:1. Download lucene.net from http://sourceforge.net/projects/dotlucene/2. Get source code and a demo project.3. Compile Lucene.net4. Copy generated lucene.dll to Demo projects.5. Compile demo projects one by one.6. Change index path in VS debug "Command Line Arguments"7. Run demo project.这个 阅读全文
posted @ 2012-08-07 10:02 webglcn 阅读(1100) 评论(1) 推荐(0) 编辑

点击右上角即可分享
微信分享提示