public
Created

  • Download Gist
quiz-1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
1) Consider the following HTML:
 
<div id="content" class="foo">
<div class="bar">
<a href="/foobar">Foobar</a>
</div>
</div>
 
And the CSS for this page is:
 
#content a {
color: red;
}
 
.foo .bar a {
color: blue;
}
 
What color is the link and why?
 
 
purple.
 
 
red. i spose id is more selective that classes.
 
 
 
2) What's the illusion that text shadows, box shadows, and gradients allow web designers to create?
 
depth.
 
 
 
 
3) In HTML5, does the "type" attribute need to be declared on SCRIPT and STYLE tags (ie., "type=text/javascript" or "type=text/css")?
 
yes. but it does not have to be a known type. if un-known, it will be
ignored.
 
 
 
4) In the "lean startup method", how is success defined?
 
no muda. no work or processes that do not support the product.
 
 
 
5) Match the following rendering engines with their corresponding browsers:
 
Presto IE
Webkit Opera
Gecko Safari
Trident Chrome
Firefox
quiz-2.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
 
 
 
1) write a javascript class, called 'Foo', with a class method 'bar' and an
instance method 'bar'
 
var Foo = function(){
this.x = 42 // instance variable
};
 
Foo.prototpe.bar = function(){}; // instance method
 
Foo.bar = function(){}; // class method
 
var foo = new Foo();
 
 
 
2) write a ruby class, called 'Foo', and a mixin, 'Bar', that adds a
*class_method* 'baz' and an *instance_method* 'baz'
 
#
#
#
class Foo
end
 
#
# one method...
#
 
module Bar
module InstanceMethods
def baz
end
end
 
module ClassMethods
def baz
end
end
 
def Bar.included(other)
super
 
ensure
other.send(:include, InstanceMethods)
other.send(:extend, ClassMethods)
end
end
 
#
# another method...
#
module Bar
def Bar.included(other)
super
 
ensure
other.module_eval do
class << other
def baz
end
end
 
def baz
end
end
end
end
 
foo = Foo.new
 
foo.baz
Foo.baz
 
 
 
3) what's wrong with this code
 
buffer.match( /^foo.*bar/ )
 
 
it does exponential backtracking
 
 
 
4) what's wrong with this code
 
class Farm
include Mongoid::Document
 
before_save do |farm|
farm.ensure_no_blank_comments!
end
 
def ensure_no_blank_comments!
errors.add('teh comments are fubar') if
comments.any?{|comment| comment.content.blank?}
end
 
class Comment
embedded_in :farm
 
field :content, String
end
 
embeds_many :comments
end
 
 
farm = Farm.find(id)
 
params = { :content => nil }
 
comment = farm.comments.build(params)
 
comment.save!
 
 
 
callbacks only fire on the object being saved. in this case our well
intentioned callback on the farm object is not triggered by saving an
embedded comment.
 
 
 
Suggested Reading:
 
 
* http://guides.rubyonrails.org/
* http://projects.dojo4.com/documents/94
* http://projects.dojo4.com/documents/47
* http://projects.dojo4.com/documents/10
 
 
Assignment:
 
* bring a piece of code that is re-usable you've written @dojo4. show and tell on tuesday.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.