初始场景:
A (master)
\
B - C - D (development)
Run Code Online (Sandbox Code Playgroud)
合并后我想要什么 --squash:
A - E (master/development)
\ /
B - C - D
Run Code Online (Sandbox Code Playgroud)
在分支上master,git log将是
commit E
Squashed commit of the following:
commit D
commit C
commit B
commit A
Run Code Online (Sandbox Code Playgroud)
继续在分支上开发development:
A - E (master)
\ / \
B - C - D F - G - H (development)
Run Code Online (Sandbox Code Playgroud)
再次与壁球合并:
A - E - I(master/development)
\ / \ /
B - C - D …Run Code Online (Sandbox Code Playgroud) 在这种情况下会弹出此警告:
实际上,在步骤[*]中,我想调试步骤[#]中所做修改的代码。然而,Visual Studio 实际上正在调试代码,而没有在步骤 [#] 中进行任何修改,因此对此发出警告。
我必须在步骤 [*] 之前清理项目,以使 Visual Studio 知道我在步骤 [#] 中所做的修改。如何让 Visual Studio 始终调试最新的源文件?
额外信息:它是“始终构建”,并且在配置管理器中选中了“构建”框。此外,在步骤[*]中,即使我手动触发“Build”(Ctrl+Shift+B),它也表示我的项目是最新的。实际上我的项目在“不调试启动”和“开始调试”中都已经过时了。我必须清理项目以使我的项目保持最新状态。
附视频(2 分钟),从“新项目”开始:https://www.youtube.com/watch ?v=0y9RljtS28k
考虑以下代码(https://go.dev/play/p/hDOyP3W_lqW)
package main
import (
"log"
"github.com/pkg/errors"
)
func myError() error {
return errors.New("failing unconditionally")
}
func myError1() error {
return errors.Errorf("annotate with additional debug info: %+v", myError())
}
func myError2() error {
return errors.Errorf("extra debug info: %+v", myError1())
}
func main() {
if err := myError2(); err != nil {
log.Printf("%+v", err)
}
}
Run Code Online (Sandbox Code Playgroud)
我使用 引发错误errors.New并使用附加信息对其进行注释errors.Errorf。
它做了我想要的事情——记录并打印堆栈跟踪和行号。然而,问题是 的输出log.Printf("%+v", err)是冗长且重复的:
2009/11/10 23:00:00 extra debug info: annotate with additional debug info: failing unconditionally …Run Code Online (Sandbox Code Playgroud) 一般我按照这里的说明:https://stackoverflow.com/a/24687152/3741933.
然而,在其评论中讨论的,酥料饼的始终,无论全屏preferredContentSize或sourceRect.
显示弹出窗口的按钮:
func buttonClicked(sender: UIButton!) {
let ac = EmptyViewController() as UIViewController
ac.modalPresentationStyle = .Popover
ac.preferredContentSize = CGSizeMake(200, 200)
let popover = ac.popoverPresentationController
popover?.delegate = self
popover?.permittedArrowDirections = .Any
popover?.sourceView = self.view
popover?.sourceRect = CGRect(x: 100, y: 100, width: 100, height: 100)
presentViewController(ac, animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)
UIViewController:
import UIKit
class EmptyViewController : UIViewController {
override func viewDidLoad() {
view.backgroundColor = UIColor.redColor()
}
}
Run Code Online (Sandbox Code Playgroud)
我想知道如何使它成为一个真正的popover(不是全屏大小).顺便说一下,正如@EI Captain所说,它在iPad上完美运行,但在iPhone上总是全屏.
class Klass:
def __init__(self, **kwargs):
self.func(variable=True, **kwargs)
def func(self, variable=True, **kwargs):
print(variable)
if __name__ == '__main__':
Klass(variable=False)
Run Code Online (Sandbox Code Playgroud)
我想知道为什么我会得到TypeError: func() got multiple values for keyword argument 'variable'.
我认为它应该打印,False因为我覆盖默认值为variableto False并传递kwargs.
git ×1
git-squash ×1
go ×1
ios ×1
kwargs ×1
merge ×1
popover ×1
python ×1
python-2.7 ×1
stack-trace ×1
swift ×1