2017年终回顾总结

  一个时间段过去之后,回顾总结总是好的,于是有了这篇年末总结,借此回顾过去的这一年。

心态的变化

红军不怕远征难,万水千山只等闲

  我是一个时常忧虑的人,根源在于自己很没有安全感,缺少对自己已达成的目标的肯定,而盯着下一阶段的目标感到焦虑。

  工作之后与朋友交流,大都觉得工作环境效率低下觉得难以忍受。刚开始我也是这样,时常为了效率问题导致内心矛盾焦虑,下班去食堂吃饭的路上我脑子里都在想,我能改变什么,逃避?一走了之?其他地方就没有效率很低下的事情?不然。我时常说服自己,内燃机的最终效率只有30%左右,也很低,但是却是全球普遍使用了几十年的产品,大家照样用的好好的。工作何尝不是一样的呢?慢慢的剖析这种焦虑的心态,其实根源在于担心效率低而跟不上主流市场,被他人淘汰。平常心来说,这种焦虑是好事情,对自己的督促,但是也要小心这种焦虑转化成一种浮躁的心态,反噬自身让自己浮躁不定,浮躁比效率低下更可怕,更坏。要尽可能的把握好当下,全力做好自己当下该做的事情,努力提升自己。

  关于忍耐。工作中时常会有“恶心的事情”,或者让自己身体和心理都难以接受的事情,整个人都会变得很负面,想逃离,想放弃,难以坚持。但是放弃了,然后呢?真的就解决问题了吗?原来的问题可能还是会以另外一种形式,另外一种压力转化到自身。我真的会想想红军两万五千里长征,他们为了达到目的是有多么坚强的意志力,疯狂的坚持。

  在万水千山的跋涉中,不能放弃,不能忘记最初的梦想。

关于技术的二三事

世之奇伟瑰怪非常之观,常在于险远

  坦诚的说,技术方面比刚毕业的时候要好许多,面对具体的业务需求能够恰当的转化成业务模型,进一步程序实现。从一开始的迷糊,接到开发任务之后不知道从何下手,到现在有自己的想法和心得。听过一句话“Everything is simulation”,深以为然。业务系统,逻辑,都是通过适当的建模,程序模拟现实生活中的需求,进一步实现功能去模拟逻辑。

  从开发人员的角度来看,熟悉之后,整个开发迭代过程就是需求分析,业务数据模型的建立,找出需要持久化的信息建立适当的数据库表,编写数据库访问接口,自底向上进一步实现业务逻辑功能,并对外提供接口。再后面就是功能测试,以及功能性问题的回归下降,系统功能的上线发布。

  因为项目组使用的ORM框架是MyBatis,这也是目前主流的轻量级半自动化ORM框架,为了更深入的了解和熟悉这个框架(其实就是很有兴趣,好奇心强,想看源码学技术,看看别人怎么构建一个如此易用的开源组件),所以我开始慢慢关注MyBatis的源码实现,并尝试发现其中的不足反馈给社区。虽然很早就加入了github,但是这是我第一次向大型的开源组织提交patch,看到别人积极的review我的代码并对我表示感谢,整个过程还是相当的开心,最后自己的代码跑过自动化测试并被accept合入主线的时候,还是相当激动的。

  除此之外也看过其他一些框架的代码,感触比较深的就是Java框架代码实现的时候大多都是各种花式的反射和代理去实现对业务侧代码的拦截功能增强,这是我的体会。

  对于数据库的使用和性能优化也有了更深的理解。当同事不能解决的MySQL查询语句性能问题,与我交流讨论解决方案的时候,我提出的解决方案能将原来数秒才能完成的查询优化3个数量级以上,当受到同事的肯定和赞许的时候还是颇为开心。但是我知道这还不够,“而世之奇伟瑰怪非常之观,常在于险远,故非有志者不能至也,而人之所罕至焉”,受限于业务并发量并不是特别大的限制,更多更有价值的技术挑战未能触及。虽然对单机本地事物有了一定的了解,但是对于分布式事物和大规模并发系统还是一个心结,希望日后能够有机会能够接触并深入掌握。比较值得一提的是,得益于组内的定期分享活动,不仅和大家交流了技术内容,还锻炼了自己的口语交流能力哈哈。会思考怎么把自己要提出的主题核心内容一点点引出来,思路步骤等等都会考虑到,这个过程是比较受益的。

  之前一直对前端的三板斧不是很了解,今年也通过几个简单的小项目,有了初体验,解决了长久以来对于前端界面的一些困惑,特别是CSS方面。

  虽然加班比较多,特别是年初三月,四月的时候,新项目刚开始迭代,那段时间经常凌晨回去休息,能够利用的业余时间比较有限,能够锻炼身体的时间比较少,再加上自己没有怎么注重锻炼,不管是心理还是身体,都有比较大的压力。

