项目开发日常小结

题记:

将2016下半年开发的一些事情记录下来

一、本地库

1.最近项目需要用到资源本地存储和同步更新的事,查阅了资料,可以使用CouchDB来做,顺便发现还有一个JavaScript的Pouchdb。

2关于nosql之间的对比  http://science.dataguru.cn/article-6331-1.html

key-value  redis mencached  

document-oriented mongodb  couchdb

column-family  Cassandra

 graph-oriented neo4j

3.mongodb与couchDB对比 http://blog.nosqlfan.com/html/1519.html

二、ELK使用

+@_host:esp-lifecycle.web.sdp.101.com  +message:"61.160.40.175"

+@_host:esp-lifecycle.web.sdp.101.com +@_status:500

三、maven环境变量设置

MAVEN_OPTS 值为 -Xmx1024m (or more)
或则命令行
  set MAVEN_OPTS= -Xms128m -Xmx512m
 参考:http://stackoverflow.com/questions/2819853/setting-java-heap-space-under-maven-2-on-windows
四、关于请求API设计的一些优化理解
ClientUitls.doReq(Client client,Config cofig,Callback back)
Client包含了请求的url,请求的model,单次请求配置config
Config包含了请求的配置,比如请求超时时间,加密等等--不是必须要有
callback 请求回调
参考:http://www.cnblogs.com/MartinChen999/archive/2011/12/19/2291112.html
五、不开命令行情况下运行tomcat
1.使用安装版
2.绿色版的
service.bat install 
如果发现没有,则可以考虑下载一个
参考:http://blog.csdn.net/wgrzhuaq/article/details/7982178
三、PECS原则

从上述两方面的分析,总结PECS原则如下:

  • 如果要从集合中读取类型T的数据,并且不能写入,可以使用 ? extends 通配符;(Producer Extends)
  • 如果要从集合中写入类型T的数据,并且不需要读取,可以使用 ? super 通配符;(Consumer Super)
  • 如果既要存又要取,那么就不要使用任何通配符。
 1    //JDK 1.5之前,存在转换风险
 2         List list = new ArrayList();
 3         list.add(new Integer(1));
 4         list.add("2");
 5         list = new ArrayList<String>();
 6 
 7         Map<String,String>m =new HashMap<>();
 8         m.put("a","1");
 9         list =new ArrayList();
10         list.add(m);
11         //不能往一个使用了? extends的数据结构里写入任何的值
12         List<? extends HashMap> extendsProduct=new ArrayList<>(list);//初始化的时候,可以加入
13 
14      //   map.add(new HashMap()); //编译不过
15        for(HashMap ss:extendsProduct){
16            System.out.println(ss.get("a"));
17 
18        }
19         List<? super Map> consumeSuper=new ArrayList<>(list);
20         consumeSuper.add(new HashMap());
21         //无法读取
22         /**
23         for(Map bb:consumeSuper){
24             System.out.println(bb.get("a"));
25 
26         }
27          */
28 
29         //可以作为参数传入
30         /**
31          *
32          * public void pushAll(Iterable<E> src){
33          for(E e : src)
34          push(e)
35          }
36          *
37          *
38          * */
39 
40 
41         //Collections.copy()
42         //public static <T> void copy(List<? super T> dest,List<? extends T> src)
43         //Collections.copy(new ArrayList<Number>(), new ArrayList<Number());
44         //Collections.copy(new ArrayList<Number>(), new ArrayList<Integer());
45 
46         // Enum    public static <T extends Enum<T>> T valueOf(Class<T> enumType,String name) {
View Code

 

 参考
1、http://www.cnblogs.com/softidea/p/4106659.html
2、 https://www.cnblogs.com/doucheyard/p/6855823.html
 
 
 

 

posted @ 2016-06-08 15:44  draem0507  阅读(316)  评论(0编辑  收藏  举报
View Code