小编Ror*_*ach的帖子

Framework的Info.plist中没有CFBundleIdentifier

在安装和运行cocoapods之后,我的Bridge.h导入问题找到了预期的目标.

我有:

#import <TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h>
#import <DateTools/DateTools.h>
Run Code Online (Sandbox Code Playgroud)

但它没有用,因为我的Headers文件夹是空的,所以我将这两个文件夹复制到Headers文件夹并硬编码路径:

#import </Users/username/Documents/new_ios/ios-app/Pods/Headers/TPKeyboardAvoiding/TPKeyboardAvoidingScrollView.h>
#import </Users/username/Documents/new_ios/ios-app/Pods/Headers/DateTools/DateTools.h>
Run Code Online (Sandbox Code Playgroud)

这工作和应用程序构建,但当我运行它时,它给出了这个错误: The operation couldn’t be completed. (LaunchServicesError error 0.)

这是控制台输出:

6/2/16 4:41:24.961 PM uploadDSYM[3519]: Fabric.framework/run 1.4.0
6/2/16 4:41:24.981 PM uploadDSYM[3521]: Fabric.framework/run 1.4.0
6/2/16 4:41:25.011 PM appleeventsd[51]: SecTaskLoadEntitlements failed error=22
6/2/16 4:41:25.019 PM sharedfilelistd[251]: SecTaskLoadEntitlements failed error=22
6/2/16 4:41:25.093 PM Fabric[257]: Bundle indentifier is of type (null), returning empty string.
6/2/16 4:41:25.752 PM com.apple.CoreSimulator.CoreSimulatorService[331]: Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=MissingBundleIdentifier, ErrorDescription=Bundle at path /Users/username/Library/Developer/CoreSimulator/Devices/#####-####-####-####-##########/data/Library/Caches/com.apple.mobile.installd.staging/temp.16rUWf/extracted/AppName.app/Frameworks/TPKeyboardAvoiding.framework did not have a CFBundleIdentifier in its …
Run Code Online (Sandbox Code Playgroud)

xcode ios cocoapods swift

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

psycopg2将python字典插入为json

我想将一个python字典作为json插入到我的postgresql数据库中(通过python和psycopg2).我有:

thedictionary = {'price money': '$1', 'name': 'Google', 'color': '', 'imgurl': 'http://www.google.com/images/nav_logo225.png', 'charateristics': 'No Description', 'store': 'google'}

cur.execute("INSERT INTO product(store_id, url, price, charecteristics, color, dimensions) VALUES (%d, %s, %s, %d, %s, %s)", (1,  'http://www.google.com', '$20', thedictionary, 'red', '8.5x11'))
Run Code Online (Sandbox Code Playgroud)

它给出了错误消息:

thedictionary = {'price money': '$1', 'name': 'Google', 'color': '', 'imgurl': 'http://www.google.com/images/nav_logo225.png', 'charateristics': 'No Description', 'store': 'google'}

cur.execute("INSERT INTO product(store_id, url, price, charecteristics, color, dimensions) VALUES (%d, %s, %s, %d, %s, %s)", (1,  'http://www.google.com', '$20', thedictionary, 'red', '8.5x11'))
Run Code Online (Sandbox Code Playgroud)

我不知道如何从这里开始.我在互联网上找不到关于如何做这种事情的事情,我对psycopg2很新.

python postgresql dictionary psycopg2

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

lxml永远不会在ubuntu上完成构建

我在vwmare上运行ubuntu 14.04 LTS和python 2.7.5.

当我跑:

sudo pip install lxml
Run Code Online (Sandbox Code Playgroud)

我明白了:

Collecting lxml
  Using cached lxml-3.4.4.tar.gz
Building wheels for collected packages: lxml
  Running setup.py bdist_wheel for lxml
Run Code Online (Sandbox Code Playgroud)

永远运行.

我找不到与此相关的任何资源,也没有任何类似错误的经验.

注意,下面的解决方案不起作用:

sudo apt-get build-dep -y lxml;
pip install lxml
Run Code Online (Sandbox Code Playgroud)

我也尝试过:

sudo apt-get install -y build-essential python-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version.
python-dev is already the newest version.
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic …
Run Code Online (Sandbox Code Playgroud)

python ubuntu lxml

14
推荐指数
2
解决办法
8208
查看次数

mysql由一个字符更新

我正在使用mysql并在变量image_url'success'的表'items'更新中没有警告.但是,实际上,更新失败了:它用空格预先设置了值并删除了我给它的值的最后一个字符.

这是更新:

