Skip to content

Instantly share code, notes, and snippets.

Avatar
⛰️
working from home

Leah Hanson astrieanna

⛰️
working from home
View GitHub Profile
View Foo.jl
module Foo
export @timeof, @bench, BinaryTree, Node, Leaf, insert
macro timeof(expr)
quote
t1 = time()
value = $(expr)
t2 = time()
t2-t1
@astrieanna
astrieanna / chart.jl
Last active Dec 22, 2015
Making Vega.jl plot
View chart.jl
#Pkg.add for JSON
#Pkg.clone for Vega.jl, JSTypes
xs = open("xs.txt","r")
ys = open("ys.txt","r")
xarr = readdlm(xs)
yarr = readdlm(ys)
x2 = Float64[x for x in xarr]
y2 = Float64[y for y in yarr]
@astrieanna
astrieanna / test.jl
Created Dec 7, 2013
Trying to make `methodswith` work for a user-defined type.
View test.jl
module Test
export TwoVals, addtwovals
type TwoVals
val1
val2
end
function addtwovals(v::TwoVals)
v.val1 + v.val2
View index.html
<script src="https://facebook.github.io/react/js/jsfiddle-integration-babel.js"></script>
<div id="container">
<!-- This element's contents will be replaced with your component. -->
</div>
View envoy_only_some.log
This file has been truncated, but you can view the full file.
[Envoy (Epoch 0)] [2020-06-18 22:07:26.052][23][debug][upstream] [external/envoy/source/common/upstream/cluster_manager_impl.cc:1267] no healthy host for HTTP connection pool
[Envoy (Epoch 0)] [2020-06-18 22:07:26.076][6][debug][config] [external/envoy/source/common/config/grpc_subscription_impl.cc:68] gRPC config for type.googleapis.com/envoy.api.v2.RouteConfiguration accepted with 1 resources with version 1592518045
[Envoy (Epoch 0)] [2020-06-18 22:07:26.076][6][trace][config] [external/envoy/source/common/config/grpc_mux_impl.cc:66] Sending DiscoveryRequest for type.googleapis.com/envoy.api.v2.RouteConfiguration: version_info: "1592518045"
[Envoy (Epoch 0)] [2020-06-18 22:07:26.171][17][debug][upstream] [external/envoy/source/common/upstream/cluster_manager_impl.cc:1267] no healthy host for HTTP connection pool
[Envoy (Epoch 0)] [2020-06-18 22:07:26.290][23][debug][upstream] [external/envoy/source/common/upstream/cluster_manager_impl.cc:1267] no healthy host for HTTP connection pool
@astrieanna
astrieanna / python-scoping-tutorial.md
Created Dec 22, 2021
A series of exercises to develop an intuition for how scoping works in Python
View python-scoping-tutorial.md

Based on this version in Clojure

Lexical Scope in Python

Lexical scope guarantees that the reference to a value will be "enclosed" in the scope in which it is being used.

Lexical scoping simplifies our life because it allows us to mechanically follow code and determine where a value originated.

  • Start at the place of reference of the value
  • Then "walk" backwards and outwards to find where the value was defined
  • Now you know where the value came from