Terror Judgement at the last day

想望耶和华日子来到的有祸了!你们为何想望耶和华的日子呢?那日黑暗没有光明, (阿摩司书 5:18 和合本)
Woe to you who long for the day of the Lord ! Why do you long for the day of the Lord ? That day will be darkness, not light. (Amos 5:18 NIV)
景况好像人躲避狮子又遇见熊,或是进房屋以手靠墙,就被蛇咬。 (阿摩司书 5:19 和合本)
It will be as though a man fled from a lion only to meet a bear, as though he entered his house and rested his hand on the wall only to have a snake bite him. (Amos 5:19 NIV)
耶和华的日子不是黑暗没有光明吗?不是幽暗毫无光辉吗? (阿摩司书 5:20 和合本)
Will not the day of the Lord be darkness, not light— pitch-dark, without a ray of brightness? (Amos 5:20 NIV)

Serene view of a calm stream in the middle of the forest
Photo by Anton Romanov / Unsplash

The Vison Of The River

他带我回到殿门,见殿的门槛下有水往东流出(原来殿面朝东)。这水从槛下,由殿的右边,在祭坛的南边往下流。 (以西结书 47:1 和合本)
The man brought me back to the entrance to the temple, and I saw water coming out from under the threshold of the temple toward the east (for the temple faced east). The water was coming down from under the south side of the temple, south of the altar. (Ezekiel 47:1 NIV)
他带我出北门,又领我从外边转到朝东的外门,见水从右边流出。 (以西结书 47:2 和合本)
He then brought me out through the north gate and led me around the outside to the outer gate facing east, and the water was trickling from the south side. (Ezekiel 47:2 NIV)
他手拿准绳往东出去的时候,量了一千肘,使我趟过水,水到踝子骨。 (以西结书 47:3 和合本)
As the man went eastward with a measuring line in his hand, he measured off a thousand cubits and then led me through water that was ankle-deep. (Ezekiel 47:3 NIV)
他又量了一千肘,使我趟过水,水就到膝;再量了一千肘,使我趟过水,水便到腰; (以西结书 47:4 和合本)
He measured off another thousand cubits and led me through water that was knee-deep. He measured off another thousand and led me through water that was up to the waist. (Ezekiel 47:4 NIV)
又量了一千肘,水便成了河,使我不能趟过。因为水势涨起,成为可洑的水,不可趟的河。 (以西结书 47:5 和合本)
He measured off another thousand, but now it was a river that I could not cross, because the water had risen and was deep enough to swim in—a river that no one could cross. (Ezekiel 47:5 NIV)
他对我说:"人子啊,你看见了什么?"他就带我回到河边。 (以西结书 47:6 和合本)
He asked me, "Son of man, do you see this?" Then he led me back to the bank of the river. (Ezekiel 47:6 NIV)
我回到河边的时候,见在河这边与那边的岸上有极多的树木。 (以西结书 47:7 和合本)
When I arrived there, I saw a great number of trees on each side of the river. (Ezekiel 47:7 NIV)
他对我说:"这水往东方流去,必下到亚拉巴,直到海。所发出来的水必流入盐海,使水变甜(原文是得医治;下同) 。 (以西结书 47:8 和合本)
He said to me, "This water flows toward the eastern region and goes down into the Arabah, where it enters the Dead Sea. When it empties into the sea, the salty water there becomes fresh. (Ezekiel 47:8 NIV)
这河水所到之处,凡滋生的动物都必生活,并且因这流来的水必有极多的鱼,海水也变甜了。这河水所到之处,百物都必生活。 (以西结书 47:9 和合本)
Swarms of living creatures will live wherever the river flows. There will be large numbers of fish, because this water flows there and makes the salt water fresh; so where the river flows everything will live. (Ezekiel 47:9 NIV)
必有渔夫站在河边,从隐·基底直到隐·以革莲,都作晒(或译:张) 网之处。那鱼各从其类,好像大海的鱼甚多。 (以西结书 47:10 和合本)
Fishermen will stand along the shore; from En Gedi to En Eglaim there will be places for spreading nets. The fish will be of many kinds—like the fish of the Mediterranean Sea. (Ezekiel 47:10 NIV)
只是泥泞之地与洼湿之处不得治好,必为盐地。 (以西结书 47:11 和合本)
But the swamps and marshes will not become fresh; they will be left for salt. (Ezekiel 47:11 NIV)
在河这边与那边的岸上必生长各类的树木;其果可作食物,叶子不枯干,果子不断绝。每月必结新果子,因为这水是从圣所流出来的。树上的果子必作食物,叶子乃为治病。" (以西结书 47:12 和合本)
Fruit trees of all kinds will grow on both banks of the river. Their leaves will not wither, nor will their fruit fail. Every month they will bear fruit, because the water from the sanctuary flows to them. Their fruit will serve for food and their leaves for healing." (Ezekiel 47:12 NIV)


