码迷,mamicode.com
首页 >  
搜索关键字:let    ( 14348个结果
免费SSL证书Let’s Encrypt
由于我们公司测试环境使用的这个。自己没有亲手搭建使用,但是知道有这个东西。以后使用的话自己直接搞起. 连接文档:http://www.5icool.org/a/201512/a15271.html https://letsencrypt.org/ http://www.freehao123.com/ ...
分类:其他好文   时间:2016-05-04 19:04:28    阅读次数:127
ES6新特性:let和const的使用
(声明, 本文的所有代码均在node的最新稳定版本v4.4.3中执行的, 如果在浏览器中执行请把JS的运行环境提升为ES6) 以前一直用var定义变量, 现在有了两种新的定义变量的方式, 1: let, 2: const;本文大概概括下使用let和const定义变量有哪些好处; let: 1:声明提 ...
分类:其他好文   时间:2016-05-04 06:31:08    阅读次数:235
Swift—do-try-catch错误处理模式-备
Swift 1.x的错误处理模式存在很多弊端,例如:为了在编程时候省事,给error参数传递一个nil,或者方法调用完成后不去判断error是否为nil,不进行错误处理。 let contents = NSString(contentsOfFile: filePath, Êencoding: NSU ...
分类:编程语言   时间:2016-05-03 12:21:43    阅读次数:826
Swift 总结使用问号(?)和感叹号(!)-备用
在使用可选类型和可选链时,多次使用了问号(?)和感叹号(!),但是它们的含义是不同的,下面我来详细说明一下。 1. 可选类型中的问号(?) 声明这个类型是可选类型,访问这种类型的变量或常量时要使用感叹号(!),下列代码是显示拆包: let result1: Double? = divide(100, ...
分类:编程语言   时间:2016-05-03 10:49:00    阅读次数:1463
Swift 可选类型-备
我们先看看如下代码: var n1: Int = 10 n1 = nil //编译错误 let str: String = nil //编译错误 Int和String类型不能接受nil的,但程序运行过程中有时被复制给nil是在所难免的,Swift为每一种数据类型提供一种可选类型(optional), ...
分类:编程语言   时间:2016-05-03 10:34:48    阅读次数:192
Map与JSON Conver
function strMapToObj(strMap) { let obj = Object.create(null); for (let [k,v] of strMap) { obj[k] = v; } return obj;}function objToStrMap(obj) { let st ...
分类:Web程序   时间:2016-05-03 09:17:30    阅读次数:183
12 extremely useful hacks for JavaScript
In this post I will share 12 extremely useful hacks for JavaScript. These hacks reduce the code and will help you to run optimized code. So let’s star ...
分类:编程语言   时间:2016-05-02 10:32:26    阅读次数:299
POJ-2533 Longest Ordered Subsequence ( DP )
题目链接: http://poj.org/problem?id=2533 Description A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric s ...
分类:其他好文   时间:2016-04-30 00:58:28    阅读次数:182
Consul & Registrator & Rails Service all together in separate Docker container
1.Start a container running Consul 2.Start a container running Registrator 3. Start a web service and let Registrator automatically register it on Consul 4. Find the IP address and port of the service from Consul UI, and start using the service...
分类:其他好文   时间:2016-04-29 19:44:16    阅读次数:263
【java设计模式】之 工厂(Factory)模式
1.工厂模式的定义         工厂模式使用的频率非常高,我们在开发中总能见到它们的身影。其定义为:Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation t...
分类:编程语言   时间:2016-04-29 19:40:25    阅读次数:266
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!