Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 PROGRAMMING


  Sort an array with only one local variable

Array sorting algorithm question is frequently asked during technical interviews. There are lots of sort algorithms including bubble sort, selection sort, insertion sort, quick sort, merge sort etc. Usually interviewees will be asked to implement sort algorithms. But have you ever been asked to sort an array which you are allowed to define ONLY ONE local variable in your algorithm? Bubble sort can be used to do this actually. Normally a bubble sort algorithm may need three local variables : the index variable, the boolean variable to determine whether continue, a temp varia...

5,165 3       JAVASCRIPT ALGORITHM SORTING BUBBLE SORT


  Java 9 release is delayed again

The original Java 9 planned release date is March 2017. But latest source shows that Java 9 release will be delayed again to July 2017. It's four months later than the planned date.Oracle Chief Architect of Java Platform group Mark Reinhold proposes this new release date in a message sent on the OpenJDK mailing list. Despite this progress, at this point it's clear that Jigsaw needs moretime. We recently received critical feedback that motivated a redesignof the module system's package-export feature [5], without which we'dhave failed to achieve one of our main goals. Ther...

6,846 0       JAVA RELEASE DATE JAVA 9 JAVA 9 DELAY


  try { return } finally {}

Do you know what value will be printed when following program is ran?class Test { public int aaa() { int x = 1; try { return ++x; } catch (Exception e) { } finally { ++x; } return x; } public static void main(String[] args) { Test t = new Test(); int y = t.aaa(); System.out.println(y); }}And before answering the above question, do you have answers to following questions?If there is a return statement in try block, will the finally block be executed when the return is executed?If finally will be exe...

57,224 4       JAVA JAVA INTERVIEW QUESTION


  Loading images progressively using Gaussian blur

The popular online publishing platform Medium has adopted an impressive image loading mechanism -- pure color - blur image loading - real image loading.Since images on Medium usually have high definition, it takes much time to load an image and hence brings a bad user experience if rendering the image after it's completely downloaded. The solution Medium comes out is to preload an small image when the real image is being loaded. On Medium, the HTML code will have below pattern for every page.<figure name="512a" id="512a" class="graf--figure graf--layoutCroppedHe...

38,286 1       JAVASCRIPT ALGORITHM GAUSSIAN BLUR MEDIUM BLUR IMAGE


  Traditional recursion vs Tail recursion

Recursion is a frequently adopted pattern for solving some sort of algorithm problems which need to divide and conquer a big issue and solve the smaller but the same issue first. For example, calculating fibonacci  accumulating sum and calculating factorials.In these kinds of issues, recursion is more straightforward than their loop counterpart. Furthermore, recursion may need less code and looks more concise.For example, let's calculate sum of a set of numbers starting with 0 and stopping at N where N might be a large number. The loop way is quite simple for this issue.private stati...

23,606 5       ALGORITHM RECURSION TAIL RECURSION TRADITIONAL RECURSION


  Spring – Web sockets in Java Development

Experts of java development team are sharing this article with entire java development community. The purpose behind intending this post is to explain spring – Web sockets as a concept to rest of the world.Technology: Web socket is the one of the protocol supported by web-browsers and web-servers. It provides the two-way communication between client and server. It is used in any Java application for providing the two way communication between client and server. It opens a connection between client and server, connection will still open after it receiving the response also, whenever the s...

8,135 0       JAVA DEVELOPMENT SPRING JAVA TECHNOLOGY


  Do you have this kind of comments in your source code?

Writing runnable code is the essential skill of a programmer, writing understandable comment is also a skill a programmer should acquire. There is some famous saying that bad comment is worth than no comment. Usually your code will be maintained by other people, if you provide them some difficult to understand or misguided comments, this will be nightmare to them. While at some other time, programmers may put some funny comments in their codes which may make others laugh. Today we share some comments which are full of humor.1. Send some warning to maintainer// // Dear maintainer...

46,751 14       COMMENT HUMOR


  Java AbstractMethodError explained and demonstrated

According to Oracle Java API documentation, AbstractMethodError is a kind of runtime error where the application is having some incompatible changes which leads to a missing implementation of an abstract method. Below is the official description.Thrown when an application tries to call an abstract method. Normally, this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled.Well this can happen in cases where there are inconsistent library upgrade. For example, if a l...

12,488 0       JAVA ABSTRACTMETHODERROR