Sunday, June 26, 2016

End of programmerdays

This blog has moved to https://programmerdays.com

As of now, I will stop posting to this website.

Saturday, June 18, 2016

Paid to exercise

We live in a weird world. Recently, I've been getting paid to exercise.

My company has partnered with another company called Jiff. After I registered my fitbit account to Jiff, Jiff gives me points based on how many steps I take and how much I sleep. I can then redeem those points for prepaid cards or I can enter raffles.

Here are some numbers for you:

  • 600 points will give you a $20 gift card.
  • 50 points will give you a raffle ticket for things like an ipad mini or a new fitbit.

For the last few months, I have gotten around 500 points per month. It could be a little bit higher if 1) I always remembered to wear my fitbit and 2) I entered things into a food log (which I always forget to do). All in all, it takes me a little over a month to make $20.

So far, I've entered a couple of raffles (but haven't won anything yet) and I have gotten 1 visa prepaid debit card.

I had a little trouble using the virtual $20 prepaid card. First, I wanted to use it with iTalki. But I found out that there is a processing fee. If I used it there, I'd have a remaining balance, and then I'd be stuck trying to figure out how to spend the leftover balance. Then I tried to buy some credits for my digital ocean account. For some reason, the charge was rejected. Finally, I successfully was able to spend it all on credits for indoor hoops.

It is fitting that I was able to use money generated from my fitness activities to do more exercise.

Wednesday, June 15, 2016

Fitbit is a good company

The band on my fitbit Charge HR somehow got an air bubble. Soon after the seams started to become unglued. I was afraid that the band might get caught on something and rip apart at any moment.

So, I went to the fitbit forums and found that others were experiencing the same issue. I sent an email to fitbit with a picture and a description of my problem. They replied within a couple of hours asking for my order number and mailing address. Before I knew it, a replacement fitbit was being prepared for me, and it arrived a few days later.

I am very impressed by fitbit's customer service. Some companies seem to operate by trying to squeeze every penny out of you (t.v. cable companies, airlines, etc ...) In contrast, my interactions with fitbit have all been easy and reasonable.

I don't remember if I mentioned this before, but since I'm talking about my fitbit, here are the things I most use the fitbit for:

  • using it as a silent alarm to wake me up before my wife
  • checking the time
  • checking my historical resting heart rate
  • using it as a reminder to never be too lazy

Saturday, June 11, 2016

Nginx Gunicorn Flask stack

I followed this wonderful guide to set up my flask + gunicorn + nginx application jjjdddfff.com on digital ocean. If you want to do the same, you should probably go there. Here are some additional notes that I took for myself.

What is the stack made of?

nginx is your http server. You tell the nginx server what port to listen to and where to pass requests. It can handle some requests on its own, like serving static resources like images, or redirects from one url to another. If it doesn't handle a request on its own, it can pass it to your app server, which in my case is gunicorn.

gunicorn is your python app server. It translates http requests into wsgi (web server gateway interface) compatible requests, which are forwarded to whatever will process the request.

flask is a python web framework. It will contain all the business logic of creating a response for a given request.

An alternative stack might be something like apache/uWsgi/django. Because it's all new to me, so I can't say with any authority which is better. I just needed to start somewhere, and after googling/reading a bit, I settled on this stack. At the worst, I think all of the pieces are plug and play. If I am unhappy with any piece of the puzzle, I don't think it will be too much trouble to switch out pieces of the stack. Right?

What do you need to do

You should look to the guide for the explicit steps, but I think it boils down to the following. First, install the software you need (nginx and virtualenv) and then within a virtual envinronment (gunicorn and flask). Then you need to write a couple of scripts.

Configure a web server (nginx)

In script, /etc/nginx/sites-enabled/homepage, I set up my web server (nginx) to listen to http requests and pass them to our app server (gunicorn) via a sock file.

server {
    listen 80;
    server_name jjjdddfff.com;

    location / {
        include proxy_params;
        proxy_pass http://unix:/home/username/homepage/homepage.sock;
    }
}
server {
    server_name www.jjjdddfff.com;
    return 301 $scheme://jjjdddfff.com$request_uri;
}