UPDATE items
    SET image_url = 'http://ecx.images-amazon.com/images/I/61Dz5t8wjQL._SX522_.jpg'
    WHERE id=38;
Run Code Online (Sandbox Code Playgroud)

这是选择:

select * from items\G;
Run Code Online (Sandbox Code Playgroud)

这是输出的一行:

...
image_url:  http://ecx.images-amazon.com/images/I/61Dz5t8wjQL._SX522_.jp
...
Run Code Online (Sandbox Code Playgroud)

注意末尾缺少的'g'和开头的额外空格.

我怎么阻止这个?

以下是一些可能有用的系统信息:

mysql> show variables LIKE '%version%';
+-------------------------+-------------------------+
| Variable_name           | Value                   |
+-------------------------+-------------------------+
| innodb_version          | 5.5.46                  |
| protocol_version        | 10                      |
| slave_type_conversions  |                         |
| version                 | 5.5.46-0ubuntu0.14.04.2 |
| version_comment         | (Ubuntu)                |
| version_compile_machine | i686                    |
| version_compile_os      | debian-linux-gnu        |
+-------------------------+-------------------------+
7 rows in set (0.00 sec)
Run Code Online (Sandbox Code Playgroud)

编辑1表描述:

mysql> desc …
Run Code Online (Sandbox Code Playgroud)

mysql sql sql-update

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

如何在移动引导程序中查看侧栏时将其添加到导航栏

我有一个使用bootstrap的网站.它在导航栏的顶部有一个搜索栏,在移动设备上会折叠.

在导航栏下方,我左侧有2列,大约有30个单选按钮,用于选择某些搜索过滤器.其他10列显示搜索结果.

在移动设备上,用户必须向下滚动所有列才能查看搜索结果.我怎么能有单选按钮"崩溃到导航栏"时,该网站是在移动设备上,这样的单选按钮不显示,直到用户点击导航栏图标.(导航栏图标是3条水平线).

导航栏:

...
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
  <form class="navbar-form navbar-left" action="search.php" method="post">
    <div class="form-group">
      <input type="text" class="form-control" name="search_title" placeholder="Search">
    </div>
    <button type="submit" class="btn btn-default">Search</button>
   ...
Run Code Online (Sandbox Code Playgroud)

左栏:

<div class="row">
    <div class="col-sm-2">
        <p class="filter-heading" >Site</p>
        <label for="aa-site">
          <input class="site-radio" type="radio" name="store" value="every-site" id="aa-site" checked> All</label></br>
        <label for="bb-site">
          <input class="site-radio" type="radio" name="store" value="wallapop" id="bb-site"> Wallapop</label></br>

  ...
    </div>

  </form>
  <div class="col-sm-10">
    <div class="panel-body center">
...
Run Code Online (Sandbox Code Playgroud)

html css jquery twitter-bootstrap

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

使用for循环和名称列表在python中导入文件

我正在尝试导入许多文件。我有一个字符串列表(myList),这些字符串是我要导入的模块文件的名称。我要导入的所有文件都在名为parentDirectory的目录中。该目录位于此代码所在的文件夹中。

到目前为止,我有:

myList = {'fileOne', 'fileTwo', 'fileThree'}
for toImport in myList:
    moduleToImport = 'parentDirectory.'+toImport
    import moduleToImport
Run Code Online (Sandbox Code Playgroud)

这段代码只是将moduleToImport视为模块的名称,但是我希望代码理解它是字符串的变量。

This is the Error Code:
dule>
    import moduleToImport
ImportError: No module named moduleToImport
Run Code Online (Sandbox Code Playgroud)

python string python-import

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

用于Selenium Scraping的Mozilla Firefox命令行安装

嗨,我有一个本地运行的刮刀,但是当尝试使用Vagrant机器将其启动到AWS EC2 linux环境时,我遇到了以下问题.

当我通过在Linux上运行测试它时,我能够直接与Firebug一起下载linux,然后运行我的Selenium webdriver.在这种情况下,我正在编写一个包含必要安装的文件.我遇到了麻烦,但由于缺乏能够直接从命令行安装firefox(以及firebug).

这是我的工作者的错误看起来(它在我安装了firefox的本地机器上运行正常,并在安装了它的linux上运行):

[worker]     " Please specify the firefox binary location or install firefox")
[worker] RuntimeError: Could not find firefox in your system PATH. Please specify the firefox binary location or install firefox
Run Code Online (Sandbox Code Playgroud)

我目前正在运行这样的东西来创建正确的开发环境.我以为我可以用Mozmill重新创建firefox.有没有人遇到/解决了这个?

  • sudo easy_install pip
  • sudo pip install selenium
  • sudo pip install mozmill

