我正在尝试使用以下路径连接到远程私有MSMQ队列:
"FormatName:DIRECT=OS:remoteMachineName\Private$\MyQueue"
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
"The specified format name does not support the requested operation. For example, a direct queue format name cannot be deleted."
Run Code Online (Sandbox Code Playgroud)
我显然做错了什么.但是,这确实可以使用本地队列.
我正在使用Spring.Net的Messaging.这是我的配置
<objects xmlns="http://www.springframework.net">
<object id="myQueue" type="Spring.Messaging.Support.MessageQueueFactoryObject, Spring.Messaging">
<property name="Path" value="FormatName:DIRECT=OS:remoteMachineName\Private$\MyQueue"/>
</object>
<object id="messageQueueTemplate" type="Spring.Messaging.Core.MessageQueueTemplate, Spring.Messaging">
<property name="DefaultMessageQueueObjectName" value="myQueue"/>
</object>
<object id="messageGateway" type="My.MessageGateway, My.Assembly">
<property name="MessageQueueTemplate" ref="messageQueueTemplate"/>
</object>
</objects>
Run Code Online (Sandbox Code Playgroud) 我想使用ggplot创建一个显示方法比较数据的散点图.这些图应该包含原始数据,理想线和带错误的拟合线.图例应显示理想线和拟合线的线型/线宽/线颜色.
我可以得到我想要的大部分内容,但这些问题与传说有关:
图例为每种线型显示2行,为什么?,如何修复?
我不喜欢图例矩形中没有粉红色背景(如果我没有指定填充颜色那么矩形背景变成默认灰色,我不喜欢它更好)
示例代码:
set.seed(603)
x.raw=rnorm(n=30, mean=50, sd=20)
y.raw=x.raw+rnorm(n=30, mean=2, sd=2)
x.raw=round(x.raw, 2); y.raw=round(y.raw, 2)
df=data.frame(x=x.raw, y=y.raw)
require(ggplot2, quietly=TRUE)
theme_set(theme_bw())
xy.range=range(df$x, df$y)
p=ggplot(df, aes(x=x, y=y)) +
geom_point(shape=ifelse(nrow(df)>49, 1, 16)) +
geom_smooth(method=lm, fill="red1", aes(colour="Fitted", linetype="Fitted")) +
geom_abline(intercept=0, slope=1, aes(colour="Ideal", linetype="Ideal")) +
scale_colour_manual(name="Lines", values=c("Ideal"="blue", "Fitted"="red")) +
scale_linetype_manual(name="Lines",
values=c("Ideal"="solid", "Fitted"="twodash")) +
scale_x_continuous(name="Control", limits=xy.range) +
scale_y_continuous(name="Evaluation", limits=xy.range) +
opts(title="Method Comparison")
p
Run Code Online (Sandbox Code Playgroud)
我非常感谢你们所有人花时间回复.虽然有一个逻辑可行,但我不会在试验和错误的情况下到达那里.我确实为最终更改了一些代码:
最终代码:
ggplot(df, aes(x=x, y=y)) +
geom_smooth(method=lm, se=FALSE, size=1, aes(colour="Fitted", linetype="Fitted")) +
geom_smooth(method=lm, fill="red", colour="red", linetype="twodash", size=1) …Run Code Online (Sandbox Code Playgroud) 我使用 UTC 在数据库中存储数据和时间值。这些值将转换为客户端上的本地时间或每个客户端时区。我从MSDN 文章中了解了这些场景,在夏令时期间显示 UTC 时间似乎会带来问题。
\n\n\n\n\n居住在美国东海岸的某人输入了一个值,例如“Oct 26, 2003 01:10:00 AM”。
\n\n1) 在这个特定的早晨,由于实行夏令时,在凌晨 2:00,本地时钟将重置为凌晨 1:00,从而创建 25 小时制的一天。由于 1:00 AM 和 2:00 AM 之间的所有\n 时钟时间值在该特定早晨\xe2\x80\x94 出现两次,至少在美国和加拿大的大部分地区\n,\n 计算机确实无法知道\n 上午 1:10 指的是\xe2\x80\x94,是在夏令时切换之前\n 发生的时间,还是\n 夏令时切换之后\n 10 分钟发生的\n 时间。
\n\n2) 同样,问题发生在春天,在某个特定的早晨,没有凌晨 2:10 这样的时间。原因是在那个特定的早晨 2:00,本地时钟的时间突然变为凌晨 3:00。在这个 23 小时制的一天中,整个 2:00 小时永远不会发生。
\n
您如何处理第 1 种情况,即您可能有 4 笔交易,其中两笔在转换之前,两笔在夏令时转换之后?如何向用户显示交易时间,因为由于轮班,最后两笔交易的显示时间可能早于前两笔交易。有时,这可能被证明是不合逻辑的,例如:在邮件链中。
\n\n添加:
\n\n要添加有关上下文的更多信息,在客户端(或通过 Web 服务与服务器通信的任何客户端应用程序)上运行的 RIA 应用程序(例如 Silverlight/Flash)允许用户选择交付时间或使用 PC 当地时间进行安排。
\n\n如果我可以检查给定输入时间的无效时间,我可能会提醒用户。此外,对于旅行者来说,需要在时间点找到时区,而不是基于用户选择,因为他们可能会在区域之间移动,并且将时区保存在用户个人资料中不会有帮助。
\n\n一些用于评估输入时间的 C# 测试示例:
\n\n//2:30 am CT to UTC …Run Code Online (Sandbox Code Playgroud) 我想以编程方式(c#或vb.net)将文件复制到iPad上的应用程序文档文件夹.该应用已启用文件共享.
我查看了iTunes SDK,但没有找到任何似乎允许您访问应用程序的内容.
有一个名为DiskAid的应用程序可以做到这一点,所以我知道它是可能的.我只是不知道从哪里开始,我似乎找不到太多信息.
如果有人有任何关于在哪里寻找或我将用于做什么的信息,请告诉我.
在我的应用程序中,我image使用相机拍摄UIImagePicker而不是裁剪.但问题是,当我在横向模式下从相机捕捉图像时,在以画面模式裁剪时,黑框显示在图像中.
图像以横向模式捕获 -

