问题列表 - 第32490页

扭曲:失败与错误

什么时候应该使用一个twisted.python.failure.Failure,当我应该使用类似twisted.internet.error.ConnectionDone?或者我应该这样做twisted.python.failure.Failure(twisted.internet.error.ConnectionDone),如果是的话,在什么情况下我应该这样做?

python exception-handling exception twisted

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

从批处理文件中获取错误代码

我有一个运行几个可执行文件的批处理文件,我希望它在成功时退出,但如果退出代码<> 0则停止.我该怎么办?

windows batch-file exit-code

37
推荐指数
3
解决办法
5万
查看次数

搜索子字符串的字符串

我需要搜索一个特定子字符串的大字符串.子字符串将从一开始,Testing=但双引号内的所有内容都可能不同,因为它是用户登录.

所以我需要的子串的例子是

Testing="network\smithj"  
Run Code Online (Sandbox Code Playgroud)

要么

Testing="network\rodgersm"  
Run Code Online (Sandbox Code Playgroud)

我的要求有意义吗?我怎么能在C#中做到这一点?

c# regex

4
推荐指数
2
解决办法
7470
查看次数

Android将样式应用于自定义TextView

我有一个TextViewStyled类,它扩展了TextView

在我的主题XML中,如何将样式应用于具有所选主题的活动上的所有TextViewStyled小部件?

我有这个简单的主题,但我想将Black Gold样式限制为TextViewStyled Widgets,而不在TextViewStyled样式属性中指定Black Gold.这是将动态切换的众多主题之一:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MyThemeOneofMany" parent="android:Theme.NoTitleBar.Fullscreen">
    <item name="android:???????????">@style/TextViewStyled_Black_Gold</item>
    </style>

    <style name="TextViewStyled_Black_Gold" parent="@android:style/Widget.TextView">            
          <item name="android:background">#1E1921</item>        
          <item name="android:textColor">#A85E4F</item>
          <item name="android:textColorLink">#FFBC4F</item>
          <item name="android:textStyle">normal</item>               
      </style>


</resources>
Run Code Online (Sandbox Code Playgroud)

android themes textview

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

在IIS下增加.NET Remoting应用程序上的并发请求

我们有一个在IIS7下以单呼叫模式运行的.NET 2.0远程服务器.它有两个API,比如说:

  1. DoLongRunningCalculation() - 有很多数据库请求,可能需要很长时间才能执行.
  2. HelloWorld() - 只返回"Hello World".

我们试图在最糟糕的情况下通过两次API调用随机轰击它来测试远程服务器(在Windows 7机器上),并发现如果超过10个客户端请求,HelloWorld响应(通常小于0.1)秒)开始花费更长时间,持续很长时间.我们的目标是我们不希望长时间运行的远程调用阻止短时间运行的呼叫.如果我们有20个客户端线程在运行,那么这是ASP.NET v2.0.50727的性能计数器:

  1. 请求排队:0
  2. 请求执行:(最多:10)
  3. 工作进程运行:0
  4. 管道实例模式:(最大:10)
  5. 应用程序队列中的请求数:0

根据Thomas的博客,我们已经尝试在注册表中将maxConcurrentRequestsPerCPU设置为"5000":IIS 7.0和6.0上的ASP.NET线程使用情况但它没有帮助.根据以上数据,似乎并发请求的数量停留在10.

所以,问题是:

  1. 我们如何增加并发请求?主要目标是我们不希望长时间运行的远程调用阻止短时间运行的呼叫.
  2. 为什么Max Requests Executing总是停留在10?

提前致谢.

performance remoting iis-7 multithreading

5
推荐指数
1
解决办法
1298
查看次数

启动Windows服务时出现TypeInitializationException,因为无法创建config部分

启动Windows服务时,我在特定的Windows Server 2008 R2计算机上遇到了一个奇怪的错误(它适用于其他2008 R2计算机).该服务使用Common.Logginglog4net.但是,在此特定计算机上,无法创建Common.Logging的配置节处理程序.

