EOY 2014

Whew. I thought 2013 was fast. 2014 was bananas. I think I’m a bit rusty from not writing as much as I ought to, so let’s just jump right in!

Grad School?

In February, I received a letter of acceptance from my absolute dream graduate school to teach high school mathematics. In what has become a theme, it was something I’d worked incredibly hard for over a long period of time to achieve, and I actually made it. I knew what I would do before I even got the letter, but that didn’t actually make it any easier – I turned them down, not only because it would have increased my debt by 130% from what is already a serious amount of money, and not only because I never would have made anywhere near enough to have repaid this ~$100k of loans, but for a host of other reasons as well. With a heavy heart, I emailed my amazing advisor and advocate at the school, a nearly two year relationship, to let her know I wouldn’t be enrolling.

So I threw myself into computer science study. With PyLadies, and my last quarter of school to complete my French degree and Math minor, I busted the proverbial it to get a job, which I did, literally the day I was done with my final FINAL exams, hopefully ever : )

Interne-towne

The job started as an internship with lots of hands-on pair coding with my boss, “how would you solve this problem,” “let’s refactor together,” along with some “hey would you reach out to this person to sponsor (x),” which was great! I got to use a way nicer computer (macbook O2) than I had (a lovely old giant brick of a PC laptop on which I installed Ubuntu 12.04), and I finally started using git at the command line. It became pretty quickly evident that we worked together fabulously, and we started to think about what kinds of projects we could do together, so we started working on new ideas, largely centered on education. It was, actually, an incredible collaboration.

We thought topics and people for Security in Python, Data Science in Python, Twisted, Django From the Actual Beginning, and a few more that I’m sure I’m missing – it was rather a fire-hose of ideas! My boss was the kind of person who had six good ideas before breakfast, and it was a fast-paced, sometimes stressful, REALLY productive space for six months.

While there, I learned git to a granular degree and now lead a monthly workshop on it and plan to lead/teach the PyLadies annual course on it as well, and while I didn’t improve my Python chops much, I learned a lot about how computers are really working, under the hood – well, under a relative hood, I got into no hardware, lol, not at all. The os and sys modules, jeez! I’ve been saying lately that it’s those two modules that turn Python from an expensive calculator into something really powerful.

Codecademy played a little role, too, as you can see if you search the javascript tag on here – while I don’t code in JS, it’s a fairly ubiquitous language & I’m glad to have some familiarity with how it handles different kinds of problems.

I also, god-willing, learned a bit of project & people management the hard way. I don’t ever want to do that again, hooray! It’s good to know, especially considering that women are often directed from engineering career paths to soft-skill positions – now I know what to push back against.

Tutorial Creation

We settled into a Python tutorial with a local $TOPIC_IN_PYTHON expert, and worked really hard on outlining, scoping, creation, refinement, refactoring, presentation, program executability, git monsters, project jupyter/pip/virtualenv & dependency concerns, and so many other logistical issues.

After we flew to the place to film it, the company we’d signed the contract offered a counter-contract, letting us off the hook, and decided not to publish it after all. While honestly heartbreaking, there was a serious amount that we all learned.

UNEMPLOYMENT OH NOES

While scrambling to find a new gig after my internship ended, I stumbled on a number of really awesome opportunities, and though I only was offered one – obviously I stopped looking once I got an offer – I met and now keep in touch with many of the folks I interviewed with, because while it didn’t work out, these are all really neat people at really cool companies, so that has been really validating.

I was strictly unemployed for all of two weeks before I got an offer from Puppet, where I’ve been since mid October, and totally in love with my job. 2014! WOW.

2015?

This year, I will be learning the ins and outs of system administration, I’ll become Puppet certified, I’ll learn Ruby, and I’ll be dipping my toe into web app development as well, all while being part of the neatest leadership team of ladies ever with PyLadies PDX. I think I’d like to get Red Hat certified, or close to it, as I’ve come into Puppet without any sys admin background, and that’s something I’d really, really like to be good at at the new spot. I continue to be amazed by how well I am treated in my new career and how much I can do for people, even while clawing at so much more – frustration at the not-knowing-enough is a constant underlying anxiety for me at the new job, and I suspect that will continue for some time, and which in fact is a good thing. Studying math, and trying to stay aware of what’s Going On in tech, is a pretty good primer for the huge amounts of Not Knowing involved in working in tech, for probably at least the first few years.

WHOO! Onward and upward, or as they say, “Up and to the right!”

Advertisements

Lesson 43

Ok, it’s starting to get pretty complex! As best as I can understand it at the moment, a class is a a sort of super structure that can be used more flexibly than can a simple function, that other variables and structures can be flexibly swapped in and out of. I am fairly lost on a good amount of the syntax, like the __init__ and the self.name = name, to name a few. But I’ve decided to go ahead and start copying in the code for this exercise, though I don’t entirely understand it yet. Evidently it always takes a long time to really grok OOP. So that’s ok.

Some things I notice: The classes call a generic object seem to be hierarchically above others, e.g. class Scene(object) (rather than class Death(Scene) which calls Scene()). I don’t know if this is important or not, but it is how Zed’s exercise is going.

And at this point, I’ve pushed through, even not being totally sure of what I’m doing, and punched in all the code, learning snippets here and there, and I’ve checked it all over, and it doesn’t run. I am frustrated. I have read the last few exercises several times where he has started discussing classes and object-oriented programming, and I’m really not getting the hang of it. Someone told me, when I shared that I was trying to start learning what the meat and potatoes of modern programming, OOP, really is, that it took learning another language before he really grokked what the deal was. Barring that, I just keep trying to read about it. I know I can get it, but I don’t have it right now, and I can’t finish this lesson of LPTHW, and I’m frustrated. So I shall move on and try to come back later.

Lesson 41

Oh, wow, Exercise 41. This is great. The code is complicated and I’m still working through it, with gems like:

for sentence in snippet, phrase:
result = sentence[:]

Wow-ee, why is there a colon between the two brackets!
EDIT: This was a CSQ! Here’s what Zed sez:

What does result = sentence[:] do?
That’s a Python way of copying a list. You’re using the list slice syntax [:] to effectively make a slice from the very first element to the very last one.

Also, don’t forget this lil guy:

PHRASE_FIRST = False
if len(sys.argv) == 2 and sys.argv[1] == "english":
PHRASE_FIRST = True

argv is used to import a file, so I can only guess that it is related to the url that the module urlopen imports. the len operation is easy enough to parse, but I don’t really know why sys is in there. [Edit: duh-doy, sys is just the imported module and sys.argv calls it.] The rest of it, honestly, I have not much idea about the rest of it other than the fact that we’re using some Boolean conditionals.

At any rate, while some of the code is confusing, it became significantly less so once I ran oop_test.py. It’s a test! As in, guess the right answer test! It scrapes the text of this learn code the hard way list of words to make up class names in order to ask what the relation is amongst all cited.

I am going to spend some time with this! The test itself is enjoyable to run. And THEN I shall try to really scrape some understanding of the code into my noggin : )

Edit: THIS IS MY TWENTIETH POST!! HOORAY!! wow!

Lesson 38

In this exercise, we play with splitting, adding to lists, & the join function, referred to in this stack overflow post as the inverse of the split function.

split cuts up any old text string, like mary had a little lamb and turns it into a formal list, like ["mary", "had", "a", "little", "lamb"], with each word made into an indexable (numerically anyway) item in a list, via the format of stringofwords.split(" "). I’m not toooootally square on the quotes in the formatting of the use of split, but I can punch it in well enough til I grok it fully.

join depends on the same structure of listofitems.join(" ") to de-string-ify it. Handy!

There’s a bit also with, hmm, how do you call it, positional list comprehension, maybe? For example in the previous given list, the ["mary", "had", "a", "little"} et cetera, position 0 is the very first one, mary, where position -1 is the very last, little.

