• Use vector in ThreadScope to Reduce the Memory Usage

    As described in the issue ThreadScope#29, the ThreadScope is really slow when loading a relatively huge eventlog file, and consumed an unacceptable volume of memory. High memory usage caused by using incorrect data structure is fairly common in many Haskell applications, thus at first glance, I focused on the internal data structure that ThreadScope uses when browsing the source code. I found that replacing List using Vector could bring a significant improvement.

  • 2018-08

  • Coupon Collector's Problem

    The coupon collector’s problem describes the following question: there are $n$ different types of coupons and the collector will receive a random coupon every time, what is the expected trials that the collector can collect all $n$ types of coupons? We can conclude that the expected trails grows as $\mathcal{O}(n\log{n})$.

  • 2017-09

  • Join in SQL

    join is a kind of SQL operation in relational algebra, combining columns cross tables.

  • 2017-08

  • Excluded Middle in Coq

    Excluded middle is an important theorem in classical logic. However in intuitionistic logic, the excluded middle theory doesn’t satisfy the constructive principle. The excluded middle law is provable in Coq and often confused with some other theorems in Coq.

  • 2017-05

  • CNN Meets Graphs

    Graph convolutional network is a kind of neural network that use graph data as input, developing a serials of Conv operator and Pooling theory based on graph theory, mainly the spectral graph theory.

  • 2016-12

  • Pattern Matching in List Comprehension

    After the | in list comprehension, pattern matching can be used to filter expected values.

  • 2016-10

  • 随机向量和概率统计

  • 矩母函数和特征函数

    概率论中,矩母函数(Moment-generating Function)和特征函数(Characteristic Function)是定义 概率分布函数的另一种形式。

  • DLL的初始化和退出处理

    将Haskell代码编译成动态链接库供其他语言调用时,需要调用hs_init函数初始化GHC的运行时环境,退出时 需要调用hs_exit函数来完成释放内存等清理工作1。如果把初始化和退出处理交给用户程序去做,不仅会给 用户程序代码带来额外的麻烦,而且错误的初始化和退出处理还会造成调用动态链接库时的错误。DLL本身的 处理化和退出清理机制可以很好地解决这一问题。

    1. https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ffi-chap.html#using-the-ffi-with-ghc 

  • 2016-09

  • 数学分析题目集锦


Subscribe via RSS