bit

How to upload 32 bit image to server-side pixmap

匿名 (未验证) 提交于 2019-12-03 01:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to create server-side RGBA pixmap from client-side buffer. CreatePixmap & CreateImage work ok for 32 and 24 bit, but XPutImage result in Match Error returned by server X Error of failed request : BadMatch ( invalid parameter attributes ) Major opcode of failed request : 72 ( X_PutImage ) Serial number of failed request : 8 Current serial number in output stream : 8 server does support 32 bit pixmaps (xdpyinfo output: https://gist.github.com/2582961 ). Same behaviour on ubuntu 12.04 (X.Org version: 1.11.3) and OSX with X

Fast counting the number of equal bytes between two arrays

匿名 (未验证) 提交于 2019-12-03 01:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I wrote the function int compare_16bytes(__m128i lhs, __m128i rhs) in order to compare two 16 byte numbers using SSE instructions: this function returns how many bytes are equal after performing the comparison. Now I would like use the above function in order to compare two byte arrays of arbitrary length: the length may not be a multiple of 16 bytes, so I need deal with this problem. How could I complete the implementation of the function below? How could I improve the function below? int fast_compare(const char* s, const char* t, int

Could not build module Darwin - arm64 issues

匿名 (未验证) 提交于 2019-12-03 01:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I developed my first XCode5 ONLY app which is very similar to the apps I have done on 4.6. It runs perfectly OK in the simulator and on my iPhone 4, 4S and 5, as well as my 2 iPads. However, when I try to validate it for submission to the App Store, I get a whole stack of errors relating to arm64 requires 7.0.0 or later. I have the deployment target set to 6.1 and this does not happen when I run my previous apps in Xcode 5 that had been started in 4.6. If I change the deployment target to 7.0 then everything is OK. What is happening here?

ARM, Thumb and Thumb 2 instructions confusion

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am a bit confused about instruction sets. There are Thumb, ARM and Thumb 2. From what I have read Thumb instructions are all 16-bit but inside the ARMv7M user manual (page vi) there are Thumb 16-bit and Thumb 32-bit instructions mentioned. Now I have to overcome this confusion. It is said that Thumb 2 supports 16-bit and 32-bit instructions. So is ARMv7M in fact supporting Thumb 2 instructions and not just Thumb? One more thing. Can I say that Thumb (32-bit) is the same as ARM instructions which are allso 32-bit? 回答1: Oh, ARM and their

reinterpret_cast between char* and std::uint8_t* - safe?

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Now we all sometimes have to work with binary data. In C++ we work with sequences of bytes, and since the beginning char was the our building block. Defined to have sizeof of 1, it is the byte. And all library I/O functions use char by default. All is good but there was always a little concern, a little oddity that bugged some people - the number of bits in a byte is implementation-defined. So in C99, it was decided to introduce several typedefs to let the developers easily express themselves, the fixed-width integer types. Optional, of

pyodbc requires python 3.3

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I just downloaded installer for pyodbc from google project . I have Python 3.5 istalled and pyodbc requires 3.3. Is there an easy work around? P.S. I am installing it on PC without Internet access. This is for Windows. 回答1: Since you can't install this via the regular pip channels, you can download a prebuilt binary for Python 3.5 from Chris Gohlke's site , where he has a bunch of libraries he creates builds for. Download either depending on the version of Python 3.5 you have installed: if you have a 32-bit Python 3.5 install if you have a

strcmp behaviour in 32-bit and 64-bit systems

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The following piece of code behaves differently in 32-bit and 64-bit operating systems. char *cat = "v,a"; if (strcmp(cat, ",") == 1) ... The above condition is true in 32-bit but false in 64-bit. I wonder why this is different? Both 32-bit and 64-bit OS are Linux (Fedora). 回答1: The strcmp() function is only defined to return a negative value if argument 1 precedes argument 2, zero if they're identical, or a positive value if argument 1 follows argument 2. There is no guarantee of any sort that the value returned will be +1 or -1 at any time

Cannot run Eclipse; JVM terminated. Exit code=13

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 选择语言 中文(简体) 日语 英语 中文(繁体) 由 翻译 强力驱动 问题: I just append -vm C:\Program Files\Java\jre6\bin\javaw.exe in eclipse.ini then I try to start eclipse again and got this error. Give me how to solve or link that actually solve it. this is my eclipse.ini - startup plugins / org . eclipse . equinox . launcher_1 . 1.0 . v20100507 . jar -- launcher . library plugins / org . eclipse . equinox . launcher . win32 . win32 . x86_1 . 1.1 . R36x_v20100810 - showsplash org . eclipse . platform -- launcher . XXMaxPermSize 256m -- launcher . defaultAction openFile - vm

portable way to deal with 64/32 bit time_t

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have some code which is built both on Windows and Linux. Linux at this point is always 32bit but Windows is 32 and 64bit. Windows wants to have time_t be 64 bit and Linux still has it as 32 bit. I'm fine with that, except in some places time_t values are converted to strings. So when time_T is 32 bit it should be done with %d and when it is 64bit with %lld... what is the smart way to do this? Also: any ideas how I may find all places where time_t's are passed to printf-style functions to address this issue? edit: I came up with

64 bit enum in C++?

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a way to have a 64 bit enum in C++? Whilst refactoring some code I came across bunch of #defines which would be better as an enum, but being greater than 32 bit causes the compiler to error. For some reason I thought the following might work: enum MY_ENUM : unsigned __int64 { LARGE_VALUE = 0x1000000000000000, }; 回答1: I don't think that's possible with C++98. The underlying representation of enums is up to the compiler. In that case, you are better off using: const __int64 LARGE_VALUE = 0x1000000000000000L; As of C++11, it is