Skip to content

Instantly share code, notes, and snippets.

View rafael-guerra-www's full-sized avatar

Rafael Guerra rafael-guerra-www

View GitHub Profile
@rafaqz
rafaqz / fortran-julia.jl
Last active March 17, 2024 21:34
Fortran-Julia conversion script
#=
This julia script converts fortran 90 code into julia.
It uses naive regex replacements to do as much as possible,
but the output WILL need further cleanup.
Known conversion problems such as GOTO are commented and marked with FIXME
Most variable declaration lines are entirely deleted, which may or
may not be useful.
function formatfilterstring(filter::NTuple{N,Union{String,Tuple{String,String}}}) where N
outarray = String[]
for i in eachindex(filter)
if typeof(filter[i])==String
push!(outarray,"",filter[i])
else
push!(outarray,filter[i]...)
end
end
string(outarray[1],"|" .* outarray[2:end]...)
@FedericoStra
FedericoStra / IteratedFunctions.jl
Last active April 10, 2021 18:07
Iterated functions in Julia
module IteratedFunctions
export IteratedFunction, iterated
struct IteratedFunction{F} <: Function
f::F
n::UInt # ensure non-negative
end
IteratedFunction(f, n::Integer) = IteratedFunction(f, UInt(n))
@kimlaberinto
kimlaberinto / make_animation.jl
Created April 12, 2021 14:56
Klein Bottle Math Politcal Compass meme animation (Julia)
## Source for math political compass klein bottle meme by @KimPLab on Twitter
## Tweet: https://twitter.com/KimPLab/status/1381621398636949511
## Inspired by the math political compass torus meme by @jessebett
## https://twitter.com/jessebett/status/1379162611414138885
## @jessebett source code notes:
## upcycled from torus knot fibration visualization:
## http://www.jessebett.com/TorusKnotFibration/torusknot.html
## Note:
@baggepinnen
baggepinnen / users.csv
Created October 2, 2021 07:09
Julia package users
name org users name_1 org_1 users_1
Compat JuliaLang 37785 Qutilities 0 1
Parsers JuliaData 36756 JeszenszkiBasis 0 1
DataAPI JuliaData 34228 CGcoefficient 0382 1
HTTP JuliaWeb 31810 Metatheory 0x0f0f0f 40
Tables JuliaData 31664 Bcrypt 2HgO 12
MacroTools FluxML 30441 Blowfish 2HgO 12
JSON JuliaIO 30115 WorldBankData 4gh 2
Missings JuliaData 30067 RELOG ANL-CEEESA 1
Reexport simonster 29669 UnitCommitment ANL-CEEESA 9
@baggepinnen
baggepinnen / users.jl
Created October 2, 2021 07:16
Analyze julia package user numbers
#=
Source: https://discourse.julialang.org/t/announcing-package-download-stats/
request_addrs: the approximate number of unique requesting IP addresses. Details below on why this is approximate and not exact.
request_count: the number of requests.
successes: the number of requests which resulted in a 2xx HTTP response code. Only included if status is not one of the key fields of the rollup. To get the success rate, divide by request_count.
cache_misses: the number of requests which resulted in the package server attempting to fetch a resource from an upstream storage server. To get the cache miss rate, divide by request_count.
# Requires installation of [GLMakie](https://github.com/JuliaPlots/Makie.jl)
# Include this file as include("eigshow.jl"), then run eigshow()
using GLMakie, LinearAlgebra, Printf
# Toby Driscoll ([email protected]), October 2021. Released under Creative Commons CC BY-NC 3.0 license.
# This function is inspired by EIGSHOW.M, which is held in copyright by The MathWorks, Inc and found at:
# Cleve Moler (2021). Cleve_Lab (https://www.mathworks.com/matlabcentral/fileexchange/59085-cleve_lab), MATLAB Central File Exchange. Retrieved October 25, 2021.
"""