装饰者模式动态地将责任附加到对象上,若要扩展功能,装饰者提供了比继承更有弹性的替代方案
Russian Doll Envelopes 来自Leetcode上一道经典的DP问题,在仔细研究这道题一整天后,决定写下这篇博文记录下整个思路。 首先看到这个问题第一反应就是DP问题,仔细读题后发现跟之前见过的求最长递增子序列有异曲同工之妙,所有先研究了一下最长递增子序列的求法
理解线程同步之前,我们需要知道为什么Java中需要线程同步。首先我们需要清楚Java中的线程内存模型,JMM(Java Memory Model)规定了JVM有主内存(Main Memory)和工作内存(WorkingMemory)之分,主内存存放程序中所有的类实例、静态数据等变量,是多个线程共享的,而工作内存存放的是该线程从主内存中拷贝过来的变量以及访问方法所取得的局部变量,是每个线程私有的其他线程不能访问。
下图为Java内存模型
代理模式是Java开发中一种常用的设计模式,为其他对象提供一种代理以控制对这个对象的访问。在某些情况下,一个对象不适合或者不能直接引用另一个对象,而代理对象可以在客户端和目标对象之间起到中介的作用
#Contributing to Open Source on GitHub A great way to get involved in open source is to contribute to the existing projects you’re using. GitHub is home to more than 5 million open source projects. There are projects for every skill set like recipes, HTML/CSS, Ruby, Astrophysics and many more. This guide will cover what you might find in a typical project and how to make a great contribution.
Find Projects We recommend that you start by finding a project that you’re already (or are interested in) using. Here are a few great places to look:
GitHub Explore: Popular and trending projects. GitHub Stars: Projects starred by other people. GitHub Showcases: A way to discover related repositories. Designer News: Front-end development and design projects.