Photo by Annie Spratt / Unsplash

Wiggle Sort II

Question:
http://www.lintcode.com/en/problem/wiggle-sort-ii/
Given an unsorted array nums, reorder it such that
nums[0] < nums[1] > nums[2] < nums[3]....

Answer:
class Solution {
public:
    /*
     * @param nums: A list of integers
     * @return: nothing
     */
    inline int partion(vector<int> &nums, int left, int right) {
        int pivot = nums[left];
        int i = left - 1;
        int j = right + 1;
        while (1) {
            do {
                i = i + 1;
            } while (nums[i] < pivot);
            do {
                j = j -1;
            } while (nums[j] > pivot);
            if (i >= j)
                return j;
            int temp = nums[i];            
            nums[i] = nums[j];            
            nums[j] = temp;             
        }
    }
    inline void qsort(vector<int> &nums,  int left, int right) {
        if (left >= right)
            return;
        int p = partion(nums, left, right);
        qsort(nums, left, p);
        qsort(nums, p+1, right);
    }     
    void wiggleSort(vector<int> &nums) {
        // write your code here
        vector<int> temp(nums.size());
        qsort(nums, 0, nums.size()-1);
        int s = (nums.size() + 1) >> 1;
        int t = nums.size();
        for (int i = 0; i < nums.size(); i++) {
            temp[i] = (i & 1) == 0 ?  nums[--s] : nums[--t] ;
        }
        nums = temp;
    }
};

VISION VALLEY

耶和华的灵(原文是手) 降在我身上。耶和华藉他的灵带我出去,将我放在平原中;这平原遍满骸骨。 (以西结书 37:1 和合本)
The hand of the Lord was on me, and he brought me out by the Spirit of the Lord and set me in the middle of a valley; it was full of bones. (Ezekiel 37:1 NIV)
他使我从骸骨的四围经过,谁知在平原的骸骨甚多,而且极其枯干。 (以西结书 37:2 和合本)
He led me back and forth among them, and I saw a great many bones on the floor of the valley, bones that were very dry. (Ezekiel 37:2 NIV)
他对我说:"人子啊,这些骸骨能复活吗?"我说:"主耶和华啊,你是知道的。" (以西结书 37:3 和合本)
He asked me, "Son of man, can these bones live?" I said, "Sovereign Lord , you alone know." (Ezekiel 37:3 NIV)
他又对我说:"你向这些骸骨发预言说:枯干的骸骨啊,要听耶和华的话。 (以西结书 37:4 和合本)
Then he said to me, "Prophesy to these bones and say to them, 'Dry bones, hear the word of the Lord ! (Ezekiel 37:4 NIV)
主耶和华对这些骸骨如此说:'我必使气息进入你们里面,你们就要活了。 (以西结书 37:5 和合本)
This is what the Sovereign Lord says to these bones: I will make breath enter you, and you will come to life. (Ezekiel 37:5 NIV)
我必给你们加上筋,使你们长肉,又将皮遮蔽你们,使气息进入你们里面,你们就要活了;你们便知道我是耶和华。'" (以西结书 37:6 和合本)
I will attach tendons to you and make flesh come upon you and cover you with skin; I will put breath in you, and you will come to life. Then you will know that I am the Lord .' " (Ezekiel 37:6 NIV)
于是,我遵命说预言。正说预言的时候,不料,有响声,有地震;骨与骨互相联络。 (以西结书 37:7 和合本)
So I prophesied as I was commanded. And as I was prophesying, there was a noise, a rattling sound, and the bones came together, bone to bone. (Ezekiel 37:7 NIV)
我观看,见骸骨上有筋,也长了肉,又有皮遮蔽其上,只是还没有气息。 (以西结书 37:8 和合本)
I looked, and tendons and flesh appeared on them and skin covered them, but there was no breath in them. (Ezekiel 37:8 NIV)
主对我说:"人子啊,你要发预言,向风发预言,说主耶和华如此说:气息啊,要从四方(原文是风) 而来,吹在这些被杀的人身上,使他们活了。" (以西结书 37:9 和合本)
Then he said to me, "Prophesy to the breath; prophesy, son of man, and say to it, 'This is what the Sovereign Lord says: Come, breath, from the four winds and breathe into these slain, that they may live.' " (Ezekiel 37:9 NIV)
于是我遵命说预言,气息就进入骸骨,骸骨便活了,并且站起来,成为极大的军队。 (以西结书 37:10 和合本)
So I prophesied as he commanded me, and breath entered them; they came to life and stood up on their feet—a vast army. (Ezekiel 37:10 NIV)
主对我说:"人子啊,这些骸骨就是以色列全家。他们说:'我们的骨头枯干了,我们的指望失去了,我们灭绝净尽了。' (以西结书 37:11 和合本)
Then he said to me: "Son of man, these bones are the people of Israel. They say, 'Our bones are dried up and our hope is gone; we are cut off.' (Ezekiel 37:11 NIV)
所以你要发预言对他们说,主耶和华如此说:'我的民哪,我必开你们的坟墓,使你们从坟墓中出来,领你们进入以色列地。 (以西结书 37:12 和合本)
Therefore prophesy and say to them: 'This is what the Sovereign Lord says: My people, I am going to open your graves and bring you up from them; I will bring you back to the land of Israel. (Ezekiel 37:12 NIV)
我的民哪,我开你们的坟墓,使你们从坟墓中出来,你们就知道我是耶和华。 (以西结书 37:13 和合本)
Then you, my people, will know that I am the Lord , when I open your graves and bring you up from them. (Ezekiel 37:13 NIV)
我必将我的灵放在你们里面,你们就要活了。我将你们安置在本地,你们就知道我—耶和华如此说,也如此成就了。这是耶和华说的。'" (以西结书 37:14 和合本)
I will put my Spirit in you and you will live, and I will settle you in your own land. Then you will know that I the Lord have spoken, and I have done it, declares the Lord .' " (Ezekiel 37:14 NIV)


