我想安装一些库来学习机器学习。我说我需要升级 pip,但是当我尝试安装它时
$ pip install --upgrade pip
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.2
Uninstalling pip-8.1.2:
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 736, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 742, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, …Run Code Online (Sandbox Code Playgroud) 我目前正在使用Angular 5进行Web项目,并且我想集成Firebase Cloud Messaging以在应用程序上发送通知,但是我遇到了许多我试图修复它们的问题。现在有两个我无法修复的错误:Namespace 'firebase.auth'和functions
错误看起来像:
ERROR in node_modules/angularfire2/auth/auth.d.ts(12,45): error TS2694: Namespace 'firebase.auth' has no exported member 'IdTokenResult'.
node_modules/angularfire2/firebase.app.module.d.ts(2,42): error TS2305: Module '"/Users/gerardtalla/dev/workspaces/ws-parcaune/pms/pms-frontend-2018/node_modules/firebase/app/index"' has no exported member 'functions'.
Run Code Online (Sandbox Code Playgroud)
我该如何解决?我正在使用
角度5
“ firebase”:“ 4.8.0”
“ angularfire2”:“ ^ 5.0.0-rc.5”
“ @ angular / cli”:“〜1.7.3”
如果有人有一个想法不要犹豫,请与我分享。在此先多谢。
firebase google-cloud-functions firebase-cloud-messaging angular5 angular-cli-v6
更新资料
感谢wf9a5m75的回答。我对API密钥有误解。Android和IOS API密钥是从Google Cloud Platform Console(https://cloud.google.com/maps-platform/)生成的。 我使用的是适用于Google Maps Javascript的https://console.developers.google.com/,这就是为什么当我在Web应用程序上测试API密钥时可以使用,但不适用于移动设备的原因。
对于遵循Ionic本机google地图指南的任何人,请使用https://cloud.google.com/maps-platform生成您的密钥
原始问题:
离子原生Google地图无法正确显示地图。我遵循了Ionic本机google地图指南 ,已使用以下方法安装了最新的Ionic本机google地图:
npm install @ionic-native/google-maps
Run Code Online (Sandbox Code Playgroud)
通过添加API密钥
ionic cordova plugin add cordova-plugin-googlemaps \
--variable API_KEY_FOR_ANDROID="..." \
--variable API_KEY_FOR_IOS="..."
Run Code Online (Sandbox Code Playgroud)
已为Android和IOS启用Maps SDK。
我测试过 ionic cordova run ios -l -c --target="iPhone-7"
花了几个小时删除所有软件包和平台并重新添加它们,但没有任何效果
我在网上搜索它说不正确的API KEY导致了此问题,但是我在可以正确显示地图的Web应用程序上尝试了相同的密钥。
有人可以帮忙吗?谢谢!
google-maps google-cloud-platform ionic-framework ionic-native ionic3
我正在处理HTTP请求,该请求将POST请求发送到Canada Post API以查询运输报价:
getRates(weight: number, originPostal, destPostal) {
const options = {
headers: new HttpHeaders({
'Authorization': 'Basic ' + btoa(this.TEST_USERNAME + ':' + this.TEST_PASSWORD),
'Accept': 'application/vnd.cpc.ship.rate-v3+xml',
'Content-Type': 'application/vnd.cpc.ship.rate-v3+xml',
'Accept-language': 'en-CA',
}),
};
const body = `
<?xml version="1.0" encoding="utf-8"?>
<mailing-scenario xmlns="http://www.canadapost.ca/ws/ship/rate-v3">
<customer-number>${this.TEST_NUMBER}</customer-number>
<parcel-characteristics>
<weight>${weight}</weight>
</parcel-characteristics>
<origin-postal-code>${originPostal}</origin-postal-code>
<destination>
<domestic>
<postal-code>${destPostal}</postal-code>
</domestic>
</destination>
</mailing-scenario>
`;
return this.http.post<any>(this.TEST_URL, body, options)
}
Run Code Online (Sandbox Code Playgroud)
查询在Postman上工作正常,而不适用于Ionic项目(ionic serve和ionic run -l).我在网上搜索它是一个CORS问题Http失败响应(未知网址):0未知错误,我已将下面添加到ionic.config.json文件中
"proxies": [
{
"path": "/price",
"proxyUrl": "https://ct.soa-gw.canadapost.ca/rs/ship/price"
}
]
Run Code Online (Sandbox Code Playgroud)
API密钥,URL由加拿大邮政提供,可在 …
更新
# access to the container
kubectl exec -it -c integration my-route-80b4cb7566-v6l7m /bin/sh
# go to directory
cd /tmp
Run Code Online (Sandbox Code Playgroud)
Squake 和 Nicola 的答案都工作正常。要检查生成的日志文件,您需要访问容器并检查正确的目录:
原始问题
我有一个与 kamel 一起运行的集成 Pod:
kamel run MyRoute.java
Run Code Online (Sandbox Code Playgroud)
我已登录路线
from("...")
.log("my log message")
Run Code Online (Sandbox Code Playgroud)
我可以使用命令检查日志行:
kubectl logs my-route-85d7f65c96-rmb4z --tail=10
Run Code Online (Sandbox Code Playgroud)
然后我就可以使用以下命令访问 pod:
kubectl exec -it -c integration my-route-85d7f65c96-rmb4z /bin/sh
Run Code Online (Sandbox Code Playgroud)
我尝试检查文件夹/var/log,不幸的是没有相关的日志文件。
我对此有两个问题:
谢谢
我之前尝试过类似问题的链接,但它不起作用.所以我在这里发帖子.
我有时间格式:
09:47:11:895799
Run Code Online (Sandbox Code Playgroud)
它存储varchar(50)在我的Microsoft SQL Server数据库中.
我正在尝试将其转换为此链接上的时间格式.
hh:mm:ss[.nnnnnnn]
Run Code Online (Sandbox Code Playgroud)
你能帮忙吗?
我使用的是Ubuntu 12.04,快捷键Ctrl + Window +左箭头/右箭头是向左和向右移动和缩放当前窗口,现在我切换到Fedora 20并且找不到快捷方式,有没有人知道如何设置这个热键?
例如,以下是Ubuntu中的快捷方式,我想知道如何使它在Fedora中工作:
最大化左/右/全屏= Ctrl + WindowsButton +(左/右/向上箭头)
将窗口移动到不同的工作区= shift + Ctrl + alt +(箭头)
Swich工作区= ctrl + alt +(箭头)
我是 sed 的新手,总是在输入文件上执行一个命令,最近我尝试使用它"-e"来处理多个命令,但我无法弄清楚它是如何工作的,默认打印非常烦人,所以我无法弄清楚命令执行的顺序。
sed -e 'command 1' -e 'command 2' input.txt
Run Code Online (Sandbox Code Playgroud)
input.txt的内容:
line1
line2
line3
Run Code Online (Sandbox Code Playgroud)
问题1:处理流程是怎样的?是吗
command1 processes line1 and then command2 processes new-line1(processed by cmd1)
command1 processes line2 and then command2 processes new-line2(processed by cmd1)
command1 processes line3 and then command2 processes new-line3(processed by cmd1)
Run Code Online (Sandbox Code Playgroud)
或者
command1 processes line1
command1 processes line2
command1 processes line3
command2 processes new-line1(already processed by cmd1)
command2 processes new-line2(already processed by cmd1)
command2 processes new-line3(already processed by cmd1)
Run Code Online (Sandbox Code Playgroud)
问题 2: 正如我提到的,默认打印非常烦人,我应该在第一个 …
我读了接口Map的JavaDoc,它说:
Collections Framework接口中的许多方法都是根据equals方法定义的.例如,对于规范
containsKey(Object key)法说:"返回true当且仅当此映射包含一个键的映射关系k,使得(key==null ? k==null : key.equals(k))".不应将此规范解释为暗示Map.containsKey使用非null参数调用key将导致key.equals(k)对任何键调用k.实现可以自由地实现优化,从而equals避免调用,例如,通过首先比较两个密钥的哈希码.(该Object.hashCode()规范保证具有不等哈希码的两个对象不能相等.)
我的理解是在containsKey()调用时,都会调用hashCode()和equals(),因此我编写了自己的代码来测试它.
HappyDay类将作为键存储在HashMap中,我重写hashCode()和equals()方法,并添加System.out.println("invoking hashCode()" + this.happyHour);并System.out.println("invoking equals()");检查方法是否被调用.
public class HappyDay {
private final int happyHour;
public HappyDay(int hh) {
this.happyHour = hh;
}
public int getHappyHour() {
return this.happyHour;
}
@Override
public boolean equals(Object o) {
System.out.println("invoking equals()");
if (o == null) {return false;}
if (o == …Run Code Online (Sandbox Code Playgroud) ionic3 ×2
angular ×1
angular5 ×1
apache-camel ×1
cors ×1
equals ×1
fedora ×1
firebase ×1
frontend ×1
google-maps ×1
hashmap ×1
ionic-native ×1
java ×1
javascript ×1
pip ×1
python ×1
python-2.7 ×1
sed ×1
shortcut ×1
sql ×1
sql-server ×1
terminal ×1
ubuntu ×1