有没有办法让统一容器将自己传递给对象?
即:
public class Something {
public Something(IUnityContainer container) {
...
}
}
Run Code Online (Sandbox Code Playgroud) 我做了一个提交并推动回购.后来我通过使用修改了提交消息git commit --amend,在弹出窗口中我输入了新消息.我可以通过看到新消息git log.经过这一切,我的git status节目就像这样.我不知道如何将这个变化推向回购.
On branch master
Your branch and `origin/master` have diverged,
and have 1 and 1 different commit(s) each, respectively.
Run Code Online (Sandbox Code Playgroud)
期待一个可行的解决方案.
我正在尝试从devel分支到主服务器的合并壁球.
stefanos-imac:trunk borini$ git merge --squash devel
CONFLICT (content): Merge conflict in test1
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 2224 and retry the command.
Squash commit -- not updating HEAD
Automatic merge failed; fix conflicts and then commit the result.
Run Code Online (Sandbox Code Playgroud)
很公平.
stefanos-imac:trunk borini$ git config merge.renameLimit 999999
Run Code Online (Sandbox Code Playgroud)
然后我尝试撤消合并并用更高的限制重做它
stefanos-imac:trunk borini$ git merge --abort
fatal: There is no merge to abort (MERGE_HEAD missing).
Run Code Online (Sandbox Code Playgroud)
好吧,也许我必须按照它说的做,只需重新调用merge命令 …
仅使用给定的SDL_Window*和SDL_Renderer*,如何在SDL 2.0中创建和保存屏幕截图?
问题是如何构建HttpWebRequest如此查询的服务器会认为它来自浏览器?
所以我一直在尝试通过以下关于ffmpeg的教程:http://dranger.com/ffmpeg/tutorial02.html
但是,当我尝试使用gcc编译时,我得到以下输出:
root:/Users/mbrodeur/Downloads/HACKATHON CONTENT/Tutorials-> gcc -o tutorial02 tutorial02.c -lavutil -lavformat -lavcodec -lz -lavutil -lm -lswscale -D_THREAD_SAFE -lSDL2
tutorial02.c: In function ‘main’:
tutorial02.c:41: error: ‘SDL_Overlay’ undeclared (first use in this function)
tutorial02.c:41: error: (Each undeclared identifier is reported only once
tutorial02.c:41: error: for each function it appears in.)
tutorial02.c:41: error: ‘bmp’ undeclared (first use in this function)
tutorial02.c:98: warning: assignment makes pointer from integer without a cast
tutorial02.c:110: error: ‘SDL_YV12_OVERLAY’ undeclared (first use in this function)
Run Code Online (Sandbox Code Playgroud)
现在,我读到SDL2中不再使用SDL_Overlay,因此存在问题.我一直在四处寻找,但似乎找不到任何有用的东西.是否有SDL_Overlay的替代品?有必要吗?
SDL_Overlay用于以下上下文: …
我使用的是Windows 7,Code :: Blocks和MinGW.在编译/构建任何东西时,我几乎没有经验,特别是当Code :: Blocks不使用makefile时.
我从http://www.libsdl.org/tmp/download-2.0.php下载了SDL2-devel-2.0.0-mingw.tar.gz(SDL开发库),我想创建一个独立的可执行文件SDL2库,但到目前为止,我总是不得不将SDL2.dll文件与可执行文件捆绑在一起以使其工作.
我听说我不能静态链接动态库,所以我唯一的选择似乎是使用上面提到的链接中的文件SDL2-2.0.0.tar.gz(源代码)对源文件做些什么.但是,我不知道我该怎么办.
我设法尝试使用源文件是将Visual Studio项目导入Code :: Blocks并构建它,但它告诉我"sdl-config没有这样的文件或目录"(我不知道触发了什么).我也不确定构建只是给了我一个可执行文件,我不知道如何将它链接到我自己的可执行文件.
一个傻瓜证明白痴的一步一步指导将是解决这个案件的最佳选择.
编辑:
我设法用Jonas提供的指南编译SDL库,并获得了一个libSDL2.a文件.
起初我只将libSDL2.a的路径添加到Code :: Blocks的"链接库:"部分,但是我收到了一堆错误,例如"SDL_Init()未在此范围内声明".
除了libSDL2.a路径之外,我还将SDL2-2.0.0\include的路径添加到编译器的搜索目录以及SDL2-2.0.0\build.libs到链接器搜索目录的路径.我还把它写到我的测试文件中:#include"SDL.h".我的测试文件现在看起来像这样:
#include "SDL.h"
int main( int argc, char* args[] ) {
//Start SDL
SDL_Init( SDL_INIT_EVERYTHING );
//Quit SDL
SDL_Quit();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
它似乎确实解决了声明问题,但现在Code :: Blocks打开了一个SDL_mmjoystick.c文件并给了我更多错误:"未定义引用'waveInClose @ 4'","未定义引用'waveOutClose @ 4'", "对'joyGetNumDevs @ 0'的未定义引用"和其他大量的引用.
这是正在发生的事情的屏幕截图,注意#include文本的不同颜色,我不确定为什么会发生这种情况:http://gyazo.com/00656a9c1e57a2bd0db1414fa7d68ced.png
我不确定如何正确使用此库.在这种情况下有任何帮助,还是我应该为此提出另一个问题?
编辑:
我将-lSDL2添加到链接器选项并删除了其他参数.现在它构建良好:
mingw32-g++.exe -Wall -fexceptions -g -IC:\Users\User\Desktop\SDL2-2.0.0\include -c "C:\Users\User\Desktop\CppProjects\SDL project\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -Wall -fexceptions -g -IC:\Users\User\Desktop\SDL2-2.0.0\include -c "C:\Users\User\Desktop\CppProjects\SDL project\thetestfile.cpp" -o obj\Debug\thetestfile.o
mingw32-g++.exe …Run Code Online (Sandbox Code Playgroud) 在GAE中,你User能用User对象查找user_id吗?
换句话说,是否有相当于:
from google.appengine.api.users import User
user = User.get_by_id(user_id)
Run Code Online (Sandbox Code Playgroud) sqlite3错误
import sqlite3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.3/sqlite3/__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "/usr/local/lib/python3.3/sqlite3/dbapi2.py", line 26, in <module>
from _sqlite3 import *
ImportError: No module named '_sqlite3'
Run Code Online (Sandbox Code Playgroud)
我使用sqlite3安装命令
pip install pysqlite
Downloading/unpacking pysqlite
Downloading pysqlite-2.6.3.tar.gz (76kB): 76kB downloaded
Running setup.py egg_info for package pysqlite
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/usr/local/lib/python3.3/codecs.py", line 300, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: …Run Code Online (Sandbox Code Playgroud) 我不知道为什么*在 Visual Studio 代码中我的 git 分支名称旁边有一个。有什么我应该警惕的吗?