问题列表 - 第44584页

ASP NET MVC 3.0获取用户输入

什么是从视图到控制器获取用户输入的最佳方法.我的意思是特定输入不像"FormCollection"那样像"对象人"或"int值"以及如何在特定间隔刷新页面

.net asp.net asp.net-mvc-3

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

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

D编程语言中的就地基数排序

我正在尝试从In-Place Radix Sort工作中获取就地基数排序示例.到目前为止我有这个:

import std.random;

void swap(ref string i,ref string j) {

  string tmp = i;
  i = j;
  j = tmp;
}

void radixSort(ref string[] seqs, size_t base = 0) {
    if(seqs.length == 0)
        return;

    size_t TPos = seqs.length, APos = 0;
    size_t i = 0;
    while(i < TPos) {
        if(seqs[i][base] == 'A') {
             swap(seqs[i], seqs[APos++]);
             i++;
        }
        else if(seqs[i][base] == 'T') {
            swap(seqs[i], seqs[--TPos]);
        } else i++;
    }

    i = APos;
    size_t CPos = APos;
    while(i …
Run Code Online (Sandbox Code Playgroud)

sorting d

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

如何计算Rank SQL查询

嗨,我有下表根据门票状态每天保存代理商排名.

No. **Agent Name** **Incidents** **workorder**  **Rank**     **TimeStamp**
1      cedric           200          29           1          21 Jan 2011
2      poul             100          10           2          21 Jan 2011
3      dan              200          20           1          21 Jan 2011
4      cedric           100          19           2          22 Jan 2011
5      poul             200          26           1          22 Jan 2011
6      dan              150          20           2          22 Jan 2011
Run Code Online (Sandbox Code Playgroud)

现在我需要查询其取出两个日期之间的排名意味着如果我选择2011年01月21日期间至2011年1月22日,然后返回查询代理我平均排名代理的这两个日期不返回该代理的日期排名的详细信息智者之间.我需要单个名字的代理人和他的排名.

此致,Iftikhar hashmi

sql sql-server

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

如何为iOS编译spatialite

我是新来的,这是我的第一个主题.我是iOS平台上的新手,我正在尝试使用sqlite3进行空间扩展,但我无法做到这一点.这让我发疯了.我不知道我该怎么做,从哪里开始.有人可以给我一些建议吗?

谢谢.

iphone spatialite

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

将Expression <T,bool>转换为String

我需要一种方法来在将来的某个时刻重新创建动态生成的报告.简而言之,我需要将特定的linq查询(每个报告不同)存储到数据库中,然后使用动态Linq执行查询.

这一切都很好,但我找不到将表达式转换为字符串的方法.

如:

Expression<Func<Product, bool>> exp = (x) => (x.Id > 5 && x.Warranty != false);
Run Code Online (Sandbox Code Playgroud)

应成为:

"Product.Id > 5 && Product.Warranty != false"
Run Code Online (Sandbox Code Playgroud)

有没有办法做到这一点?

c# expression dynamic-linq

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

从XML反序列化对象时出现间歇性错误

我有一个程序,它将存储为XML的对象作为数据库(基本上是一个消息队列)并对它们进行反序列化.间歇性地,我将得到以下错误之一:

System.Runtime.InteropServices.ExternalException: Cannot execute a program. The command being executed was "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /noconfig /fullpaths @"C:\Documents and Settings\useraccount\Local Settings\Temp\lh21vp3m.cmdline".
   at System.CodeDom.Compiler.Executor.ExecWaitWithCaptureUnimpersonated(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine)
   at System.CodeDom.Compiler.Executor.ExecWaitWithCapture(SafeUserTokenHandle userToken, String cmd, String currentDir, TempFileCollection tempFiles, String& outputName, String& errorName, String trueCmdLine)
   at Microsoft.CSharp.CSharpCodeGenerator.Compile(CompilerParameters options, String compilerDirectory, String compilerExe, String arguments, String& outputFile, Int32& nativeReturnValue, String trueArgs)
   at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
   at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
   at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)
   at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters …
Run Code Online (Sandbox Code Playgroud)

.net c# xml-serialization .net-3.5

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

如何从数组中进行分页?

我有一个数组,其中包含我想用分页显示的数据.

$display_array = Array
(
    [0] => "0602 xxx2",
    [1] => "0602 xxx3",
    [2] => 5 // Total= 2+3
    [3] => "0602 xxx3",
    [4] => "0602 saa4",
    [5] => 7 // Total = 3+4
)
Run Code Online (Sandbox Code Playgroud)

我尝试过这样的事情

function pagination($display_array, $page)
{   
    global $show_per_page;
    $page = $page < 1 ? 1 : $page;
    $start = ($page - 1) * $show_per_page;
    $end = $page * $show_per_page;
    for($i = $start; $i < $end; $i++)
    {
        ////echo $display_array[$i] . "<p>";
        // How to manipulate this? …
Run Code Online (Sandbox Code Playgroud)

php pagination

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

我怎样才能从标签中获取对象?

我有一个视图.在那个视图中我有2个按钮.

我知道那个按钮的标签.我想改变那个按钮的图像.

如何通过此标签更改图像?

iphone objective-c

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

Objective-C调用私有方法

以下是Objective-C中私有方法的示例:

MyClass.m

#import "MyClass.h"


@interface MyClass (Private)
   -(void) privateMethod:(NSString *)arg1 and: (NSString*)arg2;
@end

@implementation MyClass

   -(void) publicMethod {
       NSLog(@"public method\n");
      /*call privateMethod with arg1, and arg2 ??? */
   }

   -(void) privateMethod:(NSString *)arg1 and: (NSString*)arg2{
       NSLog(@"Arg1 %@ and Arg2 %@", arg1, arg2);
   }

@end
Run Code Online (Sandbox Code Playgroud)

我读过有关私有接口/方法声明的内容.但是如何从其他公共方法调用它们?我试过了,[self privateMethod:@"Foo" and: @"Bar"]但看起来不对.

class-design objective-c private-methods

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