继续阅读TI Designs:TIDA-01469 采用无线振动传感器并支持预防性维护的电机监控参考设计
TI Designs:TIDA-01469 采用无线振动传感器并支持预防性维护的电机监控参考设计
继续阅读TI Designs:TIDA-01469 采用无线振动传感器并支持预防性维护的电机监控参考设计
定点浮点数
如果 m & (m - 1) == 0,则m是2的n次方
1 2 3 |
public static boolean isPower2(int i){ return (i > 0) && ((i & (i - 1)) == 0); } |
卡尔曼滤波原论文 A New Approach to Linear Filtering and Prediction Problems
继续阅读卡尔曼滤波原论文 A New Approach to Linear Filtering and Prediction Problems
继续阅读“GrabCut” — Interactive Foreground Extraction using Iterated Gr aph Cuts
Understanding the Basis of the Kalman Filter
继续阅读Understanding the Basis of the Kalman Filter Via a Simple and Intuitive Derivation
最近Facebook AI
实验室开源了相似性搜索库Faiss
。
Faiss
是用于有效的相似性搜索(similarity search
)和稠密矢量聚类(clustering of dense vectors
)的库。它包含了可在任何大小向量集合里进行搜索的算法,向量集合的大小甚至可达到RAM
容纳不下的地步。另外,它还包含了用于评估和参数调优的支持代码。Faiss
用C++
编写,有Python/numpy
的完整包装。其中最有用的一些算法则在GPU
上实现。
机器上没有安装HomeBrew
的,请参考让Mac也能拥有apt-get类似的功能——Brew。
下面,我们介绍一下如何在macOS Sierra (10.12.3)
上编译Faiss
。
1.下载Faiss
源代码
1 |
$ git clone https://github.com/facebookresearch/faiss.git |
2.安装编译需要的工具
1 |
$ brew install llvm |
3.修改调整源代码,准备编译
1 2 |
$ cd faiss $ cp example_makefiles/makefile.inc.Mac.brew makefile.inc |
4.编译
1 |
$ make all |
5.执行测试用例
1 2 3 4 |
#需要手工指定动态库的搜索路径,否则会提示“dyld: Library not loaded: @rpath/libomp.dylib”,导致进程无法启动 $ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/opt/llvm/lib/ $ ./tests/demo_ivfpq_indexing |
其余的示例,参考源代码中的INSTALL
文件中的内容即可。
作者:July 。致谢:pluskid、白石、JerryLead。
说明:本文最初写于2012年6月,而后不断反反复复修改&优化,修改次数达上百次,最后修改于2016年11月。
声明:本文于2012年便早已附上所有参考链接,并注明是篇“学习笔记”,且写明具体参考了pluskid等人的文章。文末2013年的PDF是为证。
动笔写这个支持向量机(support vector machine)是费了不少劲和困难的,原因很简单,一者这个东西本身就并不好懂,要深入学习和研究下去需花费不少时间和精力,二者这个东西也不好讲清楚,尽管网上已经有朋友写得不错了(见文末参考链接),但在描述数学公式的时候还是显得不够。得益于同学白石的数学证明,我还是想尝试写一下,希望本文在兼顾通俗易懂的基础上,真真正正能足以成为一篇完整概括和介绍支持向量机的导论性的文章。
本文在写的过程中,参考了不少资料,包括《支持向量机导论》、《统计学习方法》及网友pluskid的支持向量机系列等等,于此,还是一篇学习笔记,只是加入了自己的理解和总结,有任何不妥之处,还望海涵。全文宏观上整体认识支持向量机的概念和用处,微观上深究部分定理的来龙去脉,证明及原理细节,力保逻辑清晰 & 通俗易懂。
同时,阅读本文时建议大家尽量使用chrome等浏览器,如此公式才能更好的显示,再者,阅读时可拿张纸和笔出来,把本文所有定理.公式都亲自推导一遍或者直接打印下来(可直接打印网页版或本文文末附的PDF)在文稿上演算,从而享受随时随地思考、演算的极致快感。
1. 4-way handshake sequence
2. Key Heirarchy
The EAPOL encryption key is the middle 128 bits of the PTK value.
And the first 128 bits of the PTK (KCK), is used in the computation(and validation) of the EAPOL frame MIC field value (4way handshake Message 1/2).
3. EAPOL Frame format
4 Key Data Format
Key data may be zero or more InformationElement(s) (such as the RSN information element), and zero or more key dataencapsulation(s) (KDEs) (such as GTK(s)).
4.1 RSN Information
4.2 GTK
If theEncrypted Key Data subfield (of the Key Information field) is set, the entireKey Data field shall be encrypted. If the Key Data field uses the NIST AES keywrap, then the Key Data field shall be padded before encrypting if the key datalength is less than 16 octets or if it is not a multiple of 8. The paddingconsists of appending a single octet 0xdd followed by zero or more 0x00 octets.When processing a received EAPOL-Key message, the receiver shall ignore thistrailing padding. Key Data fields that are encrypted but do not containthe GroupKey or STAKey KDE, shall be accepted.
If the GroupKey or STAKey KDE is included in the Key Data field but theKey data field is not encrypted the EAPOL-Key frames shall be ignored.
5. Sample 4-way Handshake
5.1 Message 1
The Authenticator sends an EAPOL-Key frame containing an ANonce.
Key data is zero.
5.2 Message 2
The Supplicant derives a PTK from ANonce and SNonce.
The Supplicant sends an EAPOL-Key frame containing SNonce, the RSN information element
from the Association Request frame and a MIC.
MIC is the KCK (The first 128 bits in the PTK).
Key data is RSN Information.
802.1X authentication, CCMP pairwise dna group cipher suites.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
30, // information element id 14, // length 01 00, // Version 1 00 0F AC 04, // CCMP as group cipher suite 01 00, // pairwise cipher suite count 00 0F AC 04, // CCMP as pairwise cipher suite 01 00, // authentication count 00 0F AC 02, // authentication type is PSK 08 00, // PSK replay counter |
5.3 Message 3
The Authenticator derives PTK from ANonce and SNonce and validates the MIC in the EAPOL Key frame
The Authenticator sends an EAPOL-Key frame containing ANonce, the RSN from its Beacon or Probe
Response messages, MIC whether to install the temporal keys, and the encapsulated GTK
Should the MIC data be same with the one in Message 2 ?!
Key data is RSN Information + GTK, and the data is encapsulated by using of the AES algrithm with the KEK(The middle 128 bits in PTK).
5.4 Message 4
To be added.
原始链接 http://blog.csdn.net/stevenliyong/article/details/6599528
在编译OpenSSL前,需要正确安装Perl,因为在编译OpenSSL时需要使用到该程序。
下载最新版本的Perl:http://downloads.activestate.com/ActivePerl/releases/5.20.1.2000/ActivePerl-5.20.1.2000-MSWin32-x64-298557.msi。然后安装之。
Windows 一定要使用 ActivePerl 主要是由于换行跟Linux ,Unix 的不同,如果使用其他的Perl生成的MakeFile 文件,会导致NMake无法正常的编译。
另外,一定要确保ActivePerl在系统的PATH 环境变量中在最前面,并且在命令行中执行 PATH命令的输出是跟环境变量中是一致的,Windows中有时候会发生刚刚添加的环境变量不能及时更新到命令行界面的问题,即使是你已经重新打开新的命令行窗口了。
下载最新版本的OpenSSL:http://www.openssl.org/source/openssl-1.0.1j.tar.gz
一定要使用最新的OpenSSL,早期的版本有Heartbleed的BUG,另外一定要是新下载并且刚刚解压缩出来的,没有修改过的文件,有时候,某些不经意的修改会导致编译不成功。
然后将源码释放的c:\openssl-1.0.1j目录中。
进入openssl源码目录。
1 |
cd c:\openssl-1.0.1j |
以下为参照该目录下的文件INSTALL.W32的执行过程:
运行configure:
1 |
perl Configure VC-WIN32 --prefix=c:/openssl |
创建Makefile文件:
1 |
ms\do_ms |
此处建议执行 do_ms ,有时候执行do_nasm会不正常,尽管文档中说执行 do_nasm
编译动态库:
1 |
nmake -f ms\ntdll.mak |
编译静态库:
1 |
nmake -f ms\nt.mak |
测试动态库:
1 |
nmake -f ms\ntdll.mak test |
测试静态库:
1 |
nmake -f ms\nt.mak test |
安装动态库:
1 |
nmake -f ms\ntdll.mak install |
安装静态库:
1 |
nmake -f ms\nt.mak install |
清除上次动态库的编译,以便重新编译:
1 |
nmake -f ms\ntdll.mak clean |
清除上次静态库的编译,以便重新编译:
1 |
nmake -f ms\nt.mak clean |