小编Mat*_*tin的帖子

客户端浏览器库使用Coffeescript类和RequireJS(或Curljs或类似)的示例

我们希望使用Coffeescript开发一个浏览器(仅限客户端)库,特别是除了纯函数之外,我们倾向于使用Coffeescript的"类"功能.库将相对较大,因此我们想要开始使用定义良好的模块模式,但不是我们想要每个coffeescript"类"的单个咖啡文件.我们不想动态编译咖啡文件,而是作为特定的构建步骤,并且不希望将所有输​​出的JS连接成一个文件.作为最终要求,我们将使用像Jasmine这样的东西进行测试.

有没有人知道以这种方式开发的一个好的示例库,使用Coffeescript与RequireJS,CurlJS,Browserify等等?我看过Github,有一些例子,但我看不出任何具体的需求.

我尝试了Coffee-Toaster,因为它似乎有一些承诺,可以很容易地定义依赖关系等,但它无法处理Windows路径(旧的\ vs /),所以放弃了,主要是因为它似乎是有点像"光明"方面 - 像RequireJS这样的东西似乎有更好的社区支持.

感谢您的任何帮助,您可以提供.我真的在寻找可行的源代码示例.

coffeescript requirejs curljs

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

如何更改Amazon RDS的可公开访问选项?

当您创建一个新的amazon rds实例时,您可以为"可公开访问"选项选择true/false,是否有办法为现有实例更改此选项?

amazon-web-services amazon-rds

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

在TFS 2012上构建c#6.0

如何在TFS 2012上使用C#6.0功能构建Visual Studio 2015解决方案,而无需在构建代理上安装Visual Studio 2015(使用Microsoft Build Tools 2015 RC)

我已经安装了MSBuild工具,但我仍然有例外.如何告诉我的构建模板使用MSBuild 14(仅适用于一个项目)

