Nike Run Club Data Export

I love the Nike Run Club app and use it for every run I go on. The interface is incredible and provides a lot of cool summary / overview data of each run, including mile splits, and various permutations of visualizations showing combinations of your elevation / pace / total distance / GPS location throughout the run.

Being a pydata enthusiast though, I eventually faced the familiar and primal urge every data-scientist knows all to well: the need to access the raw data. Brilliant UI / UX interface and stellar user-friendly platform be damned, I need the raw CSV / XML / KML files and yearn to load it into pandas in a Jupyter notebook!

Maybe I’ll do some munging, aggregating and filtering. Maybe I’ll import matplotlib, bokeh, altair or plotly and make some cool charts! If I’m feeling ambitious, maybe I’ll even start doing crazy geospatial shit like haversine distance or analyzing the impacts of relativity on time and distance throughout my run (don’t discount those spatial dilations when I hit breakneck speeds of 8:30 Minutes / Mile 😅).

Anyways, these dreams must be put on hold because Nike doesn’t offer an a la carte data export feature in the app or online. Fear not, I have discovered a way to still access this data — my dreams of data need not be forsaken!

 

 

words

Something I oscillate being proud and super ashamed of is the fact that I still maintain a vocabulary list. In college, specifically late junior year, I became fascinated with the Profiles that The New Yorker would publish frequently and the strange collection of people whose lives a reporter would studiously detail.

I remember reading the one on Sean Penn (which I think became relevant amidst the El Chapo story), and being impressed by the specificity of the vocabulary used. I was also confronted with the revelation of how limited my understanding of English was. It was a daunting realization, but one that I’ve since found beauty within: language need not be mundane. I was enamored by the existence of extremely precise language and the clarity with which great writers could convey a scene or concept through words alone.

Despite being incredibly annoyed by the strange rules, exceptions and ambiguity in the English language and it’s grammar, I’ve found refuge in the beauty and potency of the words that compose it.

My regretful misconception of the medium language provides to relay truth and experience was born from years of boredom bred by uninspiring texts. It was compounded by the prevalent usage of imprecise and generalized words. From DMV manuals to SAT passages and even found within the mainstream dictionaries[1], the conspiracy to suppress my interest in English and writing with dull and uninspiring words, passages and even books was widespread.

Luckily, my interest in language was buoyed by my parents (whom both hold doctorates in literature) and some especially inspiring instructors (Ms. Kathy in elementary, Chris Stapleton in high school and Carey Voeller at Wofford). Hope this shoutout contained within an objectively dull blog post about why I keep an adult vocab list hosted on my rather low traffic blog, makes dealing with me as a student worth it.

To date (2019-07-18), here’s the list of the words (and occasionally phrases) that I’ve encountered when reading and been either completely unfamiliar with or perhaps just contextually unfamiliar with and had to turn to the dictionary for clarification.

Above I expressed my disdain for the commonplace dictionaries provided by Apple and Google, as such I prefer to use the 1913 edition of Webster’s Unabridged English Dictionary. You can find the online version here and if you are especially nerdy and inclined to stick it to the man, you can even hack your Mac or iPhone and replace the bland built-in dictionary with whatever dictionary you most prefer by compiling it to XML and replacing the dictionary source in the operating system code (more on that, here). This dictionary passion was inspired by James Somers’ incredible piece.

 

Abjure

Abrogation

Abscond

Accede

Accession

Accretion

Acerbic

Acolyte

Acuity

Adipose

Aegis

Agglomeration

Albumin

Alcove

Alderman

Alembic

Aloes

Alveolae

Amorpha

Amorphous

Amorphozoic

Analemma

Anathema

Anechoic

Angiogenic

Anodyne

Anomic

Anoxic

Antechamber

Antediluvian

Anteroom

Anthelmintic

Anthemia

Anthemic

Anthemion

Anthroponymy

Anticoagulant

Antigen

Antiphonal

Apathetic

Aphasia

Aphorism

Aping

Apocryphal

Apostasy

Apostate

Apostolic

Apotheosis

Apparition

Appoggiatura

Approbation

Aquiline

Arcana

Ardor

Argot

Aria

Arrears

Arriviste

Assignation

Assortative

Astringent

Atavistic

Auslaut

Auteur

Avocation

Avowedly

Ayatollah

Badinage

Banquette

Barbiturate

Barbiturates

Barbule

Basilicas

Bedlamite

Beguile

Beguiled

