我正在尝试使用基于Web的TradingView平台来制作自己的自定义脚本,以显示各种金融市场属性。这可以通过其pine脚本引擎/解释器实现。
目前,我试图在主图表或指标图表上仅显示一条垂直线。但是,除非使用绘图histogram
或column
类型,否则他们的脚本引擎似乎并不支持垂直线。无论哪种方式,我都无法获得满意的评价。
一些测试
(1)bgcolor()
像这样使用取得了一些次要的成功:
//@version=3
study(title="vbar1", overlay = false)
trange(res, sess) => not na(time(res, sess))
vlinecol = #000000 // black
plot(n, color = na) // check last value from plot but don't display
vline = (n < 5710) ? na : trange("1", "0700-0701") ? vlinecol : na
bgcolor(vline, transp=0)
Run Code Online (Sandbox Code Playgroud)
结果是:
(2)plot()
与style=histogram
参数一起使用时会得到更好的结果:
//@version=3
study(title="vbar2", overlay = true) // scale=scale.none only for overlay=true
vlinecol = #000000 // black …
Run Code Online (Sandbox Code Playgroud) 因此该local.properties
文件在sdk.dir
变量中保存对Android SDK目录的引用.对我来说就是这样sdk.dir=/Users/rajkiran/Library/Android/sdk
.在我的CI计算机上,sdk.dir
指的是指向无效位置的SDK目录,因为用户名不同.
有什么方法可以将SDK目录设置为我的ANDROID_HOME
吗?
也许是这样的:sdk.dir=$ANDROID_HOME
所以在我的CI机器上,它会从环境变量设置SDK目录?
我正在尝试创建一个社交程序,其中配置文件存储在.txt文件中这里是代码的一部分:
XX = []
pl = glob.glob('*.txt')
for a in pl:
if ' pysocial profile.txt' in a:
print(a)
O = 2
XX.append(a)
if O == 2:
P = input('choose profile>')
if P in XX:
G = open(P, 'r')
print(G)
Run Code Online (Sandbox Code Playgroud)
我试试这个,但是当它执行"print(G)"部分时,它出来了:
<_io.TextIOWrapper name='Freddie Taylor pysocial profile.txt' mode='r' encoding='cp1252'>
.
如何让它读取文件?
似乎至少有3种方法可以做同样的事情.
# 1. git remote add origin https://x@bitbucket.org/x/y.git
# 2. git remote set-url origin ssh://git@bitbucket.org/x/y.git
# 3. git config --local remote.origin.url ssh://git@bitbucket.org/x/y.git
Run Code Online (Sandbox Code Playgroud)
注意:这似乎是一个重复此,但这些问题的答案是不完整的,不解释更改URL VS"远程"的区别?
编辑:
进一步谷歌搜索:从这个 SO回答:
a
remote
git基本上是一个不同存储库的书签,您可能希望从中获取或推送代码.带书签的存储库可能位于本地计算机上的不同文件夹中,位于远程服务器上,或者甚至可能是存储库本身......但最简单的类比是书签.存储库甚至不必是存储库的版本,它甚至可能是完全不相关的存储库.
与此:
origin
是不是远程仓库名.它是一个本地别名集,作为远程存储库URL的密钥.
我导入并下载了:firebase-functions
并firebase-admin
使用,npm i <package>
但它却给了我一个皮棉的错误,例如:cannot find module "firebase-functions"
。我也重新启动了vscode,但是问题仍然存在。
webpack或tsconfig可能有问题吗?
中的一些重要软件包package.json
:
{
"dependencies": {
"@angular/animations": "^5.2.3",
"@angular/cdk": "^5.1.1",
"@angular/common": "^5.2.2",
"@angular/compiler": "^5.2.2",
"@angular/core": "^5.2.2",
"@angular/forms": "^5.2.2",
"@angular/http": "^5.2.2",
"@angular/material": "^5.0.2",
"@angular/material-moment-adapter": "^5.2.3",
"@angular/platform-browser": "^5.2.2",
"@angular/platform-browser-dynamic": "^5.2.2",
"@angular/platform-server": "^5.2.3",
"@angular/router": "~5.2.2",
"core-js": "^2.5.3",
"express": "^4.16.2",
"firebase": "^4.9.1",
"firebase-admin": "~5.8.1",
"firebase-functions": "^0.8.1",
"zone.js": "0.8.18"
},
"private": true,
"devDependencies": {
"@angular/cli": "^1.6.7",
"@angular/compiler-cli": "^5.2.2",
"@angular/language-service": "^4.2.4",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": …
Run Code Online (Sandbox Code Playgroud) 我正在将一些主要的十六进制输入读取到 Python3 脚本中。但是,系统设置为使用UTF-8
,当从 Bash shell 管道传输到脚本时,我不断收到以下UnicodeDecodeError
错误:
UnicodeDecodeError: ('utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte)
sys.stdin.read()
根据其他 SO 答案,我在 Python3 中使用来读取管道输入,如下所示:
import sys
...
isPipe = 0
if not sys.stdin.isatty() :
isPipe = 1
try:
inpipe = sys.stdin.read().strip()
except UnicodeDecodeError as e:
err_unicode(e)
...
Run Code Online (Sandbox Code Playgroud)
它在使用这种方式管道时起作用:
# echo "\xed\xff\xff\x0b\x04\x00\xa0\xe1" | some.py
<output all ok!>
Run Code Online (Sandbox Code Playgroud)
但是,使用原始格式不会:
# echo -en "\xed\xff\xff\x0b\x04\x00\xa0\xe1"
???
??
# echo -en "\xed\xff\xff\x0b\x04\x00\xa0\xe1" | some.py
UnicodeDecodeError: ('utf-8' codec can't decode …
Run Code Online (Sandbox Code Playgroud) 我尝试通过 conda 包分发安装 Nvidia 的 GPU python 包,但遇到以下错误:
PackagesNotFoundError: The following packages are not available from
current channels:
- pyculib
Current channels:
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
Run Code Online (Sandbox Code Playgroud)
CuPy 和 pyculib 软件包的正确分发渠道是什么?
我想知道在 Linux 上是否可以识别文件(或链接)是否是硬链接。例如,如果我创建了:
dd if=/dev/urandom bs=1024 count=10000 of=file_10MB conv=notrunc
ln file_10MB file_10MB_link1
Run Code Online (Sandbox Code Playgroud)
我想创建一个检查函数,可以这样使用:
if is_hardlink("file_10MB_link1"):
pass
Run Code Online (Sandbox Code Playgroud)
如何使用 Python 检查文件是否为硬链接?
我尝试为Framework版本4.7.2
和.NET 安装 .NET SDK 4.8
。但是,这似乎不可能,因为无法指定版本,甚至无法获取多个版本的搜索结果。(实际上 winget 包Microsoft.dotNetFramework
最终让我 v.. 4.8
)
我本希望能够通过以下方式找到这些:
winget search "SDK"
winget search "DotNet"
Run Code Online (Sandbox Code Playgroud)
但没有运气。
我还期望我可以使用这样的东西:
winget install --id Microsoft.WindowsSDK --version 4.7.2
winget install --id Microsoft.WindowsSDK --version 4.8
Run Code Online (Sandbox Code Playgroud)
但这没有任何结果,因为这些包没有任何Id
.
只有在手动安装和软件包之后,它们才会显示。ndp472-devpack-enu.exe
ndp48-devpack-enu.exe
$ winget.exe list --name "Microsoft .NET"
Name Id Version Source
------------------------------------------------------------------------------------------------------------
Microsoft .NET Framework 4.8 SDK {949C0535-171C-480F-9CF4-D25C9E60FE88} 4.8.03928
Microsoft .NET Framework 4.8 Targeting Pack {BAAF5851-0759-422D-A1E9-90061B597188} 4.8.03761
Microsoft .NET Framework 4.8 Targeting Pack …
Run Code Online (Sandbox Code Playgroud) 我正在尝试从最初用于另一个(可能是基于 Debian 的)Linux 发行版的 github 存储库安装基于 Python 的软件包。
程序好像用的是Python2,导入如下:
import argparse
import logging
import Queue
import collections
import ConfigParser
import os
import socket
import random
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
from multiprocessing import Process, Queue as MPQueue, Event
...
def notif(msg):
Notify.init("TheProg")
notice = Notify.Notification.new("Critical !", msg)
notice.set_urgency(2)
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试运行该程序时,我得到了这个:
$ python2 main.py -h
Traceback (most recent call last):
File "main.py", line 11, in <module>
gi.require_version('Notify', '0.7')
File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 100, in require_version
raise ValueError('Namespace %s not available' …
Run Code Online (Sandbox Code Playgroud)