小编Tam*_*mpa的帖子

Nativescript Angular2教程导致错误

我在Angular2教程中遇到以下错误.TNS医生还可以,为什么会出现以下错误?

'tns livesync ios --emulator --watch
Executing before-prepare hook from /Users//Documents/frontend/sample-Groceries/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 1.8.10
Project successfully prepared (ios)
Executing before-livesync hook from /Users//Documents/frontend/sample-Groceries/hooks/before-livesync/nativescript-angular-sync .js
Transferring project files...
Successfully transferred all files.
Applying changes...
Successfully synced application org.nativescript.groceries on device D28D29C3-07B6-4B60-B4B0-711475C505DE.
Executing before-watch hook from /Users//Documents/frontend/sample-Groceries/hooks/before-watch/nativescript-dev-typescript.js
Found peer TypeScript 1.8.10
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: 1   0x105cd08d7 -[TNSRuntime executeModule:]
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: 2   0x10587b6d2 main
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: 3   0x109be668d start
Sep 17 07:34:37 Davids-iMac sampleGroceries[2934]: …
Run Code Online (Sandbox Code Playgroud)

nativescript angular2-nativescript

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

使用标签从github安装NPM

我需要从git中对我的angular2项目进行npm安装,但是使用tag = 6.0.0的标签.

例如

git git@github.com:akveo/ng2-smart-table.git
cd ng2-smart-table
git checkout tags/v0.6.0-0
Run Code Online (Sandbox Code Playgroud)

我怎么做相当于:

  npm install --save PACKAGE_NAME




npm install git@github.com:akveo/ng2-smart-table.git#v0.6.0-0 
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/Cellar/node/6.5.0/bin/node" "/usr/local/bin/npm" "install" "git@github.com:akveo/ng2-smart-table.git#v0.6.0-0"
npm ERR! node v7.0.0
npm ERR! npm  v3.10.8

npm ERR! Unsupported URL Type: github.com:akveo/ng2-smart-table.git#v0.6.0-0
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
Run Code Online (Sandbox Code Playgroud)

git github npm angular

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

Flask、Bcrypt - 导入错误:没有名为 ext.bcrypt 的模块

为什么会出现以下情况?

from flask import Flask
from flask.ext.bcrypt import Bcrypt

 Python 2.7.12 (default, Dec  4 2017, 14:50:18) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from flask import Flask
>>> from flask.ext.bcrypt import Bcrypt
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named ext.bcrypt
Run Code Online (Sandbox Code Playgroud)

我安装了flask-bcrypt:

pip install Flask-Bcrypt
Requirement already satisfied: Flask-Bcrypt in /usr/local/lib/python2.7/dist-packages (0.7.1)
Requirement already satisfied: Flask in /usr/local/lib/python2.7/dist-packages (from Flask-Bcrypt) (1.0.2)
Requirement already satisfied: bcrypt …
Run Code Online (Sandbox Code Playgroud)

python flask python-2.7

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

Python,协议缓冲区,以及使嵌套消息和重复字段工作

我试图在python中使用协议缓冲区提交响应.以下是结构.

