小编flo*_*low的帖子

如何在MongoDB中按日期对集合进行排序?

我正在使用MongoDB和Node.JS. 我有一个包含日期和其他行的集合.日期是JavaScript Date对象.

如何按日期对此集合进行排序?

mongodb node.js

113
推荐指数
7
解决办法
17万
查看次数

获取字符串中两个字符串之间的字符串

我有一个字符串:

"super exemple of string key : text I want to keep - end of my string"
Run Code Online (Sandbox Code Playgroud)

我想保留在"key : "和之间的字符串" - ".我怎样才能做到这一点?我必须使用正则表达式,还是可以用其他方式进行?

c# regex string

89
推荐指数
13
解决办法
20万
查看次数

Microsoft Master Data Services:如何以编程方式获取/设置Model/Entity的描述

我使用MDS 2008/API以编程方式插入/更新模型,实体,属性和成员.

我想获取或设置一个模型或一个实体的描述.

如果掌握在Master Data Manager上,我们可以在一个模型或实体的元数据上看到这一点: 在此输入图像描述

在这里,我们可以看到模型的描述,但我们无法获取或设置它.

有谁知道如何使用MDS API做到这一点?

c# sql-server master-data-management master-data-services

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

JSON日期从tweeter到C#格式

如何格式化从twitter获得的JSON日期到C#DateTime?这是我收到的日期格式:

"Tue, 19 Feb 2013 13:06:17 +0000"
Run Code Online (Sandbox Code Playgroud)

我可以用JSON.NET吗?

c# json date-format json.net

11
推荐指数
3
解决办法
4114
查看次数

来自MemoryStream UTF8编码的StreamReader

我想在MemoryStream中打开一个XML文件(来自zip存档),并在此流中创建一个StreamReader,将其放入GridView中.

我用这个代码:

MemoryStream ms = new MemoryStream();
entry.Extract(ms);
StreamReader reader = new StreamReader(ms);
DataSet ds = new DataSet();
ds.ReadXml(reader);
dataGridView1.DataSource = GlobalDs.Tables[0];
Run Code Online (Sandbox Code Playgroud)

如果我的XML文件是用ANSI编码的,那么它可以很好地工作.但是当我加载以UTF8编码的文件时,它会失败,即使我初始化StreamReader如下:

StreamReader reader = new StreamReader(ms, System.Text.Encoding.UTF8);
Run Code Online (Sandbox Code Playgroud)

我希望有人有想法解决我的问题.

c# memorystream streamreader

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

Axis2错误:无法添加以下方面

我试图从eclipse中的wsdl文件生成axis2 webservice.我正在点击此错误消息:

 Unable to add the following facetsto project AnnuaireAAAAAAAA: Axis2 Web Services Extensions, Axis2 Web Services Core.
    org.eclipse.wst.common.project.facet.core.FacetedProjectFrameworkException: Failed while installing Axis2 Web Services Core 1.1.
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1507)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modifyInternal(FacetedProject.java:441)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChangesInternal(FacetedProject.java:1181)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$2(FacetedProject.java:1117)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$1.run(FacetedProject.java:324)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modify(FacetedProject.java:339)
    at org.eclipse.jst.ws.internal.consumption.ui.common.FacetOperationDelegate$1.run(FacetOperationDelegate.java:62)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
    Caused by: org.eclipse.core.runtime.CoreException: The Axis2 facets cannot be installed since the Axis2 runtime location has not been set.
    Go to the Web Services preference page and set the Axis2 runtime location under Axis2 Preferences.
    at …
Run Code Online (Sandbox Code Playgroud)

java eclipse axis2 jboss5.x

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

无法找到编译动态表达式所需的一种或多种类型

我在Visual Studio 2010上使用Windows Phone 7.1应用程序.我尝试这样做:

dynamic dyn = JsonConvert.DeserializeObject(json);
MessageBox.Show(dyn.somevar);
Run Code Online (Sandbox Code Playgroud)

我有这个错误:

无法找到编译动态表达式所需的一种或多种类型.您是否缺少对Microsoft.CSharp.dll和System.Core.dll的引用?

我试图添加,C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\Microsof.CSharp.dll但它不起作用.

