Skip to content

Instantly share code, notes, and snippets.

@yoki
Last active July 1, 2020 14:24
Show Gist options
  • Save yoki/08ef37b2f2035735d16b3583d060e897 to your computer and use it in GitHub Desktop.
Save yoki/08ef37b2f2035735d16b3583d060e897 to your computer and use it in GitHub Desktop.
# Variable, type and functions https://github.com/PacktPublishing/Julia-1.0-Programming-Cookbook/tree/master/Chapter05
println(code)
chr = 'C'
str = "A string"
for c in str
println(c)
end
str = "Learn" * " " * "Julia"
println("a * b = $(a*b)") # interpolation
# search
findfirst(isequal('i'), "Julia") == 4
# replace
replace("Julia", "a" => "us") == "Julius"
# length
lastindex("Hello") == 5
length("Hello") == 5
#Beware of multi-byte Unicode encodings in UTF-8:
10 == lastindex("Ångström") != length("Ångström") == 8
# regex
pattern = r"l[aeiou]"
# subexpressions
str = "+1 234 567 890"
pat = r"\+([0-9]) ([0-9]+)"
m = match(pat, str)
m.captures == ["1", "234"]
# all occurances
[m.match for m = eachmatch(pat, str)]
# Data engineering
#https://github.com/PacktPublishing/Julia-1.0-Programming-Cookbook/tree/master/Chapter03
# Numerical computing https://github.com/PacktPublishing/Julia-1.0-Programming-Cookbook/tree/master/Chapter04
# metaprograming and advanced typing https://github.com/PacktPublishing/Julia-1.0-Programming-Cookbook/tree/master/Chapter06
# Analytical data (dataframe) https://github.com/PacktPublishing/Julia-1.0-Programming-Cookbook/tree/master/Chapter07
# Benchmark/log/call other program https://github.com/PacktPublishing/Julia-1.0-Programming-Cookbook/tree/master/Chapter08
# Data Science https://github.com/PacktPublishing/Julia-1.0-Programming-Cookbook/tree/master/Chapter09
# Distributed Computing https://github.com/PacktPublishing/Julia-1.0-Programming-Cookbook/tree/master/Chapter10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment