Build and Release

A continuous learner for experience and life.

Playing With Hadoop on Dockerbase

Apache Hadoop Logo Apache Hadoop is a map reduce computing environment, which provide a reliable, scalable and distributed computing environment to handle big data. This article introduce how to setup a Apache Hadoop Dockerbase image to play with the standalone operation of Hadoop on Docker.

Getting Familiar With HBase on Dockerbase

Apache HBase Logo Apache HBase is a distributed, scalable, big data store. With Apache HBase, you can randomly access your big data, which support realtime read/write. You can get more information about Apache HBase from the reference list [3]. This article introduces how to setup a standalone HBase database with Dockerbase supported.

Getting Started With Scala

enter image description here Have no any idea what to do today after dinner, although I have some homeworks need to submit soon, I still decided to try something new in a short time. I recalled I read an article yesterday on, it seems there is a company named instacarts tried Scala programming language to setup their development stack. I am very curious on the programming language, it seems someone said: “Speaking More Than One Language Could Sharpen Your Brain.”, how about Scala?

Programming for Andorid: Synchronize Actions With Handler

enter image description here

Sometimes, we need to synchronize the actions in a series but not in parallel. For example, we need to download an image then display it on Google Gallery. It seems we cannot display a partial image during downloading. OK, there is another story, probably, we will mention later, for displaying image with a coarse one then detailed the clear picture. Now let’s fix how to download an image then display it, without manual interference.

This program bases on the last one: Programming for Android: Download, Progressbar and FileProvider

Programming for Android: Download, Progressbar and FileProvider

enter image description here In this article, we try to download a file from Internet, show the progress of downloading, then share the file to gallery for displaying with FileProvider.

Keywords: Android, Programming, Download, Image, Progressbar, FileProvider


0. Create an Android project with name: FileProviderExample, you can also clone this project directly from github here: [3]


1. Download

We intend to download an image file with foreground mode since we want to block the consequent actions until the download process is complete. If you try to download file(s) with background mode, please reference some other articles here

Design a Reuse and ‘De-use’ Modularized Software System

enter image description here

Design a reuse and ‘de-use’ modularized software system

Keywords: reuse, ‘de-use’, minimum equipped interface (MEI), strong cohesion, loose coupling, software engineering

Most of the task on software design are to analyze requirements, decompose functionalities and connect the parts of artifacts to fulfill customer requirements.

This time we focus on decomposition of functionalities. Why we need to decompose the requirements to each small module or package, one of the reasons is to reuse them, another reason, I think, is to ‘de-use’ them. When we do not need any of modules, we can separate them from system very easily, which also provide much convenience for testing. We can test each of the seperated modules, packages or interfaces isolated, without interference between each other.

The goal of the software design, include architectural design and detail design, is to decompose functionalities with the characteristics of strong cohesive, and loose coupled, which means we need a complete, but most minimal system function set. Interface is a very important element between two systems to access those functionalities, in addition to deployment environment. In fact, we can treat the environment as the interface between system and the system host. So we need a minimum equipped interface (MEI), which refers to Minimum Viable Product (MVP) definition.

To achieve the goal, besides an elegant design blueprint, functional prototyping, we also need supports from configuration management and testing. We should have many different configuration profiles to include or exclude the modules according to the reuse and ‘de-use’ specifications, which we planned in design. Testing should have different test scenarios to verify and/or validate the interfaces, which are exported by modules or packages according the configuration profiles.

Succeed to DCOM and CORBA, the popular technology so far for designing a strong cohesive and loose coupled interface on cloud is REST, which based on the simple HTTP protocol verbs (GET, PUT, POST, DELETE). REST API is an analogous to SQL for interaction between systems on cloud, the latter provides several common verbs to query and manipulate data with relational database, such as SELECT, INSERT, UPDATE, DELETE, etc.

In a conclusion, as the main task for design, we need to decompose functionalities in order to reuse and ‘de-use’ modules, which act as a container to host functions. The design goal is to make functionality as most as strong cohesive, and loose coupled. We can leverage configuration management and testing to achieve the design goal. REST interface provides a good practice for designing a strong cohesive, and loose coupled cloud system.

Written with StackEdit.

Setup Mongo Database Master Slave Replication

enter image description here


You need know the IP or hostname of the Mongo database which should be acted as a master, and you can ping the port 27017 from the mongo database which should be acted as a slave.

Here are some commands might be helpful:

  • To know the external IP of the server:
$ curl
  • To ping the server which you want to connect, on the specific port ( for example: 27017 ):
$ telnet 27017


Machine A (Master): Run Mongo Daemon as master:

$ mongod --master

Machine B (Slave): If mongod is running, which is the default behavior when installed, you should stop it before the following steps:

# Stop the mongodb which installed by default
$ sudo stop mongodb

Run Mongo Daemon as slave:

$ mongod --slave

Probably you need to specify the dbpath, in case you have any disk space limitation:

$ sudo mongod --slave --dbpath /data/mongodb/

Run mongo to open a mongo shell, then config for replication:

> use local
> db.sources.find()
> db.sources.insert( { host: <masterhostname> <,only: databasename> } );

Then you run show dbs in the mongo shell:

> show dbs

You will find the databasename which we typed behind the only key above displayed.

You may need to run the command multiple times to make sure the replication is going on. For example:

> show dbs
databasename    17.9453125GB
local   0.078125GB
> show dbs
databasename    19.9443359375GB

You can also run the following commands to show the information of the replication on master and slave side:

# Master side:
> rs.printReplicationInfo() # replace 'rs' to 'db' for the version prior to 2.6

# Slave side:
> rs.printSlaveReplicationInfo() # same thing as the above command, you need to replace 'rs' to 'db' if you run the mongodb which version prior to 2.6

Besides, you can run the following command to get a defail status of the server:

> db.serverStatus()

You might neet to run resync to recover replication:

> use admin
> db.runCommand( { resync: 1 } )



Written with StackEdit.

Install Gollum

gollum snapshot

Gollum is a simple wiki system built on top of Git.

Gollum wikis are simply Git repositories that adhere to a specific format. Gollum pages may be written in a variety of formats and can be edited in a number of ways depending on your needs. You can edit your wiki locally:

  • With your favorite text editor or IDE (changes will be visible after committing).
  • With the built-in web interface.
  • With the Gollum Ruby API.

Here are steps to install gollum.

Install Nodejs Using NVM

enter image description here

An alternative to installing Node.js through apt is to use a specially designed tool called nvm, which stands for “Node.js version manager”.

Using nvm, you can install multiple, self-contained versions of Node.js which will allow you to control your environment easier. It will give you on-demand access to the newest versions of Node.js, but will also allow you to target previous releases that your app may depend on.

加入 Apple iOS 开发者计划


学习开发 iOS 应用程序的第一步是理解注册为 Apple 开发者和 iOS 开发者计划会员的不同。然后决定你在什么时候付费加入 iOS 开发者计划。本章就来谈论一下 Apple 开发者和 iOS 开发者计划的差别,大概需要的费用以及加入开发者计划的好处。最后,一步步告诉大家怎么样加入这些计划成为会员。

注册成为 Apple 开发者

注册成为 Apple 开发者不需要费用,很简单,访问以下链接:

然后按照要求一步步开始注册。 使用 Apple ID 进行注册,这个 Apple ID 就是用来在 iTunes 或者 Apple Store 上面购买商品的账号。 完成这个注册,就可以获得一些开发者资源,例如在线文档,教程等等。开发者也能够下载旧版的 iOS 开发包(SDK),以及 Xcode 开发环境(IDE)。