Posts

Rose City Mile

Image
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

Image
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^{-...

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...

Angular Carto: Map Factory

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. In this post, we will discuss how to add a Carto map to a website and how to register the map with Angular so that our Angular components can manipulate the map display. Reference the scripts Before jumping into your new Carto map, you will first need to make sure that your web page has references to the Carto and Angular javascript libraries. In order for the map to tile correctly, you will also have to reference Carto’s standard stylesheet. Sizing web page and containers If you’re looking for an immersive map that takes up the entire web page, you will need to make sure that the html and body elements and the map container are all styled to fill all space available to them. My preferred method is to define a site-wide style implementing those requirements, including a carto-map-container CSS class that can be ...

Angular Carto: Introduction

If you work with geospatial data and haven't had a chance to work with Carto , you are missing out. Carto is a platform for creating interactive geospatial visualizations on the web. The canned maps that you can build from the web-based designer are surprisingly powerful, especially if you are already familiar with SQL and CSS . If you are a proficient web programmer, you can use their JavaScript API to customize your map in virtually any way you can imagine. Carto hits a sweet spot of simplicity and flexibility that suits me nicely. I work on a team whose job is to help our clients make sense of data. The efficiency with which we can produce Carto web applications frees up our time to add value in other areas. As great as Carto is, one problem that is becoming more pressing is that we're making a lot of the same maps on different data sets. Consequently, we're starting to do a lot of copy-and-paste code reuse . Over the next year, we will be refactoring essential map f...

Scheme Sucks

You will never get read without an eye-grabbing headline. My beef with Schema arose while working through a set of programming problems that are published online. I was interested in using those problems to familiarize myself with the idioms of Scheme and Haskell , with which I am less familiar. The exercise in question asks for the sum of all Fibonacci numbers that do not exceed 10000 and are divisible by 2. For the purposes of this post, the Fibonacci sequence is defined by a recurrence relation: \[ \begin{align} F(0) &= 0 \\ F(1) &= 1 \\ F(n) &= F(n - 2) + F(n - 1). \\ \end{align} \] In an imperative language such as C , this problem can be solved with a program similar to the following one. The logic of this program mimics how a person might solve the problem with a pencil, paper, and a pocket calculator: it keeps a running total of the even Fibonacci numbers as they are computed. This is the kind of code I could write in my sleep, which is why I am interested in ...

Rhetorical bestiary: Survey data

Survey data is well known to be an imperfect measure of the truth. The many pitfalls of survey data mean that the numbers must be taken with some healthy skepticism. Evidence-free assertions that black people are three times more dishonest than white people in answering surveys about drug use do not a healthy skepticism make. @voxdotcom These figures based on self-reported drug use are notoriously unreliable. I thought it was your job to report "context"? — Billy Chav (@billy_chav) February 5, 2015

Drivers Obeying the Law, Part II

I was biking South down Ladd towards the stoplight at Division, when I heard the Suburban behind me pull around to try a pass. I was going at 25 mph, and there was another car that had just turned off of Division and was heading North in the opposing lane. Once I saw that there was oncoming traffic, I knew there was no way the Suburban could make the pass without causing a head-on collision. But he made the pass anyway! The other car had to slam on their brakes; the right taillight of the Suburban passed a foot from my handlebars. The stoplight at Division was red, so I caught him seconds after he passed me. I tapped on his window and said that he had passed too close. He had given me only a foot, and the minimum passing distance is my fall height (6 ft). He said that he had been "completely in the other lane," and that I should ride further over. Again, I was riding 25 mph--the speed limit--and had I been riding any further over I would have risked getting do...

Alan Dershowitz is an America-hating Bleeding-heart Liberal

About 8 years ago, I remarked to my eye doctor that maybe Alan Dershowitz's torture warrant idea wasn't such a bad one if the alternative was no accountability at all. Apparently he thought Dershowitz was an America-hating bleeding heart liberal, though, because he launched into a rant about how the CIA isn't stupid, they know that torture can produce unreliable information, and they always verify torture intelligence against other information gathered. (Other highlights: the ticking bomb scenario proves that using torture to gather intelligence is always justified; we don't know what is going on, so therefore no one should oppose it.) Now that we have the Senate report, we know that my eye doctor was hopelessly naive. The CIA did indeed take intelligence gathered under torture as gospel, sometimes to disastrous ends—nearly letting bin Laden's driver get away, torturing innocent people whose names were given up under torture, etc. I guess I shouldn't be surpri...