Besmirching

Bimodal

Bitumen

Bituminous

Blaxploitation

Blight

Bodega

Bollard

Botulism

Braggadocio

Bromides

Bumrushing

Bureau

Cabal

Cabalistic

Cadaveric

Cagily

Calamitous

Callow

Calumniate

Calumniator

Canard

Candolatory

Candor

Capitonym

Capitulate

Carapace

Carouse

Carousing

Catechism

Catecornered

Cathartic

Cathedra

Cation

Caulked

Centrist

Cerebration

Cernuous

Chalcedony

Chalcocite

Chalcogen

Chalcopyrite

Chapeau

Chastened

Chauvinism

Cherubic

Chicanery

Chilblains

Chinoiserie

Chippendale

Chrominance

Chromium

Chutzpah

Chyron

Claptrap

Clarion

Clemenceau

Clemency

Cloying

Coalition

Cochlea

Coda

Cognoscenti

Compendium

Concomitant

Concubines

Confection

Confit

Conflagration

Congenital

Conjugal

Conniption

Consigliere

Consign

Constabulary

Consternation

Corollary

Corporatese

Corpulent

Corpuscle

Corpuscular

Corybantic

Cossacks

Countermanded

Crake

Craven

Crony

Cupola

Curdle

Dalliance

Dally

Dapples

De Maupassant

Decamped

Decrepitude

Dehiscence

Dehiscent

Deleterious

Demagogue

Demimonde

Demur

Demurred

Denizen

Descanting

Desiccated

Despot

Despotic

Detritus

Dialectical

Dialectics

Diathermy

Didactic

Digerati

Dilapidated

Dilettante

Diminutive

Diocesan

Disavow

Discomfit

Disparate

Disputatious

Dolophine

Dostoyevsky

Dysarthria

Dystonia

Ecclesiastical

Ecumenical

Effete

Efficacious

Efflorescence

Efflorescent

Effluvium

Effrontery

Egalitarianism

Elision

Emeritus

Emissaries

Emphysema

Enamelists

Ensorcelled

Endemic

Enervation

Enfant Terrible

Enmity

Enrapture

Enraptured

Ensconce

Ensheathe

Enumerated

Environ

Environs

Epigraph

Episcopate

Epistemic

Epistemology

Epistolary

Equipoise

Equivocate

Ergonomic

Erisology

Ersatz

Erudite

Erudition

Erysipelas

Ethereal

Evinces

Eviscerate

Excoriate

Execrable

Exegesis

Exegetical

Exhortatory

Exigencies

Existence

Fatwa

Fealty

Fervid

Fester

Flash

Fledgling

Fogey

Fogyism

Formalism

Fuchsia

Fusillade

Fustian

Gabardine

Gait

Garbled

Garish

Gauze

Genteel

Genus

Geodesic

Geodesy

Geodetic

Gerontology

Gestation

Gibe

Gondola

Gondolier

Gondoliers

Gout

Graticule

Gravitas

Grouse

Gubernatorial

Gusto

Gyration

Hackles

Hackneyed

Hawala

Hegemony

Hemstitching

Heuristic

Horology

Hypodermic

Iconoclastic

Idée Fixe

Ignominious

Imago Dei

Imbue

Imbued

Immolate

Impetus

Impolitic

Imprimatur

Inaugural

Inclemency

Incommensurate

Incommunicado

Inculcated

Inculpable

Incursion

Indigent

Ineluctable

Infirmity

Iniquity

Insular

Internecine

Intimations

Intone

Intoned

Intransigent

Invective

Invention

Investiture

Jeremiad

Jingoistic

Jocund

Jural

Kitsch

Kleptocracy

Kowtow

Lambaste

Lambasted

Largesse

Lassitude

Latency

Legerdemain

Legume

Leguminous

Libation

Libidinous

Libration

Lichen

Linchpin

Litterateur

Littérateur

Liturgical

Liturgy

Livermorium

Locale

Lodestar

Luchadores

Lumpen

Lurid

Lyell

Lymphoma

Machiavellian

Madrasahs

Malaise

Malaphor

Marionette

Medias Res

Mendacious

Meting (Mete)

Milquetoast

Minutiae

Miscreant

Mise En Scène

Missives

Mordant

Mores

Moribund

Mycologists

Myrmidons

Ménage

Nadir

Neophyte

Neuropathy

Norn

Nutation

Nyctinasty

Obdurate

Obeisance

