Memento Pattern - Web Tutorials - avajava.com



Memento Pattern - Web Tutorials - avajava.com

The memento pattern is a behavioral design pattern. The memento pattern is used to store an object's state so that this state can be restored at a later point. The saved state data in the memento object is not accessible outside of the object to be saved and restored. This protects the integrity of the saved state data.

In this pattern, an Originator class represents the object whose state we would like to save. A Memento class represents an object to store the state of the Originator. The Memento class is typically a private inner class of the Originator. As a result, the Originator has access to the fields of the memento, but outside classes do not have access to these fields. This means that state information can be transferred between the Memento and the Originator within the Originator class, but outside classes do not have access to the state data stored in the Memento.

The memento pattern also utilizes a Caretaker class. This is the object that is responsible for storing and restoring the Originator's state via a Memento object. Since the Memento is a private inner class, the Memento class type is not visible to the Caretaker. As a result, the Memento object needs to be stored as an Object within the Caretaker.


Now, let's look at an example. The DietInfo class is our Originator class. We'd like to be able to save and restore its state. It contains 3 fields: a dieter name field, the day number of the diet, and the weight of the dieter on the specified day of the diet.

This class contains a private inner class called Memento. This is our Memento class that is used to save the state of DietInfo. Memento has 3 fields representing the dieter name, the day number, and the weight of the dieter.

Notice the save() method of DietInfo. This creates and returns a Memento object. This returned Memento object gets stored by the caretaker. Note that DietInfo.Memento is not visible, so the caretaker can't reference DietInfo.Memento. Instead, it stores the reference as an Object.

The restore() method of DietInfo is used to restore the state of the DietInfo. The caretaker passes in the Memento (as an Object). The memento is cast to a Memento object and then the DietInfo object's state is restored by copying over the values from the memento.


Read full article from Memento Pattern - Web Tutorials - avajava.com


邻里社交独角兽Nextdoor终于开始海外扩张_36氪



邻里社交独角兽Nextdoor终于开始海外扩张_36氪

之所以这么说,是因为国内一直没有出现像Nextdoor一样成功的邻里社交产品,叮咚小区曾在去年轰轰烈烈地拿了 1 亿美元天使投资但迅速衰败。有一位创业者曾对我说 "以社交切入社区的创业必死无疑",但他的身边仍然有不少做这门生意的人,也许是因为 Nextdoor 的郁郁葱葱让其不信这个邪?

关于中国为什么出不来 Nextdoor 就不再这里讨论了,还是看一下这家估值 11 亿美元的独角兽有何动向吧。

这家公司已经开始在荷兰开始试验其社交网络。此外,一则英国管理人员招聘广告也已经列在了网站上,描述中写道 Nextdoor 将在 2016年 初进入英国市场。

本周三,Nextdoor 给用户发送邮件表示新的隐私政策将于 2016年1月7日 生效。政策中有一部分提到将成立一个面向非美国用户的新公司――Nextdoor EMEA。

该公司确认了确实是在尝试扩展业务,但拒绝进一步予以置评。

"Nextdoor 目前已经覆盖了超过 50%的美国社区,我们一直有向全球扩张的野心。" 一位 Nextdoor 发言人在邮件中写道,"我们正在积极的尝试向几个国家扩张,并将在明年正式宣布进展。"

Nextdoor 计划向海外扩张已经喊了好几年了,2012年 时它雇佣了 LinkedIn 老将 Nirav Tolia 希望其负责国际化早期规划。

一年过去以后,Tolia 表示将于 2014年 在加拿大、南非以及英国开展业务,紧接着是巴西和日本。但显然这个计划跳票了,但仍然没有降低其对投资人的吸引力,Nextdoor 在今年3月获得了 1.1 亿美元融资


Read full article from 邻里社交独角兽Nextdoor终于开始海外扩张_36氪


12 Most Influential Books Every Software Engineer Needs to Read | The Curious Programmer



12 Most Influential Books Every Software Engineer Needs to Read | The Curious Programmer

What book should I read to become a better developer? Do I need to read books?

I think it's a great question, and it is one that I asked many of my mentors as I was becoming a software engineer. The problem was that many people suggested different books on different topics. All the books they suggested were great in their own right, but no one was able to give me a list that would be the ESSENTIAL books, the MUST READS, that any engineer with hopes of being great should most certainly read.

Well, I've learned a lot from my mentors and realized that I still had a lot to learn with the many different books that were suggested to me. I decided to develop a routine to read one book a month in my profession field (software engineering). Over the years, I've aggregated a list that, I believe, to be MUST READS for anyone that wants to be a top tier developer.

Now let me state the obvious – just reading all of these books on the list will not make you a great developer. That will come with years of experience and applying the principles in these books into real practices and developing your problem-solving skills in the real world.

However, reading these books will help you avoid the major pitfalls and mistakes that many developers make early off in their careers. I wish that someone would have told me about these books just starting out, but I was lucky enough to have found and read them over the years. You might have read some of these books in college for your computer science or engineering classes. Maybe at the time, you didn't think they were important, but I can say first hand that I've used and applied many principles from each and every one of these books.

Let me also point out that this is not an exhaustive list. Many great books come out every year. These are just the ones that have had the biggest impact on myself and my career. Also, these are mostly language agnostic, and can be applied using any of the many software languages.  (I will do another post with the best books targeted at certain technology platforms and stacks)

Well, let's get to it then! (drum roll, please)

THE LIST

(All these are essential, but I put them in descending order from which ones had the biggest impact on me.)

download (3)  12. Working Effectively with Legacy Code

I love this book because almost every software developer, at some point in their career, has to support and work with a legacy system. In this book, Michael Feathers offers start-to-finish strategies for working more effectively with large, untested legacy code bases. This book draws on material Michael created for his renowned Object Mentor seminars: techniques Michael has used in mentoring to help hundreds of developers, technical managers, and testers bring their legacy systems under control.

51WIpM70FEL._SL160_  11. The Mythical Man-Month

This book is a classic, but recently revised and corrected. The amazing thing is how relevant the book still is to software product development. If you are involved in software, this book is a must-read. The most valuable part of the book, I believe, is the "plan to throw out" prototype chapter. While the goal is always to make a bigger, better, fast whatever, it is almost an axiom that you WILL build something that has to be discarded and reworked. This happens every time, I can tell you from first-hand experience. Therefore, it is vital to plan to throw out so you can migrate your users to whatever will follow. If you dream that the first product is THE ONE, you risk abandoning them on a product that will inevitably evolve. Planning to throw-away also helps meet the schedule goals by setting reasonable milestones that can be obtained.

download (2)  10. Design Patterns

If you are planning to be an architect or designer of a system, you will most likely be required to read this book. Hailed as one of the greatest software development books ever written, this book goes into great detail on the many different design patterns that have been developed over the years to help software engineers avoid and handle common problems that the industry faces. Following the strategies in this book will allow you to build higher quality, flexible, and maintainable software. This book also goes by the name "Gang of Four" in software groups because of its famous four authors that put this book together.

 pp2e  9. Programming Pearls (2nd Edition)

This book is slightly different from the other books on the list. I would say this book helps a person "think like a programmer". Programming Pearls is a compendium of 15 columns previously published in Communications of the ACM. The columns cover a broad range of topics related to programming: from requirements gathering to performance tuning. The focus is primarily on coding techniques and algorithms.

Each column has been reorganized as a chapter. Chapters usually start with the presentation of a practical problem. Then various solutions are presented and are used as lessons to be learned. The writing style is clear and fun.

Programming Pearls is not a usual book teaching new programming concepts. Although it contains good and sometimes quite novel ideas, the aim of the book is not to teach something new but to help you become a better problem solver.

31GBgcA5PML._SL160_   8. CODE: The Hidden Language of Computer Hardware and Software

This book cleared up a lot of the "Magic" that goes into creating and developing complex systems. There are so many abstractions these days that the low-level details are sometimes unknown to the developer. Though you may not find yourself using this book 24/7 in practice…I believe it is a good idea to have an understanding of what you are building on top of and how the whole orchestration works. It may come in handy when you need to open up that "Black Box" and deep dive into the software or hardware to fix a pesky bug. "CODE: The Hidden Language of Computer Hardware and Software" by Charles Petzold deals with a number of programming concepts starting from number systems – decimal, octal, binary to high-level languages. The book explains packet based communication protocols and TCP. Many chapters are about hardware concepts, and five chapters are devoted to software and teach about the operating system, floating point arithmetic, and GUIs.