生活方面

珍惜当下,热爱生活

  总感觉身体不如从前,一直比较瘦总是吃不胖,这是我比较担心的。虽然有体育锻炼,但也感觉难有起色,不过唯一一点确认的就是要是隔三差五要是不运动一下,情况只会更糟糕。工作性质导致整天就是坐在电脑面前对着屏幕,我甚至戏谑的调侃自己是Brain Animal。

  工作在外,也难免会有离家念乡的感觉,但是我想到还有认识的朋友出国工作几年不回来的,我一万公里这算个屁啊。一年还是能趁着假期回去几次的。

  我会主动尝试改变,偶尔会主动约朋友出来吃饭,不要待在住的地方。去了解朋友最近的状况,他们最近的开心与烦恼。说实话,五和的纸上烤鱼真心好吃。

  我觉得人只有“走出去”了才会活的立体,只有走出去才知道该怎么活,此处的走出去有多重含义。

  我不怎么爱玩,或者说不怎么懂得去享受生活。就像我在此部分的文字一样,并不能拿出很多记录回顾。我知道自己在旁人看来会有些乏味,但是我在不停的改变自己,走出去。

  最后感恩生命中遇到的每一个你。

新一年的期待

  1. 乐观积极,锻炼身体,有更强壮的身体。
  2. 技术上要更进一步。
  3. 阅读更多非技术性的书籍,丰富自己的内心。

Design Pattern - I

Definition of Design Pattern:

In software engineering, a software design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. – WikiPedia.

Depends on abstract model but not implementation details.

Singleton Pattern

images

Applicable scene:
We should use this design pattern when we will get trouble if we create many instances of a class. It’s enough for us to create only one instance of a class like Log Manager, utils, thread pool, cache manager, configure files manager and so on.

Targt:
We could use this pattern to restricts the instantiation of a class to one object.

An implementation of the singleton pattern must:

  • ensure that only one instance of the singleton class ever exists
  • provide global access to that instance.

Good Practices with MySQL

In this blog, I will try my best to summary helpful experience with MySQL. Without other declaration, the deault engine which I used is innodb.

Explain your query statement is a kind of virtue

If you are not confident with what have done in your query statements, please add explain key word before your query statement and let the interepter tell you how MySQL will excute the statement.

That’s always right to explain and assert what you let the search engine done with your statements.

If you don’t know the meaning of the returned values of explain from MySQL, I will recommend you to read all about Appendix D. Using Explain in <<High Performance MySQL>>. You can also google some helpful documents about that.

That’s the first step of all to optimize your MySQL statements.

More advanced, you can profile you statement like this:

1
2
3
4
5
mysql> set profiling=1;
mysql> select filed from table;
mysql> ... more mysql statements and operation on MySQL ...
mysql> show profiles;
mysql> SHOW PROFILE FOR QUERY 1;

You can also profile you SQL statements with the help of the IDE. In MySQL-Workbench, the duration time is how long the statment excuted in the MySQL-Server and the fetch time is how long the results are transformed in the network.

SHOW PROFILE Syntax

Summary For 2016 Year

Looking back to this year, for leaving school and beginning to my career life, there have many changes, twists and turns in my life. There also have many moved and warm moments in this year. At the last day of this year, they all gone.

The brief introduction to the architecture of JUnit4

JUnit is a good framework for developer to finish testing tasks. I also use JUnit to help me with testing. From the perspective of a good programmer, the source code of JUnit is also a wonderful example to learnhow to write more good style code in Java.

In this article, I would like to try my best to share my view of JUnit.The version of JUnit what I talked is JUnit4 in this article.

Problems With Linked List

1. Linked List

In computer science, a linked list is a linear collection of data elements, called nodes, each pointing to the next node by means of a pointer. It is a data structure consisting of a group of nodes which together represent a sequence.

For single Linked list:

images

Search Algorithm in Graph

Searching in a graph is the one of the most popular topic in CS.

In this article, I would like to make a summary about what algorithms for searching in graphes.

Great ideas in Object Oriented Programming

Object-oriented programming (OOP) is a programming paradigm based on the concept of “objects”, which may contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods. – Wikipedia

OOP is just a programming paradigm and it helps programmer to build more robust and implement more abstract concept which are needed in their project.OOP isn’t the treasure which only belongs to a special programming language. It offer a way to make the problem more easy to be understood and to be solved.

There are three gread ideas in OOP.

  • Encapsulation
  • Composition, inheritance, and delegation
  • Polymophsim

Training Cascade with OpenCV

Platform: Linux/Ubuntu

Preparation:

You may have to prepare two different types of images for training a Binary Classifier Model, the positive samples and the negative samples.

Here, we gona to use image database from UIUC Image Database for Car Detection to demonstrate how to use OpenCV to detection cars in a image.