小编Jam*_*s Z的帖子

从自表更新表,其中列中的值不为空

我有一个包含值的表:

dbid    name         userid
------------------------------
154     xyz          NULL
987     xyz          NULL
777     xyz          5
111     abc          NULL
745     abc          NULL
748     abc          6
Run Code Online (Sandbox Code Playgroud)

预期输出:

dbid     name     userid
------------------------------
154     xyz          5
987     xyz          5
777     xyz          5
111     abc          6
745     abc          6
748     abc          6
Run Code Online (Sandbox Code Playgroud)

userid 列中除一个名称对应的值外,所有空值均为空。我想在 userid 中为 name = 'xyz' 的所有行设置 5。同样,想要更新表以在 userid 中设置 6,其中 name = 'abc'。

对于上述场景,更新表的查询应该是什么?

注意:以上只是一个例子。我有一个包含数十万条记录的表。我无法在查询中写入 id 5 或 6。

sql t-sql sql-server sql-update

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

将“nomodule”属性动态添加到 <script nomodules src="abc.com">

我想动态生成这样的脚本标签:

对于 'async' 和 'defer' 我知道我们可以执行以下操作:我们可以像下面那样执行“s.async=true”或“s.defer=true”。

  function script(url) {
            var s = document.createElement('script');

            s.async = true;
            s.src = url; 
            console.log(s);
            var x = document.getElementsByTagName('head')[0];
            x.appendChild(s);
          }
Run Code Online (Sandbox Code Playgroud)

获取动态生成的标签,如 <script async src="abc.com"></script>

但是对于'nomodules',我没有得到想要的结果。我试图做“s.nomodule=true”但无济于事。我尝试执行以下操作。

 function script(url) {
            var s = document.createElement('script');

            s.nomodule = true;
            s.src = url; 
            console.log(s);
            var x = document.getElementsByTagName('head')[0];
            x.appendChild(s);
          }

Run Code Online (Sandbox Code Playgroud)

但我只得到 <script src="abc.com"></script>

我怎样才能得到像

<script nomodule src="abc.com"></script> 动态。

javascript ecmascript-6

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

如何使用 jquery 在 angular 7 中使用 bootstrap popover?

我正在尝试在 angular7 中使用 jquery 实现 bootstrap4 popover。我在 index.html 中包含了“popper.js”,也使用 npm 包含了。但它不起作用。

未捕获的类型错误:jquery__WEBPACK_IMPORTED_MODULE_2__(...).popover 不是函数

此错误仅出现在控制台中。

HTML:(sample.component.html)

<button id="option2" autocomplete="off" data-toggle="popover"> Public</button>
Run Code Online (Sandbox Code Playgroud)

Jquery: (sample.component.ts)

import { Component, OnInit } from '@angular/core';
import * as $ from 'jquery';

@Component({
  selector: 'app-sample',
  templateUrl: './sample.component.html',
  styleUrls: ['./sample.component.css']
})
export class SampleComponent implements OnInit {

  constructor() { }   
  ngOnInit() {   
    $(document).ready(function(){   
      $('[data-toggle="popover"]').popover();     
      $('#option2').popover({
         html: true,
        content: function() {
          return $("#div").html();
        },
         placement: 'bottom'
      });            
    });
  }
Run Code Online (Sandbox Code Playgroud)

如何在 angular 7 中实现 bootstrap popover?

jquery popover bootstrap-4 angular7

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

ng new give "npm ERR! code EINTEGRITY required sha1 but found sha512"

我正在尝试在 Angular 7 中创建一个新项目,但出现以下错误。

npm 错误!代码完整性 npm ERR!SHA1-SKjl7xiAdhfuK14zwRlMNbQ5Ukw =完整性校验使用SHA1时失败:想SHA1-SKjl7xiAdhfuK14zwRlMNbQ5Ukw =却得到了sha512-3ds0bW0f5xtxepS3MKBqKiG2i93CTT5cG6vlfsoFDIps7lzcSnZweu3t15S90EacDpenHFyAQdpJlCaMpyLROA == SHA1-X4ctB1ciOMPTjjyMj8IQXIHbMBU =。(197 字节)

在我的系统上尝试了所有可能的解决方案,但没有一个能帮助我。

以下是我尝试过的解决方案列表。

