Jackson - Unmarshall to Collection/Array | Baeldung



Jackson - Unmarshall to Collection/Array | Baeldung

Reading the same JSON Array into a Java Collection is a bit more difficult – by default, Jackson will not be able to get the full generic type information and will instead create a collection of LinkedHashMap instances:


Read full article from Jackson - Unmarshall to Collection/Array | Baeldung


java - Should I make Jackson's ObjectMapper as static final - Stack Overflow



java - Should I make Jackson's ObjectMapper as static final - Stack Overflow

Yes, that is safe and recommended.

The only caveat from the page you referred is that you can't be modifying configuration of the mapper once it is shared; but you are not changing configuration so that is fine. If you did need to change configuration, you would do that from the static block and it would be fine as well.

EDIT: (2013/10)

With 2.0 and above, above can be augmented by noting that there is an even better way: use ObjectWriter and ObjectReader objects, which can be constructed by ObjectMapper. They are fully immutable, thread-safe, meaning that it is not even theoretically possible to cause thread-safety issues (which can occur with ObjectMapper iff code tries to re-configure instance).


Read full article from java - Should I make Jackson's ObjectMapper as static final - Stack Overflow


巩朋:我的算法学习之路 - 博客 - 伯乐在线



巩朋:我的算法学习之路 - 博客 - 伯乐在线

第一次接触数据结构是在大二下学期的数据结构课程。然而这门课程并没有让我入门――当时自己正忙于倒卖各种MP3和耳机,对于这些课程根本就不屑一顾――反正最后考试划个重点也能过,于是这门整个计算机专业本科最重要的课程就被傻逼的我直接忽略过去了。


Read full article from 巩朋:我的算法学习之路 - 博客 - 伯乐在线


java - Boost one value of several on field with Spring Data Solr - Stack Overflow



java - Boost one value of several on field with Spring Data Solr - Stack Overflow

By doing as shown below you will give far higher boost to the docs that has the category as 'webpage'. Then add 'combined' criteria to your existing other criteria


Read full article from java - Boost one value of several on field with Spring Data Solr - Stack Overflow


java - How to rounds down date filter query using spring data solr? - Stack Overflow



java - How to rounds down date filter query using spring data solr? - Stack Overflow

How can I rounds down date filter query using spring data solr?

I want to write query fq=startDate:[2013-06-14T23:59:59.999Z/DAY TO 2013-06-14T23:59:59.999Z/DAY] using FilterQuery.

How can I rounds down following query using FilterQuery ?


Read full article from java - How to rounds down date filter query using spring data solr? - Stack Overflow


[九度][何海涛] 矩形覆盖 - chkkch - 博客园



[九度][何海涛] 矩形覆盖 - chkkch - 博客园

我们可以用2*1的小矩形横着或者竖着去覆盖更大的矩形。请问用n个2*1的小矩形无重叠地覆盖一个2*n的大矩形,总共有多少种方法?


Read full article from [九度][何海涛] 矩形覆盖 - chkkch - 博客园


[九度][何海涛] 重建二叉树 - chkkch - 博客园



[九度][何海涛] 重建二叉树 - chkkch - 博客园

输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并输出它的后序遍历序列。


Read full article from [九度][何海涛] 重建二叉树 - chkkch - 博客园


[九度][何海涛] 二维数组中的查找 - chkkch - 博客园



[九度][何海涛] 二维数组中的查找 - chkkch - 博客园

在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。


Read full article from [九度][何海涛] 二维数组中的查找 - chkkch - 博客园


[九度][何海涛] 顺时针打印矩阵 - chkkch - 博客园



[九度][何海涛] 顺时针打印矩阵 - chkkch - 博客园

输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字,例如,如果输入如下矩阵:


Read full article from [九度][何海涛] 顺时针打印矩阵 - chkkch - 博客园


[九度][何海涛] 字符串的排序 - chkkch - 博客园



[九度][何海涛] 字符串的排序 - chkkch - 博客园

输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba。


Read full article from [九度][何海涛] 字符串的排序 - chkkch - 博客园


[九度][何海涛] 跳台阶 - chkkch - 博客园



[九度][何海涛] 跳台阶 - chkkch - 博客园

一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法。


Read full article from [九度][何海涛] 跳台阶 - chkkch - 博客园


[九度][何海涛] Move!Move!!Move!!! - chkkch - 博客园



[九度][何海涛] Move!Move!!Move!!! - chkkch - 博客园

汇编语言中有一种移位指令叫做循环左移(ROL),现在有个简单的任务,就是用字符串模拟这个指令的运算结果。对于一个给定的字符序列S,请你把其循环左移K位后的序列输出。例如,字符序列S="abcXYZdef",要求输出循环左移3位后的结果,即"XYZdefabc"。是不是很简单?OK,搞定它!

Read full article from [九度][何海涛] Move!Move!!Move!!! - chkkch - 博客园


[九度][何海涛] 最大子向量和 - chkkch - 博客园



[九度][何海涛] 最大子向量和 - chkkch - 博客园

HZ偶尔会拿些专业问题来忽悠那些非计算机专业的同学。今天JOBDU测试组开完会后,他又发话了:在古老的一维模式识别中,常常需要计算连续子向量的最大和,当向量全为正数的时候,问题很好解决。但是,如果向量中包含负数,是否应该包含某个负数,并期望旁边的正数会弥补它呢?例如:{6,-3,-2,7,-15,1,2,2},连续子向量的最大和为8(从第0个开始,到第3个为止)。你会不会被他忽悠住?


Read full article from [九度][何海涛] 最大子向量和 - chkkch - 博客园


[九度][何海涛] 最小的K个数 - chkkch - 博客园



[九度][何海涛] 最小的K个数 - chkkch - 博客园

输入n个整数,找出其中最小的K个数。例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4,。


Read full article from [九度][何海涛] 最小的K个数 - chkkch - 博客园


Garajeando: Kata: "Counting Code Lines"



Garajeando: Kata: "Counting Code Lines"

Kata: "Counting Code Lines"

I just did the Counting Code Lines kata in Java to practice TDD.

Read full article from Garajeando: Kata: "Counting Code Lines"


[CareerCup][Google Interview] 寻找动态的中位数 - chkkch - 博客园



[CareerCup][Google Interview] 寻找动态的中位数 - chkkch - 博客园

1. There is a stream of numbers, design an effective datastructre to store the numbers and to return the median at any point of time.

 

我们可以考虑维护一个max heap和一个min heap,max heap用来记录数组的前半部分, min heap用来记录数组的后半部分,返回数组的中位数时只要返回大堆的root。

当有一个新的数字进来时,可虑是否大于min heap的root,大于的话就放到min heap,它属于数组的后半部分,如果这时min heap的大小大于max heap了,则弹出root放到max heap里。

同时,如果新来的key小于max heap的root则放入大堆,并作相应调整。

整个算法的复杂度,插入O(logn),提取O(1)


Read full article from [CareerCup][Google Interview] 寻找动态的中位数 - chkkch - 博客园


[CareerCup][Google Interview] Find kth number in a BST - chkkch - 博客园



[CareerCup][Google Interview] Find kth number in a BST - chkkch - 博客园

