03 2012 档案
摘要:A DI CONTAINER is a software library that can automate many of the tasks involved incomposing objects and managing their lifetimes. Although it’s possible to write all therequired infrastructure code with POOR MAN’S DI, it doesn’t add much value to anapplication. On the other hand, the task of compo
阅读全文
摘要:1. 背景知识由google公司研发的google文件系统和MapReduce变成模型在处理海量数据方面引起了业界的反响。Hadoop是实现了MapReduce编程模型的开源系统。Hadoop Java API主页:http://hadoop.apache.org/2. 关系型数据库和MapReduce比较
阅读全文
摘要:1. Overview of AzureAzure is the name of Microsoft’s cloud services, which developers can use to deliver applications at scalefor various workloads and devices. Microsoft Azure provides a runtime framework for applications thatcurrently supports .NET 3.5 and .NET 4.0, as well as load balancers, oper
阅读全文
摘要:1. 官方下载2. 解压到指定目录可先解压到当前目录然后mv eclipse /opt(1)如果想把eclipse目录的更改为root拥有,可以执行下面的命令sudo chown -R root:root /opt/eclipse在/usr/bin目录下创建一个启动脚本eclipse(2)用下面的命令来创建:sudo gedit /usr/bin/eclipse然后在该文件中添加以下内容:#!/bin/sh export MOZILLA_FIVE_HOME=”/usr/lib/mozilla/” export ECLIPSE_HOME=”/opt/eclipse” $ECLIPSE_HOME/
阅读全文
摘要:需要使用到DataContext的嵌套服务代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Data.Linq;usingSystem.Configuration;namespaceCsharpTrainer.Linq.Service.Northwind{publicclassCascadeTableService{publicboolAddCascadeTables(CascadeAtableA,List<CascadeB>tablesB,L
阅读全文
摘要:1. 安装Ruby语言 apt-get install ruby libzlib-ruby rdoc ri irb检查安装结果 ruby -v2. 安装Ruby语言相关库apt-get install libruby libruby1.8 ruby1.8-dev libopenssl-ruby1.8检查安装结果irb 3. 安装Ruby语言软件包管理系统(Package Management System)RubyGems 下载http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz 解压后从命令行进入rubygems-0..
阅读全文
摘要:问题: 添加dll引用后,可以在代码中引入log4net的命名空间,但是一编译,却又找不到了。解决: 点击项目属性->查看应用程序,目标框架->把".NET FrameWork 4 Client Profile"改成".NET FrameWork 4"
阅读全文
摘要:1. 简单字符串格式化 format = "Hello, how are you doing %s %s!"values = ("David", "Gu")print format % values Result: Hello, how are you doing David Gu! format
阅读全文
摘要:1. Two Ways to create template WCF ServiceThere are a few built-in WCF service templates within Visual Studio 2010; twoof them are Visual Studio WCF Service Library and Visual Studio WCF ServiceApplication.
阅读全文
摘要:Conception Overview:It is a better option to host a WCF service within Internet Information Services Server(IIS) because IIS provides a robust, efficient, and secure host for the WCF services.IIS also has better thread and process execution boundaries handling (in additionto many other features) com
阅读全文
摘要:1. Hosting the service in a managed applicationWe can create a .NET managed application and host a WCF service inside theapplication. The hosting application can be a command-line application, a WindowsForms application, or a web application. This hosting method gives you full controlover the lifeti
阅读全文
摘要:When the application first starts up (i.e., when Application_Start() runs), this codepopulates a global static RouteCollection object called RouteTable.Routes. That’s where theapplication’s routing configuration lives.MapRoute() adds an entry to the routing configuration.正常写法:routes.MapRoute("D
阅读全文
摘要:列表示例1: (新建, 删除, 修改) # basic operation of listnames = ['David', 'George', 'Peter', 'Mark', 'ALice']print "Original List:"print namesdel names[1]print "
阅读全文
摘要:原则1:DRY(Don't repeat yourself)即不要写重复的代码,而是用“abstraction”类来抽象公有的东西。如果你需要多次用到一个硬编码值,那么可以设为公共常量;如果你要在两个以上的地方使用一个代码块,那么可以将它设为一个独立的方法。SOLID设计原则的优点是易于维护,但要注意,不要滥用,duplicate 不是针对代码,而是针对功能。这意味着,即使用公共代码来验证OrderID和SSN,二者也不会是相同的。使用公共代码来实现两个不同的功能,其实就是近似地把这两个功能永远捆绑到了一起,如果OrderID改变了其格式,SSN验证代码也会中断。因此要慎用这种组合,不
阅读全文
摘要:1. Library文件 需要的dll文件如下: FluentNHibernate.dll (*) NHibernate.ByteCode.Castle.dll (*) NHibernate.dll (*) Remotion.Data.Linq.dll Antlr3.Runtime.dll Castle.Core.dll Iesi.Collections.dll2. 创建Hibernate访问通用类usingSystem;usingSystem.Collections.Generic;usingFluentNHibernate.Cfg;usingFluentNHibernate.Cfg.Db;
阅读全文
摘要:1. sudo reboot 2. sudo shutdown -r now 立刻重启(root用户使用) 3. sudo shutdown -r 10 过10分钟自动重启(root用户使用) 4. sudo shutdown -r 20:35 在时间为20:35时候重启(root用户使用)
阅读全文
摘要:1. 构建服务层 新建一个空白解决方案,增加一个项目用来存放WCF服务-HelloWCF.Service 确保该项目引用System.Model 1) 构建服务契约 新建一个接口usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.ServiceModel;namespaceHelloWCF.Service{[ServiceContract]interfaceIHelloWorldService{[OperationContract]StringGetMessage(S
阅读全文
摘要:1. What is WCF?WCF is the latest technology from Microsoft for building services, including webservices.WCF is the acronym for Windows Communication Foundation. It is Microsoft'slatest technology that enables applications in a distributed environment tocommunicate with each other.WCF is an umbre
阅读全文
摘要:1. What is SOA?SOA is the acronym(缩略语) for Service Oriented Architecture.Basically, SOA states that every component of a system should be a service, and the system should be composed of several loosely-coupled services. A service here means a unit of a program that serves a business process. Loosely
阅读全文