message BidResponse {
  message Ad {
    optional string html_snippet = 1;
    message TemplateParameter {
      optional string parameter_value = 1;
      optional string blank_ad_parameter_value = 8;
      optional string buyer_creative_id = 2;
      optional string click_through_url = 3;
      optional int32 left = 4;
      optional int32 right = 5;
      optional int32 top = 6;
      optional int32 bottom = 7;
      optional int32 backup_index = 9;
    };
    repeated TemplateParameter template_parameter = 13;
    repeated string click_through_url = 4;
    repeated int32 vendor_type = 5;
    message AdSlot {
      required …
Run Code Online (Sandbox Code Playgroud)

python protocol-buffers

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

Flask-Babel -0 pybabel:错误:未知语言环境“jp”

我在使用 Flask-babel 时遇到了问题。我无法创建日语翻译。

pybabel:错误:未知语言环境“jp”

这是 Flask-Babel 问题吗?

当一种语言不存在时,这是同样的错误。但是,德语作品。所以.....babel nit 支持日语吗?

有没有支持像日语这样的主要语言的 Babel 替代品?

python flask flask-babel python-babel

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

python和树的快速查找,其中节点具有多个属性和值

我需要一个非常快的python中的树对象。查找的速度比内存更重要。叶节点是我想要的值。因此,如果给定 state=NY、postion=3、hourOfDay=2 和 dayOfWeek=3,我需要快速获得值 =100。带 * 的节点是叶节点。

0) root
    1) {state: [NY,LA]}
        2) {howOfDay:[1,2,3,4,5], postion:[1,2,3]}
                             *3) {dayOfWeek:[234]} => value:100
            4) {state: [FL,NV,……rest of the states]}
                5) {howOfDay:[1,6,7,8,9….23]}
                      *6) {dayOfWeek:[1,5,6,7]} => value:120
Run Code Online (Sandbox Code Playgroud)

在我的数据库中,我的数据看起来像这样,属性为 json 对象。

parent child attribute value

0 1 state NY,LA
1 2 {howOfDay:[1,2,3,4,5], postion:[1,2,3]}
2 3 dayOfWeek dayOfWeek [2,3,4] 100
0 3 state  [FL,NV,……rest of the states]
4 5 howOfDay:[1,6,7,8,9….23]
5 6 dayOfWeek:[1,5,6,7] 120
Run Code Online (Sandbox Code Playgroud)

那么,我应该使用什么 python 库和树结构来最好地找到一个值?如何将数据转换为最好的快速查找?

python tree binary-tree hashtable binary-search-tree

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

redis py 和 hgetall - 为什么键值有 b""?

下面是 redis 的 dict 返回。为什么是b?我该如何摆脱它?

data = r_client.hgetall(key)
{b'test1:r': b'2', b'test2:f': b'2'}

print('test1:r' in data)
False

print(b'test1:r' in data)
True
Run Code Online (Sandbox Code Playgroud)

当我从 redis 获取数据时,如何摆脱那个可怕的 b?

我的意思是我必须这样做才能得到我想要的:

new_data = {}
for key,value in data.items():
    new_data[key.decode()] = value.decode()
Run Code Online (Sandbox Code Playgroud)

python redis python-3.x

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

函数不会返回多个返回值 - 单值上下文中的多值

Go拒绝返回多个退货.如果我遗漏了第二次返回它可以工作,但我需要第二次返回.我该如何解决?

这是我的电话:

type Streaming struct{}

func main() {
    mySlice, dateList = getHgetallStreamingData()
}
Run Code Online (Sandbox Code Playgroud)

这是我的功能:

func getHgetallStreamingData(pair string, c redis.Conn) ([]Streaming, []time.Time) {    
    var mySlice []Streaming
    var dateList []time.Time
    return mySlice, dateList
 }
Run Code Online (Sandbox Code Playgroud)

这是我的错误:

multiple-value getHgetallStreamingData() in single-value context
Run Code Online (Sandbox Code Playgroud)

go

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

如何在for循环中创建持续时间-(不匹配的类型int和time.Duration)

我有一个循环,我从一个时间开始。时间和我要增加一分钟的时间。

 for idx := range keys {
    var a = idx * time.Minute
    var t = tInit.Add(time.Minute * a)
    fmt.Println(t, idx)


 }
Run Code Online (Sandbox Code Playgroud)

这是我的错误

invalid operation: idx * time.Minute (mismatched types int and time.Duration)
Run Code Online (Sandbox Code Playgroud)

go

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

我怎么做git pull?

请..有人可以解释一下吗?所以...... git pull不起作用.然后我指定要拉的分支.

git pull development
fatal: 'development' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
ubuntu@ubuntu:~/workspace/myrepo git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.development.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

If you often merge …
Run Code Online (Sandbox Code Playgroud)

git github

-2
推荐指数
1
解决办法
982
查看次数