Photo by frank mckenna / Unsplash

Wiggle Sort

Question:
http://www.lintcode.com/en/problem/wiggle-sort/
Given an unsorted array nums, reorder it in-place such that
nums[0] <= nums[1] >= nums[2] <= nums[3]....
Example
Given nums = [3, 5, 2, 1, 6, 4], one possible answer is [1, 6, 2, 5, 3, 4].

Answer:
class Solution {
public:
    /*
     * @param nums: A list of integers
     * @return: nothing
     */
    inline int partion(vector<int> &nums, int left, int right) {
        int pivot = nums[left];
        int i = left - 1;
        int j = right + 1;
        while (1) {
            do {
                i = i + 1;
            } while (nums[i] < pivot);
            do {
                j = j -1;
            } while (nums[j] > pivot);
            if (i >= j)
                return j;
            int temp = nums[i];
            nums[i] = nums[j];
            nums[j] = temp; 
        }
    }
    inline void qsort(vector<int> &nums,  int left, int right) {
        if (left >= right)
            return;
        int p = partion(nums, left, right);
        qsort(nums, left, p);
        qsort(nums, p+1, right);
    }
    void wiggleSort(vector<int> &nums) {
        // write your code here
        vector<int> sort = nums;
        int len = nums.size();
        qsort(sort, 0, len-1);
        int l = 0;
        int r = len - 1;
        nums.clear();
        while (l < r) {
          nums.push_back(sort[l]);
          nums.push_back(sort[r]);
          l++;
          r--;
        }
        if (l == r)
          nums.push_back(sort[l]);
    }
};

Setup shadowsocks server on ubuntu 16.04

install shadowsocks-libev

sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev
sudo apt-get update
sudo apt install shadowsocks-libev

install bbr

wget –no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh
chmod a+x bbr.sh
sudo ./bbr.sh

install rng-tools

sudo apt-get install rng-tools

config

sudo vim /etc/shadowsocks-libev/config.json
{
"server":"10.128.0.3",
"server_port":8911,
"local_port":1235,
"password":"jesusislove",
"timeout":60,
"method":"chacha20-ietf-poly1305"
}

start shadowsocks server

sudo /etc/init.d/shadowsocks-libev restart

Notes:
due to GFW, you need to change your IP and port and method in config.json frequently, otherwise your connection will be rejected.

Kth Largest Element

Question:
http://www.lintcode.com/en/problem/kth-largest-element/
Find K-th largest element in an array.
You can swap elements in the array.

Answer:
class Solution {
public:
    /*
     * @param n: An integer
     * @param nums: An array
     * @return: the Kth largest element
     */
    inline void qsort(vector<int> &nums, int left, int right) {
        if (left >= right)
            return;
        int mid = nums[(left + right)/2];
        int l = left;
        int r = right;
        while (l < r) {
            while(nums[l] < mid) ++l;
            while(nums[r] > mid) --r;
            if (l >= r) break;
            nums[l] = nums[l] + nums[r];
            nums[r] = nums[l] - nums[r];
            nums[l] = nums[l] - nums[r];
            ++l;
            --r;
        }
        if (l == r) l++;
        if (left < r) qsort(nums, left, l - 1);
        if (l > left) qsort(nums, r + 1, right);
    }
    int kthLargestElement(int n, vector<int> &nums) {
        // write your code here
        qsort(nums, 0, nums.size() - 1);
        return nums[nums.size() - n];
    }
};

fixed: embedded-redis: Unable to run on macOS Sonoma

Issue you might see below error while trying to run embedded-redis for your testing on your macOS after you upgrade to Sonoma. java.la...