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
| # Find all files KEYWORD | |
| $ fgrep -R --files-with-matches KEYWORD . | |
| # Find all files with FILENAME and KEYWORD | |
| $ find . -name FILENAME -exec fgrep --files-with-matches KEYWORD {} \; |
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
| -- Seach column name in database | |
| select table_name from all_tab_columns where column_name like '%COLUMN_NAME%'; | |
| -- Seach table name in database | |
| select table_name from all_tables where table_name like '%TABLE_NAME%'; |
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
| // Author: Kim Walisch | |
| // Released into public domain | |
| #include <windows.h> | |
| #include <cstdlib> | |
| typedef BOOL (WINAPI *LPFN_GLPI)(PSYSTEM_LOGICAL_PROCESSOR_INFORMATION, PDWORD); | |
| /// Get the CPU's cache size in bytes. | |
| /// Works on Windows (MSVC, Intel C++ Compiler, Cygwin, ...). |
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
| /// | |
| /// @file constexpr_sqrt.cpp | |
| /// @brief Calculate integer square roots at compile time using | |
| /// C++11 constexpr. | |
| /// @author Kim Walisch, <kim.walisch@gmail.com> | |
| /// @license Public Domain | |
| #include <iostream> | |
| #include <cassert> | |
| #include <cmath> |
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
| ; primesieve inner sieving loop | |
| ; Uses only 11 instructions (x86-64) to cross-off the next 8 multiples | |
| .L99: | |
| andb $-3, (%rax) | |
| andb $-9, (%rax,%r14) | |
| andb $127, (%rax,%r12) | |
| andb $-33, (%rax,%rbp) | |
| andb $-2, (%rax,%r10) | |
| andb $-65, (%rax,%rbx) | |
| andb $-5, (%rax,%r9) |
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
| wget --content-disposition -i urls.txt |
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
| struct libdivide_u64_t libdivide_u64_gen(uint64_t d) { | |
| struct libdivide_u64_t result; | |
| const uint32_t floor_log_2_d = 63 - libdivide__count_leading_zeros64(d); | |
| uint64_t proposed_m, rem; | |
| uint8_t more; | |
| proposed_m = libdivide_128_div_64_to_64(1ULL << floor_log_2_d, 0, d, &rem); //== (1 << (64 + floor_log_2_d)) / d | |
| LIBDIVIDE_ASSERT(rem > 0 && rem < d); |
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
| #include <primesieve.h> | |
| #include <stdio.h> | |
| int main() | |
| { | |
| primesieve_iterator it; | |
| primesieve_init(&it); | |
| uint64_t prime; | |
| /* iterate over the primes below 10^6 */ |
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
| # Compile using default C++ compiler | |
| c++ -O2 segmented_sieve.cpp -o segmented_sieve | |
| # Count the primes below 10^9 | |
| time ./segmented_sieve 1000000000 |
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
| 45a20e525e3c19fc98e583101af166fd5e6b2324 primesieve-5.7.2.tar.gz | |
| 064b79afeff39866b3c17d390c790778460e5a1c primesieve-5.7.2.zip | |
| 6fd3e6d98a6d4bf7a7234279deaa4eff193235b9 primesieve-5.7.0-win64.zip | |
| c7f3e96c4e1a0e23131f6a39f4086d6d275b0b6c primesieve-5.7.0-win64-console.zip | |
| 8e3f62c850efe591286fcc2262a7f4af4cad285b primesieve-5.5.0-linux-x64.tar.gz | |
| 31215c1dcbc3899f4929b1291a0cb73522111b6d primesieve-5.7.0-linux-x64-console.tar.gz | |
| 4095d6d2f88a71f8bf86cea1332b539025320bec primesieve-5.5.0-macosx-x64.zip | |
| 7ea817d4555dc378e0abf9d14400af8de95dc9f7 primesieve-5.5.0-macosx-x64-console.zip | |
| da7a99173692da005ace827b0df17cb3e7ab1356 primesieve-3.6-win32.zip | |
| 9d16566558aee0b71139f5f95dff23d808d2d886 primesieve-3.6-win32-console.zip |
OlderNewer