Archive | October 2013

Day 18 – THE WALL!

PHEW!  So… for days everyone has been talking about “the wall” which is our advanced PHP assignment where we have to sort of recreate a Facebook wall-type thing where a user can register and log in and then can post messages or comments to messages.  It’s cool because it combines a whole lot of different things that we’ve learned so far in an interesting way that really makes you put it all together.  And it’s notorious for being really challenging – so everyone feels like they are literally “hitting a wall” when working on the wall…  I spent a solid day on just the wall portion (and the past 2 days I guess on the registration portion) but I think I got it!  Here are some pictures:

register wall

And there’s all kinds of crazy stuff on the back end that processes everything depending on which button you click, adds items to the database, runs database queries, validates everything, sets error messages to display, etc.

It was definitely a challenge but it felt good to put so many different things together, and it certainly feels like quite an accomplishment to have “scaled the wall”…  :-)  Based on feedback from my remote TA who reviewed just my registration side, this morning I ended up redoing the formatting using Bootstrap which we learned in Week 1.  Then that day we had spent writing zillions of MySQL queries really paid off when it came time to write queries involving joins on this assignment which I hadn’t done since.  Plus of course everything that we’ve learned in PHP which is the heart of the assignment.  I still have some things that I’d like to figure out that might make it better but it’s good enough for now!

As a sidenote, we were supposed to validate our inputs for the registration form such that the name fields were letters and not numbers, so I had a funny moment when I tried to register myself on my own site using my real info and found that it wouldn’t let me because of the hyphen in my last name!  Ha.  So there’s one minor thing I definitely need to change – to let it accept letters or some special characters but no numbers…

But first I should go home and get some sleep!

Reinvention

Someone in my class sent me this article about reinventing oneself:

http://www.jamesaltucher.com/2013/10/the-ultimate-cheat-sheet-for-reinventing-yourself/

Here are a couple of my favorite quotes.

First, related to programming! :-) :

[If you] have passion for reinvention, then everything you look at will be a metaphor for what you want to do. The tree you see, with roots you don’t, with underground water that feeds it, is a metaphor for computer programming if you connect the dots. And everything you look at, you will connect the dots.

And second, to stay with my “road” theme…:

Keep reinventing every day.  Don’t try and find the end of the road. You can’t see it in the fog. But you can see the next step and you do know that if you take that next step eventually you get to the end of the road.

Plus bonus points for the article having a picture of John Locke… :-)

Day 16 – PHP + SQL cont.

More brain exhaustion…  I’ve been working through all kinds of assignments involving PHP and processing websites with multiple forms – adding info to a SQL database, retrieving and posting that info, etc.  Here’s a goofy example – a ninja game where the ninja goes different places and earns or loses gold – and the site keeps track of the amount of gold and there’s an activity log of all of the ninja’s actions:

ninja game

There’s just *a lot* of details to work out to make something like that function correctly!  Today I spent much of the day working on a basic user registration page and just got really stuck on one thing and then proceeded to get totally lost even though I had been pretty close to begin with!  But I think it’s working now.  It’s all a learning experience, solving all these little problems, and nothing beats the feeling of finally getting something to work, and even better understanding why it works and knowing that you fixed the problem in a satisfying way (vs. sometimes just mysteriously getting something to work but not really understanding why which also happens…).  :-)

We also learned about Git and Github today which basically is a version control system for your code.  You run it in your command line in the Terminal so it’s a little scary but also a little fun.  But of course I messed something up and accidentally deleted a bunch of files when I was trying to learn about it!  Oops.

I’ve been trying to go to some meetups too and I went to one tonight about a new kids’ educational game app, and I also had gone to one last week about “building street cred” for women new to software engineering.  Mostly it’s just good to go and talk to people.  When I’m sitting through the presentation portions sometimes I just think how I could have been spending that time learning/coding…  :-)  Though after the program ends when I have more time I will try to go to lots more.

So that was a good break I suppose and now back to my PHP!

Oh, did I mention I won the costume contest at the Coding Dojo Halloween party?  :-)  My costume was my interpretation of Ruby on Rails (a super popular programming language + framework).  I guess I knew my audience…  :-)

may ruby

Day 15 – PHP + SQL

I can’t believe it’s already the end of week 3.  1/3 of the way done.  It’s flying by.  I spent all day yesterday working through PHP programming examples.  Practicing for loops, if statements, defining functions, etc.  My favorite example involved using PHP to create a checkerboard, and I was pretty pleased with the code I wrote and my process for figuring it out.  (2 for loops one inside the other, basically iterating through the rows and columns creating the squares.  And meanwhile you check to see if either both the row and column numbers are even or if both the row and column numbers are odd in which case make the square black, otherwise (one even and one odd) it’s red.  Math!  Fun!  :-) )  And then I spent a ton of time trying to wrap my head around creating a sorting algorithm from scratch.  By the end of the day my brain was exhausted.

checkerboard

