我需要带有源代码的简单modbus Java库.我在google上找到了但是有.jar文件并且没有强大的使用手册.任何人都可以使用手册或源代码向我推荐modbus库吗?
我使用Unity来管理我的应用服务器上的服务但由于某种原因我无法使用方法'GetAllInstances'来工作.奇怪的是,相同类型的'GetInstance'似乎工作正常!
这是配置:
<alias alias="IService" type="Atom.Server.Infrastructure.Interface.Service.IService, Atom.Server.Infrastructure.Interface"/>
<alias alias="IAtomCommandService" type="Atom.CommandServer.AtomCommandService.Interface.IAtomCommandService, Atom.CommandServer.AtomCommandService.Interface"/>
<alias alias="AtomCommandService" type="Atom.CommandServer.AtomCommandService.AtomCommandService, Atom.CommandServer.AtomCommandService"/>
<register type="IService" mapTo="AtomCommandService">
<lifetime type="Singleton"/>
</register>
<register type="IAtomCommandService" mapTo="AtomCommandService">
<lifetime type="Singleton"/>
</register>
Run Code Online (Sandbox Code Playgroud)
我的想法是,当服务器启动时,我需要能够获得所有已配置的IService实例来初始化它们.
IUnityContainer container = ConfigureUnityContainer();
UnityServiceLocator locator = new UnityServiceLocator(container);
var single = locator.GetInstance<IService>();
var all = locator.GetAllInstances<IService>().ToList();
Run Code Online (Sandbox Code Playgroud)
正如我所说,单曲作品,但得到的一切都没有回报.即使我从配置中删除IAtomCommandService映射并且只是拥有IService它仍然不起作用.关于我在哪里出错的任何想法?
在所有jquery示例中,我看到这种代码:
$('.menu a').each(function(){
$(this).animate({paddingLeft: $(this).width()}, 200);
});
Run Code Online (Sandbox Code Playgroud)
他们在这里做的是"动态"创建一个函数(被称为匿名委托?)
但是,如果我有一个现有的功能,想要访问$(this)呢?
假设我有这个功能:
function doAnimate(ctl){
//do something here
{
Run Code Online (Sandbox Code Playgroud)
我如何在jquery语句中使用该函数?
我问的原因是我想在更多的jquery语句中使用这个函数,我不想多次输入匿名委托.
我试过这个,但这给了我一个错误:
$("#<%=txtReceiverEmailEcard1.ClientID %>").blur(blurWatermark($(this), 'Your email address'));
Run Code Online (Sandbox Code Playgroud) function distance(r,t){
this.rate = r,
this.time = t,
this.calculate = function() {return rate * time ;};
return this;
}
var trip1 = distance(2,4);
var trip2 = distance(5,7);
var trip3 = distance(3,10);
document.write("<br>trip1: " + trip1.calculate());
document.write("<br>trip2: " + trip2.calculate());
document.write("<br>trip3: " + trip3.calculate());
Run Code Online (Sandbox Code Playgroud)
输出中
trip1: 30
trip2: 30
trip3: 30
Run Code Online (Sandbox Code Playgroud)
输出不应该是
trip1: 8
trip2: 35
trip3: 30
Run Code Online (Sandbox Code Playgroud) 我打算在一个小型的生产网站上使用SQL CE 4.0,我想知道SQL CE 4.0可以处理多少负载:
我正在寻找一个非传统文本搜索的文本搜索引擎,我想知道哪种工具(Lucene,Sphinx,Xapian或其他)最适合我,以及从哪里开始的指示.
我有分子表示为图(原子和键).我有办法枚举大小为k的所有子图.作为技术,输入是SMILES,输出是规范的SMARTS和每个子图/ SMARTS出现的次数.
例如,如果输入分子是" CCO ",那么规范结果是{"C":2,"O":1,"CC":1,"OC":1,"CCO":1}并且如果分子是" SCO ",则规范结果是{"C":1,"S":1,"O":1,"CS":1,"OC":1,"SCO":1}.这些都是很小的例子.对于真正的分子,我得到了大约500个"单词",看起来像"CC(C)O","CCCOCC","cn"和"cccc(c)O".
将分子视为特征字符串加上计数的集合意味着我应该能够使用文本搜索工具在文本级别进行比较,希望它们在化学级别上有意义.
举例来说,我可以使用余弦相似度或者tf-idf权重,并通过寻找类似的子模式找到类似的分子.通过上面的"CCO"和"SCO"示例,余弦相似度为(2*1 + 1*1 + 1*1)/ sqrt(2*2 + 1*1 + 1*1 + 1*1 + 1*1)/ sqrt(6*(1*1))= 4/sqrt(8*6)= 0.58.
再举一个例子,如果我想找到含有"CCS"亚结构的分子,那么我可以根据计数进行快速反向索引搜索(分子必须至少有2个"C",至少1个"CS",在解决NP子图的同构问题之前.也就是说,基于文本的方法可以充当过滤器以拒绝明显的不匹配.
我试图弄清楚存在的文本解决方案,但它有点令人生畏.我不需要停词,我不需要词干,我不在乎词序; 我不需要存在很多功能.我确实需要保留单词向量的能力,因为知道"C"是出现2次还是3次是很重要的.
哪个文本搜索引擎最适合我?它看起来像Lucene,特别是在Mahout的工作.您能否推荐一下文档的哪些部分或相关的教程?我发现的那些是用于全文搜索,具有词干和我不需要的其他功能.
我已经看到了operator()STL容器的使用,但它是什么,你什么时候使用它?
我有一个Qt应用程序需要加载到不同屏幕尺寸的移动设备上.如何使其自动调整到移动设备的屏幕大小?
在我的iPhone项目,我目前使用拷贝文件NSFileManager的-copyItemAtPath:toPath:error:方法.但是,文档没有说明原子性,所以如果我的应用程序试图读取当前被另一个线程替换的文件,我可能会遇到麻烦.有没有办法以原子方式复制或替换文件?我正在寻找类似NSData的东西-writeDataToFilr:atomically:.
假设我散列了密码并为其获取了哈希码.我需要找到密码和其哈希码之间的相似程度.请为我建议一些不同的机制
.net ×1
c++ ×1
cryptography ×1
file-io ×1
graph ×1
iphone ×1
java ×1
javascript ×1
jquery ×1
lucene ×1
mobile ×1
modbus ×1
objective-c ×1
python ×1
qt ×1
screen ×1
sphinx ×1
stl ×1
text-search ×1