41Jon2rS8nL._SL160_  7.The Art of Computer Programming

This is another classic. This was written by the famous computer scientist Professor Donald Knuth and is highly praised by many of the top programmers in the industry. Even Bill Gates is quoted saying

"If you think you're a really good programmer… read [Knuth's] Art of Computer Programming… You should definitely send me a resume if you can read the whole thing."

The book begins with basic programming concepts and techniques, then focuses more particularly on information structures–the representation of information inside a computer, the structural relationships between data elements and how to deal with them efficiently. Elementary applications are given to simulation, numerical methods, symbolic computing, software, and system design.

51T4YZ3HieL._SL160_  6. Refactoring

"Refactoring" by Martin Fowler is about improving the design of existing code. It is the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal structure. With refactoring, you can even take a bad design and rework it into a good one. This book offers a thorough discussion of the principles of refactoring, including where to spot opportunities for refactoring, and how to set up the required tests. There is also a catalog of more than 40 proven refactorings with details as to when and why to use the refactoring, step by step instructions for implementing it, and an example illustrating how it works The book is written using Java as its principal language, but the ideas apply to any OO language.

41znMZniZ1L._SL160_  5. Clean Code

"Clean Code," written by Robert C. Martin, is divided into three parts. The first describes the principles, patterns, and practices of writing clean code. The second part consists of several case studies of increasing complexity. Each case study is an exercise in cleaning up code—of transforming a code base that has some problems into one that is sound and efficient. The third part is the payoff: a single chapter containing a list of heuristics and "smells" gathered while creating the case studies. The result is a knowledge base that describes the way we think when we write, read, and clean code.

41kXXE4mAKL._SL160_  4. Introduction to Algorithms

This has to be the single best book for understanding and using algorithms (which you will be doing a lot of in software development). Some books on algorithms are rigorous but incomplete; others cover masses of material but lack rigor. Introduction to Algorithms uniquely combines rigor and comprehensiveness. The book covers a broad range of algorithms in depth, yet makes their design and analysis accessible to all levels of readers. Each chapter is relatively self-contained and can be used as a unit of study. The algorithms are described in English and in a pseudocode designed to be readable by anyone who has done a little programming. The explanations have been kept elementary without sacrificing depth of coverage or mathematical rigor.The first edition became a widely used text in universities worldwide as well as the standard reference for professionals. The second edition featured new chapters on the role of algorithms, probabilistic analysis, and randomized algorithms, and linear programming.

41AJV8G0ZTL._SL160_  3. Structure and Interpretation of Computer Programs

With an analytical and rigorous approach to problem solving and programming techniques, this book is oriented toward engineering. Structure and Interpretation of Computer Programs emphasizes the central role played by different approaches to dealing with time in computational models. Its unique approach makes it appropriate for an introduction to computer science courses, as well as programming languages and program design. The book further explains the four best-known paradigms of programming languages – imperative, object-oriented, logic based and applicative programming.

41HXiIojloL._SL160_  2. Pragmatic Programmer

This was one of the first programming books I read. I had a friend recommend it to me in my first professional job. I'm glad he did. Though the book was written in 1999 (I believe), the concepts are the basis of how we go about developing a complex system in a practical manner. Programmers are craftspeople trained to use a certain set of tools (editors, object managers, version trackers) to generate a certain kind of product (programs) that will operate in some environment (operating systems on hardware assemblies). Like any other craft, computer programming has spawned a body of wisdom, most of which isn't taught at universities or in certification classes. Most programmers arrive at the so-called tricks of the trade over time, through independent experimentation. In The Pragmatic Programmer, Andrew Hunt and David Thomas codify many of the truths they've discovered during their respective careers as designers of software and writers of code.

Some of the authors' nuggets of pragmatism are concrete, and the path to their implementation is clear. They advise readers to learn one text editor, for example, and use it for everything. They also recommend the use of version-tracking software for even the smallest projects and promote the merits of learning regular expression syntax and a text-manipulation language. Other (perhaps more valuable) advice in the book is more light-hearted. In the debugging section, it is noted that "if you see hoof prints think horses, not zebras." That is, suspect everything, but start looking for problems in the most prominent places. There are recommendations for making estimates of time and expense, and for integrating testing into the development process. You'll want a copy of The Pragmatic Programmer for two reasons: it displays your own accumulated wisdom more clearly than you ever bothered to state it, and it introduces you to methods of work that you may not yet have considered.

51nWkLCu1SL._SL160_  1. Code Complete 2

And this is it! The number one book (IMHO) to read if you are going to be a great software engineer. Widely considered one of the best practical guides to programming, Steve McConnell's original CODE COMPLETE has been helping developers write better software for more than a decade. Now this classic book has been fully updated and revised with leading-edge practices—and hundreds of new code samples—illustrating the art and science of software construction. Capturing the body of knowledge available from research, academia, and everyday commercial practice, McConnell synthesizes the most effective techniques and must-know principles into clear, pragmatic guidance. No matter what your experience level, development environment, or project size, this book will inform and stimulate your thinking—and help you build the highest quality code.

Discover the timeless techniques and strategies that help you:

  • Design for minimum complexity and maximum creativity
  • Reap the benefits of collaborative development
  • Apply defensive programming techniques to reduce and flush out errors
  • Exploit opportunities to refactor—or evolve—code, and do it safely
  • Use construction practices that are right-weight for your project
  • Debug problems quickly and effectively
  • Resolve critical construction issues early and correctly
  • Build quality into the beginning, middle, and end of your project


Read full article from 12 Most Influential Books Every Software Engineer Needs to Read | The Curious Programmer


12本最具影响力的程序员书籍 �C 码农网



12本最具影响力的程序员书籍 �C 码农网

这是一个很值得探讨的问题,而且也是我在成为软件工程师之时问了很多导师的一个问题。但问题是,很多人推荐的是不同主题的不同书籍。他们推荐的书在他们看来是伟大的,但没有人能告诉我,要想成为一个伟大的工程师,我应该阅读什么,哪些是重要的、是必读的书籍。

我从我的导师那儿学到了很多东西,并意识到,我仍然有很多东西需要学习,还有许多不同的书需要阅读。我决定每个月读一本专业领域(软件工程)的书。随着时间的积累,我总结出了我认为想要成为一个顶级开发人员必须阅读的书单。

事先声明――只是阅读这些书不会让你成为一个伟大的开发者。你还需要积累多年的工作经验,并应用这些书中的原则到现实实践中,并在现实世界中发展你解决问题的能力。

阅读这些书可以帮助你避免一些常见的陷阱和错误,一些开发人员早期经历的陷阱和犯过的错误。我多么希望在我刚进入软件领域的时候,就有人向我推荐这些书啊,并且我现在依然很庆幸自己发现并反复阅读了这些书!也许你已经在大学读计算机科学或工程课程的时候读到过其中的一些书。也许在那个时候,你觉得它们并不重要,但是我可以用我亲身经历来说明我使用和应用了许多来自于这些书的原则。

我还要指出的是,此书单并不详尽。每年都会有许多伟大的著作问世。这些只是对我和我的职业生涯影响最大的书籍。此外,这些书和使用什么语言无关,可以应用于任何软件语言。

好了,让我们开始介绍这些书吧! (请鼓掌)

(这些都是必不可少的,我将根据它们对我的影响大小从后往前介绍。)

12.《Working Effectively with Legacy Code》

我之所以喜欢这本书,是因为几乎所有的软件开发人员,在其职业生涯的某个时刻,往往会不得不支持和工作于遗留系统。在这本书中,Michael Feathers提供了从开始到结束的策略,以便于更有效地工作于未经测试的遗留代码库。本书借鉴了Michael为其著名的Object Mentor专题研讨会创作的材料:Michael用于指导的技术,以帮助开发人员,技术管理人员和测试人员掌控遗留系统。

