Ei kuvausta

Gary Paduana b879c26760 Update README.md 9 vuotta sitten
.idea e084350d36 clean up gitignore and refactor static constants 9 vuotta sitten
src b1a577c48f refactor names 9 vuotta sitten
.gitignore e084350d36 clean up gitignore and refactor static constants 9 vuotta sitten
README.md b879c26760 Update README.md 9 vuotta sitten
build.gradle c1e3f7b6c1 add new classes and test cases 9 vuotta sitten

README.md

Installation

gradle

Step 1. Add the JitPack repository to your build file

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Step 2. Add the dependency

dependencies {
    compile 'com.github.garypaduana:groovy-tools:-SNAPSHOT'
}

maven

Step 1. Add the JitPack repository to your build file

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Step 2. Add the dependency

<dependency>
    <groupId>com.github.garypaduana</groupId>
    <artifactId>groovy-tools</artifactId>
    <version>-SNAPSHOT</version>
</dependency>

##Quick Usage

Import the dependency as a Grape.

@GrabResolver(name='jitpack', root='https://jitpack.io')
@Grab(group='com.github.garypaduana', module='groovy-tools', version='develop-SNAPSHOT')

import com.garypaduana.groovytools.algorithm.FermatsLittleTheorem
import static com.garypaduana.groovytools.system.Timing.timeIt

def number = 53

println timeIt({
    FermatsLittleTheorem.probablyPrime(number)
})

println timeIt({
    for(int i = 2; i <= Math.sqrt(number); i++){
        if((number % i) == 0){
            return false
        }        
    }
    return true
})

Produces:

[returnValue:true, duration:0.000181163]
[returnValue:true, duration:0.000164525]