Posts by sidigrid

68 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
sidigrid says

This is in fact a function that is all over the web in different shapes and forms, all with slightly different performances. I’ve experimented with this function in the past and it turns out that the function below generally performs nicely. I don’t see a way to improve it to go any faster – if you do, correct me! ;)
function isPrime(n:int):Boolean {
    if (n == 2)
        return true;                     //2 is a strange prime, as it's the only even prime. You might want to consider removing this check if you're certain n != 2
    if ((n & 1) == 0 || n == 1)          //(n & 1) == 0 is a bitwise check for even numbers -- Similarly to the above, you might want to remove n == 1 if you're sure it's not 1
        return false;
    var sqrt = Math.sqrt(n);             //Computing once and storing is adviced, especially for large n
    for (var i = 3; i <= sqrt; i += 2)   //only have to check until the squareroot of n, obviously. By starting at 3 and adding 2 we skip checking evens, which are filtered by checking mod2 earlier.
        if (n % i == 0)
            return false;
    return true;
}

Of course readability isn’t that great, but it’s still pretty legible. Wish there was a faster way to compute the squareroot, though! Oh well, at least it has only squareroot-n complexity :)

If you’re intrigued by (highly optimized) computation of math problems, have a look at Project Euler ! I’m currently at 25% ;)

Pretty neat use of bitwise operators and logic. This definitely would give a performance boost to normal iterative way of solving for a prime. Will try to push it further..lol..Thanks for the code Joost..nice one…

68 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
sidigrid says

Hi, This is dumb way of doing itbut is easier to understand. Hope this helps..

private function primNum(int num) { /n var nums:int = Math.floor(Math.sqrt(num)); var i:Number = 1; var prime:String = ” is”; while (++i <= nums) { if ((num % i) == 0) { //Not a prime number prime = ” is not”; i = nums; } } trace(num + prime +” a prime number”); }

Call it by primNum(123);

Dont shout if it has syntax errors..lol.. pick up its logic and enjoy.. Regards, Sid

68 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
sidigrid says

Hi All, I just wanted to know if anyone else is seeing a push in their sales these days? I dont have any big files around but the files I have already are selling good..wow, I never thought that would happen. And yep, I feel like developing new and bigger files for the market place from now..lol..

Side Talk: Has anyone been into developing for Android using flash(AIR)?!

68 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
sidigrid says

I am interested too. Do post me back if you are still searching for a programmer.(sidenvato@gmail.com) or from profile page.

Regards, Sid.

68 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
sidigrid says

Yep, interested too..but do try getting in touch with the author. If author is not available for any reason, you can contact me..

Regards, Sid

68 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
sidigrid says

Hi vladyghost, Am interested. If you dont find a player that suits your exact needs or if you want some customization to be done to a normal player, shoot me a mail through my profile..

regards…

68 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
sidigrid says

Happy Birthday buddy…Bring on nice files with your new mac…

68 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
sidigrid says

Guys, PayPal seems to be off with its bank transfer options in India.. Any other alternatives?? Moneybookers does make a bank transfer but i am not sure how good it is…Anyone with helpful information will be great…

68 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
sidigrid says

Hmm, Even I have been developing a template for WP..My first go at it. Been a tidy journey till now. Need to see what happens..Lol..

Wel, it would help a lot if you invest some time preparing a good help file for the users. Its a reusable thing for your future templates.:-)...

Flow of developing a template may vary a bit depending on the developers but in a generic sense even i do follow a similar process as that of your’s..

Hmm..Good Luck..

G.Luck to me too..Lol..

68 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 100 and 1 000 dollars
sidigrid says

Yup..everyone started to feel its effect now. And probably reduction in promoting activeden through advertising brought a blow. I think envato should really make a note of this. Recent days have probably been quite dull..

by
by
by
by
by
by