irb(main):003:0> Prime.prime?(1,3) => false irb(main):004:0> Prime.prime?(1.3) => false irb(main):005:0> Prime.prime?(20.3) => true Prime.prime? converts floating point numbers to integer to determine if they are prime. A prime ...chaitanyav (NagaChaitanya Vellanki)
Added a method to check if a given n is probably prime or composite using Miller- Rabin Test. This method is faster that the sieve method to check for an arbitrary n. Please review my pull request. https://github.com/ruby/ruby/pull...chaitanyav (NagaChaitanya Vellanki)
I was trying to install a c-extension gem, the installation failed on first attempt. But succeeded on the second attempt.This was right after installing the ruby-2.1.1 (ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]) on Manjar...chaitanyav (NagaChaitanya Vellanki)
Shyouhei Urabe wrote: > > check for similar behaviour of sprintf in a c program > ... I encountered this issue today, i was missing a format specifier in my code and it took sometime to figure it out. It would be nice if there was a wa...chaitanyav (NagaChaitanya Vellanki)
check for similar behaviour of sprintf in a c program #include <stdio.h> int main() { char buffer[50]; char *p = buffer; sprintf(buffer, "%d", 1, 2, 3); printf("%s", p); return 0; } > gcc test_str.c > ... tes...chaitanyav (NagaChaitanya Vellanki)
sprintf should raise error when the number of arguments does not match the number of format specifiers sprintf with correct number of format specifiers, arguments >> sprintf('%s', 'hello') => "hello" sprintf with a single format ...chaitanyav (NagaChaitanya Vellanki)
I will let the developers know about this issue. For now, i have added GC.start after each of the methods inside the rake task which pull around 100K+ rows of data each. I am not getting segmentation fault anymore. begin cloader_obj...chaitanyav (NagaChaitanya Vellanki)