摘要: 在数学上,双线性插值是有两个变量的插值函数的线性插值扩展,其核心思想是在两个方向分别进行一次线性插值。如果选择一个坐标系统使得 的四个已知点坐标分别为 (0, 0)、(0, 1)、(1, 0) 和 (1, 1),那么插值公式就可以化简为: 用矩阵运算来表示的话就是: 图像的空间变换,也称几何变换或几 阅读全文
posted @ 2018-07-05 13:36 飘舞的雪 阅读(5758) 评论(0) 推荐(0) 编辑
摘要: 在多线程环境中,有些事仅需要执行一次。通常当初始化应用程序时,可以比较容易地将其放在main函数中。但当你写一个库时,就不能在main里面初始化了,你可以用静态初始化,但使用一次初始化(pthread_once)会比较容易些。int pthread_once(pthread_once_t *once 阅读全文
posted @ 2018-06-11 10:18 飘舞的雪 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 一. 引子 在多线程环境中,经常会有一些计数操作,用来统计线上服务的一些qps、平均延时、error等。为了完成这些统计,可以实现一个多线程环境下的计数器类库,方便记录和查看用户程序中的各类数值。在实现这个计数器类库时,可以利用thread local存储来避免cache bouncing,从而提高 阅读全文
posted @ 2018-03-15 17:26 飘舞的雪 阅读(26990) 评论(0) 推荐(3) 编辑
摘要: 转自http://blog.csdn.net/universe_hao/article/details/52640321 shell 提取文件名和目录名 在写shell脚本中,经常会有需要对路径和文件名做处理。有时候犯不着用sed命令来操作。bash提供的变量操作和一些外部命令都能很好的处理。 一、 阅读全文
posted @ 2018-01-09 16:37 飘舞的雪 阅读(4704) 评论(0) 推荐(0) 编辑
摘要: 本文摘录整编了一些理论介绍,推导了word2vec中的数学原理,理论部分大量参考《word2vec中的数学原理详解》。 背景 语言模型 在统计自然语言处理中,语言模型指的是计算一个句子的概率模型。 传统的语言模型中词的表示是原始的、面向字符串的。两个语义相似的词的字符串可能完全不同,比如“番茄”和“ 阅读全文
posted @ 2017-12-28 13:54 飘舞的雪 阅读(1776) 评论(0) 推荐(0) 编辑
摘要: 以下转自http://blog.csdn.net/luotuo44/article/details/42773231 memcached源码中assoc.c文件里面的代码是构造一个哈希表。memcached快的一个原因是使用了哈希表。现在就来看一下memcached是怎么使用哈希表的。 哈希结构: 阅读全文
posted @ 2017-12-25 09:57 飘舞的雪 阅读(655) 评论(0) 推荐(0) 编辑
摘要: 描述: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k th 阅读全文
posted @ 2017-12-18 10:20 飘舞的雪 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 描述: Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Y 阅读全文
posted @ 2017-12-15 10:09 飘舞的雪 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 描述: Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After 阅读全文
posted @ 2017-12-15 09:40 飘舞的雪 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 转自:https://www.61mon.com/index.php/archives/222/ 一. 背景 跳跃表(英文名:Skip List),于 1990 年 William Pugh 发明,是一个可以在有序元素中实现快速查询的数据结构,其插入,查找,删除操作的平均效率都为 O(logn)。 阅读全文
posted @ 2017-12-14 14:47 飘舞的雪 阅读(430) 评论(0) 推荐(0) 编辑