{"action":"created","issue":{"url":"https://api.github.com/repos/jove-sh/jove-scala/issues/1","labels_url":"https://api.github.com/repos/jove-sh/jove-scala/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/jove-sh/jove-scala/issues/1/comments","events_url":"https://api.github.com/repos/jove-sh/jove-scala/issues/1/events","html_url":"https://github.com/jove-sh/jove-scala/issues/1","id":69325997,"number":1,"title":"Kernel crash with code that runs fine in Scala interpreter","user":{"login":"cliburn","id":518247,"avatar_url":"https://avatars.githubusercontent.com/u/518247?v=3","gravatar_id":"","url":"https://api.github.com/users/cliburn","html_url":"https://github.com/cliburn","followers_url":"https://api.github.com/users/cliburn/followers","following_url":"https://api.github.com/users/cliburn/following{/other_user}","gists_url":"https://api.github.com/users/cliburn/gists{/gist_id}","starred_url":"https://api.github.com/users/cliburn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cliburn/subscriptions","organizations_url":"https://api.github.com/users/cliburn/orgs","repos_url":"https://api.github.com/users/cliburn/repos","events_url":"https://api.github.com/users/cliburn/events{/privacy}","received_events_url":"https://api.github.com/users/cliburn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-18T16:45:33Z","updated_at":"2015-05-15T16:14:21Z","closed_at":"2015-05-15T16:14:21Z","body":"While working through 99 Scala problems, the solution to problem 12 causes the kernel to crash\r\n\r\n**P12** Decode a run-length encoded list.\r\n\r\nGiven a run-length code list generated as specified in problem P10, construct its uncompressed version.\r\n\r\nExample:\r\n```scala\r\nscala> decode(List((4, 'a), (1, 'b), (2, 'c), (2, 'a), (1, 'd), (4, 'e)))\r\nres0: List[Symbol] = List('a, 'a, 'a, 'a, 'b, 'c, 'c, 'a, 'a, 'd, 'e, 'e, 'e, 'e)\r\n```\r\n\r\n// Works in Scala interpreter but crashes kernel in Notebook\r\n```scala\r\ndef decode[A](xs: List[(Int, A)]): List[A] = \r\n    for {\r\n        (n, x) <- xs\r\n        i <- 1 to n\r\n    } yield x\r\n```\r\n\r\n```scala\r\nscala> decode(List((4, 'a), (1, 'b), (2, 'c), (2, 'a), (1, 'd), (4, 'e)))\r\nres3: List[Symbol] = List('a, 'a, 'a, 'a, 'b, 'c, 'c, 'a, 'a, 'd, 'e, 'e, 'e, 'e)\r\n````\r\n\r\nSystem:\r\nOS X 10.9.5\r\n\r\nVersion info:\r\nIPython notebook 3.1\r\nScala 2.11\r\n\r\nError message:\r\n```\r\n[I 12:28:32.928 NotebookApp] Saving file at /NinetyNine.ipynb\r\nDone fetching / updating artifacts\r\nException in thread \"Thread-74\" Exception in thread \"Thread-75\" org.zeromq.ZMQException: Errno 156384765 : Context was terminated\r\n\tat org.zeromq.ZMQ$Socket.mayRaise(ZMQ.java:1344)\r\n\tat org.zeromq.ZMQ$Socket.send(ZMQ.java:1209)\r\n\tat org.zeromq.ZMQ$Socket.send(ZMQ.java:1193)\r\n\tat jove.kernel.socket.zmq.ZMQMessageSocket.send(ZMQMessageSocket.scala:95)\r\n\tat jove.kernel.server.InterpreterServer$$anonfun$1.apply(InterpreterServer.scala:45)\r\n\tat jove.kernel.server.InterpreterServer$$anonfun$1.apply(InterpreterServer.scala:45)\r\n\tat jove.kernel.interpreter.InterpreterHandler$.jove$kernel$interpreter$InterpreterHandler$$sendStream(InterpreterHandler.scala:57)\r\n\tat jove.kernel.interpreter.InterpreterHandler$$anonfun$jove$kernel$interpreter$InterpreterHandler$$execute$2$$anonfun$stream$1$1.apply(InterpreterHandler.scala:107)\r\n\tat jove.kernel.interpreter.InterpreterHandler$$anonfun$jove$kernel$interpreter$InterpreterHandler$$execute$2$$anonfun$stream$1$1.apply(InterpreterHandler.scala:107)\r\n\tat jove.scala.imainlike.Capture$$anon$1.run(Capture.scala:11)\r\norg.zeromq.ZMQException: Errno 156384765 : Context was terminated\r\n\tat org.zeromq.ZMQ$Socket.mayRaise(ZMQ.java:1344)\r\n\tat org.zeromq.ZMQ$Socket.send(ZMQ.java:1209)\r\n\tat org.zeromq.ZMQ$Socket.send(ZMQ.java:1193)\r\n\tat jove.kernel.socket.zmq.ZMQMessageSocket$$anonfun$send$1.apply(ZMQMessageSocket.scala:94)\r\n\tat jove.kernel.socket.zmq.ZMQMessageSocket$$anonfun$send$1.apply(ZMQMessageSocket.scala:94)\r\n\tat scala.collection.immutable.List.foreach(List.scala:381)\r\n\tat jove.kernel.socket.zmq.ZMQMessageSocket.send(ZMQMessageSocket.scala:94)\r\n\tat jove.kernel.server.InterpreterServer$$anonfun$1.apply(InterpreterServer.scala:45)\r\n\tat jove.kernel.server.InterpreterServer$$anonfun$1.apply(InterpreterServer.scala:45)\r\n\tat jove.kernel.interpreter.InterpreterHandler$.jove$kernel$interpreter$InterpreterHandler$$sendStream(InterpreterHandler.scala:57)\r\n\tat jove.kernel.interpreter.InterpreterHandler$$anonfun$jove$kernel$interpreter$InterpreterHandler$$execute$2$$anonfun$stream$1$1.apply(InterpreterHandler.scala:107)\r\n\tat jove.kernel.interpreter.InterpreterHandler$$anonfun$jove$kernel$interpreter$InterpreterHandler$$execute$2$$anonfun$stream$1$1.apply(InterpreterHandler.scala:107)\r\n\tat jove.scala.imainlike.Capture$$anon$1.run(Capture.scala:11)\r\nException in thread \"RequestsEventLoop\" java.lang.AssertionError: assertion failed: List(value _1$mcI$sp, value _1$mcI$sp, value _1$mcI$sp, value _1$mcI$sp, value _1$mcI$sp, value _1$mcI$sp, value _1$mcI$sp, value _1$mcI$sp, value _1$mcI$sp, value _1$mcI$sp, value _1$mcI$sp, value _1$mcI$sp)\r\n\tat scala.reflect.internal.Symbols$Symbol.suchThat(Symbols.scala:1916)[I 12:31:34.566 NotebookApp] KernelRestarter: restarting kernel (1/5)\r\n```"},"comment":{"url":"https://api.github.com/repos/jove-sh/jove-scala/issues/comments/102450766","html_url":"https://github.com/jove-sh/jove-scala/issues/1#issuecomment-102450766","issue_url":"https://api.github.com/repos/jove-sh/jove-scala/issues/1","id":102450766,"user":{"login":"alexarchambault","id":7063723,"avatar_url":"https://avatars.githubusercontent.com/u/7063723?v=3","gravatar_id":"","url":"https://api.github.com/users/alexarchambault","html_url":"https://github.com/alexarchambault","followers_url":"https://api.github.com/users/alexarchambault/followers","following_url":"https://api.github.com/users/alexarchambault/following{/other_user}","gists_url":"https://api.github.com/users/alexarchambault/gists{/gist_id}","starred_url":"https://api.github.com/users/alexarchambault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexarchambault/subscriptions","organizations_url":"https://api.github.com/users/alexarchambault/orgs","repos_url":"https://api.github.com/users/alexarchambault/repos","events_url":"https://api.github.com/users/alexarchambault/events{/privacy}","received_events_url":"https://api.github.com/users/alexarchambault/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T16:14:21Z","updated_at":"2015-05-15T16:14:21Z","body":"Closing this. All of this is fixed in https://github.com/alexarchambault/jupyter-scala."}}