DONG Yuxuan's Homepage

Programming is an alias of thinking.

Writings

Subscribe by RSS or Atom.

使用Celery提高Python Web程序的可用性与响应速度
Nov 07, 2020 CST

当Web程序中某请求耗时过长时,会显著降低程序的响应速度甚至是可用性。异步任务队列是解决此类问题的通用技术之一。

Parallelly Applying a Function to an Iterable with Multiple Processes in Python
Sep 16, 2020 CST

Usages, traps, workarounds, and practices of multiprocessing.Pool.imap.

c2w: Convert Any CLI Program to a Web Service
Jun 13, 2020 CST

Many experienced hackers have great ideas about the technology like a cool algorithm. However, they don’t like to work on the code they think is trivial, for example, making the algorithm a Web service or writing a GUI for it. This will increase the threshold to enjoy the result and make less people understand their work, thus I wrote the c2w utility to convert any CLI program to a web service.

Design Web Pages for Both Screens and Papers
May 13, 2020 CST

Web pages can be temporary. To permanently save valuable documents, people may print your web pages to PDF files or papers. However, most web pages don’t consider what they should look like while be printed. CSS provides the @media print selector to customize styles on papers. We should make use of it to have good reading experience for both screens and papers.

The Effect of Pipe Capacity on Unix Pipeline Performance
Feb 25, 2020 CST

Depending on how two processes exchange data, we need different pipe capacities to maximize performance.

Tips on MacPorts
Feb 03, 2020 CST

MacPorts is the package manager I’m using in macOS. Personally I prefer it than Homebrew. But it also has some flaws so I give some tips about them for MacPorts beginners.

Some Differences between macOS and Common Unix Systems
Feb 01, 2020 CST

Discuss some differences between macOS and common Unix systems to help Unix users get familiar with macOS sooner.

File Systems: An Application Programmer's Perspective
Sep 30, 2019 CST

A highly abstract guide to the file system of Liunx for application programmers, ignoring many difficult details.

Removing What Seam Carving Found
Aug 21, 2019 CST

An algorithm to remove both vertical and horizontal curves found by the seam carving algorithm from an image.

KVDiff: Compare Two Large Text Files by Key Columns
Jun 29, 2019 CST

An algorithm to compare two text files by key columns without loading the whole file into the memory.

Handling Errors in Flask API Services
Apr 13, 2019 CST

Nowadays most modern web applications are developed as SPAs. The server provides only the API which is often in the JSON format instead of rendering HTML. Flask as a great Python web framework can also be used to build the API service but its infrastructures for handling errors are designed for traditional web sites thus we need a usage pattern to make building API services using Flask more convenient.

从动态规划出发设计贪心算法
Feb 19, 2017 CST

先设计一个动态规划算法,再优化成贪心算法。这样可以降低设计贪心算法过程中对技巧性和直觉的依赖。

scanf系列函数的安全使用
Sep 18, 2016 CST

在不牺牲可维护性的前提下安全使用scanf系列函数的实践

C语言函数原型声明: 从K&R C到C99
Jun 03, 2016 CST

C语言函数声明考古报告

Trie上的动态规划:编辑距离与最长公共子序列的批量计算
Nov 16, 2015 CST

计算给定单词与词典中所有单词的编辑距离与最长公共子序列

USACO Section3.3 Camelot 解题报告
Jul 28, 2015 CST

网上充满了对这个问题的错误解法,我想我需要给出一个正确的解法,并解释为什么网上常见的解法是错误的。