Rose City Mile

June 25 was a bright clear day with a high of 90. On that morning, the Rose City Mile was contested at Duniway track in southwest Portland. After a spring that was mostly pouring rain and highs of 65, it was a somewhat challenging transition. Once the masters heats wrapped up it was my turn. I must have been feeling pretty down about my running when I signed up because I seeded myself at 7 minutes. I at least managed to beat that by quite a bit with a 6:19. I came through the first lap in 82 so I clearly remember how to get out with the pack but I need to do some work to hold that pace through to the finish line. Three more men's heats followed me. Men's heat 4 was an exciting duel to the finish, with Ahmed Muhumed taking the win in 4:08.17. Women's heats ran next. Sam Bowen (#117) won her heat in 5:48.35. Sam came through the first lap with the rest of the pack, but took control of the race early. She opened a bigger and bigger gap as the race progressed and

Programming Don'ts

Just don't. Blurring of concerns Tight coupling Overly long functions Changing the value of a property Changing the value of a variable State Input/output Inheritance Constructors Objects Three-valued logic Nulls Loops Conditionals

Lewis & Clark Invitational Recap

The Lewis & Clark Cross-Country alums returned in force to their home course at McIver yesterday to toe the line in the biggest meet the park has ever seen. The 8k field comprised 26 teams fielding 301 athletes, the 6k field 23 teams fielding 246 athletes. Teams from all over the country were represented, as were several NCAA Division I teams including the University of Oregon, University of Portland, and Oregon State University. The 8k started first. The pack went out fast but the alums stayed in the mix, coming through the first lap in 17th. Once the pace settled down the alums put their racing experience to good use, methodically picking people off. In the second lap they passed Clark and Corban to advance to 15th place, and in the final lap they moved past George Fox to finish in 14th, shaving 42 points off their lap 1 score. Blake Slattengren led the alums across the finish line, running a PR of 25:24 for 52nd place. Sean Richardson followed him across the

Beverton–Holt: a discrete-time logistic model

The Beverton–Holt equation is a recurrence relation relating abundance of a population in generation $n$ to the abundance of the previous generation $n - 1$: \[ N_n = \frac{PN_{n-1}}{1 + PC^{-1}N_{n-1}}, \] where $N_n$ is the abundance at generation $n$, $P$ is the density-independent productivity of the population, and $C$ is the capacity of the population. This recurrence relation can be solved to explicitly relate the abundance at generation $n$ with the initial abundance $N_0$. Let $Q$ be the equilibrium abundance of the population given by the equation \[ Q = C \left (1-P^{-1} \right). \] Using this definition, the abunance at generation $n$ is given by the equation \[ N_n = \frac{QN_0}{N_0 + P^{-n}\left (Q - N_0 \right )}. \] The standard Beverton–Holt recurrence relation has an alternative form that is very similar to the solution of the recurrence relation. \begin{align} N_{n} &= \frac{P N_{n-1}}{1 + P C^{-1} N_{n-1}} \\ &= \frac{P N_{n-1}}{1 + P \left (1 - P^{-1 }

Angular Carto: Compound basemaps

This post is part of a series covering how to create reusable Carto map components. Read the introduction to learn why one would even want to do such a thing. The previous post in the series was voluminous, so I will change things up and describe a minor enhancement to basemap switching : basemaps that consist of more than one tile layer. This is particularly useful for adding labels to a basemap. Enhancing the basemap prototype This post builds off of the previous post on basemap selection. I will describe how specific components will change to accommodate multiple tile layers in a basemap. You may find it helpful to read the previous post to understand how the other components work. First, consider the basemap prototype that requires exactly one tile layer. Its public interface exposes addToMap() and removeFromMap() methods. Accommodating multiple tile layers in the basemap is as simple as adding a for loop to both methods. Note that after each tile layer is added to the m

Angular Carto: Switching Basemaps

This post is part of a series covering how to create reusable Carto map components. Read the introduction to learn why one would even want to do such a thing. In this post, we will discuss how to give the user control of the basemap and how to do some customizations on the basemap selector. Manipulating the basemap Before we begin, we need to ask ourselves: what is a basemap, and what does it do? In the context of a Carto map, a basemap is a layer of map tiles that sits under the informational layers. In order to be able to switch between different basemaps, each basemap should know how to add itself to the Carto map and how to remove itself from the Carto map. This functionality is implemented in the basemap prototype, cleverly named basemapProto . The prototype has two properties and two methods: tileLayer The Leaflet tile layer for the basemap. map The Carto/Leaflet map whose basemap is to be manipulated. addToMap() Add the basemap to the Carto/Leaflet map object. remove

Angular Carto: Custom Zoom Buttons

This is part of a series covering how to create reusable Carto map components. Read the introduction to learn why one would even want to do such a thing. Read the previous installment, Carto Map Factory , to learn about adding a Carto map to a webpage and registering the map with the Angular dependency injector. In this post, we will discuss how to add custom zoom buttons to the map. What are directives? We will implement our custom zoom buttons by encapsulating them in an Angular directive. Directives are a technique for packaging up bundles of HTML content and JavaScript code. Once a directive has been registered in your Angular module, it can be interpolated into the HTML of your web page, most commonly as an HTML element or as an attribute on a standard element. A good use case for directives is a text field with a date picker. The date picker should pop up a window with a navigable calendar, allow the user to browse through the calendar to find the date they want, and then sa