11.《The Mythical Man-Month》

本书是一本经典之作,但最近被修改和更正了。令人惊奇的是这本书仍然与软件产品开发密切相关。如果你从事软件的话,这本书是必读的。这本书最有价值的部分,我相信,是"plan to throw out"原型章节。尽管我们的目标通常是做一个更大,更好,更快,不管它是什么的东西,但是我们总会构建出一些不得不被废弃,需要重做的东西。这种情况我亲身经历过很多很多次。因此,关键是要plan to throw out(计划抛弃),这样你才能适应接下来的情况。如果你梦想第一个产品就ok,那么你就会有抛弃它们的风险,因为产品的改进和发展是不可避免的。计划抛弃也有助于通过设置合理的里程碑来达到进度目标。

10.《Design Patterns》

如果你打算成为一名架构师或系统的设计人员,那么你很有可能会被要求阅读这本书。这是一本被誉为有史以来最伟大的有关于软件开发的书,详细讲述了许多不同的设计模式,这么多年来一直在帮助软件工程师避免和处理行业面临的常见问题。遵照这本书的策略可以助你打造更高品质,灵活和可维护的软件。传说中的"四人帮"就是这本书,因为它是由四个著名的作者共同编写的。

9.《Programming Pearls 第二版》

这本书和这书单上的其他书籍略有不同。我想说这本书可以帮助一个人"像一个程序员一样思考"。《Programming Pearls》是先前发表在"Communications of the ACM(美国计算机学会通讯)"的15篇专栏的一个纲要。这些专栏涵盖了广泛与编程相关的主题:从需求收集到性能优化。重点关注编码技术和算法。

每个专栏被组织为一个章节。章节通常以一个实际问题的情景呈现开头。然后,提出各种解决方案和相应的经验教训。写作风格清晰明快。

《Programming Pearls》不是教授新编程概念的寻常书籍。虽然它包含了优秀,有时甚至是相当新奇的想法,但这本书的目的不是教你一些新的东西,而是帮助你成为一个更好的问题解决者。

8.《CODE: The Hidden Language of Computer Hardware and Software》

这本书清理了创建和开发复杂系统的大量"魔法"。现在的抽象是如此之多,以致于一些低层次的细节反而不为开发人员所知。虽然你可能不会发现自己在实践中时刻使用着这本书――但我相信,知道自己正在构建什么以及整个编排的工作原理是什么,总归是一个好主意。当你需要打开"黑匣子",深入软件或硬件来解决一个讨厌的bug的时候,它就能派上用场了。Charles Petzold写的《CODE: The Hidden Language of Computer Hardware and Software》梳理了许多编程概念――从数字系统的十进制,八进制,二进制到高级语言。这本书介绍了基于包的通信协议和TCP。许多章节讲解了有关硬件的概念,有五个章节涉及到了软件和教导操作系统,浮点运算和图形用户界面。

7.《The Art of Computer Programming》

这又是一部经典之作。由著名的计算机科学家教授Donald Knuth编著,并得到行业内众多顶尖程序员的一致好评。甚至连Bill Gates也对这本书赞誉有加:

"如果你认为你是一个真正优秀的程序员……那么就去读[Knuth的]《The Art of Computer Programming》吧……如果你能读懂整本书,那么请一定要给我发简历。"

这本书以基本的编程概念和技术开头,然后聚焦于更具体的信息结构――计算机内的信息表示,数据元素之间的结构关系,以及如何有效地处理这些问题。此外还提供了基本的应用程序给仿真模拟,数值方法,符号计算,软件和系统设计。

6.《Refactoring》

Martin Fowler写的《Refactoring》主要关于改进现有代码的设计。这是一个改变软件系统而不改变代码的外部行为,却能提高它内部结构的过程。通过重构,你甚至可以将一个糟糕的设计重新制作为一个很好的设计。这本书对重构原则进行了深入探讨,包括在哪里发现重构的机会,以及如何建立所需的测试。另外还有一个目录有40多个已经用细节证明的重构,这些细节包括何时以及为什么要使用重构,逐步说明如何实现重构,并举例说明重构是如何工作的。这本书用Java作为其主要语言而写,但其中的思路适用于任何OO语言。

5.《Clean Code》

《Clean Code》,作者Robert C. Martin,分为三个部分。第一部分介绍原则、模式和编写干净代码的实践方法。第二部分包括若干个复杂度渐进的研究案例。每个案例研究就是一个清洁代码的练习,也是通过解决代码库中的一些问题让代码变得健全、高效的练习。第三部分是决定性的一个部分:每个单独的章节在创建案例研究的时候包含了一系列启发式的教学法。最后得到了描述我们在编写、阅读和清理代码时的思考方式的知识库。

4.《Introduction to Algorithms》

这必须是理解和使用算法(将在软件开发中涉及很多)的最佳书籍。有些关于算法的书虽然严谨,但不全面――还有一些虽然涉及面广,但却缺乏严谨性。《Introduction to Algorithms》独特地结合了严谨性和全面性。这本书涵盖了广泛又深入的算法,使得书中的设计和分析能够面向所有层次的阅读人员。每个章节相对独立,可看作是一个学习单元。算法用英语和可读的伪代码描述。它使用初级基本的解释,并不牺牲覆盖的深度和材料的严谨性。第一版不仅广泛成为了世界各地高校的教材,还成为了专业人士的标准参考书。第二版新增了算法,概率分析,随机算法,线性规划的章节。

3.《Structure and Interpretation of Computer Programs》

以一种对解决问题和编程技术分析和严谨的态度,这本书面向于工程。《Structure and Interpretation of Computer Programs》强调通过不同方式来发挥核心作用,以处理计算模型中的时间。其独特的方式使得它非常适合于计算机科学课程,以及编程语言和程序设计的入门。这本书进一步解释了4个最著名的编程语言范式――命令式编程,面向对象编程,基于逻辑编程和应用性编程。

2.《Pragmatic Programmer》

这是我最先阅读的编程书籍之一。是我的一个朋友在我就职第一份专业工作的时候推荐给我的。我很庆幸他这么做了。尽管这本书写于1999年,但是它的概念是我们以一种务实的态度去开发复杂系统的基础。程序员也是工匠,他们被训练使用一组特定的工具(编辑器,对象管理,版本跟踪器)生成某种可在一定环境中(硬件组件上的操作系统)工作的产品(程序)。和任何其他工艺一样,计算机编程也孕育出了智慧,但其中的大多数智慧是不能从大学或认证课程中学到的。大多数程序员只能通过独立的试验,时间一点点的积累,才能掌握这些所谓的技巧。在《Pragmatic Programmer》一书中,Andrew Hunt和David Thomas编纂了很多他们在分别作为软件设计者和代码编写者的职业生涯中发现的真理。

作者的一些实用性建议非常具体,而且显然很易于实施。他们建议读者去学习,例如一个文本编辑器,然后在各种情况下使用它。他们还建议使用版本跟踪软件――即使是对最小型的项目,学习正则表达式语法和文本操作语言。书中还有其他许多也非常有价值的建议。在调试部分,作者指出:"如果你看到蹄印的话,应该考虑马这个范围,而不是斑马。"也就是说,要怀疑一切,然后从最显眼的地方寻找问题。还有关于预估时间和费用,以及将集成测试纳入到开发进程的建议。《Pragmatic Programmer》让人爱不释手的还有两个原因:它会更清晰地梳理你自己积累的智慧,它还会给你介绍你还没考虑到的工作方法。

1.《Code Complete 2》

就是它了!这就是我认为首屈一指值得阅读的书(请恕我妄言),如果你要成为一个优秀的软件工程师的话。它被广泛认为是最好的实用性编程指南之一,Steve McConnell最初的《Code Complete》在过去的10多年时间里,一直在帮助开发人员编写更好的软件。现在,这部经典书籍已全面更新,修改成了前沿的实践方法――以及数以百计的新的代码示例――修订了软件结构的艺术和科学。从研究、学术界和日常商业实践中捕获知识体系,McConnell将最有效的技术和必须知道的原则总结成清晰又务实的指导。无论你的经验水平,开发环境,还有项目规模如何,这本书都可以启迪和激发你的思考,帮助你打造最优质的代码。

