My Skills, My Strengths, My Weaknesses

I’m beginning to actively seek a job/internship/mentor as a (Python) developer. To be forthcoming, I’m outlining my ability here. I think I’m a good fit for some roles and not for others. I haven’t been able to talk shop with many developers and it’s hard to find metrics to measure yourself by in the coding world–mostly it seems like you just make something and get noticed for it.

I see a lot of jobs asking for “brilliant,” “amazing” developers. I’ve had my IQ professionally-assessed and I’m not embarrassed of it, but I don’t “own” brilliance. I’m smart, and I’m determined. I stick with problems. I’m not always brilliant, but I get it done.

 

General Programming

I can make things. I’ve made lots of  CRUD apps. I’ve never moved sprites around the screen, but I can learn, quickly. I’ve done the first 50 Project Euler problems. My code is pretty clean. My app structure is probably not, unless required by frameworks. I like small, readable functions. My git skills are rudimentary. I love optimizing and clever code, but I’m not real familiar with “big O” and the like. My optimization is on a smaller, “common-sense and small improvements” scale. I haven’t done social integration, or worked with any 3rd-party APIs, but I think I’m already capable. I have to reference docs a lot. I don’t mind referencing docs. I’m a stickler for details. I can do FizzBuzz. I read programming blogs (love codinghorror, codingthewheel among others). I click virtually every Python link that makes HN. I read stackoverflow in my spare time for fun.

I currently code in a Linux environment, Vim (with very few mods) being my editor of choice.

Generally speaking, I’m no world-beater, but with less three months of full-time coding, I feel I’ll be a strong player in a web-app environment.

Here are some paragraphs being more specific:

Python

I’ve been coding in python for a few years now, however not in any real serious capacity. I’ve done a couple of trivial desktop applications using Tkinter and a couple of decently-sized web apps, mostly CRUD apps. I spent quite a while working on a port of an existing mess of disgusting code from PHP to Python, before I parted ways with the company. I’m no prodigy, and I have to reference docs a lot, but more exposure will definitely fix that. I can get things done, I just might take a while. I’ve completed the first 50 (and a handful of other) Project Euler problems in Python. For many of them I’ve done several versions, delving into optimization of my algorithms. I like to think I’m employable–I’m no lead/senior developer, but I can hack away at the small stuff. I’d love an entry-level job, and I’m certain my skill will increase to a high level in a short period of time. My very favorite feature is list comprehension. I like “one obvious way.” I think Python code can be beautiful in ways that other languages can’t replicate.

Django

Quite related to my Python entry above, but I’ve done a few trivial web apps in Django. I understand the basic flow of things, though I haven’t delved too deeply into things like middleware except when requirements led me there. Most of my web development happened in PHP prior to me being exposed to any frameworks. When I found them, I found Django first. It compelled me to learn Python because I was so taken with the idea–frameworks make me warm and fuzzy inside. I love the structure, I love having the basic outline of “what goes where” planned and accounted for ahead of time.

http://husng.sejje.net/ is a simple poker tool that I wrote using Python/Django.

Version Control

I have limited experience with Mercurial and Git. Limited in the sense that I’ve just used them for a couple of small personal projects, to learn them. I’ve never deployed with them, nor managed a complex app. I’ve been a linux user for over a decade, though, so I don’t have any problem adapting to command-line tools. I just need some hands-on to become more familiar, and probably a few minutes to add some aliases to my bashrc.

HTML/CSS

Self-taught HTML while in high-school. This was in 2000-2001, when people used frames and tables for layouts, and iframes were just becoming popular. CSS came later, and to me was an amazing gift bestowed by geniuses–it was the same feeling as when I first found php, so that I didn’t have to maintain a layout/menu in 25 separate HTML files. Design is not my forte, however. My HTML/CSS tends to be extremely functional: display the info in a more-or-less readable fashion. I grok HTML, and old CSS. All the new stuff, though–HTML5, CSS3–is relatively unknown to me. I can hack it together, but this is not my main interest. The box model is my arch-enemy, it never just goes where I want it.

