Coder Social home page Coder Social logo

edpaths's People

Contributors

anyweez avatar

Watchers

 avatar

edpaths's Issues

getVariants() only works with specified visits

runtime error: invalid memory address or nil pointer dereference
/usr/lib/go-1.6/src/runtime/panic.go:443 (0x42df39)
        gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/lib/go-1.6/src/runtime/panic.go:62 (0x42c5f5)
        panicmem: panic(memoryError)
/usr/lib/go-1.6/src/runtime/sigpanic_unix.go:24 (0x44289a)
        sigpanic: panicmem()
/home/luke/git/edpaths/src/server/server.go:221 (0x401b25)
        getVariants: for gen.Left() > 0 {
/home/luke/git/edpaths/src/server/server.go:122 (0x402f64)
        main.func1: for _, variant := range getVariants(startID, endID, visit) {

exception while adding seventh stop

http://216.174.67.131:8080/route?from=539&visit=21115,21390,21115,20575,17072,21428

2016/10/06 21:04:35 [Recovery] panic recovered:
GET /route?from=539&visit=21115,21390,21115,20575,17072,21428 HTTP/1.1
Host: 216.174.67.131:8080
Accept: */*
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Connection: keep-alive
Referer: http://216.174.67.131:8080/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36


reflect: slice index out of range
/usr/lib/go-1.6/src/runtime/panic.go:443 (0x42e339)
        gopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))
/usr/lib/go-1.6/src/reflect/value.go:854 (0x617751)
        Value.Index: panic("reflect: slice index out of range")
/home/luke/git/go/src/github.com/anyweez/edpaths/vendor/github.com/fighterlyt/permutation/permutation.go:193 (0x5154fb)
        (*Permutator).Next: if p.less(p.value.Index(i).Interface(), p.value.Index(j).Interface()) {
/home/luke/git/go/src/github.com/anyweez/edpaths/spacecrawl/spacecrawl.go:255 (0x401d89)
        getVariants: next, _ := gen.Next()
/home/luke/git/go/src/github.com/anyweez/edpaths/spacecrawl/spacecrawl.go:147 (0x40334e)
        main.func1: for _, variant := range getVariants(startID, endID, visit) {
/home/luke/git/go/src/github.com/anyweez/edpaths/vendor/github.com/gin-gonic/gin/context.go:97 (0x517b2a)
        (*Context).Next: c.handlers[c.index](c)
/home/luke/git/go/src/github.com/anyweez/edpaths/vendor/github.com/gin-gonic/gin/recovery.go:45 (0x52a3c1)
        RecoveryWithWriter.func1: c.Next()
/home/luke/git/go/src/github.com/anyweez/edpaths/vendor/github.com/gin-gonic/gin/context.go:97 (0x517b2a)
        (*Context).Next: c.handlers[c.index](c)
/home/luke/git/go/src/github.com/anyweez/edpaths/vendor/github.com/gin-gonic/gin/logger.go:63 (0x52965a)
        LoggerWithWriter.func1: c.Next()
/home/luke/git/go/src/github.com/anyweez/edpaths/vendor/github.com/gin-gonic/gin/context.go:97 (0x517b2a)
        (*Context).Next: c.handlers[c.index](c)
/home/luke/git/go/src/github.com/anyweez/edpaths/vendor/github.com/gin-gonic/gin/gin.go:284 (0x51e982)
        (*Engine).handleHTTPRequest: context.Next()
/home/luke/git/go/src/github.com/anyweez/edpaths/vendor/github.com/gin-gonic/gin/gin.go:265 (0x51e5b7)
        (*Engine).ServeHTTP: engine.handleHTTPRequest(c)
/usr/lib/go-1.6/src/net/http/server.go:2081 (0x4b32ee)
        serverHandler.ServeHTTP: handler.ServeHTTP(rw, req)
/usr/lib/go-1.6/src/net/http/server.go:1472 (0x4afb9e)
        (*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)
/usr/lib/go-1.6/src/runtime/asm_amd64.s:1998 (0x45f1a1)
        goexit: BYTE    $0x90   // NOP

exception when invalid visit list provided (ending in comma)

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x18 pc=0x50e06d]

goroutine 8 [running]:
panic(0x8c6460, 0xc820010100)
        /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
github.com/anyweez/edpaths/structs.(*SpaceSystem).DistanceTo(0xc84f28b140, 0x0, 0x0)
        /home/luke/git/go/src/github.com/anyweez/edpaths/structs/entities.go:142 +0xd
github.com/anyweez/edpaths/structs.TravelCost(0xc84f28b140, 0x0, 0xc8694779f0)
        /home/luke/git/go/src/github.com/anyweez/edpaths/structs/priority.go:23 +0x2e
github.com/anyweez/edpaths/structs.(*SpaceGraph).FindPath(0xc84ce22cc0, 0xc84f28b140, 0x0, 0xc869477e88, 0xc82001a900)
        /home/luke/git/go/src/github.com/anyweez/edpaths/structs/search.go:73 +0x511
main.main.func1.1(0xc84ce22cc0, 0xc82c7c5d60, 0xc82c7c5d00, 0xc869a5a600, 0xc869a58780)
        /home/luke/git/go/src/github.com/anyweez/edpaths/spacecrawl/spacecrawl.go:170 +0x3c1
created by main.main.func1
        /home/luke/git/go/src/github.com/anyweez/edpaths/spacecrawl/spacecrawl.go:188 +0xa28

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.