AtomicFrontierCode / keyboards

Simulated annealing code for video
MIT License
274 stars 32 forks source link

MacOS silicon #12

Open WorkshopPlays opened 7 months ago

WorkshopPlays commented 7 months ago

When the code git clone

https://github.com/AtomicFrontierCode/keyboards.git cd keyboards julia -L 'keyboardSA.jl'

is put into the MacOS julia terminal, the response

ERROR: syntax: extra token "clone" after end of expression Stacktrace: [1] top-level scope @ none:1

I am not experienced with coding or the Julia language and have absolutely no clue how to fix this.

bakisama commented 7 months ago

do you have git installed?

coolaj86 commented 7 months ago

You need to:

  1. install macOS Command Line Developer Tools
  2. install Julia
  3. clone the git repo
  4. run the program (and modify the input text with your own text)

Bonus: put Julia in your PATH for future use.

In Full

1. Install Xcode Command Line Tools

On macOS you first must install the developer tools:

xcode-select --install

After that you'll need to install Julia:

2a. Install Julia The Easy Way™

Using Webi:

curl https://webi.sh/julia | sh
source ~/.config/envman/PATH.env

2b. Install Julia The Very Manual Way™

curl -o ./julia-1.9.4-macaarch64.tar.gz -# -L https://julialang-s3.julialang.org/bin/mac/aarch64/1.9/julia-1.9.4-macaarch64.tar.gz

tar xzvf ./julia-1.9.4-macaarch64.tar.gz

xattr -r -d com.apple.quarantine ./julia-1.9.4

mkdir -p ~/.local/opt/

mv ./julia-1.9.4 ~/.local/opt/

ln -s ./julia-1.9.4 ~/.local/opt/julia

3. Run the Project

Now, with git and julia both installed, you can download the repo and run the project:

git clone https://github.com/AtomicFrontierCode/keyboards.git ./keyboards

pushd ./keyboards/

~/.local/opt/julia/bin/julia -L ./keyboardSA.jl

A bunch of stuff will install for a few minutes and then the program will run for a minute or so.

Once you get to the julia > prompt it's done. You can hit ctrl + d to exit and then final.png will be the best keyboard layout for the contents of myBook.txt.

open ./final.png

Options

Replace myBook.txt with a bunch of text from your own writings (or in that style) and it if it's long enough it may take a few days before it comes up with the answer.

Replace baselineLayout = QWERTYgenome, with either ABCgenome or DVORAKgenome if you prefer the ABC or Dvorak layouts.

WorkshopPlays commented 6 months ago

@coolaj86 I ran everything but the last line. I hit Ctrl+D, and exited the terminal window. I ran the command open ./final.png but the file does not exist.

coolaj86 commented 6 months ago

@WorkshopPlays Record you screen with Cmd+Shift+5 on macOS (make sure to enable the mic in the Options dropdown) go through the process, upload it to YouTube, and I'll watch and give you feedback.