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 heap | |
| type HeapIF interface { | |
| Push(el interface{}) | |
| Pop() interface{} | |
| Get() interface{} | |
| Size() int64 | |
| Empty() bool | |
| } |
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 bfs | |
| import "container/list" | |
| // Point is a basic structure for representing points in a maze | |
| type Point struct { | |
| x, y int | |
| } | |
| // QPoint wraps around Point together with information about distance from the |
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 dfs | |
| // Point is a basic structure for representing points in a maze | |
| type Point struct { | |
| x, y int | |
| } | |
| // SPoint wraps around Point together with information about distance from the | |
| // origin | |
| type SPoint 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
| (defun timestamp-at-point-to-date () | |
| "Interactively try to capture number at point and convert it to | |
| human-readable date." | |
| (interactive) | |
| (let ((timestamp (/ (thing-at-point 'number) 1000))) | |
| (message (format-time-string "%Y-%m-%dT%T" timestamp)))) |
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
| import scala.annotation.tailrec | |
| // Solutions to 99 Scala problems taken from: http://aperiodic.net/phil/scala/s-99/ | |
| // Problem 01 | |
| def last(l: List[Any]): Any = { | |
| l match { | |
| case List() => | |
| null | |
| case List(x) => | |
| x |
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 flatten | |
| import "errors" | |
| // Flatten takes an arbitrarily nested array and tries to | |
| // flatten it into an array of integers. It currently requires | |
| // its input to be in the form of array of interface{} | |
| func Flatten(arr interface{}) ([]interface{}, error) { | |
| res := []interface{}{} |
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
| # 31oct17abu | |
| # (c) Software Lab. Alexander Burger | |
| bin = ../bin | |
| lib = ../lib | |
| ifeq ($(MAKECMDGOALS), arm64.android) | |
| UNAME = Android | |
| MACHINE = aarch64 | |
| else |
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
| # -*- picolisp -*- | |
| #!/usr/local/bin/picolisp /usr/local/lib/picolisp/lib.l | |
| # 01may18abu | |
| # Annotated version | |
| (load "@lib/misc.l" "@lib/vip.l") | |
| (bye | |
| (if |
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
| (de sequencePrinter (N Key) | |
| (co Key | |
| (yield) | |
| (for i N | |
| (yield i)))) | |
| (de sequenceConsumer (Key) | |
| (while (yield Nil Key) | |
| (wait 1000) | |
| (println @))) |
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
| (load "bfs.l") | |
| (def 'Arr1 '( | |
| (1 1 1 1 1 1) | |
| (1 0 0 0 0 1) | |
| (1 0 9 1 0 1) | |
| (1 0 0 1 1 1) | |
| (1 1 1 1 1 1))) | |
| (test |