小编use*_*721的帖子

从自动触发Jenkins构建中排除.yaml和.md文件

当.yaml文件和自述文件被更改和提交时,我不希望Jenkins构建自动触发.我正在寻找一个可以在我的Jenkins文件中调用的全局函数.

任何建议表示赞赏.

谢谢!

jenkins jenkins-pipeline

10
推荐指数
1
解决办法
428
查看次数

静态内容的MVC客户端缓存不起作用

我在web.config中添加了以下一个

<staticContent>
   <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="10.00:00:00" />
</staticContent>
Run Code Online (Sandbox Code Playgroud)

但我没有看到响应标头过期.我应该做其他任何改变吗?

在此输入图像描述

asp.net-mvc clientcache

7
推荐指数
1
解决办法
1940
查看次数

AngularJS $ http.POST方法405错误

在$ http.post方法中,我遇到了405问题.我们正在为POST和GET方法使用单一服务(REST).

如果url有localhost它正在工作.urlAddScenario是localhost/Service.svc/api/scenarios/add.如果我使用机器名而不是locahost它不起作用.machinname/Service.svc/API /场景/加

我的JS代码是

 scenarioExecutionFactory.addScenario = function (scenarioId) {
        return $http.post(urlAddScenario, scenarioId)               
    };
Run Code Online (Sandbox Code Playgroud)

anotherJS:

 var runScenarioId = { "ScenarioId": 10 }
                   scenarioExecutionFactory.addScenario(runScenarioId )
                         .success(function (data) {
                             $scope.getScenarioRecentRuns($scope.CurrentScenario);
                         });
Run Code Online (Sandbox Code Playgroud)

WCF服务:

  [OperationContract]
        [WebInvoke(UriTemplate = "api/scenarios/add",
            RequestFormat = WebMessageFormat.Json,
            ResponseFormat = WebMessageFormat.Json,
            Method = "POST")]
        Request AddScenario(ScenarioRequestParams requestParams);
Run Code Online (Sandbox Code Playgroud)

配置:

   <system.webServer>
<httpProtocol>
  <customHeaders>
    <add name="Access-Control-Allow-Origin" value="*" />
    <add name="Access-Control-Allow-Credentials" value="true" />
    <add name="Access-Control-Allow-Methods" value="GET,POST,PUT,OPTIONS" />
    <add name="Access-Control-Allow-Headers" value="Origin,Content-Type,Accept,Authorization,X-Ellucian-Media-Type" />
  </customHeaders>

</httpProtocol>
Run Code Online (Sandbox Code Playgroud)

我在Headers中看到OPTIONS而不是POST.

头:

**OPTIONS** http://ddd/HelloService/HelloService.svc/PostData HTTP/1.1
Accept: */*
Origin: http://localhost:31284
Access-Control-Request-Method: POST
Access-Control-Request-Headers: …
Run Code Online (Sandbox Code Playgroud)

asp.net cors asp.net-web-api angularjs

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

angular 5 &amp; 8 - 431 请求头字段太大

我正在处理 2 个项目,并在我的机器上为新项目安装了 Angular 8。但是,我在现有项目中使用 Angular 5。我得到431请求头字段太大错误在我Angular5项目我安装角8.之后我怎么能在我的当前项目解决这个错误?

谢谢

http-headers angular5 angular8

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

AngularJs ng-repeat with index

我只想在单击显示按钮时在此部分显示名称.我正试图检测使用索引,但我没有成功.

Code:

<div ng-repeat="c in customers">

   <a ng-click="display(c.id[$index])" ng-hide="need to hide after click this one">{{vm.updateText}}</a>
   <div ng-show="c.id[$index]" class="updateSection">
        <input type="text" name="id" data-ng-model="id" />
          <input type="button" ng-click="vm.veryId(id)" value="{{vm.verifyButtonText}}">
          <input type="button" ng-click="vm.Cancel()" value="{{vm.cancelButtonText}}">
       </div>
    </div>
    // will show ng-click="vm.veryId(id)"
    <rpe-progress data-ng-show="vm.showProgress" block="true"></rpe-progress>
    // if id is working will show following error message:
    <rpe-alert show="vm.mpnIdAlert">{{vm.errormessage}}</rpe-alert>        



<script>
   vm.display= function (index) {    
      vm.id[index] = true;  
  //   I want show updatesection & hide Update text   
   }
vm.cancel= function () {   
//   I want hide updatesection …
Run Code Online (Sandbox Code Playgroud)

angularjs angularjs-ng-repeat

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

查找具有给定和的元素对是否存在于大整数数组中

我有一个1000万个元素的整数数组,如何在C#中编写一个函数,如果数组有一个总和最多为75的对,则返回True.

我的代码是:

        int sum = 75, max = 10000000;
        int[] array = new int[max];
        bool checkFlag = false;
        Random rnd = new Random();
        Stopwatch sw = Stopwatch.StartNew();

        for (int i = 0; i < max; i++)
        {
            array[i] = rnd.Next(0, max * 20);
        }
        Array.Sort(array);
        if (array[0] + array[1] <= sum)
        {
            Console.WriteLine("{0} + {1} = {2}", array[0], array[1], array[0] + array[1]);
            checkFlag = true; 
        }
        Console.WriteLine("Sum upto 75 is: " + checkFlag);
Run Code Online (Sandbox Code Playgroud)

c#

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