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

 ALL


  Service discovery with etcd

In previous post, we have talked about etcd and its usage. This post we will cover how to implement server discovery with etcd.Service discovery is to solve one of the most commonly seen scenarios in distributed system where how to find the corresponding target service to talk to. In short, it is to find some server which one can talk to based on some service name.A complete service discovery system include below three key functions:Service registration: A service must register itself to some common place so that others can discover itHealth check: An instance must report its health status to ...

4,356 0       SERVICE DISCOVERY ETCD DEMO TUTORIAL


  A HTTPS client and HTTPS server demo in Java

In this post, I will create a HTTPS server and HTTPS client demo which can establish HTTPS communication between a server and a client using Java. This should be very useful when we want to test our understanding about SSL communication. We will use both a detailed SSL client and a simple HttpsURLConnection as the HTTPS client.Before creating the actual HTTPS server and HTTPS client, we first need to generate the keystore and truststore to be used by the server and client. To generate the keystore, we can follow instructions at Different types of keystore in Java -- JKS. In this demo, we ...

69,128 5       JAVA SSL DEMO HTTPS


  Different types of keystore in Java -- JKS

JKS is Java Keystore, a proprietary keystore type designed for Java. It can be used to store private keys and certificates used for SSL communication, it cannot store secret keys however. The keytool shipped with JDKs cannot extract private keys stored on JKS. This type of keystore usually has an extension of jks.Next we will show how to operate the JKS keystore with pure Java code.Create JKS keystoreThe simplest method to create a JKS keystore to create an empty keystore. We can first get an instance of KeyStore and then load a null keystore. After loading the null keystore, we just need to c...

45,104 3       DEMO EXAMPLE KEYSTORE JKS


  Install and remote access phpMyAdmin on CentOS

phpMyAdmin is a free and open source tool written in PHP intended to handle the administration of MySQL with the use of a Web browser. It can perform various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements; or managing users and permissions.Today I walk through you the steps to install phpMyAdmin on CentOS. Actually, these steps are applicable to other Linux systems as well. 1. Download the phpMyAdmin from Sourceforge.net. Run command:wget -c http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/3.5.1/phpMyAdmin-3.5.1-english.tar....

18,150 0       PHPMYADMIN LINUX DEMO INSTALLATION


  PHP to get long running process progress dynamically

Frequently in web applications, we may have a request to the back end system which may trigger a long running process such as searching huge amount of data or a long running database process. Then the front end webpage may hang and wait for the process to be finished. During this process, if we can provide the user some information about the progress of the back end process, it may improve user experience. Unfortunately, in web applications, this seems not an easy task because web scripting languages don't support multithreading and HTTP is stateless.  We now can have AJAX to simulate rea...

59,206 10       PHP AJAX DEMO PROGRESS LONG PROCESS


  C++11 multithreading tutorial

The code for this tutorial is on GitHub: https://github.com/sol-prog/threads.In my previous tutorials I’ve presented some of the newest C++11 additions to the language: regular expressions, raw strings and lambdas.Perhaps one of the biggest change to the language is the addition of multithreading support. Before C++11, it was possible to target multicore computers using OS facilities (pthreads on Unix like systems) or libraries like OpenMP and MPI.This tutorial is meant to get you started with C++11 threads and not to be an exhaustive reference of the standard.Creating and launching a t...

4,118 0       C++ DEMO MULTITHREADING STANDARD 11


  Using DateInterval class in PHP

DateInterval is (amongst others) a relatively new addition to the date extension in PHP 5.3. It allows to describe an interval in time, and you can perform actions with that interval. Basically, it allows to calculate with dates in a very easy way, and do even more fun stuff with it.Unfortunately no documentation exists today for DateInterval and friends, but PHP is open-source so you can easily have a peek at the code to see what’s happening under the engine. This is more or less what the documentation for DateInterval and some helper functions could look like:Prototype:DateInterval Da...

5,301 0       PHP DEMO CLASS DATEINTERVAL PHP 5.3


  Java Polymorphism and Overriding Methods

Most Java developers will be familiar with polymorphism – we’ve all seen the example of the Dog and Cat classes inheriting from some abstract Animal class and having their say() methods produce different results. But it’s still worthwhile to look at a few simple examples to reinforce the concepts.First, we define a simple class with one instance method and one static method.public class A{ public String getName() { return "I am A"; } public static String getStaticName() { return "Statically A!"; }}Then we extend that clas...

2,730 0       JAVA POLYMORPHISM DEMO OVERRIDING DYNAMI