Oblique

Obliquity

Obstinate

Obviate

Odalisque

Odylic

Oedema

Oligopolists

Omerta

Ontological

Onus

Ophthalmology

Opia

Opprobrium

Opulent

Oracular

Orotund

Orthography

Oryx

Ostracization

Otiose

Outmoded

Paean

Palama

Palmistry

Palpable

Panacea

Pandemonium

Panoply

Panopticon

Pantomime

Parable

Parlance

Parochial

Parried

Pastiche

Pathogenesis

Pathogenicity

Pathos

Paucity

Paunch

Pax Roeana

Peace Of Westphalia

Pedagogic

Pedagogy

Pendeloque

Penology

Peregrinate

Periodization

Peripatetic

Pernicious

Pestilence

Phantasmal

Pharmacopoeia

Philatelic

Philippic

Philtrum

Phrenology

Pibroch

Platitudes

Pliant

Plutocracy

Plying (Their Trade)

Pogrom

Poignantly

Polemic

Post Mortem

Praziquantel

Precariat

Precocious

Preternatural

Privation

Proboscis

Profligacy

Progenitor

Promulgated

Propinquity

Propitious

Prosaic

Puerile

Pugilist

Pugnacious

Purloined

Pusillanimous

Putative

Putsch

Quadrennial

Quaver

Rampant

Rankle

Rarefy

Ratiocination

Recalcitrant

Reconnaissance

Recursive

Redolent

Redouble

Relish

Reportorial

Reproach

Reticence

Reticent

Revel

Rhubarb

Rothbard

Rutile

Saccadic

Sacerdotal

Sacrilege

Sacroiliac

Sacrosanct

Salacious

Salient

Salvific

Samizdat

Sanctum

Sanguine

Scattershot

Sciatica

Sclerotic

Scurrilous

Seance

Sebastopol

Seconal

Sedulous

Sedulously

Semaphore

Sevastopol

Shambolic

Shawl

Sheaf

Sheath

Shebeen

Shibboleth

Shroud

Siliqua

Simulacrum

Sleuthing

Sobriquet

Solipsism

Sonder

Soppy

Sordid

Sorosis

Specter

Sprightly

Spritely

Spurious

Squall

Stalwart

Stare Decisis

Stendhal

Stoic

Stradivarius

Styptic

Sublunar

Suborning

Subservient

Subterfuge

Sulfurous

Sump

Supercilious

Supplicant

Surfeit

Sycophant

Tacit

Taciturn

Teetotaler

Telegenic

Temporal

Tendril

Theocracy

Thurible

Timbre

Tinctured

Titillate

Titivate

Titivating

Titters

Titular

Tolstoy

Tortola

Tourniquet

Toxoplasmosis

Transliterate

Transmutes

Travail

Trenchant

Triage

Tripe

Trivalent

Turgenev

Tutelage

Tzitzit

Umbrage

Undergird

Uninflected

Untrammeled

Vainglory

Valor

Vamp

Vanguard

Vaunted

Verbosity

Verve

Vicissitudes

Visage

Visceral

Vitriolage

Vitriolic

Voluminous

Vox Populi

Vulgarian

Winnow

Yarmulke

Zany

 

[1] Referring to the default dictionary on iOS and via Google Search.

Todo: Self Host Blog

At some point, I really hope to migrate this blog from WordPress to a fully self hosted, designed and written implementation of this humble blog. My ambition to accomplish this is probably just a manifestation of my OCD and desire to have more control over the content and how it’s presented.

If you’ve ever done this, I would love to hear about the process and method by which you ultimately did it. I have thought about using a static site hosted on S3 or some of the Django packages for CMS / blog hosting, but have so far failed to settle on either.

The front end is often something I shy away from, but I’m hoping when I eventually take on this project, it will hit a critical mass and allow me to break out of my hesitation and into continued progress as a developer.

Ordinary Data Structures: Python3’s deque to Store Recent Emojis

Recent Emojis

if the implementation is simply the most recently used 30 emojis, then some sort of ordered iterable array-like structure would be best suited to the problem. Since 0 index insertions are an important requirement, Python’s built in deque data structure would be a good candidate to use here.

deque is found in the collections library and accepts an array-like input of values along with an optional keyword argument named maxlen which specifies the maximum length of the data structure. This last part is ideal for this application, as Apple’s implementation limits the recently used emojis to 30.

from collections import deque

recent_emojis = deque([], maxlen=30)