Set up application server (gunicorn)

In script /etc/init/homepage.conf, I created an upstart file that tells ubuntu to start your web application (homepage) that is bound to that "sock" file used in the web server.

description "Gunicorn application server running homepage"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
setuid username
setgid www-data

script
    cd /home/username/homepage
    . venv/bin/activate
    gunicorn --workers 1 --bind unix:homepage.sock -m 007 homepage
end script

Create a web application (flask)

In script, /home/username/homepage/homepage.py, I set up a flask application which will handle all the business logic of processing requests.

from flask import Flask
application = Flask(__name__)

@application.route("/")
def home():
    return "Hello world"

if __name__ == "__main__":
    application.run(host='0.0.0.0')

Some helpful commands

Test the web server.

sudo nginx -t
sudo service nginx restart

Test the application server.

sudo stop homepage
sudo start homepage

Tuesday, June 7, 2016

Indoor Hoops

I had my first experience playing basketball with Indoorhoops.com.

I first signed up for a game a couple of weeks ago, on the Sunday of Mother's day, but there weren't enough people, and the scheduled game was cancelled.

I tried again, and this time there were enough people, and I got to play. I haven't played full court basketball in a couple of years, so I was a little bit nervous whether I could keep up. In the end, I think my skill level was just fine. I'm not sure where I would rank among all the players there, but the team I played on won a few games, and I contributed to those wins somewhat. Basically, I didn't stick out like a sore thumb of incompetence, so that was good.

I think there were about 12 people for a 5v5 game. The winner stayed on, and if you lost, you had a pretty decent chance of getting in the next game, just by hitting some free throws. I think I played for about an hour and half straight, before I volunteered to sit one out.

It was a hot day, and the court was hot too. This was OK with me, and probably helped me get a good workout. The court I went to was a bit small, which was Ok as well, because I probably would've gotten tired faster if it were bigger.

It was a good experience, and I plan on doing it again.

If you want to try it out, consider using this link: https://indoorhoops.com/in/refer/CNFJN12678, so that I can get some referral credits.

Sunday, June 5, 2016

My Virtual Private Server

I bought a server

As a professional computer programmer I have written and deployed a lot of code. Almost all of this code has run on machines that someone else had set up for me. This is a gap of knowledge and understanding and experience that I want to shrink.

This weekend, I made a step towards reducing my knowledge gap by purchasing access to a VPS (virtual private server) from Digital Ocean. With it, I can now start up a linux server "in the cloud" in a couple of minutes. I didn't and don't fully understand what that meant (because of my previously noted knowledge gap), but I signed up for an account and bought some credits anyway.

What did I buy?

I bought something that Digital Ocean calls 'droplets'. Droplets are a virtual server that has an operating system, like Ubuntu, and a set of resources like a hard drive, RAM, bandwidth and an IP address. You can then connect to your droplet via ssh and do whatever unix stuff you like.

I bought the cheapest one which is an Ubuntu server with 512 MB of RAM, 20 GB hard disk and 1000 GB of transfer. It costs $5/month or .007 cents per hour. I used a coupon code, for $10, so I won't start paying for a little while.

For now, I'm still in the process of configuring it. Until I have something like a web server running on it, I have been shutting down the server whenever I am not actively working on it. I think this will save me some cents.

Oh yeah, like I said, I'm a dummy - so without understanding things, I also bought a domain name from google domains. It's jjjdddfff.com. I'm still learning how the server works, so getting a domain name is a bit premature, and money not well spent. Oh well, I guess it'll be motivation to get something working sooner than later.

What have I done so far

So far, I've followed some of digital ocean's tutorials and done the basics. I used ssh to connect to my virtual server from my home machine. I added a non root unix user that has sudo privileges. I added some firewalls.

Next, I plan on installing components for a web stack. And after that, who knows?

Spending Spree

Within the last couple of days, I have been on a spending spree. I bought:

