本文譯自 Julio Merino 2018 年七月撰寫的 Rust vs. Go 一文。Julio Merino 是 G 社僱員,在 G 社工作超過 8 年,無論工作內外,都接觸開發不少 Go 語言,並撰寫 [Rust 點評][rust-review]系列文,來聽聽他對 Rust 與 Go 的想法吧。
Thanks Julio Merino for this awesome article!
The thing that students have the hardest time on when learning functional programming is how to process a recursive structure while maintaining some sort of "state", the result if you will. I'll attempt here to demystify the process.
Functional programming languages almost always use a lot of recursively defined structures. Depending on the language those can be implemented in various ways, but in any case the end result is the same. A structure of this type is either an "atom", i.e. an irreducible thing, or a "compound" consisting of substructures of the same form.
For example a "list" is either an Empty/Nil list (the "atom") or it is formed as a Cons of a value and another list (compound form). That other "sublist" can itself be empty or another cons and so on and so forth. A tree is similar. It is either empty, or it consists of a triple of a value and two sub-trees, left and right.
Almost every problem we encounter is a question about doing something with all entries in a structure. To solve these prob
(-> | |
Ember = require 'ember' | |
moment = require 'moment' | |
# Socket.io | |
io = window.io | |
host = location.origin.replace /^http/, 'ws' | |
socket = io.connect host | |
# SnapSecret |
I'm doing some research on how companies use GitHub Enterprise (or public GitHub) internally. If you can help out by answering a few questions, I'd greatly appreciate it.
- What is the primary setup? Is there an organization and each official repo is owned by that organization?
- Does every engineer have a fork of each repo they're working on?
- Are engineers allowed to push directly to the official repo? Or must all commits go through a pull request?
- Do engineers work on feature branches on the main repo or on their own forks?
- Do you require engineers to squash commits and rebase before merging?
- Overall, what is the workflow for getting a new commit into the main repository?
- What sort of hooks do you make use of?
- Are there any ops issues you encountered? (Scaling, unforeseen downtime, etc.)
##引言
鉴于使用Git有一点点门槛(比SVN稍微高一点),我写了个实用教程,如果想更进一步了解Git,或者觉得我写的太懶,推荐参考书 Progit,这本书是开源的,前四章就足够用了。
组内我和晓天、汤韬都会使用git,有问题可以线下直接问。
至于为什么要用Git,其实用SVN也是挺好的,但是SVN是集中式提交,同一时刻只能有一个人修改一个文件,这个在很多时候会比较蛋疼,另一方面SVN提交时要求联网,这样碰上断网什么的话SVN就废了。
Use gist to share ideas
import numpy as np | |
import warnings | |
from itertools import cycle, izip | |
from sklearn.utils import gen_even_slices | |
from sklearn.utils import shuffle | |
from sklearn.base import BaseEstimator | |
from sklearn.base import ClassifierMixin | |
from sklearn.preprocessing import LabelBinarizer |