PHP

I found PHP directly after I ported my site to use server-side-includes. I was so amazed that I immediately commenced an entire rewrite of my website. Databases were extremely powerful and superior to file-based-storage in so many ways. I’ve seen a LOT of php code, and coded 10+ CRUD apps using it–all relatively small by today’s standards. One site used CodeIgniter, though I feel I’m more competent than that might show–I have some experience with non-PHP frameworks, so I mostly “get it.” I haven’t used PHP much in the last couple of years, so it’s possible that my knowledge is lagging some, and I’ll be rusty with syntax.

One of my PHP sites is up at http://lmfao.us/, though I have no control over it any longer as my partner died quite a while ago and although someone (unknown to me) is renewing the domain (he controls it), the site is just languishing. It has auto-thumbnailing (intervention optional) and watermarking in the admin panel.

MySQL

I’ve used MySQL in quite a lot of projects, but they were all CRUD and had no use for scaling. I’m functional for sure, but I’m not knowledgeable in any advanced SQL. My SQL looks mostly like this:
“SELECT user, id FROM users WHERE location=’USA’”

I’m not able to troubleshoot MySQL performance issues beyond common sense: make fewer calls, use Google. Like anything else, though, I can learn this quickly–it has just never been necessary.

For two years all of my exposure to MySQL or any database has been abstracted through the Django ORM, so I’m pretty rusty at raw SQL.

 

Strengths:

I learn quickly, and thoroughly.
I like to understand how things work, which leads to intricate knowledge.
I’m smart.
I express my thoughts well, in both written and oral language.
I mesh well.
I have essentially zero worldly obligations, excepting a girl I can’t be without. No pets, kids, debts, homes.
I like hard problems.
I have staying power, I stick with problems.
I love coding.
I have opinions.
My word is good.
Passion comes easy.
I like good music.

 

Weaknesses:

I can’t design.
I can’t even match my clothes, except by rules I’ve been taught.
I avoid confrontation, sometimes at the expense of something important.
I don’t know Apple.
I’m not “colleged.”
I sleep a lot.
I hate voice calls.
I don’t like beer (but can definitely handle a mixed drink), coffee, energy drinks.
You sometimes have to dig for my opinions.
I miss pop-culture references.
Floating the box model.

Accept.

I keep looking for meaning, but all I’ve found so far is that in order to be at peace with the present, we must be at peace with the past, because the present is a product of the past. Accept. Accept. Accept. Learn to love the present moment. What happened, happened. It’s difficult to understand the big picture when our lives are mere brush strokes on the canvas of reality. Trusting that it all fits together to form something beautiful is the purest form of faith. Anything else is a dangerous distraction. No contracts with God, no expectations of reward, just trust.

Paul Buchheit

And that’s where I am. I have my hopes set high, and I’m not prepared for failure. But here, now, in this moment, I have to accept the path that led me here. I’m undeniably here. I want to rise like a phoenix from these ashes, carrying my prize with me. Able to because of my new-found strength. But I’m just choking on the ashes, floundering.

But I think that the ashes in the air will subside. Things will be beautiful, because we went down this path for a reason. Unbeknownst to us, something beautiful is being painted. I can’t wait to see it, quite literally–my innards twist in ways I’ve never known, in anticipation and at the memory of their own shortcomings. But my new-found strength comes from them–my heart works in ways it never worked before. And in that terrible pain it can now feel comes its salvation–it has become what was needed all along.

I pray the ashes will subside. I want to push into the sunlight.

My Development as a Developer

tl;dr:
I’m mostly a hobbyist. I’ve made a couple of “application”-sized websites with HTML/CSS/PHP/Python/MySQL. I’ve made a lot of little “tools” with GUIs for windows. I taught myself all of it, and so in many areas I know just as much as I need to.

