我想在我的angular 4项目中使用https://materialdesignicons.com/中的图标.网站上的说明仅涵盖如何将其包含在Angular 1.x(https://materialdesignicons.com/getting-started)中
如何包含材料设计图标,以便我可以像<md-icon svgIcon="source"></md-icon>使用Angular Material和ng serve?一样使用它们?
注意:我已经包含了google material icons哪些是不同的!
如何使用mongodbnode.js Node.js Mongodb 驱动程序的本机驱动程序调试 MongoDb 聚合步骤
我通过谷歌搜索找到的是这个npm包:https : //www.npmjs.com/package/mongo-aggregation-debugger
还有其他选择吗?
保存使用聚合查询"mongodb": "^3.0.6"与结果$out时调用运营商只工作.toArray().
聚合步骤:
let aggregationSteps = [{
$group: {
_id: '$created_at',
}
}, {'$out': 'ProjectsByCreated'}];
Run Code Online (Sandbox Code Playgroud)
执行聚合:
await collection.aggregate(aggregationSteps, {'allowDiskUse': true})
预期结果:名为ProjectsByCreated的新集合.
结果:没有集合,查询不会抛出异常但是没有被执行?(只需1毫秒)
toArray()在预期行为中附加结果:
await collection.aggregate(aggregationSteps, {'allowDiskUse': true}).toArray();
为什么mongodb只在调用时创建结果集合.toArray(),文档在哪里这样说?我怎样才能解决这个问题?
该文档似乎没有提供任何有关此信息:
我尝试发送这两个请求,但我只得到标题中列出的错误作为响应.我对谷歌服务器的两个网络请求是这样的:
HttpClient http = new HttpClient();
HttpResponseMessage response = await http.GetAsync("https://accounts.google.com/o/oauth2/token?code="+localSettings.Values["AccessKey"]+"&client_id=XX-XXXXXXXXXX.apps.googleusercontent.com&client_secret=XXXXX-XXXX&redirect_uri=http://localhost/oauth2callback&grant_type=authorization_code");
//response.EnsureSuccessStatusCode();
Debug.WriteLine(response.ToString());
HttpResponseMessage response1 = await http.GetAsync("https://content.googleapis.com/youtube/v3/subscriptions?part=id&maxResults=10&mine=true&key="+localSettings.Values["AccessKey"]);
Debug.WriteLine(response1.ToString());
Run Code Online (Sandbox Code Playgroud)
我从调试器获得以下输出:
StatusCode: 405, ReasonPhrase: '', Version: 2.0, Content: System.Net.Http.StreamContent, Headers:
{
server: GSE
alt-svc: quic=":443"; p="1"; ma=604800
cache-control: max-age=0, private
accept-ranges: none
date: Tue, 29 Sep 2015 16:05:03 GMT
x-frame-options: SAMEORIGIN
vary: Accept-Encoding
x-content-type-options: nosniff
alternate-protocol: 443:quic,p=1
x-xss-protection: 1; mode=block
content-type: application/json
expires: Tue, 29 Sep 2015 16:05:03 GMT
}
StatusCode: 400, ReasonPhrase: '', Version: 2.0, Content: System.Net.Http.StreamContent, Headers:
{
server: …Run Code Online (Sandbox Code Playgroud)我在three.js中创建了一个游戏,其中包含3个场景GameScene,MenuScene以及HighScoreScene.当玩家从不断变化的场景如-用户可以将这些场景之间切换MenuScene到HighScoreScene我试图从旧场景清理资源.
但清理资源似乎不起作用.所以这是我的代码,当用户在场景之间切换时,它会被执行:
所以在旧场景中我有这个动画循环:
function cancelAnimation() {
cancelAnimationFrame(animationFrameId); // EXECUTING WHEN SWITCHING SCENE!!!
}
function animate() {
animationFrameId = requestAnimationFrame(animate); // Saving id
render();
}
function render() {
renderer.clear();
renderer.render(scene, camera);
}
Run Code Online (Sandbox Code Playgroud)
因此,当切换场景时,我取消设置所有点击监听器,我正在呼叫cancelAnimation.
因为我将每个场景的代码存储在一个对象中,就像var menuScene = new MenuScene()我menuScene = undefined在切换场景时也这样做.
我也传递相同var renderer = new THREE.WebGLRenderer();的场景实例.
这一切似乎都没有帮助游戏执行得更慢.
在这些场景之间切换和清理资源的正确方法是什么?我在这做错了什么?
我正在尝试将MQTT-C-Client-Library包含在一个简单的 C++ 项目中。我已经像这样成功包含了头文件#include "MQTTClient.h"。在 Linux 终端中编译它会打印以下错误:
[xy@localhost mosquittoProject]$ sudo g++ *.cpp -o MQTTTest
/tmp/ccHn3s6m.o: In function `main':
mosquitto_test.cpp:(.text+0x11e): undefined reference to `MQTTClient_create'
mosquitto_test.cpp:(.text+0x13f): undefined reference to `MQTTClient_connect'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
经过一番谷歌搜索后,我发现我需要链接该库:Example MQTT Client Code not work C
基于这个问题和答案,我尝试再次编译它,如下所示:
sudo g++ -L/home/xy/Desktop/paho.mqtt.c/build/output/ *.cpp -l paho-mqtt3c -o MQTTTest
编译得很好,但运行时仍然出现错误。控制台命令和输出:
[xy@localhost mosquittoProject]$ sudo g++ -L/home/xy/Desktop/paho.mqtt.c/build/output/ *.cpp -l paho-mqtt3c -o MQTTTest
[xy@localhost mosquittoProject]$ ./MQTTTest
./MQTTTest: error while loading shared libraries: libpaho-mqtt3c.so.1: cannot open shared object …Run Code Online (Sandbox Code Playgroud) 我正在尝试保留容器数据,为此我想安装一个卷。这是我的任务定义,尽管声明了它,但它仍抛出未知卷错误。
aws_ecs_task_definition.wordpress:正在创建...错误:ClientException:未知卷“wordpress-volume”。
locals {
username = jsondecode(data.aws_secretsmanager_secret_version.wordpress.secret_string)["username"]
password = jsondecode(data.aws_secretsmanager_secret_version.wordpress.secret_string)["password"]
}
resource "aws_ecs_task_definition" "wordpress" {
family = "wordpress"
container_definitions = jsonencode([{
name = "wordpress"
image = "wordpress"
essential = true
cpu = 256
memory = 512
entryPoint = [ "sh", "-c"]
command = ["ls -la /var/www/html"]
volumes = [{
name = "wordpress-volume"
efsVolumeConfiguration = {
fileSystemId = aws_efs_file_system.wordpress.id
}
}]
mountPoints = [{
sourceVolume = "wordpress-volume"
containerPath = "/var/www/html"
readOnly = false
}]
environment = [{
name = "WORDPRESS_DB_HOST"
value …Run Code Online (Sandbox Code Playgroud) 在构建管道中,我有一个使用 powershell 脚本的工作,根据这样的变量设置应用程序名称:
$applicationName = If ('$(configuration)' -eq 'Release') { 'Appname' } Else { 'Appname-Test' }
Write-Host "##vso[task.setvariable variable=applicationName]$applicationName"
Run Code Online (Sandbox Code Playgroud)
我尝试将PublishBuildArtifacts@1变量的显示名称设置为这样的变量:
- task: PublishBuildArtifacts@1
displayName: $[variables.applicationName] # runtime variable
Run Code Online (Sandbox Code Playgroud)
但这从字面上显示$[variables.applicationName]而不是变量值。如何根据变量更改任务的显示名称?
我在这样的localstorage中保存元素(使用严格模式):
localStorage.setItem(String(index), JSON.stringify([name, score]));
然后我写了一个方法来检查新分数是否大于保存的分数:
// Returns index where to place the score and return -1 if no new highscore
function isHighScore(score) {
console.log("called");
for (var i = 0; i < 3; i++) {
if (localStorage.getItem(String(i)) == null) {
return i; // No highscore yet at this position => new Highscore
}
else{
var indexObject = JSON.parse(localStorage.getItem(String(i)));
console.log(indexObject);
if(indexObject[1] < score){ // Checking if new score is higher than currently at this index
return i; // Returning index if new …Run Code Online (Sandbox Code Playgroud) c# ×2
javascript ×2
mongodb ×2
node.js ×2
amazon-ecs ×1
amazon-efs ×1
angular ×1
api ×1
azure-devops ×1
c ×1
c++ ×1
debugging ×1
docker ×1
header ×1
http-error ×1
httprequest ×1
linker ×1
listview ×1
mqtt ×1
null ×1
paho ×1
performance ×1
response ×1
terraform ×1
three.js ×1
uwp ×1
xaml ×1