# find the PID of the process on your port
lsof -i :3000
# kill it bang bang
Thank me later
# find the PID of the process on your port
lsof -i :3000
# kill it bang bang
Thank me later
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!
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, 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.
Mise En Scène
Peace Of Westphalia
Plying (Their Trade)
 Referring to the default dictionary on iOS and via Google Search.
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.
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
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.
[Perpetually updated unless I get lazy]
SELECT setval(pg_get_serial_sequence('t1', 'id'), coalesce(max(id),0) + 1, false) FROM t1;
(Seriously, why is this so hard for me?)
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;
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;
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
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;