I’ve been coding a long time, but never in an overly-serious sense. I like to make things, or I have an idea that I want to pursue that requires some coding. But it goes way back.

My first computer experience was on a DOS/Win 3.1 system when I was maybe 10. It was my older sister’s, and she didn’t know much about it. It had basic and a few games, and I inspected them and found out roughly how they worked. I don’t have what I made, but I remember lots of GOTOs. I liked text-adventure games (Zork), and tried to replicate those. But I only had access in the summer, and I also had Doom distracting me.

Fast-forward six years and I get my first computer around age 16. I had been on AOL with some buddies and already knew that I wanted a punter, and a chatcom, and whatever. I found my way into the “vb6″ chat, and eventually acquired dos32.bas. I made a lot of dinky little programs. An mp3 player (with a custom shape, not square), an “AIM bank” to store all of my AIM handles, a chat-com, etc. I was fascinated by sub7, and learned sockets and made a similar remote-control type client/server. Later I found out about affiliate marketing, and to make a long story short, I made a chatlinker (it spammed my link) and a really non-obtrusive website that mostly didn’t get me flagged for spam. I made probably $6500 in my junior year of high-school.

Somewhere in that same time-span I made an angelfire-hosted Goldeneye fansite. I taught myself HTML in a couple of weeks. Back then frames were all the rage. Animated gifs, hit counters, “guestbooks.” I eventually made a personal site. Now it’d be considered a blog, but back then we called them “Everything/nothing.” I learned about server-side-includes, and they blew my mind. And about a week after I finished implementing them, I learned about PHP–it was pretty new. I rewrote my whole site, and used a site called gyrate.org as inspiration. I made a user-system, where users could earn points by contributions–comments, votes, etc. They could spend points on things like front-page posts. I also had a “neverending story,” which was like a choose-your-own-adventure story, but if you came to a dead-end you could write a page in the book. I had a pretty active userbase of around 300 people, until my domain was squatted.

For a large period of this time, I used linux as my main desktop OS. I started in Mandrake, mostly used Debian, and eventually moved to Ubuntu and now Arch. I wrote some shell scripts and learned some basic sysadmin. I set up my own LAMP stack, got a DNS server up, mail server, etc.

I got away from coding at this point, but I would still sometimes find a reason to start a project. I played professional poker, and I made a program that would automatically seek out bad players and sit in their games (but I played manually). It interfaced with the Full Tilt Poker client, and looked players up on Sharkscope, scraping their stats out of the JSON.

Another project was a funny image site. Initially coded in PHP/MySQL, re-wrote later in PHP using CodeIgniter. I later started a Python/Django rewrite for fun, but never finished.

Since then I’ve worked on a few smallish projects, but still nothing very serious. I’ve had some ideas for startups, and I’ve done some workups in Python/Django. I love Django and basically everything about it. Frameworks would have kept me developing nonstop–they take away so much of what was boring to me about developing.

I’ve done a lot of Project Euler problems–I enjoy them, they’re like logic puzzles, and they’re teaching me a lot of new python concepts as well.

I’m trying to push my skills to “employable” and work on a project I love.

Project Euler – Problem 13 in Python

Problem 13 requests:

Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.

Some euler problems almost look like programming exercises. There’s nothing special about this problem whatsoever, it feels like a basic file-reading exercise.

So, I stored the numbers in a file.

Opening files in python is pretty simple:

f = open('13-numbers.txt', 'r')

The ‘r’ just means “open for reading.”

Then you can loop over the lines like this:

for line in f:
    num = int(line)

In this case, the line is a 50-digit number (that python still things is a string, so we convert with int() ).

Sum up all the numbers, and then to find the first ten digits you convert back to string and use a splice:

str(total)[0:10]

Project Euler – Problem 12 in Python

Project Euler Problem 12 deals with factorization, so it’s important to get a pretty efficient function to do that. The problem reads:

The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:

1, 3, 6, 10, 15, 21, 28, 36, 45, 55, …

Let us list the factors of the first seven triangle numbers:

1: 1
3: 1,3
6: 1,2,3,6
10: 1,2,5,10
15: 1,3,5,15
21: 1,3,7,21
28: 1,2,4,7,14,28
We can see that 28 is the first triangle number to have over five divisors.

What is the value of the first triangle number to have over five hundred divisors?

So, I created a “factor” function that returns all the factors of a given number. I’ll save you the trouble of finding it later, and let you know that this is a useful function (for Euler) that should be put in your re-usable toolbelt–in my case, euler.py.

Here’s my most efficient example:

def factorize(num):
    factors = [1, num]
    for i in range(2, int(math.sqrt(num))+ 1):
        if not num % i:
            factors.append(i)
            factors.append(num / i)
    return list(set(factors))

So we fill the list with 1 and the number, and then check remainders with modulus (%) for all the other numbers up to the square root. That’s as far as we have to go, and we’ll use 36 as an example to see why:

start with [1, 36]
check 2, find [2, 18]
check 3, find [3, 12]
check 4, find [4, 9]
check 5, fail
check 6, find [6]
Done.

So even though we only went to six, we were able to get 9, 12, and 18–numbers greater than six. Any number greater than six will have a corresponding factor lower than six, so for max efficiency we don’t go any higher.

Moving on, it’s now a fairly simple matter to check each triangle number for X number of factors, in this case 500.

First, I imported my factorization function:

from euler import factors

Then I made a function to find the first (triangle) number with X number of factors:

def first_triangle_with_divisors(num):
    '''
    Find the first triangle number with
    at least num number of divisors
    '''
    count = 1
    triangle = 1
    factor_count = 0
    while factor_count < num:
        count += 1
        triangle += count
        factor_count = len(factors(triangle))
    return (triangle, factor_count)

Walking through it, we start with

count = 1

so we can determine the next number that has to be added–it allows us to make the triangle number sequence. We set
triangle = 1

…our first triangle number. And then we set up a spot for the factor_count, so that we can set up a while loop with it.

The loop will iterate until

factor_count > num

…with num being an argument the function accepts. We could hard-code this to 500, but I set it as a variable so that I can run the known case (28 is the first number with > 5 factors) to verify working code.

This code fails in one case, if you input 1 for num. It’s trivial to fix, but doesn’t matter for our application. To fix it you would just insert, at the beginning of the function:

if num == 1:
  return (1, 1)

During each loop, we increase our count, and then add it to the previous triangle number to get the new one. Then we call our factors() function on the new number, which returns a list of factors. We count them with len() and only finish if they’re over our target.

The end of my file just has a couple of cases:

print first_triangle_with_divisors(1)
print first_triangle_with_divisors(6)
print first_triangle_with_divisors(500)

And returns the correct answer.

We can speed the function for large numbers. It’s hard to be perfect, and probably harder to prove mathematically, but it makes a lot of sense that the first number with 500 divisors is probably divisible by both 2 and 3, and possibly 5 which will give it a lot of “extra” divisors.

On my machine this runs in about 10 seconds, and it’s cut fairly drastically by including an extra line:

while factor_count < num:
        count += 1
        triangle += count
        if num < 100 or num > 100 and not triangle % 2 and not triangle % 3:
            factor_count = len(factors(triangle))
    return (triangle, factor_count)

This simply means we’ll skip our most time-sinking function, factors(), if we need a high number of factors and the triangle is not evenly divisible by 2 and 3. This ONLY works if you need the FIRST number that qualifies, because you will eventually run into a number, I think, with 500+ divisors that is not evenly divisible by 2 or 3.

Of note:
Do some research on whitespace. I had an invisible error, to the naked eye, that cost me an hour of frustrating debugging–my factor function was exiting early and I couldn’t figure out why. Some weird whitespace accident with Vim, my editor of choice.

