Skip to content

Instantly share code, notes, and snippets.

@ThomasMiconi
ThomasMiconi / prompt.txt
Last active April 11, 2023 06:03
Prompt for a novel arithmetic operation, following Zhou et al. 2022. See comments.
Problem: 821`763=
Explanation:
The first number is 821, FN=[8,2,1]. The second number is 763, SN=[7,6,3]. Since FN [8,2,1] has 3 digits, SN [7,6,3] has 3 digits, thus the maximum number of digits is 3. In each subsequent step, we remove one number from the beginning of FN and one from the beginning of SN.
Length of FN is 3. FN=[8,2,1]. Length of SN is 3. SN=[7,6,3]. FN[3]=8. SN[3]=7. C[3]=0. Since 8*7=56, 56%10=6, 56//10=5. Length of A is 1. Thus A=[6]. Since 5 is odd, we change the value of C. Since C[3]=0, C[2]=1.
Length of FN is 2. FN=[2,1]. Length of SN is 2. SN=[6,3]. FN[2]=2. SN[2]=6. C[2]=1. Since 2*6=12, 12%10=2, 12//10=1. Length of A is 2. Thus A=[6,2]. Since 1 is odd, we change the value of C. Since C[2]=1, C[1]=0.
Length of FN is 1. FN=[1]. Length of SN is 1. SN=[3]. FN[1]=1. SN[1]=3. C[1]=0. Since 1*3=4, 4%10=4, 4//10=0. Length of A is 3. Thus A=[6,2,4]. Since 0 is even, we do not change the value of C. Since C[1]=0, C[0]=0.
There are no more digits and C[0]=0. Thus the process is complete. Sin
@vtjeng
vtjeng / local_julia_dev.MD
Last active May 25, 2020 21:48
Guide to local development for the MIPVerify Julia Package

This is a guide for local development of a Julia package in Julia 1.0 and above.

tl;dr: We use a new environment to ensure that our regular Julia environment is not affected.

Setting up a new environment

Navigate to ~/.julia/environments. This folder should contain the default environment. (I am currently working in Julia 1.0, so the environments folder contains the folder v1.0).

From the same folder, make a new project by running julia, then entering the Pkg repl by pressing ] from julia.

Upon entering the Pkg REPL, you should see a prompt like this:

@mapsam
mapsam / README.md
Last active June 11, 2023 11:59
Namecheap > Github pages

Namecheap > Github pages

Pointing your domains to a gh-pages branch requires three steps.

  1. Add the Github IPs as A records on Namecheap.
    185.199.108.153
    185.199.109.153
    185.199.110.153
    185.199.111.153
@danfinlay
danfinlay / How to download streaming video.md
Last active July 30, 2024 15:24
How to download a streaming video with Google Chrome

How to download streaming video

Streaming just means a download that they don't want you to keep. But Chrome's developer tools make it easy to access what's really going on under the hood.

Open Developer Tools

From the page where you want to download some things, go into your chrome menu to open the developer tools. You can either:

1.  (On a mac): Command-option-J
2. (On a PC): Control-alt-J
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active September 24, 2024 16:32
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname