5. Overriding Spring IO Platform’s dependency management



5. Overriding Spring IO Platform's dependency management

5. Overriding Spring IO Platform's dependency management One of the major benefits of the Spring IO Platform is that it provides a set of versions that are known to work together, while also allowing you to override those versions to suit the needs of your project. Both the Spring IO Platform bom, and the Spring Boot bom from which it inherits, use properties to define the versions of the managed dependencies. To change the version of a dependency the value of its version property can be overridden. To identify the property that you wish to override, consult the sections of the Spring IO Platform bom and the Spring Boot bom from which it inherits. Exactly how the property is overridden depends on whether your project is built with Maven or Gradle. 5.1 Overriding a version using Maven To override a property in Maven you must use the Platform's bom as your pom's parent. You can then declare the property in your pom's 5.

Read full article from 5. Overriding Spring IO Platform's dependency management


Overriding Dependency Versions with Spring Boot



Overriding Dependency Versions with Spring Boot

This article explains some of the dependency management tricks that can be used to create libraries and apps that depend on newer versions of a transitive dependency than that managed by a platform like examples below uses Reactor as an example of such a dependency because it is nearing a major new release (2.5.0) but existing dependency management platforms (Spring Boot 1.3.xq) declare a dependency on older versions (2.0.7). If you wanted to write an app that depended on a new version of Reactor through a transitive dependency on a library, this is the situation you would be faced with. It is a reasonable thing to want to do this, but it should be done with caution, because newer versions of transitive dependencies can easily break features that rely on the older version in Spring Boot. When you do this, and apply one of the fixes below, you are divorcing yourself from the dependency management of Spring Boot and saying "hey, I know what I am doing, trust me." Unfortunately,

Read full article from Overriding Dependency Versions with Spring Boot


Best Baby Food Buying Guide - Consumer Reports



Best Baby Food Buying Guide - Consumer Reports

Your baby will be ready to expand his diet beyond breast milk or formula when she has reached some key developmental markers. Those usually include being able to sit up with support, holding her neck upright and steady, having good head control, and doubling her birth weight. You might notice that as your baby approaches 4 to 6 months she's more interested in reaching out and grabbing the food that you're eating. Since most babies lose the tongue-thrust reflex (when infants push their tongue against the roof of their mouth when a spoon is inserted) at about 4 months, you'll find it easier to spoon-feed her. The process might take awhile; introducing a variety of solid foods is a gradual process.

During your baby's first year, his menu will still include breast milk or formula before switching to cow's milk. The American Academy of Pediatrics recommends that babies be breast-fed exclusively for at least the first four months, preferably six months, and that breast-feeding continue until your child is 1 year old, even after you've introduced solid foods. Be sure to consult your own pediatrician about what to feed your baby, when to introduce solid foods, and how to introduce new foods.


Read full article from Best Baby Food Buying Guide - Consumer Reports


Fact-checking the first Clinton-Trump presidential debate - The Washington Post



Fact-checking the first Clinton-Trump presidential debate - The Washington Post

Get breaking news alerts from The Washington Post Turn on desktop notifications? It looks like you've previously blocked notifications. Please update your browser permissions to allow them. The inside track on Washington politics. Be the first to know about new stories from PowerPost. Sign up to follow, and we'll e-mail you free updates as they're published. You'll receive free e-mail news updates each time a new story is published. You're all set! Fact-checking the first Clinton-Trump presidential debate The inside track on Washington politics. Be the first to know about new stories from PowerPost. Sign up to follow, and we'll e-mail you free updates as they're published. You'll receive free e-mail news updates each time a new story is published. You're all set! Republican nominee Donald Trump and Democratic nominee Hillary Clinton shake hands at the presidential debate in New York.

Read full article from Fact-checking the first Clinton-Trump presidential debate - The Washington Post


如何找到心仪的工作 - liaozhen的专栏 - 博客频道 - CSDN.NET



如何找到心仪的工作 - liaozhen的专栏 - 博客频道 - CSDN.NET

好久没有写过博客了。回首自己过去的三年,感觉就像过得那么快,走了好远,感觉也应该回过头看看来时的路,也好整理心情,收拾包袱,轻装上路。网上看过很多人写的面经,感觉自己也获益不少,这篇文章就当是作为一个面经,希望能对正在找工作的码农同行们有些帮助吧。我根据这些经验拿到了每个参加onsite面试的公司的offer,而我深深的觉得,这种经验可以帮助到其他人,因为我可以拿到,别人就应该也可以拿得到。评论里有朋友指出题目叫做"我的面试经历"更好,这个建议很好,而我个人觉得,这样有点限制本文的读者和格局,所以还是不改标题了,因为目的是为了让找工作的朋友们能得到一些启发和帮助,要是有那么一点点帮助,也算功德一件。


我博士毕业的时候,因为种种原因,并没有花过什么时间准备面试,顺顺当当的就加入了Bing的团队,当时也面试了,不过估计因为是MSRA的长期intern,多少熟悉公司的技术,产品背景以及团队,面的就很顺利,印象中是周五左右面试,面完第二个周一就给了offer了。当时刚毕业,也不知道argue钱和股票,别人说多少就是多少,当然就更不知道competitive offer了,所以拿了之后就准备回老家去跟女朋友结婚,办签证,顺便回去吃喝玩乐。当时也去过百度群面过,面试时那叫一个人山人海,然后当时给offer的lead之前也在msra实习过,所以也算顺利。在面试百度和bing的中间,面了一下Google,当时人年轻气盛,基本上是去裸面的,可惜了当时好朋友的推荐,结果第一面就被刷了。不过后来因为拿了bing的offer,所以心里也没在意。到了bing之后,加油工作,老板也是非常照顾,每年都给升级,所以两年下来就升上了senior,也算在团队里面有点小名气,跟同事合作也很开心。这三年,可能因为心思单纯,做事情简单粗暴,被人挖坑被人拍砖也就呵呵过去,失败了转天重头来过,因此做的事情很多,做的多也就出货的多,基本上老板说什么讨论什么,过几天就能拿个执行方案出来,好多时候,用心把看起来简简单单平常的事当个重要的事做,所以状态很好,很有passion,走的也艰难,但是走的也远。读者可能会问,这跟你的标题没关系吧,其实工作的事,无非就是干活出货,找到这个状态很重要,有这个状态,就算现在的工作不是你心仪的工作,你也应该会找到心仪的工作的。


Read full article from 如何找到心仪的工作 - liaozhen的专栏 - 博客频道 - CSDN.NET


QAware | Blog: Apache Solr as a compressed, scalable, and high performance time series database



QAware | Blog: Apache Solr as a compressed, scalable, and high performance time series database

68.000.000.000 time correlated data objects: How to store such amount of data on your laptop computer and retrieve any point within a few milliseconds? We answered that question at FOSDEM 2015 Conference in Brussels.

A relational database management system (RDBMS) like Oracle, MySQL or Microsoft SQL Server and a normalized data-schema does not work well on 68 Billion data objects in a time series. They have some unacceptable drawbacks for us
  • long import duration,
  • slow query and retrieval of data objects, 
  • high amount of hard dive space and 
  • are limited in scalability due to RDBMS.
There are open source time series databases available, including InfluxDB, OpenTSBD, RDDTool or SciDB and many more but neither of them fully complies to our major requirements. 
  • fast imports and queries
  • storing arbitrary metadata on time series as well on data objects
  • minimal hard drive space
  • everything should run on a laptop computer without performance drawbacks
We decided to create our own solution instead of using a solution that only complies to 50 percent of our requirements. We realized how easy it is, to build a perfect matching solution when choosing the right tools.

Read full article from QAware | Blog: Apache Solr as a compressed, scalable, and high performance time series database


java - Eclipse Display View is throwing error - Stack Overflow



java - Eclipse Display View is throwing error - Stack Overflow

all. Amy requirement is checking one exception condition(whether the message is alright or not). For that, I have thrown exception keeping my code in debug mode.

I have written following expression, right click after selecting the expression, execute.

throw new NullPointerException();

Eclipse is showing

Evaluation failed. Reason(s):          Syntax error, insert ";" to complete BlockStatements

Read full article from java - Eclipse Display View is throwing error - Stack Overflow


Amazon Dynamo DB max client connections? - Stack Overflow



Amazon Dynamo DB max client connections? - Stack Overflow

Since the connections to Amazon DynamoDB is http(s) based, the concept of open connections is limited to your tcp max open connections at once. I highly doubt there's a limit on Amazons end at all as it is load balanced close to infinity.

Naturally, the exception is your read and write capacity limits. Note that they want you to contact them if you will exceed a certain amount of capacity units which depend on your region.

You've probably already read them, but the limitations of DynamoDB is found here:


Read full article from Amazon Dynamo DB max client connections? - Stack Overflow


Deserialization of untrusted data - OWASP



Deserialization of untrusted data - OWASP

Data which is untrusted cannot be trusted to be well formed. Malformed data or unexpected data could be used to abuse application logic, deny service, or execute arbitrary code, when deserialized.

Consequences

  • Availability: The logic of deserialization could be abused to create recursive object graphs or never provide data expected to terminate reading.
  • Authorization: Potentially code could make assumptions that information in the deserialized object about the data is valid. Functions which make this dangerous assumption could be exploited.
  • Access control (instruction processing): malicious objects can abuse the logic of custom deserializers in order to affect code execution.

Exposure period

  • Requirements specification: A deserialization library could be used which provides a cryptographic framework to seal serialized data.
  • Implementation: Not using the safe deserialization/serializing data features of a language can create data integrity problems.
  • Implementation: Not using the protection accessor functions of an object can cause data integrity problems
  • Implementation: Not protecting your objects from default overloaded functions - which may provide for raw output streams of objects - may cause data confidentiality problems.
  • Implementation: Not making fields transient can often cause data confidentiality problems.

Platform

  • Languages: C, C++, Java, Python, Ruby (and probably others)
  • Operating platforms: Any

Required resources

Any

Severity

High

Likelihood of exploit

Medium

It is often convenient to serialize objects for convenient communication or to save them for later use. However, deserialized data or code can often be modified without using the provided accessor functions if it does not use cryptography to protect itself. Furthermore, any cryptography would still be client-side security - which is of course a dangerous security assumption.

An attempt to serialize and then deserialize a class containing transient fields will result in NULLs where the non-transient data should be. This is an excellent way to prevent time, environment-based, or sensitive variables from being carried over and used improperly.


Read full article from Deserialization of untrusted data - OWASP


(10) What can TensorFlow do? - Quora



(10) What can TensorFlow do? - Quora

The short answer: it allows machine learning researcher to experiment with deep neural nets  more easily. Here, "more easily" means it takes less time to construct artificial neural networks, less time to train them (this is arguable, as is always the case when speed is concerned), and less time to deploy them.

Do not expect: do not expect magic things to come from TensorFlow. There is none. A wealth of deep learning frameworks already exist in the wild and TensorFlow is just one of them. It will not give you powerful AI overnight, nor will it help your smartphone to recognize cats. It is a tool for deep learning research that will hopefully make it a bit less cumbersome.

