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
$ mvn compile -e -rf :org.lamport.tlatools | |
... | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Building org.lamport.tla.toolbox.uitest 1.0.0-SNAPSHOT | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Reactor Summary: | |
[INFO] | |
[INFO] org.lamport.tlatools ............................... SUCCESS [ 8.409 s] | |
[INFO] org.lamport.tlatools.api ........................... SUCCESS [ 0.004 s] |
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
(On Ubuntu 16.04) | |
# Clone repo | |
$ git clone https://github.com/tlaplus/tlaplus.git | |
# Install Java 8 | |
$ sudo add-apt-repository ppa:webupd8team/java | |
$ sudo apt update | |
$ sudo apt install oracle-java8-installer | |
$ javac -version |
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
$ mvn compile -rf :org.lamport.tlatools | |
... | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Building org.lamport.tla.toolbox.uitest 1.0.0-SNAPSHOT | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Reactor Summary: | |
[INFO] | |
[INFO] org.lamport.tlatools ............................... SUCCESS [ 8.395 s] | |
[INFO] org.lamport.tlatools.api ........................... SUCCESS [ 0.004 s] |
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
import Data.Bits | |
import System.IO | |
import qualified Data.List as L | |
import qualified Data.Vector as V | |
import qualified Data.HashMap.Strict as HM | |
import Statistics.Test.ChiSquared | |
import Data.BloomFilter.Hash | |
best :: Int -> Int -> Int | |
best servers bits = 2^bits `div` servers |
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
trace :: ((input, feedback) -> (output, feedback)) -> input -> output | |
trace f input = output | |
where (output, feedback) = f (input, feedback) |
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
sequenceA = 'actgatcgattgatcgatcgatcg' | |
sequenceB = 'tttagatcgatcttgatc' | |
""" | |
Task: Uppercase (highlight) the most similar subsequence in sequenceA and sequenceB. In other words, align sequenceA and sequenceB so they best match. | |
Why is this useful? If the sequences are big, or you have a lot of sequence pairs, this is tiresome and error prone. | |
""" |
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
import time | |
""" | |
Here's your function/task you want to make parallel | |
In your case the time.sleep would be replaced with lots | |
of computation | |
""" | |
def computation(threadid): | |
print "starting thread ", threadid | |
time.sleep(2) |
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
import time | |
from multiprocessing import Process | |
""" | |
Here's your function/task you want to make parallel | |
In your case the time.sleep would be replaced with lots | |
of computation | |
""" | |
def computation(threadid): | |
print "starting thread ", threadid |