问题列表 - 第13483页

Predicate <T>在.NET 3.0+中不可用

Predicate可以在.NET的任何地方使用吗?从MSDN http://msdn.microsoft.com/en-us/library/bfcke1bz.aspx,我在任何地方都看不到谓词.我看到一个匿名者返回一个布尔值但没有泛型或"Predicate"关键字.

.net generics predicate .net-3.5

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

Memcache最大密钥到期时间

什么是memcached的最大密钥到期时间?

如果我没有提供到期时间并且缓存已满,那么会发生什么?

memcached

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

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

在Delphi-2010中不推荐使用TThread.resume应该使用什么?

在我的多线程应用程序中

我使用TThread.suspendTThread.resume

自从将我的应用程序移至Delphi 2010后,我收到以下交战消息

[DCC警告] xxx.pas(277):不推荐使用W1000符号'Resume'

如果弃用Resume应该使用什么?

编辑1:

我使用Resume命令启动线程 - 因为它创建时将'CreateSuspended'设置为True并在终止线程之前挂起.

编辑2:

这是delphi 2010手册的链接

delphi delphi-2010

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

MVC与敏捷有争执吗?

敏捷强调快速迭代而不浪费计划.

MVC强调基于计划架构的关注点分离.

由于非MVC技术需要较少的规划,它们是否更适合敏捷项目?

model-view-controller agile

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

sprintf()疯了

我需要一些帮助,因为它让我的C程序感到困惑

我有2个字符串(基数和路径)

BASE: /home/steve/cps730
PATH: /page2.html
Run Code Online (Sandbox Code Playgroud)

这就是printf在我调用sprintf将它们的内容连接在一起之前读取的方式.这是代码块

        int memory_alloc = strlen(filepath)+1;
        memory_alloc += strlen(BASE_DIR)+1;
        printf("\n\nAlloc: %d",memory_alloc);
        char *input = (char*)malloc(memory_alloc+9000);
        printf("\n\nBASE: %s\nPATH: %s\n\n",BASE_DIR,filepath);
        sprintf(input, "%s%s",BASE_DIR,filepath); //   :(

        printf("\n\nPATH: %s\n\n",input);
Run Code Online (Sandbox Code Playgroud)

现在,您能解释一下最终的printf语句是如何返回的

PATH: e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/stev
Run Code Online (Sandbox Code Playgroud)

因为它根本不理解它.

**我在malloc语句中添加了9000以防止程序崩溃(因为字符串的大小明显大于31个字节.

全输出

Alloc: 31

BASE: /home/steve/cps730
PATH: /page2.html



PATH: /home/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/steve/cps730e/stev

Sending: 
HTTP/1.0 404 Not Found
Date: Sat, 12 Sep 2009 19:01:53 GMT
Connection: close
Run Code Online (Sandbox Code Playgroud)

编辑...................使用这些变量的所有代码

const char *BASE_DIR = "/home/steve/cps730";
 char* handleHeader(char *header){
    //Method given by browser (will only take GET, POST, and HEAD)
    char *method;
    method …
Run Code Online (Sandbox Code Playgroud)

c printf

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

如何选择Windows窗体TextBox中的所有文本?

如何在我的多行文本框中选择全部?

对我来说似乎很奇怪,没有办法做到这一点; 开箱即用的框架中应该有一些东西.

c# textbox

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

异步方法和异步委托

简而言之,C#3.0异步方法异步委托看起来很相似,但行为却截然不同.

这是本书所说的两者.

异步方法

  1. 很少或从不阻止任何线程.
  2. Begin方法可能不会立即返回给调用者.
  3. 一个没有C#语言支持的商定协议.

异步代理

  1. 可以阻止任何时间长度
  2. BeginInvoke立即返回给调用者.
  3. 内置编译器支持.

该书还说,异步方法的目的是允许许多任务在少数线程上运行; 异步委托的目的是与调用者并行执行任务.

当我通过反射器查看System.IO.Stream类中的BeginRead()方法时,它正在使用委托并在其上调用BeginInvoke.因此异步方法在内部使用异步委托.

  1. 在这种情况下,怎么能说他们的行为不同?既然它在内部使用委托,那么如何进行上述比较呢?
  2. 您是否认为使用委托的BeginXXX方法是与调用者并行执行函数的方法?
  3. 通过保持充分利用CPU等所有优点来实现异步方法的正确方法是什么?

有什么想法吗?

.net c# multithreading asynchronous

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

如何使RibbonApplicationMenuBar处于非活动/活动状态?

我尝试了许多与RibbonApplicationMenuBar相关联的方法,以防止用户使用鼠标选择RibbonApplicationMenuBar,直到从inifile加载项目设置并关闭splashform.但除非另有说明,否则似乎没有任何工作可以使RibbonApplicationMenuBar InActive.

帮助文件没有显示RibbonApplicationMenuBar的许多属性和帮助Wiki相同,所以我无法解决这个问题.

procedure TMainForm.FormCreate( Sender: TObject );
begin
  // make theRibbonApplicationMenuBar1 inactive
  RibbonApplicationMenuBar1.Enabled := False;
  RibbonApplicationMenuBar1.Inactive := True;
  RibbonApplicationMenuBar1.Hide;
  RibbonApplicationMenuBar1.AutoFocus := False;
  // read application settings
  ReadIni( AIniFileFilename );
  // show a splash form
  FormSplash := TFormSplash.Create( MainForm );
  // FormSplash.Parent := MainForm;
  FormSplash.Position := poOwnerFormCenter;
  FormSplash.Show;
  FormSplash.Update;
end;


procedure TMainForm.FormShow( Sender: TObject );
begin
  // close the splash form
  FormSplash.RequestClose;
  // Activate the RibbonApplicationMenuBar
  RibbonApplicationMenuBar1.Enabled := True;
  RibbonApplicationMenuBar1.Inactive := False;
  if RibbonApplicationMenuBar1.CanFocus then
    RibbonApplicationMenuBar1.SetFocus;
  RibbonApplicationMenuBar1.AutoFocus := True;
  RibbonApplicationMenuBar1.SelectApplicationButton; …
Run Code Online (Sandbox Code Playgroud)

delphi ribbon

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

Native C++ 中的渐变画笔?

在c#中,你可以使用drawing2d.lineargradientbrush,但在c++中,我现在只找到了CreateSolidBrush函数。原生 gdi dll 中有创建渐变画笔的函数吗?我在 msdn 上找不到类似的东西。谢谢

c++ winapi native

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