Code error fixed #4: Append Parse query results to a form dropdown

After I’ve done my Parse query of a person’s pets, I need all the pet names in a dropdown field. Leaving out lots of code, but essentially


for (var i = 0; i < results.length ; i++) {
$('\<option\>').val(results[i].attributes.name).
text(results[i].attributes.name)
.appendTo('#pet-names');
}

where pet names is my selection form field. Seems simple, enough, I know, but…sigh…

Advertisement

The final yard sprint

[Wednesday, early AM] Trying to write about my Iron Yard final project at 2:42am from bed using Android voice recognition for the bulk of my transcription of thoughts is not a recipe for a sterling blog post. But I lack the time to write something adequate.

No matter how much I do it’s never going to be enough. There is so much work that is needed to make this a legitimate website. This work could go on forever, and I kind of hope it does, but I have only had 3 weeks, and I only have a week to go.

Most of my classmates are in larger groups. I’m doing this by myself because I wanted this project to demonstrate all the potential that I have, whatever that might be, whatever I could possibly get done with regard to styling and HTML and Javascript and the Backbone framework and the Parse database back end.

But I know no matter how hard I work–I could work 24 hours a day–the design is going to fall short because I don’t know enough about awesome design and don’t have time to implement an awesome design. Integrating with api’s is going to fall short because there’s simply no time to do awesome things with them. The amount of information stored in the database is going to be limited simply because there isn’t time to build out an extensive data model. The CSS isn’t going to be extraordinary because I just don’t have the experience to make it as elegant as I would like.

I should define a scope of what to deliver at a minimum, and, I have, to a degree. However, it’s really difficult because I want this to be a fully functioning app. I don’t want this to be merely a demonstration where I can fake half of it, but rather a demonstration of something very real and functional that was created from nothing.

I am feeling enormous pressure to deliver something that is a fully functioning, particularly because the large groups will be delivering essentially complete web sites that are going to be functional in the real world. I put all of this pressure on myself because I simply don’t know what’s enough, at what point is it okay to say I will work on making this better later and that it does not have to do everything right now.

I know that no matter what I get done, it may not be apparent just how much effort I put into this. But no matter how much work I put into it, if you compare it to an established website by a very experienced developer it’s going to pale in comparison.

[Saturday, early AM] And my thoughts have pretty much been ditto early Thursday morning, early Friday morning, and right now.

I have been told the past few days to focus on design, which has just amped up the pressure, because, frankly, I didn’t spent nine weeks in the program to learn how to be a better designer. I always value good design, I cringe at bad design, and I feel pained when my own design is inadequate. But I came to the program to code–to learn everything I could about building front end applications with Javascript, and I wish that could be the focus of this final project. Instead, I find myself spending time on making buttons looks better. Why?

Because, next Friday, I have five minutes to present three weeks of work, which attempts to encapsulate nine weeks of work, which builds off a couple of decades of other related experience.

You could tell me to stop putting so much pressure on myself, but the audience for this five minute presentation is a group of local employers who are looking to hire developers. And I don’t expect to be employed by next Friday, so presenting my best self is advisable.

Code error fixed #3: Backbone event click on id not firing

Hours gone. It’s 3:37AM. Even though it worked for a couple of days, suddenly clicking on a div called ‘about’ was failing to execute. Turned out I had moved it to ‘main-header’ for stylistic purposes and didn’t put two and two together that I had specified ‘main-container’ as the element for this particular view. Since ‘about’ no longer existed in ‘main-container’, the event wasn’t binding to anything. Duh. It feels as bad as having made a typo. But maybe posting this will save 3+ hours in the life of some other Backbone newbie someday.

var LinkView = Parse.View.extend({
el: "#main-container",
initialize: function(tag) {
blah=tag;
if (!(tag)) {tag = 'blah'};
$('#main-header').append(_.template($('#blah-header-template').html(),({"blahName":tag})));
new blahView(tag);
},
events: {
"click #about" : "showProfile"
},
showProfile: function(e) {
new ProfileView(blah);
}
});

