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
A March recap, or an experiment in moderating moderation
"How much can you really know about yourself if you've never been in a fight?"
This month I transitioned out of a full health and fitness mindset into a technology- and career-oriented mindset. I stopped my caffeine abstinence, stopped focusing on what I ate, stopped being concerned with working out every day. I assumed that all of this would probably take a small toll on how I felt, but that my momentum from January and February would prevent me from experiencing a major backslide in productivity.
That assumption was wrong.
Here’s what I got done in the month of March:
- Read 9 books
- Zorba the Greek by Nikos Kazantzakis
- Hold Me Tight by Sue Johnson
- Foundation and Empire by Isaac Asimov
- Extreme Ownership by Jocko Willink
- MaddAddam by Margaret Atwood
- Batman: The Dark Knight Returns by Frank Miller
- Batman: The Long Halloween by Jeph Loeb
- The Wisdom of Crowds by James Surowiecki
- Network Security Through Data Analysis by Michael S. Collins
- Wrote two blog posts on reading a whole lot of books in a month and the Node.js community
- Participated in my first trapeze class
- Attended judo classes every week, learning how to properly fall and throw
- Found a new place to live
- Started waking up at 5:30, inspired by this post from Greg Baugues
- Worked through half of MIT’s 6.001: Structure and Interpretation of Computer Programs
Ultimately, I could have done better in this month. I could have finished more. My head wasn’t in the game, and I think I know why. I allowed myself to become undisciplined in my food intake, my workout routines, and my caffeine intake, thinking that if I allowed my willpower to weaken in those areas of my life I would have more to apply to other areas of my life. It doesn’t work that way, at least not for me. When I allowed my discipline to weaken, it changed my entire mindset away from a regular meditation on getting things done to an unstructured mentality that struggled to focus on any particular task. I could drag myself to the gym or to judo class, but once I needed to keep myself focused at home, I regularly broke down.
Anyway, I’ve gone back to a low-caffeine state. I’m currently experimenting with a concoction known as “Titanium Tea”, a hybrid of multiple varieties of tea combined with butter and coconut oil. Not even kidding, I drop melted butter in my tea every morning to start the day. So far, it’s been working out exceptionally well. I need only a single mug of tea in the morning to power me through the rest of the day and let me calm down at night to finally hit the bed - and I don’t have any of the ups and downs and crashes that are typically associated with my coffee drinking. Here’s one recipe to follow for making your own. Here’s my simpler version:
- Get some Irish Breakfast and green tea bags. Honestly, you can use whatever black and green tea combo you like, just make sure to grab one of each.
- Boil your water.
- Add water to mug. Throw in a tablespoon of butter (I use Kerrygold unsalted, which you can find at the grocery store) and a tablespoon of coconut oil.
- Steep one black and one green tea bag in your buttery mug, together, for four minutes.
- Remove tea bags, stir everything around, and enjoy.
That concoction right there keeps me going throughout the day without needing any more coffee.
Next month, it’s all about more technology, visiting my brother in Dallas, checking out the Kingman Island Bluegrass Festival, and hopefully doing some more restaurant exploration now that the weather has turned around in DC. Stay tuned!Tweet
I am overjoyed for the Node community
The Node community has hit a huge moment in its growth, and I couldn’t be more excited for it as an outsider looking in. It’s certainly dark times for Node devs as many of them sort through the issues arising in their own applications after one prolific developer rage-quit and pulled all of his code from the Node Package Manager after a spat with the Kik product team. Many Node developers relied on those packages being part of the NPM infrastructure, and the lack of a tested, readily available alternative that offers the same ease of use makes this abrupt change harder to bear.
Developer pundits, of which I am sometimes one, have jumped on the question: have we forgotten how to program? David Haney writes:
I can’t help but be amazed by the fact that developers are taking on dependencies for single line functions that they should be able to write with their eyes closed. In my opinion, if you cannot write a left-pad, is-positive-integer, or isArray function in 5 minutes flat (including the time you spend Googling), then you don’t actually know how to code. Hell, any of these would make a great code screening interview question to determine whether or not a candidate can code.
Thanks to Andrew McGill for reading this and providing feedback.Tweet
How to Read All of the Books You Want in a Month
In the past two months, I’ve drastically scaled up the number of books I read on a per month basis. On average, I take out two books a week, a far cry from a book every single day. Sometimes, it’s enjoyable and relaxing reading, sometimes it’s tiring work. The end result, though, is always worthwhile.
I’ve employed a few different strategies in these two months to churn through my booklist. I don’t have a particular order or anything, so I’m just going to list them out here:
- Read fiction in audiobook format. My colleagues at National Journal got me started on the audiobook kick. A lot of them walk or bike to work, popping in their headphones for the commute and cranking away at one novel after another. Best part: a lot of the audiobooks are available on Overdrive (i.e., for free!), but anything else can likely be found on Audible.
- Maintain a Goodreads list along with a queue of books at my house. What I want to read oscillates from week to week. I can’t say at the beginning of month what I’m going to want to read the next week. So, I don’t try. I throw every book I want to read into Goodreads to save it for later. And I try my hardest, through a combination of Amazon and the DC Public Library, to make sure there are four unread books at my house at all times: two nonfiction and two fiction. If you don’t have a library card yet, perhaps BooksForDC will finally persuade you by showing when a book you want on Amazon could be had for free by reserving it at the library.
- Stop reading and watching other stuff that I don’t really care about. I don’t watch much television, online or otherwise, half because I don’t own a television and half because there’s nothing much I care to watch. I don’t think I have the attention span for long-running shows, with Game of Thrones and House of Cards being the only exception. I even dropped Breaking Bad after three seasons. I just couldn’t keep up. By avoiding most video content and doing my best to stay away from the dopamine hits of regular social media usage, I free up more time to focus on my reading.
- Read only two books at a time, one nonfiction during the day and one fiction before bed. I don’t stick to this rhythm wholesale any more, as it doesn’t mesh well with my audiobooks. However, it seems that this rhythm may have made it easier to focus on tasks other that reading, such as social media abstinence or regular experimental code writing.
- Move the needle a little bit every day. I have a line item in my Way of Life app that just says “Read.” Nothing more than that, just a gentle reminder to get a few pages done every day.
There’s probably a lot more I could try to get even more reading done, so if anything is working for you I want to hear about it! @josephmosbyTweet
A February Recap or What Life is Like Without Coffee
In February, I decided to enter life’s “Hard Mode.” I gave up caffeine completely.
I had no idea how this experiment would work and what it would do for my productivity. Here is what I was able to accomplish in the month of February, in similar format to my January recap:
- Read 9 books
- Mastery by Robert Greene
- Radical Acceptance by Tara Brach
- Foundation by Isaac Asimov
- A Farewell to Arms by Ernest Hemingway
- Oryx and Crake by Margaret Atwood (semi-recap here)
- Influence: The Psychology of Persuasion by Robert Cialdini
- A Million Miles in a Thousand Years by Donald Miller
- Trigger Warning: Short Fictions and Disturbances by Neil Gaiman
- Vagabonding: An Uncommon Guide to the Art of Long-Term World Travel by Rolf Potts
- Executed 50 pullups and 100 pushups in the same workout, and executed 30/60 with an additional 25 lb. weight attached to me
- Squatted 245 lb. for 5 repetitions
- Leg pressed 500 lb. for 5 repetitions
- Lost one or two inches off my waistline (this is an estimate, I just know my pants don’t fit)
- Attended my first two judo lessons
- Completed the first draft of my e-book on uWSGI
- Watched 20+ TED talks
- Wrote daily journal entries
- Got a tan and a sunburn in Rio de Janeiro while riding the waves on Copacabana Beach
I again followed the practice of not setting goals in this month and focused on systems instead. I believe that this pushed me through the fog of an uncaffeinated mind, and perhaps ultimately strengthened my willpower.
I decided to go cold turkey off of coffee just before January wrapped up. I knew that many highly successful people had gotten off of caffeine over the course of their lives, and I thought it was a worthwhile experiment to try for myself. It turned out to be wildly different than my expectations.
The last time I tried to give up caffeine cold turkey, I was crippled with raging headaches and nausea that made me think I had the flu. I cracked after two days. This time, I gradually reduced my caffeine intake over the course of several months, ultimately consuming only the equivalent of half of a cup of coffee per day. When I went off, I had a headache the first night, then did not have any pain afterward.
What I did not account for was “the fog.” The fog is a state of mind that exists somewhere between tired and fully awake, and I went through this state in varying degrees over the course of my experiment. My brain didn’t feel like it was moving as quickly while it was in the fog, nor was I nearly as motivated to get things done. After the first few days, I was completely functional at my day job, but at nighttime I would grind to get anything done. Though I read more books, lifted heavier weights, and finished my e-book’s first draft during this time period, I felt I had to mentally fight to do any of that.
I believe that it was the fight that made this entire experiment worthwhile. It’s one thing to knock out a bunch of tasks when hopped up on caffeine - it’s another thing to need to consciously decide what absolutely must be done when you know your caffeineless willpower can only handle so much. That willpower training is invaluable. I look forward to having it when I allow myself caffeine once more.
Judo is the first martial art I’ve practiced since I was a first grader. It is so much fun and I wish I had tried it earlier. It’s an intense workout. The warmups alone will make your core hurt, to say nothing of the part where you start tossing people around. It’s almost like an extremely physical chess match, with grip position and balance being the dominant factors that win or lose matches rather than total strength. There’s no rush quite like it. I’m hooked already after only a few classes and will definitely be hungry for more in 2016.
I dropped use of the Lifesum and Pacifica apps in the month of February. Lifesum was part of an experiment to clean up my eating habits by tracking my daily protein, carbohydrate, and fat intake. I instead focused on cooking more at home and not allowing myself some standard fast food cheats, and it’s far too difficult to track home-cooked meals easily in Lifesum. I scrapped Pacifica for similar reasons. When I dropped caffeine and began sleeping more, I noticed that my stress levels and mental well-being improved as well. I still have a lot that I want to do on the mindfulness front, but I don’t think this particular app will help me toward those goals. In addition, I took two bags of used clothing in for donation, gradually reducing the mental paces I put myself through to pick out what to wear.
In the first parts of the year, I focused on physical well-being. I’ve developed systems to help me maintain my health, some of which I may recycle or augment as I move into the next phase of the year: technical skills acquisition. For the next three months, I plan to focus on practicing and mastering some of the skills that make up my world as an engineer. I will allow myself caffeine again, but it still won’t be a daily thing. It will be an intentional dose to achieve specific tasks.
What are you working on in March? I want to hear about it! Let me know: @josephmosbyTweet
Oryx and Crake
Oryx and Crake has haunted me for a longer period of time than any book I’ve read in years. Naturally, I think everyone should read it.
It isn’t the story that gets to you. Margaret Atwood does good work with the story-telling and writes a compelling tale with beautiful, complex characters. But it would be a standard enjoyable sciencey-fiction story in the vibe of many of the modern writers in that genre if it weren’t for the implications.
You know something horrible is going to happen from the beginning. When the book opens, the horribleness has already happened, and the reader is waiting for it to unfold in the ensuing flashback chapters. But as the crescendo builds to a frightening pitch, you realize that what you expected in chapter one is nowhere near as menacing and uncomfortably plausible as the apocalypse that Atwood has concocted for the reader. Eight months after the first read and I’m still thinking about it.
Go check it out. You won’t be disappointed.Tweet