def update_recent_emojis(emoji_used, recent_emojis : deque):
    if emoji_used in recent_emojis:
        recent_emojis.remove(emoji_used)

    recent_emojis.appendleft(emoji_used)
    return recent_emojis


About Time — I find my favorite movie

I’ve recently rewatched the film “About Time” and am now comfortable declaring it as my favorite film. Besides the high degree of relatability I have with the plot, being a somewhat awkward and goofy young professional who somehow stumbled into an instant love with an incredibly sweet girl, I enjoyed the humorous juxtaposition of the mundane alongside the incredulous and supernatural.

The film is a sweet story not so much about time travel as it is one about coming to terms with your individualism, however undervalued those quantities might have been in your youth.

I thought it was substantial that the father not reveal the family secret to Tim until he was twenty one years old. Thematically, I think this decision enabled the film to convey valuable life lessons to an older audience than most films. The familiar setting of the film, particularly as it relates to my life (especially where I am in life currently), enabled me to become significantly attached to the characters off the bat, especially Tim.

As the plot rolls forward following Tim’s path through time forwards and back, his humble journey elicited a range of joy, despair, glee and remorse as he wielded his incredible gift against the familiar trials of life, with mixed results. I grew increasingly empathetic of Tim and his mostly noble choices, impressed by his attempt to always make those around him happy and fulfilled.

Tim triumphs over what he had initially declared to be the purpose he would pursue with his powers, as he settles into love and then family with Mary. Meanwhile, his father, who energizes the plot with the revelation of time travel, is revealed to be dying and his condition worsens rapidly thereafter. In this swift course of dopamine reversal, the film forced the focus away from Tim and instead towards introspection.

The scene that really gets me is the last one with Tim and his father. His father, James laments that his cancer is unavoidable even with their endowed power. Before he dies, he shares with Tim his “secret formula” for happiness including a recipe for using the gift:

And so he told me his secret formula for happiness. Part one of the two part plan was that I should just get on with ordinary life, living it day by day like anyone else. But then came part two of dad’s plan, he told me to live every day again almost exactly the same. The first time with all the tensions and worries that stop us noticing how sweet the world can be. But the second time noticing.

Finally, Tim comes to embrace normality in its entirety. As the film exhausts its last bit of kinetic energy, Tim shares one last nugget of insight

In the end, I think I’ve finally learned the final lesson from my travels in time. And I’ve even gone one step further than my father did. The truth is, I now don’t travel back at all – not even for the day. I just try to live every day as if I’ve deliberately come back to this one day to enjoy it. As if it was the full final day of my extraordinary ordinary life.

With this, the credits begin to roll following a stream of tears. This movie always leaves me touched, inspired, happy and looking forward to my life ahead. Lastly, I can’t help but wonder if Tim will choose to share the family secret with his son, Jeff — only time will tell.

StackOverflow Pages I Frequent

A collection of notes to help keep the ball rolling throughout the Sisyphean task of writing code.

[Perpetually updated unless I get lazy]

 

Resetting serial sequence PostgreSQL

https://stackoverflow.com/questions/244243/how-to-reset-postgres-primary-key-sequence-when-it-falls-out-of-sync

SELECT setval(pg_get_serial_sequence('t1', 'id'), coalesce(max(id),0) + 1, false) FROM t1;

 

PostgreSQL rounding

(Seriously, why is this so hard for me?)

https://www.postgresql.org/message-id/opsmwld9knawcxfg%40adi

Screen Shot 2018-08-25 at 11.35.50 PM.png

FWIW I always read the parameters^ and expect this to work:

select round(price, 4) from price_data;

But it doesn’t because because price is double precision. Fix with this:

select round(price::numeric, 4) from price_data;

 

With Clause Syntax:

Alias goes before the query expression that is referenced (which is different than the syntax of a subquery). 

with price_data_alias as (
    select round(price::numeric, 4) from price_data)

 select distinct price_data_alias.price, other_table.column from 
   price_data_alias inner join other_table on id;

Updating Triggers

You can’t “create or replace” or “update” or “alter” triggers, so this is the next best thing. Note: must also specify all of the tables

from: stackoverflow

BEGIN;
DROP TRIGGER IF EXISTS trig on tab2;
CREATE TRIGGER trig
  AFTER INSERT OR UPDATE OR DELETE
  ON tab2
  FOR EACH ROW
  EXECUTE PROCEDURE proc3();

COMMIT;