它使用以下堆栈跟踪失败(格式化以获得更好的可读性).最令我惊讶的是SecurityException.是什么导致这个?

有人有线索吗?

System.TypeInitializationException: The type initializer for
    'MyWindowsService.Program' threw an exception.
--->
Common.Logging.ConfigurationException: Failed obtaining configuration for
    Common.Logging from configuration section 'common/logging'.
--->
System.Configuration.ConfigurationErrorsException: An error occurred creating
    the configuration section handler for common/logging: Request failed.
    (C:\Path\MyWindowsService.exe.Config line 7)
--->
System.Security.SecurityException: Request failed.
at System.RuntimeTypeHandle.CreateInstance(
    RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached,
    RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis,
    Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly,
    Boolean skipVisibilityChecks, …
Run Code Online (Sandbox Code Playgroud)

.net c# security configuration securityexception

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

我可以将Spring的@RequestMapping和BeanNameUrlHandlerMapping相互结合使用来将URL映射到方法吗?

我想要做的是有一个公共的Service类,它有各种方法,如"search""retriveByID"等.理想情况下,这个类将使用服务参数并填充请求对象并交给相应的数据源处理程序.

我想根据被搜索的域对象将服务类实例化为具有不同请求处理程序的Spring bean.然后使用bean BeanNameUrlHandlerMapping根据URL调用不同的Service类.

<bean name="/sequence/*" class="org.dfci.cccb.services.SearchServiceImpl">
    <property name="searchHandler">
     ....
Run Code Online (Sandbox Code Playgroud)

我的问题是,当我尝试这样做时,我不能使用方法级别的RequestMapping注释来选择服务类的适当方法.

@RequestMapping("*/search/")
QueryResult search(...
Run Code Online (Sandbox Code Playgroud)

或者可以通过bean定义注入注释值吗?

更新 还有关于此主题的Springsource文章:http: //blog.springsource.com/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc /

spring spring-mvc url-mapping

5
推荐指数
1
解决办法
1347
查看次数

获取R脚本的路径

有没有办法以编程方式在脚本本身内找到R脚本的路径?

我问这个是因为我有几个脚本使用RGtk2并从.glade文件加载GUI.

在这些脚本中,我不得不setwd("path/to/the/script")在开头放置一条指令,否则将找不到.glade文件(位于同一目录中).

这很好,但如果我将脚本移动到另一个目录或另一台计算机,我必须更改路径.我知道,这不是什么大问题,但有一些东西会很好:

setwd(getScriptPath())

那么,是否存在类似的功能?

r path

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

如何在程序启动时将我的MainForm设置为隐藏?

我正在使用Borland c ++ builder.我有一个应用程序,我希望隐藏主窗体,直到在不同的窗体上按下按钮.我已将mainform上的Visible值设置为false,但在运行程序时它仍会显示.谁知道该怎么办?

vcl c++builder

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

UIAlertView带有iPhone中的两个按钮

我正在尝试按下按钮时显示警报视图,因此我编写了如下代码:

- (IBAction)signUpComplete: (id)sender {
  UIAlertView* alert_view = [[UIAlertView alloc]
      initWithTitle: @"test" message: @"test" delegate: nil cancelButtonTitle: @"cancel" otherButtonTitles: @"OK"];
  [alert_view show];
  [alert_view release];
}
Run Code Online (Sandbox Code Playgroud)

但是这个代码在initWithTitle方法中遇到以下异常崩溃:

2010-08-11 03:03:18.697 Polaris [1155:207]*** - [UIButton copyWithZone:]:无法识别的选择器发送到实例0x176af0
2010-08-11 03:03:18.700 Polaris [1155:207]***由于未捕获的异常而终止应用程序

0x176af0与参数'sender'的值相同,后者是其动作处理程序为signUpComplete的按钮:我认为问题是otherButtonTitles:参数,因为它与参数nil一起工作正常.因此创建"确定"按钮时出现问题.我的代码有什么问题吗?

谢谢!

iphone cocoa-touch uialertview ios

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