小编cra*_*den的帖子

未找到XAMPP对象错误

我刚刚在我的机器上安装了XAMPP,当试图访问htdocs中的子文件夹时,我收到以下错误.

找不到对象!在此服务器上找不到请求的URL.如果您手动输入了URL,请检查拼写,然后重试.

如果您认为这是服务器错误,请与网站管理员联系.

错误404

本地主机

Apache/2.4.4(Win32)OpenSSL/0.9.8y PHP/5.4.19"

为了访问htdocs的子文件夹,我需要进行哪些默认的安全更改?谢谢!

windows xampp webserver

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

由于CircularJSON,Angular CLI 7新项目失败

刚刚将Angular CLI重新安装到版本7.1.1.运行时ng new project-name,会发生以下错误:

npm WARN deprecated circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! code ERR_STREAM_WRITE_AFTER_END npm ERR! write after end
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\[username]\AppData\Roaming\npm-cache\_logs\2018-12-04T20_40_23_399Z-debug.log
Package install failed, see above.

更改为项目目录时,无法提供新的Angular应用程序.怎么修这个呢?

npm angular-cli angular

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

圈到圈碰撞响应未按预期工作

我正在制作 HTML Canvas 演示,以了解有关圆到圆碰撞检测和响应的更多信息。我相信检测代码是正确的,但响应数学并不完全存在。

该演示已使用 TypeScript 实现,TypeScript 是 JavaScript 的类型化超集,可转换为纯 JavaScript。

我相信问题存在于 Circle 类的 checkCollision 方法中,特别是计算新速度的数学方法。

蓝色圆圈位置由鼠标控制(使用事件侦听器)。如果红色圆圈从蓝色圆圈的右侧碰撞,则碰撞响应似乎正常工作,但如果从左侧接近,则无法正确响应。

我正在寻找有关如何修改 checkCollision 数学以从任何角度正确处理碰撞的一些指导。

这是用于现场演示和开发环境的CodePenCodePen

class DemoCanvas {
    canvasWidth: number = 500;
    canvasHeight: number = 500;
    canvas: HTMLCanvasElement = document.createElement('canvas');
    constructor() {
        this.canvas.width = this.canvasWidth;
        this.canvas.height = this.canvasHeight;
        this.canvas.style.border = '1px solid black';
        this.canvas.style.position = 'absolute';
        this.canvas.style.left = '50%';
        this.canvas.style.top = '50%';
        this.canvas.style.transform = 'translate(-50%, -50%)';
        document.body.appendChild(this.canvas);
    }

    clear() {
        this.canvas.getContext('2d').clearRect(0, 0, this.canvas.width, this.canvas.height);
    }

    getContext(): CanvasRenderingContext2D {
        return this.canvas.getContext('2d');
    } …
Run Code Online (Sandbox Code Playgroud)

javascript physics canvas typescript

6
推荐指数
1
解决办法
1387
查看次数

什么是 Docker 注册服务连接?

此文档之后Docker registry service connection可在以下 YAML 中找到。什么是Docker registry service connection,在哪里可以找到?

trigger:
- master

variables:
  # Container registry service connection established during pipeline creation
  dockerRegistryServiceConnection: <Docker registry service connection>
  imageRepository: <Name of your image repository>
  containerRegistry: <Name of the Azure container registry>
  dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile'
  tag: '$(Build.BuildId)'

  # Agent VM image name
  vmImageName: 'ubuntu-latest'

- task: AzureWebAppContainer@1 # Add this at the end of your file
  inputs:
    azureSubscription: '<Azure service connection>'
    appName: '<Name of the container web …
Run Code Online (Sandbox Code Playgroud)

azure docker azure-devops azure-pipelines azure-container-registry

6
推荐指数
2
解决办法
5304
查看次数

为什么此 ASP.NET Core POST 请求返回“405(方法不允许)”?

我有一个使用 ASP.NET Core 2.1 创建的非常简单的 API。当客户端页面从 localhost:8080 调用 API 时,位于 localhost:5000 的 API 将返回 HTTP:405。

为什么?请注意,AuthController.cs 中的 HTTP GET 测试方法按预期工作。这只是返回 HTTP:405 的 HTTP POST 请求。

控制器\AuthController.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using server.Models;
using System.IdentityModel.Tokens.Jwt;
using Microsoft.IdentityModel.Tokens;
using System.Security.Claims;
using System.Text;

namespace server.Controllers
{
    [Route("api/auth")]
    [ApiController]
    public class AuthController : ControllerBase
    {

        [HttpGet, Route("test")]
        public ActionResult<IEnumerable<string>> Get()
        {
            return new string[] { "value1", "value2" };
        }

        [HttpPost, Route("login")]
        public IActionResult Login([FromBody]LoginModel user)
        {
            if (user …
Run Code Online (Sandbox Code Playgroud)

c# asp.net-core

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

如何使用 Azure CLI 创建 Azure DevOps 存储库

按照此处的文档,我尝试使用以下命令创建存储库:
az repos create --name Example

返回以下错误:

该命令因意外错误而失败。这是回溯:

TF401019:名称或标识符为 client 的 Git 存储库不存在,或者您无权执行正在尝试的操作。操作返回无效状态代码 404。

我已运行该az login命令,并使用以下命令将组织和项目设置为配置中的默认值:
az devops configure --defaults organization=https://dev.azure.com/example project=example

如何使用 Azure DevOps CLI 创建存储库?

git azure azure-cli azure-devops

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

如何将对象传输到 Azure Blob 存储而不将文件保存在本地存储上?

我一直在关注GitHub 上的这个示例,将文件传输到 Azure Blob 存储。该程序在本地MyDocuments文件夹中创建一个文件以上传到 blob 容器。创建文件后,会将其上传到容器。是否可以在内存中创建 JSON 对象并将其发送到 Azure Blob 存储,而无需先将该文件写入硬盘?

namespace storage_blobs_dotnet_quickstart
{
    using Microsoft.Azure.Storage;
    using Microsoft.Azure.Storage.Blob;
    using System;
    using System.IO;
    using System.Threading.Tasks;

    public static class Program
    {
        public static void Main()
        {
            Console.WriteLine("Azure Blob Storage - .NET quickstart sample");
            Console.WriteLine();
            ProcessAsync().GetAwaiter().GetResult();

            Console.WriteLine("Press any key to exit the sample application.");
            Console.ReadLine();
        }

        private static async Task ProcessAsync()
        {
            CloudStorageAccount storageAccount = null;
            CloudBlobContainer cloudBlobContainer = null;
            string sourceFile = null;
            string destinationFile = null; …
Run Code Online (Sandbox Code Playgroud)

c# azure .net-core azure-blob-storage

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

Azure Blob 存储触发器函数未触发

创建使用应用服务计划进行托管的 Azure 函数 blob 触发器模板时,该函数在配置为“始终开启”时正确触发。我通过在 Azure 控制台中运行应用程序并通过 Microsoft Azure 存储资源管理器添加文件进行了测试。在查看Monitor函数的屏幕时可以找到这些触发器的日志。

使用 Blob 存储模板创建相同的函数但这次选择“消耗”而不是应用服务计划时,监视器下没有显示任何内容。当我在 Azure 控制台中运行测试或将文件添加到目标 Blob 容器时,这些触发器日志不会显示在monitor屏幕上。

当将新文件添加到 Blob 容器时,如何确保触发此触发器模板?

azure azure-storage-blobs azure-functions

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

为什么这个 AWS Amplify API 被 CORS 策略阻止

AWS Amplify 中的此 REST API 是使用以下命令创建的。在生成的 Express 函数中不更改任何代码,发现下面的 post 请求会导致以下错误:

CORS 策略已阻止从源“http://localhost:3000”访问“https://example-id.execute-api.ca-central-1.amazonaws.com/dev/example-path”的 XMLHttpRequest :对预检请求的响应未通过访问控制检查:请求的资源上不存在“Access-Control-Allow-Origin”标头。

默认情况下,Express 函数Enable CORS for all methods在第 行的注释下包含避免 CORS 问题的代码21。可以做些什么来允许将请求传递到 API 函数中?

app.js 中的默认 Express 代码(后端)

// Enable CORS for all methods
app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*")
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept")
  next()
});

// Example POST method
app.post('/example-path', function(req, res) {
  // Add your code here
  res.json({success: 'post call succeed!', url: req.url, body: req.body})
});
Run Code Online (Sandbox Code Playgroud)

放大命令

放大添加api

? 请从以下提到的服务中选择一项:REST
? 为您的资源提供一个友好名称,以用作项目中此类别的标签:示例 …

javascript cors aws-lambda aws-api-gateway aws-amplify

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

邮差为简单的ASP.NET Core Web API收到404错误

我已经设置了一个非常简单的ASP.NET Core 2.1 Web API项目,并创建了以下简单的控制器,它使用EF Core获取entites.

问题是,当尝试使用Postman访问GetEntities方法时,响应是404错误.我在以下URL上使用了HTTP GET方法.

https://localhost:44311/api/entities

响应正文包含消息<pre>Cannot GET /api/entities</pre>.

为什么Postman收到这条路线的404错误?

EntitiesController.cs

namespace MyProject.Controllers
{
    [Route("api/controller")]
    public class EntitiesController : Controller
    {
        private readonly ApplicationDbContext dbContext;

        public EntitiesController(ApplicationDbContext _dbContext)
        {
            this.dbContext = _dbContext;
        }

        [HttpGet]
        public IActionResult GetEntities()
        {
            var result = dbContext.Entities.ToListAsync();
            return Ok(result);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

c# http postman asp.net-core

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

为什么此 ASP.NET Core Docker 构建在 Azure Pipelines 中失败?

在 Azure Pipelines 中构建 ASP.NET Core 项目时,下面的 YAML 文件仅在将解决方案和项目放在同一目录中时才有效。不需要将解决方案和项目放在同一目录下,可以对下面的YAML文件做什么?这在单个解决方案中多个项目的情况下很重要。

以下是采取的步骤:

  1. 使用 Visual Studio 2019 创建了支持 Linux Docker 容器的新 ASP.NET Core 3.1 项目。
  2. 推送到 Azure 存储库“DockerTest”。
  3. 使用模板“Docker: Build and push an image to Azure Container Registry”创建了管道,它基本上生成了下面的 YAML。

这导致在构建过程中出现以下错误:

复制失败:stat /var/lib/docker/tmp/docker-builder701699653/DockerTest/DockerTest.csproj:没有这样的文件或目录

azure-pipelines.yml

# Docker
# Build and push an image to Azure Container Registry
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker

trigger:
- master

resources:
- repo: self

variables:
  # Container registry service connection established during pipeline creation
  dockerRegistryServiceConnection: 'example-connection-string'
  imageRepository: 'dockertest'
  containerRegistry: …
Run Code Online (Sandbox Code Playgroud)

docker azure-devops azure-pipelines

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