所以我使用角度材料和angular4,我已经在一个MdDialogue组件中放入了html for booking.com表格.当有人按下按钮时,我希望这个对话框弹出窗体内部的形式.应用程序加载后,它会按预期工作一次,但不会再次.我希望每次都能工作.没有错误消息,因此我不清楚为什么会发生这种情况.booking()中的逻辑初始化表单.
booking.com表单的html如下所示.
<ins class="bookingaff" data-aid="1179852" data-target_aid="1179846" data-prod="nsb" data-width="100%" data-height="auto">
<!-- Anything inside will go away once widget is loaded. -->
<a href="//www.booking.com?aid=1179846">Booking.com</a>
</ins>
Run Code Online (Sandbox Code Playgroud)
这是booking.com组件的样子......
...
openBookings(){
let dialogRef = this.dialog.open(Booking_com);
dialogRef.afterClosed().subscribe(result => {
});
}
debug(data){
console.log(data);
}
}
@Component({
selector: 'Booking_com',
templateUrl: 'Booking_com.html',
styleUrls: ['Booking_com.sass']
})
export class Booking_com implements AfterViewInit{
ngAfterViewInit(): void {
this.booking();
}
constructor(public dialogRef: MdDialogRef<Booking_com>) {}
booking(){
(function(d, sc, u) {
var s:any = d.createElement(sc);
var p:any = d.getElementsByTagName(sc)[0];
s.type = 'text/javascript';
s.async …Run Code Online (Sandbox Code Playgroud) 我一直在关注有关此主题的文档Heroku文档, 并经历了这一过程,并尝试对其说做的内容做一些改动
直接数据库到数据库副本
我确信文档是错误的,或者我的设置或设置有误(确实具有管理员权限)。我还阅读了一些分散的内容,说明heroku CLI中的命令已更改。
当我运行此命令时(使用我的heroku DB的凭据)
heroku pg:copy sushi::ORANGE GREEN --app sushi-staging
Run Code Online (Sandbox Code Playgroud)
在我确认消息后:
警告:破坏性行为?此命令将从中删除所有数据
并确认。然后我得到一个错误,说:
Heroku PostgreSQL数据库必须是源数据库或目标数据库
将数据从一个应用程序中的postgresql数据库复制到heroku上另一应用程序中的postgresql数据库的正确方法是什么?
我刚刚将angular cli更新到了版本6。当然,我的应用程序坏了,并且一直在尝试查看文档和SO问题,试图找出如何向angular.json添加环境?我希望能够运行与ng serve --env = local等效的功能,然后使其在本地服务器中运行本地构建...我已经参与其中,而我的angular.json文件如下所示...
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"bb-admin": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"styleext": "sass"
}
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/bb-admin",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.sass"
],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all", …Run Code Online (Sandbox Code Playgroud) 我对 python 很陌生,并且看过各种堆栈溢出帖子。我觉得这应该有效,但事实并非如此。如何从 python 中的另一个文件导入类?这个文件夹结构
src/example/ClassExample
src/test/ClassExampleTest
Run Code Online (Sandbox Code Playgroud)
我有这门课
class ClassExample:
def __init__(self):
pass
def helloWorld(self):
return "Hello World!"
Run Code Online (Sandbox Code Playgroud)
我有这个测试课
import unittest
from example import ClassExample
class ClassExampleTest(unittest.TestCase):
def test_HelloWorld(self):
hello = ClassExample()
self.assertEqual("Hello World!", hello.helloWorld())
if __name__ == '__main__':
unittest.main()
Run Code Online (Sandbox Code Playgroud)
当单元测试运行时,对象为 None:
AttributeError:“NoneType”对象没有属性“helloWorld”
这有什么问题吗?如何在Python中导入类?
我已经检查了这个问题的github问题,并查看了各种堆栈溢出问题和博客和内容,我找不到解决方案,为什么我在我的角度2应用程序中运行"ng test"时出现此错误.
这是测试的样子:
import { TestBed, async } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { RouterModule } from "@angular/router";
import { Location,LocationStrategy } from "@angular/common";
describe('App: MemberAdmin', () => {
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
imports:[
RouterModule
],
providers:[
Location,
LocationStrategy
]
});
});
it('should create the app', async(() => {
let fixture = TestBed.createComponent(AppComponent);
let app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
}));
it(`should have as title 'app works!'`, async(() => {
let fixture = TestBed.createComponent(AppComponent); …Run Code Online (Sandbox Code Playgroud) 我有一个angular4应用程序,现在用的角料框架https://material.angular.io/components/sidenav/examples.我想让md-sidenav-container拉伸整个div的高度,而不会遮住标题.我附上了全屏指令,这导致sidenav填满屏幕的整个高度,从而掩盖了标题组件.这不是我想要的.这些图像示出了sidenav拉伸头的上方,以及其中它停止在头,但不延伸到所述底部的另一尝试.我希望它一直延伸到标题,一直到屏幕的底部.我该如何做到这一点?谢谢!
HTML
<div class="bar">
<md-sidenav-container class="example-sidenav-fab-container">
<md-sidenav #sidenav mode="side" opened="true" align="end">
<!--<button md-mini-fab class="example-fab" (click)="sidenav.toggle()">-->
<!--<md-icon>add</md-icon>-->
<!--</button>-->
<div class="example-scrolling-content">
<ul>
<li>Recommendations</li>
<li>Events</li>
<li>Settings</li>
</ul>
</div>
</md-sidenav>
<button md-mini-fab class="example-fab" (click)="sidenav.toggle()">
<md-icon>add</md-icon>
</button>
</md-sidenav-container>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
md-sidenav-container
:background-color white
:float right
:width 300px
:height 400px
md-sidenav
:background-color $light-blue
//.example-sidenav-fab-container
// width: 300px
// height: 400px
//border: 1px solid rgba(0, 0, 0, 0.5)
.example-sidenav-fab-container md-sidenav
max-width: 300px
.example-sidenav-fab-container md-sidenav
display: flex
overflow: visible
.example-scrolling-content
overflow: auto
.example-fab
position: absolute
right: …Run Code Online (Sandbox Code Playgroud) 前几天,我收到了来自case++aazqzqnklgexao@support.facebook.com的电子邮件。他们告诉我,我的应用程序正在“创造负面体验”,因为它(根据他们的说法)不符合
平台政策7.2:实现Facebook登录的本机iOS和Android应用必须使用我们的官方SDK进行登录
当我足够确定地登录FB开发者帐户时,我会看到一条类似以下的消息。
问题是我的应用程序没有IOS或android登录名。只是一个JavaScript登录名。我回答并告诉他们,他们回答
感谢您与我合作修复您的应用...
但是,当我登录FB开发者帐户时,该消息仍然存在。如何确定此问题已解决?
我一直在查看 terraform 文档和 udemy 课程来回答这个问题,但找不到答案。我有一个 jenkins 管道,它正在使用 terraform 构建 AWS 基础设施。这是使用通过配置的远程后端
terraform {
backend "s3" {}
}
Run Code Online (Sandbox Code Playgroud)
堵塞。我想为本地开发覆盖它,以便使用terraform init. 我试过跑步,terraform init -backend=false但我意识到这不是我想要的,因为它也没有创建本地后端。我已经看到terraform init -backend=<file>了一个选项,但是如果我使用它,那么我不知道在文件中放什么来指示默认的本地后端配置。我发现这篇文章覆盖了文件,但它并没有让我相信这个功能存在于这个特定用例的 terraform 中。我想确保我以正确的方式做到这一点。如何使用 terraform 中的默认本地后端配置覆盖远程后端配置?谢谢。
我正在尝试使用 docker compose 构建图像,但它失败了,但它仅适用于 docker。我读过一些 SO 帖子,说当在 Dockerfile 中找不到文件/文件夹时,会发生失败时引发的错误。使用 docker 构建时构建可以工作,所以我不知道为什么它不能与 docker-compose 一起使用。为什么会发生这种情况?
该项目的结构是这样的:
parent_proj
|_proj
|_Dockerfile
|_docker-compose.yml
Run Code Online (Sandbox Code Playgroud)
这是我的 docker-compose 文件:
version: '3.4'
services:
integrations:
build:
context: .
dockerfile: proj/Dockerfile
network: host
image: int
ports:
- "5000:5000"
Run Code Online (Sandbox Code Playgroud)
这是 proj/ 内的 Dockerfile
FROM openjdk:11
USER root
#RUN apt-get bash
ARG JAR_FILE=target/proj-0.0.1-SNAPSHOT.jar
COPY ${JAR_FILE} /app2.jar
ENTRYPOINT ["java","-jar", "/app2.jar"]
Run Code Online (Sandbox Code Playgroud)
当我进入 proj 文件夹时。我可以跑
docker build . -t proj
Run Code Online (Sandbox Code Playgroud)
以上成功,我随后可以运行容器。但是,当我在parent_proj 中并运行时,docker compose build它失败并显示错误消息
无法计算缓存密钥:无法行走 /var/lib/docker/tmp/buildkit-mount316454722/target:lstat /var/lib/docker/tmp/buildkit-mount316454722/target:没有这样的文件或目录
为什么会出现这种情况?如何在不重组项目的情况下使用 docker-compose 成功构建?
谢谢
我想创建一个连接到死信队列的 SQS 队列。我希望将 SQS 队列中收到但无法正确处理的消息放入死信队列。此外,我想将其设置为云形成。我已经看过 这些文档。但我对设置过程仍然有疑问。我在页面下方看到了这段代码片段,它展示了如何执行此操作:
AWSTemplateFormatVersion: "2010-09-09"
Resources:
MySourceQueue:
Type: AWS::SQS::Queue
Properties:
RedrivePolicy:
deadLetterTargetArn:
Fn::GetAtt:
- "MyDeadLetterQueue"
- "Arn"
maxReceiveCount: 5
MyDeadLetterQueue:
Type: AWS::SQS::Queue
Outputs:
SourceQueueURL:
Description: "URL of the source queue"
Value:
Ref: "MySourceQueue"
SourceQueueARN:
Description: "ARN of the source queue"
Value:
Fn::GetAtt:
- "MySourceQueue"
- "Arn"
DeadLetterQueueURL:
Description: "URL of the dead letter queue"
Value:
Ref: "MyDeadLetterQueue"
DeadLetterQueueARN:
Description: "ARN of the dead letter queue"
Value:
Fn::GetAtt:
- "MyDeadLetterQueue"
- "Arn"
Run Code Online (Sandbox Code Playgroud)
我的问题是:
1) 这个代码片段是针对 1 sqs/死信队列的吗?那么,如果我想做很多这样的东西,我会为每一个复制整个块吗? …
angular ×4
amazon-sqs ×1
angular-cli ×1
docker ×1
facebook ×1
heroku ×1
postgresql ×1
python ×1
python-3.x ×1
terraform ×1
unit-testing ×1