我现在能做什么?

.net c# dynamic windows-phone-7

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

C#替换字符串,除非前面有另一个字符串

我想,以取代所有ocurrence "通过\"在一个字符串,除非这"前面有一个\ 用于为例字符串hello "World\"将成为hello \"World\"

是否可以不使用正则表达式?但如果我必须使用正则表达式,我可以使用什么样的?

谢谢你的帮助,问候,

c# regex string replace

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

适用于XMI 2.1.1的XSD

我必须使用JAXB解析XMI文件(xmi版本2.1.1)。

为此,我必须生成与XMI文件相对应的Java类。因此,我需要一个xmi文件的shema定义来使用jxc工具进行该操作。

我希望任何人都知道在哪里可以找到此文件。在此先感谢您的帮助!

编辑:有关更多信息,有一个xmi文件的示例(使用modelio生成):

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmlns:uml="http://schema.omg.org/spec/UML/2.1.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmi:version="2.1" xmi:id="_1cUA4Pm5EeKGw-fe2JKgbQ" name="test">
  <eAnnotations xmi:id="_1cUA4fm5EeKGw-fe2JKgbQ" source="Objing">
    <contents xmi:type="uml:Property" xmi:id="_1cUA4vm5EeKGw-fe2JKgbQ" name="exporterVersion">
      <defaultValue xmi:type="uml:LiteralString" xmi:id="_1cUA4_m5EeKGw-fe2JKgbQ" value="2.2"/>
    </contents>
  </eAnnotations>
  <ownedComment xmi:type="uml:Comment" xmi:id="_1cUA5Pm5EeKGw-fe2JKgbQ">
    <body/>
  </ownedComment>
  <packagedElement xmi:type="uml:Class" xmi:id="_1cUA5fm5EeKGw-fe2JKgbQ" name="User">
    <ownedAttribute xmi:type="uml:Property" xmi:id="_1cUA5vm5EeKGw-fe2JKgbQ" name="login" visibility="private" isUnique="false" isReadOnly="true">
      <type xmi:type="uml:PrimitiveType" href="http://schema.omg.org/spec/UML/2.1.1/uml.xml#String"/>
    </ownedAttribute>
    <ownedAttribute xmi:type="uml:Property" xmi:id="_1cUA5_m5EeKGw-fe2JKgbQ" name="id" visibility="private" isUnique="false" isReadOnly="true">
      <type xmi:type="uml:PrimitiveType" href="http://schema.omg.org/spec/UML/2.1.1/uml.xml#Integer"/>
    </ownedAttribute>
  </packagedElement>
  <packagedElement xmi:type="uml:Association" xmi:id="_1cUA6Pm5EeKGw-fe2JKgbQ" memberEnd="_1cUA6fm5EeKGw-fe2JKgbQ _1cUA7fm5EeKGw-fe2JKgbQ">
    <ownedEnd xmi:type="uml:Property" xmi:id="_1cUA6fm5EeKGw-fe2JKgbQ" type="_1cUA6_m5EeKGw-fe2JKgbQ" association="_1cUA6Pm5EeKGw-fe2JKgbQ">
      <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_1cUA6vm5EeKGw-fe2JKgbQ"/>
    </ownedEnd>
  </packagedElement>
  <packagedElement xmi:type="uml:Class" xmi:id="_1cUA6_m5EeKGw-fe2JKgbQ" name="Group">
    <ownedAttribute xmi:type="uml:Property" xmi:id="_1cUA7Pm5EeKGw-fe2JKgbQ" …
Run Code Online (Sandbox Code Playgroud)

xsd uml jaxb xjc xmi

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

如何访问继承的成员

我有这样的A类和B类:

class A
{
public:
   A(){}
};

class B : public A
{
public:
   B() : A()
   {
      value = 10;
   }
   int Value()
   {
      return value;
   }

protected:
   int value;
}:
Run Code Online (Sandbox Code Playgroud)

我有这个代码:

int main()
{
   A* a = new B();
   // how can I access to Value() ? I would like to make that :
   int val = a->Value();
   // must i cast a to B ? how ?
}
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助.

c++

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