Solution:

el: "#main-header",

July highs and lows…in brief

Low: There is quite a lengthy, complicated story behind this, but over the course of July 2014, I had no health insurance, for the first time in my life. This was disastrous on so many levels.

High: I created an app that shows all the most recent vines of my dog on one page. There’s probably a page on Vine’s site that does exactly the same thing, but this one was built with Backbone, which I kinda know how to use.

Coding error fixed #2: Chrome not rendering page at full width

This was driving me crazy for…well, probably since last weekend’s project. I was using my CSS from last weekend’s project in a test bed for this weekend’s project, and page elements that should have rendered at full screen width or full container width (approximately 960px) were rendering at 600px or 700px in Chrome. All appeared fine in Firefox.

I realized that the main html tag has all of these reserved classes automatically applied to them:


<html class=" js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths">

Last weekend, in my ignorance, I had named a div class video. This was the problem. Of course, there is no need for this div in this weekend’s project, and it would not have wound up in the actual project repo. It would’ve been a mystery to me why this was happening…and it is still a mystery as to why exactly this behavior occurred in Chrome and not Firefox, but there’s no time to look into this deeper.

Lesson learned: don’t use reserved classes

Coding error fixed #1: Invalid CSS after ” webkit-image”: expected

Someone suggested I blog about code errors I find solutions for. This will be quick and dirty, because I don’t have time to do this. I offer no context to anyone, purposely.

When trying to compile an old repo via gulp:

Error in plugin 'gulp-ruby-sass'
error /Users/davidhseidman/Documents/TIY/github-contributions/bower_components/bourbon/dist/helpers/_linear-angle-parser.scss (Line 21: Invalid CSS after " webkit-image": expected ")", was ": -webkit- + $p...")

I tried reinstalling bourbon. I tried upgrading gulp-ruby-sass.

Solution: upgrading sass.

sass -v
Sass 3.2.19 (Media Mark)

gem install sass
sass -v
Sass 3.3.10 (Maptastic Maple)

Dogwoome!

There’s no time to blog. And I’m self-censoring. I’d be a lot more blunt and prolific in describing my state of mind as I press forward with my career re-invention if I were still blogging under a pseudonym. I think my last couple of posts have hinted at a strong undercurrent of frustration. (I could go a read them, but it’s never a good idea to read old blog posts, even if they’re only a few days old, let alone a few years old.) I’ll hold off on making another such post now, because I have been meaning to post a link to my game.

Yes, it’s a game called Dogwoome! Dogs must woo potential adopters through a series of licks, cuddles, and barks. That’s it. Most people will see a silly game that does very little. People I know probably assumed I could have done something like this, already. Nope. I haven’t coded anything resembling a game since college. And this was fun. Although, in a fashion true to myself, when I was turning in this homework at the end of last weekend, I was obsessed with what it doesn’t do. I wanted there to be complex algorithms. I wanted it to be multi-player with multiple targets. I wanted my code to be clean. But we only had so many days to work on this. There were some technical requirements that had to be met. I write about this in the past tense as if I’ll never touch another line of code on it. I don’t know if I’ll touch it again. In this class, we’re always charging ahead. We should clean up some of our old projects and be proud enough of them to keep them in our public github repositories for all to see forever. But I don’t know.

was proud of this when I submitted it. But, again (recurring theme alert!), I am constantly overwhelmed by what I do not know how to do, and I can’t help but look at something like this and see how amateurish it is rather than what I was able to put together in a few days having never built anything like this before.

I do not sell myself well, do I? Nor do I hold firm to proclamations that my blog post isn’t going to be “another such” self-critical/defensive/frustration-laden post. (Why couldn’t I just have made this a post about Dogwoome!?)

Enjoy Dogwoome!