Coder Social home page Coder Social logo

pisearch's Introduction

pisearch

Go language Pi search code. Requires a file of the digits of Pi and a suffix array built atop them:

<name>.4.bin -- digits of pi, BCD, packed 2 digits per byte

<name>.4.idx -- a suffix array indexing those digits, stored
                as little-endian uint32s.

I've put a copy of pi1m.4.bin and pi1m.4.idx at:

if you want to play with them. You will need some kind of file of Pi digits in src/pisearch in order to run the tests.

The search code is in src/pisearch. It's had more thought put into it than the quick hack of a web interface in src/piweb. Use at your own risk. The json exported by piweb is still changing a lot as I work on the javascript/html front-end.

Building

cd pisearch
    export GOPATH=`/bin/pwd`
go install pi       (command-line search interface)
go install piweb    (web-based/json search code)
go install pipack   (utility to pack and unpack BCD)

go test pisearch   (requires a pi file - see pisearch_test.go)

Optionally:

go install pigen    (generate pi using the Chudnovsky algorithm)

pigen depends on an external package that you must install using go get:

go get github.com/cznic/mathutil

Of course, you can also check out the pi search code into a subdirectory of your GOPATH, adjusting things as needed for your setup. To verify that you've got things running, try some commands such as:

pi search 1415
pi count 99999

pisearch's People

Contributors

dave-andersen avatar

Watchers

 avatar

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.