Big O Notation & The Programs I’d Like To Write

[Currently Reading: “Cracking the Coding Interview” by Gayle L. McDowell. Chapters I-VII]

I’m not a “computer guy” just yet, so sometimes a lot of the technical terminology that surrounds code escapes me. I’m reading “Cracking the Coding Interview” per the suggestion of my close friends. They tell me that working through the problems in the book will help me a lot with what I’m trying to accomplish. The idea is to throw me into the swimming pool in order to teach me how to swim.

The book so far is a mix of interview strategy and crash courses in coding concepts. The one I’m currently working on is an essential concept called “Big O Notation.” Big O is a way to roughly estimate the time an algorithm will run (runtime). This is useful especially when the algorithm or program is handling a large amount of information, because Big O measures how quickly you will get through the data that is pushed into the algorithm.

The tricky part for me comes to calculating Big O times. There are a handful of rules and math concepts that you need to grasp in order to calculate how long an algorithm will run. It has been a while since I’ve seen anything that looks like math, so it takes a little extra effort to make that jump again. However, from looking at examples and working through exercises, I get the sense that it will be relatively simple to determine Big O notation eventually. It will probably take me O(N) to get through the brunt of it though (lol).

tim-gouw-68319

This is a stock photo of a hardworking individual.

“Cracking The Coding Interview” also describes interview practices company-by-company. McDowell highlights the differences between a Facebook interview versus an Amazon interview and that kind of thing. What’s funny about these is how often McDowell mentions that companies are looking for someone who is enthusiastic about their product. I guess this is a no-brainer, but I can see how someone might forget to express how excited they are about, say, Microsoft, while in a technical coding interview. A lot of the time when I tell people that I’m learning computer programming, they ask me what I’d like to make. I don’t have a very good answer for that yet, because truthfully I just want to get out of customer service and retail as soon as possible.

The thing that excites me the most is the possibility of making computer-generated art (novels, poetry), which is cool but I am afraid that there is little-to-no money in this kind of thing. But I hope that I’m wrong, because it would be super interesting to develop programs that write television shows or articles that make sense and also hold a human audience. I also tell people that I’m interested in the cross-over between code and customer service. I know for a fact that an Amazon Echo device could have done 80% of my job as a bookseller, and I would be interested in developing services and products that do just that.

I know a lot of people are afraid of being put out of work by robots, and I believe this shift is inevitable. I don’t think the answer is telling technological progress to stop, but rather we should see what kinds of opportunities blossom once robots take a lot of the grunt-work away from us. Perhaps the massive shift away from human work will put pressure on our governments to provide Universal Basic Income for the population. Hopefully this kind of policy would allow us to spend our time on more meaningful pursuits.

Advertisements

My Favorite Wikipedia Pages

At a previous job, I spent a lot of time looking at Wikipedia pages to fill time. After a while, I realized that I returned to some pages over and over again. These pages were interesting because they elevated the medium of the Wikipedia page by becoming a piece that felt more like art than a reference page. I sat down with my friends and tried to hash out what exactly makes a Wikipedia page great, and we settled on the following criteria.

  1. The page must have good one liners. The page must be quotable for easy sharing and to leave you will a snippet that stays in your mind long after you’ve read the article.
  2. The page should have a compelling narrative. Stories are always good, and the page should draw you into one.
  3. The page should have interesting subsections. There is nothing better than scrolling down to the “Controversy” portion of someone’s Wikipedia page. My personal favorite is skipping directly to “Early Life” and “Early Career” since I want to see what successful people were doing at around my age.
  4. The page must excel at being a Wikipedia page. Interesting people and subjects are great, but I am interested in how these people fit into the format that Wikipedia has designed for us, from the table of contents to the footnotes.

That being said, here are some of my favorites.

