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
const N = 32 | |
""" | |
Montgomery Modular Multiplication. | |
""" | |
function MMM(a::UInt32, b::UInt32, n::UInt32)::UInt32 | |
s::UInt64 = 0 | |
q::UInt32 = 0 | |
for i::UInt32 in 0:N-1 | |
# i-th bit of a shifted to the least significant position |
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
SYSCONFIG CONFIG_IOVOLTAGE=3.3 COMPRESS_CONFIG=ON MCCLK_FREQ=62 SLAVE_SPI_PORT=DISABLE MASTER_SPI_PORT=ENABLE SLAVE_PARALLEL_PORT=DISABLE; | |
# 25 MHZ clock on the i5 board | |
LOCATE COMP "clk_i" SITE "P3"; | |
IOBUF PORT "clk_i" IO_TYPE=LVCMOS33; | |
FREQUENCY PORT "clk_i" 25 MHZ; | |
# Built in LED | |
LOCATE COMP "led0" SITE "U16"; | |
IOBUF PORT "led0" IO_TYPE=LVCMOS25; |
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
# So you've read this: https://github.com/atom/atom/pull/8442 but you don't want to use the Atom Portable version. | |
# The workaround is to alias the atom command :) | |
# Put this into your ~/.bash_aliases | |
alias atom-local='ATOM_HOME=$PWD/.atom atom $PWD' | |
# Starting Atom with the provided command above each directory conatains its own styles, plugins, etc. | |
# This way you can use Juno when you're working with Julia and use your standard js/vue/react plugins | |
# when doing some frontend 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
module Sorting (main) where | |
quicksort :: [Integer] -> [Integer] | |
quicksort [] = [] | |
quicksort (x:xs) = quicksort smaller ++ [x] ++ larger | |
where | |
smaller = [a | a <- xs, a <= x] | |
larger = [b | b <- xs, b > x] | |
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 UnicodePlots | |
const points = 20 | |
function command(from, to) | |
start = "HEAD" * "^"^from | |
last = "HEAD" * "^"^to | |
`git diff --numstat $start $last` | |
end | |
data = zeros(points, 3) |
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
## Rename file | |
j=1;for i in `ls | grep -E ".png|.jpg|.jpeg|.PNG|.JPG|.JPEG"`; do prt=$(printf '%04d' $j);j=$((j + 1));mv -v $i "$prt.JPG"; done | |
mogrify -crop 1920x1080+362+628 *.jpg | |
## or resize | |
mogrify -resize 1920x1080 *.jpg | |
## morph if necessary !!! takes time | |
convert *.jpg -delay 10 -morph 10 %05d.morph.jpg | |
## create movie | |
ffmpeg -r 25 -i %05d.morph.jpg output.mp4 | |
## or |