So you think you wanna be a web developer... Fork this, update your copy with answers. They don't need to be precise - pseudo-code is fine in most cases. Some questions don't have correct answers. Submit your answers to [email protected] FROM: [email protected] SUBJECT: [dojo4-quiz] quiz-1 BODY: https://gist.github.com/to-your-submission
==========================================================
- is this broken in html5? if so why? ==========================================================
  <div id='teh_javascripts' />teh answerz...
  'http://domain.com:4242/foo/bar/baz.html'
teh answerz...
========================================================== 3. in any language you choose, write this to run in parallel
  numbers = 20, 1
  results = []
  numbers.each do |number|
    results.push( parallelize{ number * 2 } )
  end
  sum = reduce( results )
teh answerz...
========================================================== 4. in any language you choose, write this to run in parallel on multiple cores
  numbers = 20, 1
  results = []
  numbers.each do |number|
    results.push( parallelize{ number * 2 } )
  end
  sum = reduce( results )
teh answerz...
  <label for='user.email'>
  <input name='user.email'>teh answerz...
  if @not_modified
    render :status => status
  endteh answerz...
========================================================== 7. is this javascript broken? if so, why?
  var submit = document.getElementById("submit");
  submit.click();teh answerz...
<!-- A -->
  <table>
    <tr>
      <td class='key' style='width:33%'>
        {{ dynamic_content_for(:key) }}
      </td>
      <td class='val'>
        {{ dynamic_content_for(:val) }}
      </td>
    </tr>
  </table>
<!-- B -->
  <div class='fluid grid'>
    <div class='row'>
      <span class='key width33'>
        {{ dynamic_content_for(:key) }}
      </span>
      <span class='val'>
        {{ dynamic_content_for(:val) }}
      </span>
    </div>
  </div>teh answerz...
# A
  if var == 42
    "..."
  end
# B
  if 42 == var
    "..."
  endteh answerz...
  @response =
    http_request(url, :method => method, :params => params, :headers => headers)
  if @response.ok?
    ship_it!
  else
    debugger!
  endteh answerz...
# A
  if foo.bar.baz
    '...'
  end
# B
  if foo
    if foo.bar
      if foo.bar.baz
        '...'
      end
    end
  endteh answerz...
========================================================== 12. is this javascript broken? if so, why?
  ajax(url)({
    'method'  : 'POST',
    'params'  : params,
    'headers' : headers
  });
teh answerz...
  '#FFE'teh answerz...
  0b101010teh answerz...
========================================================== 15. describe an algorithm to detect the 'edges' in these pixels
0 0 0 0 0 0 0 0 1 1 1 0 0 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0
teh answerz...
  $color = [@X, @R, @G, @B].as_hex
 teh answerz...
========================================================== 16. what are the advantages of static linking?
  export HINT=$LD_RUN_PATH
teh answerz...
     var uploader = new qq.FileUploader(options);
     var image_ids = [];
     uploader._uploadFileList = function(){
       image_ids = [];
       var args = Array.prototype.slice.call(arguments);
       var result = qq.FileUploaderBasic.prototype._uploadFileList.apply(uploader, args);
       return(result);
     };
teh answerz...
  jQuery('.help').find('a').attr('tabindex', '-1');
teh answerz...
  ~ > run_api_tests_locally
    "FAIL: you must access teh API from a box on EC2 with IP 1.2.3.4!"
teh answerz...
// A
  User.prototype.first_name = function(){
    return this.name.split(/\s+/)[0];
  };
// B
  User.prototype.first_name = function(){
    return User.first_name_for(this.name);
  };
  User.first_name_for = function(name){
    return name.split(/\s+/)[0];
  };teh answerz...