Will Smith. (https://en.wikipedia.org/wiki/Will_Smith).
I think about Will Smith’s Wikipedia page a lot, mostly because of the “Religious Beliefs” subsection. Will Smith and his family seem to be very spiritual people (just look at the interview with Willow and Jaden Smith in which they delve into their own personal philosophies). In the “Religious Beliefs” section of the Wikipedia page, there is a whole paragraph dedicated to the fact that he has spoken favorably of Scientology (though is not a Scientologist). “”I just think a lot of the ideas in Scientology are brilliant and revolutionary and non-religious,” he says. I am a little confused how and why this made it onto Will Smith’s Wikipedia page, alongside all of his other accomplishments. I understand the controversy surrounding Scientology and by no means endorse it. I wonder why Will Smith’s opinion on the matter holds any weight in the debate, especially when this quote illustrates that the ideas in Scientology are, to him, non-religious. I guess I just think about Will Smith in many regards*, none of which include this offhand mention of Scientology.

Lord Byron. (https://en.wikipedia.org/wiki/Lord_Byron).
I looked up Lord Byron after watching the movie “The Trip” with Steve Coogan and Rob Brydon. I was blown away. Lord Byron was the biggest fuckboy ever to tread planet Earth. His Wikipedia page is expansive and divided into wild chapters of his various escapades. Byron’s Wikipedia page was particularly useful to me because the information was tangentially work-related and I felt like I wouldn’t get in trouble for studying literary history. But also I was there for all of the insane fuckery that Lord Byron got himself into. This page requires multiple visits, and the subsections read well by themselves (“Fondness For Animals”, “Education and Early Loves”, “Political Career”). The fact that all of this is plotted out in an outlines and structured manner when Byron’s life seem to be the opposite of outlined and structured makes it a great read.

byron

Look at this fuck-o.

Minnesota Nice. (https://en.wikipedia.org/wiki/Minnesota_nice).
I visited this page after watching the Coen Brother’s “Fargo” (1996). Regional cultural differences were relevant to me at the time. I was living in Portland where people seemed to be generally friendlier than other place I had visited. I think about this page a lot, especially when I move to new towns and try to get a sense of the cultural climate. Living in Seattle is refreshing after living in Portland, since people are more inclined to be just outright nasty. I sometimes think it is directly linked to population density, that the more tightly packed people are crammed into a given space, the more of an asshole they will typically be in everyday life.

Here are some honorable mentions for some Wikpedia pages that my friends and I like that also may tickle your interests.

Everyone has their favorite topic, so you can imagine that this list goes on for a while. When I asked my friends what their favorite pages were, everyone had an enthusiastic response. This thrills me, because it shows me that people are curious and excited about the things they find, especially in a kind of dry format. Information, when organized neatly, can be a sublime experience.


*Most often in the context of the movie “I, Robot”.

How “The Wire” Frames My Career Perspective

I watched “The Wire” recently and was completely hooked for two reasons. First, it is a well-written, well-performed, and extremely compelling television series. Secondly, it helped me gain some cognitive tools for how to optimize my life and career aspirations by helping me process my environment differently.

David Simon spent twelve years reporting on crime for the Baltimore Sun before losing his respect for journalism. Convinced that news had little effect on the population, he began to write books about crime and drug trade, along with the TV series “The Wire”. He said that the show  is “really about the American city, and about how we live together. It’s about how institutions have an effect on individuals. Whether one is a cop, a longshoreman, a drug dealer, a politician, a judge or a lawyer, all are ultimately compromised and must contend with whatever institution to which they are committed.”

david-simon

David Simon, creator of “The Wire”.

What makes “The Wire” so interesting is the well-researched insight into how and why people get involved in crime, or any other business in urban environments. It is heavily influenced by the design of a city or system, and how the people within it move to find their own path of least resistance. Sure, we all have an illusion of free-will, but sometimes immediate gains depend on the structure of what surrounds us.

This has helped my career  by practicing a “zoom out” every once in a while, where I evaluate my role in the larger system. I try to stay in touch with my skill set, and then see where I can place those skills easily in a system for maximum gain. For example, I recently switched my career from bookseller to barista and doubled the amount of money that I make per hour. By “zooming out”, I saw that my career as a bookseller had no future and no paths to something valuable or profitable in the short term, and sticking with the job would only prolong my financial woes. I quit immediately and picked up a coffee job in Seattle, and now I work in a industry that pays some of its employees more money that most booksellers.

It is so easy to lose scope. Our day to day lives encourage us to keep blinders on in order to focus on the tasks at hand. However, a regular practice of contemplating the infinite (whether it be in church, at yoga, or while meditating on the bus) allows us to realize that (1) we are are small units within much larger structures and (2) our problems are even smaller units within these structures.

nikita-maru-70928

Broadening scope is like giving yourself a road map to optimize your value. Once you have this map, you start to see routes to a better career. You see which businesses, social circles, and institutions can bring you closer to your goals. As a barista, I get to meet a high volume of customers on a regular basis. I make more money and get more flexibility with my schedule. Living in Seattle, I get to meet with my friends who are software developers more often. I have maximized my social capital, I have a job that suits my needs, and I have much more opportunities to develop my programming skills.

Watching “The Wire” is like watching all of the cogs and gears of a clock turn. Applying this framework to my surroundings is endlessly fascinating, and also gives me reason to learn more about the architecture of my environment. I am now watching a lot of “current economics” videos on Khan Academy because I have a newly developed interest in how my cities spin, and hopefully it will allow me to create my own effective sub-system within it.

Three Reviews of Seattle Cafes

I have visited an handful of cafes in Seattle so far, and I think it might be worth my time to give you the lowdown of some of the ones I like and dislike.

Ghost Note Coffee (Bellevue Ave)

[A good spot to work despite its confusing twists on traditional coffee.]

This is a relatively new spot that has only been open for a couple months. The cafe is a triumph in interior design and serves mediocre coffee in such a stylish way I don’t even care if it tastes horrible. And some of the coffee does indeed taste horrible. The cafe brews iced coffee to order (something I’ve never experienced before) which results in a grainy, bitter, barely palatable beverage. The espresso experience is fine (probably because they aren’t taking artistic liberties with the process), so I usually get a shot and work in the corner near the restrooms. The cafe is excellent for work and study. This, I am convinced, is the primary focus of the cafe. Outlets are aplenty, seating is everywhere. The walls are lined with long tables and I have spent a good two hours working on projects here. The color scheme of the cafe is a pleasant aquamarine paired with white, and it even makes you feel more productive just by stepping in. Tidy, clean, and all around a great experience as long as you avoid their iced coffee experiment.

Elm Street Coffee Roasters (2nd Ave)

[An impersonal, high-end cafe that offers a quality espresso experience.]

With an interior design scheme straight out of a Kinfolk Magazine, it’s hard to feel terribly comfortable at Elm Street. Unlike Ghost Note, they definitely take pride in their coffee products, and I have had pleasant espresso experiences here almost every time. I find the espresso light, complex, and smooth. It’s hard to say too much about a cafe that is consistent and has provided what you expect from a third-wave cafe: good coffee. The atmosphere is professional, delicate, and stark, so it’s a good place to sit for a professional chat and less ideal for working. My favorite spot to sit is along the bar, though that’s probably because I’m either typing, reading, or standing for a moment while having a quick drink. The tables are low and there are nooks and booths to recline in, and I find that the angular design invites semi-formal interactions.

Porchlight Coffee & Records (14th Ave)

[A delightful cafe/record store with a calm and creative atmosphere.] 

IMG_0310

Porchlight is the most charming cafe I have visited in Seattle yet. First, the customer service was noticeably excellent. My barista was friendly, personable, and made me feel welcome the entire time I was at the cafe. I got an espresso and a muffin, served on a yellow food tray like the kind you would find in a school cafeteria. While I read and worked on my muffin, several people came in and announced to the barista that they were look for some records. In the back of the store is a small vinyl collection, which adds to the atmosphere and fondly reminds me of my favorite cafe in the world, Courier Coffee in Portland, Oregon. This cafe was clean, cozy, and cultivated a unique feeling that I will definitely want to return to. When I look for a cafe, I look for spots that take pride in their product, and Porchlight’s product is its coffee experience. 

My First Taste of the Coding Interview

Over dinner, I spoke with my close friends Zac and Elliott about what my next steps should be if I want to break into a software development job. “First, buy Cracking The Code Interview,” said Zac, “and just read the whole thing.” I immediately took his advice, and the next morning I walked to the closest bookstore and bought the Cracking The Coding Interview by Gayle Laakmann McDowell. While at the store, I picked up an Arduino Starter Kit as a fun way to apply some of the stuff I’ve been learning.

FullSizeRender (1)

“When I first started on the problems in Cracking The Code Interview, I spent a lot of time banging my head against a wall,” Elliott told me. Zac chimed in “But it’s just practice.” My friends explained that if I spent a little bit of time working on code problems in the book, I would become familiar with more complex problems than the ones I am currently solving. “It’s all about putting yourself in an uncomfortable situation. Part of being a software developer is dealing with problems that you have no idea how to solve,” said Elliott.

After dinner, we drove back home and I flipped through Cracking The Code Interview. Suddenly, Elliott slapped down a stack of papers and a red Sharpie in front of me. “We’re going to solve some problems,” he said. We picked two questions (ranked “easy” on leetcode.com) and Elliott had me talk through the problems and tell him how I would solve them. A couple times I offered solutions using JavaScript methods and he laughed. “I want you to solve this with math,” he told me. I got a crash course in modulus operators and common pitfalls from dealing with loops and arrays. I lost track of time, but we probably worked on the problems for more than an hour.

“I threw a lot of stuff at you but you handled it well,” said Elliott, swirling a glass of wine. “When I was preparing for my interview, the first thing I did when I woke up in the morning was answer code questions. I had to be ready to solve complex challenges under any circumstances, so my mom would ask me stuff from Cracking The Code Interview at random times.”

FullSizeRender

This kind of training and diligence thrills me. I remember watching the movie Somm and hearing something like this: There are some people who hear about difficult tasks and think “wow that’s really incredible” and others who hear the same thing and think “I want to do that.” I definitely fall into the latter category. Zac told me he felt similarly, that always when someone tells him about something that was really difficult, he immediately wants to try it to see if he can go about it in a smarter way.

A lot of getting good at anything is just training, so today I’m putting in the time to get through Cracking The Code Interview while getting my feet wet with Java. It really helps, though, to have such a supportive friend group. I told Elliott that helping me solve problems on paper felt really useful. “Anytime. Not literally,” he said,  before shutting the door.

My First Year of JavaScript

I’ve spent about a year taking online courses with Treehouse (teamtreehouse.com) in order to break into computer programming. It’s been a ride, and I’ve met a ton of interesting people along the way. I suspect that there might be a lot of people in my position, people who have realized that their retail jobs will soon become obsolete and that a functional understanding of computers and code is necessary in order to be a human in the coming years. So, I would like to share what I’ve learned (and what I’m learning) in my forays into tech in order to inspire my peers, or at least make them feel less alone.

I chose JavaScript because it seemed to have a large fan-base. In Portland, Oregon, I had friends who connected me with JavaScript meetups and opportunities to learn the potential of what was possible with the language. On Treehouse, the JavaScript teachers also seemed SUPER excited about JavaScript (Dave McFarland almost leaps over his desk to tell you how excited he is to teach you JavaScript). With such an enthusiastic community, how could I not get started?

Screenshot 2017-09-12 at 3.44.05 PM

Serious face and Treehouse stats.

JavaScript is a programming language mainly used to make stuff that you see in your web browser. It allows you to make animate, direct traffic, create tools, and much more. The terrain for what is possible with JavaScript is vast and growing, and a lot of what I have been looking into recently has included using JavaScript to write programs for internet-connected devices like the Amazon Echo, or even for Arduinos. Most of my coursework has been focused on making “dynamic web pages”, which basically means websites that you can actually use to do things as opposed to just reading them. For example, you could use JavaScript to make a website that keeps your shopping list, or turns music into animations, or generates random movie-plots.

The movie-plot idea was one of my first projects in JavaScript. It is based on a book that I encountered at Powell’s, which kind of resembled those books where you can change the head, torso, and legs of a monster by turning the pages. I wanted to make a program that created random, silly treatments for movies. And lo! I did.

Screenshot 2017-09-12 at 3.30.29 PM

This is the kind of stuff my computer spits out when I run the program.

This is pretty rudimentary, but I’m still proud of it and it was one of the first projects that I followed from inception to completion. I’ve created a lot more since this first one, but we’ll save those for future blog posts. What I’ve noticed is that when you’re starting out with programming, you will often put in a heroic amount of effort to produce something that seems, on the surface, unimpressive. However, take your victories and roll with them, because the more you do the unimpressive things the more you will learn to make stuff that is useful.

Should Your Life Be a Sitcom?

“This should be a sitcom,” is something I hear often among my friends. Usually we are sitting in the living room of someone’s apartment, having beers and discussing hijinks that we experienced during the day. “Why isn’t this a TV show?” and “We could totally be a TV series” are other iterations of the same idea, that our lives are so unique and entertaining that we could be the next “Friends” or “Girls” or “Seinfeld”.

If this is a thought that is going through your mind, as exciting as it is, your life probably doesn’t have be a sitcom and you don’t really need to shop around the details for a deal with Netflix. For the majority of us, once our lives have hit sitcom-hilarity levels, this means your life is interesting enough that you are generally pleased with the amount of mayhem going on. It is so interesting and funny that it resembles shows that attempt to capture that exact feeling of life-absurdity.

IMG_0270

Assorted goofin’ from my life in 2017. 

My general feeling about mainstream art is that it exists to fulfill a spiritual deficit. We watch sitcoms for comfort and also to be distracted from our own lives which can often be very, very boring. “The Office” managed to heighten the deadening 9 to 5 tedium of cubicle work into a hilarious and emotional roller-coaster, in a way that was relatable but also completely absurd. “30 Rock” gave me a peek into the world of being a writer in New York. “It’s Always Sunny In Philadelphia” satisfied my desire to occasionally be pieces of shit, when my day-to-day lifestyle demanded composure and manners.

Television brings color to otherwise dead moments. We all have our own little prisons that prevent us from feeling alive. It can be responsibility, fear, financial limitations, etc., but through the lens of art we dream for a moment that the stakes and circumstances have changed. But, what happens when we have reached the point where we don’t even need television to reach the baseline comfort and hilarity of a sitcom? For me, it is a form of accomplishment. When I have the thought “This could be a sitcom,” I feel blessed to be living a life that is so entertaining that I would watch it in my free time.

Right now I am sleeping on a friend’s couch, struggling to pull my life together. One of my housemates is juggling workplace romances and another is preparing for doomsday. We spend our afternoons drinking La Croix and watching cars fuck each other up with poor parking maneuvers. A steady rotation of friends filter through with cookies and beer and stories. Our lives are filled with a number of events, tragedies, celebrations, heartbreaks, and hopes. It feels so riveting to be a part of it. So when someone, gasping with laughter, asks “Why aren’t we a sitcom?” the answer is that we don’t even have to be.