Given n elements, sort the elements. Here, only one operation is permitted decreaseValue..
Note that you cannot swap the values.. output should be a sorted list..
if input is 4 5 2 1 3
output is 3 3 3.. There can be many answers.. Give the optimum solution with minimum cost. where as cost is the sum of decreased amounts..
for this example, 4,5 are decreased by 1.. 2 is decreased by 2.. 1 is decreased by 1..

Read full article from [CareerCup][Google Interview] Find kth number in a BST - chkkch - 博客园


[CareerCup][Google Interview] 找出最小排序次数 - chkkch - 博客园



[CareerCup][Google Interview] 找出最小排序次数 - chkkch - 博客园

Given an unsorted array provide two indices n1 and n2 such that if we only sort the elements between n1 and n2,then the whole array will become sorted.
n1-n2 should be as minimum as possible.

http://www.careercup.com/question?id=4345015


Read full article from [CareerCup][Google Interview] 找出最小排序次数 - chkkch - 博客园


[CareerCup][Google Interview] Find kth number in a BST - chkkch - 博客园



[CareerCup][Google Interview] Find kth number in a BST - chkkch - 博客园

ind kth number in a BST

递归实现,按照左根右的顺序来实现


Read full article from [CareerCup][Google Interview] Find kth number in a BST - chkkch - 博客园


传世经典书丛



传世经典书丛

中国电力出版社 中国电力 电子工业出版社 人民邮电出版社 清华大学出版社

Read full article from 传世经典书丛


深入理解计算机系统 (豆瓣)



深入理解计算机系统 (豆瓣)

本书适用于那些想要写出更快、更可靠程序的程序员。通过掌握程序是如何映射到系统上,以及程序是如何执行的,读者能够更好的理解程序的行为为什么是这样的,以及效率低下是如何造成的。粗略来看,计算机系统包括处理器和存储器硬件、编译器、操作系统和网络互连环境。而通过程序员的视角,读者可以清晰地明白学习计算机系统的内部工作原理会对他们今后作为计算机科学研究者和工程师的工作有进一步的帮助。它还有助于为进一步学习计算机体系结构、操作系统、编译器和网络互连做好准备。


Read full article from 深入理解计算机系统 (豆瓣)


[CareerCup][Google Interview] Merge Two BST - chkkch - 博客园



[CareerCup][Google Interview] Merge Two BST - chkkch - 博客园

You have two BST, you have to merge them into a single BST, inplace and linear time.

http://www.careercup.com/question?id=8255895

 

 

其中,一位仁兄给出了一个非常漂亮的解答:

we could do it in O(m+n) (m, n sizes of both bsts)
1) Covert Tree1 in to circular doubly linked list. O(m)
Search for "tree list recursion problem" for more details.
2) Convert Tree2 in to circular doubly linked list O(n).
3) Merge Tree1, Tree2 O(m+n)
4) Convert the merged circular doubly linked list to Tree. O(m+n) (Middle node can be chosen as root to make tree balanced).

其中doubly link list,tree node的left和right正好作为链表的前后链接。

当然,要写好每一步其实也不容易的。

1)如何把tree转换为doubly link list

2) 如何merge两个list

3) 如何把doubly link list转换为tree


Read full article from [CareerCup][Google Interview] Merge Two BST - chkkch - 博客园


[CareerCup][Google Interview] 找出现次数 - chkkch - 博客园



[CareerCup][Google Interview] 找出现次数 - chkkch - 博客园

Given a sorted array and a number n.How can u find the number of occurance of n in the array . should be o(logn)

http://www.careercup.com/question?id=8877058


Read full article from [CareerCup][Google Interview] 找出现次数 - chkkch - 博客园


Complexity of a function: i | CareerCup



Complexity of a function: i | CareerCup

-1     Team: Autopilot     Comment hidden because of low score. Click to expand. 5 Time complexity of Fibonacci function evaluation is Fibonacci function itself. - Flux November 05, 2013 0 of 0 votes Programming functions growth is the mathematical functions? Can u prove it? - urik on bb November 06, 2013 0 of 0 votes As ghost89413 noticed above below, there is recurrent formula for running time T(n) = T(n-1) + T(n-2) For n < 2, T(n) = 1 Which is Fib(n). Another intuitive approach is to notice that we haven't any type of memoisation or result caching for functions call, so final result is sum of 1-s (if "flatten" recursion tree). Fib(n) consists of Fib(n) ones, so complexity is Fib(n). - Flux November 06, 2013 2 of 6 votes the complexity of a naive recursive fibonacci is indeed 2^n. T(n<=1) = O(1) // Understood T(n) = T(n-1) + T(n-2) + O(1) Assume T(n-1) = O(2n-1),

Read full article from Complexity of a function: i | CareerCup


Careercup - Microsoft面试题 - 5175246478901248 - zhuli19901106 - 博客园



Careercup - Microsoft面试题 - 5175246478901248 - zhuli19901106 - 博客园

design an alarm clock for a deaf person.


Read full article from Careercup - Microsoft面试题 - 5175246478901248 - zhuli19901106 - 博客园


Careercup - Microsoft面试题 - 5718181884723200 - zhuli19901106 - 博客园



Careercup - Microsoft面试题 - 5718181884723200 - zhuli19901106 - 博客园

3 Process: 4 1. Basic element of resource allocation in the operating system. 5 2. Possesses independent resources: 6 a. code segment 7 b. data segment 8 i. constant data 9 ii. global variable 10 iii. stack 11 iv. heap 12 c. register 13 d. program counter 14 3. Have independent virtual address mapping. 15 4. It has life cycle, it is running, in contrast to a program. 16 Thread: 17 1. Basic element of CPU scheduling. 18 2. Possesses part of independent resources: 19 a. register 20 b. stack 21 c. program counter 22 3. Multiple threads share part of resources in same process: 23 a. code segment 24 b. data segment 25 i. constant data 26 ii. global variable 27 iii. heap 28 4. All threads in a process share the same address space. 29 5. It has life cycle

Read full article from Careercup - Microsoft面试题 - 5718181884723200 - zhuli19901106 - 博客园


Inside Google's Secret War Against Ad Fraud | Digital - Advertising Age



Inside Google's Secret War Against Ad Fraud | Digital - Advertising Age

"First step, let's go to some website," he commanded. "AdAge.com, how about that one?" As the page loaded on my browser, a stream of code ran down the screen in a separate window to the left. After a few seconds, Sasha explained what was happening. "I'm afraid that when you're dealing with our team, you shouldn't just go to a website when we tell you," he said. The computer, brand new, was already infected. "You are participating in a botnet."


Read full article from Inside Google's Secret War Against Ad Fraud | Digital - Advertising Age


Code Cop: How to divide learning time



