问题列表 - 第37515页

搜索和替换整个项目(Netbeans)

有没有办法在netbeans中进行项目范围的搜索和替换?好像应该有,但我找不到任何关于它的信息.

谢谢

netbeans

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

如何在java中解析单词创建的特殊字符

我试图在java中解析一些word文档.一些值是像日期范围的东西,而不是像Startdate那样出现 - endDate我得到一些像这样的时髦字符

StartDate ?Çô EndDate
Run Code Online (Sandbox Code Playgroud)

这是单词放入特殊字符的地方.你可以搜索这些字符并用常规字符替换它们 - 或者字符串中的东西,这样我就可以对" - "进行标记,那个字符是什么 - ascii?unicode还是什么?

编辑添加一些代码:

 String projDateString = "08/2010 ?Çô Present"
                Charset charset = Charset.forName("Cp1252");
                CharsetDecoder decoder = charset.newDecoder();
                ByteBuffer buf = ByteBuffer.wrap(projDateString.getBytes("Cp1252"));
                CharBuffer cbuf = decoder.decode(buf); 
                String s = cbuf.toString();
                println ("S: " + s)

                println("projDatestring: " + projDateString)
Run Code Online (Sandbox Code Playgroud)

输出以下内容:

S: 08/2010 ?Çô Present
projDatestring: 08/2010 ?Çô Present
Run Code Online (Sandbox Code Playgroud)

另外,使用上面相同的projDateString,如果我这样做:

projDateString.replaceAll("\u0096", "\u2013");
projDateString.replaceAll("\u0097", "\u2014");
Run Code Online (Sandbox Code Playgroud)

然后打印出projDateString,它仍然打印为

projDatestring: 08/2010 ?Çô Present
Run Code Online (Sandbox Code Playgroud)

java regex parsing

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

如何实现假网络摄像头?

我想播放录制的电影作为我的网络摄像头?我怎么能这样做,我是Delphi程序员,有必要编写设备驱动程序吗?

我正在等待完成这项任务的想法.谢谢!

delphi webcam

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

调试在64位计算机上捕获的32位进程的转储

我最近收到了一个客户的64位崩溃转储.
我们的流程都是32位,但客户的机器正在运行x64 Server 2008.

Visual Studio(2008和2010 Express)告诉我,我必须使用64位版本MSVSMON.EXE,我不能,因为我没有64位机器.

我很确定在WinDbg中有一种方法可以做到这一点,但我发现WinDbg是敌对的.

有没有办法在32位机器上调试64位转储,最好是使用Visual Studio?

debugging 64-bit windbg crash-dumps visual-studio-2010

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

对未经身份验证的用户和AJAX调用的不同响应

我的ASP MVC(1.0)网站有一个默认的登录页面(基于OpenId - 但不应该有所不同).当AuthorizedAttribute在Action/Controller上时,它可以正常工作.

但是,我也有AJAX请求.以下是我对他们的看法:

if (Request.IsAjaxRequest())
{ 
  if (Request.IsAuthenticated)
  {
    // Authenticated Ajax request
  }
  else
  {
    // Non-authenticated Ajax request.
    Response.StatusCode = (int)HttpStatusCode.Unauthorized;
    return Json(new { response = "AUTHENTICATION_FAILED" });
   }
}
Run Code Online (Sandbox Code Playgroud)

问题是如果我将Response.StatusCode设置为Unauthorized,请求将被重定向到我的登录页面,这对Ajax请求不利.

对此问题的任何建议表示赞赏.

ajax asp.net-mvc

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

密码哈希的盐是否应该"哈希"?

我认为这可能是一个愚蠢的问题,但我已经对我应该做的最好的事情感到困惑.

在对密码哈希进行salting时,盐是否也应该被散列或保留为明文?

注意:我在SHA-256中散列密码,Salt是预定义的字符串,因为一次只能存储一个密码.

TIA

克里斯(Shamballa).

delphi security passwords

6
推荐指数
2
解决办法
572
查看次数

使用Django haystack MultiValueField迭代搜索结果视图中的项目

如果我的某个搜索索引上有MultiValueField,并且我想在搜索结果中显示每个值,我该怎么做?似乎某些东西没有被正确格式化,或者我在某种程度上误解了MultiValueField?

class PageAttachmentIndex(indexes.SearchIndex):
    # This should reference search/indexes/pages/pageattachment_text.txt
    text      = indexes.CharField(document=True, use_template=True)
    title     = indexes.CharField(model_attr='name')
    page      = indexes.IntegerField(model_attr='page_id')
    attrs     = indexes.MultiValueField()
    file      = indexes.CharField(model_attr='file')
    filesize  = indexes.IntegerField(model_attr='file__size')
    timestamp = indexes.DateTimeField(model_attr='timestamp')
    url       = indexes.CharField(model_attr='page')

    def prepare_attrs(self, obj):
        """ Prepare the attributes for any file attachments on the
            current page as specified in the M2M relationship. """
        # Add in attributes (assuming there's a M2M relationship to
        # attachment attributes on the model.) Note that this will NOT
        # get picked up …
Run Code Online (Sandbox Code Playgroud)

python django search django-haystack

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

如何使用PHP下载大文件(内存使用率低)

我必须使用PHP下载大文件(1xx MB).

我如何下载这个而不浪费内存(RAM)临时文件?

当我使用

$something=file_get_contents('http://somehost.example/file.zip');
file_put_contents($something,'myfile.zip');
Run Code Online (Sandbox Code Playgroud)

我需要有那么大的内存大小的文件.

也许可以使用任何其他方式下载它?

例如,在部分(例如1024b)中,写入磁盘,并下载另一部分重复,直到文件完全下载?

php file download

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

RegEx表达式将捕获包括多行块在内的两个字符之间的所有内容

我想捕获<%和%>之间的所有文本和文本块.

例如:

<html>
<head>
<title>Title Here</title>
</head>
<body>
<% include("/path/to/include") %>
<h1>Test Template</h1>
<p>Variable: <% print(second_var) %></p>
<%

variable = value;

foreach(params here)
{
    code here
}

%>
<p><a href="/" title="Home">Home</a></p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

我已经尝试了,\<\%(.*)\%\>但这将捕获包括<h1>Test Template</h1>块在内的所有内容.

regex

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

在后台线程上接收CLLocation更新

我正在尝试使用iPhone SDK实现(非并发)NSOperation以进行位置更新.NSOperation子类的"肉"是这样的:

- (void)start {
    // background thread set up by the NSOperationQueue
    assert(![NSThread isMainThread]);

    if ([self isCancelled]) {
        return;
    }

    self->locationManager = [[CLLocationManager alloc] init];
    locationManager.delegate = self;
    locationManager.desiredAccuracy = self->desiredAccuracy;
    locationManager.distanceFilter = self->filter;
    [locationManager startUpdatingLocation];

    [self willChangeValueForKey:@"isExecuting"];
    self->acquiringLocation = YES;
    [self didChangeValueForKey:@"isExecuting"];
}

- (void)cancel {
    if ( ! self->cancelled ) {
        [self willChangeValueForKey:@"isCancelled"];
        self->cancelled = YES;
        [self didChangeValueForKey:@"isCancelled"];

        [self stopUpdatingLocation];
    }
}

- (BOOL)isExecuting {
    return self->acquiringLocation == YES;
}

- (BOOL)isConcurrent {
    return NO;
}

- …
Run Code Online (Sandbox Code Playgroud)

iphone core-location cllocationmanager

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