小编Rob*_*obs的帖子

如果string是数字,则vba将字符串转换为int

我需要将从excel获得的字符串转换为整数.为此,我使用CInt(),效果很好.但是,字符串可能不是数字,在这种情况下我需要将整数设置为0.目前我有:

If oXLSheet2.Cells(4, 6).Value <> "example string" Then
  currentLoad = CInt(oXLSheet2.Cells(4, 6).Value)
Else
  currentLoad = 0
End If
Run Code Online (Sandbox Code Playgroud)

问题是我无法预测可能在此单元格中的所有可能的非数字字符串.有没有办法可以告诉它转换如果它是一个整数,如果没有则设置为0?

excel vba excel-vba

59
推荐指数
3
解决办法
60万
查看次数

如何将SVN 1.4.4(r25188)升级到SVN 1.6

我们如何将SVN从1.4.4版升级到1.6版?

我以为我们可以使用以下命令行,但它在我们的版本中不存在:

svnadmin upgrade
Run Code Online (Sandbox Code Playgroud)

SVN正在Windows Server环境中运行.我们正在运行SVN Server版本:svnadmin,版本1.4.4(r25188)编译2007-06-08T18:49:42.

svn

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

重构命名空间后,"/'应用程序中的服务器错误.序列不包含任何元素"

我在App_Start文件夹中使用MVC 4和Ninject 3与NinjectWebCommon.

我的Global.asax.cs是MvcApplication:HttpApplication

我收到下面的错误,因为Ninject开始两次 - 为什么?

Server Error in '/' Application.

Sequence contains no elements

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Sequence contains no elements

Source Error: 


Line 50:             kernelInstance = createKernelCallback();
Line 51: 
Line 52:             kernelInstance.Components.GetAll<INinjectHttpApplicationPlugin>().Map(c => c.Start());
Line 53:             kernelInstance.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
Line 54:             kernelInstance.Inject(this);

Source File: c:\Projects\Ninject\Ninject.Web.Common\src\Ninject.Web.Common\Bootstrapper.cs    Line: 52 

Stack …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc ninject asp.net-mvc-4

9
推荐指数
1
解决办法
6896
查看次数

错误:无法锁定配置文件 C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied

我想运行这个 Git 命令:

git submodule add https://github.com/example/example.git
Run Code Online (Sandbox Code Playgroud)

但我收到此错误:

克隆到“C:/projects/xxx/yyy/zzz/”...致命:无法访问“ https://github.com/xxx/yyy.git/ ”:错误设置证书验证位置:
CAfile:C: \Program Files (x86)\git\bin\curl-ca-bundle.crt
CApath:无
致命:将“ https://github.com/xxx/yyy.git ”克隆到子模块路径“C:/projects/xxx” /yyy/zzz/example' 失败

所以,为了解决这个问题,我试图运行这个命令:

git config --system http.sslcainfo "C:\Program Files (x86)\git\bin\curl-ca-bundle.crt"
Run Code Online (Sandbox Code Playgroud)

但我收到此错误消息:

错误:无法锁定配置文件 C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied

我怎样才能解决这个问题?

git

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

如何将WebDev.WebServer.exe安装为独立应用程序?

如何将Visual Studio的Web开发服务器(WebDev.WebServer.exe)安装为Standlone应用程序?

这样我们的Web设计人员就可以从SVN获取最新代码,然后运行MSBuild批处理文件来构建代码,然后运行批处理文件以使用Web Development Server的本地副本(WebDev.WebServer.exe)启动代码.

注:我希望有他们所有的机器安装Visual Studio.

编辑:我已按照下面的建议完成,我收到此错误:

错误应用程序WebDev.WebServer.EXE,版本9.0.30729.1,时间戳0x488f1aa2,错误模块KERNEL32.dll,版本6.0.6001.18215,时间戳0x49953395,异常代码0xe0434f4d,错误偏移0x000442eb,进程ID 0x%9,应用程序启动时间0x %10.

webdev.webserver visual-studio

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

单元测试Mvc.Compare属性错误地返回模型isValid = true