There are so many free options on the internet, so I have always been reluctant to pay for anything. In the past, I've read and used resources right up to the pay wall, and then I go try something else. This strategy works. You can learn and improve in a lot of ways.

But recently I feel like I've hit the point of diminishing returns. I also see now that time is more scarce than dollars. So, I've decided to cross the pay wall for a few items.

I'll write some more details on each of the things I'm now paying for later.

Monday, May 30, 2016

Android MVP Architecture

On the never-ending journey to go from hobby programmer to professional, I am always on the lookout for good programming practices. A couple of weeks ago, I found a sample Android TODO app from Google. This app was created to demonstrate how one might organize and architect an Android application. In this post, I'll discuss what I learned from this project.

Android environment

I haven't done any Android programming in a while, so I had to spend some time getting my Android Studio, the SDK and other things up to date. After a few rounds of downloads, updating and restarting, I was ready to work.

I read that that the new version of Android Studio had some big improvements in emulator performance, but I didn't really notice much difference - things are still bad. On both the emulator and on a real phone, I ran the app without any issue. But the emulator performed terribly with the instrumentation tests. First, some of the tests failed only on my emulator. Second, the emulator took about 20 minutes to run all tests, whereas the phone took about 2 minutes.

It looks like I can do some developing with the emulator, but given my set up, it's still not really a viable solution. For now, I'll just move on.

File organization

When you build projects with Android Studio, it creates some folders and files for you. The top level of the todo app looks like this:

app/
build/
build.gradle
gradle/
gradle.properties
gradlew
gradle.bat
local.properties
settings.gradle
todoapp.imp

and that is pretty similar to all Android apps that I've created in Android Studio.

The major difference I see in this sample apps and ones that I have worked on is that there are a lot more src folders:

app/src/androidTest
app/src/androidTestMock
app/src/main
app/src/mock
app/src/prod
app/src/test

The main/ folder holds most of the code that is used in the app. It will be used in all build variants and flavors.

There are two product flavors listed in app/build.gradle, mock and prod, which correspond to two of the src folders. They both have files that define a class called Injection. This is a little interesting and new for me. The prod and mock versions of this class do the same thing except the mock uses a faked class, which is also defined in the mock directory hierarchy. So, depending on whether we are building a mock or prod version of the app, we will use real or faked classes.

This leaves three test folders androidTest, androidTestMock, and test. Based on the comments (I think): test defines unit tests; androidTest defines integration tests; and androidTestMock defined integration tests that use mock classes. I found this naming to be a little confusing at first, but I think I get it now -- since android is the instrument we're using, androidTest == instrumentTest.

Now that I have a handle on the file organization, I'll look at some code.

Model view presenters

This todo app is implemented using a Model-View-Presenter (MVP) architecture.

In android, things start in an Activity class, and it creates each part of the MVP app. For example:

  • TasksActivity is an AppCompatActivity
  • TasksActivity creates a TasksFragment which is the View
  • TasksActivity creates a TasksPresenter which is the Presenter
  • TasksActivity creates a TasksRepository which gives access to Task objects which is the Model

The Presenter is constructed with references to the Model and the View.

mTasksPresenter = new TasksPresenter(
  Injection.provideTasksRepository(getApplicationContext()),
  tasksFragment);

and the view is aware of the presenter, like so:

public TasksPresenter(  
    @NonNull TasksRepository tasksRepository,   
    @NonNull TasksContract.View tasksView) {  
  ...
  mTasksView.setPresenter(this);
}

This pattern is done for each of the different Activity's. Data from models are processed by the Presenter to be rendered by the View. Conversely, updates from a user can be sent through the View to the Presenter onto the Model.

Conclusion

This sample app is nicely organized and it's something I can emulate in my projects.

Sunday, May 15, 2016

End of Algorithms 2

After falling a bit behind schedule, I am almost finished with Algorithms II from Coursera. I have finished all of the prgramming assignments and all of the lectures. All that remain is the final round of exercises.

Like many worthwhile pursuits, I am glad that I went through the classes (both Algorithms I and II), and also happy that it is over.

