我在我正在使用的脚本中看到了这一行:
git config core.worktree ..
Run Code Online (Sandbox Code Playgroud)
我不确定 git worktree 做什么,但我绝对不明白为什么将其设置为..
有什么线索吗?谢谢
我正在尝试从http://open.gl/introduction编译一个简单的测试程序:
#include <GLFW/glfw3.h>
#include <thread>
int main()
{
glfwInit();
std::this_thread::sleep_for(std::chrono::seconds(1));
glfwTerminate();
}
Run Code Online (Sandbox Code Playgroud)
我使用以下代码编译:
>> g++ -c tutorial01.cpp -o tutorial01.o -std=c++11
>> g++ tutorial01.o -o tutorial01 -lglfw3 -lGL -lXrandr -lX11 -lXi -lGLEW
/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libGL.so: undefined reference to `_glapi_tls_Dispatch'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
以下是有关该问题的一些额外信息:
>> readlink -f "/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libGL.so"
/usr/lib/x86_64-linux-gnu/libGL.so.1.2.0
>> nm -D /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0 | grep _glapi_tls_Dispatch
U _glapi_tls_Dispatch
>> ldd /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0
linux-vdso.so.1 (0x00007fff0b200000)
libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007ff437f80000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007ff437d68000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007ff437b60000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 …Run Code Online (Sandbox Code Playgroud) 如何使用 scikit svm 绘制一维数据的分离“超平面”?
我遵循二维数据指南:http://scikit-learn.org/stable/auto_examples/svm/plot_svm_margin.html,但不知道如何使其适用于一维数据
pos = np.random.randn(20, 1) + 1
neg = np.random.randn(20, 1) - 1
X = np.r_[pos, neg]
Y = [0] * 20 + [1] * 20
clf = svm.SVC(kernel='linear', C=0.05)
clf.fit(X, Y)
# how to get "hyperplane" and margins values ??
Run Code Online (Sandbox Code Playgroud)
谢谢
c++ ×1
compilation ×1
config ×1
git ×1
git-worktree ×1
linux ×1
makefile ×1
matplotlib ×1
numpy ×1
opengl ×1
python ×1
scikit-learn ×1
svm ×1