PROGRAMMING


  Why exception would be thrown when deleting element while looping through HashMap in Java

HashMap and other Collection types are frequently used in Java application programming. This post will explain why exception would be thrown when deleting element with Map.remove() while looping through a Map using Iterator. This issue would also occur to other Collection types such as Set, List.Below is a sample code snippet demonstrating the exception thrown.Map<String,String> map = Collections.synchronizedMap(new TreeMap<String,String>()); map.put("key1","value1");map.put("key2","value2");map.put("key3","value3"); Set<Entry<String,String>> entries = map.entrySet(); I...

3,556 0       JAVA HASHMAP CONCURRENTMODIFICATIONEXCEPTION


  Python Disrupts the Programming Language World- Gets Hot and Popular

Python is one of the fastest growing languages currently. It is undeniable that more and more programmers use Python and deploy it to the best of their use. Everyone, from the freelancer and startups to giant corporations and even governments, is using Python. Let us have a look at the reasons that make it so popular. Training:According to research, 8 out of 10 tech schools in the US teach Python over JAVA. Even the three major MOOC platforms, edX, Coursera, and Udacity have a similar approach and have introductory programmes before anything else and promote it on a massive level. &n...

9,462 1       DEVELOPMENT PYTHON TEAM


  Java Concurrency Basics: CountDownLatch and CyclicBarrier

CountDownLatchCountDownLatch can be used in synchronizing behavior among threads, it makes one or more threads wait for some actions in other threads to be completed. It has a property count which defines how many countDown() need to be called before other threads which called await() to be waked up. When a thread calls CountDownLatch.await(), the thread will be blocked until the value of count becomes 0. The initial value of count can be specified when creating the CountDownLatch instance. Every time when CountDownLatch.countDown() is called, the value of count will decrease by 1 until t...

6,771 0       JAVA CONCURRENCY JAVA COUNTDOWNLATCH CYCLICBARRIER


  Stream API in Java 8

OverviewIn this lesson on Stream API in Java, we will study how we can put Streams to use to write efficient and much more maintainable code. We will also write code with and without Streams so that we are able to compare the two versions.Before doing all this, we must know how to create a Stream and process it and that is what we will get started with.Introduction to StreamsWe will be starting with creating Streams. Let us get started with the Stream<T> API which enables us to play with Stream processing.Creating StreamsStreams can be created from any source like a Collection or an arra...

3,813 0       DEVELOPMENT TEAM JAVA 8 STREAM API


  What will the value of Integer.valueOf(127) == Integer.valueOf(127) be in Java?

Do you really understand how Java does the integer comparison? OK, ignore the statements in the post title. What we are interested in is another set of comparison statements. Let's first see below code snippet.public class IntegerComparison { public static void main(String[] args) { Integer a = 127, b = 127; Integer c = 128, d = 128; System.out.println(a == b); System.out.println(c == d); }}What do you think the output will be? Are they both displaying true? You will find out the answer after reading through how Java optimizes some of the integer comparison logic.First, you need to un...

11,757 3       JAVA == EQUALSTO


  How to check which Ohai plugin hangs in chef client run

Ohai plugins are very important components in chef client which aims to provide resource management automation on a server. The data discovered by Ohai plugins are describing the current state of the server and they will be used to maintain the server in a desired state. Each Ohai plugin discovers a specific pierce of information about the server such as cpu, memory, middleware etc.However, there are rare occasions(well I am a bit optimistic here) someone may find that the chef client run is hanging and it hangs at Ohai plugin discovery stage. Given every server has its own unique co...

4,998 0       HOW TO CHEF-CLIENT OHAI UPTIME HANG


  A plugin to update last_error in Delayed Job

delayed_job is a process based asynchronous task processing gem which can be ran at background. It will fork the specified number of processes to execute the tasks asynchronously. The task status is usually stored in the database so that it can be easily integrated into a Rails application where asynchronous job execution is desired.Normally when a job fails to execute or error occurs, it would save the error into the database with the column last_error. Ideally all these will be handled by the delayed_job gem itself, we no need to worry about anything. However, in some extreme cases, we ...

3,898 0       RUBY RUBY ON RAILS DELAYED JOB LAST_ERROR


  Want to be a programmer? Top programming languages that will be result driven in 2017

Programmers are always high in demand in software industry: take any corporate blue chip Software Company India for instance; programmers are playing a pivotal role in company’s business and relevant growth. In that case if you are planning to pursue a programmer’s career and earn fat package, here goes the range of option for your further study.Alternatively, if you are an employer and you want to understand the basic idea of coding, the outline description of popular programming language will give you extra leverage for doing recruitment, coordination with your team, etc. Ja...

2,239 0       JAVA SOFTWARE OUTSOURCING INDIA PROGRAMMERS