September, or fifteen minutes
I am obsessed with time.
It’s a fascinating notion, time. I used to start stressing out if my web applications took longer than 300 milliseconds to respond to an incoming request, which is about as much time as it takes for you to blink your eye. I know that taking one of the 50-series buses back to my house will take about ten minutes longer than one of the 60’s (but there are less frequent 60’s), so I will recalculate public transportation options based on when each bus is coming at the time I arrive at the bus stop. I am constantly re-evaluating and optimizing how I spend my day, because certain things (commuting) are a waste of time, others are a necessary evil (cooking, laundry), others are valuable and enjoyable (writing), and some are just plain fun (watching Doctor Who, a show about a time traveler that I’ve been binging on this year).
I find large chunks of future daunting to evaluate. I tend to optimize for minutes, not days or weeks, and so I struggle to truly focus on the long term and am constantly going for short-term victories. Yet I want to accomplish so much - I want to build things, I want to create great ideas, I want to develop wonderful relationships. I want to do a lot of things that aren’t accomplished in minutes, they’re accomplished over weeks and months and lifetimes. For years I’ve struggled to reconcile my desire for big things with my tendency toward little thinking.
An idea to resolve this conflict began to take root in my mind when I stumbled upon a Reddit post about 15 push-ups. It’s a simple idea:
“LPT: There is a visible difference between not working out at all and doing 15 pushups every day. Make 15 push ups your new ‘not working out’.” - source
I originally started chewing on this idea from a purely fitness-related perspective, and I liked it. If you’re doing 15 push-ups a day, you’re not going to turn into Arnold Schwarzenegger, but you’re moving the needle forward. You’re doing something positive in a short window of time that will train your body into something stronger than it would have been otherwise. That step forward is important mentally and physically.
Now, fast forward a few weeks, and I’m reading the book Founders at Work while on a trip to Charleston, SC. In Founders at Work, Jessica Livingston conducts a series of interviews with business founders to discuss the early days of their businesses. The results are fascinating. There are some archetypal stories in there (Apple, PayPal) as well as some slightly off the wall ones (Hot or Not). But one of the ones that really stuck with me was the tale of the early days of del.icio.us, the social bookmarking site that eventually sold to Yahoo for an undisclosed amount.
When Joshua Schachter founded del.icio.us, he wasn’t trying to become a startup founder. He was working as a quant for Morgan Stanley full-time: a job notorious for long, stressful hours. But here he is with del.icio.us, a hack project that was realized to the world and was getting some 30,000 users. Here was how he described those early days:
**Livingston:** When you were doing this in your spare time, did you ever say, "Ugh. This is too much work"? **Schacter:** Not really. I was always very careful...to structure the code...such that I could come in and look at it, figure out what I'm doing, do it, and be done for the day in 15 minutes. So if I could get one thing done a day, I was happy. A lot of stuff, if I could spend more time, I did, but as long as I could get one or two things done a week total, if I didn't have time, I didn't have time. So it moved pretty slowly. I worked on it for years.
That passage is fascinating to me. Fifteen minutes a day! While working as a quant for Morgan Stanley!
So this month, I started tinkering around with fifteen minutes. When I’m feeling daunted by the scale of a task, I set my timer for fifteen minutes and crank. I’m moving the needle forward. I’m getting my fifteen push-ups in.
There’s a surprising amount of stuff you can do in fifteen minutes, like:
- Work out
- Fold your laundry
- Straighten your room up
- Write a single code function
- Pay your bills
- Purchase and initialize a server
- Learn how to send a custom HTTP method in Python
- Read a few pages of a book
- etc., etc.
You keep stacking those fifteen minutes up and up and suddenly you’re staring at something you’re proud of. I built an app called “FutureSelf,” which plays on my obsession with time and allows me to send picture messages to myself in the future. I wrote a Python library that lets me analyze log files in Spark. I set up my own personal, hosted version of Dropbox.
These are things I wanted to accomplish, and the principles are the same for anyone out there reading this. Set your time for fifteen minutes. Crank. Move the needle forward just a little bit whenever you can. You’ll be shocked at what you can get done.
- Founders at Work by Jessica Livingston
- The Song Machine: Inside the Hit Factory by John Seabrook
- So Good They Can’t Ignore You by Cal Newport
- FutureSelf [non-public]
TV shows watched!
- Twilio - Security
- Certbot Documentation
- The Road Coder’s Survival Kit
- Ask HN: What’s your favorite HN post?
- Advancing in the Bash shell
- Machine Learning in a Year
- Seven Languages in Seven Weeks
Spearman's rank-order correlation
This is a mini-post: something I learned about today at work that I thought was awesome in and of itself. It’s called “Spearman’s rank-order correlation,” and it tells you if two data sets move in the same direction.
Two sets of data can have what’s called a “monotonic” relationship, which basically means that if one value goes up, the other value goes up; and if one value goes down, the other goes right down with it. Monotonicity doesn’t necessarily care about the direction of that relationship. It just cares that the two go together.
Let’s look at something topical. Specifically, let’s see how Kirk Cousins’s and Eli Manning’s passing yards compare over a given sixteen-game season. If Cousins and Manning had a strong Spearman rank-order correlation (shortened as Spearman’s rho, because mathematicians like Greek), we would Manning’s passing yards go up if Cousins has a great game, and if Manning only throws for a hundred yards, Cousins will have a bad game too. I’m going to ignore bye weeks in this example so each will have exactly sixteen games.
from scipy.stats import spearmanr kirk = [196, 203, 316, 290, 219, 196, 317, 217, 324, 207, 302, 219, 300, 319, 365, 176] eli = [189, 292, 279, 212, 441, 189, 170, 350, 213, 361, 321, 297, 337, 245, 234, 302] spearmanr(kirk, eli) # SpearmanrResult(correlation=-0.19602068697550504, pvalue=0.46686779279825008)
Okay, so not really correlated… in fact, they’re actually slightly negatively correlated, which would imply that Cousins has bad games when Manning has good ones and vice versa. But it’s a loose relationship, so we won’t compare that too much.
This isn’t much of a fair comparison, though. If the Giants were playing the Patriots on the same week that Washington was playing Philadelphia, we’d expect Manning to have a bad game while Cousins has a great one. So let’s compare how they fared when facing similar teams and see if the correlation improves.
So now if we run our calculation:
kirk_vs_teams = [290, 219, 196, 317, 217, 324, 207, 219, 319] eli_vs_teams = [302, 292, 297, 213, 361, 350, 245, 170, 212] SpearmanrResult(correlation=-0.10041928905068677, pvalue=0.7971388092372127)
Okay.. almost no correlation at all! Good to know for fantasy purposes, that if you want to hedge your QB bets, put Cousins and Manning on the field together!
That’s all I’ve got, that’s Spearman’s rho. Go have fun with it!Tweet
An August recap on the road again
The first words of this post started where they so often do: on the road. Specifically, they started at Ling and Louie’s Asian Bar and Grill at Terminal A of DFW Airport, where Robbie has just poured me a Deschutes Obsidian Stout to help get my ideas flowing. This beer lives up to its name. It’s black as can be - impenetrably so. If I’m not actively moving the glass, it settles into a solid mass that makes the outside look painted. It doesn’t have the bitter bite of a Guinness, though. It’s creamy, almost buttery. Robbie’s a dutiful airport bartender. Aside from checking in once to see if I wanted something to eat, he’s left me alone. He knows his guests that want to talk. We all travel in our own way, you never know what kind of mood you’ll be in when you’re on the road.
I am only a few gates down from gates A18 through A22, which I have gotten to know quite well. I’ve been there four times this month for a few different work-related trips. I know there’s a stack of gutbomb fast food joints, the ubiquitous Vino Volo, the Pinkberry. I know this without having to go look to double-check. They’ll be there in a pinch if I need something quick, and if I have time to think - there’s Ling and Louie’s.
By accident or by fate, I have spent much of the eight thousand miles I’ve traveled this month meditating on what it means to be a man. Not a man in the sense of gender, but in the sense of maturity. I don’t know what triggered it. Perhaps it was the seed of Robert Pirsig’s ideas on quality that finally bloomed after reading them earlier this year. Perhaps it was Philip Chavanne’s The Early Tales of Snow and Oakham which tells the story of an adventurer handing off his creation and his stories to his sons. Or maybe it was Being Nixon, a phenomenal biography of the psyche of Richard Nixon and a reminder that presidents had to learn to grow up too. Maybe it was watching a healthy amount of Anthony Bourdain shows in Dallas, a man who I unashamedly aspire to emulate. Who knows. Maybe it was just the road. It unlocks my mind in ways a steady home address never can.
I have meditated on the requirement of responsibility for myself and for others. I have previously contemplated the need to take ownership of my own life, but Chavanne’s book has made me dwell on responsibility for the lives of those outside myself. Is there an element of manhood that involves willingly stepping up to shoulder the needs of others? I believe there is.
I have thought about the road and what it means to me to be out here. When I was younger, I thought travel was only about exploring new places and trying new food. Now that I’m older, I realize that the road is an opportunity for reflection that - for whatever reason - I can’t find at home. It was draws me to long flights and solo stints in cars. That’s where I get my chance to think.
I have pondered my future and what I want to do to achieve it. That motivation, that drive, was lost to me for most of the summer. I didn’t lose my way, but I certainly felt like I was sitting at a crossroads and couldn’t find the motivation to pick a direction and get moving. Now I’m back.
I’m back in D.C. now, because I rarely start and finish a post the same day. I’m celebrating the friends I have here. The road is a good place for lonely reflection, and home is a place for baseball games, house parties, and the people you care about. The road is a good place for pondering ideas, but home is where they must be turned into action.
And to close, as I always do, I have a bulleted list of accomplishments from the month:
- Read 3 books
- Traveled 8,000+ miles
- Ate the best burrito of my life at El Agave Mexican Grill in San Jose
- Trained consistently for at least four days a week, even while traveling
- Brought on a new college hire at work
- Closed a major client project, despite working far more hours than I wanted to on it
- Learned more about machine learning, Scala, and forecasting
- Enjoyed a proper Sunday on the beach in Chicago
Next month I’ll be on the road (again) visiting Charleston and some client sites. I hope in the latter part of the month to return to more focused learning and cooking more at home. And football returns very, very soon.Tweet
July, or the things I learned without breakfast
What would you do with your week if you knew you wouldn’t feel guilty about what you didn’t do?
There’s an implied answer to this question that’s sort of guilt-inducing in itself. The implied answer of “oh, you didn’t go skydiving off the Amalfi Coast? You didn’t launch a startup? You didn’t see every one of your friends and family members? Suppose you did all that. What would you do the next day? And the next? How would you structure your life?
I have this voice that nags at the back of my head and it tells me weird things on a regular basis. It’s really obsessed with eating breakfast in the morning. I’m pretty sure that this is because I used to force myself to eat these massive breakfasts and second breakfasts back when I was trying to gain weight, and the little voice in my head is convinced that I’ll turn back into a scrawny rat if I don’t eat breakfast. For the same reasons, that voice is really obsessed with working out a lot.
That voice is also convinced that studying business and technology tomes is the hidden key to success, and if I don’t read enough then my career is going to fail. It’s also convinced that if I don’t write blog posts, my career will probably sputter too, even though I don’t really write about my career on my blog. This voice has twisted logic.
When I wrote my last blog post, I was hanging out in San Francisco with a friend who doesn’t include breakfast as part of his daily routine. (quelle horreur!) He is a coffee-only before lunch kind of guy, and while I was there, I decided I would experiment with coffee-only before lunch. And you know what? I actually liked it. It saved so much time in the morning and I could get by on less caffeine since I could afford to sleep more. The world did not come crashing down around me without my standard two eggs and yogurt.
This prompted me to ask myself an interesting question: what would I actually do with myself if I didn’t try to hold to a rigorous routine day after day? What if I didn’t make plans to work out? What if I didn’t try to wake up earlier to squeeze more out of the day? What if I didn’t try to only sleep six hours?
Here’s what happened:
- I went to the gym just twice, both days when I was in Disney World. I decided I was having way more fun swinging heavy steel clubs around, running outside from time to time, and playing basketball. Going to the gym in DC is just a drag for me right now. I don’t like treadmills or ellipticals, I don’t like waiting for benches to open up, and I don’t like taking an extra hour out of my day just to get there and back. After almost ten years of being a regular gym rat, I finally took some time off.
- I started drinking better coffee in the mornings. I upgraded my coffee game with a French press and some Qualia Coffee, the best brew in DC.
- I didn’t really eat breakfast. Sometimes I had toast with peanut butter.
- I slept more. I hit seven hours a night on a regular basis, and sometimes even eight. My alarm can go off at 7:30AM and I can still make it into the office by 9:00 by not working out or worrying about breakfast.
- I learned more at work and got more done in less time, which is a direct result of not being dog tired. I suspect sleep might be one of those things where you either have to get seven-plus hours (like Arianna Huffington) or sub-five hours (like Jocko Willink), but there’s probably not a middle ground here. I like the Huffington approach way more.
- I read four books:
- I traveled to Disney World with my college roommates. This is a super fun trip as an adult. There are certain parts of the park that you will enjoy way more once you’re over 21 (you probably never knew that there’s a bar in Epcot that features over a hundred tequilas and a few dozen mezcals), and there are other parts of the park that will make you feel like a kid again (hello, fireworks show at the Magic Kingdom castle).
The most important thing that changed wasn’t what I actually got accomplished. That stayed mostly constant. What changed was how I felt about it all. I was genuinely happier doing things that I liked when I let them flow into my schedule, and I was way less thrown off when I had to carve out time for an actual chore because I wasn’t treating everything like a chore. It was a remarkably mentally easy way to live.
I’ll be on the road a bit next month with some work-related travel and some beach-related travel. I’ll be reading. I’ll be learning. I’ll be enjoying life a little more while I do all of it.Tweet
This is not a reflection piece, at least not in the sense that I have been reflecting on life and career in the five monthly posts preceding this one. I didn’t start musing on what I would write back toward the middle of June. I don’t have a list of tangible accomplishments that are immediately coming to mind.
This is a piece about doing the work.
It is also a piece about meditation, because meditation helped me understand the work. In meditation, I learned how to become aware of what my mind was doing. In its average state, the mind is not merely aware of what’s going on; the mind is actively judging and evaluating its surroundings. Rather than focusing all cognitive cycles on doing the task at hand, it spends some of its time thinking about doing the task at hand.
This has its benefits and detriments. Our caveman ancestors would never have created the axe if they hadn’t occasionally stopped to evaluate which stones were better for breaking wood apart for the fire. But if they spent all of their time optimizing the stone, they would have perished in the cold when their firewood ran out. We alternate back and forth between execution and evaluation. Too much evaluation and we never move forward, too much execution and we never improve our pace.
Toward the beginning of the year, I actively evaluated everything. The evidence is in my writing from that time. I experimented with new workout routines, new diets, new activity trackers, and new technologies. I considered their utility as I was using them, like a product reviewer. It felt good. I was constantly thinking of myself as someone who was “highly productive,” not because I was actually producing anything at the time, but because I was thinking about producing things a lot.
Then the pressure picked up as I went through interviews and moved houses, and I struggled to maintain my pace of evaluation. I didn’t have time or mental energy to read as much as I had been or explore new apps and technologies. I felt bad about this. My perceived productivity was rooted in producing things about productivity. If I was no longer producing those things, what was I producing? My May blog post felt like a slog. I didn’t want to post it, but I felt embarrassed about not doing that. Then I felt embarrassed when it was late.
Through no intention of my own, I didn’t have time for any of that in June. I didn’t have time to continuously evaluate my productivity and intentionally experiment with new ideas and technologies. I just worked. I started building the plane during take-off, learning strategies and technologies as I went. I didn’t just focus on writing code, either: there were organizational differences to adapt to and new domains to learn about.
I admittedly haven’t had time to evaluate if the dead sprint I’m currently in is the right place to be. This blog post is a small reflection point to that effect. Perhaps I’m simply adapting to an increase in velocity. There’s a parallel to that in Newtonian physics: though it requires a lot of force to accelerate up to a higher velocity, the laws of momentum dictate that you can stay at that velocity indefinitely if nothing else is acting on you. If this is the new normal, eventually I’ll get used to it without needing a lot of effort.
So what did have I accomplished in the weeks prior?
- Read two books
- The Box: How the Shipping Container Made the World Smaller and the World Economy Bigger by Marc Levinson
- The Road to Character by David Brooks
- Went on a bold diet that resulted in me shaving a few percentage points of bodyfat in a month while not diminishing my quality of life
- Trained almost exclusively with steel clubs and steel maces
- Completed my first course in Apache Spark
This month has me doing multiple travel runs (I’m currently typing this from Wormhole Coffee in Chicago after trips through the Bay Area and Dallas), learning more Spark, picking up my CPA materials again, and just overall enjoying the summer. I hope you’re all doing the same!Tweet
In the first week of this month, I began closing down all of the things I’d been working on at National Journal. I started documenting the code that I’d written and training my co-workers on the things that only I had locked up in my head before taking my last lunches on that best roof in the District of Columbia. That was before D.C.’s three straight weeks of rain started, of course.
My first task at NJ was to build a Django model interpreter that would recursively dig into foreign key relationships to create nested documents to insert into MongoDB. Then I learned how to build authentication systems. Then I learned what happens when you build those authentication systems expecting that every page will be generated fresh and suddenly a CDN just destroys your entire mental model of the world. NJ was my trial by fire. I finally became a “developer” there. It took four years of me coding and several public-facing projects before I actually felt like I was a professional software developer.
Now I’ve started with a team that’s going to challenge me all over again. I typed four or five sentences trying to articulate my feelings about this new team before finally settling on a simple “This is the coolest thing I’ve ever done.” We’re building a Spark framework that’s going to analyze some truly huge datasets. I get to write Scala and SQL and explore graph databases and play around with computing hardware that I would normally never get to touch. I’m ecstatic.
That’s a big thing that happened this month. What else happened?
I read two books:
Now, this is a marked drop from my normal book volume. I’ve started taking notes on everything I read. Those notes look something like this:
I have pages upon pages of notes for Letters from a Stoic, one of the most thought-provoking books I’ve ever read. I’ll have a more detailed review later when I take the time to read back through my notes.
I started training with this scary-looking gear:
These weights are fierce on the muscles. With both the steel club and the steel mace, the weight is all thrown off on angles that normal barbells don’t cover. They’re only fifteen pounds each, but after one of their recommended workouts, I’m shaking. The weighted vest adds ten pounds of extra umph.
I wrote a post for a company blog that hasn’t gone live yet, but when that’s posted I’ll link it here. This will be my first post written for someone other than myself, if we ignore the post on optimizing music for productivity that got picked up by Lifehacker and Matt Mullenweg’s blog.
Finally, I purchased a TV for $50 and hooked up my PS3 to it.
I bring this up because while I’ve enjoyed kicking back and relaxing with some video games, I’ve also become aware of its addictive nature. I’ve become mindful of the desire to just chill after work and veg out for hours. Now, I’m curbing back my gaming through a Pomodoro technique mix. 25 minutes of something productive, then 25 minutes of games, back, forth, back, forth, etc. It seems to be working out so far.
What’s next in June? I have a stack of Scala and analytics material to read. I have a lot of new coding projects to explore at work. I also have jury duty.
By the way, my friend Josh challenged me to get back into more personal experimentation through a single text message asking what hack I was going to explore next. What suggestions should I try? Hit me up at @josephmosby.Tweet
It’s now the end of April. We’re a third of the way through 2016 already. What have I learned so far?
I’ve learned that morning workouts work more effectively than anything else I’ve tried. In the month of April, I came back to a dedicated 5:30AM wake-up call combined with an early trip to the gym. I was immediately successful in what I wanted to accomplish: heavier lifts in the four majors (bench press, deadlift, back squat, and shoulder press). I believe this works for me because it allows me to focus on my workouts before anything else that day in addition to letting me hit the gym when my energy levels are highest.
I’ve learned that coffee isn’t necessary. This realization has reflected on all aspects of my life, extending far beyond the physical release from caffeine addiction. My mind is clearer now. I am aware of the moments when it is drugged and when it is not. When I learned to detect a state of mind that was hyperactive on caffeine, I learned how to detect one that was overemotional or stressed or out of control in some other way. As I have learned how to detect these different states, I have learned how to respond accordingly.
I’ve learned that discipline has to be applied through all areas of my life or it won’t be applied at all. I start my weekdays off the same way with breakfast, the gym, and a walk to the office from the gym. By starting my day off this way, I set the tone for the entire rest of the day. The value of this cannot be overstated when trying to get big things done at work and after hours.
I’ve learned that when you tackle big things, they often shout down some of the smaller ones. I tackled two massive tasks this month: I moved into a new house, and I went through the interview process for a new job that I’ll be starting in May (I’ll write about that later). The mental focus dedicated to both of those tasks distracted me from some of the reading and writing I intended to do, but that was all for the best. I needed to be focused on those two primary objectives this month. In future months, I intend to anticipate those primary objectives before the month heats up and focus my activities accordingly.
In listicle form, here’s what I accomplished in the month of April:
- Read 5 books
- Walked more than 320,000 steps
- Moved in to a new home with fantastic roommates in an amazing neighborhood
- Interviewed for and accepted a new job
- Visited my brother in Dallas
- Wrote three blog posts, one on Python modules’ frequency of use, one on mental toughness and one on Prince
- Played three softball games
My attention in May is focused on starting off this new job with a bang. I will be writing more; there’s a lot flying around my head right now that I’m fired up to share here. I will also be paying Chicago a visit for Memorial Day weekend as my dad, brother and I go find all of their steak and trouble.
How is your year shaping up? Let me know! @josephmosbyTweet
My memories of Prince began in college with my suite-mate Adam, who idolized him already. Adam, born in 1988, was an ’80s music freak. We’d find him in his room rocking out to Foreigner’s Jukebox Hero, guitar in hand, the solos memorized. But he didn’t touch Prince. Three guitarists living in a suite together, and none of us would touch Prince. We knew we’d just disappoint ourselves.
Toward the end of my college career, I picked up Jay-Z’s The Blueprint 3 and got curious about hip-hop and R&B soon afterward. Prince was there too. My co-worker BL had me listen to Sign O’ the Times with new ears followed by a stack of Prince B-sides. The albums weren’t even labeled, they were CDs burned and mixed together, but I went all the way through them. No one had musical depth like that. There was good stuff, there was bad stuff. All throughout I could hear elements of crazy awesome musical ideas, and I’d point out to BL “oh that really sounds like so-and-so” and BL would remind me that Prince got there first, a few years before the rest of the industry caught up.
Going to a music school in Nashville, Tennessee (where everyone thinks a whole lot about music) and then moving to Washington, DC (where everyone thinks a whole lot about everything) jaded me on music for a little bit. I lost that ability to just get swept up in a musical performance instead of focusing on all of the details like the performer’s technical ability or song selection. But then Prince was there too, because Prince didn’t care what I or anyone else thought about the culture. He was too busy creating it. That was a big lesson.
I missed an opportunity to see Prince at the Warner Theatre last year because I had other plans. I didn’t make the effort because Prince was always supposed to be there, ageless and unchanging. I could watch Purple Rain and his episode of New Girl in the same day, the recordings separated by 30 years, but he was the same Prince throughout. No other artist can pull that off.
And even outside of the music, Prince was a reminder to me that you don’t have to hail from New York or San Francisco or Los Angeles to have an impact on the culture. That small towns and middle America produced more than country and folk music. That when you made it, you didn’t have to move to the big city and join the “scene.” He was outside of all of that, and something about how amazing he was signaled that it was a totally okay thing if you chose to opt out as well.
What more can I say? Who had an impact over so many lives over so many years just by virtue of his being?Tweet
How to develop mental toughness
This is one of those posts that I feel weird writing, because who am I to talk about mental toughness? I’m a private-school-educated guy who grew up in the suburbs of a sleepy Southern town, not a veteran, not an athlete or anything like that. But I speak to some of my friends who read my monthly recaps and they occasionally ask how I motivate myself to do any of it. I never really know how to answer that question. “I don’t know, man, I guess I just do it…”
I’m a growing fan of Jocko Willink’s work after listening to his interview on the Tim Ferriss show and reading Extreme Ownership, which discusses his approach to leadership. In his first episode of the Jocko Podcast, Jocko gets asked the question I’m tackling here: “how do you develop mental toughness?” Jocko’s a Navy SEAL who fought in Iraq, a jiu-jitsu practitioner, surfer, etc., etc. The dude’s hardcore. And he doesn’t really know how to answer this question, because he’s always been mentally tough. He doesn’t think about not being mentally tough.
I am not Jocko. I try to wake up early every weekday morning, but at least one day every week I oversleep and I can’t bring myself to keep up the discipline into the weekend. I downloaded Civilization V and struggle to stay away from it for more than a day or so. I get nervous about talking to new people. I really like Twitter and have a nervous tic that causes me to obsessively check it.
Still, I think that mental toughness is more of a choice I make every day than it is something I am or am not. When I successfully wake up at 5:30 and hit the ground for the gym, I am doing a mentally tough thing. When I tell myself “one more SICP course video, no Civ5 yet,” I am doing a mentally tough thing. When I tell myself “no Twitter, write the mental toughness post,” I am doing a mentally tough thing. Conversely, when I oversleep my alarm, I am doing a mentally weak thing. When I try to say “it’s not my fault that I overslept,” it’s an even weaker thing.
But mental toughness here is something I practice, not something I am or am not. That is critical to how to tackle it. It’s not a question of something I am or am not, it’s a response to a particular choice that I get to make multiple times a day. I can wake up early in the morning, work out, bust my chops at work, and then totally break down on something that I wanted to get done that night. Or I can oversleep and eat junk food throughout the day but still toughen myself up at lunchtime and finish the day on a high note.
I find that there are a few things that help me maintain that mental toughness:
- I wake up early and go to the gym before work. If I do this, I go into the office with all the endorphin highs of working out and I leave the office without an obligation to squeeze in a workout after work. That’s an immensely helpful situation to be in. When you start your day off like this, doing something that’s important to you, you’ve set the tone for the entire day. For me, that’s working out. For you, it might be the 500 words challenge or cooking yourself a gourmet meal to take into work that day. Just start the day off on your own terms rather than stressed out and sprinting to the office.
- I meditate. This is an on and off thing for me, mostly based on available time and how I’m choosing to use it, but I always find that a ten-minute meditative practice helps with my mental toughness for the entire rest of the day afterward.
- I avoid overconsumption of alcohol and caffeine. The alcohol part should be a no-brainer. Even if you’re just a little foggy from the night before, you’re having to expend mental energy just to grind through the day. The caffeine is a little counter-intuitive, but I’ve found that reducing myself to a single cup of tea does more for my mental toughness than clinging to my pot of coffee. Sure, I’m more energetic on the multiple cups of coffee, but that doesn’t mean I’m able to mentally buckle down.
What works for you? I know there are a lot of people out there with more highly developed strategies than mine for practicing mental toughness, and I’d love to hear about them.Tweet
A few days ago, I asked myself a simple question: what are the most (and least) popular Python modules from the standard library? Or rather, I decided to ask GitHub. There are at least a dozen syntactic ways you can bring a module into a piece of Python code, but I thought it might be easiest to simply search for “import “ and see how many results came back. There will of course be some false positives and false negatives, but on average, this approach can serve as a proxy for total usage.
Here are the results for the most used libraries:
And the results for the least used:
The full dataset can be found here, for the curious.
What do these usage patterns say about us as Python developers? And why would the language developers keep these almost completely unused modules around?
sys to be heavily used, though I did not expect them to blow away the #3 and #4 competitors as much as they did. Let’s think about what they do. These are big, complex libraries that operate at the most basic levels of the operating system. If you want to traverse a directory tree and pop out all of the text files, you’re using
os. If you have a script that’s dependent on system state - or even one that just needs to kill itself in a hurry - you’re using
sys. So with these modules being so heavily used, you’re looking at a lot of usage by system engineers, operations teams, and any piece of software who has to talk to a machine directly instead of just buzzing around in application space.
datetime are somewhat expected to land where they are, regular expressions and date management are both cornerstones of software development.
shutil surprised me a little bit. I thought that
sys and the standard
write() system calls would do most of the file work and something like
unittest would fill out the last of the top 5, but it looks like there’s still a lot of pushing files around left to do.
So if you’re a Python dev, there’s a good chance you’re doing a decent amount of work pushing files around and investigating your operating system. That makes complete sense - Python was started as a systems and automation scripting language, and that’s still at its core even if we’re now writing more complex software with it.
Now let’s take a look at the bottom of the barrel.
pathlib is one of the newest modules added to the standard library, and it’s currently only in there on a provisional basis. It provides a “simple hierarchy of classes to handle filesystem paths and the common operations users do over them.” The usage rationale comes from PEP 428, citing the previous attempt to provide these features in PEP 355 and the path.py module that treats filepaths like first-class players in the language.
pathlib clearly has not taken off yet, but it’s still new in the language.
fpectl deals with floating point exceptions. The reasoning for its low usage is clear on the man page: this module is not built by default, and its usage is discouraged and dangerous.
zipapp does something I didn’t even know you could do in Python: run Python executables that have been zipped up into archives directly.
tracemalloc lets debuggers sort through memory problems in their code, and it sort of makes sense to me that this probably doesn’t make it into committed code that often. Finishing us out,
nis is incredibly niche: it provides a wrapper around the Sun Network Information Service.
It’s interesting to me that some of the least-used modules share some similarities with the most-used: they’re all about system management. They’re even experiments with new ways to approach system management. There’s a lot that can be done with Python, but when it comes to the core library - the operating system is king.Tweet