Torture vs. American Exceptionalism

Mitt Romney, in No Apology: The Case for American Greatness : I make no apology for my conviction that America's economic and military leadership is not only good for America but also critical for freedom and peace around the world. (Page 2) ... What's chilling to consider is that if America is not the superpower, others will take our place. What nation or nations would rise, and what would be the consequences for our safety, freedom, and prosperity? The world is a safer place when America is strong.... ... The very existence of American power helps to hold tyrants in check and reduces the risk of precipitous war. (Page 10) ... No nation has shed more blood for more noble causes than the United States. Its beneficence and benevolence are unmatched by any nation on earth, and by any nation in history. Abraham Lincoln understood that the destiny of the world was twined to the destiny of America. It is why he called the United States the "last, best hope of...

Solidarity for me, but not for thee

On November 14, Portland's KGW TV station reported that "Portland Police Chief [Mike Reese] on Monday ordered three officers to remove 'I am Darren Wilson' images from their Facebook pages." Reese's order was not without controversy: Maybe the Portland officers where [sic] expressing their rights of free speech when showing solidarity with their brother? [ 1 ] I think that what they are saying is that they don't support the lynching of a white police officer without benefit of due process, a trial or even charges being brought forward.... [ 2 ] On November 30, six members of the St. Louis Rams entered the field with their hands up in the air, in the "don't shoot" position, protesting everything that has happened in Ferguson over the last few months. The St. Louis County Police Officers Association was not amused. From the official statement by the SLPOA: The St. Louis Police Officers Association is profoundly disappointed with the ...

Two Shootings

On April 17, 2005, during an interrogation, Esteban Carpio shot and killed police detective James L. Allen of Providence, RI. Carpio was re-arrested 45 minutes later. He was punched in the face three times by police detective Christopher Zarella, breaking bones in Carpio's face. Comments on Carpio: The streets are not like a court room. There is such thing as street justice, which compensates for the crimes that are not paid for by the legal justice system. That's what he fucking gets. He brought that upon himself Should have let the family's of the people he killed go at him, I promise it would have been much worse. Sympathy sorry we're all out here. Cops should be commended. He walked into the court alive even after shooting a cop. Now that is something! Bet the two people he killed are still dead... Justice bitches...  maybe you shouldn't shoot people in the face This dude took a mans life away. He desevered to be killed. Hopefully he looses si...

Overlawyering, Part II

Shorter Kathleen Parker : Having a personal opinion about whether Bill Cosby is a rapist is a violation of his due process rights. Blog posts and tweets must meet the same evidentiary standards as a criminal conviction. Also, FERGUSON!

Even Prime Fallacy

The simplest possible Even Prime Fallacy is shown below: Salviati : Most prime numbers are odd. Simplicio : Two is even! Your argument completely falls apart. We may express this idea more formally: Salviati : p is sometimes true. Simplicio : Yes, but p is sometimes false! Your argument completely falls apart. Simplicio has failed to disprove Salviati, not because Simplicio's rebuttal is illogical or irrelevant, but because it is literally the exact same argument as the one Salviati made! " p is sometimes false" is an inevitable logical consequence of " p is sometimes true." Someone who invokes an even prime fallacy probably thinks of an argument as "words you say in response to words someone else says," rather than as an exercise in logic.

Today in Drivers Obeying the Law...

Image
The sign says NO TURN ON RED . It very clearly indicates what lanes you are legally allowed to turn into. Naturally, the car in front of me turns, on red, into a lane in which it is not allowed. He joins a veritable parade of cars illegally blocking the transit lanes, for what purpose I cannot discern. Further up the street, a car honks at a bus pulling away from the bus stop, even though the car is breaking the law by being in a transit lane. Behind me, a train has to slow to a crawl. The trains take a full block to come to a stop, so the operator has to hit the brakes early to avoid crushing all the cars parked on the tracks. Drivers think the law is very important, which is why they always obey it.

Consent Schmonsent

Shikha Dalmia : At any given moment, one person wants sex more passionately than the other. What's more, whether due to nurture or nature, there is usually a difference in tempo between men and women, with women generally requiring more "convincing." And someone who requires convincing is not yet in a position to offer "affirmative" much less "enthusiastic" consent. That doesn't mean that the final experience is unsatisfying—but it does mean that initially one has to be coaxed out of one's comfort zone. Affirmative consent would criminalize that. I am finding it next to impossible to read this passage in any other way than "women just need to be raped a little bit or they won't want to have sex." It is deeply, deeply creepy.