During your development in Rails, there will be times where you will want to provide some functionality which is required by you, but either you don't know how to do or you don't want to implement it on your own since a lot of work has been put into its development by talented developers. These … Continue reading What is the use of Gemfile in Rails?
Computing
Leveraging Sass mixins for cleaner code
Without question, one of the most powerful and valuable features of Sass is the ability to package up existing code into reusable chunks of code called mixins. Mixins are like macros Mixins are the Sass equivalent of macros in other programming languages. If you've programmed before you could think of them as functions, procedures, or … Continue reading Leveraging Sass mixins for cleaner code
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
How to edit Sublime Text build settings?
I want to enable -std=gnu++11 in Sublime Text 3's C++ Single File build on Ubuntu 12.04. I have already upgraded the tool chain to the latest g++ and do not want to see the following error on every build: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This … Continue reading How to edit Sublime Text build settings?
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