Don’t use width/height stylesheet in Qt

Qt has an internal collision if you use “width: xxx;” or “height: xxx” in the widgets. The collision is between Qt’s layout system and style sheet handling. It causes Qt incorrectly calculating QScrollBar’s size. Therefore it effected all other widgets along side the scrollbars. The best solution is: don’t use width or height style in…

Two key points in writing a Windows NDIS Miniport Driver with NdisMediumIP

In Windows 7 or later, NDIS miniport driver support NdisMediumIP as its media type. This means the network data sending to or receiving from the network adapter is pure IP packet, without any media frame like an ethernet frame. Everything is OK to write such a miniport driver, except for two points different from traditional…

Access one opened file/device handle from multiple threads in Windows

Windows’ kernel I/O manager will serialize I/O requests automatically if you didn’t have the flag FILE_FLAG_OVERLAPPED in CreateFile() call, as the page http://winprogger.com/multithreaded-synchronous-io-must-be-asynchronous/comment-page-1/#comment-59075 described. This fact haven’t be mentioned in M$’s documentation, and there is few information about this on the web. Conclusion. If you want to Open a handle and access it from multiple…

Old Android version, linux shared library and apk packer controlled by Android Studio

Old Android version (4.4 on my side) didn’t look for shared library by SONAME inside. It only checks file name. For example, in recent Android version (7 or 8), one file named libcrypto.so whose SONAME is libcrypto.so.1.0.0 can be loaded by dependents successfully. But in old versions the system reported “dlopen failed to load libcrypto.so.1.0.0”.…

Strange behavior in WOW64 DLL loading in Windows 2008 R2

That is, if a 32bit DLL was loaded by CreateRemoteThread(), the DLL would be unloaded silently without DLL_PROCESS_DETACH invocation sent to DLLMain() of the DLL. There are indeed 2 weird issues, one is silent unloading, the other is no DLL_PROCESS_DETACH callback. This occurs on WOW64 environment of Windows 2008 Server R2 only.  Windows 2012 and…

curl certificate issue

Mac OS X El Capitan, MacPorts, it goes well for so long. And one day, git complains: curl: (77) error setting certificate verify locations: CAfile: /opt/local/share/curl/curl-ca-bundle.crt CApath: none Easy, update git config system to use ca-bundle.crt found by searching. [http] sslcainfo = /opt/local/share/apps/kssl/ca-bundle.crt Problem sovled. But, curl itself still complains: curl –cacert /opt/local/share/apps/kssl/ca-bundle.crt … Problem…

Auto Layout UITableView cell resizing with multi-line UILabel issue in iOS7

There are many blogs and articles talked about this issue and resolution on Internet. But any of them has this or that problems in those solutions. So I took several hours on researches and got a perfect result, at least I think so. 🙂 Thought about device orientation change, table width and cell width will change.…