- 方便代码的交流和维护。
- 不影响编码的效率,不与大众习惯冲突。
- 使代码更美观、阅读更方便。
- 使代码的逻辑更清晰、更易于理解。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 中文全文检索,使用mmseg | |
| ## 创建索引 | |
| PUT http://localhost:9200/index | |
| ## 设置mapping | |
| POST /index/fulltext/_mapping | |
| { | |
| "fulltext": { | |
| "_all": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Panel extends Backbone.View | |
| el: $('#test') | |
| events: | |
| 'click #superZone': 'clickMyZone' | |
| initialize: -> | |
| $("#test").append '<span id="superZone">Panel initialized</span>, ' | |
| @foo = 'bar' | |
| render: -> | |
| $("#test").append 'super render' | |
| @ |
- 确认Apple所有证书为最新,否则先删除,再去www.apple.com/certificateauthority/下载所有,并安装
- 创建证书(Developer+Distribution),下载并安装
- ** 下载的证书安装后显示不信任,则为Apple证书已经过期,应重新下载所有证书 **
- 创建App ID(此即为app identify,如com.whatever.projectname)
- 创建App,选择App ID,选择计费
- 当为“Prepare to upload”时,需打开,点击“Ready to Upload binary”,选择安全条款,状态变为“Ready for upload”
地址 = Protocal :// MachineName/DomainName/IP [:Port]
- TCP. net.tcp://localhost:8002/MySrv, net.tcp://localhost:8002/MySrv2
- HTTP. http://localhost:8001 默认80端口
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 协议定义 | |
| [OperationContract] | |
| [WebInvoke | |
| ( | |
| // UriTemplate="/EchoWithPost", | |
| // Method="POST", 默认为POST | |
| // BodyStyle = WebMessageBodyStyle.Bare, 默认为Bare无包裹 | |
| RequestFormat=WebMessageFormat.Json, | |
| ResponseFormat=WebMessageFormat.Json | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 传递Header | |
| using (WebChannelFactory<IService> wcf = new WebChannelFactory<IService>(new Uri("http://localhost:"+port+"/Web"))) | |
| { | |
| IService channel = wcf.CreateChannel(); | |
| // 首先创建OperationContextScope | |
| // ** 注意OperationContextScope只能使用在单个调用内,不能跨调用包裹 ** | |
| using ( OperationContextScope scope = new OperationContextScope((IContextChannel)channel)) | |
| { | |
| // 传递Header |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| >>> char = 'a' | |
| >>> str = char * 3 | |
| >>> str | |
| 'aaa' | |
| >>> str[0] = 'b' | |
| Traceback (most recent call last): | |
| File "<stdin>", line 1, in <module> | |
| TypeError: 'str' object does not support item assignment |