摘要: given a 2-d matrix with 0 or 1 values largest square of all 1's dynamic programming, dp[i][j] = 1 + min{dp[i-1][j], dp[i][j-1], dp[i-1][j-1]} if m[i][ 阅读全文
posted @ 2017-05-07 17:14 qsort 阅读(357) 评论(0) 推荐(1) 编辑
摘要: ```lisp (require 'cl) (require 'package) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (add-to-list 'package-archives '("gnu" . "http://elpa.g... 阅读全文
posted @ 2017-04-08 21:00 qsort 阅读(394) 评论(0) 推荐(0) 编辑
摘要: "JVM endianness StackOverflow topic" to summarize JVM class file is big endian; JVM multi byte instructions are big endian; gives you endianness of un 阅读全文
posted @ 2017-02-05 00:34 qsort 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Facebook Architecture "Quora article" a relatively old "presentation on facebook architecture" "another InfoQ presentation" on Facebook architecture / 阅读全文
posted @ 2017-01-09 23:55 qsort 阅读(524) 评论(0) 推荐(0) 编辑
摘要: https://lwn.net/Articles/691932/ https://gcc.gnu.org/wiki/FunctionMultiVersioning why multi versioning This aim of this project is to make it really e 阅读全文
posted @ 2016-12-20 22:34 qsort 阅读(286) 评论(0) 推荐(0) 编辑
摘要: see "Spare Matrix wikipedia item" , and scipy's documentation on different "choices of sparse matrix type" sparse matrix storage, only store non zero 阅读全文
posted @ 2016-12-04 20:22 qsort 阅读(493) 评论(0) 推荐(0) 编辑
摘要: Pseudo Random Nubmer Sampling https://en.wikipedia.org/wiki/Inverse\_transform\_sampling given a distribution's cumulative distribution function (CDF) 阅读全文
posted @ 2016-11-27 22:35 qsort 阅读(334) 评论(0) 推荐(0) 编辑
摘要: http://www.1point3acres.com/bbs/thread-212960-1-1.html 第二轮白人小哥,一开始问了一道至今不懂的问题,好像是给一个vector<uint8_t> nums, 然后又给一个256位的vector<int> counts,遍历nums,然后count 阅读全文
posted @ 2016-11-23 18:28 qsort 阅读(321) 评论(0) 推荐(0) 编辑
摘要: sorted matrix ( Young Matrix ) search for a given value in the matrix: 1) starting from upper-right corner, turn left or turn down, O(n+m) 2) if it's 阅读全文
posted @ 2016-11-08 23:46 qsort 阅读(211) 评论(0) 推荐(0) 编辑
摘要: Maximal Subarray Sum : O(n) scan-and-update dynamic programming, https://en.wikipedia.org/wiki/Maximum_subarray_problem, https://leetcode.com/problems 阅读全文
posted @ 2016-11-07 00:59 qsort 阅读(360) 评论(0) 推荐(0) 编辑
摘要: randomly choose a sample of k items from a list S containing n elements, the algorithm may be online (i.e. the input list is unknown beforehand) https 阅读全文
posted @ 2016-10-27 23:21 qsort 阅读(232) 评论(0) 推荐(0) 编辑
摘要: Instagram: http://instagram-engineering.tumblr.com/post/10853187575/sharding-ids-at-instagram Flickr: http://code.flickr.net/2010/02/08/ticket-servers 阅读全文
posted @ 2016-10-10 22:14 qsort 阅读(633) 评论(0) 推荐(0) 编辑
摘要: https://www.hiredintech.com/classrooms/system-design/lesson/72 user's browser / mobile App => Load Balancer => AppSrv1, AppSrv2, AppSrv3, ... => DB Lo 阅读全文
posted @ 2016-10-10 21:24 qsort 阅读(175) 评论(0) 推荐(0) 编辑
摘要: http://www.tuicool.com/articles/miuq63E http://www.guokr.com/blog/475765/ http://songwie.com/articlelist/44 https://www.youtube.com/watch?v=5yDO-tmIoX 阅读全文
posted @ 2016-10-10 00:18 qsort 阅读(338) 评论(0) 推荐(0) 编辑
摘要: https://youtu.be/-W9F__D3oY4 Storage PATA, SATA, SAS (15,000 rpm), SSD, RAID0 : striping, double throughput / size, no redundancy; RAID1 : mirror; RAI 阅读全文
posted @ 2016-10-09 16:15 qsort 阅读(373) 评论(0) 推荐(0) 编辑
摘要: http://highscalability.com/blog/2011/6/27/tripadvisor-architecture-40m-visitors-200m-dynamic-page-view.html request URL is parsed, content collected f 阅读全文
posted @ 2016-10-09 16:14 qsort 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Use Cases 1, shortening : take a URL => return a much shorter URL 2, redirection : take a short URL => redirect to the original URL 3, custom URL : ht 阅读全文
posted @ 2016-10-05 21:45 qsort 阅读(417) 评论(0) 推荐(0) 编辑
摘要: if the computation in a thread needs a larger Java Virtual Machine stack than is permitted, the Java Virtual Machine throws a StackOverflowError; if J 阅读全文
posted @ 2016-08-26 22:46 qsort 阅读(291) 评论(0) 推荐(0) 编辑
摘要: db2ilist - list instancesdb2 attach to user using // this will attach to the instance as the specified user.db2 create database feedb automatic st... 阅读全文
posted @ 2015-12-13 14:31 qsort 阅读(357) 评论(0) 推荐(0) 编辑
摘要: modified fromhttps://github.com/flyingmachine/emacs-for-clojure;;;;;; Packages;;;;;; Define package repositories(require 'package)(add-to-list 'packag... 阅读全文
posted @ 2015-04-25 16:50 qsort 阅读(555) 评论(0) 推荐(0) 编辑
摘要: decompile the application fileapktool d -o dianping/ dianping.apkmodify the resources / smali assembly codes as you wish.diff -bur 51buy/smali/ 51buy_... 阅读全文
posted @ 2014-12-26 18:33 qsort 阅读(305) 评论(0) 推荐(0) 编辑
摘要: user@user-desk ~/Downloads/largetrd$ file -i LT_Largetrd.csvLT_Largetrd.csv: text/plain; charset=utf-16le 阅读全文
posted @ 2014-12-06 15:12 qsort 阅读(173) 评论(0) 推荐(0) 编辑
摘要: http://clang.llvm.org/docs/InternalsManual.html#the-qualtype-classthe QualType class is designed to be an efficient value class which contains a poi... 阅读全文
posted @ 2014-10-19 14:29 qsort 阅读(828) 评论(0) 推荐(0) 编辑
摘要: Transactional memory in Clojure is implemented using Multiversion Concurrency Control protocolhttp://en.wikipedia.org/wiki/Transactional_memoryhttp:/... 阅读全文
posted @ 2014-06-08 18:24 qsort 阅读(275) 评论(0) 推荐(0) 编辑
摘要: before this, confirm that you don't have 32bit libs notably 32bit libc, e.g. you have/lib64/ld-linux-x86-64.so.2but not/lib32/ld-linux.so.2https://wik... 阅读全文
posted @ 2014-04-27 23:09 qsort 阅读(1265) 评论(0) 推荐(0) 编辑
摘要: http://en.wikipedia.org/wiki/Hash_listIncomputer science, ahash listis typically alistofhashesof the data blocks in a file or set of filesAn important use of hash lists is to make sure that data blocks received from other peers in apeer-to-peer networkare received undamaged and unaltered, and to che 阅读全文
posted @ 2014-01-25 16:30 qsort 阅读(369) 评论(0) 推荐(0) 编辑
摘要: K-S test, test for the equality of continuous, one-dimensional probability distribution that can be used to compare a sample with a reference probability distribution, or to compare two samples.paper:Unobservable Re-authentication for Smartphoneshttp://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirno 阅读全文
posted @ 2013-12-30 14:04 qsort 阅读(477) 评论(0) 推荐(0) 编辑
摘要: in intel x86 instruction set, "jmp $" means jump to this instruction location, thus falling into an infinite loop.https://defuse.ca/online-x86-assembler.htm#disassemblythe instruction is "0xfeeb".Based on this instruction, we can create possibly the shortest C program that can co 阅读全文
posted @ 2013-10-13 21:14 qsort 阅读(1047) 评论(0) 推荐(0) 编辑
摘要: SGI explanation:http://www.sgi.com/tech/stl/stack.htmlOne might wonder why pop() returns void, instead of value_type. That is, why must one use top() and pop() to examine and remove the top element, instead of combining the two in a single member function? In fact, there is a good reason for this de 阅读全文
posted @ 2013-07-21 15:24 qsort 阅读(477) 评论(0) 推荐(0) 编辑
摘要: -frandom-seed=string This option provides a seed that GCC uses when it would otherwise use random numbers. It is used to generate certain symbol names that have to be different in every compiled file. It is also used to place unique stamps in coverage data files and the object files... 阅读全文
posted @ 2013-07-20 17:20 qsort 阅读(1070) 评论(0) 推荐(0) 编辑
摘要: glpk,http://en.wikipedia.org/wiki/GNU_Linear_Programming_Kit一个最简单的例子 1 /* decision variables */ 2 3 var x1 >= 0; 4 var x2 >= 0; 5 var x3 >= 0; 6 var x4 >= 0; 7 8 /* objective function */ 9 minimize result: x1 + x2 + x3 + x4;10 11 /* constraints */12 a: -2*x1 + 8*x2 + 0*x3 + 10*x4 >= 5 阅读全文
posted @ 2013-06-13 23:02 qsort 阅读(261) 评论(0) 推荐(0) 编辑
摘要: windows cmd执行python的时候似乎有一些处理是依赖于cmd的编码的,这导致了一些处理中文内容文件时出现问题。更改编码(code page):chcp不带参数,查看codepage;chcp nnn(如936),更改codepage到对应代码的codepage。 阅读全文
posted @ 2013-04-19 23:47 qsort 阅读(266) 评论(0) 推荐(0) 编辑
摘要: http://www.denisbauer.com/NETTools/FileDisassembler.aspxdisassemble a .net dll to a visual studio project.for more info,http://blog.justinholton.com/post/How-to-Decompile-a-dot-NET-DLL-into-a-Visual-Studio-project.aspx 阅读全文
posted @ 2013-02-07 14:29 qsort 阅读(273) 评论(0) 推荐(0) 编辑
摘要: http request headers are typically parsed by the web server as a hash table. If the technology in use has a deterministic hashing scheme, it's vulnerable to hash collision based DOS attack.No matter how we choose our hash function, it's always possible to devise a set of keys that will hash 阅读全文
posted @ 2013-01-13 23:49 qsort 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 需要的包:wireless-tools、wpasupplicant,安装以后会有对应的hook脚本挂到/etc/network/对应的目录下面,比如if-pre-up.dinterfaces文件里面加上对应的配置auto wlan0iface wlan0 inet staticwpa-ssid ChinaNet-xxxxwpa-psk my-secret-password# static IP settingsaddress 192.168.1.188netmask 255.255.255.0gateway 192.168.1.1dns-nameserver 192.168... 阅读全文
posted @ 2012-12-27 11:54 qsort 阅读(227) 评论(0) 推荐(0) 编辑
摘要: nrefactory:http://wiki.sharpdevelop.net/NRefactory.ashxNRefactory is used by SharpDevelop & MonoDevelop for code navigation etc. NRefactory 5 is a complete rewrite of NRefactory 4 and is used by MonoDevelop 3.a tutorial on nrefactory:http://www.codeproject.com/Articles/408663/Using-NRefactory-fo 阅读全文
posted @ 2012-09-08 17:50 qsort 阅读(1023) 评论(1) 推荐(0) 编辑
摘要: View Code %token STRING%token RIGHT_APPEND%%cmd: fg_cmd | bg_cmd ;bg_cmd: fg_cmd '&' ;fg_cmd: simple_cmd | pipe_cmd ;simple_cmd: /* empty command */ | executable | executable input_redirection | input_redirection executable ... 阅读全文
posted @ 2012-04-25 22:53 qsort 阅读(247) 评论(0) 推荐(0) 编辑
摘要: ORM是Object Relational Mapping的缩写,目的在于解决object-orient programming与relational database之间的不一致(所谓Object-relational impedance mismatch,impedance-阻抗这个词,用的很形象)。这种不一致产生的原因很容易理解,两边是两个不同的domain,各自的模型都不尽相同,更多参见wiki页面。实现ORM的两种思路:Data Mapper Pattern与Active Record Pattern。Active Record Pattern是一种从RDBMS的模型出发,将其反应在 阅读全文
posted @ 2012-02-24 21:31 qsort 阅读(481) 评论(0) 推荐(0) 编辑
摘要: 某本书扫描得到的图片,每个大约8MB,tif格式,想做成一个pdf,方便携带。基本过程:先用imagemagick所带的convert,来转变为pdf;然后用pdftk将这些单页pdf合并,得到最终的pdf文件。convert时,得到的pdf比较大,convert resize又烦,而且似乎压缩太小以后图像质量不太好。尝试首先转换为jpg,结果效果非常好,真是不错。命令:for file in *.tif do convert $file ${file/%tif/jpg}; done;for file in *.jpg do convert $file ${file/%jpg/pdf}; do 阅读全文
posted @ 2012-02-18 15:39 qsort 阅读(1503) 评论(0) 推荐(0) 编辑
摘要: 1NF的要求:1,各行没有顺序关系;2,各列也没有顺序关系;3,不允许重复的行;4,不允许null的列。因此,实际上是要求:1,要有unique key;2,不允许nullable属性。当然这里的unique key可以是一个attribute,也可以是一个superkey。如果一个relation满足1NF,则所有的attribute自然为一个superkeysuper-key是区分各个行的attribute的集合,minimal super-key称作一个candidate key所有的candidate key中,一般声明一个为primary key。2NF首先是1NF,之后,要求每一个 阅读全文
posted @ 2011-11-22 18:39 qsort 阅读(2038) 评论(0) 推荐(0) 编辑