Code Cop: How to divide learning time

  • (a) studying, e.g. reading technical books or blog posts, watching (recorded) presentations as well as any form of consuming knowledge.
  • (b) practising, e.g. doing code katas, attending Coding Dojos or working on fun (but otherwise useless) projects.
  • (c) experimenting, which includes creating prototypes or trying out new frameworks or ideas.
  • (d) creating something real, e.g. hobby projects or maybe contributing to Open Source.
  • (e) documenting and sharing, e.g. creating how-to documents or writing blog posts.
  • (f) teaching, e.g. preparing presentations and talking at user group meetings.

  • Read full article from Code Cop: How to divide learning time


    Kata07: How'd I Do? - CodeKata



    Kata07: How'd I Do? - CodeKata

    However, doing this six months after you write code is not the best way of developing good software today. So the underlying challenge of this kata is this: how can we get into the habit of critically reviewing the code that we write, as we write it? And can we use the techniques of reading code with different expectations (good coder, bad coder, and bug hunt) when we're reviewing our colleagues code?


    Read full article from Kata07: How'd I Do? - CodeKata


    Why We Hate Ruby



    Why We Hate Ruby

  • Semi-significant whitespace
    • Actually, this doesn't bother me, but I'm including it on the assumption that it bothers someone. (^_^)
    • While not whitespace, the case-significant variables are annoying.

  • It's not SmalltalkLanguage, though it tries really hard to be.
    • Control constructs that aren't implemented with blocks
    • Verbose syntax for blocks that aren't the last parameter to a function
      • A brief block syntax is good. If you have one, you should use it for all blocks.
    • See also RubyIsSmalltalkMinusMinus.

  • Read full article from Why We Hate Ruby


    [Agile]Coding Dojo, Kata, Wasa, and Randori - Blackie的失敗筆記- 點部落



    [Agile]Coding Dojo, Kata, Wasa, and Randori - Blackie的失敗筆記- 點部落

    這是指一個學習的過程或方法,招集一群人有目地的在安全的環境一起學習技術或探索問題,而這過程著重在如何一起學習與解決問題,也會從中加入一些其他的開發方式,例如Pair coding、TDD、Design pattern等來當作主軸,讓大家在過程中都有個主題的方向去學習,既使犯錯了也是很好的教材。


    Read full article from [Agile]Coding Dojo, Kata, Wasa, and Randori - Blackie的失敗筆記- 點部落


    Careercup面试题 - 加州掘金客 - 51CTO技术博客



    Careercup面试题 - 加州掘金客 - 51CTO技术博客

    http://www.careercup.com/question?id=2777, aligned malloc详细解析,或者简单使用memalign


    Read full article from Careercup面试题 - 加州掘金客 - 51CTO技术博客


    Find number of friday 13th's f | CareerCup



    Find number of friday 13th's f | CareerCup

    Find number of friday 13th's from today to the end of 2012.

    Read full article from Find number of friday 13th's f | CareerCup


    Google面试官Gayle McDowell:找一家能让你开心的公司 - SegmentFault



    Google面试官Gayle McDowell:找一家能让你开心的公司 - SegmentFault

    Gayle: 这其实是很多公司共有的问题。因为急迫地需要用人,他们雇佣了平庸的人,最终他们要和不优秀的人为伍。从长远来讲,这对于公司是个很大的代价。

    有三个解决这个问题的办法:

    • 第一,公司可以仅提供短期职位,对于优秀的员工可以提供转为长期职位的可能性。这其实就是实习可以为一家公司做的。不幸的是,如果人们还得在几个月后另谋他就的话,很多人就不会加入这个公司。

    • 第二,一家公司可以在最开始就建立连贯、清晰的标准。设计一套资格和预期,并和面试官们进行沟通。当发生用人压力时,这些标准会让面试官们无法进行妥协和折中。

    • 第三,可以在面试过程中加入"决策者",这个人需要没有雇佣的动机。比如,有些公司会要求至少一位面试官来自另一个团队。这样就保证了即便这个团队因为急于用人而降低了标准,外部面试官仍然会保持一贯的高标准。


    Read full article from Google面试官Gayle McDowell:找一家能让你开心的公司 - SegmentFault


    经典算法题一览 - 小唯THU - 博客园



    经典算法题一览 - 小唯THU - 博客园

    oding interview exposed (3ed) 这个最简单了,基础比较挫的可以从这里开始

    "这本书籍不是"课本",不是"课程",而是教你做各种常见面试题目的。熟练掌握这本书籍的内容,是你找到工作的基础。"

    Programming Interviews Exposed 8.0/60 | 程序员面试攻略 7.7/86


    Read full article from 经典算法题一览 - 小唯THU - 博客园


    面试经验:Facebook面试问题总结_互联网的一些事



    面试经验:Facebook面试问题总结_互联网的一些事

    网站资源的话,上面提到的interviewstreet.com, glassdoor.com都不错,另外careercup.com,leetcode.com都是听别人提起比较多的,上面有各种各样的算法题目(我自己都没怎么上过,不知道哪个更好些)。当然对于ACMer来说,各个OJ都是很好的资源,对于非ACMer来说,如果想接触一下竞赛题的话,我推荐topcoder.com里面的Algorithm竞赛里Div2难度的题目。Topcoder的题目代码量通常不会太大,更接近面试时的情况,而且多数题目都会在赛后有解答,而且可以看到别人的提交,所以也是学习的好机会。

      论坛的话,我上的最多的是水木社区的算法版(newsmth.net),另外mitbbs.com上关于在美国签证、找工作、移民等等的讨论都很多。前不久发现一个叫"一亩三分地(www.1point3acres.com/bbs)的论坛看上去也很赞。


    Read full article from 面试经验:Facebook面试问题总结_互联网的一些事


    Report: NSA paid RSA to make flawed crypto algorithm the default | Ars Technica



    Report: NSA paid RSA to make flawed crypto algorithm the default | Ars Technica

    Security company RSA was paid $10 million to use the flawed Dual_EC_DRBG pseudorandom number generating algorithm as the default algorithm in its BSafe crypto library, according to sources speaking to Reuters.


    Read full article from Report: NSA paid RSA to make flawed crypto algorithm the default | Ars Technica


    [LeetCode]Duplicate Emails | 书影博客



    [LeetCode]Duplicate Emails | 书影博客


    Read full article from [LeetCode]Duplicate Emails | 书影博客


    Run solr in schemaless mode - Stack Overflow



    Run solr in schemaless mode - Stack Overflow

    I try to run solr in schemaless mode on a windows machine, like it is described here. But if I run the command

    java -Dsolr.solr.home=example-schemaless\solr -jar start.jar

    Read full article from Run solr in schemaless mode - Stack Overflow


    Find the largest pair sum in an unsorted array - GeeksforGeeks



    Find the largest pair sum in an unsorted array - GeeksforGeeks

    Given an unsorted array, find the largest pair sum in it. For example, the largest pair sum in {12, 34, 10, 6, 40} is 74.


    Read full article from Find the largest pair sum in an unsorted array - GeeksforGeeks


    程序员必看的书(十三)�程序员 | IT江湖



    程序员必看的书(十三)�程序员 | IT江湖

    《程序员的呐喊》涉及编程语言文化、代码方法学、google公司文化等热点话题。

    对工厂业界的各种现象、技术、趋势等,作者都在本书中表达了自己独特犀利的观点。比如java真的是一门优秀的面向对象语言吗?重构真的那么美好吗?强弱类型语言到底哪个更好?敏捷真的靠谱吗?程序员要不要懂数学等。另外,他还谈到了很多大公司的理念,比如亚马逊做平台为什么那么成功等。最后,本书还收录了他写的google面试攻略,这篇文章可以说为无数应试者点亮了明灯


    Read full article from 程序员必看的书(十三)�程序员 | IT江湖


    通过JVM日志来进行安全点分析 - Java译站



    通过JVM日志来进行安全点分析 - Java译站

    许多事件都可能会导致JVM暂停所有的应用线程。这类暂停又被称为"stop-the-world"(STW)暂停。触发STW暂停最常见的原因就是垃圾回收了(github中的一个例子),但不同的JIT活动(例子),偏向锁擦除(例子),特定的JVMTI操作,以及许多场景也可能会导致应用程序暂停。


    Read full article from 通过JVM日志来进行安全点分析 - Java译站


    Integrating Lucene with Android ~ Technical Essentials



    Integrating Lucene with Android ~ Technical Essentials

    If you want to integrate Lucene with your android application, this post will get you started.  Lucene provides you with a wide range of searching options  like  Fuzzy Search, wildcard search, etc.  So, you can use this in your android application, if you want to provide search option over your custom data model.


    Read full article from Integrating Lucene with Android ~ Technical Essentials


    Gentle Introduction to HBase Part I - Data Structure | Suman Srinivasan's Code Blog



    Gentle Introduction to HBase Part I – Data Structure | Suman Srinivasan's Code Blog

    In this post (hopefully the first of more), I hope to provide a gentle introduction to HBase (since I never had one myself!) This specific post is more about the specifics of HBase’s data structure, but I hope to do more posts introducing HBase programming using a combination of HBase on Amazon’s Elastic Map Reduce (I like to call it Amazon’s HAAS or HBase-as-a-Service) and Python using the HappyBase library (this offers a really easy interface to the HBase Thrift interface.)


    Read full article from Gentle Introduction to HBase Part I – Data Structure | Suman Srinivasan's Code Blog


    Who's next on Wall Street: Tech IPOs to look for in 2014 | VentureBeat | Business | by Jordan Novet



    Who's next on Wall Street: Tech IPOs to look for in 2014 | VentureBeat | Business | by Jordan Novet

    Here we are in 2014, and a whole bunch of hot tech companies are considering initial public offerings (IPOs) this year. We've given you our best guesses below on the likelihood each of these players will actually pull the trigger. Feel free to share your views and predictions in the comments section.


    Read full article from Who's next on Wall Street: Tech IPOs to look for in 2014 | VentureBeat | Business | by Jordan Novet


    Accumulo: Why The World Needs Another NoSQL Database « Wikibon Blog



    Accumulo: Why The World Needs Another NoSQL Database « Wikibon Blog

    To that list you can add Accumulo, an open source database originally developed at the National Security Agency. You may be wondering why the world needs yet another database to handle large volumes of multi-structured data. The answer is, of course, that no one of these NoSQL databases has yet checked all the feature/functionality boxes that most enterprises require before deploying a new technology.


    Read full article from Accumulo: Why The World Needs Another NoSQL Database « Wikibon Blog


    Tales from Programmatic Oceans: Ten Things Every Computer Science Major Should Learn



    Tales from Programmatic Oceans: Ten Things Every Computer Science Major Should Learn

    Meeting the graduation requirements is not necessarily sufficient for being the best computer scientist you can be. For a typical college curriculum, here are the top ten things you should be sure to learn:

    Read full article from Tales from Programmatic Oceans: Ten Things Every Computer Science Major Should Learn


    How Facebook Transformed Its Networking Team



    How Facebook Transformed Its Networking Team

    For years, Facebook has had a career development program called "hack-a-month," which allows engineers to switch to a different team for a month — and if they like it better than their original job, they can make the switch permanent.


    Read full article from How Facebook Transformed Its Networking Team


    A Relevant Tale: How Google Killed Inktomi | Diego Basch's Blog



    A Relevant Tale: How Google Killed Inktomi | Diego Basch's Blog

    On March 20th, 2000 Inktomi had a market capitalization of 25 billion dollars. As a relatively early employee, I was a multimillionaire on paper. Life was good. In the next year and a half the stock went down by 99.9%. In the end, Inktomi was acquired by Yahoo for 250M. What happened? Among other things, Google. Grab some popcorn and enjoy this story.


    Read full article from A Relevant Tale: How Google Killed Inktomi | Diego Basch's Blog


    图论算法 有图有代码 万字总结 向前辈致敬 - NoMasp柯于旺――脚踏实地,全力以赴! - 博客频道 - CSDN.NET



    图论算法 有图有代码 万字总结 向前辈致敬 - NoMasp柯于旺――脚踏实地,全力以赴! - 博客频道 - CSDN.NET

    看到这篇博客相信一开始映入读者眼帘的就是下面这幅图了,这就是传说中的七桥问题(哥尼斯堡桥问题)。在哥尼斯堡,普雷格尔河环绕着奈佛夫岛(图中的A岛)。这条河将陆地分成了下面4个区域,该处还有着7座连接这些陆地的桥梁。


    Read full article from 图论算法 有图有代码 万字总结 向前辈致敬 - NoMasp柯于旺――脚踏实地,全力以赴! - 博客频道 - CSDN.NET


    java - JAX-RS jersey ExceptionMappers User-Defined Exception - Stack Overflow



    java - JAX-RS jersey ExceptionMappers User-Defined Exception - Stack Overflow

    You need to annotate your exception mapper with @Provider, otherwise it will never get registered with the JAX-RS runtime.


    Read full article from java - JAX-RS jersey ExceptionMappers User-Defined Exception - Stack Overflow


    java - How to scan multiple paths using the @ComponentScan annotation? - Stack Overflow



    java - How to scan multiple paths using the @ComponentScan annotation? - Stack Overflow

    @ComponentScan uses string array, like this:

    @ComponentScan({"com.my.package.first","com.my.package.second"})

    When you provide multiple package names in only one string, Spring interprets this as one package name, and thus can't find it.


    Read full article from java - How to scan multiple paths using the @ComponentScan annotation? - Stack Overflow


    java - How to load multiple configuration file from classpath using @ImportResource annotation in Spring - Stack Overflow



    java - How to load multiple configuration file from classpath using @ImportResource annotation in Spring - Stack Overflow

    I don't know,how to load multiple configuration files from classpath in spring using @ImportResource.I have already gone through the link Spring 3 @ImportResource with multiple files but no luck so far. My code is below.


    Read full article from java - How to load multiple configuration file from classpath using @ImportResource annotation in Spring - Stack Overflow


    (9) Which are the companies where the culture is driven by product managers? - Quora



    (9) Which are the companies where the culture is driven by product managers? - Quora

    Based on my research for Cracking the PM Interview, here's who drives the direction & decisions:

    Apple: Executives & Designers
    Amazon: PMs
    Facebook: Engineers
    Google: Engineers
    Microsoft: PMs
    Yahoo: PMs

    Read full article from (9) Which are the companies where the culture is driven by product managers? - Quora


    Using set cover algorithm to optimize query latency for a large scale distributed graph | LinkedIn Engineering



    Using set cover algorithm to optimize query latency for a large scale distributed graph | LinkedIn Engineering

    Social networks often require the ability to perform low latency graph computations in the user request path. For example, at LinkedIn, we show the graph distance and common connections whenever we show a profile on the site. To do this, we have developed a distributed and partitioned graph system that scales to hundreds of millions of members and their connections and handles hundreds of thousands of queries per second. We published a paper in the HotCloud'13 Conference, June 2013 that describes one of the techniques we use to keep latencies low:


    Read full article from Using set cover algorithm to optimize query latency for a large scale distributed graph | LinkedIn Engineering


    Spring Boot, java.lang.IllegalStateException when calling ControllerLinkBuilder.linkTo from a websocket - Stack Overflow



    Spring Boot, java.lang.IllegalStateException when calling ControllerLinkBuilder.linkTo from a websocket - Stack Overflow

    linkTo depends on the current HTTP request but the HTTP current request does not exist because the call was originated by a WebSocket event. Therefore you need a different approach.


    Read full article from Spring Boot, java.lang.IllegalStateException when calling ControllerLinkBuilder.linkTo from a websocket - Stack Overflow


    How HashSet Internally Works in Java | Java67



    How HashSet Internally Works in Java | Java67

    Not many programmer know that HashSet is internally implemented using HashMap in Java, so if you know How HashMap works internally in Java, more likely you can figure out how HashSet works in Java. But, now a curious Java developer can question that, how come HashSet uses HashMap, because you need a key value pair to use with Map, while in HashSet we only store one object. Good question, isn't it? If you remember some functionality of earlier class, then you know that HashMap allows duplicate values and this property is exploited while implementing HashSet in Java. Since HashSet implements Set interface it needs to guarantee uniqueness and this is achieved by storing elements as keys with same value always. Things gets clear by checking HashSet.java from JDK source code. All you need to look at is, how elements are stored in HashSet and how they are retrieved from HashSet. Since HashSet doesn't provide any direct method for retrieving object e.g. get(Key key) from HashMap or get(int index) from List, only way to get object from HashSet is via Iterator. See here for code example of iterating over HashSet in Java. When you create an object of HashSet in Java, it internally create instance of backup Map with default initial capacity 16 and default load factor 0.75 as shown below :

    Read full article from How HashSet Internally Works in Java | Java67


    spring cloud - Does Feign retry require some sort of configuration? - Stack Overflow



    spring cloud - Does Feign retry require some sort of configuration? - Stack Overflow

    If you are using ribbon you can set properties similar to the following (substituting "localapp" for your serviceid):

    localapp.ribbon.MaxAutoRetries=5  localapp.ribbon.MaxAutoRetriesNextServer=5  localapp.ribbon.OkToRetryOnAllOperations=true

    Read full article from spring cloud - Does Feign retry require some sort of configuration? - Stack Overflow


    Demystifying Conway's Law | ThoughtWorks



    Demystifying Conway's Law | ThoughtWorks

    "Any organization that designs a system (defined more broadly here than just information systems) will inevitably produce a design whose structure is a copy of the organization's communication structure."


    Read full article from Demystifying Conway's Law | ThoughtWorks


    lucene - Is there a way to remove the calculation of length norms for fields in elastic search? - Stack Overflow



    lucene - Is there a way to remove the calculation of length norms for fields in elastic search? - Stack Overflow

    The lengthNorm and field level boosting, as you said, are both stored in the norm. So no, you can't have one without the other.

    But you don't actually need field boosting at index time. You can apply it at search time instead, and that way you have more flexibility when you want to tweak the boost level later on.

    Not only that, by setting omit_norms you reduce the amount of data you have to store at index time by quite a lot, so it is to be recommended where appropriate (such as in your case).


    Read full article from lucene - Is there a way to remove the calculation of length norms for fields in elastic search? - Stack Overflow


    fluent/fluentd



    fluent/fluentd

    Fluentd collects events from various data sources and writes them to files, RDBMS, NoSQL, IaaS, SaaS, Hadoop and so on. Fluentd helps you unify your logging infrastructure (Learn more about the Unified Logging Layer).


    Read full article from fluent/fluentd


    The Top 20 Platform as a Service (PaaS) Vendors



    The Top 20 Platform as a Service (PaaS) Vendors

    If not for the platform, there would be no apps, and no need for cloud infrastructure. There are many cloud platforms to choose from, all of which in one way or another help developers build and deploy their applications to the cloud. The cloud platform is the "shake" to the cloud infrastructure's "bake." The goal is to be able to quickly and efficiently design and deploy applications, and have them function reliably. Think of the platform as the enabler of cloud applications. Each of these 20 cloud platform vendors does that in one way, shape or form. And each has carved its own niche to be among the coolest players in the cloud computing platform game.


    Read full article from The Top 20 Platform as a Service (PaaS) Vendors


    Vertx 3, Java Reactive Microservice Framework - Mammatus



    Vertx 3, Java Reactive Microservice Framework - Mammatus

    It looks like Vertx 3 is a very significant release. Vertx3 is a Java Reactive Microservice Framework. It fills many gaps and fixes direction with Vertx 2 (which was already very compelling). Vertx 3 seems even more targeted at the reactive microservices space. It adds support for pluggable messaging, it has more than one cluster manager, it has async MySQL support, as well as async support for Redis, and PostgreSQL support, and MongoDB. It adds support for microservices monitoring, stats and metrics. It is a lighter weight, non-container focus (no more classloader focus). It is much more like a lib and a lot less like a traditional Java EE container. It is a new direction for Vertx, and quite an improvement from Vertx 2.

    Read full article from Vertx 3, Java Reactive Microservice Framework - Mammatus


    Introducing Spring XD, a Runtime Environment for Big Data Applications



    Introducing Spring XD, a Runtime Environment for Big Data Applications

    Spring XD (eXtreme Data) is Pivotal's Big Data play. It joins Spring Boot and Grails as part of the execution portion of the Spring IO platform. Whilst Spring XD makes use of a number of existing Spring projects it is a runtime environment rather than a library or framework, comprising a bin directory with servers that you start up and interact with via a shell. The runtime can run on a developer machine, on a client's own servers, on AWS EC2, and on Cloud Foundry.


    Read full article from Introducing Spring XD, a Runtime Environment for Big Data Applications


    Scala on Google App Engine | The Scala Programming Language



    Scala on Google App Engine | The Scala Programming Language

    Scala works on Google App Engine. You may have seen some early reports already here and here.

    In their article, the three Google engineers, Toby Reyelts, Alex Rudnick and Lex Spoon show you how to implement Scala projects on the App Engine by taking you through two sample applications. They say "Overall, it looks like the scalac compiler produces jars that are so close to Java's that App Engine just doesn't notice or care. We can second that: it works for us too!"


    Read full article from Scala on Google App Engine | The Scala Programming Language


    Top 7 programmers bad habits | Making Good Software



    Top 7 programmers bad habits | Making Good Software

    I have bad news for you buddy, all code is crap. No matter how much effort you put on it, there is always a majority of programmers who are going to think that your code sucks and that they could have done it 10 times better. I have already covered this topic in previous posts, you can find more information of what exactly I mean when I say that all the code is crap here and here.


    Read full article from Top 7 programmers bad habits | Making Good Software


    (9) Which is a good online course for studying distributed systems? Video lectures, preferred. - Quora



    (9) Which is a good online course for studying distributed systems? Video lectures, preferred. - Quora

    I recently found the lectures by Prof. Seif Haridi on Distributed Algorithms. He has explained the basic concepts quite well but has taken a theoretical approach to the subject. Nevertheless, it's a good introductory course (available online for free) on Distributed Algorithms

    Read full article from (9) Which is a good online course for studying distributed systems? Video lectures, preferred. - Quora


    Tokutek Announces New Consensus Algorithm for MongoDB



    Tokutek Announces New Consensus Algorithm for MongoDB

    The design is heavily influenced by the Raft and Paxos algorithms and aims to provide the same provably strong consistency guarantees. It differs from Raft to enable it to support the MongoDB architecture and programming model, implementing an asynchronous, pull-based replication model. This, the developers claim,


    Read full article from Tokutek Announces New Consensus Algorithm for MongoDB


    HydraBase coming to Open Source HBase... - HBase at Facebook



    HydraBase coming to Open Source HBase... - HBase at Facebook

    HydraBase coming to Open Source HBase

    At Facebook, we have decided to merge our internal HBase branch with the current HBase Open Source branch. With this merge, we are also planning to integrate HydraBase into Open Source HBase. To start with


    Read full article from HydraBase coming to Open Source HBase... - HBase at Facebook


    (9) What are some good alternatives to Paxos for consensus management? - Quora



    (9) What are some good alternatives to Paxos for consensus management? - Quora

    Zookeeper (http://zookeeper.apache.org/)  is successfully used in many companies to solve problems that require consensus. These include but are not limited to the following problems:
    -- sequence generation
    -- lock management
    -- leader election
    -- group membership management

    ZK is distributed and fault-tolerant.

    ZK is used with HBase, so any company using HBase is also using ZK. This includes companies like Facebook and StumbleUpon. It is used in Apache Kafka, a product created by and used at LinkedIn. It is also used in LinkedIn for internal service discovery.

    Read full article from (9) What are some good alternatives to Paxos for consensus management? - Quora


    Where do Apache Samza and Apache Storm differ in their use cases? - Stack Overflow



    Where do Apache Samza and Apache Storm differ in their use cases? - Stack Overflow

    Apache Samza streams by processing messages as they come in one at a time. The streams get divided into partitions that are an ordered sequence where each has a unique ID. It supports batching and is typically used with Hadoop's YARN and Apache Kafka.


    Read full article from Where do Apache Samza and Apache Storm differ in their use cases? - Stack Overflow


    Streaming Big Data: Storm, Spark and Samza | Blog T



    Streaming Big Data: Storm, Spark and Samza | Blog T

    In Storm, you design a graph of real-time computation called a topology, and feed it to the cluster where the master node will distribute the code among worker nodes to execute it. In a topology, data is passed around between spouts that emit data streams as immutable sets of key-value pairs called tuples, and bolts that transform those streams (count, filter etc.). Bolts themselves can optionally emit data to other bolts down the processing pipeline.


    Read full article from Streaming Big Data: Storm, Spark and Samza | Blog T


    java - why storm backtype.storm.utils.TimeCacheMap deprecated - Stack Overflow



    java - why storm backtype.storm.utils.TimeCacheMap deprecated - Stack Overflow

    Not sure what was the real reason. Seems like it exposes a generic set of capabilities, not really essential to Storm. I've implemented simple join bolts using Guava Cache and was very satisfied.


    Read full article from java - why storm backtype.storm.utils.TimeCacheMap deprecated - Stack Overflow


    Out in the Open: Ex-Googlers Building Cloud Software That's Almost Impossible to Take Down | WIRED



    Out in the Open: Ex-Googlers Building Cloud Software That's Almost Impossible to Take Down | WIRED

    Cockroaches are some of the most resilient creatures on earth. They can live for 45 minutes without air and over a month without food. Cutting their heads off won't even kill them—at least not immediately. Their bodies can live on for several days without their heads.


    Read full article from Out in the Open: Ex-Googlers Building Cloud Software That's Almost Impossible to Take Down | WIRED


    C3.js: D3-based reusable chart library | Hacker News



    C3.js: D3-based reusable chart library | Hacker News

    Out of raw d3.js, nvd3.js, cubism, and rickshaw.js, I've by far had the best experience with nvd3.

    I was particularly pleased with the way nvd3 supports sliding data off line charts without any extra work.

    D3.js is an excellent, low level visualization library. But you will find yourself spending days to a couple weeks with custom styling, tooltips, legends, etc. Many high level charting libraries are nice because they have this out of the box.

    However, I want a library that lets me make visualizations that I can run on my monitor for 10 days straight without running into obscure bugs. Rickshaw failed me in this regard. I have a caching scheme in my client-side application. Rickshaw has its own local copy of data which requires the developer to write custom, messy javascript to evict. I found that rickshaw actually has some custom 'sliding window' logic. I was unhappy because I had to go to stackoverflow to discover that feature rather than using the documentation.


    Read full article from C3.js: D3-based reusable chart library | Hacker News


    (9) Why is D3.js so complex compared to ggplot? - Quora



    (9) Why is D3.js so complex compared to ggplot? - Quora

    D3 seems more complex, because it leverages Web technologies like HTML, CSS and SVG. The steep learning curve of D3 stems from the fact that in order to understand "D3 Code", you need to first understand HTML, SVG, JavaScript, and CSS.

    Read full article from (9) Why is D3.js so complex compared to ggplot? - Quora


    (9) Which one would you prefer to use D3.js or Highchart.js? - Quora



    (9) Which one would you prefer to use D3.js or Highchart.js? - Quora

    Totally different use cases, really. D3 is best for more complicated non-standard data visualization. It also doesn't support IE8 and the shims to do so require a lot of finger crossing and cursing. Highcharts is great for implementations of more standard charts and graphs in a cross browser way. It is themeable and customizable, although you sometimes have to use Stackoverflow instead of the docs to do what you want.

    Read full article from (9) Which one would you prefer to use D3.js or Highchart.js? - Quora


    My 2013 PyCon talk: Awesome Big Data Algorithms



    My 2013 PyCon talk: Awesome Big Data Algorithms

    Random algorithms and probabilistic data structures are algorithmically efficient and can provide shockingly good practical results. I will give a practical introduction, with live demos and bad jokes, to this fascinating algorithmic niche. I will conclude with some discussions of how our group has applied this to large sequencing data sets (although this will not be the focus of the talk).


    Read full article from My 2013 PyCon talk: Awesome Big Data Algorithms


    BlinkDB: Queries with Bounded Errors and Bounded Response Times on Very Large Data



    BlinkDB: Queries with Bounded Errors and Bounded Response Times on Very Large Data

    BlinkDB is a massively parallel, approximate query engine for running interactive SQL queries on large volumes of data. It allows users to trade-off query accuracy for response time, enabling interactive queries over massive data by running queries on data samples and presenting results annotated with meaningful error bars. To achieve this, BlinkDB uses two key ideas: (1) An adaptive optimization framework that builds and maintains a set of multi-dimensional samples from original data over time, and (2) A dynamic sample selection strategy that selects an appropriately sized sample based on a query's accuracy and/or response time requirements. We have evaluated BlinkDB on the well-known TPC-H benchmarks, a real-world analytic workload derived from Conviva Inc. and are in the process of deploying it at Facebook Inc.

    Read full article from BlinkDB: Queries with Bounded Errors and Bounded Response Times on Very Large Data


    Apache Spark User List - when to use broadcast variables



    Apache Spark User List - when to use broadcast variables

    Broadcast variables need to fit entirely in memory - so that's a
    pretty good litmus test for whether or not to broadcast a smaller
    dataset or turn it into an RDD.

    Read full article from Apache Spark User List - when to use broadcast variables


    I Will Get That Job At Google. | Java Integer equality



    I Will Get That Job At Google. | Java Integer equality

    To understand why it occurs you need to know how Java compares such values. In this case the method Integer.valueOf(i) is being called. This method caches values from -128 to 127 (as you may see in sources), so all Integer instances with value from this diapason will be equal in case of using == operation.


    Read full article from I Will Get That Job At Google. | Java Integer equality


    I Will Get That Job At Google. | Java limit for recursion



    I Will Get That Job At Google. | Java limit for recursion

    Result for the example (for the current JVM) is about 10 000. It's the max depth for the current JVM with default settings.

    Default stack size for the machine is 320 kb, so it means that for this case each recursive call uses 32 extra bytes (for a program counter, method variables etc).


    Read full article from I Will Get That Job At Google. | Java limit for recursion


    I Will Get That Job At Google. | Java hashCode() implementation



    I Will Get That Job At Google. | Java hashCode() implementation

    "Many people will claim that Object.hashCode will return the address of the object representation in memory. In modern implementations objects actually move within memory. Instead an area of the object header is used to store the value, which may be lazily derived from the memory address at the time that the value is first requested."


    Read full article from I Will Get That Job At Google. | Java hashCode() implementation


    String Memory Internals | Javalobby



    String Memory Internals | Javalobby

  • String object itself is rather cheap. It's the text it points to that consumes most of the memory
  • String is just a thin wrapper around char[] to preserve immutability
  • new String("abc") isn't really that expensive as the internal text representation is reused. But still avoid such construct.
  • When String is concatenated from constant values known at compile time, concatenation is done by the compiler, not by the JVM
  • substring() is tricky, but most importantly, it is very cheap, both in terms of used memory and run time (constant in both cases)

  • Read full article from String Memory Internals | Javalobby


    I Will Get That Job At Google. | Using 'return' in finally blocks



    I Will Get That Job At Google. | Using 'return' in finally blocks

    Another interesting fact is that 'finally return' construction below will be processed (code below returns "false"):

    try { return true; } finally { return false; }

    Note that using return in finally blocks is really bad practice: you lose all the exceptons and leave them unhandled. Avoid such situations!


    Read full article from I Will Get That Job At Google. | Using 'return' in finally blocks


    Use Google Drive to convert Image to Text (OCR)



    Use Google Drive to convert Image to Text (OCR)

    We may come across the need to convert images to text which should be editable, or we may need to convert some scanned copy into text, so that it can be edited in our regular editors. Actually, converting the scanned copy to text is done using Optical Character Recognition (OCR) Software which may not come free. You need to spend some good amount of money to get them and convert images to text. Spending money to buy those OCR software only for single usage is not a good idea. You can convert images to text for free if you are a Google Drive user. Google Drive provides you the OCR technology and we make use of it to convert images to text.

    Read full article from Use Google Drive to convert Image to Text (OCR)


    JSON, Avro, Trevni, and Parquet: how they are related | capnjosh



    JSON, Avro, Trevni, and Parquet: how they are related | capnjosh

    vro – a data storage system that stores JSON along with the schema for the JSON. Think of it as a file that contains loads of objects stored in JSON, and then the schema is stored along with it. In addition,
    "When Avro is used in RPC, the client and server exchange schemas in the connection handshake".

    Read full article from JSON, Avro, Trevni, and Parquet: how they are related | capnjosh


    (10) Redis vs Memcached: which one should I use for a web-based application? - Quora



    (10) Redis vs Memcached: which one should I use for a web-based application? - Quora

  • If you want a highly scalable data store which could be shared by mutiple applications (or even servers), redis is what you should use.
  • If you aren't ok with your cache warming up with every restart, redis is what you should use.
  • If you want to delete or expire items of your choice from your cache, redis is what you should use.
  • If you want to query for a particular type of an object, redis is what you should use.

  • Read full article from (10) Redis vs Memcached: which one should I use for a web-based application? - Quora


    Colossus: Successor to the Google File System (GFS) - Highly Scalable Systems



    Colossus: Successor to the Google File System (GFS) - Highly Scalable Systems

    Colossus is the successor to the Google File System (GFS) as mentioned in the recent paper on Spanner on OSDI 2012. Colossus is also used by spanner to store its tablets. The information about Colossus is slim compared with GFS which is published in the paper on SOSP 2003. There is still some information about Colossus on the Web. Here, I list some of them.


    Read full article from Colossus: Successor to the Google File System (GFS) - Highly Scalable Systems


    Best Online College Resources on Open Courseware & MOOCs | Top5OnlineColleges.org



    Best Online College Resources on Open Courseware & MOOCs | Top5OnlineColleges.org

    Many companies have set up platforms that anyone can use to create and promote MOOCs, and as the MOOC format gets more popular, there will doubtlessly be heavy competition to create the best course creation and hosting service. This competition will lead to an increase in quality of some MOOCs, but it will be more difficult to sort out which courses offer the best and most relevant content.


    Read full article from Best Online College Resources on Open Courseware & MOOCs | Top5OnlineColleges.org


    Where to Get the Best Free Education Online



    Where to Get the Best Free Education Online

    You won't really notice much of a difference between sitting in front of a screen watching a lecture and sitting in on a lecture in person—apart from the fact that if you do have a burning question, you can't raise your hand to get it answered. These video sites host lectures and full courses from some of the best schools on the planet.


    Read full article from Where to Get the Best Free Education Online


    I Will Get That Job At Google. | Facebook release process



    I Will Get That Job At Google. | Facebook release process

  • Weekly release branches
  • Sunday 6 PM - checkout trunk, test till Tuesday 4 PM.
  • Release process https://www.facebook.com/note.php?note_id=10150660826788920

  • Read full article from I Will Get That Job At Google. | Facebook release process


    I Will Get That Job At Google. | Finding a collision probability of a HashMap



    I Will Get That Job At Google. | Finding a collision probability of a HashMap

    Let's assume that we have a HashMap with initial size = 65536. How many random elements should we put into a HashMap to get the first collision?


    Read full article from I Will Get That Job At Google. | Finding a collision probability of a HashMap


    I Will Get That Job At Google. | Instanceof vs class name check. Performance test



    I Will Get That Job At Google. | Instanceof vs class name check. Performance test

    Let's also assume that collection classes are final and don't need to be extended. This sutuation is almost always true for collection items. How can we improve such equals method? Instanceof is quite a slow operation. Let's write a synthetic test. At first we will calculate total time needed to call instanceof method:


    Read full article from I Will Get That Job At Google. | Instanceof vs class name check. Performance test


    I Will Get That Job At Google. | Repaint and reflow events on web pages



    I Will Get That Job At Google. | Repaint and reflow events on web pages

    A repaint occurs when changes are made to an elements skin that changes visibility, but do not affect its layout. Examples of this include outline, visibility, or background color. According to Opera, repaint is expensive because the browser must verify the visibility of all other nodes in the DOM tree. 

    A reflow is even more critical to performance because it involves changes that affect the layout of a portion of the page (or the whole page). Reflow of an element causes the subsequent reflow of all child and ancestor elements as well as any elements following it in the DOM.


    Read full article from I Will Get That Job At Google. | Repaint and reflow events on web pages


    I Will Get That Job At Google. | Effective string inversion. Naive approach vs...



    I Will Get That Job At Google. | Effective string inversion. Naive approach vs...

    Let's try to invert string using a char array and a StringBuilder. This will need O(N) memory, where N is the length of a given string. It's fact that O(N) is the minimal amount of memory which we need for this task because initial char array is being stored in memory during the whole process flow. It will also need O(N) time, so it's also minimal amount of time needed for the algorithm.


    Read full article from I Will Get That Job At Google. | Effective string inversion. Naive approach vs...


    Finger Trees - Andrew Gibiansky



    Finger Trees - Andrew Gibiansky

    In this notebook, we'll look at finger trees, a general purpose functional data structure developed in the paper by Hinze and Patterson. Finger trees provide a functional sequence data structure, which provides amortized constant-time access and appending to the front and end of the sequence, as well as logarithmic time concatenation and random access. In addition to good asymptotic runtime bounds, the data structure turns out to be incredibly flexible: when combined with monoidal tags on the elements, finger trees may be used to implement efficient random-access sequences, ordered sequences, interval trees, and priority queues.


    Read full article from Finger Trees - Andrew Gibiansky


    unicode - Why does the Java ecosystem use different character encodings throughout their software stack? - Stack Overflow



    unicode - Why does the Java ecosystem use different character encodings throughout their software stack? - Stack Overflow

    At the time Java was created, the class file format used UTF-8 and the runtime used UCS-2. Unicode had less than 64k codepoints, so 16 bits was enough. Later, when additional "planes" were added to Unicode, UCS-2 was replaced with the (pretty much) compatible UTF-16, and UTF-8 was replaced with CESU-8 (hence "Compatibility Encoding Scheme...").

    In the class file format they wanted to use UTF-8 to save space. The design of the class file format (including the JVM instruction set) was heavily geared towards compactness.

    In the runtime they wanted to use UCS-2 because it was felt that saving space was less important than being able to avoid the need to deal with variable-width characters. Unfortunately, this kind of backfired now that it's UTF-16, because a codepoint can now take multiple "chars", and worse, the "char" datatype is now sort of misnamed (it no longer corresponds to a character, in general, but instead corresponds to a UTF-16 code-unit).

    share|edit|flag

    Read full article from unicode - Why does the Java ecosystem use different character encodings throughout their software stack? - Stack Overflow


    Why does Java use UTF-16 for internal string representation? - Programmers Stack Exchange



    Why does Java use UTF-16 for internal string representation? - Programmers Stack Exchange

    For the main part, for the sake of plain and simple future-proofing. Whether it was a misguided reason and the wrong way to go about it is a different question.

    You can see some reasons behind some of their design decisions in this document about the 2004 switch to Java 5 and UTF-16, which explains some of the shortcomings as well: Supplementary Characters in the Java Platform, and see Why does the Java ecosystem use different encodings throughout their stack?.

    For more details on the pitfalls of using UTF-16, and why UTF-8 is likely to be a better option in general, see Should UTF-16 be considered harmful? and the UTF-8 Everywhere manifesto.


    Read full article from Why does Java use UTF-16 for internal string representation? - Programmers Stack Exchange


    What is the Java's internal represention for String? Modified UTF-8? UTF-16? - Stack Overflow



    What is the Java's internal represention for String? Modified UTF-8? UTF-16? - Stack Overflow

    The Java programming language is based on the Unicode character set, and several libraries implement the Unicode standard. The primitive data type char in the Java programming language is an unsigned 16-bit integer that can represent a Unicode code point in the range U+0000 to U+FFFF, or the code units of UTF-16. The various types and classes in the Java platform that represent character sequences - char[], implementations of java.lang.CharSequence (such as the String class), and implementations of java.text.CharacterIterator - are UTF-16 sequences.


    Read full article from What is the Java's internal represention for String? Modified UTF-8? UTF-16? - Stack Overflow


    The Craft of Text Editing



    The Craft of Text Editing

    This web site contains the full text of the book "The Craft of Text Editing." That book was published in 1991 by Springer-Verlag & Co. By arrangement between the author and the publisher, the book version is now out of print and all rights have been returned to the author. Note that there may be some slight differences in typographic corrections between this version and the printed one.


    Read full article from The Craft of Text Editing


    (10) Which data structure would you use to design a Text editor? - Quora



    (10) Which data structure would you use to design a Text editor? - Quora

    If your planning on coding this up from scratch, I'd recommend starting with a "gap buffer". It's not the best solution but it is the simplest. Once you have that implemented, you will have something working and you'll be familiar with some of the issues involved in coding up your own text-editor.

    Read full article from (10) Which data structure would you use to design a Text editor? - Quora


    Enterprise UMA: Access Management with OAuth2 | Gluu | Blog



    Enterprise UMA: Access Management with OAuth2 | Gluu | Blog

    (1) OpenID Connect provides authentication, including the endpoints that enable a website to bootstrap authentication with a previously unknown domain.

    (2) UMA introduces an OAuth2 "policy decision point," which enables a website to query a central point to find out if a person is authorized for a certain "scope," which can map to an organizational policy.


    Read full article from Enterprise UMA: Access Management with OAuth2 | Gluu | Blog


    Secure Java Web Services - Stack Overflow



    Secure Java Web Services - Stack Overflow

    You should do two things, first secure the transport using SSL. If you control both the clients and the server then you can require 2-way SSL which would ensure that only trusted clients can connect.

    Second you can implement WS security protocols. Web service security standards tend to deal with three things: Authentication, Digital Signatures and Encyption/Decyption (from the Spring-WS docs):


    Read full article from Secure Java Web Services - Stack Overflow


    Going Beyond OAuth2: BYOD in the Enterprise | Box Blog



    Going Beyond OAuth2: BYOD in the Enterprise | Box Blog

    Box's OAuth2 authorization server enhances OAuth2 authorization model so that if an enterprise has trusted access enabled, the bearer token can only be generated from an enterprise-authorized device. If this token is used from another device that  is not authorized to access corporate data (for e.g., the user's shiny new Android phone), the OAuth2 authorization endpoint blocks the request.


    Read full article from Going Beyond OAuth2: BYOD in the Enterprise | Box Blog


    (10) How does OAuth 2.0 work? - Quora



    (10) How does OAuth 2.0 work? - Quora

    OAuth 2.0 is a HTTPS-based protocol which enables a resource owner (the end-user), using a user-agent (typically a browser), lets a client (typically an API consumer)  access a protected resource on a resource server (typically an API provider) using credentials stored on an authorization server. Access to the protected resource is authorized by an access token.

    Read full article from (10) How does OAuth 2.0 work? - Quora


    Ropes: Theory and practice



    Ropes: Theory and practice

    A rope represents an immutable character sequence. A rope's length is simply the number of characters in the sequence. Most string representations store all their characters contiguously in memory. The defining characteristic of a rope is that it does away with this restriction, instead allowing fragments of the rope to reside noncontiguously and joining them using concatenation nodes. This design allows concatenation to run asymptotically faster than for Java Strings. The String version of concatenation requires strings you want to join to be copied to a new location, which is an O(n) operation. The rope counterpart simply creates a new concatenation node, which is an O(1) operation. (If you're unfamiliar with big-O notation, see Resources for a link to explanatory material.)


    Read full article from Ropes: Theory and practice


    The Value of Knowing What You Don’t Know You Don’t Know | Umbel



    The Value of Knowing What You Don't Know You Don't Know | Umbel

    Anosognosia is a curious condition in which a person who suffers from a certain disability is unaware of the existence of his or her disability. If you ask an anosognosic patient whose left arm is paralyzed to pick something up with their paralyzed left arm, they of course can't do it. Yet, if you ask them why they won't, they may say they just don't feel like picking it up right now, completely unaware that they are in fact paralyzed.


    Read full article from The Value of Knowing What You Don't Know You Don't Know | Umbel


    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