calculate hamming distance and weight in sqlite -


Is there a good way to calculate the distance and weight of hamming in the sequel? It supports bit-rate operators, but I want to order the weight based on the hammer, and there is no support for the breakout in the software.

To be more elaborate, suppose I have those lines: 1011 1000 1100 0011 and 1 line (1011) given, I have the last line (0011) I would like to get in the form, which is a maximum of 1s if you and they have.

In my case the number will be about 650 points long, and I have around 3500 rows.

I have found this solution that works with the tapes of text, but I like some other optimal choice:

  create table teas (x blob); Enter the TS value ('00010'); ... Select X & amp; '10011', length (x and amp; 10011 ',' 0 ',' ')) weight by TS;  

SQLite does not have any one that can directly help it.

In SQLite 3.8.3 or later, you can use a recursive to calculate matches by hand:

  create table T (X ); Insert T Value ('1011'), ('1000'), ('1100'), ('0011'); All select mails (with substrokes (rest, 1, 1) = '1' and substrate (pattern, x, x, '1011', x), in the form of comparison (matches, comfort, pattern, origin) 1, 1) = '1'), substroke (rest, 2), substrate (pattern, 2), compare WHERE from original! = '') Select match, match WHERE rest = '' ORDER to original DESC; 3 | 1011 2 | 0011 1. 1000 1 1100  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -