问题列表 - 第41323页

MCR和.NET不兼容

我正在尝试编译使用.NET模块的Matlab(R2010b)应用程序,但我遇到了MCR和.NET模块之间不兼容的问题:

  • .NET模块使用Visual Studio 2010编译.
  • MCR配置为使用Visual Studio 2010.
  • 该应用程序还包含一些使用Visual Studio 2010构建的Mex文件,它们在Matlab和MCR中都可以正常工作.

如果我从Matlab cli加载程序集一切正常,但是一旦我编译应用程序并从cmd.exe运行它,就会抛出一个错误,指出程序集是使用比当前加载的运行时更新的运行时构建的.我认为Matlab R2010b是用Visual Studio 2008构建的,并且相信这就是问题,但我想知道是否有人能解决这个问题?

.net matlab matlab-deployment matlab-compiler

8
推荐指数
1
解决办法
2312
查看次数

期待JavaScript对象中正确的调用上下文(this)

考虑一下:

window.onload = function () {
    myObj.init();
};

var myObj = {
    init: function () {
        console.log("init: Let's call the callMe method...");

        //callMe is not defined...
        callMe();

        //Works fine!
        this.callMe();
    },

    callMe: function () {
        console.log('callMe');
    }
};
Run Code Online (Sandbox Code Playgroud)

由于init函数以这种方式调用(myObj.init),我希望this在init函数中成为myObj.如果是这种情况,为什么callMe功能失败?如何在callMe不使用init主体中的this上下文的情况下调用该函数?(实际上,this通过函数反复调用对象方法太烦人了.那么拥有单个对象有什么意义呢?)

我想知道如何解决这个问题,以便使用上面代码中的第一个调用来调用callMe方法?

javascript scope this

4
推荐指数
1
解决办法
660
查看次数

嵌套集索引和性能

我在理解在嵌套集模型上使用什么索引时遇到了一些麻烦.查询是:

SELECT `node`.`id`,(COUNT(parent.id) - 1) AS `depth`,`name` FROM `categories` AS `parent` 
INNER JOIN `categories` AS `node` ON (`node`.`lft` BETWEEN parent.lft AND parent.rgt)
INNER JOIN `filebank_categories` ON (`node`.`id` = `filebank_categories`.`category_id` AND `filebank_categories`.`filebank_id` = 136)
INNER JOIN `categories_names` ON (`categories_names`.`category_id` = `node`.`id` AND `categories_names`.`language_id` = 1) 
WHERE `node`.`system_id` = parent.system_id 
GROUP BY node.id 
ORDER BY `node`.`lft` ASC
Run Code Online (Sandbox Code Playgroud)

这个查询需要大约350毫秒,大约有5000行categories.EXPLAIN给出了这个:

1   SIMPLE  filebank_categories     ref     fk_filebank_categories_categories1,filebank_id          filebank_id 5   const                               474 Using where; Using temporary; Using filesort
1   SIMPLE  node                    eq_ref  PRIMARY,lft,category,cat,lft,rgt,system,id,lft,system   PRIMARY     4 …

mysql query-optimization nested-sets

2
推荐指数
1
解决办法
1966
查看次数

缓存与分页

所以我在计算机体系结构课程中,我想我很难区分缓存和页面.

我能想到的唯一解释是,页面是操作系统欺骗程序的方式,它在指定的内存区域中完成所有工作,而高速缓存是硬件从操作系统读取操作系统的方式.记忆的区域,当它真的不是.

操作系统是否指向需要"新页面"的硬件,或者由os尝试读取当前缓存"页面"的"超出范围"的地址(由于缺少更好的术语) .

我是在正确的轨道还是我完全疯了?

paging caching operating-system terminology

7
推荐指数
1
解决办法
9015
查看次数

在android活动之间传递字符串数组

我在First Activity中有2个String数组 - A,现在我需要将两个数组都传递给second_activity - B,我该怎么做?

我知道IntentAndroid中的那种概念并且已经将单个变量值传递给另一个活动,但是我没有实现在活动之间传递字符串数组的概念,我已经在网上浏览了相同的内容.

