小编Zia*_*hoy的帖子

Sed在Windows中创建不可删除的文件

我正在尝试在Windows Server 2003中运行以下命令,但是sed创建了一堆我无法从当前目录中的命令行删除的文件.

for /R %f in (*.*) do "C:\Program Files\gnuwin32\bin\sed.exe" -i "s/bad/good/g" "%f"

有没有人有什么建议?神奇的是,我可以使用Windows资源管理器删除文件.

根据要求,这里有一些示例文件名:

  • sed0E3WZJ
  • sed5miXwt
  • sed6fzFKh

而且,更多故障排除信息......

  • 它来自命令提示符和批处理文件
  • 如果我只需要在一个目录上运行sed,那么我就可以了sed "s/bad/good/g" *.*,一切正常.唉,我还需要它来处理所有的子目录.
  • 我只安装了Sed.
  • Sed正在创建文件

sed windows-server-2003

19
推荐指数
1
解决办法
8833
查看次数

使用jQuery获取有关事件源的信息

函数绑定到许多对象的事件.其中一个对象触发事件,jQuery启动.如何找出谁在JavaScript函数中解雇了事件?

我尝试过使用function [name](event){}和戳戳事件,但我得到"'数据'为空或不是对象".

这是我现在的代码:

<script type="text/javascript">
    $(document).ready(function() {
    $('.opening').bind("click", function(event) {
         //code to populate event.data since right now, the tags don't hold the info...they will eventually with an XHTML custom namespace
            event.data.building = "Student Center";
            event.data.room = "Pacific Ballroom A";
            event.data.s_time = "9/15/2009 8:00";
            event.data.e_time = "9/15/2009 10:00";

            indicatePreferenceByClick(event);
        });
    function indicatePreferenceByClick(event) {
        alert("I got clicked and all I got was this alert box.");
        $("#left").load("../ReserveSpace/PreferenceByClick", { building: event.data.building, room: event.data.room, s_time: event.data.s_time, e_time: event.data.e_time});
    };
</script>
Run Code Online (Sandbox Code Playgroud)

jquery jquery-events

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

如何让TestDriven.net使用NCover生成有用的代码覆盖率XML文件?

Repro的步骤:

  1. 在Windows 7 Ultimate 32位版本的VS 2010 Professional中创建一个C#项目.
  2. 使用VS C#单元测试向导编写一些单元测试
  3. 下载并安装最新的RTM或Beta版TestDriven.Net.
  4. 右键单击测试项目,然后选择Test with NCover
  5. 等待
  6. 看到NCover的窗口是空的

如何让TestDriven.net使用NCover生成有用的代码覆盖率XML文件?

到目前为止,我已尝试重新启动,卸载RTM版本并安装Beta版本,并在调试和发布模式下运行.

使用输出窗口文本更新:

------ Test started: Assembly: TestProject1.dll ------

NCover v1.5.8 - Code Coverage Analysis for .NET - http://ncover.com

NCover.Console v1.5.8 - Code Coverage Analysis for .NET - http://ncover.org
Copyright (c) 2004-2006 Peter Waldschmidt


Command: C:\Program Files\TestDriven.NET 3\ProcessInvocation86.exe
Command Args: "/assemblyName:TestDriven.TestRunner.Server, Version=3.2.2770.0, Culture=neutral, PublicKeyToken=50ecb853f8c6b8d2" "/xmlName:M:TestDriven.TestRunner.Coverage.NCoverCoverageTestRunner.OutOfProc.Run(System.String,System.String,System.String,System.String,System.String)" "/parameter:tcp://127.0.0.1:64445/7dbdb535-3602-4a8e-8bbc-f8be7eb83987" "/parameter:tcp://127.0.0.1:64445/fbff4f73-2438-43e4-b1f9-2bdaeb9c0907" "/parameter:C:\Users\Zian\Documents\Visual Studio 2010\Projects\ClassLibrary1\TestProject1\bin\Debug\TestProject1.dll" "/parameter" "/parameter"
Working Directory: 
Assemblies: ClassLibrary1;ClassLibrary1_Accessor;TestProject1
Coverage Xml: C:\Users\Zian\AppData\Local\Temp\Mutant Design\TestDriven.NET 2.0\Coverage\ClassLibrary1\TestProject1.xml
Coverage Log: Coverage.Log

Waiting …
Run Code Online (Sandbox Code Playgroud)

.net c# xml testdriven.net visual-studio-2010

13
推荐指数
1
解决办法
1769
查看次数

处理UI事件的最佳实践

我已经在OnCreate()上放置了UI事件的所有绑定代码.它使我的OnCreate()变得巨大.

在android中实现UI事件是否存在模式?我可以在View xml文件中添加方法,然后我可以将所有处理程序代码放在其他位置.

简而言之,我想我问我如何用android应用程序代码实现MVVM模式?

android event-driven-design android-layout

10
推荐指数
2
解决办法
3723
查看次数

如何让Eclipse使用NetBeans密钥绑定?

我知道可以通过从其他人导入文件或安装C++加载项来将Visual Studio键绑定到Eclipse中.有什么东西可以让我导入NetBeans密钥绑定吗?

eclipse netbeans

10
推荐指数
1
解决办法
1118
查看次数

配置ELMAH:无法识别的配置节错误

建立:

  • Windows XP
  • .NET Framework 3.5 SP1
  • ASP .NET MVC版本1

我一直在尝试按照http://code.google.com/p/elmah/wiki/MVC上的说明设置ELMAH,但按F5时出现以下错误:

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized configuration section elmah/errorlog.

Source Error: 


Line 30: 
Line 31:     <elmah>
Line 32:         <errorlog type="Elmah.XmlFilerErrorLog, Elmah" logPath="~/App_Data" />
Line 33:     </elmah>
Line 34:
Run Code Online (Sandbox Code Playgroud)

而且,这是配置文件:

<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc elmah

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

如何使用SQL以编程方式访问Windows Live照片库中的面部识别缓存?

我不是在谈论JPEG的XMP数据包中嵌入的"人物标签".我在谈论用于识别新面孔的面部数据库.

我想在我的程序中添加使用已经训练过的WLPG数据库识别人脸的选项.我设法使用API​​(类型库dll)来检测面,但要识别它们,它需要一个在同一API中不可用的Exemplar Cache对象.我可以创建自己的对象,但我想使用已有的对象来避免对用户进行重复培训.

我知道数据库位于"%localappdata%\ Local\Microsoft\Windows Live Photo Gallery"中,并且它是SQL Server Compact Edition 3.1格式.我用Visual Studio 2010打开了数据库,但是我更喜欢在不直接访问数据库的情况下阅读它,而且我没有看到导出该功能的DLL.

顺便说一下,我正在使用Delphi 2010.

有任何想法吗?

delphi api windows-live face-recognition photo-gallery

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

因子时间算法和P/NP

很容易看到n!比N几乎任何东西都要慢得多(比如说,100 ^ N),所以,如果一个问题被认为是NP完全而且一个发生在一个!算法近似解决方案,人们会做史努比舞蹈.

我有两个关于这种情况的问题:

  1. 请问!算法被认为是多项式时间的解?因子肯定似乎不是一个提升到权力的术语.
  2. 如果找到了!解决方案意味着我们有一个相当快的算法,因为n!增长快于2 ^ N,这是否意味着一些NP完全问题不需要启发式/近似算法(除了模糊的情况)?

当然,这两个问题依赖于第一段是真的; 如果我错了,请告诉我.

algorithm np-complete

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

为什么LINQ中的Union函数不能删除重复的条目?

我正在使用VB .NET,我知道Union通常使用ByRef但是在VB中,字符串通常被处理为好像它们是原始数据类型.

因此,这是问题所在:

Sub Main()
    Dim firstFile, secondFile As String(), resultingFile As New StringBuilder

    firstFile = My.Computer.FileSystem.ReadAllText(My.Computer.FileSystem.SpecialDirectories.Desktop & "\1.txt").Split(vbNewLine)
    secondFile = My.Computer.FileSystem.ReadAllText(My.Computer.FileSystem.SpecialDirectories.Desktop & "\2.txt").Split(vbNewLine)

    For Each line As String In firstFile.Union(secondFile)
        resultingFile.AppendLine(line)
    Next

    My.Computer.FileSystem.WriteAllText(My.Computer.FileSystem.SpecialDirectories.Desktop & "\merged.txt", resultingFile.ToString, True)
End Sub
Run Code Online (Sandbox Code Playgroud)

1.txt包含:
a
b
c
d
e

2.txt包含:
b
c
d
e
f
g
h
i
j

运行代码后,我得到:
a
b
c
d
e
b
f
g
h
i
j

任何使联盟功能都像数学对应的建议?

linq vb.net union

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

什么是DB2的Varchar(Max)等价物?

在DB2中,是否有一种数据类型允许字符串像SQL Server数据库中的Varchar(Max)数据类型一样动态增长和缩小?

sql sql-server db2 varchar

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