Skip to content

Instantly share code, notes, and snippets.

View jackdempsey's full-sized avatar

jack dempsey jackdempsey

View GitHub Profile
Today, I’d like to put kids in the richest possible environment and let them choose.
It would not be school, with formal classes, summer breaks, and so on.
It would be a safe place that is open all the time.
A place where one might, or might not, encounter people reading aloud in one hall or organizing a puppet show,
with home-made puppets or building a saltwater aquarium with bacterial filters. It would have zoomable
binocular microscopes by the doors to the play areas, so that found leaves and rocks could be examined closely.
I’d want kids to take breaks whenever they feel like it, to play outside or sit with a book in a corner —
even if they kept that up for a year or more. They know who they are and what they need better than we ever will.
@jackdempsey
jackdempsey / gogo
Last active September 30, 2017 18:52
A template for a "go" script that you run in the morning to refresh code, open important webpages and reminders
~ > cat ~/bin/gogo
#!/bin/bash
echo "Good morning Jack!"
echo "******************"
cd ~/MAIN_REPO_HERE
echo "Checking out master..."
git checkout master
echo "Pulling changes..."
reup # my version of this https://gist.github.com/righi/0ca1b7d1bfa3fee03999

The Anatomy of an Onyx Program

In this tutorial, we'll take an in-depth view of what's happening when you execute a simple Onyx program. All of the code can be found in the Onyx Starter repository if you'd like to follow along. The code uses the development environment with HornetQ and ZooKeeper running in memory, so you don't need additional dependencies to run the example for yourself on your machine.

The Workflow

At the core of the program is the workflow - the flow of data that we ingest, apply transformations to, and send to an output for storage. In this program, we're going to ingest some sentences from an input source, split the sentence into individual words, play with capitalization, and add a suffix. Finally, we'll send the transformed data to an output source.

Let's examine the workflow pictorially:

user=> (load-file "src/flow_combine/core.clj")
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[{:n -2} {:n 0} {:n 2} {:n 4} {:n 5} {:n 6} {:n 8} :done]
#onyx.system.OnyxDevelopmentEnv{:logging-config #onyx.logging_configuration.LoggingConfiguration{:file "onyx.log", :config nil}, :log #onyx.log.zookeeper.ZooKeeper{:config {:hornetq/mode :vm, :hornetq.server/type :vm, :hornetq/server? true, :zookeeper/address "127.0.0.1:2186", :zookeeper/server? true, :zookeeper.server/port 2186, :onyx/id #uuid "afc875f7-2978-489e-aac4-84e527fa7889"}, :prefix #uuid "afc875f7-2978-489e-aac4-84e527fa7889", :conn #<ZooKeeper State:CLOSED sessionid:0x14ca93bb3a400
Thoughts on http://words.steveklabnik.com/a-new-introduction-to-rust
1. Better than previous readings (though those were good too! Maybe just too quick?)
2. For visual learners, picturing/seeing chunk of lines is very useful.
2a. This becomes less clear across function calls. Any help in those cases? Similarly, investigation of hard to follow ownership examples will likely be valuable.
3. A 3-4 point quick summary to figure out ownership in any context would be helpful. Not sure how possible this is, but if the essentials can be boiled down to something easily remembered and applied, the overall understanding can grow from repeated application of the correct rules.
4. Know of any editor support for showing ownership? At least in very simple cases it seems straightforward.
5. lifetime, ownership, borrow, etc. They seem to be good choices, but generic enough that they don't help until you already understand things. It might be easier to really nail home the concept and then finally say "and that? That's borro
2.2.0 :058 > def action
2.2.0 :059?> if true
2.2.0 :060?> puts "call some api thing" && return
2.2.0 :061?> end
2.2.0 :062?> puts "does this happen"
2.2.0 :063?> end
=> :action
2.2.0 :064 > action
=> nil
2.2.0 :065 > def action
@jackdempsey
jackdempsey / points.rb
Last active August 29, 2015 14:12
points
require "fiddle"
require "fiddle/import"
module RustPoint
extend Fiddle::Importer
dlload "./libpoints.dylib"
extern "Point* make_point(int, int)"
extern "double get_distance(Point*, Point*)"
puts "Example 1: No rescue inside loop"
begin
5.times do |i|
begin
p i
raise "loop stops here"
end
end
rescue => e
puts "error caught here: #{e}"
> factorial n = \
| if n < 1 then 1 \
| else n * factorial (n-1)
[1 of 1] Compiling Repl ( repl-temp-000.elm )
Parse error at (line 6, column 1):
unexpected "i"
expecting newline or spaces
> factorial n = \
| if n < 1 then 1 \

I like Learn You a Haskell as a reference and cheat-sheet but I found it a little slow for learning Haskell.

Here's my recommended order for just learning Haskell:

http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way/ 80% completion here is fine if you feel your attention waning, the next thing will address hammering in things like functors and monads via typeclasses.

https://github.com/NICTA/course/ this will hammer in the lessons in a very direct form by forcing you to confront the challenges and lessons learned by the creators and community of Haskell itself. Doing the exercises here is critical for being fluent.

Real World Haskell is available online. (Thanks bos!)