Category Archives: Computer and Internet

Run multiple jobs in Flink local environment

Actually there is little reason to do this. Flink local environment is generally used to test and debug, not for scalable stream data processing. But anyway, this is the way to run multiple jobs in the local environment. First, start … Continue reading

Posted in Cloud, Computer and Internet | Leave a comment

XXE attack and mitigation

Recently I’ve got a security violation report from Sonar. It is the XXE attack. This is indeed a scary scenario, with attacker able to access server internal file with ease. The simplest approach is to disable this feature. However in … Continue reading

Posted in Computer and Internet, Programming and Algorithm | Tagged | Leave a comment

Oracle 某项目的 Database Design Guidelines

涉及用户数据的表必须有USER_ID列。主要为了sharding。相应的,表和索引基于USER_ID做partition。 使用基本构造。Heap表,B-tree索引,VARCHAR2(数据库整体应该已经是unicode编码了)。 不使用Trigger。这部分逻辑应该放在中间层。 不使用PL/SQL。同上。 数据生命周期。主要是注意数据的清理。 不使用并行操作。大多数时间并不只有一个模块在运行。 不在运行时使用DDL。DDL只在downtime执行。 可以的话使用global temporary table。 不使用foreign key。这个比较意外,主要是为了migration方便。 压缩索引。使用”COMPRESS ADVANCED LOW”。

Posted in Computer and Internet | Tagged | Leave a comment

Learning with XGBoost

There is a Mercedes-Benz Greener Manufacturing competition hosted on Kaggle. Data size is small and relatively simple, so it fits well as a quick weekend diversion. As usual, before modeling the data, pre-processing is required. In this case, the categorical … Continue reading

Posted in Computer and Internet, Machine Learning | Tagged | Leave a comment

AlphaGo 简单介绍

读了下2016年的 Mastering the game of Go with deep neural networks and tree search,本来想写个读后感,不过发现 Google DeepMind’s AlphaGo: How it works 其实已经做了相当全面的介绍了。 围棋在博弈论上其实算是个非常简单的问题,非胜即负的零和游戏,同时也没有任何随机因素,和简单的井字棋游戏没什么大差。如果棋手是全知全能的话,5a 将只显示0或100,每步只需要在标明100的任何一个位置落子即可(下一步,在对手看来所有位置都将显示0)。 AlphaGo 首先利用的是已有的围棋知识库。如果对于一个棋局,已经有围棋大师如此落子的话,那这至少是个不错的选择。于是由 KSG Go 的数据训练了一个高准确率(57%)的策略网络,用来模拟大师的围棋策略;同时也训练了一个更快速(但较低准确率 24%)的策略网络,用来实时快速推演整个棋局。 策略网络的输出是一个落子的概率分布。因此可以将两个策略网络重复相互对弈,每次会得到有所不同的棋局进程。 接下来 AlphaGo 令高准确率的策略网络相互对弈,用 reinforcement learning 的方法继续优化策略网络。这时,优化的策略网络已经能够大概率战胜已有的围棋程序了。 最后,AlphaGo 利用策略网络对弈的棋局来训练价值网络。简单来说,对于任何棋局,有一个最优的价值(如前所述的0或100,但这需要不现实的完整树状搜索),这个最优的价值可以用反复用策略网络对弈的结果来近似(如果策略网络从该棋局开始对弈100局,80胜20败的话,可以近似认为其价值为80),然后这个近似的价值可以用价值网络的输出来近似。而显然价值网络在实时计算上优势明显。 在这些非实时的策略网络和价值网络训练完成之后,在和人类对弈中,AlphaGo 用基于 Monte … Continue reading

Posted in Computer and Internet, Machine Learning, Science | Tagged , | Leave a comment

Deep learning in H2O

I did not find an easy-to-use native deep neural network package on R. IMO darch is actually a good one. But it still takes some effort to pre-process data, tune the parameters, etc. On the other hand, H2O platform is very easy … Continue reading

Posted in Computer and Internet, Machine Learning, Science | Tagged | Leave a comment

caret package for R

R is one of the best tool to do data science (for prototype, and for data fit in memory). And caret is one of the best package to create common machine learning models in R. As described in packages introduction, caret … Continue reading

Posted in Computer and Internet, Machine Learning, Science | Tagged | 1 Comment