我删除了本地存储库中的一个文件(仅在文件系统级别,而不是使用hg remove).我现在想要将该文件从存储库恢复到我的本地目录.当我这样做时hg status,它知道该文件是在本地删除的,但是没有提交的更改是我所期望的.
我刚刚将我的C++游戏移植到OS X并且第一次运行时我在尝试调用时遇到以下异常SDL_SetVideoMode.
2012-09-28 15:01:05.437 SCRAsteroids [28595:707] *由于未捕获异常'NSInternalInconsistencyException'而终止app,原因:'错误(1000)在第259行创建CGSWindow'*第一次抛出调用堆栈:(0 CoreFoundation 0x00007fff8b53b716 __exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff90e30470 objc_exception_throw + 43 2的CoreFoundation 0x00007fff8b53b4ec + [NSException提高:格式:] + 204 3了AppKit 0x00007fff8a26a579 _NSCreateWindowWithOpaqueShape2 + 655 4了AppKit 0x00007fff8a268d70 - [NSWindow _commonAwake] + 2002 5了AppKit 0x00007fff8a2277e2 - [NSWindow _commonInitFrame: styleMask:backing:defer:] + 1763 6 AppKit 0x00007fff8a22692f - [NSWindow _initContent:styleMask:backing:defer:contentView:] + 1568 7 AppKit 0x00007fff8a2262ff - [NSWindow initWithContentRect:styleMask:backing:defer:] + 45 8 libSDL-1.2. 0.dylib 0x0000000107c228f6 - [SDL_QuartzWindow initWithContentRect:styleMask:backing:defer:] + 294 9 libSDL-1.2.0.dylib 0x0000000107c20505 QZ_SetVideoMode + 2837 10 libSDL-1.2.0.dylib …
作为一项挑战,我已经用Java实现了一个基本的Web服务器.当我打开原始时,InputStream我立即进入阻塞读取,将HTTP请求的整个400或字节读入字节数组.这是有效的,但是我不再检查任何数据,只是在发送响应后关闭套接字.
我想知道是否有更强大的方法来做到这一点,以免错过来自客户端的任何数据.我想过一次读一个字节,直到read返回流结束.但是,当没有更多的数据时,它有时会阻塞,并且令人困惑的JavaDocs public abtract int InputStream.read()表示:
If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.
所以它意味着如果到达流的末尾会发生两件事:返回-1和阻塞.我看到了阻塞.
我的问题是,使用像HTTP这样的协议,你应该如何从套接字读取,你怎么知道这个连接中你将获得的所有数据?
Windows XP:
我最终想安装DDD(调试器).它不适用于Windows的二进制形式.当我得到它的源并试图配置它时,它抱怨没有术语大写库存在.所以我获得了ncurses并在使用Cygwin终端进行了大部分成功构建之后得到了这个:
../lib/libncurses.a(lib_ttyflags.o)(.text+0x41):lib_ttyflags.c: undefined reference to `_nc_mingw_ioctl'
../lib/libncurses.a(lib_ttyflags.o)(.text+0xd1):lib_ttyflags.c: undefined reference to `_nc_mingw_ioctl'
Run Code Online (Sandbox Code Playgroud) 我一直在制作一个makefile.它通过使用includes支持轻松创建exe,lib和dll类型的项目.
现在我又开始使用mercurial,我注意到在构建之前一切都很好.您看到我的目标文件进入每个子项目的源目录下的子目录.我将lib,exe和dll文件构建到主工作目录下的目录中.这意味着每当我这样做时hg status,它会用'?'列出这些临时二进制文件,这是我不想要的视觉混乱.(这不是mercurial的错,当然我也不会那么天真地检查它们到repo或类似的东西.)我只想要hg状态来发现我可能忘记正确添加的文件,而不是这些临时构建的文件.
目前的目录结构是这样的:
projroot
-- subproj1 (for source files)
-- subproj1/intr (for object files, release build)
-- subproj2 (for source files)
-- subproj2/intr (for object files, release build)
-- bin (for exes and dlls)
-- lib (for libraries that I build)
Run Code Online (Sandbox Code Playgroud)
所以我正在考虑重构makefile以保持在工作目录之外构建的文件(objs libs dlls和exes).大多数人都将所有二进制文件保存在一个比projroot高一级的目录中,以避免SCM看到它们吗?必须有一些最好的做法.我使用的东西似乎很好,但我认为它有点过时了,当然我已经看到了ant为Java src和类创建一个完全独立的树的方式.
这个结构怎么样?
projroot (contains common makefile includes and repo in here)
-- subproj1 (for source files)
-- subproj2 (for source files)
build
-- subproj1/intr (.o / .obj files in …Run Code Online (Sandbox Code Playgroud) 我正在寻找理想的免费 mercurial托管站点。理想情况下,它应该支持
我已经从Assembla开始搜索,并且正在逐步研究该列表,接下来可能会尝试BitBucket。那么上述部分或全部可能吗?