在使用该图像时,黑匣子显示在图像的上部和下部,如下图所示 -

但我想删除那些黑色部分,以便image覆盖整个区域.
我怎样才能做到这一点 ?
我有这样的代码JavaScript:
slider.setPhotos([
{ "src": "image1", "name": "n1" },
{ "src": "image2", "name": "n2" },
{ "src": "image3", "name": "n3" }
]);
Run Code Online (Sandbox Code Playgroud)
我想设置src和name来自的值C#.
假设值如下所示C#:
var images = new string[] {"/images/a1.jpg", "/images/a2.jpg", "/images/a3.jpg"};
var names = new string[] {"First", "Second", "Third"};
Run Code Online (Sandbox Code Playgroud)
如何将这些值设置为JavaScript代码(即在C#代码中的Page Load方法)?
即使解决方案如此明显,我也不应该发布这个,我将其作为提醒和其他人的有用参考点.
我的app.config文件中有以下内容:
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
Run Code Online (Sandbox Code Playgroud)
其次是:
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<object name="mediaLibrary" type="AlbumLibraryWPF.AlbumLibrary, AlbumLibraryWPF"/>
</objects>
</spring>
Run Code Online (Sandbox Code Playgroud)
然后在我的应用程序中我得到了:
using Spring.Context;
using Spring.Context.Support;
public partial class AlbumChecker : Window
{
private DataTable dataTable;
private Library library;
private Thread libraryThread;
public AlbumChecker()
{
InitializeComponent();
CreateToolTips();
IApplicationContext ctx = ContextRegistry.GetContext();
library = (Library)ctx.GetObject("mediaLibrary");
// Other initialisation
}
// Other code
}
Run Code Online (Sandbox Code Playgroud)
它编译得非常好,但是,我在调用GetContext()时遇到异常:
Error creating context 'spring.root': Could not load type from string …Run Code Online (Sandbox Code Playgroud) 我正在开发一个包含许多winform ui项目的Windows Forms解决方案.有一个类库项目,其中包含一些名为的自定义共享控件MyControls.
现在,当我创建一个MyControls
由同一个项目中的一个或多个控件组成的控件时,我遇到了问题.
我要么得到编译警告:警告CS0436:'path-to\MyType.cs'中的类型'MyType'与'MyControls.dll'中导入的类型'MyType'冲突.使用'path-to\MyType.cs'中定义的类型.或者我得到一堆不同的编译错误,都指向"MyControls.dll"(错误CS0234 - "你错过了程序集引用吗?").
我得到错误或警告,从来没有.
怎么解决这个?
注意
我添加了visual-studio-2010,因为这是我遇到问题的版本.不知道这是否与其他版本有关.
我已经使用Nuget安装了StructureMap.
我不想签入创建的包目录.
如何使用packages.config?重新创建包目录?
我尝试Update-Package没有成功(没有任何事情,我第一次只有一点延迟).
我的packages.config:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="structuremap" version="2.6.3" />
</packages>
Run Code Online (Sandbox Code Playgroud) 我在使用spring.net 4.0开发Web应用程序方面有一定的经验,nhibernate 3.0用于基于ASP.net的Web应用程序.最近我遇到了一种情况,我需要使用spring.net来注入属于WorkerRole该类的服务依赖项.我正常创建了app.config文件,正如我通常使用的spring.config文件一样.这是为了清楚起见.(我已经排除了根节点)
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web" requirePermission="false" />
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" requirePermission="false" />
<section name="parsers" type="Spring.Context.Support.NamespaceParsersSectionHandler, Spring.Core" />
</sectionGroup>
</configSections>
<spring>
<context>
<!-- Application services and data access that has been previously developed and tested-->
<resource uri="assembly://DataAccess/data-access-config.xml" />
<resource uri="assembly://Services/service-config.xml" />
<resource uri="AOP.xml" />
<resource uri="DI.xml"/>
</context>
<parsers>
<parser type="Spring.Data.Config.DatabaseNamespaceParser, Spring.Data" />
<parser type="Spring.Transaction.Config.TxNamespaceParser, Spring.Data" />
<parser type="Spring.Aop.Config.AopNamespaceParser, Spring.Aop" />
</parsers>
</spring>
Run Code Online (Sandbox Code Playgroud)
同样这是AOP.xml
<object id="FilterServiceProxy" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
<property name="proxyInterfaces" value="Domain.IFilterService"/>
<property name="target" ref="FilterService"/> …Run Code Online (Sandbox Code Playgroud)