TryValidateObjectCompare在单元测试时,似乎没有使用模型验证属性.

我知道ModelState.IsValid = true,当我知道它时false(单元测试时).

我有这个示例模型:

public class CompareTestModel
{
    public string Password { get; set; }

    [System.Web.Mvc.Compare(
         "Password",
          ErrorMessage = "The passwords do not match")]
    public string PasswordCompare { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

在单元测试时使用此辅助方法验证模型:

using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

public static class ModelHelper
{
    public static void ValidateModel(
         this Controller controller,
         object viewModel)
    {
        controller.ModelState.Clear();

        var validationContext = new ValidationContext(viewModel, null, null);
        var validationResults = new List<ValidationResult>();

        Validator.TryValidateObject(
            viewModel,
            validationContext,
            validationResults,
            true);

        foreach …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc unit-testing asp.net-mvc-4

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

如何将List <Company>转换为List <ICompany>

我想转换List<Company>List<ICompany>

ICompany是一个Company实现的接口.

public List<ICompany> FindAll()
{
    List<Company> companies = new List<Company>();

    var query = from c in _scope.Extent<Company>()
                select c;

    companies = query.ToList();

    return companies.ToList<ICompany>(); // doesn't work
    //and
    return companies.ToList(); // doesn't work
}
Run Code Online (Sandbox Code Playgroud)

有什么想法吗?

.net c# linq generics collections

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

使用全局程序集缓存提高速度

如果我有一个1000个asp.net网站,每个网站的/ bin文件夹中有30个DLL.

因此有30,000个DLL.

如果我将一组DLL注册到全局程序集缓存中并且每个站点都在GAC中使用DLL,那么网站/ Web服务器/机器会运行得更快吗?

例如,网站会集体使用更少的内存吗?

dll assemblies gac isolation

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

寻找RegEx查找和替换Visual Studio插件

我正在寻找一个Visual Studio插件,它执行标准的正则表达式查找和替换,而不是正则表达式的Microsoft Visual Studio版本

因为你没有得到完整的语法

请帮忙?

谢谢

c# regex add-in replace visual-studio-2008

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

请解释Redis Pub/Sub Wire协议示例

在这个Redis Pub/Sub主题中

它说:

" subscribe:表示我们成功订阅了作为回复中第二个元素的通道.第三个参数表示我们当前订阅的频道数."

然后它给出了这个有线协议示例:

SUBSCRIBE first second
*3
$9
subscribe
$5
first
:1
*3
$9
subscribe
$6
second
:2
Run Code Online (Sandbox Code Playgroud)

像*3和$ 9这样的线条是什么意思?

redis

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

如何从文档和窗口中删除JavaScript touch事件处理程序?

我有一个显示FullCalendar日历的网页

日历将托管在公共Salesforce社区页面中.

我希望能够使用touch和通过移动设备在日历中创建活动drag.

Salesforce Communities和FullCalendar都支持移动设备.

FullCalendar有触控支持

但是当我使用移动设备访问社区页面时,我无法使用touchdrag创建日历条目.

touch通过Salesforce的社区页面/框架创建的事件处理程序:

  • documentfor touchstarttouchendandtouchcancel
  • window 对于 touchmove

这似乎覆盖了FullCalendar touch事件.

以下是调试的示例日历:

我怎样才能删除touch的事件处理程序documentwindow

我试过添加:

    document.addEventListener("touchstart", function (event) {
        event.preventDefault();
        console.log("touchstart: event.preventDefault()");
    }, false);

    document.addEventListener("touchend", function (event) {
        event.preventDefault();
        console.log("touchend: event.preventDefault()");
    }, false);

    document.addEventListener("touchcancel", function (event) {
        event.preventDefault();
        console.log("touchcancel: event.preventDefault()");
    }, false);

    window.addEventListener("touchmove", function (event) {
        event.preventDefault();
        console.log("touchmove: …
Run Code Online (Sandbox Code Playgroud)

javascript event-listener touch fullcalendar removeeventlistener

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