问题列表 - 第25444页

将Table Valued参数传递给存储过程

下面是如何在使用.NET的SQL Server 2008存储过程中使用表值参数的示例.

是CF9中的参数类型列表.

问:ColdFusion是否可以将表值参数传递给Microsoft SQL Server 2008存储过程?

coldfusion sql-server-2008

4
推荐指数
2
解决办法
4669
查看次数

Scala 2.8 TreeMap和自定义排序

我正在从scala 2.7切换到scala 2.8并使用订购.它看起来很直接,但我想知道我可以减少一点点冗长.例如:

scala> case class A(i: Int)
defined class A
scala> object A extends Ordering[A] { def compare(o1: A, o2: A) = o1.i - o2.i}
defined module A
Run Code Online (Sandbox Code Playgroud)

如果我然后尝试创建一个TreeMap,我会收到一个错误

scala> new collection.immutable.TreeMap[A, String]()
<console>:10: error: could not find implicit value for parameter ordering: Ordering[A]
       new collection.immutable.TreeMap[A, String]()
       ^
Run Code Online (Sandbox Code Playgroud)

但是,如果我明确指定对象A作为排序它可以正常工作.

scala> new collection.immutable.TreeMap[A, String]()(A)
res34: scala.collection.immutable.TreeMap[A,String] = Map()
Run Code Online (Sandbox Code Playgroud)

我是否总是必须明确指定顺序或是否有更短的格式?

谢谢

scala treemap scala-2.8

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

Silverlight 4默认按钮服务

几个月来,我在SL 3应用程序中成功使用了David Justices Default Button示例.此方法基于附加属性.

升级到SL4后,该方法不再有效,我得到一个XAML异常:

未知的解析器错误:扫描程序2148474880

有人在SL4中成功使用过这个(或任何其他)默认按钮附加行为吗?

有没有其他方法可以在SL4中使用可用的新类实现默认按钮行为?

谢谢,马克

defaultbutton attached-properties silverlight-4.0

5
推荐指数
2
解决办法
6819
查看次数

为什么我会使用Scala/Lift而不是Java/Spring?

我知道这个问题有点开放,但我一直在考虑使用Scala/Lift作为Java/Spring的替代品,我想知道Scala/Lift对它有什么真正的优势.从我的观点和经验来看,Java Annotations和Spring确实最大限度地减少了您为应用程序所做的编码量.Scala/Lift会改进吗?

java spring scala lift

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

将URL作为URL参数传递

我正在CakePHP应用程序中实现OpenId登录.在某个时刻,我需要重定向到另一个动作,同时保留有关OpenId身份的信息,例如,它本身就是一个URL(带有GET参数),例如

https://www.google.com/accounts/o8/id?id=31g2iy321i3y1idh43q7tyYgdsjhd863Es

我如何传递这些数据?第一次尝试将是

function openid() {
    ...
    $this->redirect(array('controller' => 'users', 'action' => 'openid_create', $openid));
}
Run Code Online (Sandbox Code Playgroud)

但显而易见的问题是,这完全搞砸了CakePHP解析URL参数的方式.

我需要做以下任何一种情况:

1)以CakePHP友好的方式对URL进行编码以传递它,然后对其进行解码,或者

2)将URL作为POST参数传递

但我不知道该怎么做.

编辑:回应评论,我应该更清楚.我正在使用OpenId组件,我有一个有效的OpenId实现.我需要做的是将OpenId链接到现有的用户系统.当新用户通过OpenId登录时,我会询问更多详细信息,然后使用此数据创建新用户.问题是我必须在整个过程中保留OpenId URL.

php url cakephp

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

从不兼容的指针类型分配

我已经设置了以下结构:

typedef struct _thread_node_t {
    pthread_t thread;
    struct thread_node_t *next;
} thread_node_t;
Run Code Online (Sandbox Code Playgroud)

......然后我定义了:

// create thread to for incoming connection
thread_node_t *thread_node = (thread_node_t*) malloc(sizeof(thread_node_t));
pthread_create(&(thread_node->thread), NULL, client_thread, &csFD);

thread_node->next = thread_arr; // assignment from incompatible pointer type

thread_arr = thread_node;
Run Code Online (Sandbox Code Playgroud)

thread_arr的位置 thread_node_t *thread_arr = NULL;

我不明白为什么编译器在抱怨.也许我误会了什么.

c struct pointers typedef

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

为什么NullPointerException未声明为已检查的异常

这是接受采访时提出的问题.NullPointerException很常见; 为什么它不被声明为已检查的例外?我用谷歌搜索,但没有得到正确的答案.

java nullpointerexception

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

当T可以是一个数组时,C#泛型

我正在为第三方库编写一个C#包装器,它从硬件设备读取单个值和数组,但总是返回一个object []数组,即使是一个值也是如此.当我希望最终用户能够使用泛型来接收数组或单个值时,这需要重复调​​用object [0].

我想使用泛型,以便被调用者可以通过以下方式使用包装器:

MyWrapper<float> mw = new MyWrapper<float>( ... );
float value = mw.Value; //should return float;

MyWrapper<float[]> mw = new MyWrapper<float[]>( ... );
float[] values = mw.Value; //should return float[];
Run Code Online (Sandbox Code Playgroud)

在MyWrapper中,我目前的Value属性如下:

public T Value
{
   get
   {
      if(_wrappedObject.Values.Length > 1)
         return (T)_wrappedObject.Value; //T could be float[]. this doesn't compile.
      else
         return (T)_wrappedObject.Values[0]; //T could be float. this compiles.
   }
}
Run Code Online (Sandbox Code Playgroud)

我在第一种情况下遇到编译错误:

无法将'object []'类型转换为'T'

如果我将MyWrapper.Value更改为T [],我会收到:

无法将'object []'类型转换为'T []'

有关如何实现目标的任何想法?谢谢!

c# generics templates

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

将64位二进制转换为长度等效

我们如何将以下64位二进制转换为长等效值;

01111101 10100011 01001111 11111111 11111111 11111111 11111111 11000000  
equals 7D A3 4F FF FF FF FF C0 HEX  
equals 9053167636875050944    << this is the value we want in a C# variable 
Run Code Online (Sandbox Code Playgroud)

编辑:大二进制数当前存储为字符串.所以它是我要寻找的长串转换字符串.

c# binary 64-bit hex

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

如何将任意对象作为参数传递给jasper报告?

我想作为参数传递给我的.jrxml我的域的任意对象,例如Person.

InputStream reportFile = MyPage.this.getClass().getResourceAsStream("test.jrxml");
HashMap<String, Person> parameters = new HashMap<String, Person>();
parameters.put("person", new Person("John", "Doe"));
...
JasperReport report = JasperCompileManager.compileReport(reportFile);
JasperPrint print = JasperFillManager.fillReport(report, parameters, new JREmptyDataSource());
return JasperExportManager.exportReportToPdf(print);
Run Code Online (Sandbox Code Playgroud)

在.jrxml上执行以下操作:

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
 <property name="ireport.zoom" value="1.0"/>
 <property name="ireport.x" value="0"/>
 <property name="ireport.y" value="0"/>
 <parameter name="PERSON" isForPrompting="false" class="myApp.domain.person"/>
 <background>
  <band splitType="Stretch"/>
 </background>
 <title>
  <band height="20">
       <staticText>
         <reportElement x="180" y="0" width="200" height="20"/>
         <text><![CDATA[$P{PERSON.lastName}]]></text>
       </staticText>
     </band>
 </title>
...
Run Code Online (Sandbox Code Playgroud)

这样的事情可能吗?我在哪里可以找到更复杂的教程,而不仅仅是传递java.lang.String?

谢谢

java jasper-reports

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