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
using Gadfly, DataFrames | |
X = 0:0.01:2pi | |
Y = sin.(X); | |
df = DataFrame(X=X, Y=Y) | |
pl = plot(df, x=:X, y=:Y, Geom.line, Guide.title("Gadfly Tutorial")) | |
draw(SVG("tutorial.svg", 1000px, 600px), pl) |
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 main | |
import ( | |
"fmt" | |
) | |
var toBeSorted [10]int = [10]int{1,3,2,4,8,6,7,2,3,0} | |
func bubbleSort(input [10]int) { | |
// n is the number of items in our list |
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
{ | |
"version": "0.1.0", | |
"tasks": [ | |
{ | |
"taskName": "build", | |
"command": "sbt", | |
"args": ["compile"], | |
"isShellCommand": true, | |
"showOutput": "always" | |
},{ |
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
// Side Effect | |
class Cafe { | |
def buyCoffee(cc: CreditCard): Coffee = { // Method of class is determined with def | |
val cup = new Coffee() | |
cc.charge(cup.price) // Side Effect! | |
cup // Scala doesn't need return | |
} | |
} |
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
sudo eopkg up |
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
[Desktop Entry] | |
Name=Typora | |
Comment=Open Typora | |
Exec=typora | |
Icon=typora | |
Terminal=false | |
Type=Application | |
Categories=Development; |
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
sudo ln -s /path/to/dir/typora /usr/bin/typora |
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
print [i for i in range(1,100000000001)][0] |
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
main = print $ head [1..] |
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
primes' = 2 : [x | x <- [3..], isPrime' x] | |
isPrime' x = all (\p -> x `rem` p > 0) (factorsToTry x) | |
where | |
factorsToTry x = takeWhile (\p -> p*p <= x) primes' |
OlderNewer