  • nmp 安装最新
  • 清除缓存
  • 删除 node_modules
  • 强制清除缓存
  • 卸载 angular 并重新安装 angular

node.js angular-cli angular

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

复合流(来自 Sink 和 Source)的目的是什么?

我正在尝试从网站上了解复合流(来自接收器和源),它们表示如下:

在此输入图像描述

有人可以提供一个使用复合流的例子吗?
我应该什么时候使用它?

akka akka-stream

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

Knime CSV Reader 中出现“数据元素太少”错误

执行包含大约 400k 行的 CSV 文件时收到以下错误

错误:

错误 CSV 读取器 2:1 执行失败:数据元素太少(行:2 (Row0),源:'file:/Users/shobha.dhingra/Desktop/SBC:Non%20SBC/SBC.csv')

我尝试用几行执行另一个 csv 文件,没有遇到问题。

csv file knime

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

如何在 Flutter 中将浮动操作按钮移动到屏幕的左侧?

默认情况下,浮动操作按钮位于屏幕右侧。我知道, , 之floatingActionButtonLocation类的和它的属性,但没有一个能帮助我将它移动到屏幕的左侧。endDockedstartDockedcenterDocked

floating-action-button flutter flutter-layout

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

使用 OpenCV 从图像中检测和提取签名

我正在导入附加的图像。导入图像后,我想删除水平线,检测签名然后提取它,在签名周围创建矩形,裁剪矩形并保存。

我正在努力将签名的整个区域识别为一个轮廓或一组轮廓。

我已经尝试过findcontour各种方法来检测签名区域。请参考下面的代码。

Python脚本:

imagePath

#read image
image = cv2.imread(imagePath,cv2.COLOR_BGR2RGB)

#Convert to greyscale
gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) # grayscale

#Apply threshold
ret,thresh1 = cv2.threshold(gray, 0, 255,cv2.THRESH_OTSU|cv2.THRESH_BINARY_INV)

plt.imshow(thresh1,cmap = 'gray')


#preprocessing
rect_kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (15,15))
dilation = cv2.dilate(thresh1, rect_kernel, iterations = 1)
plt.imshow(dilation,cmap = 'gray')


#Detect contours
contours, hierarchy = cv2.findContours(dilation, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
contours[0]

height, width, _ = image.shape
min_x, min_y = width, height
max_x = max_y = 0   
for contour, hier in zip(contours, hierarchy):
    (x,y,w,h) = cv2.boundingRect(contour)
    min_x, max_x …
Run Code Online (Sandbox Code Playgroud)

python opencv image-processing signature contour

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

禁用右键单击嵌入元素内的 pdf

我有一个embed元素,我在其中提供了pdf文件路径。我想防止它被下载。

<embed src="test.pdf" width="760" height="800" oncontextmenu="return false" />
Run Code Online (Sandbox Code Playgroud)

但是当我右键单击该 t 时,我可以选择保存和打印 pdf。我想阻止这些选项。

我试过

<script type="text/javascript">
    document.addEventListener("contextmenu", function (e) {
        e.preventDefault();
    }, false);
</script>
Run Code Online (Sandbox Code Playgroud)

但它禁用右键单击除 PDF 之外的整个页面。

html javascript pdf

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

如何在Anaconda3中安装pyttsx?

如何在Anaconda3(Python3.7)Windows 10机器上安装pyttsx?我尝试安装但出现错误

ERROR: Could not find a version that satisfies the requirement pyttsx3 (from versions: none)
ERROR: No matching distribution found for pyttsx3

C:\Users\Ramesh\Anaconda3\Scripts>pip install pyttsx3
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting pyttsx3
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/pyttsx3/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken …
Run Code Online (Sandbox Code Playgroud)

python python-3.x anaconda windows-10

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