March 2012 Pool Winnings

Total: +$280

03/16/2012: $5 entry singles at 3Bs. $5 sidebet with J.O. in finals. +$100
03/07/2012: Chopped free tourney with Gary Plymale, even though I would have to beat him twice. +$70
03/03/2012: Played 2 $50 sets with J.O. Went 1-1
03/03/2012: Bet $10 on the side with J.O. during tourney.
03/03/2012: Won the free tourney. Never lost a game. +$100

Project Euler – Problem 10 in Python

Project Euler Problem 10 reads:

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.

Find the sum of all the primes below two million.

This is really a cinch. We already have established a sieve generator for prime numbers in Project Euler Problem 3 in Python, and hopefully by now you’ve done the helper “homework” function to map the grid to a list. So we just run it for 2,000,000 and then sum them. The built-in

sum()
sums a list. So a one-liner, using your own function name for the helper:

print sum(prime_list_numbers[2000000])

Project Euler – Problem 9 in Python

Project Euler Problem 9 reads:

A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,

a2 + b2 = c2
For example, 32 + 42 = 9 + 16 = 25 = 52.

There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.

Natural meaning “whole” or integer.

Well we start out with nested ranges:

import math

for a in range(1, 500):
  for b in range(1, 500):
    c = math.sqrt(a * a + b * b)

This looks like a good candidate for list comprehensions, and I tried them, but it gets a little messy. I really think this is a lot more legible. And with such a small range, we’re really not worried about this taking too terribly wrong as all the functions are math and comparisons (FAST).

So, to continue:

    if not c % 1: #making sure we have a natural number
      if a + b + c == 1000:
        print int(a * b * c)

Not too bad!

Project Euler – Problem 8 in Python

Project Euler Problem 8:

Find the greatest product of five consecutive digits in the 1000-digit number.

73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
30358907296290491560440772390713810515859307960866
70172427121883998797908792274921901699720888093776
65727333001053367881220235421809751254540594752243
52584907711670556013604839586446706324415722155397
53697817977846174064955149290862569321978468622482
83972241375657056057490261407972968652414535100474
82166370484403199890008895243450658541227588666881
16427171479924442928230863465674813919123162824586
17866458359124566529476545682848912883142607690042
24219022671055626321111109370544217506941658960408
07198403850962455444362981230987879927244284909188
84580156166097919133875499200524063689912560717606
05886116467109405077541002256983155200055935729725
71636269561882670428252483600823257530420752963450

So we’ll enter the number, take every 5-character section and find the product.

record = 1
for i in xrange(0, 995):
  total = 1
  portion = number[i:i+5] #pull out the section
  for x in range(0, 5):
    total *= int(portion[x])
  if total > record:
    record = total
print record

So record is our place-holder for the record-setting number. We go 0-995 to find all the possible starting spots for 5-character-length strings. We find a product and compare to our previous record. I didn’t show setting the number, it’s set as “number” and I just didn’t want to repeat the 1,000 digits. Brute force FTW as usual.

Project Euler – Problem 7 in Python

Project Euler problem 7 asks:

By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.

What is the 10 001st prime number?

This isn’t that difficult of a problem. We’ve already implemented a sieve in Project Euler Problem 3 in Python. If you completed the “homework” and made a helper function that converts your grid into a list, this is a no-brainer. And that may feel like “cheating” to newbies–it’s not! You should, at every opportunity, re-use existing code that already does what you need.

So this is a 2-liner. Import your (helper) function, and print the 10,001st member of the list (located at 10000, because 0 is the first)

from euler import prime_list_numbers
print prime_list_numbers(500000)[10000]

Of note: “euler” is the name of my file where I keep my reusable functions. Yours is different unless you also used that name. prime_list_numbers is the name of my function which makes a list of all the primes up to N. And 500,000 is an arbitrary number I chose that seemed high enough to ensure I got 10,001 primes (and in fact, there were over 41,000).

So there it is!