为什么我的TFS 2012编译异步并等待(c#5.0)而BuildAgent只安装了Visual Studio 2012而没有任何问题?

我尝试将BuildProcessTemplate的ToolPath更改为MSBuild/14.0 /但是我遇到了构建错误:

C:\ Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.targets(316):"csc2.exe"已退出,代码为-532462766.

安装Microsoft.Net.Compilers 1.0.0-rc2编译器会出现相同的错误.

如果我使用命令行编译项目,我会得到完全相同的错误/尽管在使用具有完全相同参数的命令行时我的开发机器上没有错误.

这是我在命令行中获得的异常:

C:\Program Files (x86)\MSBuild\14.0\bin\csc2.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /highentro.....
     Unhandled Exception: System.InvalidProgramException: Common Language Runtime detected an invalid program.
        at System.Collections.Immutable.SecurePooledObject`1.Use[TCaller](TCaller& caller)
        at System.Collections.Immutable.SortedInt32KeyNode`1.Enumerator.PushLeft(SortedInt32KeyNode`1 node)
        at System.Collections.Immutable.SortedInt32KeyNode`1.Enumerator..ctor(SortedInt32KeyNode`1 root)
        at System.Collections.Immutable.ImmutableDictionary`2.Enumerator..ctor(SortedInt32KeyNode`1 root, Builder builder)
        at Microsoft.CodeAnalysis.RuleSet.GetDiagnosticOptionsFromRulesetFile(Dictionary`2 diagnosticOptions, String resolvedPath, IList`1 diagnosticsOpt, CommonMessageProvider messageProviderOpt)
        at Microsoft.CodeAnalysis.CSharp.CSharpCommandLineParser.Parse(IEnumerable`1 args, String baseDirectory, String additionalReferencePaths)
        at Microsoft.CodeAnalysis.CSharp.CSharpCommandLineParser.CommonParse(IEnumerable`1 args, String baseDirectory, String …
Run Code Online (Sandbox Code Playgroud)

c# msbuild tfs roslyn tfs2012

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

我可以重用HttpWebRequest吗?

我可以重用HttpWebRequest吗?

看起来对网站的第3个请求会导致操作超时.似乎每个请求都创建了一个新连接,所以我想知道我是否可以通过更改URL并再次获取请求来重用HttpWebRequest.有问题的代码如下.此代码检查是否存在一系列URL.

    static void storeList(TextWriter sw, string urlTemplate, int start, int end)
    {
        for (int i = start; i < end; i++)
        {
            var url = string.Format(urlTemplate, i);
            var req = (HttpWebRequest)HttpWebRequest.Create(url);
            {
                req.Method = "HEAD";
                tryHttpWebRequest
                {
                    var resp = req.GetResponse();
                    sw.WriteLine(i);
                }
                catch (Exception e)
                {
                }
            }
        }
        sw.Flush();
    }
Run Code Online (Sandbox Code Playgroud)

.net httpwebrequest

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

在打印时保持HTML元素不跨越多个页面

我有以下HTML,我希望避免在跨越多个页面时被分解.问题是,如果我使用page-break-before或之后,它会将每个元素放在它自己的页面上.我有另外一个问题是,假如我display: block在任的cellCSS类或wrap类中,DIV或LI仍然被打散.我有一个打印媒体CSS文件和屏幕的CSS文件.我想保持<li class="cell">元素及其内容不被分解.

        <div class="pad">
        <h1 style="text-align: center; margin: 10px 0">

            Work Orders for Jan 05, 2011
        </h1>
        <p class="printHidden">
            <a href="/orders/print-all/date/2011-01-05">Print All Work Orders</a>
        </p>
        <ul class="workorders">                    
            <li class="cell">
                <div class="wrap" id="146">

                    <div class="scheduled">
                        <p>
                            <strong>Work Order:</strong> <a href="/orders/view/work-order/146">158801</a>
                        </p>
                        <p>
                            <strong>Client:</strong> Client Name
                        </p><br>

                        <b>Resources</b>
                        <ul>
                            <li>
                                <a href="/resources/view/resource-id/5" id="Person-5">Mikell McLaindon</a>
                            </li>
                            <li>
                                <a href="/resources/view/resource-id/9" id="Person-9">Jose Copper</a>

                            </li>
                        </ul>
                    </div>
                    <div class="unschedule printHidden">
                        <h1 style="text-align: center; margin: 10px 0 10px; …
Run Code Online (Sandbox Code Playgroud)

html css printing page-break

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

访问方法'System.Web.Http.HttpConfiguration.DefaultFormatters()'失败

我的单元测试我的WEB API控制器有问题,我正在使用moq模拟我的存储库,进行设置和响应.然后使用模拟存储库启动控制器.问题是当我尝试从控制器执行调用时,我得到一个异常:

尝试通过方法'System.Web.Http.HttpConfiguration..ctor(System.Web.Http.HttpRouteCollection)'访问方法'System.Web.Http.HttpConfiguration.DefaultFormatters()'失败.


在EyeShield.Api.Tests.PersonsControllerTests.Get_Persons_ReturnsAllPersons()的System.Web.Http.HttpConfiguration..ctor()的System.Web.Http.HttpConfiguration..ctor(HttpRouteCollection路由)中

说实话,不知道这里可能出现什么问题.有谁知道这里可能存在什么问题?

控制器:

using System;
using System.Net;
using System.Net.Http;
using EyeShield.Api.DtoMappers;
using EyeShield.Api.Models;
using EyeShield.Service;
using System.Web.Http;

namespace EyeShield.Api.Controllers
{
    public class PersonsController : ApiController
    {
        private readonly IPersonService _personService;

        public PersonsController(IPersonService personService)
        {
            _personService = personService;
        }

        public HttpResponseMessage Get()
        {
            try
            {
                var persons = PersonMapper.ToDto(_personService.GetPersons());
                var response = Request.CreateResponse(HttpStatusCode.OK, persons);
                return response;
            }
            catch (Exception e)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, e.Message);
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

Global.asax中:

using EyeShield.Data.Infrastructure;
using EyeShield.Data.Repositories;
using EyeShield.Service;
using Ninject;
using …
Run Code Online (Sandbox Code Playgroud)

c# unit-testing moq asp.net-web-api

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

隐式算子

我刚刚看到它在最近的一个答案中使用:

public static implicit operator bool(Savepoint sp)
{
    return sp != null;
}
Run Code Online (Sandbox Code Playgroud)

为什么我们在这里需要隐含的词,这是什么意思?

c# implicit-cast implicit-conversion

19
推荐指数
2
解决办法
3210
查看次数

除了在ASP.NET上运行并且不使用IIS日志的谷歌分析的替代方案?

我需要一个针对我的各种页面的点击计数器,但我不能使用谷歌分析(我的客户端还没有为云计算做好准备),我不能使用任何需要访问IIS日志的东西(服务器管理员拥有它们和不想放弃他们)

对于本质上是托管的ASP.NET帐户,用户使用跟踪有哪些资源?

我正在IIS 6上运行ASP.NET应用程序.我已启用了运行状况监控,但到目前为止,这只是创建没有分析的日志数据.

asp.net web-analytics-tools web-analytics

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

TFS 2010 API资源

有没有人有任何好的资源来使用TFS 2010 API?我特别关注如何创建,读取,更新和删除工作项.

tfs-sdk tfs2010

18
推荐指数
2
解决办法
7312
查看次数

"where"在C#类声明中的含义是什么?

我试图谷歌这个,但我能找到的只是普通类声明的文件.

public class DataContextWrapper<T> : IDataContextWrapper where T : DataContext, new()
{

}
Run Code Online (Sandbox Code Playgroud)

我看到该类实现了IDataContextWrapper,它继承自DataContext,并且根据它的实例化方式随T类而变化.

我不知道where T"或" 是什么, new()意思.

.net c# generics

18
推荐指数
5
解决办法
2663
查看次数