So now it’s time to move on to connecting PHP with SQL and actually make pages that can process information, add info to a database, do stuff with that data, etc.  It’s exciting because it means we’ll finally be able to create things that “do” something.  Except at the moment it all feels a little overwhelming!  I just need to start working through everything…  The pace and intensity is definitely starting to pick up.  Good thing it’s almost the weekend so I can spend some time catching up and making sure I really understand everything.

Plus we’re having a Halloween party this weekend too.  :-)

Day 13 – PHP

Starting to wrap my head around PHP…  Fun to start doing some real “programming.”  I’ve done similar stuff on my own but it’s good to now be doing it as a part of the class.  I had done the PHP track on Codecademy as part of the prep work though I’m still having to re-remember all the syntax.  Key things to remember sytnax-wise:

1. always end lines with semicolons; ( :-) )

2. start variable names with dollar signs

3. use == for “is equal to” in things like if statements (vs. = which does variable assignment – same in other languages but I still forget sometimes – possibly b/c I’m still so used to FileMaker Pro which just uses = for comparisons in calculations – mainly I suppose b/c it has sort of a separate way of setting variables…)

So I just worked through a long example involving rolling dice x number of times, displaying each roll, and then displaying a summary of how many times each number was rolled and also the percentage for each number out of the total.  My first time through I had a ton of repetition involving assigning separate variables for $summary_1, $summary_2, $summary_3, $summary_4, $summary_5, and $summary_6, doing the same thing for the 6 separate percentage variables, and also writing out echo statements 6 times for displaying like “Number 1: 10 rolls / 50 total (20%).”  So much repetition.  It was 62 lines of code total.  So then I refactored and used arrays instead of the 6 separate variables and used for loops instead of so many lines echoing out info in a similar form.  And now it’s 32 lines.  :-)  I cut it in half and it’s so much more elegant!  Definitely a good sign that this is so exciting to me.  :-)

Day 11

And 14 hours later I am a MySQL query master!  Maybe…  :-)

Week 2

Phew.  This week was a bit of a whirlwind.  Monday we had a long tech talk in the middle of the day, Wednesday we did a group assignment in the morning and then had our “sports day” for a few hours (we just go to a local park and play sports or hang out and have lunch there – to give us a break from coding in the middle of the week), Thursday most of us went to this all-day event in SF Uncubed, and Friday we had our first “belt exam” all afternoon.  Not as much straight learning/coding this week I guess, though other good experiences.  So today (Saturday) I came into Coding Dojo and am trying to catch up on a bunch of stuff.  Including writing a blog post.  :-)

Our tech talk Monday was interesting.  It was a current instructor at Hackbright Academy, another one of these programming bootcamps, and he talked about some Internet basics – like what exactly happens when you type in google.com and press enter – all of the behind-the-scenes steps to go from your computer to the Google servers and get back info, etc.  And he talked about binary some which was fun for me.  A lot of what he talked about I at least had some familiarity with from my Udacity classes that I did, so it’s so great that those are proving useful – at least to have given me some prior exposure to all of this.  Concepts from those classes keep coming up again and again, so it’s great to at least have an idea of what people are talking about.

The Uncubed event was cool too.  Some good talks and good to get out and meet some people.  I met the founder of Ampush who I recognized from the Bravo TV show Start-Ups: Silicon Valley which I loved but sadly was canceled after one season.  So that was a little bit of a silly highlight for me.

And then yesterday we had our first “belt exam.”  Over the course of the class, we’ll take 4 exams and earn “belts” (like in a martial arts dojo…) – except I think the belts that we get are actually just stickers.  So yesterday was the yellow belt exam which covered HTML, CSS, and a teensy bit of jQuery.  It essentially involved re-creating a screenshot of a website in HTML and CSS, which we’ve already done a bunch of times, so it was just doing the same thing one more time.  We had 4 hours to do as much as we could, and then we also needed to make a short video afterwards to explain a little bit about our thought process.  It went well, though I’m sure I didn’t do everything in the most efficient and cleanest way possible.

So in terms of actual coding, we finished up jQuery this week, which went well.  So now we can do things like click on a button to make something fade in or out, get values from form inputs and do something with them, and easily create cool elements like tabs, accordians, and date pickers using jQuery UI.  Oh and I used a jQuery plug-in to add “tooltips” to my periodic table so when you hover over an element, its full name pops up.  I also found a few opportunities to use straight JavaScript (jQuery is a JavaScript library), which was exciting to me.  There was one assignment that involved having the same image show up 8 times, so you can just put the image tag 8 times in your HTML file which is fine, but I asked our teacher if there was any way to set a variable in HTML or something to that effect and she showed us a way to use a for loop in JavaScript so you only need to put the image tag in once and have the for loop iterate through adding it however many times you specify.  Fun to see for loops and JavaScript in action!  Instead of just in the standalone examples on Codecademy.  And then for one of the other assignments everyone was solving it different ways so I ended up spending a bunch of time trying to solve it all the different ways and got to use JavaScript for 2 of my methods – involving the substring and replace methods and concatenation.  Fun!

