GithubHelp home page GithubHelp logo

ktprime's Introduction

many useful program including prime/twin sieve & hash map & timer & lru & topk

ktprime's People

Contributors

ktprime avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ktprime's Issues

You have accidentally replaced PrimeNumber.cpp

Hi,

I think you have accidentally replaced PrimeNumber.cpp by topK.cpp. Both PrimeNumber.cpp and topK.cpp are nearly identical and your PrimeNumber.cpp cannot be used anymore to sieve prime numbers.

rehash public

For the hashmaps, should rehash be public? This seems to be the standard with most the other hashmaps. I see one has shrink_to_fit which calls rehash (but the other does not).

This is a great hashmap! I've been comparing it to many others, and it has clearly been the best.

Compile error using GCC >= 6.3

Hi,

I have run into a compiler error using GCC 6.3 and GCC 7.1 on Ubuntu 17.04 (x86_64):

g++-7.1 -DSIEVE_SIZE=2048 -DW30 -march=native -funroll-loops -O3 -s -pipe PrimeNumber.cpp -o prime
PrimeNumber.cpp: In function ‘int main(int, char**)’:
PrimeNumber.cpp:1865:8: error: ‘gets’ was not declared in this scope
   if (!gets(ccmd) || !executeCmd(ccmd))

It seems to me that GCC has removed gets from the <stdio.h> because its usage is dangerous!

Using the clang++-4.0 the code compiles fine but I get a warning for gets:

clang++ -DSIEVE_SIZE=2048 -DW30 -march=native -funroll-loops -O3 -s -pipe PrimeNumber.cpp -o PrimeNumber
PrimeNumber.cpp:1864:10: warning: 'gets' is deprecated [-Wdeprecated-declarations]
    if (!gets(ccmd) || !executeCmd(ccmd))
         ^
/usr/include/stdio.h:640:14: note: 'gets' has been explicitly marked deprecated here
extern char *gets (char *__s) __wur __attribute_deprecated__;
             ^
1 warning generated.
/tmp/PrimeNumber-595f7f.o: In function `main':
PrimeNumber.cpp:(.text+0x4842): warning: the `gets' function is dangerous and should not be used.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.