我有一个UIViewController,我正在从我的第一个视图控制器导航到第二个视图控制器,我想要更改显示的按钮的名称navigationcontroller以便返回....
SecondViewController *secondController = [[SecondViewController alloc]
initWithNibName:nil
bundle:NULL];
[self.navigationController pushViewController:secondController animated:YES];
Run Code Online (Sandbox Code Playgroud)
现在在第二个viewcontroller我想改变按钮的名称navigationController.
uiviewcontroller uinavigationcontroller uinavigationitem ios
是否有任何工具可以直接测试是否为32位或64位制作库?
我正在尝试在Windows上使用hg-git Mercurial扩展(Windows 7 64位,具体而言).我安装了Mercurial和Git.我安装了Python 2.5(32位).
我按照http://hg-git.github.com/上的说明安装了扩展程序.最初的easy_install失败,因为没有Visual Studio 2003它无法编译dulwich.
我手动安装了德威:
现在当我运行easy_install hg-git时,它会成功(因为dulwich依赖性得到满足).
在我的C:\ Users\username\Mercurial.ini中,我有:
[extensions]
hgext.bookmarks =
hggit =
Run Code Online (Sandbox Code Playgroud)
当我在命令提示符下键入'hg'时,我看到:"***无法导入扩展名hggit:没有名为hggit的模块"
在我的c:\ Python25文件夹下查看,我看到的对hggit的唯一引用是Lib\site-packages\hg_git-0.2.1-py2.5.egg.这应该被提取到某个地方,还是应该按原样运行?
由于失败了,我尝试了hg-git页面中的"更多参与"指令,建议克隆git://github.com/schacon/hg-git.git并引用我的Mercurial配置中的路径.我克隆了repo,并将我的扩展文件更改为:
[extensions]
hgext.bookmarks =
hggit = c:\code\hg-git\hggit
Run Code Online (Sandbox Code Playgroud)
现在当我运行hg时,我看到:***无法从c:\ code\hg-git\hggit导入扩展名hggit:没有名为dulwich.errors的模块.
好的,所以这告诉我它现在正在寻找hggit,因为我可以在hg-git\hggit\git_handler.py中看到它调用
from dulwich.errors import HangupException
Run Code Online (Sandbox Code Playgroud)
这让我觉得dulwich没有正确安装,或者没有安装在路径中.
更新:
从Python命令行:
import dulwich
Run Code Online (Sandbox Code Playgroud)
产量 Import Error: No module named dulwich
但是,在C:\ Python25\Lib\site-packages下,我有一个似乎已填充的dulwich-0.5.0-py2.5.egg文件夹.这是由上述步骤创建的.我需要采取额外的步骤使其成为Python"路径"的一部分吗?
从Python命令行(如其中一个答案中所建议的):
import pkg_resources
pkg_resources.require('dulwich')
Run Code Online (Sandbox Code Playgroud)
产量 [dulwich 0.5.0 (c:\python25\lib\site-packages\dulwich-0.5.0-py2.5.egg)]
那告诉我什么呢?导入dulwich失败,但显然pkg_resources可以找到它.我该怎么处理这些信息?
我在示例文件中有以下代码:
#include "SkCanvas.h"
#include "SkDevice.h"
#include "SkGLCanvas.h"
#include "SkGraphics.h"
#include "SkImageEncoder.h"
#include "SkPaint.h"
#include "SkPicture.h"
#include "SkStream.h"
#include "SkWindow.h"
Run Code Online (Sandbox Code Playgroud)
但是,此代码位于/ home/me/development/skia中的各种文件夹中(其中包括core/animator/images/ports/svg /等等).
如何让GCC认识到这条道路?
我在github有一个repo是公共的,我有一个我正在开发的开源应用程序,用于制作产品目录和小cms内容.
我还有一个私有存储库(不在github中托管),它是在github中托管的开源应用程序下开发的应用程序.
由于我目前正在处理这两个应用程序,在开源软件中添加功能,并在私有应用程序中进行更改,例如更改模板以及从开源代码中提取代码.
我想知道是否有任何方法可以从开源软件中提取新内容,还可以将新应用程序的代码推送到其他repo.
我试图在BitBucket上添加一个文件到我的存储库,我遇到了麻烦.
我正在使用GIT,这就是我输入的内容
$ cd lis4368/assignments
$ git remote
$ git remote -v
$ git remote rm origin
Run Code Online (Sandbox Code Playgroud)
然后我输入(这是BitBucket告诉我进入的)
$ git remote add origin https://cpb09e@bitbucket.org/cpb09e/cpb09e.git
$ git push -u origin master
Run Code Online (Sandbox Code Playgroud)
我一直收到此错误消息:
error: src refspec master does not match any.
error: failed to push some refs to 'https://cpb09e@bitbucket.org/cpb09e/cpb09e.git'
Run Code Online (Sandbox Code Playgroud)
有人请求帮助我吗?我已经尝试了从git commit到rm -rf*的所有内容,但我无法完成任何工作.
我试图弄清楚Git中的"移植物"是什么.
例如,在这里的一个最新评论中,Tobu假设使用git-filter-branch和.git/info/grafts来连接两个存储库.
但我不明白为什么我需要这些移植物?似乎所有工作都没有最后两个命令.
在一台机器(IP地址192.168.1.2)上,我创建了一个Git存储库
$ cd /home/hap/working
$ git init
$ (add some files)
$ git add .
$ git commit -m 'Initial commit'
Run Code Online (Sandbox Code Playgroud)
我在同一个Wi-Fi网络上有另一台机器.如何从其他机器克隆?
我正在使用PyQt并遇到了这个问题.如果我的import语句是:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
Run Code Online (Sandbox Code Playgroud)
然后pylint给出了数百个"未使用的导入"警告.我很犹豫要把它们关闭,因为可能有其他未使用的导入实际上很有用.另一种选择是这样做:
from PyQt4.QtCore import Qt, QPointF, QRectF
from PyQt4.QtGui import QGraphicsItem, QGraphicsScene, ...
Run Code Online (Sandbox Code Playgroud)
and I end up having 9 classes on the QtGui line. There's a third option, which is:
from PyQt4 import QtCore, QtGui
Run Code Online (Sandbox Code Playgroud)
and then prefix all the classes with QtCore or QtGui whenever I use them.
At this point I'm agnostic as to which one I end up doing in my project, although the last one seems the …
让我们考虑python(3.x)脚本:
main.py:
from test.team import team
from test.user import user
if __name__ == '__main__':
u = user()
t = team()
u.setTeam(t)
t.setLeader(u)
Run Code Online (Sandbox Code Playgroud)
测试/ user.py:
from test.team import team
class user:
def setTeam(self, t):
if issubclass(t, team.__class__):
self.team = t
Run Code Online (Sandbox Code Playgroud)
测试/ team.py:
from test.user import user
class team:
def setLeader(self, u):
if issubclass(u, user.__class__):
self.leader = u
Run Code Online (Sandbox Code Playgroud)
现在,当然,我已经获得了循环导入和出色的ImportError.
所以,不是pythonista,我有三个问题.首先:
一世.我怎么能让这个东西工作?
并且,知道某人将不可避免地说"循环导入总是表明设计问题",第二个问题来自:
II.为什么这个设计不好?
最后,第三个:
III.什么是更好的选择?
确切地说,上面的类型检查只是一个例子,还有一个基于类的索引层,它允许ie.发现所有用户都是一个团队的成员(用户类有许多子类,因此索引加倍,对于一般用户和每个特定子类)或所有团队都将用户作为成员
编辑:
我希望更详细的例子能够澄清我试图实现的目标.为了可读性省略了文件(但是有一个300kb的源文件让我感到害怕,所以请假设每个类都在不同的文件中)
# ENTITY
class Entity:
_id = None
_defs = {}
_data = None
def …Run Code Online (Sandbox Code Playgroud) git ×4
python ×3
c++ ×2
windows ×2
32bit-64bit ×1
bitbucket ×1
class-design ×1
dependencies ×1
dulwich ×1
gcc ×1
git-clone ×1
git-push ×1
header ×1
hg-git ×1
ios ×1
mercurial ×1
pylint ×1
pyqt ×1
pyqt4 ×1
refspec ×1
repository ×1
visual-c++ ×1