This file contains 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
object Story { | |
object Once { def upon = (x: a.type) => x } | |
object a { def time = (x: languages.type) => x } | |
object languages { def were = (x: inflexible.type) => x } | |
object inflexible { def along = (x: came.type) => x } | |
object came { def Scala = (x: inflexible.type) => x } | |
implicit def string(s : String) : inflexible.type = inflexible | |
def main(args: Array[String]): Unit = { | |
Once upon a time languages were inflexible; "Then " along came Scala ". The End!" |
This file contains 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
#!/bin/sh | |
# one way (older scala version will be installed) | |
# sudo apt-get install scala | |
#2nd way | |
sudo apt-get remove scala-library scala | |
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb | |
sudo dpkg -i scala-2.11.4.deb | |
sudo apt-get update |
This file contains 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 mani; | |
import static org.hamcrest.Matchers.equalTo; | |
import static org.hamcrest.Matchers.is; | |
import static org.junit.Assert.assertThat; | |
import static org.mockito.Mockito.verify; | |
import static org.mockito.Mockito.verifyNoMoreInteractions; | |
import static org.mockito.Mockito.when; | |
import static org.mockito.MockitoAnnotations.initMocks; |
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
This file contains 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
#!/bin/sh | |
## | |
# Install autoconf, automake and libtool smoothly on Mac OS X. | |
# Newer versions of these libraries are available and may work better on OS X | |
# | |
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html | |
# | |
export build=~/devtools # or wherever you'd like to build |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
This file contains 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
CompletableFuture.supplyAsync(()-> { | |
try { | |
Thread.sleep(5000); | |
} catch (InterruptedException e) { | |
throw new RuntimeException("Error sleeping", e); | |
} | |
if (System.currentTimeMillis()%2==0) { | |
throw new RuntimeException("Even time..."); // 50% chance to fail | |
} | |
return "Hello World!"; |
sed -E -f solver.sed input
where input
is a file containing the maze.
For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p
.
The solver assumes the following:
- The maze only contains the characters
# \nSE
- Every line has the same number of characters
- There is only one start (
S
) and end (E
)