小编K. *_*zyk的帖子

Angular 2材质在按钮上使用较浅/较深的颜色

是否有任何优雅的方式可以使用较暗/较暗的主要或强调颜色的变体与角度2材料的按钮,而无需手工重新创建整体造型?

angular-material

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

Angular 4同时激活父组件和子组件

我写了一些插图来说明我的问题:LINK

我需要为父组件设置动画,同时我想在子组件中制作一些动画.看起来angular是阻止子组件上的动画,然后简单地在父动画结束后跳转状态而没有任何转换.

是否有任何方法可以使动画并行工作,或至少链接而不使用回调?

@Component({
  selector: 'outer',
  template: `
    <div [@state]="state" (mouseenter)="state='wide'" (mouseleave)="state='narrow'" style="background-color: red;">
      <inner [stateInner]="state"></inner>
    </div>`,
  animations:[
    trigger('state', [
      state('narrow', style({
        width: '100px'
      })),
      state('wide', style({
        width: '400px'
      })),
      transition('* => *', animate('500ms'))
    ])  
  ]
})
export class Outer {
  public state: string = 'narrow';
  constructor() {
  }
}


@Component({
  selector: 'inner',
  template: `
    <div [@stateInner]="stateInner">
      <h2>Hello</h2>
    </div>`,
  animations:[
    trigger('stateInner', [
      state('narrow', style({
        height: '100px'
      })),
      state('wide', style({
        height: '400px'
      })),
      transition('* => *', animate('500ms'))
    ])  
  ]
}) …
Run Code Online (Sandbox Code Playgroud)

angular angular-animations

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

Docker Compose:无法运行 ssh:没有这样的文件或目录

我正在尝试使用 docker-compose 从他们的 git 存储库中获取、构建和运行多个服务。我做了一个简单的 docker-compose.yml 来测试它:

version: '3'

services:
  test-service:
    build: git@gitlab.com:dan-poltherm/partservicego.git
    ports:
      - 8005:443
Run Code Online (Sandbox Code Playgroud)

似乎 docker-compose 无法获取存储库我在调用时收到以下错误docker-compose up --build

ERROR: error fetching: fatal: cannot run ssh: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我安装了 OpenSSH 客户端(Windows 10 端口)并%SYSTEMROOT%\System32\OpenSSH\添加到 PATH,我也设置GIT_SSHC:\Windows\System32\OpenSSH\ssh.exe. 我可以克隆与回购git clonessh也从PowerShell的工作。

git docker docker-compose

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

OpenCV VideoCapture:无法为不同主机重复使用 HTTP 连接

我正在尝试使用 openCV 捕获 YouTube 直播。

使用pafy我从youtube获取m3u8播放列表(尚未研究播放列表更新),但是播放列表上的片段在多个主机上分散,这似乎导致与第一个主机不同的主机上的片段冻结,然后出现如下错误:

Cannot reuse HTTP connection for different host: r5---sn-x2pm-f5fs.googlevideo.com:-1 != r4---sn-x2pm-f5fs.googlevideo.com:-1
Run Code Online (Sandbox Code Playgroud)

这似乎是 ffmpeg 问题,但也许我错过了一些解决方法?

我的代码:

mPafy = pafy.new('VQOzkTEPCMw')
mStream = mPafy.getbest(preftype="mp4")

capture = cv2.VideoCapture(mStream.url)
while(True):
    ret, frame = capture.read()
    cv2.imshow('yt', frame)
    if cv2.waitKey(20) & 0xFF == ord('q'):
        break
capture.release()
cv2.destroyAllWindows()
Run Code Online (Sandbox Code Playgroud)

编辑:

我绕过VideoCapture并直接调用ffmpeg,它好一点,每当片段位于不同主机上时仍然会冻结,但只持续约1秒。并且段没有丢失,ffmpeg打开新连接并抓取它,只是打开连接需要时间。

TBF 我不知道我应该从哪里开始。一种方法是手动处理 m3u8 播放列表并提供 ffmpeg 数据流进行解码,但这感觉有点矫枉过正。无论如何,这是我当前的代码:

import pafy
from cv2 import cv2
import subprocess as sp
import numpy as np

mPafy = pafy.new('VQOzkTEPCMw')
mStream = mPafy.getbest(preftype='mp4')
frameSize = 3*mStream.dimensions[0]*mStream.dimensions[1]

pipe = sp.Popen(['./ffmpeg.exe', '-i', …
Run Code Online (Sandbox Code Playgroud)

python opencv

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

Android Auto DHU - 等待电话

我正在尝试在我的电脑上运行桌面主机。我完全按照本指南指定的方式设置了所有内容:https://developer.android.com/training/cars/testing(尝试了 2.0 和 1.1,结果相同)。它似乎连接正确,但我无法让它显示除“等待电话”之外的任何内容。控制台显示如下:

Android Auto - Desktop Head Unit
  Build: 2020-09-20-332761970
  Version: 2.0-windows-beta

[W]: No configuration specified - using default values.
[E]: Could not load configuration from 'C:\Users\kkowalczyk\.android\headunit.ini'.
BoringSSL is the SSL implementation used in the receiver-lib.
Starting link. Requested protocol version: 1.6 (snapshot 314970161)
[I]: Connecting over ADB to localhost:5277...
[I]: connected.
> Phone reported protocol version 1.6
ssl state=TLS client read_server_hello -1
ssl state=TLS client process_change_cipher_spec -1
ssl state=SSL negotiation finished successfully 1
SSL version=TLSv1.2 …
Run Code Online (Sandbox Code Playgroud)

android android-auto

4
推荐指数
1
解决办法
4457
查看次数

使用 HTTP/2 时是否可以有多个开放的 SSE 通道?

到目前为止我只使用 HTTP/1.1,但最近我切换到 HTTP/2。在 1.1 上,我遇到了请求数量限制问题,但 HTTP/2 使用一个连接与多路复用,这是否意味着我可以保持多个 SSE 通道打开而没有问题,还是应该只使用一个具有某些内部消息路由解决方案的通道?

http server-sent-events http2

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