不断地探索技巧和策略,可以帮助你:

  • 最小复杂性和最大创意的设计
  • 获得协同开发带来的好处
  • 应用防御性编程技术,以减少和驱赶错误
  • 利用机会安全地重构或改进代码
  • 使用针对你项目的结构方法
  • 快速有效地调试问题
  • 早早地正确解决关键的结构问题
  • 从头到尾项目打造高质量的项目

Read full article from 12本最具影响力的程序员书籍 �C 码农网


Gun-wielding pair strikes in early morning S.F. home invasion - SFGate



Gun-wielding pair strikes in early morning S.F. home invasion - SFGate

Remember Me   Kale Williams | on December 31, 2015 Photo: Kale Williams Image 1 of 1 San Francisco police are investigating a home-invasion robbery after a man and a woman were woken up by two armed gunmen in the Bayview district Thursday morning. San Francisco police are investigating a home-invasion robbery after a man and a woman were woken up by two armed gunmen in the Bayview district Thursday morning. Photo: Kale Williams 1 / 1 Back to Gallery A San Francisco couple was lucky to have only lost a purse, some cash and a couple tablets after a home-invasion robbery in which one of the victims woke up with a gun pressed to his forehead Thursday morning, authorities said. Officers responded to reports of the robbery around 2 a.m. on the 2000 block of Bancroft Avenue near Phelps Street in the Bayview district, said Officer Albie Esparza , a police spokesman. The victim, identified only as a 41-year-old man,

Read full article from Gun-wielding pair strikes in early morning S.F. home invasion - SFGate


Android users are lusting most after the Nexus 6P, Note 5, and Priv | Android Central



Android users are lusting most after the Nexus 6P, Note 5, and Priv | Android Central

Sticking close to home Android users are lusting most after the Nexus 6P, Note 5, and Priv When it comes to buying a new phone, we have a tendency to stick close to home. In our first look at the purchase interest and intent of the Mobile Nations' communities, we tapped into the level of demand for tablets, watches, and TV boxes being offered by the biggest smartphone providers. But the smartphone itself remains the primary digital device for many, and plenty of companies have debuted offerings in the past few months that vied to become holiday purchases — or at least a last-minute buy before the calendar flips over. So late last month, we asked over 5,700 readers of Android Central, CrackBerry, iMore and Windows Central to share their thoughts on what could be taking their calls. Even the smartphones that garnered the most interest didn't muster the same amount of attention as some of the hot (and newer) non-smartphone products like as Android Wear, Apple TV and the Surface Book.

Read full article from Android users are lusting most after the Nexus 6P, Note 5, and Priv | Android Central


Apple Inc. (AAPL) Position Boosted by MUFG Americas - Dakota Financial News



Apple Inc. (AAPL) Position Boosted by MUFG Americas - Dakota Financial News

Apple Inc. - Get News & Ratings Daily Enter your email address below to get the latest news and analysts' ratings for Apple Inc. with our FREE daily email newsletter: Follow Us on Social Media       MUFG Americas boosted its stake in shares of Apple Inc. (NASDAQ:AAPL) by 0.0% during the third quarter, according to its most recent disclosure with the Securities and Exchange Commission. The firm owned 553,010 shares of the iPhone maker's stock after buying an additional 171 shares during the period. Apple accounts for about 2.3% of MUFG Americas' portfolio, making the stock its 3rd largest position. MUFG Americas' holdings in Apple were worth $60,997,000 as of its most recent SEC filing. Several other hedge funds also recently bought and sold shares of the stock. TrimTabs Asset Management bought a new stake in Apple during the third quarter valued at $2,157,000. Chelsea Counsel Company boosted its stake in Apple by 8.9% in the third quarter. Chelsea Counsel Company now owns 168,

Read full article from Apple Inc. (AAPL) Position Boosted by MUFG Americas - Dakota Financial News


Wow, the Republicans really don't understand how they created Donald Trump - Salon.com



Wow, the Republicans really don’t understand how they created Donald Trump - Salon.com

Thursday, Dec 31, 2015 5:41 PM UTC Wow, the Republicans really don’t understand how they created Donald Trump Conservative establishment will never figure this out unless they start talking honestly about their base and race All Share Services (Credit: Chuck Kennedy/AP/Charlie Neibergall) The latest issue of the Atlantic has a long essay by conservative pundit and former George W. Bush speechwriter David Frum analyzing the current squabble between the GOP’s elite donor class and its rank-and-file voters — a fight that has resulted in Donald Trump dominating the presidential primary polls while easily swatting down every establishment challenger from Jeb Bush to Scott Walker. It’s a solid and clear-eyed piece from a writer who has, despite his conservative bona fides, occasionally committed apostasy in the last few years as his Republican Party has found itself in thrall to its angry, nativist base. The piece falters, though,

Read full article from Wow, the Republicans really don’t understand how they created Donald Trump - Salon.com


Visitor design pattern example tutorial - HowToDoInJava



Visitor design pattern example tutorial - HowToDoInJava

Design patterns are used to solve the problems which occur in a pattern, we all know that, right? Also we know that behavioral design patterns are design patterns that identify common communication patterns between objects. One of such behavioral patterns is visitor pattern, which we are going to learn about in this post.


Read full article from Visitor design pattern example tutorial - HowToDoInJava


Visitor Design Pattern



Visitor Design Pattern

What is the Visitor Pattern?

The visitor pattern is a Gang of Four design pattern. This is a behavioural pattern as it defines a manner for controlling communication between classes or entities. The visitor pattern is used to separate a relatively complex set of structured data classes from the functionality that may be performed upon the data that they hold. This allows the creation of a data model with limited internal functionality and a set of visitors that perform operations upon the data. The pattern specifically allows each of the elements of a data structure to be visited in turn without knowing the details of the structure beforehand.

The key benefit of separating the data model from the algorithms that may be applied to it is the ability to add new operations easily. The classes of the data structure are initially created with the inclusion of a method that may be called by a visitor object. This method performs a callback to the visitor, passing itself to the visitor's method as a parameter. The visitor can then perform operations upon the data object. To add a new operation, a new visitor class is created with the appropriate callback method. The data classes need no further modification.

A second benefit of the design pattern is that a single visitor object is used to visit all elements of the data structure. The visitor object can maintain state between calls to individual data objects.

An example of the use of the visitor design pattern could be used within a personnel system. The data structure could define a hierarchy of managers and employees, each with a salary property. This system could include two visitor algorithms. The first would traverse the hierarchy and generate monthly salary payments. The second could apply a standard pay increase to each employee.


Read full article from Visitor Design Pattern


Twitter: Politwoops is back



Twitter: Politwoops is back

