我已经看到很多博客文章和堆栈溢出帖子说,这
git config --global diff.algorithm patience
将允许差异和合并使用耐心策略选项与默认的递归算法.
我发现这不是这种情况,我提出以下演示来说明原因.
git config --global diff.algorithm patience //mythical config statement
git clone https://github.com/kjlubick/PracticingGit.git
cd PracticingGit
git checkout origin/patience-merge-1 -t
git checkout -b merge_test //temp branch for merging
git diff origin/patience-merge-2
Run Code Online (Sandbox Code Playgroud)
这种差异(图片由meld看起来很漂亮.让我们尝试合并它.
git merge origin/patience-merge-2
Run Code Online (Sandbox Code Playgroud)
咦?合并看起来很难看.尽管第9-19行没有实际改变,但它们与diff完全不同,标记为冲突/改变.
如果我们强制合并使用耐心策略选项:
git merge --abort
git merge origin/patience-merge-2 -X patience
Run Code Online (Sandbox Code Playgroud)

那好多了.冲突与我们之前制作的差异相匹配,并且在语义上是正确的.
如何让合并实际上使用耐心设置,而不仅仅是差异?
在黑暗中我尝试了额外的镜头(失败):
git config --global merge.algorithm patience
git config --global merge.diff.algorithm patience
Run Code Online (Sandbox Code Playgroud)
系统信息:
Windows 8.1
git版本1.8.4.msysgit.0(通过GitHub for Windows 2.0)
我有一个spring bean,它有一个记录器成员,我使用该记录器记录一些动作.
我也写了一个使用的测试用例SpringJUnit4ClassRunner.我已经使用属性文件配置了Log4j,并且在每个测试用例中,我使用以下属性初始化记录器:
@BeforeClass
public static void init() {
PropertyConfigurator.configure("src/com/config/log4j.properties");
}
Run Code Online (Sandbox Code Playgroud)
当我进行测试时它会给我一个警告
log4j:WARN No appenders could be found for logger (org.springframework.test.context.junit4.SpringJUnit4ClassRunner).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Run Code Online (Sandbox Code Playgroud)
但是,我的bean中的记录器将消息写入log4j.properties中的指定位置,即它工作正常.为什么log4j会给我这样的警告?
我在我的Ubuntu 12.04.1笔记本电脑上运行1.0.3并且我偶然发现了一个问题,如果我在main()中运行一些代码,它的行为与我使用go test运行它的方式有很大不同.
这是我的例子:
来自main.go
package main
import (
"image"
"image/jpeg"
"fmt"
"myproj/htmlutil"
[some imports removed]
)
func main() {
img, err := htmlutil.GetResizedImageFromWeb("http://img.foodnetwork.com/FOOD/2011/05/04/FNM_060111-OOT-B005_s4x3.jpg")
if err != nil {
fmt.Println("There was a problem ",err)
}
fmt.Println("Bounds were ",img.Bounds())
}
Run Code Online (Sandbox Code Playgroud)
来自myproj/htmlutil_test.go
package htmlutil
import (
"image"
"fmt"
"testing"
[some imports removed]
)
func TestGetImageFromURL(t *testing.T){
img, err := GetResizedImageFromWeb("http://img.foodnetwork.com/FOOD/2011/05/04/FNM_060111-OOT-B005_s4x3.jpg")
if err != nil {
t.Fatalf("There was a problem %q",err)
}
fmt.Println("Bounds were ",img.Bounds())
}
Run Code Online (Sandbox Code Playgroud)
他们调用的函数GetResizedImageFromWeb()位于myproj/htmlutil.go中:
package htmlutil
import (
"errors"
"fmt" …Run Code Online (Sandbox Code Playgroud) 我有一个Three.js场景渲染,我想导出动画渲染后的外观.例如,在动画消失了~100帧之后,用户点击导出并且场景应该像当时一样导出到STL.
从我尝试过(使用STLExporter.js),似乎只使用初始位置导出模型.
如果已经有办法做到这一点,或者是一个简单的解决方法,我会很感激在这方面的推动.
更新:在进一步深入了解内部结构之后,我已经想出(至少表面上看)为什么STLExporter不起作用.STLExporter查找所有对象并询问它们对象的顶点和面Geometry.我的模型有一堆被剥皮的骨头.在动画步骤期间,骨骼会更新,但这些更新不会传播到原始Geometry对象.我知道这些变换顶点正在计算并存在于某处(它们会在画布上显示).
问题是这些变换的顶点和面存储在哪里,我可以访问它们以将它们导出为STL吗?