Who should be excited: deep learning researchers who construct and experiment with large number of networks, researchers who are too lazy to get their hands dirty on serious code, and companies that benefit from being able to quickly train and deploy their models. Basically if you consider yourself a member of the general public, it's got nothing to do with you.

Read full article from (10) What can TensorFlow do? - Quora


Google's New Messaging App Is So Useful I Don't Care That It's Creepy



Google's New Messaging App Is So Useful I Don't Care That It's Creepy

People use their phones for messaging more than almost anything else. That's why companies like Apple, Facebook, and Snapchat are dumping truckloads into making it easier and more fun to send messages. In May at I/O, Google announced Allo, its latest foray into the brave new world of messaging. Now, the app is finally available on iOS and Android.

Advertisement


Read full article from Google's New Messaging App Is So Useful I Don't Care That It's Creepy


这才是Angular2的灵魂!



这才是Angular2的灵魂!

谷歌开发者 微信号 Google_Developers 功能介绍 谷歌官方公众号,这里有 Android 等各种谷歌开发技术、Google Play 应用优化 和  AdMob 应用变现。 文|章小飞(Aaron Zhang)   谷歌 Angular 技术推广工程师 1. 背景介绍:Angular1.x与Angular2 近年来,Web 开发技术的发展日新月异,各种框架层出不穷。在这样的大背景之下,2010年10月,Google 首次发布了自己的 Web 开发框架,名为 AngularJS,也叫 Angular,或者简称为 ng。 Angular 刚一发布就引起了强烈的关注,它首次提出的"双向数据绑定"的概念受到了众多开发者的喜爱。当然,也有很多人对此持有保留意见。但是无论如何,Angular 所提出来的众多独创性的概念深深影响了 Web 技术的发展进程。例如,当前市面上相当多的 Web 框架都已经支持"数据绑定"的概念,有一些支持单向绑定,有一些支持双向绑定,Angular 的影响力之强大可见一斑。 在 Google 内部有非常多的产品都在使用 Angular,在国内,也有非常多的企业正在使用 Angular1.x 开发自己的应用,包括移动 APP,其中有很多行业巨头。 2014年9月,Angular 团队在 ng-europe 会议上公开宣布了第二个大版本的开发计划,也就是大家熟知的 Angular2,与此对应,之前的版本就称为 Angular 1.x了。 目前,Angular2 已经处于正式发布之前的最后准备阶段,按照既定的时间表,本月底(2016-09)Angular2 将会发布第一个正式版本。Angular2 依然保持了最初的核心设计理念,但是与 Angular 1.x 相比,在各种语法细节上发生了大幅度的修改。 详细的情况在后面的第三小节" Angular2 有哪些重要变化?"中解释。从整体上看,Angular2 变得更加简洁,因为它的核心概念只有一个,那就是追求彻底的"组件化(Component)"。 2.

Read full article from 这才是Angular2的灵魂!


44. Wildcard Matching - YRB - 博客园



44. Wildcard Matching - YRB - 博客园

Implement wildcard pattern matching with support for '?' and '*'.

'?' Matches any single character. '*' Matches any sequence of characters (including the empty sequence).  The matching should cover the entire input string (not partial).  The function prototype should be: bool isMatch(const char *s, const char *p)  Some examples: isMatch("aa","a") → false isMatch("aa","aa") → true isMatch("aaa","aa") → false isMatch("aa", "*") → true isMatch("aa", "a*") → true isMatch("ab", "?*") → true isMatch("aab", "c*a*b") → false

链接:  http://leetcode.com/problems/wildcard-matching/

题解:

这道题是一刷里放弃的6道题中第一道。看过<挑战程序设计>以后还是决定好好对待这道题目。 前些天专门学习了NFA,但对这道题目还是会time out。试过把*预处理为"?*"之后可以用regular expression的DP方法来过,但是速度比较慢。 这道题也是Two Sigma上午三轮技术面里必考的一道题。 以后再遇到这类题目,我要尽可能使用DP来做,好好练习DP。

又做到了这一题,下面用dp来解决。虽然AC但是速度很慢,有很多地方需要优化,比如更多的pruning,Space Complexity减少为O(n)等等。Reference里有三个解得就非常好。 留给三刷继续深入研究这道题目。

下面使用DP解决的思路。代码大部分和 10. Regular Expression Matching 一样。直接拷贝自己的解释。

使用DP的方法: 

  1. 在初始的判断之后,首先建立dp矩阵res[][] = new boolean[m + 1][n + 1]。其中res[i][j]是指s到字符i - 1,p到字符j - 1的match情况,true为match。
  2. res[0][0] = true表示s和p都为""的时候match成功
  3. 接下来对pattern p的首行'*'号的0 match情况进行初始化,res[0][j] = res[0][j - 1] && p.charAt(j - 1) == '*'。这里表示,假如res[0][j - 1],也就是""与p.charAt(j - 2)成功match,那么因为当前字符p.charAt(j - 1) = '*'可以代表空字符串,所以res[0][j]也肯定match成功。我们发现在10. Regular Expression Matching与这一题44. Wildcard Matching中, 合理得初始化都是都是必不可少的步骤。
  4. 之后我们就可以从从位置(1, 1)开始对res矩阵进行二维dp,主要分为两种情况
    1. p.charAt(i - 1)不等于'*': 这里表示matching transition,假如s和p的上一个字符match, 即res[i - 1][j - 1] == true,同时新的字符s.charAt(i - 1) == p.charAt(j - 1),或者p.charAt(j - 1) == '?', 那么我们可以确定res[i][j] = true,这表示到 s 和 p 到 i - 1和j - 1的位置是match的
    2. 假如p.charAt(i - 1) == '*': 这里表示epsilon transition,系统可能处于不同的状态,我们要分多种情况进行考虑,只要有一个状态为true,在这个位置的结果就为true,是一个"或"的关系:
      1. res[i][j - 1] == true,即s.charAt(i - 1) match p.charAt(j - 2),这里'*'号可以当作"",表示0 matching,这种情况下,我们可以认为状态合理,res[i][j] = true。 例 "C" match "C*", i = 2, j = 2,这里C match C,'*'作为空字符串"",所以我们match成功
      2. res[i - 1][j] == true,即s.charAt(i - 2) match p.charAt(j - 1),这里'*'号是被当做"s[j - 2]" + "s[j - 1]"这两个字符拼起来的字符串。因为'*'可以代表任意字符串,所以假如res[i - 1][j] == true,那么res[i][j]也一定是true,其实这样类推下去,res[i + 1][j]也是true,这一列都是true。 (根据这个特性其实我们可以巧妙地改写一下,提前把这一列剩下元素都设置为true,可以减少不少数组访问)。 例 "AC" match "*", i = 2, j = 1,这时候'*'可以作为'AC',所以也是match成功。
  5. 数组全部遍历完毕之后我们返回res[m][n] 


