Ruby’s New &.!= Operator

Ruby 2.3 was just released in December, and amongst the changes is this weird looking new operator. It can do a nice job DRYing up your code, but seems like it will make code more obscure to read. Maybe it’s just a matter of getting used to it.

Link to the full article is below.

Source: Ruby’s New &.!= Operator

Jay Fields’ Thoughts: Ruby: inject

I discovered this awesome blog post today while researching for a Udacity reviewer training course (that’s the coder version of name dropping… 😉

Check out the start of it below, and then read the whole thing on his blog. He really breaks down the inject method, explaining what it does step by step in a clear and well thought out manner. Even better, he goes through a ton of scenarios where inject just kicks ass.

I love inject. To be more specific, I love Enumerable#inject. I find it easy to read and easy to use. It’s powerful and it lets me be more concise. Enumerable#inject is a good thing.

Of course, I didn’t always love it. When I was new to Ruby I didn’t understand what it was, so I found it hard to follow. However, finding it hard to understand didn’t make me run from it, instead I wanted to know what all the hype was about. Enumerable#inject is an often used method by many great Rubyists, and I wanted to know what I was missing.

So, to learn about Enumerable#inject I did what I always do, I used it every possible way I could think of.

Example 1: Summing numbers
Summing numbers is the most common example for using inject. You have an array of numbers and you want the sum of those numbers.

[1, 2, 3, 4].inject(0) { |result, element| result + element } # => 10

If the example isn’t straightforward, don’t worry, we’re going to break it down. The inject method takes an argument and a block. The block will be executed once for each element contained in the object that inject was called on ([1,2,3,4] in our example). The argument passed to inject will be yielded as the first argument to the block, the first time it’s executed. The second argument yielded to the block will be the first element of the object that we called inject on….

Source: Jay Fields’ Thoughts: Ruby: inject

First few weeks in the coding world…

Long.

Yup, they’ve been long. I basically sit at my laptop every waking hour, trying to figure out how to implement small features into the app I’m working on for my job. It’s a tough slog because I have to learn every single thing from scratch, and when I can’t find decent documentation for something, I’m pretty much stuck until I have a chance to meet with the Overseer.

Continue reading “First few weeks in the coding world…”

The journey continues…

So today I started getting an app up on Heroku for the new job I’m starting on Monday. I’ve actually done quite a bit of work for them already, but it’s been mostly meetings and research. Today I started deploying code.

And immediately ran into a snag.

After setting up a github repo for my company with brand spanking new ssh keys and launching the rails project on my local machine, I did my standard heroku create command, expecting my app to be created on the heroku account I set up for my employer.

It went into my personal heroku stashpps instead.

Because I’m sure many of my fellow Wyncoders will face this minor issue soon, if they haven’t already, I’m going to briefly talk about a nifty little tool that solved this problem beautifully.

Heroku-accounts is a plugin that will handle multiple account management for you. It’s super easy to install and the ReadMe on the GitHub repo provides all the details you need to get it configured and running smoothly. All you have to type is:

$ heroku plugins:install git://github.com/ddollar/heroku-accounts.git

in your terminal, and you’re off and running. You have to manually link your personal heroku account. It’ll ask you for your username and password, and then you have to add the following to your ~/.ssh/config file:

  Host heroku.personal
    HostName heroku.com
    IdentityFile /PATH/TO/PRIVATE/KEY
    IdentitiesOnly yes

If you don’t have a config file, just create (or ‘touch’) one and paste that in.

Then to create another profile for a client or for work:

$ heroku accounts:add work --auto

Here, “work” can be whatever name you want. This will prompt you for your email and password to the Heroku account you want to associate with this profile. With the –auto flag, the add-on will create ssh keys.

Now, with

heroku accounts:set work

you can set that to be your active account, and when you create a heroku app or push, it will go to the right spot.

There are a few more commands you can make use of. Visit the github repo to learn them all. Or check out this other blog post I found useful here.

Hope this helps out people who run into the same issue!

The End

You, faithful reader (all one or two of you), probably suspect me of being a lazy procrastinator who has neglected his blog and left key portions of the story untold. You’re probably right, but the reason I’ve been procrastinating is that I haven’t wanted this journey to end.

I’ve always sucked with endings. When I wrote fiction, I dreaded getting to that point when I had to start thinking about wrapping up the tale. I didn’t want to stop exploring the world and the characters I had created. With Wyncode, I wanted to keep driving onward, learning and exploring new concepts with my amazing classmates.

But in fiction as in life, you can only avoid the ending for so long. A reluctant ending is better than none at all, so I will do my duty and bring this journey to its conclusion.

For the final project, my team built thebulk.co, a crowd sourcing site to buy items in bulk. The idea originated from one of my teammates. She had extensive experience as a project manager and had worked on big projects like HBOGo, so she was a natural lead for the team. We ran into tons of blockers throughout the two weeks we worked on the app, but we stuck together and overcame them all. We had a MVP (minimum viable product) ready just a few hours after the scheduled code freeze. And that was my fault, because I thought it would be a simple matter to set up AWS hosting for our images on the final night of work, and not only did that setup take up the entirety of that final night, it overflowed into the entire morning and past the code freeze.

From now on, I set up AWS right from the start.

With the projects on code freeze, the last week of Wyncode consisted of advanced lectures and presentation preparations for Pitch Day VI. We all learned quickly that presenting is hard work, and we sucked at it. Luckily, we had the entire Wyncode team there to help us prepare. We practiced our presentations a handful of times in front of live audiences, including a full rehearsal at Live Ninja’s #wafflewednesday.

Our presentations that morning were disastrous. And the next night, we had to perform in front of hundreds of people, judges, companies that might hire us, and venture capitalists. One of the things I’m most proud of is the improvement all the teams made from that morning to Pitch Day.

 IMG_0980

We all killed it that night, and it was an amazing night with tons of surprises. It started with our head TA announcing he was leaving and taking a job with Udacity in San Francisco. Needless to say, we were super excited for him, and that set the celebratory tone for the night. And to end the night, we learned that one of our very own classmates, whom we had taken to calling Superman, was going to take over the head TA position! He has big shoes to fill, but I’m confident he’s going to soar.

At the end of the night, I had the opportunity to chat with a few people looking to hire coders. I collected and distributed business cards and followed up, but nothing really came out of those conversations. Luckily, I had already been in talks with one company to complete a project for them as a consultant.

That night, I celebrated with my girlfriend, my brother (who flew in from Baton Rouge to attend the event), and my parents. That weekend, I celebrated with my old friends who I had been badly neglecting over the two month bootcamp. And then Monday.

Up at six a.m. Back to my old job. Most of my classmates were back at The LAB, collaborating on projects and studying to improve their skills. I was in my small, spartan office. The room is about the size of a small bathroom. It’s freezing because the old AC at the school can’t regulate temperatures right. No windows. There’s one poster, a Heat Championship team, on the wall, and lots of papers thumbtacked to a cork board. Papers with medicaid codes, CHC processes and cross-battery assessment, bell curves, language dominance classifications, certificates from trainings, and my go-to reference for projective assessments. All my psychological test kits stacked in the corner like kindle for a funeral pyre. My entire library was boxed and taped shut.

I had stripped my office before the end of the school year with the intention of never going back. And yet, there I was, unable to believe Wyncode was over, and dreading losing coding time because I had to evaluate the next kid on my case load. I had told myself that if I ever stepped foot in that office again, I’d be a big fat failure. It would mean that I wasn’t smart enough, that I couldn’t learn something new, that I was too old to start a whole new career.

That kind of thinking led to a rough start to the week. At The Lab, they were having Wynterviews each day, during which teams from hiring partners came and interviewed each of the final-project-teams. With work, I had a hard time making it to the interviews, and I hadn’t received any solid responses from my resume submissions on job boards. I saw myself at sixty, sitting that that tiny closet of an office, shuffling the same papers around after completing yet another evaluation.

And then Thursday, I got a call from the company I had been in talks with to complete their project. I had been in competition with a firm from Boca, and they had decided to go with me. Could I meet with them on Saturday to kick off the project?

And like that, I had a job.

I’ve been winding down my last two weeks, leaving things in order for whoever comes to take over after me. And of course, I’ve been studying my ass off, trying to build my skills so that I can be effective on my first gig. So really, the end is just the beginning, because the greatest thing about wynning code, is that the journey never ends.

A HUGE thank you to the entire Wyncode team and all my classmates for making these last two months truly special. And I can’t finish without mentioning our head instructor one more time, Ed Toro. If any future students are reading this, be prepared. Ed’s instruction moves blazing fast. It’s impossible to keep up (unless you’re Superman). Don’t fight it. Embrace it. Realize that Ed is trying to download decades of coding experience and knowledge into your brain in just nine weeks. You’re not going to get it the first time…in fact, you might come back few months later to tell him about this cool new trick you learned, for him to tell you that trick was covered in slide 38 of the Ruby methods lecture during week two. So until the day that he designs a Matrix like interface to make you a programmer in an hour or two, just do your best keep up.

IMG_0895

And to anyone starting out on their own coding journey, go start hacking!

“A computer is like a violin. You can imagine a novice trying first a phonograph and then a violin. The latter, he says, sounds terrible. That is the argument we have heard from our humanists and most of our computer scientists. Computer programs are good, they say, for particular purposes, but they aren’t flexible. Neither is a violin, or a typewriter, until you learn how to use it.”  ― Marvin Minsky

No more fun and games…

I’ve been neglecting the blog to focus on coding. Even when we have a slow week, I feel like every minute I spend not coding is a minute that I fall behind.

But I would like to briefly capture some of the many awesome Wyncode moments of the past few weeks. I’ll start with friends and family night.

We started learning Rails on Monday, roughly two weeks ago. Wednesday the Wyncode crew assigned us to groups and gave us a Rails project to complete. And Friday, we would present our work for all our friends and family. Oh, yeah, and we still had to attend lectures and workshops throughout the day.

When they come up with seemingly impossible tasks like this, I wonder if they plot them out in their little conference room, twisting their mustachios and giggling.

I thought it was an impossible task, but my group banded together and whipped up a working prototype just in time for presentations. It was a great event and a great night, followed by an alumni picnic on Saturday, which was a real treat. Wyncode has built an amazing community, more like a family, really, and being a part of it is truly a privilege. Wyncode might just take over the #Miamitech scene!

The following week, we continued working on Rails and individual projects. We had time to catch up on past assignments and work on a project of our own choosing. I decided to spend my time working on a slightly more complicated app (for a book exchange) that included encrypted passwords and authentication, search via scraping Amazon’s homepage, multiple models, a join table, foreign keys, and one-click database entries based on the information scraped when the user initially searched for titles.

This was a frustrating and complicated task that often triggered the “I’m never going to get this” despair I’ve been forced to get comfortable with during my tenure here. I didn’t so much feel like I was building an app, but more like I was stitching together a Frankenstein pile of code. Instead of dead body parts, I dug around the graveyard of failed apps on my hard drive hunting for the last bits of the programs that still worked. My blueprint was made up chunks of the lecture notes cobbled together with snippets from tutorials and Pronouncements of the Documentation.

The pieces of this Frankenapp were held together with frayed string. Each time it struggled to life, a working organ would stress the stitching to the breaking point, and it crumpled as it voiced a blaring complaint. I got this monster up and walking a few times, only to watch his ankles and knees collapse beneath the weight of unwieldily code.

I breathed life into him just long enough to present his bruised and scarred face to my classmates yesterday. In the end, he was still my offspring, and no matter how twisted and hideous his visage, we shared that bond.

But now fun and games are over. A few days ago, we voted on final projects, assembled our teams, and it’s balls to the wall till the end of the course. Two weeks to build a fully functioning professional web app and present it to the #miamitech community at Pitch Day.

And to all my friends and family, and anyone out there who is interested in coding or #miamitech, Pitch Day is August 13th, at 7:00 p.m., at The LAB Miami. It’s a great event, and the more the merrier.

I just hope this next app has a prettier face than the last one. It would be fitting, of course.

Every Frankestein needs a bride.

 

“´Wonderful´, the Flatline said,´I never did like to do anything simple when I could do it ass-backwards.´”
― William Gibson, Neuromancer

Learning Code

“It may be that the only real way to learn things is to just go slog around the mud and figure it out yourself.” –Sandi Metz, Interview on CodeNewbie Podcast

It may seem weird that I’m posting that while attending a bootcamp to learn how to be a web developer. And weirder still that I firmly believe it, despite learning so much over these first four weeks of the course. And can it get even weirder, being that I was a teacher, and have worked in education for most of my adult life?

For me, it boils down to this: Teachers can teach you, but they can’t learn you nothing.

The actual learning requires you to get your hands dirty. It requires you to fuck up and break things and lose hope. But you learn as you put the pieces back together and buff the finish to a nice, shiny gloss.

My Wyncode experience has reflected this. Wyncode does a hell of a job teaching these concepts, but I don’t really learn them until I’ve nearly drowned in the mud and just barely crawled my way back to the surface.

This is probably a good time to tell you about the general daily format at Wyncode. Each day starts with a lecture led by our head instructor, Ed Toro. Ed is a really smart guy. Computer Science MIT graduate, tons of coding experience with seemingly every programming language ever invented, practical real world experience with big companies and start-ups…Ed is a font of knowledge that spews forth coding wisdom. He not only knows how shit works, but why it works, all the way down to the metal. I haven’t been able to ask this guy a single question that he couldn’t answer off the top of his head, a single bug that he couldn’t identify within seconds of scanning my code. Dude is bad ass.

Because he’s so smart, and because the material he covers is almost always brand new material, keeping up with him can be difficult at times. This is a good thing, mind you. Otherwise, we’d never get through all the material we have to cover over 9 weeks. And it really works with the model that Wyncode has implemented. After this initial exposure and homework challenges that force you to apply what you’ve grasped from the lecture, Wyncode provides several techniques to fill in the gaps.

The most effective are the live-coding sessions, usually led by Ed or our head TA, Walter. With these, they review all the concepts covered during the initial lecture while showing us how a professional developer thinks about and applies these concepts to practical problems.

This process has been invaluable to me. I think every coder has gone through the torture of staring at the blank screen and trying to figure out how in the hell they are going to come up with that first line of code. The live coding provides an excellent model for the type of thinking a student would want to apply to the problem.

To further fill in the gaps of our learning, TAs are available throughout the day to work with students individually. The TAs are knowledgable and gracious with their time. Moreover, they have a wide range of experiences, so a student who wants to go beyond the general curriculum can always find someone who has employed that technology in a project.

They are kinda like iPhone apps…Want to focus on Node? There’s a TA for that.

And seriously, they are super generous with their time. I’ve chatted online with them countless times, as late as one or two in the morning, and they have stuck with me, offering suggestion and fixes, until the malicious code has been tamed.

On top of this, we have access to Codeschool and other online learning tools. It’s funny. Before Wyncode, the online resources I tried were pretty useless to me. They were either too difficult, or so easy that I learned nothing. But using something like Codeschool after having gone through the steps I described above really helps cement the knowledge in my brain, and more importantly, helps build confidence.

All of these facets work really well together. The initial exposure, the targeted exercises, the meta-thinking that you learn via live coding, the individual help. Wyncode is truly structured to provide a robust educational experience.

And yet, when I learn most, is on those weekend projects, when I sit home by myself till three or four in the morning, coding and testing and running into failure after failure, until I finally get my code to work. Of course, this is part of the curriculum as well, but for me, this is mud-slogging time. This is the dirty work that speeds up my acquisition of the skill-set the most.

That’s it for today. This week, we’re learning Rails, and models and controllers are kicking my ass. I’m off to learn to code.

In the mud.

 

 

 

Enter Week 4

I arrived early on Monday, rested after the 4th of July weekend, and feeling slightly accomplished after finishing the first draft of my personal website. Last week we worked mostly on internet protocols, getting comfortable with how the internet works, and starting to get some practice with HTML and CSS. I spent the weekend playing with the code on my website, trying to get things to work the way I wanted, and I also reviewed some JavaScript basics, trying to prepare for the assault of material this week.

For now, check out my website here. I’ll be adding to it as I learn more throughout Wyncode. I was really happy that I was finally able to get CSS to layout all the sections of my home page the way I wanted! I tried a similar project before Wyncode, and I had to let it go because it became an unsalvageable mess of colliding and overlapping divs, overflowing text, and broken images. What I have now may not be a design masterpiece (design is not something I’ve studied), but I got all the elements to work the way I wanted. I’m pretty confident that I’ll be able to code websites to people’s tastes.

I think the 4th of July brought a much-needed break for everyone. I was starting to burn out a bit. For the first three weeks, I worked till the wee hours of the morning every single day. I’m sure my classmates put in similar efforts, and I think the grind of the boot camp was starting to take its toll on many of us.

If I had time to really analyze it, I would say the most interesting thing about Wyncode has been how people handle the rigors of the course differently. We have a mix of people, from college kids, to people switching careers, artists, business owners, you name it. Everyone that I have met is intelligent, accomplished, and devoted to learning. Some people have taken off like rock-stars, performing so well that they actually have served as quasi-TAs to the rest of us. Others need more time to learn and assimilate the material.

What happens when you take people who have succeeded in every undertaking, and throw them into an environment where they have to fail and fail and fail again in order to start to learn? Because that’s what coding requires — a shit ton of failure. Hell, that’s what’s considered best practice when writing code. It’s called test driven development. You write a test, run it, let it fail, analyze the error, and then write the fewest possible lines of code that will fix that failure. Rinse and repeat.

So what happens psychologically in this type of scenario? It’s more than a blow to the ego.

It’s an identity crisis.

All of a sudden, people who breezed through their jobs successfully have to scratch and claw their way, every single minute, out of the pit of despair dug with each shovel-full of failure.

I thought I recognized this crisis in the eyes of some of my classmates last week. I may be just projecting, but I recognized it  because I was feeling a bit of despair myself.

When I was studying counseling for my school psych degree, I learned that in Chinese, the word for crisis is made of two symbols: one means danger, and the other, opportunity.

Wyncode embodies that, and as week four rolls in, I think I’ve clawed past the worse of the danger and am starting to glimpse opportunity.

That is, of course, until the next new programming language kicks me in the teeth.

“You never let a serious crisis go to waste. And what I mean by that it’s an opportunity to do things you think you could not do before.” –Rahm Emanuel