http://w140.com/tekwiki/wiki/Phosphor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #cmake >= 3.21 | |
| if(WIN32) | |
| add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD | |
| COMMAND ${CMAKE_COMMAND} -E copy_if_different | |
| $<TARGET_RUNTIME_DLLS:${PROJECT_NAME}> | |
| $<TARGET_FILE_DIR:${PROJECT_NAME}> | |
| COMMAND_EXPAND_LISTS | |
| ) | |
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # usage (run it in git bash): | |
| # cd <your-project's-build-dir> | |
| # copydlls.sh . | |
| # path to your goddamn compiler's dlls | |
| # (they are usually in the bin directory of where compiler is installed) | |
| dllpath=/c/Qt/Tools/mingw1310_64/bin | |
| # copy the damn dlls already | |
| cp ${dllpath}/libatomic-1.dll $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // utility function to do printf-style formatting on a std::string | |
| #include <string> | |
| template<typename ... Args> | |
| static std::string format_string(const char* format, Args... args) | |
| { | |
| if (format) { | |
| // get size from test run | |
| const size_t sz = std::snprintf(nullptr, 0, format, args ...); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| VAR = foobar => Assign value to variable when qmake is run | |
| $$VAR => QMake variable's value at the time qmake is run | |
| $${VAR} => QMake variable's value at the time qmake is run (identical but enclosed to separate from surrounding text) | |
| $(VAR) => Contents of an Environment variable at the time Makefile (not qmake) is run | |
| $$(VAR) =>Contents of an Environment variable at the time qmake (not Makefile) is run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class FrequencyDoubler | |
| { | |
| public: | |
| FrequencyDoubler() { | |
| coeffs = ReSampler::makeHilbert(1001); | |
| length = coeffs.size(); | |
| history.resize(length); | |
| centerTap = length / 2; | |
| currentIndex = length - 1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "quince" | |
| "apple" | |
| "bananna" | |
| "cherry" | |
| "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Mr Mrs | |
| Ms | |
| Miss | |
| Dr | |
| Herr | |
| Monsieur | |
| Hr | |
| Frau | |
| - | |
| A V M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef UGLYPLOT_H | |
| #define UGLYPLOT_H | |
| #include <iostream> | |
| #include <cmath> | |
| class UglyPlot | |
| { | |
| public: | |
| static void plot(const double* p, int length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // pick a good fft size for fftw (of the form 2^a * 3^b * 5^c * 7^d * [1|11|13] ) | |
| int selectFFTSize(int n) | |
| { | |
| int s = 1; | |
| for(int ef : {1, 11, 13}) { | |
| for(int d = 1 ; d <= n; d *= 7) { | |
| for(int c = 1; c <= n; c *= 5) { | |
| for(int b = 1; b <= n; b *= 3) { |
NewerOlder