Read full article from 44. Wildcard Matching - YRB - 博客园


The way to Algorithm : Leetcode 44 Wildcard Matching



The way to Algorithm : Leetcode 44 Wildcard Matching

Leetcode 44 Wildcard Matching

Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.  '*' Matches any sequence of characters (including the empty sequence).    The matching should cover the entire input string (not partial).    The function prototype should be:  bool isMatch(const char *s, const char *p)    Some examples:  isMatch("aa","a") → false  isMatch("aa","aa") → true  isMatch("aaa","aa") → false  isMatch("aa", "*") → true  isMatch("aa", "a*") → true  isMatch("ab", "?*") → true  isMatch("aab", "c*a*b") → false

Read full article from The way to Algorithm : Leetcode 44 Wildcard Matching


getting initializationError0 while using @RunWith(SpringJUnit4ClassRunner.class) - Spring Forum



getting initializationError0 while using @RunWith(SpringJUnit4ClassRunner.class) - Spring Forum

Ok, Fixed the issue. Via transitive dependency, I was using the log4j-over-slf4j jar, we was using the 1.5.6 version, because slf4j's implementation does not contain all the log4j source code, there will always be NoClassDefFoundError when trying to invoke a log4J class that does not exist, and in my case, the source of the log4j-over-slf4j.jar we are using does not have the LogManager class in it.

I went down the route of getting the latest implementation (log4j-over-slf4j-1.6.1.jar) which although it has the LogManager class in it, you still run into further errors because supporting jars e.g. slf4j-api, slf4j-log4j12 are either not compatible or they do not have the required class.

Because log4j is already available, we did not really need the slf4j implementations in the current project, hence excluding log4j-over-slf4j in my immediate pom meant that this jar was not added to my classpath, and my test code just used the log4j implementation and it worked.

Sample exclusion code:
<exclusion>
<artifactId>log4j-over-slf4j</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>

If using eclipse and you have the m2eclipse plugin installed, using the dependency hierarchy tab, you can see the dependency using this artifact, just add the exclusion code to this dependency.

Read full article from getting initializationError0 while using @RunWith(SpringJUnit4ClassRunner.class) - Spring Forum


Evaluate Division | codesolutiony



Evaluate Division | codesolutiony

