鉴于为词性标记了一组单词,我想找到那些在主流英语中猥亵的词.我怎么能这样做?我应该制作一个庞大的列表,并检查列表中是否存在任何内容?我应该尝试使用正则表达式来捕获单个根上的一堆变体吗?
如果它更容易,我不想过滤掉,只是为了得到一个计数.因此,如果有一些误报,那就不是世界末日,只要有一个或多或少均匀过度夸大的比率.
有没有人知道一个英语动词变形器,我可以用动词词汇(现在分词),可以给我其他动词形式的动词?
例如:
I give it I get
========= ======================================
run ran, running, runs
sing sang, singing, sings
play played, playing, plays
Run Code Online (Sandbox Code Playgroud) 我正在尝试训练前馈网络,以便使用Ruby Library AI4R执行XOR操作.但是,当我在训练后评估XOR时.我没有得到正确的输出.有没有人之前使用过这个库并得到它来学习XOR操作.
我正在使用两个输入神经元,一个隐藏层中的三个神经元,以及一个用于输出的层,因为我之前看到过这样的预先计算的XOR前馈神经网络.
require "rubygems"
require "ai4r"
# Create the network with:
# 2 inputs
# 1 hidden layer with 3 neurons
# 1 outputs
net = Ai4r::NeuralNetwork::Backpropagation.new([2, 3, 1])
example = [[0,0],[0,1],[1,0],[1,1]]
result = [[0],[1],[1],[0]]
# Train the network
400.times do |i|
j = i % result.length
puts net.train(example[j], result[j])
end
# Use it: Evaluate data with the trained network
puts "evaluate 0,0: #{net.eval([0,0])}" # => evaluate 0,0: 0.507531383375123
puts "evaluate 0,1: #{net.eval([0,1])}" # => evaluate 0,1: 0.491957823618629 …Run Code Online (Sandbox Code Playgroud) ruby artificial-intelligence machine-learning neural-network
我需要为注册到网站的用户提供5级层次结构.每个用户都被另一个用户邀请,我需要知道用户的所有后代.也是用户的祖先.
我想到了2个解决方案.
ancestor_id descendant_id distance
1 1 0
2 2 0
3 3 0
4 4 0
5 5 0
6 6 0
2 3 1
Run Code Online (Sandbox Code Playgroud)
user_id ancestor_level1_id ancestor_level2_id ancestor_level3_id ancestor_level4_id ancestor_level5_id
10 9 7 4 3 2
9 7 4 3 2 1
Run Code Online (Sandbox Code Playgroud)
这些好主意吗?
我知道"邻接列表模型"和"修改后的预订树遍历算法",但这些是"推荐"系统的良好解决方案吗?
我需要在这棵树上执行的查询是:
我正在做大学项目。那样,他们想要一个真实的证明。为此,我计划传递TextBox字符串进行报告。
我用谷歌搜索在winform中传递参数。然后我逐步进行了此过程。我实现了。
步:
1:在Visual Studio 2010中,打开.rdlc文件,然后打开“报表数据”窗口(如果看不到此窗口,请转到“视图”菜单将其打开);
2:右键单击“参数”节点,并添加新的参数,即:将其命名为“ content”;
3:在您的.rdlc文件中,添加一个名为tbContent的文本框,并将其字段express设置为:
= Parameters!content.Value
4:转到包含您的reporterview控件的Form文件,然后添加以下代码:
Run Code Online (Sandbox Code Playgroud)this.reportViewer1.LocalReport.ReportEmbeddedResource=“ TestReport.Report1.rdlc”;ReportParameter rp = new ReportParameter(“ content”,this.textBox1.Text); this.reportViewer1.LocalReport.SetParameters(new ReportParameter [] {rp}); this.reportViewer1.RefreshReport();
5:然后可以将参数从表单上的文本框传递到.rdlc文件;
我添加了using Microsoft.Reporting.WinForms;程序集参考。
this.reportViewer1.LocalReport.ReportEmbeddedResource = "Report1.rdlc";
ReportParameter rp = new ReportParameter("content", this.textBox1.Text);
this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp });
this.reportViewer1.RefreshReport();
Run Code Online (Sandbox Code Playgroud)
但这引发了异常:
在
this.reportViewer1.LocalReport.SetParameters(new ReportParameter [] {rp}); 处未处理本地处理异常。线。
这是剪贴板中的完整错误:
Microsoft.Reporting.WinForms.LocalProcessingException was unhandled
Message=An error occurred during local report processing.
Source=Microsoft.ReportViewer.WinForms
StackTrace:
at Microsoft.Reporting.WinForms.LocalReport.EnsureExecutionSession()
at Microsoft.Reporting.WinForms.LocalReport.SetParameters(IEnumerable`1 parameters)
at Report.Form1.Form1_Load(Object sender, EventArgs e) in D:\Jagadeeswaran\Project\Report\Report\Form1.cs:line 38 …Run Code Online (Sandbox Code Playgroud) 在我的代码中的某个时刻,我想在A上调用C方法.这可能吗?我提出的一个修复是从A - > C转换,但这似乎有点多余.
注意:
谢谢 ...
我刚刚升级到rails 3,但在升级之前运行了ruby 1.9.1.Rails 3不支持Ruby 1.9.1.我怎样才能降级到ruby 1.8.7?
我有以下查询我必须与之交谈的链接服务器。
选择 * 从
OPENQUERY(DWH_LINK, 'SELECT * FROM TABLEA ')
它通常会返回大部分数据,但缺少某些行?
链接服务器来自 oracle 客户端
这是有人在使用 openquery 时遇到过的问题吗?
我正在尝试延迟为C++/CLI应用程序加载我的依赖.dll,以便我可以测试它们的存在并警告用户而不是崩溃.
我已经尝试将dll添加到MyProject-> Properties-> ConfigurationProperties-> Linker-> Input-> Delay Loaded DLLS ...但是这只是给了我一个警告,它没有引用它们:
5> LINK:警告LNK4199:/DELAYLOAD:Util.dll被忽略; 没有从Util.dll找到导入
如果我删除.dll并运行应用程序它会崩溃,并希望向microsoft发送有关丢失的.dll的信息,因此它看起来仍然在尝试在启动时加载所有模块并因此适合.
仅供参考,我的app启动看起来像这样:
using namespace System;
using namespace System::Collections::ObjectModel;
using namespace Microsoft::Win32;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
try
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// First make sure we have all the .dlls we need
ArrayList^ missingDlls = gcnew ArrayList();
Assembly^ assembly = Assembly::GetEntryAssembly();
array<System::Reflection::AssemblyName^>^ referencedAssemblies = assembly->GetReferencedAssemblies();
for each(System::Reflection::AssemblyName^ referencedAssemblyName in referencedAssemblies)
{
try
{
Assembly^ a = …Run Code Online (Sandbox Code Playgroud) 我已经安装了rails和mysql.我也安装了mysql2 gem.我通过命令rails创建了一个rails应用程序new try_cms -d mysql它已成功创建.但是当我尝试使用rails server命令运行WEBrick服务器时,我收到以下错误.
/Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.16.dylib (LoadError)
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
from /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2.rb:7
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:68:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:66:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:66:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:55:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler/runtime.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.9/lib/bundler.rb:114:in `require'
from /Users/dilippednekar/Sites/try_cms/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:28:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:28
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27
from script/rails:6:in `require'
from script/rails:6
Run Code Online (Sandbox Code Playgroud)
提前致谢.