Java Concurrency Tutorial: Synchronization and Locks

In the next 15 min you learn how to synchronize access to mutable shared variables via the synchronized keyword, locks and semaphores. The majority of concepts shown in this article also work in older versions of Java. However the code samples focus on Java 8 and make heavy use of lambda expressions and new concurrency … Continue reading Java Concurrency Tutorial: Synchronization and Locks

Java Concurrency Tutorial: Threads and Executors

This guide teaches you concurrent programming in Java 8 with easily understood code examples. It's the first part out of a series of tutorials covering the Java Concurrency API. In the next 15 min you learn how to execute code in parallel via threads, tasks and executor services. The Concurrency API was first introduced with … Continue reading Java Concurrency Tutorial: Threads and Executors

Can Heroku force an application to use SSL/TLS?

Issue You have configured an SSL endpoint and now you want your application to use https for all requests. Resolution Redirects need to be performed at the application level as the Heroku router does not provide this functionality. You should code the redirect logic into your application. Under the hood, Heroku router (over)writes the X-Forwarded-Proto … Continue reading Can Heroku force an application to use SSL/TLS?

Configure Rails on Windows 7

1. Go to https://rubyinstaller.org/downloads/ and download the recommended (not necessarily the latest version of the Ruby with Devkit to avoid potential gem compatibility issue (for example, sqlite3 on Windows platform) Which version to download? If you don’t know what version to install and you’re getting started with Ruby, we recommend you use Ruby+Devkit 2.4.X as … Continue reading Configure Rails on Windows 7

How to make a custom build version (e.g., Ruby, Python, etc.) in Sublime Text 3

It looks like Sublime Text 3 uses OSX-default version of Ruby in build mode. I would like to change the version, since I'm using a newer one. I found some answers for privious version of sublime: How to edit a native build system in Sublime Text 2? Setting and changing build systems in Sublime Text … Continue reading How to make a custom build version (e.g., Ruby, Python, etc.) in Sublime Text 3

Remote procedure call

In distributed computing, a remote procedure call (RPC) is when a computer program causes a procedure (subroutine) to execute in a different address space (commonly on another computer on a shared network), which is coded as if it were a normal (local) procedure call, without the programmer explicitly coding the details for the remote interaction. … Continue reading Remote procedure call

HashSet in Java

Class HashSet<E> java.lang.Object java.util.AbstractCollection<E> java.util.AbstractSet<E> java.util.HashSet<E> Type Parameters: E - the type of elements maintained by this set All Implemented Interfaces: Serializable, Cloneable, Iterable<E>, Collection<E>, Set<E> Direct Known Subclasses: JobStateReasons, LinkedHashSet public class HashSet<E> extends AbstractSet<E> implements Set<E>, Cloneable, Serializable This class implements the Set interface, backed by a hash table (actually a HashMap instance). … Continue reading HashSet in Java