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
* [聊一聊 cookie](https://segmentfault.com/a/1190000004556040) | |
* [跨域资源共享 CORS 详解](http://www.ruanyifeng.com/blog/2016/04/cors.html) |
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
算法的时间复杂度和空间复杂度合称为算法的复杂度。 | |
from:http://blog.csdn.net/booirror/article/details/7707551/ | |
1.时间复杂度 | |
(1)时间频度 一个算法执行所耗费的时间,从理论上是不能算出来的,必须上机运行测试才能知道。但我们不可能也没有必要对每个算法都上机测试,只需知道哪个算法花费的时间多,哪个算法花费的时间少就可以了。并且一个算法花费的时间与算法中语句的执行次数成正比例,哪个算法中语句执行次数多,它花费时间就多。一个算法中的语句执行次数称为语句频度或时间频度。记为T(n)。 | |
(2)时间复杂度 在刚才提到的时间频度中,n称为问题的规模,当n不断变化时,时间频度T(n)也会不断变化。但有时我们想知道它变化时呈现什么规律。为此,我们引入时间复杂度概念。 一般情况下,算法中基本操作重复执行的次数是问题规模n的某个函数,用T(n)表示,若有某个辅助函数f(n),使得当n趋近于无穷大时,T(n)/f(n)的极限值为不等于零的常数,则称f(n)是T(n)的同数量级函数。记作T(n)=O(f(n)),称O(f(n)) 为算法的渐进时间复杂度,简称时间复杂度。 | |
时间频度不同,但时间复杂度可能相同。如:T(n)=n2+3n+4与T(n)=4n2+2n+1它们的频度不同,但时间复杂度相同,都为O(n2)。 | |
按数量级递增排列,常见的时间复杂度有:常数阶O(1),对数阶O(log2n),线性阶O(n), 线性对数阶O(nlog2n),平方阶O(n2),立方阶O(n3),..., k次方阶O(nk),指数阶O(2n)。随着问题规模n的不断增大,上述时间复杂度不断增大,算法的执行效率越低。 | |
(3)最坏时间复杂度和平均时间复杂度 最坏情况下的时间复杂度称最坏时间复杂度。一般不特别说明,讨论的时间复杂度均是最坏情况下的时间复杂度。 这样做的原因是:最坏情况下的时间复杂度是算法在任何输入实例上运行时间的上界,这就保证了算法的运行时间不会比任何更长。 | |
在最坏情况下的时间复杂度为T(n)=0(n),它表示对于任何输入实例,该算法的运行时间不可能大于0(n)。 平均时间复杂度是指所有可能的输入实例均以等概率出现的情况下,算法的期望运行时间。 | |
指数阶0(2n),显然,时间复杂度为指数阶0(2n)的算法效率极低,当n值稍大时就无法应用。 |
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
* http://www.07net01.com/2016/04/1434487.html | |
1.引言 | |
随着项目不断的增大,尤其是一个在不断开发完善的项目,随着需求变化,数据库的schema也会跟着变化,数据库也需要不断的扩充,加表加字段,(每一次的增加称作一次DB的迁移migration)你是否还在用着最原始的方式, 用文件管理每次的SQL升级脚本,加了哪些字段,加了那些表,现在可以用数据库版本控制工具轻而易举搞定了。 | |
flyway支持Java API的操作方式,可以和spring 框架进行无缝连接,使其在系统启动的时候检查并升级数据库的版本(特别适合于java项目)。 | |
2.flyway的特点 | |
2.1使用它之前先要了解一些概念: |
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
http://www.code123.cc/docs/kibana-logstash/v4/index.html |
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
我的环境是MAC下,MAC默认安装了zsh(一些教程会让安装zsh,如果已经默认安装,就没必要再装了)使用命令查看是否已经安装 | |
cat /etc/shells | |
应该会看到 | |
/bin/bash | |
/bin/csh | |
/bin/ksh | |
/bin/sh | |
/bin/tcsh |
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
https://m.baidu.com/from=844b/bd_page_type=1/ssid=0/uid=0/pu=usm%401%2Csz%401320_2001%2Cta%40iphone_1_10.2_3_602/baiduid=09D566A93A00B6098D9A9094E1B40875/w=0_10_/t=iphone/l=3/tc?ref=www_iphone&lid=9196191050352420881&order=2&fm=alop&tj=www_normal_2_0_10_title&vit=osres&m=8&srd=1&cltj=cloud_title&asres=1&nt=wnor&title=HTTP%E4%B8%8EHTTPS%E7%9A%84%E5%8C%BA%E5%88%AB-%E9%A9%AC%E6%B5%B7%E7%A5%A5%E5%8D%9A%E5%AE%A2&dict=30&w_qd=IlPT2AEptyoA_yixCFOxWykgqxLI&sec=19779&di=f2ffa8feb894b707&bdenc=1&nsrc=IlPT2AEptyoA_yixCFOxXnANedT62v3IEQGG_yFZ_je8lUS7hPOlItgfEFX7LmuTEUfwsCPQpx9Dw8O-RyJrlK |
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
uat1和dev 环境,多个dubbo部署在同一台机器上,启动时候会遇到:dubbo Can not lock the registry cache file,多次尝试不成功,会导致dubbo服务启动失败 | |
解决思路: | |
1. https://github.com/alibaba/dubbo/issues/81 | |
2. 手工重启也可以 | |
现在uat1和dev 环境,多个dubbo部署在同一台机器上,启动时候会遇到:dubbo Can not lock the registry cache file, | |
多次尝试不成功,会导致dubbo服务启动失败 | |
解决思路: | |
在dubbo.properties加入一行配置即可 |
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
http://www.gaofi.cn/book/pdfdown/77 |