我需要安装Firefox和Firebug的命令行.谢谢!

进展:

我现在正在使用sudo apt-get install firefox我认为可行的.我无法测试它实际运行,也没有使firebug和网络导出工作.我尝试过,sudo apt-get install firebug但无法找到.它据说在这里工作:http://www.daveshuck.com/2008/05/06/firebug-with-firefox-3-in-ubuntu-hardy-heron/然而它对我不起作用?

python linux firefox firebug selenium

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

beautifulsoup .get_text()对我的HTML解析不够具体

鉴于下面的HTML代码,我希望只输出h1的文本,而不是输出"Details about",这是span的文本(由h1封装).

我当前的输出给出:

Details about   New Men's Genuine Leather Bifold ID Credit Card Money Holder Wallet Black
Run Code Online (Sandbox Code Playgroud)

我想要:

New Men's Genuine Leather Bifold ID Credit Card Money Holder Wallet Black
Run Code Online (Sandbox Code Playgroud)

这是我正在使用的HTML

<h1 class="it-ttl" itemprop="name" id="itemTitle"><span class="g-hdn">Details about  &nbsp;</span>New Men&#039;s Genuine Leather Bifold ID Credit Card Money Holder Wallet Black</h1>
Run Code Online (Sandbox Code Playgroud)

这是我目前的代码:

for line in soup.find_all('h1',attrs={'itemprop':'name'}):
    print line.get_text()
Run Code Online (Sandbox Code Playgroud)

注意:我不想仅截断字符串,因为我希望此代码具有一些可重用性.什么是最好的是一些代码,用于裁剪任何由跨度限制的文本.

html python regex beautifulsoup

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

nginx错误:(13:权限被拒绝)连接到上游时)

我在使用ubuntu 14.04 LTS的谷歌计算引擎VM上运行带有puma,capistrano和nginx的rails应用程序.

我在外部IP上运行nginx.当我访问它时,我在日志中得到两个nginx错误:

2016/02/03 11:58:07 [info] 19754#0: *73 client closed connection while waiting for request, client: ###.##.##.###, server: 0.0.0.0:443

2016/02/03 11:58:07 [crit] 19754#0: *74 connect() to unix:///home/my-user-name/apps/my-web-app/shared/tmp/sockets/my-web-app-puma.sock failed (13: Permission denied) while connecting to upstream, client: ###.##.##.###, server: , 
request: "GET / HTTP/1.1", upstream: "http://unix:///home/my-user-name/apps/my-web-app/shared/tmp/sockets/my-web-app-puma.sock:/", host: "###.###.###.###"
Run Code Online (Sandbox Code Playgroud)

注意:最后一个###.###.###.###是运行代码的google计算VM的外部IP.我相信前两个IP是我的家庭IP.

我试过:setsebool httpd_can_network_connect on按照这里的建议: (13:权限被拒绝)连接到上游时:[nginx] 它返回了:setsebool: SELinux is disabled.但问题仍然存在.

连接到上游时看了(13:权限被拒绝):[nginx],但它似乎是特别的uwsgi

这是我的nginx.conf

upstream puma {
  server unix:///home/my-user-name/apps/my-web-app/shared/tmp/sockets/my-web-app-puma.sock;
}
server {
  listen 80 default_server deferred; …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails nginx google-compute-engine puma

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

Swagger 基本路径与 kubernetes 扇出路径

设置

我使用 kubernetes 将用户发送到在某些端口上运行内容的容器。

例如,对于我在 port 上的 pod 中的容器上运行的东西8080,用户转到www.example.com/mt,然后/mt将它们转发到运行的容器,在8080我的例子中,该容器是一个具有 swagger 规范的应用程序的容器。

疑问/问题

我的 swagger 应用程序会在应该的时候www.example.com/mt/swagger-ui.html 发送它的 POST/GET 等www.example.com:443/api/...www.example.com/mt/api/...

有谁知道如何解决这个问题。是 swagger 还是 kubernetes?

可能有用的注释:

我的 .yaml 文件包含执行端口转发的文件

spec:
  rules:
  - http:
      paths:
      - path: /ui
        backend:
          serviceName: neo4j-service
          servicePort: 9205
      - path: /pg
        backend:
          serviceName: neo4j-service
          servicePort: 8181
      - path: /mt
        backend:
          serviceName: neo4j-service
          servicePort: 8080
Run Code Online (Sandbox Code Playgroud)

swagger kubernetes

5
推荐指数
0
解决办法
643
查看次数