Evaluate Division Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If the answer does not exist, return -1.0. public class Solution { public double[] calcEquation(String[][] equations, double[] values, String[][] queries) { Map> map = new HashMap>(); for (int i = 0; i < equations.length; i++) { String[] equation = equations[i]; String a = equation[0]; String b = equation[1]; if (!map.containsKey(a)) { Map innerMap = new HashMap(); map.put(a, innerMap); } map.get(a).put(b, values[i]); if (!map.containsKey(b)) { Map innerMap = new HashMap(); map.put(b, innerMap); } map.get(b).put(a, 1/values[i]); } double[] results = new double[queries.length]; for (int i = 0; i < queries.length; i++) { String[] query = queries[i];

Read full article from Evaluate Division | codesolutiony


ntp - Wrong time on my Ubuntu Amazon EC2 instances - Server Fault



ntp - Wrong time on my Ubuntu Amazon EC2 instances - Server Fault

EC2 instances should take their time from the host but there are occasional problems with that. If you configure ntp correctly it should resolve this.


Read full article from ntp - Wrong time on my Ubuntu Amazon EC2 instances - Server Fault


AWS Developer Forums: Clock synchronization in EC2 ...



AWS Developer Forums: Clock synchronization in EC2 ...

The host machine should be syncronizing the clock. Virtual machines should then simply see a common clock shared by the machine. In Xen this would be under dom0 while instances run under domU(s) which do not have access to the hardware clock. I have heard of a patch that allows clock shifting where Xen maintains a differential between the hardware clock on your domU VM. But I would imagine that patch would slow down access to the clock by excluding it from the hardware VM assist features (which otherwise allow every VM to read the clock instantly w/o a hypervisor trap happening).

So the answer would be: just don't run NTP (except to provide time server feed to your own LAN). Hopefully each box at AWS has NTP running in their dom0.

Read full article from AWS Developer Forums: Clock synchronization in EC2 ...


NoSuchMethodError exception · Issue #297 · Netflix/curator · GitHub



NoSuchMethodError exception · Issue #297 · Netflix/curator · GitHub

Curator has moved to Apache. Please see: http://curator.apache.org - on that site you can email the Curator mailing lists, add issues to Curator's Jira, etc. For this particular issue, you're probably using Curator 3.0 which requires ZK 3.5.x. Use Curator 2.9.x instead.


Read full article from NoSuchMethodError exception · Issue #297 · Netflix/curator · GitHub


Google Expands Wi-Fi Assistant to All Nexus Users - Thurrott.com



Google Expands Wi-Fi Assistant to All Nexus Users - Thurrott.com

News, Reviews & Analysis Google this week began rolling out a feature called Wi-Fi Assistant—previously a Project Fi exclusive—to all users of Nexus handsets in the United States, Canada, and elsewhere. This feature works similarly to Wi-Fi Sense in Windows 10. Google announced this change was coming back in August, but according to recent reports, it's now rolling out. "Keep your connection speed high and your data bill low with Wi-Fi Assistant, a feature that allows you to automatically and securely connect to more than a million, free open Wi-Fi hotspots," a Google+ post explains. "Originally a Project Fi exclusive feature, we are now expanding Wi-Fi Assistant to all Nexus users in the United States, Canada, Mexico, UK and Nordic countries. This will roll out to users over the next few weeks." To be clear, Wi-Fi Assistant doesn't just connect your phone blindly to open networks:

Read full article from Google Expands Wi-Fi Assistant to All Nexus Users - Thurrott.com


I Hire Engineers At Google--Here's What I Look For (And Why) | Fast Company | Business + Innovation



I Hire Engineers At Google--Here's What I Look For (And Why) | Fast Company | Business + Innovation

3. Get Comfortable With Coding Exercises

Now for the obvious part: It goes without saying that engineers need to be able to code, so intensive preparation for the coding exercise—the centerpiece of every Google engineering interview—is a must. Candidates should be able to answer three coding questions from scratch (without the help of a library function) within 45 minutes.

I also suggest practicing with a live person, whether they're technical or not. And try going analog—use a whiteboard or a blank piece of paper. And focus in particular on algorithms and data structures. There are some great samples in Cracking the Coding Interview, Topcoder, and LeetCode.


Read full article from I Hire Engineers At Google--Here's What I Look For (And Why) | Fast Company | Business + Innovation


我做这个程序员还有意思吗? | 外刊IT评论



我做这个程序员还有意思吗? | 外刊IT评论

我有了这种感觉,并在认真考虑是否要辞职,不再做程序员,但其中的原因并不是你们想象的那样。

不,并不是因为编程很难;我喜欢解决难题,用创造性的方式解决。那会是一种让我极度兴奋的体验。

为什么?我想你会这样问。

原因是:我花了大量的时间和精力为老板将一个以前一直是手工处理的工作改进成了自动处理,而在之后的一次会议上却被质问,"你花了这么多时间究竟干了什么?"

我花了这么多时间究竟干了什么…开什么玩笑?

我并没期望拿今年的优秀员工奖、特殊待遇、赞誉或告诉我不用再做其它工作了。

然而,当你花了无数的时间去改进一项工作后,却被人问"你究竟干了些什么?",你会真的很想说去他妈的编程。问题是这并不是上级对你的工作感兴趣而做的真诚的询问。不是的,那是一种傲慢的,俯视的语气,暗示着你是在浪费大家所有人的时间。

当一个人身陷这样一个消极的环境中时,他的斗志会逐渐的消磨掉,腐化掉。我发现自己开始自问,"你干嘛不知好歹的去改进这些东西?很显然,他们对你所做的努力嗤之以鼻。"

那么,如果是你,你会怎么做?你热爱编程,但你面对的却是一帮没有脑子、不知道欣赏你花费大量努力完成的作品的人。这就像是西西弗斯的登山,注定是一个失败者。

我做这个程序员还有意思吗?如果你遇到这种情况你会怎么做?


Read full article from 我做这个程序员还有意思吗? | 外刊IT评论


Google为什么要从头开发一套新的操作系统Fuchsia?



Google为什么要从头开发一套新的操作系统Fuchsia?

Zach Supalla的公司Particle为物联网提供硬件工具包和开发者工具。他指出,对于这些小规模计算设备来说,Linux存在若干问题。

一是Linux对于这类应用来说太大了。即便Linux内核是模块化的,能够让开发者剔除不必要的部分,但最终仍会占据好几兆的空间。这意味着更难以把Linux内核塞进廉价的微控制器里面,从而让处理器成为必须,而后者往往大得多、贵得多且更耗能。

"全新的供应链这道鸿沟还没有跨越,这对制造提出了更高的品质要求,而且成本还得低很多," Supalla说。

另一个问题是Linux并不是"实时"的。跟ATM、医疗产品等单用途设备采用的嵌入式系统不同,Linux利用调度机制来处理大批任务。尽管这可以极大发挥通用计算机的性能,但也会导致需要精确定时的设备,比如说3D打印机或者汽车内部的许多电动控制系统出现问题。

"要想确保这玩意儿在确切的微秒时刻运行,你不会希望有个进程在那里决定什么时候跑什么东西," Supalla说。

Supalla说,对于物联网应用来说,像Linux这样的通用操作系统的安全性可能也会更低。其代码量更大,这意味着可能存在更多的安全漏洞需要处理或者通过防火墙或VPN锁定。

"运行实时操作系统或者嵌入式系统的价值之一在于,这些系统无需锁定任何东西," Supalla说:"它不需要运行一批你需要考虑的东西。除了你写的软件以外它不会运行任何东西。"

Supalla的推断是,Fuchsia是集两家之大成的一次尝试,在让应用和硬件通过操作系统进行通信方面Linux仍然处理得更好,而当今的一些嵌入式操作系统,比如FreeRTOS和ThreadX就没有前面提到的Linux的那些问题。

"他们可能既想要有Linux那种水平的抽象,又想获得RTOS的那种性能、小规模以及实时性," Supalla说:"这些都是非常有价值的东西,而且我认为从理论上来说是可以实现的。只是之前没做过而已。"

纵向扩展

如果Fuschia的目标只是小规模设备的话,可能就没那么值得关注了。但是Fuschia的开发者野心要比这大,他们宣称该操作系统可扩展到智能手机和桌面计算机上。理论上,这会使得Fuschia成为Google的Android和Chrome OS的直接替代方案。

为什么要这么做呢?据Supalla说,可能从头开始能够做出一个更高效的操作系统,这反过来又能支持更高效的服务器——对此Google一直都很感兴趣。他还指出桌面兼容性还可以模拟一次运行大量更小的设备,从而确保规模化运行。

"让一千台服务器每次都同时跑同样的软件应用,要比折腾一百万芯片跑起来更容易,所以这对测试更好。" Supalla说。

Dediu的理论不一样:一套新的操作系统可以让Google远离Android遭遇的知识产权授权问题。"因为这是一张白纸式的设计,不会碰到有人去找IP(知识产权)方面的麻烦,"他说:"这也许是一个合理的假设,因为Linux的确有一些棘手的IP问题。"

要记住的是,这也可能就是学术性的。Fuchsia的开发者说他们会完整记录并最终发布这套操作系统,但要走的路还很长,而且还不清楚Google会不会给予其充分的支持。Android生态体系已经很庞大(并且正在跟Chromebooks进行合并)。与此同时,Google还在扩展Android的某个版本到物联网设备,这个带嵌入式特性的版本叫做Brillo——Linux的缺点见鬼去吧,它正在成为一个成熟的平台,而不仅仅是一个简单的操作系统。

还有,Unix开始只是一个志愿者项目,并未得到贝尔实验室的承认;Linux Torvalds做Linux也只是自己的爱好。也许几十年后,我们会讨论起 Fuchsia 当初在 Google 内部不太被重视的事情。


Read full article from Google为什么要从头开发一套新的操作系统Fuchsia?


Snippet: Creating Amazon DynamoDB Tables - AWS Developer Blog - Java



Snippet: Creating Amazon DynamoDB Tables - AWS Developer Blog - Java

In many applications, it's important to make sure your code handles creating any resources that it needs in order to run. Otherwise, you'll have to manually create those resources whenever you want to run your application with a new AWS account.

For example, if you have an application that needs to store data in an Amazon DynamoDB table, then you'll probably want your application to check if that table exists at startup, create it if necessary, and only let your application logic start running once that table is ready to use.

The following code demonstrates how to create a simple Amazon DynamoDB table using the SDK:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
AmazonDynamoDB dynamo = new AmazonDynamoDBClient(myCredentials);
 
CreateTableRequest request = new CreateTableRequest().withTableName("customers");
 
request.withKeySchema(new KeySchemaElement()
        .withAttributeName("customerId")
        .withKeyType(KeyType.HASH));
 
request.withAttributeDefinitions(new AttributeDefinition()
        .withAttributeName("customerId")
        .withAttributeType(ScalarAttributeType.S));
 
request.setProvisionedThroughput(new ProvisionedThroughput()
        .withReadCapacityUnits(5)
        .withWriteCapacityUnits(2));
 
dynamo.createTable(request);

This code creates a simple table called customers, specifies low values for provisioned throughput, and declares the hash key (think: primary key) to be an attribute named id with type String.

Once you've created your table, you'll want to make sure it's ready for use before you let your application logic start executing; otherwise, you'll get errors from Amazon DynamoDB when you try to use it.

The following function, taken from some of our SDK test code for DynamoDB, demonstrates how to poll the status of a table and detect when the table is ready for use.


Read full article from Snippet: Creating Amazon DynamoDB Tables - AWS Developer Blog - Java


(10) Why is LinkedIn getting rid of Scala? - Quora



(10) Why is LinkedIn getting rid of Scala? - Quora

Fundamentally, LinkedIn wants to streamline their tooling and deployment. Despite Scala's solid presence, Java is still the bedrock language of the LinkedIn tech stack, and will continue to be. By focusing their technical efforts to one language, they are able to slim down the amount of required tooling while simultaneously focusing on building on more robust developer tools.

Despite some developers' love of Scala (my own included), it simply makes sense to simplify. The Play framework works with Java, so needs not be replaced but migrated. The upcoming features in Java 8 (lambdas, parallelization, etc.) are more incentives to streamline. It's (fairly) low investment with (fairly) high returns: LinkedIn is able to solve some daunting infrastructural issues and loses little in the long run.

Read full article from (10) Why is LinkedIn getting rid of Scala? - Quora


程序员面前的十座大山 - NetSmell



程序员面前的十座大山 - NetSmell

如果是老程序员,那么,他一定会知道,其实软件开发中任务重大的不是代码,而是工作中其他的任务执行。如果你是刚刚进入软件这个行业,想要在这个行业有所发展,那么下面的这些困难你是一定要翻越的十座大山。

1.让别人了解你做的什么

总是有人会问你,软件开发是什么?每次和别人解释这个过程真的很让人头痛。也许在外行人的眼里,我们就是一群傻呆子,只会每天坐在电脑前不停的敲键盘的程序员。

2.可视化解决方案

如果给你一组简单但是考虑不周的一个需求方案,而你所做的就是代码结构、数据储库、算法以及一些解决业务问题就得去完成的各项技术内容。还要你用通俗易懂,让外行人都看明白的方式解释出来,并在客户的要求时间内完成,这些真得很少有人做好。

3.交付时间过于紧迫

这种事情是每个开发人员遇到都会头痛的事情,想一下,如果给你一个以前都没有接触过的任务,还要你马上答复他们用多长时间可以做出来,这是不是难倒你了。

所以这个时候你真的只能靠经验来估时间了,但大多程序员都会把时间少估了,其原因主要是他们没把所以的可能时间都加上。

4.参考别人写的程序

三人行必有我师,写程序也是一样。但是,研究别人的程序,意味着你要完整的了解对方的思路,架构设计。并且,如果当初写程序的人并没有留下清晰详细的注释,或者,只是一个完工的项目,那我们就更困难了。

5.需求不可控

软件开发时,需求不是一成不变的,偶尔客户会心血来潮加一点什么奇葩的功能,你明知这样的结果是错误的,但你没法拒绝客户。当最终失败的结果出现时,客户会责怪你,而不是他自己。

6.不优化和过度优化

追求完美是我们的目标,但事情就远不可能做的完美。我们不可能无限止的改善,这样软件永远没有发布之日,

很多人都有将就能用的心态,只要现在能用就行,以后的事情以后说,这样倒霉的就是那些接手维护这些老代码的人。

7.测试

要想达到百分之百的测试是不可能的,软件的复杂性远远超出你的想像。

软件的输出会因为事到环境的不同而篇千变万化,无法完全掌握。

编写测试代码是一件费力不讨好的事。

团队集体写测试程序时,沟通会成会大问题。

有时用户的想法会让我们莫名其妙,这是用户和软件开发人员之间的差异。

8.写文档

没有程序员愿意做这种事情,费时费力又不讨好。

9.电脑的问题

开发过程中意外出现的死机、蓝屏、数据丢失,这些虽然不是程序员的责任,但也必须我们自己去解决,否则无法工继续工作。

10.不懂装懂的人

我们会发现有很多人不懂装懂,他们从来不会对着飞行员说应该如何驾驶飞机,但会对着电脑屏幕告诉程序员该如何开发软件,想出很多无语的点子。


Read full article from 程序员面前的十座大山 - NetSmell


Inspired by Actual Events: JDK 9 @Deprecated Annotation Enhancements



Inspired by Actual Events: JDK 9 @Deprecated Annotation Enhancements

In the post What Might a New @Deprecated Look Like?, I used the description of JEP 277 ("Enhanced Deprecation") at that time to guide the creation of an enhanced customized @Deprecated annotation. Since that post, however, there have been significant changes made in JEP 277. This post summarizes the changes and the currently planned enhancements to @Deprecated that are slated for JDK 9.

The changes made to JDK-8065614 ("JEP 277: Enhanced Deprecation") on 2016-03-03 18:04 remove the portion of the JEP description that described the proposed @Deprecated enum. The "Alternatives" section of the main JEP 277 page documents why the enum was removed:

Previous versions of this proposal included a variety of "reason" codes including UNSPECIFIED, DANGEROUS, OBSOLETE, SUPERSEDED, UNIMPLEMENTED, and EXPERIMENTAL. These attempted to encode the reason for which an API was deprecated, the risks of using it, and also whether a replacement API is available. In practice, all of this information is too subjective be encoded as values in an annotation. Instead, this information should be described in the Javadoc documentation comment.

The revised @Deprecated annotation now supports two methods as shown in the API documentation. The documentation explains that the forRemoval() method "indicates whether the annvaluable otated element is subject to removal in a future version" and returns false by default. The since() method documentation states that this second method "returns the version in which the annotated element became deprecated" and returns empty string by default.


Read full article from Inspired by Actual Events: JDK 9 @Deprecated Annotation Enhancements


SiftingAppender: logging different threads to different log files | NoBlogDefFound



SiftingAppender: logging different threads to different log files | NoBlogDefFound

One novel feature of Logback is SiftingAppender (JavaDoc). In short it's a proxy appender that creates one child appender per each unique value of a given runtime property. Typically this property is taken from MDC. Here is an example based on the official documentation linked above:

Read full article from SiftingAppender: logging different threads to different log files | NoBlogDefFound


LeetCode赛题395----Longest Substring with At Least K Repeating Characters - HorseShoe2016 - 博客园



LeetCode赛题395----Longest Substring with At Least K Repeating Characters - HorseShoe2016 - 博客园

Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than k times.

Example 1:

Input:  s = "aaabb", k = 3    Output:  3    The longest substring is "aaa", as 'a' is repeated 3 times.

Read full article from LeetCode赛题395----Longest Substring with At Least K Repeating Characters - HorseShoe2016 - 博客园


好好写代码 - Python之美 - 知乎专栏



好好写代码 - Python之美 - 知乎专栏

之前有同学想了解豆瓣的工程管理、CodeReview,代码规范。我先铺垫一下 @段念@清风 2位老师的分享:

1. 前豆瓣工程副总裁段念谈豆瓣的研发管理

2. 文化建设是个"系统工程"

3. 工程师文化中的工具"情结"

4. 豆瓣 CODE 两年历程回顾:git 不是万能的,没有 review 是万万不能的

5. 清风在 C2D2 的分享Slide

说句场外话,就是因为看了清风老师在C2D2的分享,我才决定来豆瓣的。

在这里聊一些我在豆瓣的一些实践和个人理解。

团队要有自己的规范

开发者提交了PR其实就是潜意识的已经认为自己的代码写的还不错,完成了工作。评审者提意见的表达方式就很重要,弄不好就是矛盾。这可以让很多人本身并不喜欢或者被动的做评审和被评审。

实现同一功能,开发者可以选择多种方式,这就是编程的乐趣。但是问题是没有那么多事情是如「太阳东升西落」这样的客观事实,大部分是很主观的,我说这样实现没有问题,你觉得那样可能会更好,谁也说服不了谁。


Read full article from 好好写代码 - Python之美 - 知乎专栏


How to Enable Android Nougat’s Direct Boot for Less Annoying Encryption



How to Enable Android Nougat's Direct Boot for Less Annoying Encryption

Articles l l GET UPDATES BY EMAIL Enter your email below to get exclusive access to our best articles and tips before everybody else. RSS How-To Geek Nougat's Direct Boot and File Encryption, Explained RELATED ARTICLE In previous versions of Android, Google used full-disk encryption to secure your device. That meant you had to enter the PIN or password every time your phone booted–or it wouldn't boot at all. So, if the phone reboots in the middle of the night, while in your bag, or some other scenario where you won't see it for a while, you basically miss out on everything that happens—since the operating system isn't technically loaded, it has no way to generate notifications. Instead, it just sits at full brightness (with no timeout!) waiting for your input…or to die. Whichever comes first. Man, that sounds grim. It sounds great in theory, security-wise, but in practice, the above-mentioned scenario makes this method incredibly inconvenient. So, in Android Nougat,

Read full article from How to Enable Android Nougat's Direct Boot for Less Annoying Encryption


由“徐玉玉”事件引发的数据治理体系化思考 - 其他 - DBAplus社群——围绕数据库、大数据、PaaS云,运维圈最专注围绕“数据”的学习交流和专业社群



由"徐玉玉"事件引发的数据治理体系化思考 - 其他 - DBAplus社群——围绕数据库、大数据、PaaS云,运维圈最专注围绕"数据"的学习交流和专业社群

类似的笔者去过的一个智能制卡机构,看到各地社保局委托制作个人社保卡,在数据的传送、实体卡的运输、装箱单的要求方面,居然嫌麻烦,要求制卡商明文打印姓名、身份证号、社保卡号、电话等信息作为装箱单,这些拥有大量个人敏感信息的国家机关因为没有商业公司供应链的强制要求,反而是信息安全管理的短板。


Read full article from 由"徐玉玉"事件引发的数据治理体系化思考 - 其他 - DBAplus社群——围绕数据库、大数据、PaaS云,运维圈最专注围绕"数据"的学习交流和专业社群


原来你是这样的NullPointerException - Zero - 博客频道 - CSDN.NET



原来你是这样的NullPointerException - Zero - 博客频道 - CSDN.NET

在C语言里,你可以读取NULL本身的值(void *)0,即0,但是读取它指向的值,那是非法的,会引发段错误。而Java里面的NULL就是直接指向了0,上述也说了,指向地址为0的单元,一般是不能使用的。

一句话总结:因为指向了不可使用的内存单元,虚拟机无法读取它的值,最终导致NullPointerException。


Read full article from 原来你是这样的NullPointerException - Zero - 博客频道 - CSDN.NET


请修改这段程序,立刻! | 外刊IT评论



请修改这段程序,立刻! | 外刊IT评论

  你们正在开发一个新项目,你在一个地方看到一段有问题的代码。错误的处理方式是,"啊,别人写的,我最好别碰它","我没有时间去改它——我有自己的事要做","如果我修改它,肯定会改出问题"。

  问题是——有问题的代码会越积越多。即使是很小的一段程序,经过一段时间的累计,你很快就能看到它成为一个"由一些菜鸟写的、没人愿意去维护的巨大的历史遗留项目"。有人曾说,超过6个月的项目全是"历史遗留"项目,因为里面都会积累大量的有问题的代码,或用另外一个词——技术债务。

  这就是为什么你要马上修改它们的原因。当你看到一些有问题的代码,或一些不是好的写法的东西——改掉它。立即。否则,当你再次注意到它时就已经太晚了,因为其它的代码就开始依赖它,新的代码会模仿这种编写风格(也许是拷贝/粘贴而来),修改这些东西将会变成你的噩梦。让我们把上面错误的做法纠正:

  • "啊,别人写的代码,我最好别动它"——什么?你的项目团队的一员,你有"权力"去修改它。如果有人把代码写的很糟糕,他可能并没有意识到自己的代码很烂——所以,他们不会改正它。不要认为改正这些代码会冒犯他们。他们也许会没面子,但不是因为你。
  • "我没有时间去修改它——我有自己的事要做"——这就是你的事。你可以在你的缺陷跟踪里添加上一条任务,写上"重构X",写上花费的时间。你也可以把它推迟到下一个sprint(如果是敏捷开发)。管理层坚持认为开发新东西比修改旧程序重要吗?告诉他们去读读《重构》这本书或Spolsky的文章..或本文。(也许不管用,但不妨试一试)
  • "如果我修改它,肯定会改出问题"——也许。但是,等一下,你们有单元测试用例,不是吗?还有集成测试,确认测试。如果没有——先把这些补齐了。这样你就不用担心把程序改坏了。

  代码审查是避免这样的代码很重要的方法。如果提交的代码都经过了代码审查,未被察觉的有问题的代码会大幅度的减少。仍然会有,但会少的多。

  对于这样的做法唯一的问题是——如何确定一段代码是有问题、需要改进的?这就需要经验了,需要你熟悉好的开发方法和模式。对这个问题我不能给出一个秘诀。但你需要在团队里有一群能明辨是非的程序员。如果没有——读一读《代码大全(Code Complete)》(以及《Effective Java》,如果你们使用的语言是Java。)

  所以——请马上修改。这会省下你的时间,免去你的头疼,让你对这个项目更有自豪感,而不是"这烂项目是一些菜鸟写的,我只是做了一些辅助的工作。"你不能这样说——如果项目很烂,你难辞其咎。


Read full article from 请修改这段程序,立刻! | 外刊IT评论


Labels

Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

Popular Posts