There were a lot of things I think I gained from the experience. It gave me a good survey of lots of data structures and algorithms. I wanted to fill-in holes in my knowledge of algorithms, and I think that these courses have done just that. For all of the more advanced subjects, I need to take deeper dives, but I am happy that I have a good breadth of knowledge at least.

Additionally, since Algorithms is taught with Java examples, I got to work with a foreign language and its specific coding style and tool-set. While frustrating at times, it's fun to try new things.

And opposite the 'new', the lecturer shared many interesting historical anecdotes throughout the course. I'm not really big on history, but I think these little tidbits made the material a bit more colorful, which also makes it easier to recall things.

A bit of advice

Now that I am about to finish my second massive online course, I wanted to offer you (and future me) some advice about taking online courses:

  • If you start it, finish it. If you say to yourself, "I'll see how it goes", you will undoubtably quit.
  • Do everything. Watch the lectures, do the exercises, do the projects, participate in forums.
  • Set a time(s) in your day/week to do the work. Schedule it like an appointment that you can't miss.
  • Keep up with the new material and the deadlines (even if they're not really enforced).

What I am saying is, be hard on yourself. Don't let yourself have an excuse for not finishing the course. It's so easy to start and quit.

What's next?

I don't have any plans to take any other Coursera courses in the immediate future. I'll check in again later, but I don't see anything that I'd really want to invest time into for now. So, I don't expect to commit anything else this year.

Luckily, I have a nice backlog of study items that I want to work on. More on that later ...

Tuesday, April 12, 2016

Approach for Studying cppreference.com

My approach for reading the cpp reference materials is to start by reading each of the high level topics (ie each page that is directly linked from the main cppreference landing page. Once I have made a sweep of the high level topics, I'll go back to do more in depth reading of the lower level material.

There is a lot of material, so it is easy to feel overwhelmed. Even the basic concepts page has mentioned many things that I need to review/learn (like translation, parameter packs, and odr-used). I'll have to find the right balance of digging in and challenging myself to really know what I say I know, yet also moving on from a topic so that I don't become bored and frustrated and quit before I should.

I took a quick look at each of those unfamiliar topics I just mentioned and after reading just a little, things weren't nearly as initmidating as before. Translation is just a series of steps to go from the code we type into our text editors to a format that computers can run. Parameter packs are a group of parameters for templates. They are a somewhat newer feature of the C++ language so I don't feel so bad that I don't know them well. And odr-used is an awkward spelling/grammatical phrase describing the concept that things must have unique definitions (unlike declarations).

So this is the start of my cppreference reading journey. Let's see how it goes.

Friday, April 8, 2016

Week 3 of Algorithms Part III. Mincut/Maxflow

I finished the third week's work for Algorithms II from Coursera.

I flew through the lectures and exercises over the weekend. The first set of lectures was on Mincut/Maxflow, and the second set was on Radix sort of strings. It looks like we are wrapping up our work with graphs and restarting work on strings.

I think the mincut/maxcut graph search algorithm is tricky. One example of applying this algorithm is calculating when a baseball team is mathematically eliminated from the playoffs. The programming assignment was based on this baseball problem. It was trivial to complete (we just used an existing API that calculated the maxflow), but it was still hard for me to wrap my head around.

I'll have to review the graph data structure and algorithms more, but it's cool to think that I've learned all the basics. I've always found graph structures to be intimidating. It may be an oversimplification, but here's what I'd say about most graph problems:

- maintain a list of neighbors. 
- do depth first or breadth first search.
- for a given problem, maintain some auxillary data, 
  like previous node or current weight

and that's about it. I should review the material to judge whether that's really an oversimplification or not, but that's what I'm feeling now.

After the mincut/maxflow stuff, the lectures moved to sorting again. Oddly, we studied radix sort, which is rather trivial compared to the more complicated merge/quick/heap sorts. I guess we are transitioning to other string algorithms, so this just a step in that direction.

And now, the course has a break for one week. I will take the week to go over material and the given job interview questions. And, rest.

Sunday, April 3, 2016

Week 2 of Algorithms Part II. MST and Shortest Path

I finished the second week's work for Algorithms II from Coursera.

I had a three day weekend, so I was able to finish the lectures/exercises/programming assignment before the week even started.

We covered Minimum Spanning Trees and Shortest Path algorithms.

For Minimum Spanning Trees, we used Kruskal's algorithm and Prim's Algorithm. I have a hard time remembering what these algorithms refer to. Naming algorithms after a person is nice for that person, but it's a bit pointless. It's like naming a variable in a program after the original coder. It definitely wouldn't pass a code review.

In any case, Prim's algorithm works by doing the following:

Choose a node to start from.
Find the shortest edge that connects it to some other node.
Now, we have a two node component.

Then, repeat the following two steps.
1. From the component, find the shortest edge that connects it to an
   unconnected node.
2. Add that edge and component.

Kruskal's algorithm is a little bit different.

1. Sort the edges from shortest to longest.
2. Choose the shortest edge.
3. Use it if it is making a new connection.
4. Choose the next shortest edge and repeat from step 2.

I think better names for these might be, "NextBestNode" and "NextBestEdge".

Dijkstra's algorithm is an extension of Prim's algorithm where you consider the directions and weights to get the shortest paths.

A key idea in all of these algorithms is to keep building from basic tools. Use things like sorting, priority queues and depth-first or breadth-first iterations, along with some simple arrays for flagging changes and you can come up with some powerful algorithms.

This is demonstrated in the programming assignment. Using a shortest path algorithm with breadth-first searching we're able to do some rather cool image manipulation called seam carving.

This week was fun and cool, but I'll have to go back and review it all so that it really sticks with me moving forward.

Saturday, March 26, 2016

Studying cppreference

I have been writing programs in C++ for several years now, but there are many concepts that I don't know very well. My knowledge of the subject feels so shallow. I want to make a a concerted effort to fill in these holes. So, I'm going to commit to another goal.

I'm going to read each of the references documents in the Standard C++ reference, and then summarize them in my own words.

I like this commitment because it has a well defined ending. I think and hope it will be a worthwhile endeavor.

Update I have heard that the cpluscplus.com website may not be the best reference material to read. It seems like http://en.cppreference.com/w/ may be the more respected source. So, I'll base my studies off of cppreference instead.

See my reports below

Essential Fitness NYC

I went to go work out at Essential Fitness NYC. The trainer (Scott) was very kind and welcoming. I took the "Essential 7" class with two other students, who seem to be regulars at the facility. It was similar to personal training in that the trainer spent a lot of one-one-time with me. We did kettlebell swings, goblet squats, side steps with elastic bands, planks, and some stretching on rollers.

The objective for me to go to this class was to learn to improve my daily home workouts, and I did get some good pointers.

For kettlebell swings, I was instructed to plant my feet firmer into the ground, and to swing faster (my hip hinge should be faster). We also worked on my feet placement a bit (I was encouraged to try a more narrow stance). I'm sure there were a lot of pointers that Scott could have given to me, but he didn't want to overload me with too much information. The advice he gave made sense. If I get my base well grounded, it should help my swing.

For the goblet squat, the trainer gave me one good tip -- lower yourself slowly with control instead of just dropping. This makes squats harder, but probably more effective. I imagine I should do a similar thing for all exercises like push ups and pull ups.

Using the rollers was completely new to me. It seems like something I could get for my apartment, but I'll have to read more before I start shopping for one.

The most challenging thing for me was to get the breathing correct. I've seen and heard others do this coordinated breathing technique before, but I couldn't seem to get it right. I resorted to just taking regular breaths after I 'hissed' or breathed out. This will require more practice.

I think essentialfitnessnyc and Scott are great resources. Before I sign up again, I'd think I'd ask some questions to Scott to see if he thinks I might get more out of his other classes. I wish I could've had more time to work on other movements like the clean, snatch and so on ..., but it's probably the case that I have to learn to walk before I can run.

In my past, from programming to working out to learning anything, I've always favored just learning by myself. I think it was mainly because I was shy (and also broke/cheap). This year, I've forced myself to get some external help, which I hope will help me to improve faster and avoid mistakes. I'm not sure if I will go back to essentialfitnessnyc again, but I think it's good to continue to force myself to go out and get some external help from time to time.

Week 1 of Algorithms Part II. Graphs

I finished Algorithms 1 from Coursera a couple of weeks ago, and this week, I just finished the first weeek's work for Algorithms II from Coursera.

I tried to make the most of my time off between the two classes. I worked on an open source project, did some reading about building web applications and tried to study some other things. During this time off, I realized that I prefer structured classes. They help me to stay focused on the subject of study. With that said, I have to continue to push myself to focus on the material and my deep understanding of it, instead of allowing myself to be satisfied with simply getting the correct answers for the course.

I think some ways to improve my understanding will be to review and participate in the Coursera discussion forums. This gives me a chance to see how others (different from the course instructors) are thinking about the material. In the discussion forum, I can have the chance to approach things as a teacher, which will also help me to understand the material better.

So, onto my thoughts on week 1 of Algorithms 2.

This week, we went over undirected and directed graphs. Using breadth first and depth first searches, we were able to solve some possibly tricky problems like topological sort and finding strong components in directed graphs. The takeaway for me is to get very comfortable with depth and breadth first searches and to have a good mental image of what we get from each. With these two tools you can have a good chance of answering a question. Interestingly, it's a bit difficult to know at first glance how fast you might be able to solve a given problem. It's a lot less intuitive than guessing calculation times of sorting algorithms.

The lectures did an OK job of presenting the material. There were a few demos that you should watch (not just read through). The exercises were rather pain free. They asked you to trace through the steps of things like breadth first and depth first search.

The programming assignment, similar to ones in Algorithm I, asked us to work with existing implementations (this week, a directed graph) instead of writing an implementation on our own. I guess re-writing an implementation on my own can be part of my own self studying. The most time consuming part of this project was understanding the requirements (can there be multiple terms in a synset, is a word unique across synsets, etc ...) After I figured out what the requirements were, it was pretty straightforward to use the provided directed graph class to finish. I'm not sure if it really improved my understanding of Graphs, but at least it didn't take too much time.

Sunday, March 20, 2016

On Knowing

A concept that I will like to internalize is the following:

Know everything about what you say you know. Know a little bit about everything else.

Here are some case studies where this concept comes in handy:

  1. On prioritizing.
    You can devote more time and energy to learning the things you know very deeply. For other things, you can do more leisurely reading and learning.

  2. On working on a project.
    For the parts you know how to build well, you will create a very high caliber product. For parts you don't know well, you will know enough to hire an expert or re-use an existing library that is proven to work well.

  3. On interviews.
    People will often ask you what you know. If you say you know a certain thing, and then they find out that your knowledge in the subject is shallow, you look like a fool. For subjects that you say you don't know, having a general idea is usually sufficient to show that you aren't a one-trick pony. Having this mix of deep and shallow knowledge should prove to the interviewer that you are capable of learning any subject, as it is needed.

Bad interview

I found out about a new position at work and applied for it. I got an interview, but it did not go well.

I heard about the job on one day, did some light Q&A with the team members the next day and then had a technical interview the following day. I wasn't looking for a new job, so I didn't think a technical interview was on my horizon. The interviewer asked if I needed some time, but I thought waiting a day or two would just make me feel more anxious, so I said let's just do it immediately. That was a mistake. A little bit of review would have helped immensely.

The interviewer asked questions about basic things, like object construction and destruction, which I often take for granted when writing code. My focus is often on higher level details, like what would be the next best feature to develop for a client. Reminding myself of the basics would help me on interviews and would also help me write better code.

I also didn't have the right approach for answering questions. For questions that I knew the answer to, I didn't really explain things from first principles well. For questions that I didn't know the answer to, I just admitted I didn't know the answer. I think it would have been better to say something like,

"I don't remember the syntax and rules for this, but if it we assume it worked like this, then we could do this or that."

This would have let the interviewer know that I could think through problems and could move a problem along after googling for minor details. Instead, I allowed myself to get stuck in the mud too many times.

I think the final issue I had was that I simply got tired. I hadn't gone on an interview, or even taken a test, in years. The interview lasted about and 1.5 hours. After about an hour or so of talking, explaining, and thinking, I simply got tired. I felt like giving up on some questions a few times instead of digging deeper and deeper, even if I had more knowledge to share.

I doubt I got the job. That sucks, but that's completely my fault. I think with a little better preparation, I could've done a lot better.

I'm sad that I messed things up, and sad to have to continue on with my current job (I had already begun to daydream about moving on). The positive outcome is that I still have my current job, and learned (the hard way) how to do better on an interview.

Another opportunity will probably arise. I hope I turn this experience into a lesson that improves my interview skills for the next one.

Tuesday, March 15, 2016

First foray into open source with Proselint

For 2016, I challenged myself to contribute to 10 different open source projects on github.

I started looking for a project to work on by scanning through the list of trending github projects. I eventually decided to work on Proselint. The purpose of this project is to develop a tool that could analyze writing - it's a linter for prose.

I want to be a better writer, so a tool to improve my writing would be good to know about and to use. It would also allow me to 'dog-food' software. I like projects where I'm also the user.

Looking through the github page, there were a lot of existing small issues, many of which were tagged 'Easy'. I eventually chose to fix an issue where I would add a check that looks for paragraphs that start with the word 'But'. It seemed like a good balance of an easy problem that I could solve, but not a completely trivial code update.

I eventually made the code change, got my pull request accepted, and became an open source contributer. It was a really small update, but even still, I learned and was reminded of a number of things.

  • pip is a really cool package management program. I should incorporate it into my projects more.
  • regex is powerful. I shouldn't be afraid of it.
  • nosetests is a great way to run tests. I should use this more.
  • I need to figure out a good way to organize files/code better. Having a good structure makes things much easier to find and update.
  • Normally, gvim is my go to text editor, but for this new project Atom with the vim plugin might be a better option. It's much easier to navigate across files and folders and it has some auto-complete to move things along.

This was my first open source contribution adventure, and it was fun, inspirational (for me), and educational. For my next projects, I will look for a variety of projects (different languages, different applications, etc ...). I think the variation will teach me a lot.

As they say, it's certainly better to give than to receive.

Sunday, March 13, 2016

Feynman Method of Learning

I just read about the Feynman method for learning. The article describes it well, so you can read about it here. But in the spirit of the method, I'll try to describe it from memory now.

Start by writing the concept you want to learn at the top of the page.

Example: "How to learn with the Feynman method"
Why: I think this is important for getting you to focus on one concept instead of letting yourself get off tangent.

Describe the concept as if you are teaching it to a beginner.

This means describing the concept without using any subject specific jargon or relying on any other assumptions.

Why: This will expose holes in your understanding.

Go back to the source material.

After you discover holes in your understanding, go back to the source materials (books, lectures, mentors) and re-learn what you are unsure of.

Simplify

Describe the concept again using simpler words and analogies.

Why: This will ensure you have a deep understanding and you aren't accidentally, incorrectly assuming anything.

My takeaway

The methodology sounds good. I think the most important thing is being an active learner, instead of just being a passive observer.

Wednesday, March 9, 2016

Going open source

I have decided to commit to something new.

Before the year ends, I will contribute to 10 different open source projects. That's only about 1 project per month, but it's 10 more than I've ever done before.

I think it will be an interesting challenge. It will force me to be exposed to many new projects, and their unique coding/project styles. I'm sure this exposure will give me new ideas and make me a better developer.

Of course, the other possible benefit is that I'll be contributing to the open source world. Hopefully some good comes out of the that.

Updates
1. March 15 - Created a module for Proselint. See blogpost about it.
2.
3.
4.
5.
6.
7.
8.
9.
10.