Cancel Set Get the news Share This Story! Let friends in your social network know what you are reading about Twitter: Politwoops is back Just in time for the 2016 election cycle, the tool will surface tweets politicians deleted. Post to Facebook {# #} A link has been sent to your friend's email address. Posted! Join the Nation's Conversation To find out more about Facebook commenting please read the Conversation Guidelines and FAQs Twitter: Politwoops is back Jessica Guynn , USA TODAY 12:45 p.m. EST December 31, 2015 Twitter headquarters in San Francisco (Photo: Justin Sullivan, Getty Images) SAN FRANCISCO — Just in time for the 2016 election cycle, Twitter is bringing back Politwoops. The gaffe tracker created by The Sunlight Foundation and The Open State Foundation archives tweets that politicians delete, some of them truly cringeworthy. One congressional staffer was even fired after Politwoops brought to light a deleted tweet sent during the Super Bowl: "Me likey Broke Girls.

Read full article from Twitter: Politwoops is back


仅差870亿美元:谷歌市值要超越苹果有多难?_网易科技



仅差870亿美元:谷歌市值要超越苹果有多难?_网易科技

甚至谷歌在核心业务上也并非高枕无忧。在本地搜索方面,他们的竞争对手包括Yelp和OpenDoor、微软等企业。早在今年1月雅虎在搜索市场上的份额增长,导致谷歌的份额五年来首次降至75%之下。另外我们知道,微软的必应搜索服务已经实现了盈利,在PC端,微软的大招是用户可以免费下载和安装微软的最新操作系统Windows 10,并通过操作系统默认使用自家Cortana虚拟语音助理与必应搜索。另外是目前亚马逊在价格比较搜索领域来势凶猛,让谷歌无法安睡。同时,Facebook推出了个人助理服务"M",试图改变人们在网上搜索产品的方法。甚至苹果正在利用自身的封闭系统的软件产品布局优势来隔离谷歌搜索在苹果生态圈的影响力。比如iOS设备上,用户通过Safari浏览器进行搜索,苹果并不会优先显示谷歌搜索结果,而是会优先显示自家产品苹果地图或是iTunes Store上的搜索结果。这无疑也会影响到谷歌的付费广告收入。

谷歌相对于苹果的另一大短板在于在硬件方面没有太多亮点,目前还看不到消费前景。谷歌发展了各种看起来与核心业务关系不大、又存在高风险的部门与业务,例如无人驾驶汽车、气球网络、自动驾驶技术以及高速宽带互联网项目Google Fiber以及可以监测血糖的隐形眼镜等项目。但关键目前都不赚钱,投资者已经等不起,高速宽带互联网项目Google Fiber画的饼甚至也不如AT&T和Comcast公司利用现有光缆基础设施服务的想象空间。

我们看到,近年来,Google在研发方面的投入不断飙升,去年更飙升了38%,达到了98亿美元,远超过了谷歌19%的收入增长率。同时随着Google Glass、无人汽车等项目的受挫,Google的投资者开始要求更快的投资回报率,谷歌的广告营收压力增长。所以我们看到,早在2011年,谷歌就投资建设非洲市场的互联网基础设施,并且创建当地语言的搜索页面,以及谷歌日前与肯尼亚电话公司Safaricom合作将推出"免费地带"等,谷歌的这些布局的目的也寄望借此获取新的用户群,提升广告营收增长空间。

而从苹果近年来的市值表现与股价规律看,苹果也深受iPhone超级周期的影响。即一轮低潮之后引发下一轮高潮,S系列一般是苹果的低潮,紧跟着则是一轮股价上涨高潮,比如在2013年,由于苹果iPhone5s与前代区隔性不明显,缺乏震撼性的产品,导致其股价下跌,在2013年6月,苹果召开WWDC发布会,成功抑制股价下滑势头,直到iPhone6发布之后,苹果市值则快速增长,2015年苹果股价曾冲高到134.54美元,市值突破7500亿美元。

而此前美林美银分析师沃姆希・莫汉对于iPhone超级周期的分析也表达了同样的意思,他认为,苹果的上一个出货量高峰期是2014年12月份(iPhone6销售的旺季),下一个高峰期则可能要等到2016年9月份iPhone7发布后才会出现。我们也知道,苹果也需要一个差异化不明显的过渡性的产品(iPhone6s)制造一轮低潮,进而赢得更长的时间窗口进行延续性创新进而引发下一轮高潮,此前笔者也撰文指出,苹果对于iPhone7的投入与期望颇大,从功能、芯片、材质到专利,苹果为iPhone7未来的引爆效应正在做好各方面的准备。因此一旦iPhone7系列新设备上市,苹果股价将可能将在2016年反弹回升。

加之我们知道,苹果正在有意识将收入转移到为客户端服务上,高盛此前指出,如果目前使用iPhone一个用户所带来的ARPU是每月42美元,那么假设他使用所有的苹果设备,那么带来ARPU会达到每月153美元。不过ARPU能不能达到这个数还很难说,但从长远看,苹果的硬件和服务在用户基数上有着增长潜力。

综上我们知道,分析师们的预测逻辑是,如果这两家公司明年表现与今年类似,那么Alphabet市值将超过7500亿美元,而苹果市值却会降至5900亿美元。但从上面的分析可知,事实上可能恰恰相反,苹果股价在明年增长的可能性则更大,分析师预测谷歌市值增长一切基于谷歌的未来营收增长,其实分析师有意忽略了或者也并没有看到谷歌在营收上其实面临着一系列的威胁与不确定因素,未来维持股价的平稳以防反弹事实上都非常困难,更遑论超越苹果。


Read full article from 仅差870亿美元:谷歌市值要超越苹果有多难?_网易科技


Fight breaks out at Newark anti-violence rally (PHOTOS) | NJ.com



Fight breaks out at Newark anti-violence rally (PHOTOS) | NJ.com

Set Your Location (Enter City and State or Zip Code) Congratulations! Your weather is set to . You can change the location at any time. AccuWeather.com Quick Look Don't have an account? Favorite Schools NEWARK  — A skirmish broke out between rival activists on the steps of City Hall Wednesday during what had been intended as a demonstration against violence in Newark. Police were called to the scene after a small crowd began arguing over escalating violence and the city's attempts to curb it. The noon press conference was called by a group of activists led by Salaam Ismial, co-chair of the New Jersey Study Commission on Violence, and Abdul Muhammad, a longtime Newark anti-violence activist. In a release announcing the event, the two said they planned to ask Mayor Ras Baraka to "unleash his quality of life plan in addressing ongoing violence facing Newark residents." As the group spoke to reporters, however,

Read full article from Fight breaks out at Newark anti-violence rally (PHOTOS) | NJ.com


【晨间阅读】美国网速3年半提升2倍,为什么还落后于别的国家? | PingWest品玩



【晨间阅读】美国网速3年半提升2倍,为什么还落后于别的国家? | PingWest品玩


Read full article from 【晨间阅读】美国网速3年半提升2倍,为什么还落后于别的国家? | PingWest品玩


Debian Linux founder Ian Murdock dies at 42, cause unknown | ZDNet




Debian 社区发表悼念声明,缅怀创始人 Ian Murdock - 开源中国社区



Debian 社区发表悼念声明,缅怀创始人 Ian Murdock - 开源中国社区

Ian 从 1993 年8 月开始启动 Debian 项目,并在同一年的稍晚时间正式发布了它的第一个版本,Debian 还会一直坚定不移地继续努力,成为流行世界、亿万人受惠的通用操作系统,不管是嵌入式设备还是太空站,都能看到它的身影。

Ian 一直非常关注在创建一个发行版和开源社区文化的过程中做正确的事情,不管是技术上,还是道德上。每一次准备好的系统发布,都包含着对自由软件和自由精神立场的坚定支持。

Ian 对开源的忠诚奉献一直引导着他的工作,不管是在 Debian 还是在后来的年月里,一直伴随他朝着最好的未来。Ian 的梦想一直都在发扬和继续,Debian 社区仍然非常活跃,成千上万的开发者们用数不清的工作时间带给世界一个安全可靠的操作系统。

这段特殊时期,Debian 社区的精神会一直陪伴着 Ian 的家庭,会陪伴一起共度难关。

他 的家庭同时也请求大家在这个艰难的时刻留给他们一些隐私空间,我们对此非常尊重,同时也号召大家尊重 Ian 家人的愿望,来自 Debian 社区和开源社区的关心他的人们的慰问,可以发送到这个专属邮箱 in-memoriam-ian@debian.org ,Debian 社区会保存这份善意,并存档。

逝者已往,愿 Ian 安息,这位把自己的浪漫书写在了 Debian 和 Free Software  的传奇人物,一路走好,我们会永远记住您!Linux Story 谨上。


Read full article from Debian 社区发表悼念声明,缅怀创始人 Ian Murdock - 开源中国社区


程序猿的年终总结,各种版本各种残



程序猿的年终总结,各种版本各种残

深夜11点,写完今天最后一个代码,小猿起身合上电脑,用滚烫的开水为自己泡制了一桶老坛酸菜牛肉面。这是苦逼程序猿给接下来继续奋战的自己最好的馈赠。中国的程序猿更偏爱坐在窗前,在夜晚中静静的享受独特的泡面香味。科班出身的他虽然写了N多复杂代码,但仍口味清淡,他们往往不加或少加料包,由泡面热腾腾的蒸汽熏蒸自己的脸颊,润湿又干又涩的双眼,抚慰受伤的心灵。然后,看着外边依然还是熙熙攘攘的车流和不属于自己的任何一个亮灯的窗口,却思考着如何才能成为一个名垂青史的程序猿……程序猿不迷茫……


Read full article from 程序猿的年终总结,各种版本各种残


Refactoring as a way to understand code - composition.al



Refactoring as a way to understand code - composition.al

Dec 29th, 2015 Recently, an acquaintance was complaining of a project they were working on that involved reading a mountain of "incidentally complex" code — code that wasn't doing anything particularly interesting algorithmically, but that was nevertheless so hairy that it was difficult to understand the implications of adding even the small feature they wanted to add. After reading code non-stop for a week, they were tearing their hair out in frustration. As a researcher, I'm often faced with piles of undocumented, untested, poorly-engineered, "research-quality" code that I need to somehow come to understand well enough to modify. What I've found is that I can't just sit there and read that kind of code for very long; I don't learn anything, and I end up miserable. I need to dig in and start trying to refactor. The idea is to pick some concrete task and attempt it. Depending on the code, some options (in order of how ambitious they are) might include:

Read full article from Refactoring as a way to understand code - composition.al


Does Google Stock Have Room Left to Grow? (GOOG, GOOGL) | InvestorPlace



Does Google Stock Have Room Left to Grow? (GOOG, GOOGL) | InvestorPlace

    Popular Posts: Alphabet ( GOOG , GOOGL ) has been one of the best-performing large-cap tech stocks of 2015. Google stock is near all-time highs right now, up nearly 50% this year and supporting a market capitalization of $540 billion. This makes GOOGL the second most valuable company in the world, behind only Apple ( AAPL ). Looking ahead to 2016, is it possible that the Google stock price will go even higher, and GOOGL become even more valuable? Is GOOGL Worth $600 Billion? Fact is that if Google stock goes much higher, it will be even more valuable than Apple. In the event that AAPL trades flat, if Google stock were to trade higher by just 15%, then GOOGL would likely become even more valuable than AAPL due to the latter's aggressive stock buybacks. That would be hard to imagine given the difference between the actual sizes of these two companies. Company $233.7 billion $69.8 billion Given the information above,

Read full article from Does Google Stock Have Room Left to Grow? (GOOG, GOOGL) | InvestorPlace


Apple Inc.: Why Being So Widely Held Will Hurt AAPL Stock | InvestorPlace



Apple Inc.: Why Being So Widely Held Will Hurt AAPL Stock | InvestorPlace

Apple Inc.: Why Being So Widely Held Will Hurt AAPL This trade is too crowded with bulls, and AAPL shares are swarmed with too many signs of trouble     Apple Inc. (NASDAQ: AAPL ) — the most widely held stock in the world — is getting ready to close out its most disappointing year in almost two decades. Do you think, like the majority of the crowd, that you should be looking at this as a value opportunity, or just the beginning of a lengthy decline in Apple stock? Our analysis suggests that the latter is about to take place, signaling that the real opportunity is to sell the shares before things get worse. Let's start with why we're considering AAPL's performance to be among the worst in more than 18 years. This year, Apple stock will return -2.2% (if we closed the books today) at the same time that the market is going to squeak out a slight gain. The last time AAPL shares posted a loss when the market gained was in 1997. This, of course, was during the era where Apple Inc.

Read full article from Apple Inc.: Why Being So Widely Held Will Hurt AAPL Stock | InvestorPlace


Oil Prices Become a Problem for U.S. Steelmakers - Bloomberg Business



Oil Prices Become a Problem for U.S. Steelmakers - Bloomberg Business

Connecting decision makers to a dynamic network of information, people and ideas, Bloomberg quickly and accurately delivers business and financial information, news and insight around the world. Updated on Lower U.S. demand is hurting domestic producers and importers The price of hot-rolled steel coil has lost 38% this year U.S. steelmakers battered by plunging prices have been quick to blame a flood of cheap Chinese shipments. But with imports nearing four-year lows, another culprit is emerging: the energy collapse. Foreign steel coming into the U.S. dropped 36 percent in November from a year ago, according to U.S. Census Bureau data. That's with domestic prices at the weakest in at least nine years and new taxes on products from six countries deemed to be unfairly priced. Yet U.S. mills have idled the most capacity since the financial crisis, operating at just 61 percent in the week ending Dec. 21.

Read full article from Oil Prices Become a Problem for U.S. Steelmakers - Bloomberg Business


[LeetCode]Number of Connected Components in an Undirected Graph - EpoTalk - SegmentFault



[LeetCode]Number of Connected Components in an Undirected Graph - EpoTalk - SegmentFault

Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to find the number of connected components in an undirected graph.

Example 1:

    0          3      |          |      1 --- 2    4

Given n = 5 and edges = [[0, 1], [1, 2], [3, 4]], return 2.

Example 2:

    0           4      |           |      1 --- 2 --- 3

Given n = 5 and edges = [[0, 1], [1, 2], [2, 3], [3, 4]], return 1.

分析

典型且很基础的union find题。用一个数组记录各个数字的父节点,然后遍历图,对edge中两个端点做union。最后扫一遍数组,找到根节点个数即可。


Read full article from [LeetCode]Number of Connected Components in an Undirected Graph - EpoTalk - SegmentFault


California ~ Personal Income Tax: 2015 Tax Rate Schedules, Filing Thresholds, Other Adjusted Figures Released |



California ~ Personal Income Tax: 2015 Tax Rate Schedules, Filing Thresholds, Other Adjusted Figures Released |

The California Franchise Tax Board has adjusted the California personal income tax rate schedules, return filing thresholds, personal exemption amounts, standard deduction amounts, itemized deduction reduction thresholds, and other credit and exemption amounts for 2015. The adjusted figures are based on a 1.3% inflation rate for the period from June 2014 to June 2015.

Rates

For 2015, the personal income tax rates for single taxpayers and married taxpayers filing separately range from 1.0% of the first $7,850 of taxable income (formerly, $7,749 for 2014) to 12.3% of taxable income that is $526,443 and over (formerly, $519,687 and over for 2014). For married taxpayers filing jointly and surviving spouses with a dependent child, the rates range from 1.0% of the first $15,700 of taxable income (formerly, $15,498 for 2014) to 12.3% of taxable income that is $1,052,886 and over (formerly, $1,039,374 and over for 2014). For taxpayers filing as heads of households, the rates range from 1.0% of the first $15,710 of taxable income (formerly, $15,508 for 2014) to 12.3% of taxable income that is $715,962 and over (formerly, $706,774 and over for 2014).

Filing Thresholds

For 2015, a single taxpayer or head of household taxpayer must file a return if the taxpayer's adjusted gross income (AGI) exceeds an amount ranging from $13,005 to $33,620 (formerly, $12,838 to $33,223 for 2014) or if the taxpayer's gross income exceeds an amount ranging from $16,256 to $36,871 (formerly, $16,047 to $36,432 for 2014). A surviving spouse taxpayer with dependents must file a return if the taxpayer's AGI exceeds an amount ranging from $24,238 to $33,620 (formerly, $23,938 to $33,223 for 2014) or if the taxpayer's gross income exceeds an amount ranging from $27,489 to $36,871 (formerly, $27,147 to $36,432 for 2014). The corresponding AGI and gross income thresholds requiring married couples to file a return range from $26,012 to $52,077 (formerly, $25,678 to $51,463 for 2014) and from $32,514 to $58,579 (formerly, $32,097 to $57,882 for 2014), respectively. The number of dependents and the taxpayer's age (under 65, or 65 or older) determine the filing threshold level that applies.

Individuals who do not meet the filing thresholds but who had state income tax withheld or made estimated tax payments will need to file returns to receive their refunds. In addition, some individuals may qualify for the state's new earned income tax credit and may need to file to claim that refundable credit.

Personal Exemption

The personal exemption credits increase to $109 (previously, $108) for single taxpayers, married taxpayers filing separately, and heads of households and to $218 (previously, $216) for married taxpayers filing jointly and surviving spouses. The personal exemption amount for dependents increases to $337 (previously, $333).

The AGI thresholds that activate the phaseout of personal exemption credits for 2015 are $178,706 for single taxpayers and married taxpayers filing separately (formerly, $176,413 for 2014), $357,417 for married taxpayers filing jointly and surviving spouses (formerly, $352,830 for 2014), and $268,063 for heads of households (formerly, $264,623 for 2014).

Standard Deduction

The standard deduction increases to $4,044 (previously, $3,992) for single taxpayers and married taxpayers filing separate returns and to $8,088 (previously, $7,984) for married taxpayers filing jointly, surviving spouses, and heads of households.

Itemized Deduction Reduction Thresholds

The AGI thresholds that activate the reduction of itemized deductions for 2015 are $178,706 for single taxpayers and married taxpayers filing separately (formerly, $176,413 for 2014), $357,417 for married taxpayers filing jointly and surviving spouses (formerly, $352,830 for 2014), and $268,063 for heads of households (formerly, $264,623 for 2014).

Credits

The renter's credit will be available for single filers with adjusted gross incomes of $38,259 or less (previously, $37,768 or less) and for joint filers with adjusted gross incomes of $76,518 or less (previously, $75,536 or less).

The joint custody head of household credit and the dependent parent credit are increased for 2015 to the lesser of $431 (formerly, $425 for 2014) or 30% of net tax.

The qualified senior head of household credit is increased for 2015 to 2% of taxable income of up to $69,902 (formerly, $69,005 for 2014), up to a $1,317 (formerly, $1,300 for 2014) maximum credit amount.

Alternative Minimum Tax Exemption

The alternative minimum tax exemption amounts for 2015 are increased to $65,721 (formerly, $64,878 for 2014) for single or unmarried taxpayers, $43,812 (formerly, $43,250 for 2014) for married taxpayers filing separately and estates and trusts, and $87,627 (formerly, $86,502 for 2014) for married taxpayers filing jointly and surviving spouses. Exemption phaseouts begin at the following alternative minimum taxable income levels for 2015: $246,451 (formerly, $243,288 for 2014) for single or unmarried taxpayers, $164,299 (formerly, $162,191 for 2014) for married taxpayers filing separately and estates and trusts, and $328,601 (formerly, $324,384 for 2014) for married taxpayers filing jointly and surviving spouses.


Read full article from California ~ Personal Income Tax: 2015 Tax Rate Schedules, Filing Thresholds, Other Adjusted Figures Released |


Java8所有的包介绍(由英文文档翻译而来) - 小宝鸽 - 博客频道 - CSDN.NET



Java8所有的包介绍(由英文文档翻译而来) - 小宝鸽 - 博客频道 - CSDN.NET

翻译了一天,终于把翻译任务的"Java 8所有的包介绍"翻译完了,收获也是非常大,了解了Java8中所有包的作用,对Java8有了一个整体的了解,另外也是提高了自身的阅读能力。

http://code.csdn.net/translations/97 这是我参与的一个翻译项目"Java-SE8-API文档"翻译。
希望有更多的人参与到翻译当中,一起提高一起学习。


Java平台,标准版第八版

API规范

java.applet

提供了需要创建一个小程序和用来跟其他小程序交流上下文的类。

java.awt

包含了所有用于创建用户界面和绘制图形和图像的类。

java.awt.color

提供了颜色空间的类。

java.awt.datatransfer

提供了应用程序内部和应用程序之间进行数据交换的接口和类。

java.awt.dnd

拖放功能是分布在许多提供一个与GUI中的显示元素逻辑相关的两个实体之间交换数据机制的用户界面系统中的直接操作动作。

java.awt.event

提供了处理由AWT组件激活的不同类型的事件的接口和类。

java.awt.font

提供了与字体相关的类和接口。

java.awt.geom

提供了定义和执行二维几何相关对象的Java 2D类。

java.awt.im

提供了输入法框架的类和接口。

java.awt.im.spi

提供了能开发可用于在任何Java运行环境的输入法的接口。


Read full article from Java8所有的包介绍(由英文文档翻译而来) - 小宝鸽 - 博客频道 - CSDN.NET


芯片企业竞购战火再燃:仙童收到最新收购要约_科技_腾讯网



芯片企业竞购战火再燃:仙童收到最新收购要约_科技_腾讯网

腾讯科技讯 12月30日,仙童半导体周二表示,一家竞购方调整了对该公司的竞购报价,希望与ON Semiconductor展开竞争。

仙童半导体并未披露该公司的身份,只是透露其将竞购报价上调至每股21.70美元,但该公司之前曾经表示,这一报价并不优于ON Semiconductor给出的每股20美元的报价。

本月早些时候,有多家新闻机构报道称,仙童半导体的竞购方是中国华润集团和清芯华创投资管理公司。中国投资者近来收购芯片企业的意愿颇强,而清芯华创去年也曾计划收购OmniVision。

仙童半导体虽然近期在巨头云集的芯片行业表现不佳,但该公司却在硅谷的发展过程中扮演了重要角色。他由一群外号"八叛逆"的工程师共同创办,这8位工程师开发了首款可以量产的集成电路。(长歌)


Read full article from 芯片企业竞购战火再燃:仙童收到最新收购要约_科技_腾讯网


There's Something Rotten in Amazon's Pantry | Seamus Condron | PCMag.com



There's Something Rotten in Amazon's Pantry | Seamus Condron | PCMag.com

I failed to notice that Prime Pantry, while seemingly part of the Prime family of services, did not offer free shipping on this box of goodies. In fact, it cost $5.99. When you're used to paying zero shipping on items like televisions and other big ticket items, and then getting that item two days later, you become accustomed to a certain lifestyle. As far as I was concerned, $5.99 could have been $19.99 or more. As an Amazon Prime addict, paying for shipping just feels...dirty.

The worst shocker was yet to come. I was coming around on the idea that getting a 45-pound box of groceries delivered to me for under six bucks was actually a good deal considering how quickly I'd get it. But then I glanced at the delivery time of my box of wonders. Note: anyone with a history of heart trouble should think about not continuing. OK? Here we go.

There

Read full article from There's Something Rotten in Amazon's Pantry | Seamus Condron | PCMag.com


What's So "Prime" About Prime Pantry? | Re/code



What’s So “Prime” About Prime Pantry? | Re/code

Amazon’s smiley logo is a good fit for me, a relatively happy customer — an Amazon Prime member, even. I’m also a new parent; the two tend to go hand in hand.

You see, the $99-a-year Amazon Prime service has saved my baby-raising, city-dwelling self umpteen hours of battling traffic en route to the ’burbs for a visit to Buy Buy Baby or Babies R Us, where I would hunt tirelessly for some obscure infant item. Instead, I pick up my iPhone, open the Amazon app, select the item I want and tap the one-click button to order. Two days later, it’s on my doorstep, shipped for free — unless someone steals it, which is another story.


Read full article from What’s So “Prime” About Prime Pantry? | Re/code


Best Baby Bottles: Glass vs. Plastic



Best Baby Bottles: Glass vs. Plastic

Baby Bottle Worries

The problem with glass bottles is pretty obvious -- drop one on the floor in the middle of a late-night feeding, and you'll have a roomful of shattered glass to clean up. Glass is also heavy and cumbersome. On the upside, glass bottles are sturdy, and they don't contain any chemicals that could potentially get into the baby's formula.

Plastic baby bottles are lightweight, strong, and unbreakable. In 2012, the FDA banned the use of bisphenol A in the manufacture of baby bottles and sippy cups. There were concerns that the chemical in polycarbonate plastic could lead to certain cancers, changes in the brain and reproductive system, and early puberty. All baby bottles and sippy cups sold in the USA are now BPA-free.

In 2013, the FDA supported a food additive amendment to end the use of bisphenol A-based epoxy resins in the lining of formula cans. Manufacturers had abandoned the use of BPA in those products, so the move was largely supportive.


Read full article from Best Baby Bottles: Glass vs. Plastic


Google Glass 2.0 is real, and here are photos to prove it - CNET



Google Glass 2.0 is real, and here are photos to prove it - CNET

Top Stories Google Glass 2.0 is real, and here are photos to prove it Google Glass 2.0 is real, and here are photos to prove it Photos that Google filed with the FCC show the device inside and out. Sarah Tew/CNET The next generation of Google Glass, Google's head-mounted wearable display, is the real deal. A filing to the Federal Communications Commission, the U.S. government body that must review and approve personal electronics like phones and wearables, reveals photos of the device's external design, along with internal circuitry (see below) and also a basic user manual. The filing also includes a statement on company letterhead authorizing a third party to help get Google through the FCC's authorization process. A new edition of Google Glass signals a possible new direction for the company's stalled and stagnant wearable, especially if it winds up in use as a business tool rather than as product for everyday buyers, as blog 9-to-5 Google reports .

Read full article from Google Glass 2.0 is real, and here are photos to prove it - CNET


Putin's Bailout Bank Needs a Rescue; It's an $18 Billion Whopper - Bloomberg Business



Putin's Bailout Bank Needs a Rescue; It's an $18 Billion Whopper - Bloomberg Business

Connecting decision makers to a dynamic network of information, people and ideas, Bloomberg quickly and accurately delivers business and financial information, news and insight around the world. Updated on Western sanctions cut off funding access as debt payments loom VEB was supposed to be the financial supercharger of the Russian president's state-directed capitalism, using its government backing to raise billions at low rates on western markets and pumping them into ventures the Kremlin wanted funded, some concealed from public view with code names like "Lily of the Valley." Hit by Western sanctions last year, VEB has stopped new lending. The cost of its bailout could reach 1.3 trillion rubles ($18 billion), according to several senior government officials, ballooning the budget deficit at a time when plunging oil prices are forcing spending cuts. "The government can't just leave it alone to face the problems caused by the financial and economic situation in the country,

Read full article from Putin's Bailout Bank Needs a Rescue; It's an $18 Billion Whopper - Bloomberg Business


Putin's Bailout Bank Needs a Rescue; It's an $18 Billion Whopper - Bloomberg Business



Putin's Bailout Bank Needs a Rescue; It's an $18 Billion Whopper - Bloomberg Business

Connecting decision makers to a dynamic network of information, people and ideas, Bloomberg quickly and accurately delivers business and financial information, news and insight around the world. Updated on Western sanctions cut off funding access as debt payments loom VEB was supposed to be the financial supercharger of the Russian president's state-directed capitalism, using its government backing to raise billions at low rates on western markets and pumping them into ventures the Kremlin wanted funded, some concealed from public view with code names like "Lily of the Valley." Hit by Western sanctions last year, VEB has stopped new lending. The cost of its bailout could reach 1.3 trillion rubles ($18 billion), according to several senior government officials, ballooning the budget deficit at a time when plunging oil prices are forcing spending cuts. "The government can't just leave it alone to face the problems caused by the financial and economic situation in the country,

Read full article from Putin's Bailout Bank Needs a Rescue; It's an $18 Billion Whopper - Bloomberg Business


Javarevisited: The real difference between Process and Thread in Java



Javarevisited: The real difference between Process and Thread in Java

Menu The real difference between Process and Thread in Java One of the common question from programming interviews is, what is the difference between a Thread and a Process? Well, the main difference between them  is that a Process is a program which is executing some code and a thread is an independent path of execution inside the process. A process can have more than one thread for doing independent task e.g. a thread for reading data from disk, a thread for processing that data and another thread for sending that data over the network. This technique to improve throughput and better utilize CPU power is also known as multi-threading . Technically, most significant difference between thread is address space and context switching. All thread from a process share same address space but a process has their own address space. Similarly, context switching between process is more expensive than context switching between threads.

Read full article from Javarevisited: The real difference between Process and Thread in Java


自旋锁spinlock剖析与改进_知识库_博客园



自旋锁spinlock剖析与改进_知识库_博客园

  spinlock又称自旋锁,线程通过busy-wait-loop的方式来获取锁,任时刻只有一个线程能够获得锁,其他线程忙等待直到获得锁。spinlock在多处理器多线程环境的场景中有很广泛的使用,一般要求使用spinlock的临界区尽量简短,这样获取的锁可以尽快释放,以满足其他忙等的线程。Spinlock和mutex不同,spinlock不会导致线程的状态切换(用户态->内核态),但是spinlock使用不当(如临界区执行时间过长)会导致cpu busy飙高。

  2, spinlock与mutex对比

  2.1,优缺点比较

  spinlock不会使线程状态发生切换,mutex在获取不到锁的时候会选择sleep。

  mutex获取锁分为两阶段,第一阶段在用户态采用spinlock锁总线的方式获取一次锁,如果成功立即返回;否则进入第二阶段,调用系统的futex锁去sleep,当锁可用后被唤醒,继续竞争锁。

  Spinlock优点:没有昂贵的系统调用,一直处于用户态,执行速度快。

  Spinlock缺点:一直占用cpu,而且在执行过程中还会锁bus总线,锁总线时其他处理器不能使用总线。

  Mutex优点:不会忙等,得不到锁会sleep。

  Mutex缺点:sleep时会陷入到内核态,需要昂贵的系统调用。

  2.2,使用准则

  Spinlock使用准则:临界区尽量简短,控制在100行代码以内,不要有显式或者隐式的系统调用,调用的函数也尽量简短。例如,不要在临界区中调用read,write,open等会产生系统调用的函数,也不要去sleep;strcpy,memcpy等函数慎用,依赖于数据的大小。


Read full article from 自旋锁spinlock剖析与改进_知识库_博客园


Free PDF: How to be a Programmer: A Short, Comprehensive, and Personal Summary by Robert L. Read, PhD



Free PDF: How to be a Programmer: A Short, Comprehensive, and Personal Summary by Robert L. Read, PhD

This long essay attempts to summarize the non-technical things that I wish someone had explained to me at the beginning of my career as a professional programmer. It is primarily concerned with social situations and team relationships that occur in typical software development. I try to cover what I consider the essential, often non-techncial, skills of the beginning, intermediate and advanced programmer. The essay gives my opinions only; its value lies in that the material is so subjective that it is generally not taught in school directly or emphasized enough in publications. It begins with a table of contents that will allow the reader to judge their interest in the material. To the beginner, it may be a peek into the culture of the software engineer; to the advanced programmer, it is an opinionated review that I hope will provoke thought due to its comprehensiveness.


Read full article from Free PDF: How to be a Programmer: A Short, Comprehensive, and Personal Summary by Robert L. Read, PhD


Distributed Systems Reading List



Distributed Systems Reading List

A Distributed Systems Reading List

Introduction

I often argue that the toughest thing about distributed systems is changing the way you think. The below is a collection of material I've found useful for motivating these changes.

Thought Provokers

Ramblings that make you think about the way you design. Not everything can be solved with big servers, databases and transactions.

Amazon

Somewhat about the technology but more interesting is the culture and organization they've created to work with it.

Google

Current "rocket science" in distributed systems.

eBay

Interesting they dumped most of J2EE and use a lot of db partitioning. Check out their site upgrade tool as well.

Consistency Models

Key to building systems that suit their environments is finding the right tradeoff between consistency and availability.

Theory

Papers that describe various important elements of distributed systems design.

Languages and Tools

Issues of distributed systems construction with specific technologies.

Infrastructure

Storage

Paxos Consensus

Understanding this algorithm is the challenge. I would suggest reading "Paxos Made Simple" before the other papers and again afterward.

Other Consensus Papers

Gossip Protocols (Epidemic Behaviours)

P2P

  • Chord: A Scalable Peer-to-peer Lookup Protocol for Internet Applications
  • Kademlia: A Peer-to-peer Information System Based on the XOR Metric
  • Pastry: Scalable, decentralized object location and routing for large-scale peer-to-peer systems
  • PAST: A large-scale, persistent peer-to-peer storage utility - storage system atop Pastry
  • SCRIBE: A large-scale and decentralised application-level multicast infrastructure - wide area messaging atop Pastry

Read full article from Distributed Systems Reading List


2015年人工智能领域十大事件:无人机逐渐成熟,Magic Leap再融资_新芽NewSeed



2015年人工智能领域十大事件:无人机逐渐成熟,Magic Leap再融资_新芽NewSeed


Read full article from 2015年人工智能领域十大事件:无人机逐渐成熟,Magic Leap再融资_新芽NewSeed


Silicon's Valley's Brutal Ageism | New Republic



"" style="border: 0px; vertical-align: bottom;">