RSSAmplifier

Blog

Programming

timothypratley.blogspot.comRSS feed ↗25 posts

Latest posts

The Hallway Track: Clojure/Conj 2024 in Alexandria

This year I had the privilege of attending Clojure/Conj in Alexandria, VA. Alexandria is a beautiful city, with a museum seemingly on every corner, and abundant trees just starting to turn yellow for the fall. It has an efficient metro system and a safe, welcoming atmosphere. The conference was held in the unique George Washington Masonic Memorial. The venue has an impressive theater with quirky…

Clojure REPL tip: Setting up a retry key binding

One thing that I love about Clojure is that the Read-Eval-Print-Loop (REPL) enables me to redefine functions on the fly, without restarting anything. This makes trying things, making changes, and trying them again very fluid. Trying stuff, changing it, and trying it again pretty much sums up how I write code. If at first you don’t succeed, dust yourself off and try again. – Aaliyah Today I’m going…

The Hallway Track: Clojure/Conj 2023 in Durham

These are my notes and impressions from the hallway conversations during Clojure/Conj 2023 conference. I'm sharing them in the hope of capturing some of the atmosphere and provide a peek into what people in the Clojure community are up to and what companies are using Clojure. General observations Database announcements: Datomic is free now XTDB v2 and Cloud Fluree BI and reporting for Datomic And…

How to recognize collider bias

Marilyn vos Savant holds the highest recorded intelligence quotient (IQ) in the Guinness Book of Records. In 1990 she answered an intriguing question in her regular column in Parade magazine: You are on a game show and you are given the choice of three doors. Behind one door is a car. Behind the other doors are goats. You pick a door and the host (Monty Hall) always opens a different door that…

Equations for data transformation: Term Rewriting

Term rewriting equations and patterns For a programmer, functions are the fundamental form of expression. Programmers write functions that transform inputs into outputs. \[f(x) = x + 1\] The inputs and outputs are complex data that represent something in the real world. I think about the inputs and outputs as abstract data shapes. I might start with a nested map that needs to be transformed into a…

Meander: The answer to map fatigue

Map fatigue. You may already have it. You might know somebody who does. That debilitating depression that causes otherwise normal programmers to roll their eyes and sigh. It starts out innocuous enough. I’ll just reach into this widget entity value and pull out the description I need. Oh and I’ll grab the count from the inventory entity. Hmmm what’s this argument being passed in here, I wonder if…

A Puzzle Worth Solving

Every year school coordinators around the globe have to make a duty roster. A teachers job doesn't end at the class room, they also take turns monitoring key areas of the school at key times to keep the students safe. A duty roster is a schedule of who is responsible for each area for each time slot that requires supervision. Figure 1: A randomly selected duty roster schedule Duty Start mon tues…

Ryzen is for Programmers

When I heard about AMD’s Ryzen series CPU launch I immediately wondered how much performance I could get out of one. This article relates my experience building a PC to replace my much loved but aging 2013 Macbook Pro with a Ryzen powerhouse. First I’ll share the reasons why I wanted to build my own PC. Then I’ll run through the build process. At the end are my programmer oriented task timings…

Big Trouble in Little Taiwan

小台灣的大麻煩 Lunar New Year in Taiwan. Everybody is celebrating with firecrackers, lanterns, food, gifts, and having fun. 農曆新年在台灣。 大家都在慶祝爆竹,燈籠,食品,禮物和樂趣。 The citizens of Taiwan are eating all the best tasty foods with their families... But where is the fruit this year? 台灣公民都在家裡跟家庭一起吃所有的美味。 但是今年為什麼沒有水果哪? Smiling Uncle: "I'll pop out and get some fruit from the market. Be right back."…

Reagent deep dive part 4: Application principles

(ns my.reagent-examples (:require [clojure.string :as string] [reagent.core :as reagent] [reagent.ratom])) (enable-console-print!) (defn a-better-mouse-trap [mouse] (let [mice (reagent/atom 1)] (fn render-mouse-trap [mouse] (into [:div [:button {:on-click (fn [e] (swap! mice (fn [m] (inc (mod m 4)))))} "Catch!"]] (repeat @mice mouse))))) Welcome to the fourth and final leg of the Reagent deep dive…

Reagent deep dive part 3: Sequences

(ns my.reagent-examples (:require [clojure.string :as string] [reagent.core :as reagent] [reagent.ratom])) (enable-console-print!) Welcome to the third leg of the Reagent deep dive tour. In part 2 we got into the thick of the component lifecycle. Today we move on to nuances surrounding the representation of sequences. This will be quite a change of pace as it is a somewhat less tangible topic.…

Reagent deep dive part 2: The lifecycle of a component

(ns my.reagent-examples (:require [reagent.core :as reagent] [reagent.dom] [reagent.ratom])) (enable-console-print!) Welcome to the second leg of the Reagent deep dive tour! In part 1 we saw how to create components and react to change. Now we move on to some more challenging aspects of UI building. Today we examine how to represent component local state and how to access the rendered DOM nodes.…