So now we are moving on to databases and MySQL and then on to PHP.  I have so much prior experience with databases from working with FileMaker Pro but somehow it’s all still a little confusing.  It’s just not taught in our platform the best way possible I guess.  I’m looking forward to having our teacher actually teach us about it.  I’m sure that will help clarify things.  But I’m figuring out how to use MySQL Workbench, which feels clunky compared to FileMaker Pro, but I’m starting to get the hang of it.  And there are a few things that are easier in MySQL Workbench than in FileMaker Pro, though most of the time I find myself thinking how everything is way easier in Filemaker Pro.  But that is also just what I am used to.  :-)

Phew – that was a lot of updates from a long week!  Hopefully I’ll be able to find time in the coming weeks to write shorter posts more frequently…

BTW, I am now level 5 on Codeivate.  And during our belt exam yesterday I guess I increased my max streak to 2 hours and 46 minutes of non-stop coding.  (I must have stopped for long enough sometime in the middle of the 4-hour exam that it got broken up.)  It’s sort of fun to keep track this way.  Adds a weird added sense of productivity – like when I’m coding I’m building stuff and learning but I’m also leveling up!  Even if it doesn’t actually “mean” anything, it feels like it does.  :-)

Day 6 – jQuery

Well, after the solid week last week of HTML and CSS now we are on to jQuery and jQuery UI, and our websites now can be somewhat interactive!  I didn’t end up doing much coding this weekend, and I started off this morning fresh on jQuery.  I had done the jQuery track on Codecademy a few months ago, but honestly I barely remember any of it.  It clearly did not leave too much of an impression on me.  But now just after 1 day of working on this, I actually have a fairly good sense of it!  Amazing to think that just this morning I barely had a sense of even what jQuery was.  Okay yes I’ve been here over 13 hours at this point (though we had a long tech talk in the middle of the day and also broken up by meals and other breaks of course) – but still – so much to learn in just 1 day!  Take that times every day we’re here and it’s no wonder we will come out of this having learned so much!  Their learning platform is pretty good, and the assignments make us implement everything we’re learning which is really the only way to get it.  But it’s also so clear to me that having the support is so helpful for learning all this.  I’ve gotten stuck on or confused by a few things today, and I can just ask my teacher and she instantly can explain it, instead of me spending tons of time Googling for an answer and never finding a satisfactory explanation that’s written in an understandable way.  Plus of course having my classmates to discuss everything with and compare notes and help each other and share tips.

On another random note, I must be getting into coding because today I was writing an email and found myself trying to “comment out” some of my sentences – which you can do when writing code to temporarily turn some code off but not deleting it entirely because you may want it back – good as a debugging tool, or just to add comments explaining your code.  But I guess there’s not really an equivalent in like email or Microsoft Word – other than like highlighting or using some other formatting – but I was trying to use it for a sentence in my email that I wanted to take out for a minute to see how it looked without it but I didn’t want to delete it because I might want it back later.  Anyway, I guess I’m starting to get coding habits that are starting to take over…  :-)

Success!

Image(recreated from scratch in HTML and CSS…)

Day 5 – More CSS

Hard to believe that we are already a week in!  We’ve been getting pretty darn good at replicating screenshots of websites in HTML and CSS.  I did the 4 screenshot assignments and at this point definitely feel comfortable laying out a website with all kinds of positioning, formatting, etc.  I realize that the little bit I did doing the Web Development track on Codecademy which covers HTML and CSS actually did give me a slight leg up just having had that prior exposure.  I’ve done some things in HTML since, but I hadn’t really touched CSS since doing it on Codecademy a few months ago, so I definitely didn’t remember the specifics.  But having had that prior exposure just sort of knowing the general concepts and knowing what kinds of things are possible stayed with me and made it easier to pick up this time.  And in general although CSS can be a pain dealing with so many minor details getting everything to look just right, overall it makes perfect sense and follows very specific rules and implementing it has been pretty fun.

We’re also learning about Twitter Bootstrap which is an existing framework including fancy CSS so you can make your own website look awesome just by implementing it if you don’t want to write your own CSS.  It seems like tons of people use Bootstrap these days so it’s a good skill to have – great to have the skills to write our own CSS and great to know how to implement existing libraries.  I’m on to the final CSS optional assignment which is to recreate the periodic table in HTML and CSS not using table elements.  It should be a little bit of a challenge, but I’m looking forward to trying to figure it out!

On another note, someone in my class found a plug-in for Sublime Text (code editor) called Codeivate that keeps track of how much time you’re spending writing code in Sublime in different languages, and you get points as you go and you “level up” once you earn enough points, which is good for tracking purposes but also provides a bizarre sense of motivation.  I wish I had discovered it sooner and had been using it all along, even when I was learning on my own (though of course if only tracks time spent actually typing in Sublime).  I’ve found myself wondering how much time total I’ve spent learning to code thus far. There’s the whole idea from Malcolm Gladwell’s book Outliers that to become an expert at anything you need to spend 10,000 hours on it.  I wonder how many hours in I am.  :-)  (Except really, I am learning a ton of different skills, not just focusing on one area – but still.)

Overall I feel like the time is starting to go by really fast, and I’m sure that will continue.  But it is cool to take a step back and realize that in such a short time we’ve totally learned how to build the superficial elements of practically any type of website.  Adding functionality will come later…  :-)