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 the biggest prime factor of 600851475143 | |
problem3 = do | |
print "Find the biggest prime factor of 600851475143" | |
print(maxPrimeFactor 600851475143) | |
maxPrimeFactor :: Int -> Int | |
maxPrimeFactor n = take 1 (primeFactors n) | |
primeFactors :: Int -> [Int] |
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
package main | |
import "fmt" | |
import "log" | |
import "encoding/json" | |
import "time" | |
import "github.com/mattbaird/elastigo/api" | |
import "github.com/mattbaird/elastigo/core" | |
type Person struct { |
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
package main | |
import "fmt" | |
import "log" | |
import "github.com/couchbaselabs/go-couchbase" | |
/* the view is a JavaScript map function that returns a list of key-value rows. Each row has a birthday as key and the document id as value. To obtain the entire doc, just replace `meta.id` with `doc`. | |
function (doc, meta) { | |
if(doc.birthday) { |
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
package main | |
import "fmt" | |
import "log" | |
import "time" | |
import "github.com/couchbaselabs/go-couchbase" | |
type Person struct { | |
Name string `json:name` | |
Surname string `json:surname` |