Reagent deep dive part 1: Hiccup and ratoms

Today I invite you to embark with me on the grand tour of Reagent , a ClojureScript library for building web pages. I will be encouraging you to try several small exercises on this page as we go. You can change the example code provided on this page to make it do other stuff. Let me know in the comments if you get stuck at all, or have any questions. This tour is going to get down into the nitty…

The hallway track of Clojure Conj 2016 in Austin

The Clojure Barbecue Conj 2016 in Austin: This year the Conj was held in Austin, which was an excellent venue. It’s warm! I only needed a light jacket and jeans outside. Austin has great eats, especially the barbecue. Everybody was chowing down on some good ol Texas ribs. There were plenty of nearby eating options for quick meals or longer sit ins. The airport is small and easy, as was land…

My research group needs you!

Six months ago I joined a small, informal research group. It has been a profoundly positive experience for me that I want to share with you. My hope is that you will join us. When I first joined the research group, I wasn’t entirely sure what a research group meant. It sounds intellectual and auspicious, but for me it turned out to be more about establishing a safe place to discuss ideas, set…

Hillary the astronaut; how to draw a caricature

Recently I have been tinkering on some ClojureScript animations using Reanimated . One problem I ran into was that most of the drawing tools available to me were too complex for my needs. Most of the time I was fine creating with circles and rectangles, but I wanted some characters with a more hand drawn feel. So I built Napkindo . Here is a screencast that shows it in action: Transcript: Hi! I’m…

Elm vs ClojureScript, a first encounter

Recently I have been gathering information about what makes for a happy programming environment. The Elm language kept popping up as a leader in most of the metrics I am interested in. So on the weekend I gave Elm a try and was pleasantly surprised. Elm solves practical problems in a very elegant way, and the compiler is very friendly. I coded up a basic counter that represents numbers as n sided…

The Cloud Warden

Icarus Santese stood as still as a statue, his left palm against his forehead and right palm over his heart. The chipped and worn amphitheatre around him was barely visible beneath verdant vines which thrived on the warmth retained by the stone. Small brown birds flitted about in the early rays of dawn, feasting on insects drawn to the vine leaves. Two acolytes sat waiting silently for him to…

Notes on Bootstrapping

Doug Engelbart was a visionary, best known as the i nventor of the computer mouse. I have been reading about his life and ideas and want to share with you a short inspirational reading from page 8 of "What the dormouse said", a book by John Markoff. https://youtu.be/uqjuX0-FYi4 Doug was passionate about improving the way we improve. Any organization has a primary process, and it is generally…

Reacting to changes with Firebase, and how to interop

Transcript of Firebase screencast . CoderX here. Firebase is a hosting service that provides an authenticated realtime database. The database acts like a JSON tree that pushes changes out to clients. Clients can write to and subscribe to parts of the object. This subscription model fits nicely with reactive style pages. Reacting to changes with Firebase, and how to interop In this screencast we…

Of Models and Metaphors

Models are how we understand, describe and predict the world around us. They are the basis of science and knowledge. Metaphors can give an intuitive feel for a model. Metaphors are useful for avoiding a complete understanding something. Avoiding a full understanding in favor of being content with some simple abstract idea. Feynman refuses to give examples of what physical phenomena are like…

Composing test assertions in a pipeline

Have you ever wanted to test the steps in a long pipeline of operations? "Edward Teach asking a co-worker why his threaded pipeline expression is failing in production" - By Jean Leon Gerome Ferris - Public Domain . ( -> starting-state ( step1 ) ( step2 ) ( step3 )) Wouldn't it be great if we could just insert some checks in between? We could write a test that checked the steps throughout the…

Hallway track of Clojure/West

Talk Recommendations Deepen and Diversify the Clojure Community with Jr Engineers - Amie Kuttruff https://www.youtube.com/watch?v=SOIhncWcCjA Excellent guide to learning Clojure or any programming language. Great advice for starting your journey, or helping others. Fun, stylish and entertaining. Had an engaging story arc. USE lisp WITH game - Making an Adventure Game with Clojure - Bryce Covert…

Sente Style Multiplayer Snake in ClojureScript

Watch the Screencast Read the Source Code Play the game Standalone Coder X here, Today we will build a multiplayer snake game. Players connect to a central server and eat green food dots to grow. We will use websockets to communicate between the browser and server. One concern when using websockets is browser support. Sente is a library which addresses this concern by falling back to ajax when…

Do not settle for a REPL transcript

Transcript for "Do not settle for a REPL" screencast: https://www.youtube.com/watch?v=ZD8q3fMr5sE CoderX here. Today we will be using test-refresh to find influential Twitter friends. The goal is to illustrate why code reload is better than a REPL. Test-refresh watches the file-system, reloads code, and runs tests. Jake McCrary wrote test-refresh while sporting a smart bow-tie. Programming is…