请告诉我可能的解决方案.

android

26
推荐指数
2
解决办法
5万
查看次数

有没有办法在iText(Java版本)中将矩形绘制到PdfPCell中?

我找到了一些关于如何在iText中绘制表单的教程,但是我需要将它插入到单元格中,我不知道如何.感谢您对此事的考虑.

java itext

2
推荐指数
1
解决办法
7633
查看次数

如何在android中停止ASyncTask线程

can anybody have any idea how to stop ASyncTask thread in android?.
Run Code Online (Sandbox Code Playgroud)

实际上我有一个创建线程并执行它们的循环.当这个循环结束时,我想停止所有运行的线程.无论如何要停止线程?

非常感谢.

multithreading android android-asynctask

20
推荐指数
1
解决办法
3万
查看次数

检查一个整数是否是另一个整数幂

这是一个采访问题:"给定2个整数x和y,检查x是否是y的整数幂"(例如,对于x = 8和y = 2,答案是"真",对于x = 10和y = 2 "假").

明显的解决方案是:

int n = y; while(n < x) n *= y; return n == x
Run Code Online (Sandbox Code Playgroud)

现在我在考虑如何改进它.

当然,我可以检查一些特殊情况:比如他们xy应该是奇数或偶数,也就是说,我们可以检查的至少显著位xy.但是我想知道我是否可以改进核心算法本身.

algorithm math

29
推荐指数
3
解决办法
2万
查看次数

如何创建从httpget获取相同参数的httppost?

我有一个控制器来显示一个模型(用户),并希望创建一个屏幕只需一个按钮来激活.我不想要表格中的字段.我已经在网址中有了id.我怎么能做到这一点?

asp.net-mvc http-get http-post c#-4.0 asp.net-mvc-2

7
推荐指数
2
解决办法
7977
查看次数

使用RSpec获取未初始化的常量错误.不知道是什么导致了它

我正在使用RSpec进行测试,当我周五下午离开工作时,我的测试正在通过.但当我回家并同步我的存储库时,我的笔记本电脑上的测试失败了.现在回到工作岗位,测试仍然失败.不要相信它的代码,因为运行rspec本身会返回一个错误,spork甚至不会启动.当我尝试启动Spork时,收到以下错误消息:

Using RSpec
Loading Spork.prefork block...
uninitialized constant ActionView::Template::Handlers::ERB::ENCODING_FLAG (NameError)
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-core-2.2.1/lib/rspec/core/backward_compatibility.rb:20:in `const_missing'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/template/handlers/erb.rb:85:in `<class:ERB>'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/template/handlers/erb.rb:70:in `<module:Handlers>'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/template/handlers/erb.rb:28:in `<class:Template>'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/template/handlers/erb.rb:27:in `<module:ActionView>'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/template/handlers/erb.rb:6:in `<top (required)>'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/template/handlers.rb:10:in `extended'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/template.rb:99:in `extend'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/template.rb:99:in `<class:Template>'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/template.rb:8:in `<module:ActionView>'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/template.rb:6:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/template/resolver.rb:3:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/actionpack-3.0.3/lib/action_view/testing/resolvers.rb:1:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-rails-2.2.1/lib/rspec/rails/view_rendering.rb:1:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/rspec-rails-2.2.1/lib/rspec/rails.rb:9:in `<top (required)>'
<internal:lib/rubygems/custom_require>:33:in `require'
<internal:lib/rubygems/custom_require>:33:in `rescue in require'
<internal:lib/rubygems/custom_require>:29:in `require'
/home/jeff/Projects/Rails/vahsfbhistory/spec/spec_helper.rb:10:in `block in <top (required)>'
/home/jeff/.rvm/gems/ruby-1.9.2-p0@rails3tutorial/gems/spork-0.8.4/lib/spork.rb:23:in `prefork'
/home/jeff/Projects/Rails/vahsfbhistory/spec/spec_helper.rb:5:in `<top (required)>' …
Run Code Online (Sandbox Code Playgroud)

rspec ruby-on-rails spork

23
推荐指数
2
解决办法
8603
查看次数