Feng's Notes Isn't coding fun?

Troubleshooting Cloudflare Image Upload with Node

I was working on testing upload images to Cloudflare using their API. The task was supposed to be simple because cloudfare have some code samples here, however I was having trouble getting it to work. As I’m using node+axios , the sample code on document is like

How to set up a full-stack home server

I will explain in this article how to deploy and serve a kubenetes cluster(k3s) using your home laptop/PC. I will also show you how to expose your services to the internet with cloudflare tunnel. I will use a simple web app as an example to show how to build a full-stack application and serve it with the home server. Here is the overview of the architecture setup. The laptop running all these stuff is a 7 year old Thinkpad with Interl i5 + 16G Mem installed with Ubuntu

A Dev's Guide to K8s Deployment

[This is a note first published internally, I copied here for backup ] Although I have deployed a couple of apps in our k8s cluster, I find it still tricky to go through the whole journey fluently. I took some notes and put them down here for a memo. Hope it helps developers like me who are still experiencing k8s issues from time to time. The deployment steps Local Test So you have a Dockerfile in your project and a docker engine running on your machine

How to Test a Kong Plugin

Kong is a popular API gateway we are proactively using. Sometimes we need to develop plugins to meet specific architecture/business needs.

再读黑客与画家

第一次读这本书竟然已经是五年前了,最近在推上看到有人提及,就又回去翻了一下。还是有很多新感受(或者说记起来很多已经忘了的点),在这里梳理一下。

配对交易简介

量化策略里有一大类叫做Pairs Trading-配对交易,是我觉得非常有趣的,其基本思路是寻找市场中表现相近的两个资产标的A和B, 当A涨得比较高的时候,卖出A买入B , 当A 跌的比较多的时候,买入A卖出B。这个思路很容易理解,因为如果两支股票确实相近,那么他们的价格有回归到相似的可能性,这也符合古老中国哲学里面“合久必分,分久必合”的朴素道理。

道理我们是都清楚的,甚至很多交易者也是模糊的按照这个思路来做的,比如当看到百事股价跟可口可乐股价偏离太远时,可能会考虑购进一些百事股票,卖出可口股票。问题是如何把这些模糊的想法进行量化分析,进而让算法捕捉到你看不到的机会,这主要需要解决两个问题:1. 如何发现符合要求的配对 2. 何时进场买卖 。 下面我们以QUANTAXIS为回测工具,以沪深市场为例来简要介绍下一个基本的配对交易策略是怎么进行的。

Kong Vs Goku

最近由于工作需要用到API网关做请求转发用,挑了目前人气较高的两款 Kong 和Goku 对比研究一下。

聊聊我喜欢的英国报刊

虽然现在已经进入了电子时代,但是在英国你还是能看到数量繁多的传统报刊,周末的时候到市中心总是习惯性走进WHS(一家连锁书刊文具店)然后在报刊栏停留很久。陈列的杂志报刊各种题材最新的事件一目了然,随便翻翻就很满足。所有这些报刊中,我有订阅的有三个,经济学人、金融时报和卫报,下面聊下我对这几份报刊的感觉。

持仓风险分析--要不要买特斯拉

声明:文中所述股票仅为分析举例之用,请独立作出投资决策。Quantopian 为免费分析平台,与本文无利益关系。

如果你有买股票,尤其是美股股票,今年不太可能没注意到特斯拉TSLA。特斯拉股票今年从低点涨了将近10倍,近两天股价大幅度回调,那么你应该去买进么?

如果你是“信仰投资者”, 认定了一龙马教主的神功,那么就不必往下看了,闭着眼买然后把炒股软件删掉。 我长期也是看好特斯拉的,但是凯恩斯大师曾说过:“长期来看,我们都死了。。。”, 所以短期还是要尽可能分析一下。本文试图从持仓风险分析的角度来探讨下要不要买进TSLA, 所用量化分析平台为Quantopian,所用语言为Python

The guide to predictive data analysis on MIMIC

Below is my teaching materials when I served as assistant teacher on Digital Health and data analysis at Reading University. The dataset I used for this course is MIMIC. If you are interested in healthcare data analysis, this might be what you want to check.