Skip to content

Instantly share code, notes, and snippets.

View JeffIrwin's full-sized avatar
🦀
carcinizing

Jeff Irwin JeffIrwin

🦀
carcinizing
View GitHub Profile
@JeffIrwin
JeffIrwin / hello.r
Created January 8, 2022 16:11
Messing around with R
# hello.r
# Windows one-time setup (requires choco):
#
# choco install R
#
# Run this from a shell:
#
# "/c/Program Files/R/R-4.1.2/bin/Rscript.exe" hello.r
@JeffIrwin
JeffIrwin / array.f90
Created September 29, 2020 21:14
Hot take: an array is a function
module mymodule
integer, parameter :: n = 6
integer, parameter :: myarray(n) = [1, 1, 2, 3, 5, 8]
contains
integer function myfunc(input)
@JeffIrwin
JeffIrwin / asc2bin.sce
Created January 23, 2020 01:54
Text to/from binary conversion in Scilab
clear
clc
xdel(winsid())
asc = 'send help'
//==============================================================================
bin = ''
subroutine eniuq(t)
character(len = :), allocatable :: s
character(len = *) :: t
integer :: i
s = ''
do i = 1, len(t)
if (t(i:i) == char(10)) then
s = s//char(34)//'//char(10)// &'//t(i:i)//' '//char(34)
else
s = s//t(i:i)
program p
character(len = *), parameter :: c = '' &
//' //''''\n' &
//'\n' &
//' character(len = :), allocatable :: d\n' &
//'\n' &
//' integer :: i\n' &
//'\n' &
//' print ''(a)'', "program p"\n' &
@JeffIrwin
JeffIrwin / triplePalindrome.py
Created September 17, 2018 23:22
Given an integer, find three palindromes that sum to it.
import sys
if len(sys.argv) != 2:
print("Usage:")
print("python3 triplePalindrome.py 30041777")
sys.exit(-1)
nStr = sys.argv[1]
n = int(nStr)