This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The summation challenge, extended from the classical a-plus-b problem, is a | |
programming challenge for beginners. A programmer is asked to write a program to | |
read multiple integers separated by whitespace from a single line and then print | |
out their sum. Although not difficult, different solutions to this problem can | |
exhibit different characteristics of programming languages. Once I start to | |
learn a new language, I will add a new solution here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newtype Rec a = Fold { unfold :: Rec a -> a } | |
fix :: (a -> a) -> a | |
fix f = (\x -> f (unfold x x)) (Fold (\x -> f (unfold x x))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <pthread.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#define SERV_PORT 4746 | |
#define BACKLOG 10 | |
#define DATA_LEN 100000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fino-time.zsh-theme | |
# Modified by yzyzsun on 2018-06-12 | |
# Use with a dark background and 256-color terminal. | |
# Borrowing shamelessly from these oh-my-zsh themes: | |
# bira | |
# robbyrussell | |
# | |
# Also borrowing from http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exampleWithNumber: x | |
|y| | |
true & false not & (nil isNil) ifFalse: [self halt]. | |
y := self size + super size. | |
#($a #a 'a' 1 1.0) | |
do: [:each | Transcript | |
show: (each class name); | |
show: (each printString); | |
show: ' ']. | |
^ x < y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /etc/yum.repos.d | |
curl -O https://copr.fedorainfracloud.org/coprs/librehat/shadowsocks/repo/epel-7/librehat-shadowsocks-epel-7.repo | |
yum -y install shadowsocks-libev | |
setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/ss-server | |
cat > /etc/shadowsocks-libev/config.json << 'EOF' | |
{ | |
"server": "0.0.0.0", | |
"server_port": 443, | |
"password": "p@$$w0rd", | |
"method": "aes-128-gcm" |