24 October 2014

Hackbright Day 19: Magical SQL Python Gnomes (but not GNOME as in RIP GNOME 2)

Today we talked about SQLAlchemy, which is a SQL handler for Python. It's called SQLAlchemy because it's basically magical if you don't know how SQL works and it's still pretty spectacular if you do. It basically takes ugly SQL calls and turns them into things that look way more like python syntax. SQLAlchemy is called an object-relational mapping (or ORM as people call it) program. In SQL, we have databases that contain tables. These tables have columns that contain different kinds of information for a given record (or row). What SQLAlchemy does, is translate the python we input so that SQL can handle it. It does this by essentially mapping a table to a class, a column to an attribute of a class, and a record (or row) to an instance of the class. It's really nice, the syntax is mostly familiar (although the OR and AND statements are a bit weird), but it seems pretty useful. The other cool thing about SQLAlchemy is that you can use whatever SQL "engine" that you want. We're using SQLite with it, but I'll probably look into things like PostgreSQL for my project.

Speaking of projects, we talked about project selection today. As of a week ago, I had a project that I was dead set on, but then I started working on other things on the side and found out that i was way more interested in that than the one I was originally going to work on. I'm still not sure what I'm going to do, but I'm looking into the new, exciting project right now because I think it will be a better way for me to display skills in areas that I'm interested in, rather than work on a project that I think should exist, but isn't the type of coding that I'm interested in (oh my god. back end. god help me if I have to do a ton of front end coding in my career).

We talked a bit about other projects that people have done during the 5 weeks leading up to career day, and one thing that came up was called Flattest Route, which works with the Google Maps API to determine which is the least hill-climby route you can take to get from point A to point B. As an example, here's my walk from the bus stop to the house we're staying in. The route is color coded to indicate the steepness. Green is easy, yellow is moderate, blue is difficult, red is very difficult, and black is basically mountain climbing.

Sometimes I wonder if i should get crampons to walk up this hill.

The other super awesome thing that happened was that I got to meet up with a friend from high school at lunch. We're going to be on a hackathon team this weekend to try to best display asteroid data for fun and not profit. Hopefully we'll be able to hack something together that looks awesome and is super informative.

Not these gnomes either

23 October 2014

Hackbright Day 18: Study hall, with pictures!

Today was a "study hall" day. We ended up talking about how to use flask as the server to a web app that then rendered HTML pages. These HTML pages (along with their CSS) were manipulated by jQuery and AJAX calls to display things we wanted. In order to demonstrate this linkage in the clearest way possible, we added a random number button to the web app we worked on yesterday, just to show an example of how everything works together.

This is my super awesome graphical interpretation of what we did in lecture all morning.

Later on, I met up with one of my mentors and we started talking about how I could structure my project. And then I mentioned my pet project and now I'm starting to wonder if that's what I should actually pursue. I need to do a little bit of legwork to see if it's possible, but that project might be closer aligned with my technical interests than the other project idea I have.

In the afternoon, we had another lecture on cookies and sessions. Browsers store cookies. Sessions are server side. Sessions need cookies to store information from the browser. I think? I need to look into it a lot more. After I finished up the last part of the assignment from yesterday, I lost all will to work, so I updated my LinkedIn page a little bit. It turns out that I'm not very interesting and almost all of my "endorsements" are for things that are probably not relevant to the jobs I'm looking for, so it was probably just a good way for me to feel productive without having to think too hard.

22 October 2014

Hackbright Day 17: Wherein I fundamentally misunderstand jQuery

Today was challenging, and I'm going to blame my inability to quickly digest syntax and the fact that I haven't been sleeping for more than like 5 hours per night. I'm usually fine on little-to-no sleep, but now that I'm old, I need to sleep for like 6 or 7 hours at least every once in awhile. Lame.

We talked about jQuery and AJAX today. jQuery (and I'm probably stylizing the name wrong, but whatevs, I wasn't even going to post tonight) is a javascript library that lets you do things in a much more succinct way than "vanilla" javascript. It seems like it's used in conjunction with AJAX to modify the HTML + CSS on the fly, make get and post requests (I'm still fuzzy on post syntax), and generally interact with different parts of your webapp. The fact that this is about as specific as I can get with jQuery and AJAX means that I definitely failed in absorbing the lecture this morning.

And now I need to PTFO.

And here's a picture of two motorized wheelchairs outfitted to be electric horses. Because San Francisco.

21 October 2014

Hackbright Day 16: Sessions + More Flask

When I transferred high schools way back in 2001, I joined all the extra curricular activities that I could in order to meet people and make friends. Some of them turned out to be life-changing (Hi, Ms. Maciolek!) and some of them turned out to be a huge waste of time (that would be you, softball). One of the things that sort of fell in between those extremes was the literary journal *thing* that I did one year. One of the first orders of business was to pick a name for it. My suggestion was "Sessions". They ended up going with "Harbinger". Speaking to the incredible content of my character, I basically lost interest once my name wasn't chosen.

Fast forward 13 years, and now I finally get to talk about sessions.

Sessions, in this context, are about storing information on the server side of a web app. In Flask, the session is a dictionary that you fill with information like, for instance, the user name. For websites where you might buy something, everything you'd add to a shopping cart would be in the session dictionary.

Our assignment today was to make a webapp. The skeleton for the app was already in place, but we needed to add things to it to make it functional. We ended up using Flask, the python framework for web apps, SQL, html + css, and jinja (which is a way to inject a little bit of python into the html). It was a lot of fun, actually, and we were able to make a functional app with a log in page and an account page.

I had a meeting with my advisor today and at his suggestion, I'm going to try to work on a project on my own to create an app, mostly to practice all these new skills that we've been talking about in class.

apt-get install ROBOJULIACHILD 
So my intent is to create a recipe-generating bot that is based on a few different recipe "structures" and will then randomly select things that would go with it. I've sort of sketched out an idea of how to implement it. The working name is cook roulette, but robojuliachild is my favorite. My biggest thought is to make the recipe structure a class and then have the different kinds of recipes (e.g., quiche, risotto, etc.). This works because I'm probably not going to make anything that's too fancy, but doing this with classes makes it modular so I could come back to this easily. What's also nice about this is that I can get more experience with classes without having to go back to that horrible game exercise. (I should definitely probably revisit that at some point.) I'm thinking that it would be interesting to add baking recipes to this because you could calculate the required ingredient amounts based on the ph of different ingredients.

We also talked about how the internet works and now I think I want to run my own server to deploy my own apps. And then I brought up cookie clicker because I'm totally a winner like that.

20 October 2014

Hackbright Day 15: Pro Set. That's way super fun.

Friday was uneventful and eventful. We reviewed all 17,000 new languages we learned this week. It was also install day, where everyone was told what to install to run everything we do in lab on their laptops. I figured out that I somehow totally fucked up my install of Chrubuntu and damaged the Chrome OS in the process. It's not a huge deal because my plan is to actually just reinstall Chrome OS and un-partition the teeny-tiny hard drive. Apparently there's something called Crouton that will let you run Ubuntu on top of the Chrome OS. I've come to the conclusion that getting that Chromebook was a mistake. Not a huge one, but typing on it makes my right hand hurt and it's hard to look at. 

We also got to see working examples of javascript webapps. One of the TAs has made some games, the best of which is called Pro Set. Similar to set in that i t's a concentration/matching game, it's also a lot more difficult, hence the "Pro" part.

Since I was basically set with install day (and also because I'm pretty sure that my install is the easiest what with apt-get install life), I was pretty much by myself in lab. I talked with one of the TAs for a really long time about Hackbright and life in general. It was good. I don't have a Hackbright alum mentor, so this was a nice way to absorb information and good vibes from someone who graduated the program and found success.

Friday night was also board game night. Colby came down to Hackbright, and we all played a game of friendly taboo, a concentration game called Ricochet Robots, and then some crazy taboo/charade game. It was really fun to interact with people in a non-work setting. It's something I feel like I don't do enough. 

On Saturday we FINALLY found a place to live after Nov 1. Thank jebus crust. We'll be in Alameda until the end of February. Hopefully by then, everyone will be employed and then we can focus on where we'll be living more permanently. 

On Sunday morning, I went to a Ladies Tech Brunch at some superfancy high rise apartment in the Financial District. It was nice, but there were a lot of people, and it was definitely good for networking that I just wasn't in the right frame of mind to pursue. I did meet a couple people that I'd like to keep in touch with, though, and I think it encouraged me to go to a PyLadies SF meetup when I can. After that, another HBer and I went to La Boheme Cafe in the Mission to meet up with a bunch of HBers + a HB instructor who were mostly just co-working. I love how accessible and friendly everyone, especially the instructors, are. Hackbright is shaping up into a good decision.

And my 10 second review of La Boheme Cafe:
I'm way too lazy to edit this. Pretend it's cropped.

  • great space to work
  • good, strong coffee
  • pretty good food, and they use zataar spice on their pitas so you know they must know something
  • will definitely return

17 October 2014

Hackbright Day 14: An Ode to GeoCities, erm... I mean JavaScript

We learned about javascript today. Yes, that javascript that let you have the greatest websites the 90s could produce:

click on the link for awesome. dooooooooooo it.
This website is still active and more fabulous than you could possibly imagine.

If you've been keeping track, that makes the new language count up to 4 this week: sql, html, css, and javascript. Not to mention that we just started with flask too.

Things to note about javascript
it was written in 10 days;
it has some weird quirks, like === is strictly equal and 19=="19", which is not strictly equal;
it uses curly braces and semi-colons; similar to C; 
I may have had horrible flashbacks to CSE 231 again when they showed us how for loops work;
you need to use parentheses around the conditional statements in your if statements;
the javascript "equivalent" of a python dictionary is called an object; 
     objects behave an awful lot like python classes;
I think that I'll end up using it in combination with probably flask, possibly django and whatever horrible amount of CSS and HTML I'll need to put together my project.

And if you're feeling nostalgic about the before times filled with the flashing, spastic wonder that was geocities, One Terabyte of Kilobyte Age is an amazing repository .

15 October 2014

Hackbright Day 13: Exactly the types of things you would think you'd do on a day 13

Today was a day with no cake, but lots of HTML and CSS.

I much prefer cake.

We saw how HTML and CSS worked together in the morning lecture, got a series of 12 drills to complete of varying difficulty, and then had another small lecture in the afternoon about CSS and then had another lecture on SQL, whereupon we were shown "Little Bobby Tables". This is a very pro-XKCD environment, which is a very good thing.

One of the instructors showed us this AND IT IS SO TRUE.

After spending today on things that are typically deemed "front end", I've decided that I much prefer back end engineering. I can't even describe how much I was craving an equation. I would have even taken list slicing! I found the HTML/CSS to be tedious, and it was even less interesting today than yesterday because at least yesterday we were doing things through Python with Flask. Fortunately, my partner was patient through my complaints. I think I probably owe her a six pack after all my griping.

A few days ago, I gave a short tech talk on cat, head, tail, and grep. I didn't have slides because it was supposed to be a 5-10 minute talk, so I just got up with a terminal and went at it. It was probably super not clear for most everyone, so I took screen shots of me playing around in the terminal and now I'm working on a page that has the pictures and explanations because I hate myself. JKLOL. Mostly it's because I need to practice HTML and CSS.