Question
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).
For example, the 32-bit integer ’11' has binary representation 00000000000000000000000000001011, so the function should return 3.
解说
这道题的意思是统计32位整数二进制格式下的‘1’的个数。
more
Solution
rig继续阅读 »
机器环境
Windows:Win7 64 bit
Java:java version "1.8.0_45";Java HotSpot(TM) 64-Bit Server VM
Solr:5.5
Lucene:5.5
Tomcat:8.0.32
Lucene和Solr下载地址:http://lucene.apache.org/
Windows选择下载zip压缩包,Linux选择下载tgz压缩包
Tomcat下载地址:http://tomcat.apache.org/ ,选择Binary Distributions下的Core中的64-bit Windows zip (pgp, md5, sha1)下载之后文件名称是:apache-继续阅读 »
这里收藏工作中用到的脚本,也为了防止做重复的搜索工作,同时分享给大家。
more
查看当前表的自增序列
mysql
SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'DatabaseName' AND TABLE_NAME = 'TableName';
修改自增序列
mysql
alter table tablename auto_increment=NUMBER;
查看binlog
mysql
show binary logs;
查看binlog位置
mysql
show binlog events in继续阅读 »