我刚刚在我的机器上安装了XAMPP,当试图访问htdocs中的子文件夹时,我收到以下错误.
找不到对象!在此服务器上找不到请求的URL.如果您手动输入了URL,请检查拼写,然后重试.
如果您认为这是服务器错误,请与网站管理员联系.
错误404
本地主机
Apache/2.4.4(Win32)OpenSSL/0.9.8y PHP/5.4.19"
为了访问htdocs的子文件夹,我需要进行哪些默认的安全更改?谢谢!
刚刚将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应用程序.怎么修这个呢?
我正在制作 HTML Canvas 演示,以了解有关圆到圆碰撞检测和响应的更多信息。我相信检测代码是正确的,但响应数学并不完全存在。
该演示已使用 TypeScript 实现,TypeScript 是 JavaScript 的类型化超集,可转换为纯 JavaScript。
我相信问题存在于 Circle 类的 checkCollision 方法中,特别是计算新速度的数学方法。
蓝色圆圈位置由鼠标控制(使用事件侦听器)。如果红色圆圈从蓝色圆圈的右侧碰撞,则碰撞响应似乎正常工作,但如果从左侧接近,则无法正确响应。
我正在寻找有关如何修改 checkCollision 数学以从任何角度正确处理碰撞的一些指导。
这是用于现场演示和开发环境的CodePen: CodePen
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) 在此文档之后,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
我有一个使用 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) 按照此处的文档,我尝试使用以下命令创建存储库:
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 创建存储库?
我一直在关注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) 创建使用应用服务计划进行托管的 Azure 函数 blob 触发器模板时,该函数在配置为“始终开启”时正确触发。我通过在 Azure 控制台中运行应用程序并通过 Microsoft Azure 存储资源管理器添加文件进行了测试。在查看Monitor函数的屏幕时可以找到这些触发器的日志。
使用 Blob 存储模板创建相同的函数但这次选择“消耗”而不是应用服务计划时,监视器下没有显示任何内容。当我在 Azure 控制台中运行测试或将文件添加到目标 Blob 容器时,这些触发器日志不会显示在monitor屏幕上。
当将新文件添加到 Blob 容器时,如何确保触发此触发器模板?
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 ? 为您的资源提供一个友好名称,以用作项目中此类别的标签:示例 …
我已经设置了一个非常简单的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) 在 Azure Pipelines 中构建 ASP.NET Core 项目时,下面的 YAML 文件仅在将解决方案和项目放在同一目录中时才有效。不需要将解决方案和项目放在同一目录下,可以对下面的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) azure ×4
azure-devops ×3
c# ×3
asp.net-core ×2
docker ×2
javascript ×2
.net-core ×1
angular ×1
angular-cli ×1
aws-amplify ×1
aws-lambda ×1
azure-cli ×1
canvas ×1
cors ×1
git ×1
http ×1
npm ×1
physics ×1
postman ×1
typescript ×1
webserver ×1
windows ×1
xampp ×1