c++ Programming Glossary: low
Copy a file in an sane, safe and efficient way http://stackoverflow.com/questions/10195343/copy-a-file-in-an-sane-safe-and-efficient-way POSIX WAY K R use this in The C programming language more low level #include iostream #include fcntl.h open #include unistd.h.. is faster with POSIX and SENDFILE all other programs are slower. Maybe the options truncate or create have a impact on this.. und 0.30 seconds buffered. So cp is a little bit slower than the POSIX sample. Looks fine for me. Maybe I add also..
How do I remove code duplication between similar const and non-const member functions? http://stackoverflow.com/questions/123758/how-do-i-remove-code-duplication-between-similar-const-and-non-const-member-func and non const member functions Let's say I have the following class X where I want to return access to an internal member.. printed in a lighter shade of gray since we're running low on toner by this point ... The two member functions 'X Z '..
What is the difference between new/delete and malloc/free? http://stackoverflow.com/questions/240212/what-is-the-difference-between-new-delete-and-malloc-free defined. Can add a new memory allocator to deal with low memory set_new_handler operator new delete can be overridden.. splice user code into the allocation sequence to help with low memory. malloc free can NOT be overridden legally Technically..
How to write a browser plugin? http://stackoverflow.com/questions/2649056/how-to-write-a-browser-plugin NPAPI use cases The NPAPI itself is however relatively low level but there are tools and frameworks that can help you with..
Generate random numbers uniformly over an entire range http://stackoverflow.com/questions/288739/generate-random-numbers-uniformly-over-an-entire-range 3609293 3630000 3628441 3636376 3621404 From answers below OK RAND_MAX is 32767. I am on C Windows platform. Is there any.. the high bits show a better distribution than the low bits so the recommended way to generate random numbers of a.. 1 max min 1 min Note make sure RAND_MAX 1 does not overflow thanks Demi The division generates a random number in the interval..
When should static_cast, dynamic_cast and reinterpret_cast be used? http://stackoverflow.com/questions/332030/when-should-static-cast-dynamic-cast-and-reinterpret-cast-be-used a raw data stream into actual data or storing data in the low bits of an aligned pointer. C casts are casts using type object.. object . A C style cast is defined as the first of the following which succeeds const_cast static_cast static_cast then const_cast..
C++ HTML template framework, templatizing library, HTML generator library http://stackoverflow.com/questions/355650/c-html-template-framework-templatizing-library-html-generator-library download only Group none License free to use Language C low level C interface mixed Last Update unknown Last Release unknown..
What is memory fragmentation? http://stackoverflow.com/questions/3770457/what-is-memory-fragmentation failures or unexpectedly causes the system to run low on memory catch this in testing for preference . The standard..
std::wstring VS std::string http://stackoverflow.com/questions/402283/stdwstring-vs-stdstring characters such as Unicode characters. I have got the following questions When should I use std wstring over std string Can.. encoded in UTF 8 i.e. Unicode string of chars . The following code #include cstring #include iostream int main int argc.. wtext i std cout std endl std endl return 0 outputs the following text sizeof char 1 text olé sizeof text 5 strlen text 4 text..
C++ : Catch a divide by zero error http://stackoverflow.com/questions/4747934/c-catch-a-divide-by-zero-error operating system interrupts your program's main control flow and calls a signal handler which in turn terminates the operation.. exceptions that's NOT a way to control your program's flow even in exceptional cases. A valid program shouldn't do that... some useful signals which are very useful in general in low level programming and don't cause your program to be killed..
Why would anybody use C over C++? [closed] http://stackoverflow.com/questions/497786/why-would-anybody-use-c-over-c are C gurus You're writing drivers kernels or other low level code You know the C compiler isn't good at optimizing.. and simply use the C subset but the C compiler is slower even for tiny programs. You need extreme performance or small..
What are the barriers to understanding pointers and what can be done to overcome them? http://stackoverflow.com/questions/5727/what-are-the-barriers-to-understanding-pointers-and-what-can-be-done-to-overcome be easily explained. I've added some Delphi code down below and some comments where appropriate. I chose Delphi since my.. the parts labelled Memory layout in the explanation below. They are intended to give examples of what memory could look.. memory could look like after operations but they are more low level in nature. However in order to accurately explain how..
Why copying stringstream is not allowed? http://stackoverflow.com/questions/6010864/why-copying-stringstream-is-not-allowed copying stringstream is not allowed int main std stringstream s1 This is my string. std stringstream.. is my string. std stringstream s2 s1 error copying not allowed I couldn't find a reason as to why i can't copy stringstream... is a bucket then stream is a hose through which data flows . Think of stream as some pipe through which you get data a..
Exotic architectures the standards committees care about http://stackoverflow.com/questions/6971886/exotic-architectures-the-standards-committees-care-about to people that it's good that C doesn't mandate any other low level aspects like fixed sized types sup . It's good because..
how to achieve 4 FLOPs per cycle http://stackoverflow.com/questions/8389648/how-to-achieve-4-flops-per-cycle g O2 march native addmul.cpp . a.out 1000 produces the following output on an Intel Core i5 750 2.66 GHz addmul 0.270 s 3.707.. to admit but on my system cl O2 does a much better job at low level optimising operations for my system and achieves close.. to measure power consumption and CPU temperatures. The following code which is fairly long achieves close to optimal on my..
Why can't clang with libc++ in c++0x mode link this boost::program_options example? http://stackoverflow.com/questions/8454329/why-cant-clang-with-libc-in-c0x-mode-link-this-boostprogram-options-examp not binary compatible with gcc's libstdc except for some low level stuff such as operator new . For example the std string..
What XML parser should I use in C++? http://stackoverflow.com/questions/9387610/what-xml-parser-should-i-use-in-c you should use depends on your needs. Here's a convenient flowchart So the first question is this What do you need I Need Full.. read and write all of the XML specification not just the low lying easy to parse bits. You need Namespaces DocTypes entity.. be the actual DOM or the actual SAX to the extent that C allows. You have chosen Xerces That's your choice. It's pretty much..
Why does my STL code run so slowly when I have the debugger/IDE attached? http://stackoverflow.com/questions/1060337/why-does-my-stl-code-run-so-slowly-when-i-have-the-debugger-ide-attached heap. On Windows 2000 and above the default heap is the Low Fragmentation Heap which is insanely good compared to the debug..
What are the most widely used C++ vector/matrix math/linear algebra libraries, and their cost and benefit tradeoffs? http://stackoverflow.com/questions/1380371/what-are-the-most-widely-used-c-vector-matrix-math-linear-algebra-libraries-a Geometry module with quaternions and geometric transforms. Low memory overhead. Full highly performant solving of large NxN..
Rendering issue with different computers http://stackoverflow.com/questions/18064988/rendering-issue-with-different-computers GLenum severity static const char severities High Medium Low Unknown int str_idx min severity GL_DEBUG_SEVERITY_HIGH sizeof.. 0xff0000ff High Red 0xff00ffff Med Yellow 0xff00ff00 Low Green 0xffffffff White int col_idx min severity GL_DEBUG_SEVERITY_HIGH..
Small block allocator on Linux (or RedHat Linux) to avoid memory fragmentation http://stackoverflow.com/questions/2415373/small-block-allocator-on-linux-or-redhat-linux-to-avoid-memory-fragmentation block allocation on HP UX link text and on Windows XP Low fragmentation Heap . On HP UX it is possible to tune the allocator..
Good (preferable free) learning resources / books for embedded C / C++ programmers [closed] http://stackoverflow.com/questions/3507148/good-preferable-free-learning-resources-books-for-embedded-c-c-programme are Software development in limited resources conditions. Low level programming strategies. Software development before hardware..
C++ HTML template framework, templatizing library, HTML generator library http://stackoverflow.com/questions/355650/c-html-template-framework-templatizing-library-html-generator-library Last Release 2.1.1 on Mar 8 2011 Document Rich Community Low rare discussion since 2010 Templatizer Site http www.lazarusid.com.. Last Release 3.2.0 on Nov 29 2011 Document Rich Community Low rare activity Flate Site http flate.dead inside.org Project..
Direct formula for summing XOR http://stackoverflow.com/questions/3932346/direct-formula-for-summing-xor 47 47 N 47 0 0 N 48 48 48 N 49 1 1 N 50 51 51 Explanation Low bit is XOR between low bit and next bit. For each bit except..
Disable CONTROL + ALT + DELETE and Windows(win) Key in Windows 7 using Win32 application http://stackoverflow.com/questions/4529577/disable-control-alt-delete-and-windowswin-key-in-windows-7-using-win32-app linker SECTION .mydata RWS tell linker make it shared Low level keyboard hook Trap task switching keys by returning without..
Atomicity in C++ : Myth or Reality http://stackoverflow.com/questions/5002046/atomicity-in-c-myth-or-reality your code. You can use compiler memory barrier for that. Low level atomic read and writes for x86 is described in Intel Reference..
How to solve Memory Fragmentation http://stackoverflow.com/questions/60871/how-to-solve-memory-fragmentation I'm hoping someone can tell me the best one 1 Use Windows Low fragmentation Heap 2 jemalloc as used in Firefox 3 3 Doug Lea's..
Looking for an easy way to reinitialize a struct http://stackoverflow.com/questions/6684968/looking-for-an-easy-way-to-reinitialize-a-struct EQData EQ_FILTER_TYPE_FILTER_BUTTERWORTH_12DB T Low Pass coolVector.push_back t But of course this doesn't work..... EQData EQ_FILTER_TYPE_FILTER_BUTTERWORTH_12DB T Low Pass coolVector.push_back t2 In C 0x I think you should be able.. EQData EQ_FILTER_TYPE_FILTER_BUTTERWORTH_12DB T Low Pass coolVector.push_back t or even coolVector.push_back 1 EQData..
How to write fast (low level) code? [closed] http://stackoverflow.com/questions/6852670/how-to-write-fast-low-level-code about memory pdf book Write Great Code Volume 2 Thinking Low Level Writing High Level book Software optimization resources..
The implementation of random_device in VS2010? http://stackoverflow.com/questions/9549357/the-implementation-of-random-device-in-vs2010 precision internal CPU counters such as RDTSC RDMSR RDPMC Low level system information Idle Process Time Io Read Transfer..
Windows Unicode C++ Stream Output Failure http://stackoverflow.com/questions/9859020/windows-unicode-c-stream-output-failure test app which just does the following std wcout L u2122 Low and behold that breaks output to the console window for the..
|