This was a good one! I think the exercises will stay challenging through the next thirteen : )

Lesson 36

Lessons 32, 33, and 34 were list comprehension and conditionals like if/elif/else, for, and while, all of which I feel fairly comfortable with. Exercise 35 was an application of these ideas in the form of, woohoo, a text-based adventure game! This one came in a bit longer at 76 lines, which I honestly love copying in. He had a few handy tricks that he hadn’t talked about, like the exit(0) which kicks you out of the program, and a few clever nestings and conditionals, like the combination of the boolean in one of the “rooms” with a while and an if/else.

Rather than give each of those its own post, since I don’t have much to add having learned those functionalities long ago, I moved over them so I could advance a bit more quickly. In exercise 36, he asks for a unique game! So I made one! Woo-hoo! After a not too long trial and error period, I came up with the following game, of which the following is probably the most representative output that I got when I had someone else play it. Check the repo if you’re interested in the code! the output is more fun anyway : )

WELCOME TO THE DUNDJEL
you can go north and south. maybe other directions?
> north
You carry on your dumb way north, dummy
You went north! That's probably fine.
You see an A and a B, and also a button.
> a
yeah, you only have so many options, here.
nice that you think I'm smart enough to come
up with more stuff, but I haven't.
> b
yeah, you only have so many options, here.
nice that you think I'm smart enough to come
up with more stuff, but I haven't.
> A
consider all of your options my friend.
but not today, for today you die.
you lose. you see a howling hag:
SHE'S A WIIIIIITCH
BOOOOO. BOOOOOOOO!!

It makes me laugh which is really all that I’m looking for in my own text-based adventures. There IS a way to win, but it doesn’t look like they made it!

Hey, quick sidenote, have you seen Depression Quest? It’s eligible for Steam Greenlight, and it, well, my description won’t do it justice, the concept is amazing & you should just go take a look.

Lessons 29, 30 & 31

Hey-o, conditional statements! I breezed through a bunch of lessons because we’re getting back to the kind of programming that I have already learned quite well. For the novice, my blog will not be as helpful as it may have been for previous lessons. The issue is that I am super ready to finish LPTHW!

For Exercise 29, he introduces conditional statements, the results of which I could see as I typed them in.

people = 20
cats = 30

if people < cats:
print "Too many cats! The world is doomed!"

if people > cats:
print "Not many cats! The world is saved!"

Basic less-than/greater-than operators – clearly the world is doomed! That’s about all there is to this exercise. (Ed: T.I.L. that less than and greater than symbols have to be inserted into with & l t ; and & g t ;, respectively! Awesome!)

In Exercise 30, it’s the same thing but introducing, hmm, subconditional statements you might call them? Rather than just if and else there’s also elif which takes its place before the final else in which you can make a further conditional statement within the if statement. This has been one of the handiest things I have learned (though I learned it long before this lesson) in Python, and it has analogues in every other programming language as well. Very cool.

In Exercise 31, the conditional statements get wrapped up in a “game” in which your player gets to choose from various options, to either be driven mad by Cthulhu or ripped apart by a bear. HMMM, which would you choose?? The purpose of this lesson is to start getting the student comfortable with nested if-statements. Old hat for me – I need to move a little faster!

With that, I think I need to go through these lessons a little more quickly than I want to blog about. I will write another blog when I come up against something that is truly new to me. I know Zed Shaw has challenges for me yet!

Lesson 28

Hoo-woo-woo-wow, Lesson 28 was a zipper, but I imagine that is only because I took Discrete Mathematics about a year ago, in which boolean logic was beaten into us : )

I thought this truth determination was especially funny to find. Can you find the correct truth value?
"chunky" == "bacon" and not (3 == 4 or 3 == 3)

I got them all right! Moving on, breakneck pace my friends! But really, I want to get back, so badly, to “copy this in & solve a problem.” I looked ahead a bit & I think the next one is like that. Oooooh I hope!