我正试图决定我在MsBuild与Nant战争中的哪一方.我开始:停止服务,部署一些文件,重新启动服务.只是从查看这两个链接,在Nant中更容易做到.
MSBuild:Microsoft.Sdc.Tasks中使用Service Exists MSBuild任务的示例?
<target name="service_exists">
<script language="C#">
<references>
<include name="System.ServiceProcess.dll" />
</references>
<code><![CDATA[
public static void ScriptMain(Project project) {
String serviceName = project.Properties["service.name"];
project.Properties["service.exists"] = "false";
project.Properties["service.running"] = "false";
System.ServiceProcess.ServiceController[] scServices;
scServices = System.ServiceProcess.ServiceController.GetServices();
foreach (System.ServiceProcess.ServiceController scTemp in scServices)
{
etc...
Run Code Online (Sandbox Code Playgroud)
Nant:http: //ryepup.unwashedmeme.com/blog/2007/01/04/restart-a-windows-service-remotely/
<!-- Send the stop request -->
<exec program="sc.exe">
<arg line="\\server stop shibd_Default"/>
</exec>
<!-- Sleep a little bit, to give the service a chance to stop -->
<sleep seconds="5"/>
<!-- Send the start request …Run Code Online (Sandbox Code Playgroud) 我使用WPF,它有一个Storyboard有Completed事件的类.
我这样使用它:
sb.Completed += AddControlToTaskbar;
private void AddControlToTaskbar(object sender, EventArgs args)
{
//...
}
Run Code Online (Sandbox Code Playgroud)
如何将传递EventArgs给我的方法?它总是为null,我需要它成为一个自定义类
谢谢马克
我应该给我的时间来改变术语和缩写来<acronym>和<abbr>?值得使用吗?什么是使用两个标签的专业人士?它对SEO和屏幕阅读器有用吗?
我的.gitignore文件内容如下:
build/
glucosia.xcodeproj/
!glucosia.xcodeproj/project.pbxproj
core-plot/framework/build
core-plot/framework/CorePlot-CocoaTouch.xcodeproj/
!core-plot/framework/CorePlot-CocoaTouch.xcodeproj/project.pbxproj
.DS_Store
Classes/.DS_Store
Run Code Online (Sandbox Code Playgroud)
奇怪的glucosia.xcodeproj/project.pbxproj是,正如我所料,不会被忽视.
但是,core-plot/framework/CorePlot-CocoaTouch.xcodeproj/project.pbxproj仍然被忽视.
有任何想法吗?
谢谢!
我正在寻找创建一个可在Web浏览器中查看的静态仪表板.而且我想创建像Stephen Few在他的书" 信息仪表板设计"中所做的那样的事情.(见底部示例)
如果网格可以很容易地做到这一点,你知道有什么好的资源来学习如何使用它吗?我已经阅读了手册,但我发现它没有太大帮助.我见过LearnR博客的ggplot2销售仪表板(它使用网格),我无法理解网格和布局部分内容.
dasboard示例http://img251.imageshack.us/img251/1029/fewciodashboard800.png
注意:我不确定是否已经提出过这个问题,因为我找不到适合我的背景的任何问题(或者我无法理解现有问题'背景')
这些天我很喜欢Git.特别是,主题分支.我正在开发一个小代码共享应用程序.我有(本地)分支,如"主","认证","书签","评论","鼻子"等...
我的(预期)工作流程如下所示:创建主题分支==>在主题分支上工作==>将文件提交到分支==>将主题分支更改合并到"主"分支.(后来删除主题分支)
我试过为几个分支做同样的事情.它工作正常.但后来当我检查git图时,即使我遵循相同的工作流程,所有机会都发生在"主人"上.没有树线分叉和会聚!它显示了一条带有多个提交的单线.我不知道为什么?我的印象是,我用HEAD指针搞砸了什么?
为了给出实用的观点,这是我的git图:http://github.com/none-da/zeshare/network
以下是我使用的命令:
>> git branch authentication_feature
>> git checkout authentication_feature
>> # I work with all the files here in "authentication_feature" branch
>> git commit -m "Authentication_feature is up" # commiting to the branch
>> git branch # just to confirm, which branch I am working on
>> git checkout master # trying to shift to master branch
>> git merge --no-commit authentication_feature # I merge in two steps. This is step 1 …Run Code Online (Sandbox Code Playgroud) 当我有用户登录时,我正在阅读有关登录循环的另一个问题,设置为返回登录后可能无法访问的URL(即管理员页面,用户使用普通帐户登录) .
WebForms下的解决方案似乎是利用该UrlAuthorizationModule.CheckUrlAccessForPrincipal方法.但是,对于使用授权属性保护的Action方法的URL不起作用.我想我可以弄清楚URL指向哪个方法并反映它以解决我的问题 - 但我似乎无法弄清楚如何从路由表中获取此信息.
有人曾经使用过这个,或者有解决方案吗?如果我能从URL获取路由信息,我想我可以完成其余的工作,但是如果有人有一个通用的解决方案 - 即.一些隐藏的方法类似于之前提到的MVC,然后这也是非常棒的.
我不是问如何检查用户是否有权访问指定的Controller/Action对.我首先需要弄清楚如何根据URL从RouteTable获取Controller/Action对.所有背景故事的原因都在于确实存在与UrlAuthorizationModule.CheckUrlAccessForPrincipalMVC 相当的情况.
最近unordered_map在C++中的讨论使我意识到,我应该使用之前使用unordered_map过的大多数情况map,因为查找的效率(摊销的O(1)与O(log n)).大多数时候我使用的地图我使用int或std::string作为键,因此我对哈希函数的定义没有任何问题.我越是想到它,我就越发现我发现std::map在一个简单类型的情况下我找不到任何理由std::unordered_map- 我看了一下界面,并没有发现任何显着的差异会影响我的代码.
因此,这个问题-有没有使用任何真正的原因std::map在std::unordered map简单类型一样的情况下,int和std::string?
我从一个严格的编程角度问我 - 我知道它没有被完全认为是标准的,并且它可能会带来移植问题.
另外我希望正确的答案之一可能是"它对于较小的数据集更有效",因为开销较小(是真的吗?) - 因此我想将问题限制在密钥数量的情况下是非平凡的(> 1 024).
编辑: 呃,我忘记了显而易见的(感谢GMan!) - 是的,地图是当然有序的 - 我知道,我正在寻找其他原因.
过去已经进行了许多尝试以在Python中添加超时功能,以便在指定的时间限制到期时,等待代码可以继续.不幸的是,以前的配方要么允许运行功能继续运行并消耗资源,要么使用特定于平台的线程终止方法来终止该功能.这个wiki的目的是为这个问题开发一个跨平台的答案,许多程序员不得不为各种编程项目解决这个问题.
#! /usr/bin/env python
"""Provide way to add timeout specifications to arbitrary functions.
There are many ways to add a timeout to a function, but no solution
is both cross-platform and capable of terminating the procedure. This
module use the multiprocessing module to solve both of those problems."""
################################################################################
__author__ = 'Stephen "Zero" Chappell <Noctis.Skytower@gmail.com>'
__date__ = '11 February 2010'
__version__ = '$Revision: 3 $'
################################################################################
import inspect
import sys
import time
import multiprocessing
################################################################################
def add_timeout(function, limit=60):
"""Add a …Run Code Online (Sandbox Code Playgroud) 当我访问http://localhost:17357/u/a%2fa/m/ssd-10并查看HttpContext.Current.Request.UrlApplication_BeginRequest时,我看到了http://localhost:17357/u/a/a/m/ssd-10吗?我不应该得到http://localhost:17357/u/a%2fa/m/ssd-10?我认为逃避网址的重点是什么?,&,和其他特殊符号不要与网址中的特殊含义相混淆.也许我需要调整配置?
我创建了4个用户名,有
a?@!&ee
a?@!/&ee
as d
???
Run Code Online (Sandbox Code Playgroud)
链接为
<a href="/u/a%3f%40%21%26ee">a?@!&ee</a><br>
<a href="/u/a%3f%40%21%2f%26ee">a?@!/&ee</a><br>
<a href="/u/as%20d">as d</a><br>
<a href="/u/%ef%bd%b8%ef%bd%b2%ef%be%9d">???</a>
Run Code Online (Sandbox Code Playgroud)
最后两个工作,但前两个我得到了exceptio
A first chance exception of type 'System.ArgumentException' occurred in mscorlib.dll
Additional information: Illegal characters in path.
Run Code Online (Sandbox Code Playgroud)
然后
A first chance exception of type 'System.Web.HttpException' occurred in System.Web.dll
Additional information: '/u/a?@!&ee' is not a valid virtual path.
Run Code Online (Sandbox Code Playgroud)
我的页面说Bad Request.我如何允许这些用户名工作.如果不可能我怎么写一个解决方法?
git ×2
abbr ×1
asp.net ×1
asp.net-mvc ×1
asynchronous ×1
branch ×1
c# ×1
c++ ×1
commit ×1
dashboard ×1
delegates ×1
dictionary ×1
escaping ×1
events ×1
ggplot2 ×1
github ×1
gitignore ×1
html ×1
include ×1
merge ×1
msbuild ×1
nant ×1
performance ×1
process ×1
python ×1
r ×1
r-grid ×1
seo ×1
timeout ×1
url ×1
xhtml ×1