INF 362 Unit 1

Debugging

RAT

iRAT

5 Minutes

iRAT

2 Minutes

iRAT

1 Minute

iRAT

Hand in your test papers.

tRAT

tRAT

10 Minutes

tRAT

5 Minutes

tRAT

1 Minute

How'd teams do?

Appeals Process

Mini Lecture

Clarification

Some things to note

Activities

Rank the following CSS Selectors by specificity

  1. #foo .bar .qux
  2. #foo div ul li p a
  3. .bar #foo
  4. #foo .bar p
  5. #foo #baz

What color is this text?

<p class="title" id="red">Hello, World!</p>
#red .title {color: red; border: 1px solid green}
.title {color: green; font-size: 34px;}
p {color: black; font-size:20px; border: 1px solid orange;}
  1. Black
  2. Red
  3. Green
  4. Orange

What color is the border?

<p class="title" id="red">Hello, World!</p>
#red .title {color: red; border: 1px solid green}
.title {color: green; font-size: 34px;}
p {color: black; font-size:20px; border: 1px solid orange;}
  1. Black
  2. Red
  3. Green
  4. Orange

What font size is this text?

<p class="title" id="red">Hello, World!</p>
#red.title {
color: red; font-size:12px; border: 1px solid green}
.title {color: green; font-size: 34px;}
p {color: black; font-size:20px; border: 1px solid orange;}
  1. 20px
  2. 34px
  3. 16px
  4. None of the Above

Given the following options, which is the best way to diagnose and resolve a problem with a CSS rule not applying to your code.

  1. Look at your CSS directly
  2. Use Dev Tools style inspector
  3. Add !important to the style that's not applying
  4. Both A and C

A JavaScript function you just wrote is not working, where in dev tools would you want to look first?

  1. Network Panel
  2. Element Inspector
  3. Sources Panel
  4. None of the Above

Place the following steps in order of effectiveness at solving a CSS problem

  1. Add a new class to the element in html, and new styles in CSS
  2. Add an "element.style" style to the element in dev tools
  3. Check for specificity/cascading issues in Dev Tools
  4. Check to see if you wrote the CSS rule correctly

Place the following steps in order of effectiveness for diagnosing and resolving a JS function not firing.

  1. Check to see if you wrote the JS function correctly
  2. Run the JS through a linter
  3. Add console.log statements where appropriate to track script execution
  4. Check the error output of the console

Jeff just diagnosed and solved a problem.

Rearrange Jeff's diagnosis steps in the order you would have chosen and then decide as a team which steps you would have performed and in which order. (you CAN drop steps)

  1. Effect wasn't showing up on screen
  2. Found a few missing semicolons, fixed them
  3. Refreshed page, still had errors
  4. Checked HTML, was clear of errors
  5. Checked Chrome Dev Console, saw 2 errors
  6. Fixed error in his initialization function (1st error)
  7. Refreshed page, had another error
  8. Fixed extra comma in a declaration (2nd error)
  9. Refreshed page, everything worked.

Back to Jeff.

What is the biggest optimization you could have performed?

  1. Effect wasn't showing up on screen
  2. Found a few missing semicolons, fixed them
  3. Refreshed page, still had errors
  4. Checked HTML, was clear of errors
  5. Checked Chrome Dev Console, saw 2 errors
  6. Fixed error in his initialization function (1st error)
  7. Refreshed page, had another error
  8. Fixed extra comma in a declaration (2nd error)
  9. Refreshed page, everything worked.

Create a bug in CSS that can be debugged by dev tools

Among the team, choose the best CSS bug, and explain why you thought it was the best example of a css rule to be diagnosed through dev tools.

Create a JS bug that can be diagnosed by dev tools

Among your team choose the best JS bug and explain why.

Given the following code example: Individually: What is the expected output of this code

var theName = "sara";
var namer = function(theName) {
    document.write(theName)
}
namer();

As a team what is the output of this code

var theName = "sara";
var namer = function(theName) {
    document.write(theName)
}
namer();

undefined

This script is not performing the task you think it should be. Choose the between lines where placing a console.log() would be most effective in checking to see if the function is firing at all.

var theName = "sara";
var namer = function(theName) {
    document.write(theName)
}
namer();
  1. 1-2
  2. 2-3
  3. 3-4
  4. 4-5
  5. 5-6

What is the console.log function you should write to check to see what name is set to inside the function?

var theName = "sara";
var namer = function(theName) {
    document.write(theName)
}
namer();

console.log(theName);

Sara's code isn't printing out her name. Which of the following mistakes in this code is the actual cause?

var theName = "sara";
var namer = function(theName) {
    document.write(theName)
}
namer();
  1. theName should be passed into the function
  2. theName is not a global variable
  3. document.write(theName) is missing a semi-colon
  4. namer is not properly initialized as a function

I'm having a really tough time using Dev Tools. I'd like you to write up some instructions for me to do the following:

  1. Start with this page: (http://jsbin.com/IdAFaJa/1/ )
  2. Add your team name to the H1 tag
  3. Apply your team color to your team name
  4. Add an unordered list with your team member names after "members"
  5. Create a custom css class for your team member names.
  6. Apply that style to the list of names
  7. Find an image on wikipedia commons (http://commons.wikimedia.org) for your team mascot:
    1. provide the search term used to find that image
    2. Insert it between the text: "Team {Your Team Name}, Go <img>'s"
    3. Image should be 300x300px
    4. Image should have a border of 5px inset of your team color;

Final Project Introduction

Create a REAL web app

Working with Empire Justice Center (EJC) to create a web-based foreclosure app.

Each team creates their own version.

Teams determine the criteria for critique.

In the end one team will emerge victorious, and be chosen by EJC to go live.

This is job experience, put this on your resume.

Phase 1

Project Proposal

  • Scope of the project
  • Style Tile
  • All published on GitHub

Phase 2

Project Midterm

  • Mobile First, Responsive Prototype
  • Foundation 5
  • Information Architecture in place
  • Layout finalized

Phase 3

Final Project

  • Jekyll-based static web app
  • Using data sources for content
  • Javascript is a requirement
  • Cross-Browser compatible to IE 9

Unit 2 Preview

  • User Research
  • Collaborative Design
  • Style Tiles
  • Scope

For Next Class

GitHub

  1. Sign up for GitHub
  2. Add username to the Team spreadsheet: http://bit.ly/inf362teams

User Research

  1. How to Interview Humans
  2. Determining User Needs
  3. Creating Personas

Project Scope

  1. Creating a great project scope

Design Studio

  1. The Design Studio Method
  2. Podcast that breaks down design studio even further/
  3. Extra - How design studios build consensus (crucial)
  4. Extra maybe overkill, as it says a lot of what the first two said, but he answers questions in this one

The Dao of Web Design

http://alistapart.com/article/dao

Style Tiles

  1. Get an understanding of what a Style Tile is, you'll be creating one soon.

Work Study Available

See me for details