SitePoint Sponsor

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 67
  1. #26
    Hibernator YuriKolovsky's Avatar
    Join Date
    Nov 2007
    Location
    Malaga, Spain
    Posts
    1,072
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Loving all your questions ralph

  2. #27
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by YuriKolovsky View Post
    Loving all your questions ralph
    Thanks, Timo ... though I bet you could come up with better ones.

  3. #28
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    I think this would make a more interesting version of the alerts question

    Code:
    "use strict";
    x = 10;
    
    function hello() {
        var x = 5;
        alert(x);
    }
    
    hello();
    
    alert(x);
    a) 10, 10
    b) 5, 5
    c) 5, 10
    d) syntax error because the code doesn't declare the global variable x before trying to use it.


    or possibly this one.

    Assume that the browser is Opera and that you check the checkbox in each alert before pressing the OK button.

    Code:
    "use strict";
    var x = 10;
    
    function hello() {
        var x = 5;
        alert(x);
    }
    
    hello();
    
    alert(x);
    a) 10, 10
    b) 5, 5
    c) 5, 10
    d) 5 and then nothing because JavaScript is disabled before returning from the first alert.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #29
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by connor
    Q) What selector would you use in order to create an anchor-based pure CSS accordion menu?
    A) a:hover B) a:visited C) a:clicked D) a:active
    If it only worked with :active then you'd only see the accordion opening while the user is holding down the button. :active states don't stay.

    Unless I'm missing something.


    Felgall thanks for the correction of indexOf.

  5. #30
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,313
    Mentioned
    178 Post(s)
    Tagged
    9 Thread(s)
    That's a neat site.

    Quote Originally Posted by ralph.m View Post
    Maybe @Pullo and @markbrown4 can come up with some Ruby questions.
    Are you looking for questions about plain Ruby or more about Rails?

  6. #31
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    I have pondered your questions deeply.

    Quote Originally Posted by And in response, thus spake the Oracle:

    Question:
    Which of these is NOT valid ID value, for the ID attribute within XHTML 1.x?

    Code:
    id="_Orcus"
    
    id="2Demogorgon"
    
    id="Geryon:Dispater"
    
    id="Asmo.deus"
    Answer: id="2Demogorgon" ID must start with an alphabetic letter or an underscore, in XHTML.

    Comment: the first choice would however be invalid in HTML 4.01. HTML5 accepts any nonsense. For HTML5, apart from the ID attribute being a unique value, it must contain at least one character (can't be empty), and cannot contain any space characters.

  7. #32
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    Lawlz yeah you can have
    <div id="♥"> if ya want nowadays.

  8. #33
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by connor4312 View Post
    Q) What selector would you use in order to create an anchor-based pure CSS accordion menu?
    ... D) a:active
    Quote Originally Posted by Stomme poes View Post
    If it only worked with :active then you'd only see the accordion opening while the user is holding down the button. :active states don't stay.
    Yeah, I'd expect to see a:target there or something similar.

    Quote Originally Posted by Pullo View Post
    Are you looking for questions about plain Ruby or more about Rails?
    That's a question for @HAWK and/or @James08

  9. #34
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Actually Poes, I was thinking something more like: <p id="<!--<a><div>http://html5sucks.org/</div></a>-->"></p> for a valid HTML5 id attribute value.

  10. #35
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,603
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by xhtmlcoder View Post
    Actually Poes, I was thinking something more like: <p id="<!--<a><div>http://html5sucks.org/</div></a>-->"></p> for a valid HTML5 id attribute value.
    That's the second best demonstration of HTML 5 stupidity that I have come across so far. The best being the "mandatory empty" input field definition at the bottom of my sig.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  11. #36
    SitePoint Member James08's Avatar
    Join Date
    Dec 2012
    Posts
    0
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pullo View Post
    That's a neat site.


    Are you looking for questions about plain Ruby or more about Rails?
    Hi, Pullo.

    Questions about ruby on rails would be awesome!

  12. #37
    SitePoint Enthusiast
    Join Date
    Jul 2012
    Posts
    32
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Ah never mind...

  13. #38
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by connor4312 View Post
    Ah never mind...
    Don't be put off. Your questions were good.

  14. #39
    SitePoint Member James08's Avatar
    Join Date
    Dec 2012
    Posts
    0
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by connor4312 View Post
    Ah never mind...
    Connor your questions were good!

    Anymore would be awesome

    Also what was the answer to the last question, im sure everyone would like to know

  15. #40
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Another JavaScript question:

    Consider the following code:

    Code:
    function hello( str1, str2 ) {
        console.log( str1 + " " + str2 );
    }
    
    hello.call(this, "hello", "world");

    Why do we use call() to invoke this function?

    a) This is how all functions are invoked.
    b) To pass in the "this" parameter.
    c) To pass in a scope variable (this) and 0 or more arguments
    d) You can't invoke a function this way.
    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }

  16. #41
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,313
    Mentioned
    178 Post(s)
    Tagged
    9 Thread(s)
    Hi there @James08 ;

    Here are some Rails questions to get things rolling.
    The correct answer is always the first one.

    Which architecture pattern does Rails implement?
    Model-View-Controller
    Model View Presenter
    Operational Data Store
    Event-driven architecture

    Which component of Rails responds to external requests from the web server?
    Controller
    Model
    Helper
    Database

    How would you declare a 1:n assosciation in Rails?
    Using "has_many" and "belongs_to"
    Using "has_one" and "has_n"
    Using "has_many" and ":dependent"
    Using "has_and_belongs_to_many"

    What purpose does the asset pipeline serve?
    To concatenate and minify JavaScript and CSS files
    To cache and compress images
    To speed up database queries
    To reduce server latency

    Which command should you run to make rails aware of a change in your database schema?
    rake db:migrate
    rake db:update
    rake db:teardown
    rake db:reload

    What will the following output?
    Code:
    p "SITEPOINT ROCKS!".downcase.gsub(/\b\w/) { |match| match.upcase }
    "Sitepoint Rocks!"
    "sitepoint rocks!"
    "SITEPOINT rocks!"
    "SiTePoInT RoCkS!"

    What will the following output?
    Code:
    @user = User.find(1)
    <%= link_to "User Details", user_path(@user) %>
    <a href="/users/1">User Details</a>
    <a href="/users?id=1">User Details</a>
    <a href="http://www.yoursite.com/users/1">User Details</a>
    Nothing, you cannot pass user_path an object

    How would you generate the following:
    Code:
    <input accept="text/html" type="file" id="post_attached" name="post[attached]" />
    file_field(:post, :attached, :accept => 'text/html')
    file_field(:id => 'post', :name => 'attached', :accept => 'text/html')
    input_field(:post, :attached, :accept => 'text/html')
    input_field(:type=> 'file', :id => 'post', :name => 'attached', :accept => 'text/html')

    Which ORM does Rails use to connect classes to relational database tables
    Active Record
    Active Mapper
    Active Object
    Active Data

    What would the following output?
    Code:
    number_with_delimiter(1240.99, ".",  ",")
    1.240,99
    1,240.99
    1240,99
    1240.99

  17. #42
    SitePoint Member James08's Avatar
    Join Date
    Dec 2012
    Posts
    0
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pullo View Post
    Hi there @James08 ;

    Here are some Rails questions to get things rolling.
    The correct answer is always the first one.

    Which architecture pattern does Rails implement?
    Model-View-Controller
    Model View Presenter
    Operational Data Store
    Event-driven architecture

    Which component of Rails responds to external requests from the web server?
    Controller
    Model
    Helper
    Database

    How would you declare a 1:n assosciation in Rails?
    Using "has_many" and "belongs_to"
    Using "has_one" and "has_n"
    Using "has_many" and ":dependent"
    Using "has_and_belongs_to_many"

    What purpose does the asset pipeline serve?
    To concatenate and minify JavaScript and CSS files
    To cache and compress images
    To speed up database queries
    To reduce server latency

    Which command should you run to make rails aware of a change in your database schema?
    rake db:migrate
    rake db:update
    rake db:teardown
    rake db:reload

    What will the following output?
    Code:
    p "SITEPOINT ROCKS!".downcase.gsub(/\b\w/) { |match| match.upcase }
    "Sitepoint Rocks!"
    "sitepoint rocks!"
    "SITEPOINT rocks!"
    "SiTePoInT RoCkS!"

    What will the following output?
    Code:
    @user = User.find(1)
    <%= link_to "User Details", user_path(@user) %>
    <a href="/users/1">User Details</a>
    <a href="/users?id=1">User Details</a>
    <a href="http://www.yoursite.com/users/1">User Details</a>
    Nothing, you cannot pass user_path an object

    How would you generate the following:
    Code:
    <input accept="text/html" type="file" id="post_attached" name="post[attached]" />
    file_fieldpost, :attached, :accept => 'text/html')
    file_fieldid => 'post', :name => 'attached', :accept => 'text/html')
    input_fieldpost, :attached, :accept => 'text/html')
    input_fieldtype=> 'file', :id => 'post', :name => 'attached', :accept => 'text/html')

    Which ORM does Rails use to connect classes to relational database tables
    Active Record
    Active Mapper
    Active Object
    Active Data

    What would the following output?
    Code:
    number_with_delimiter(1240.99, ".",  ",")
    1.240,99
    1,240.99
    1240,99
    1240.99
    Questions are great! Thanks Pullo!

  18. #43
    SitePoint Member reSabi's Avatar
    Join Date
    Nov 2012
    Location
    Belgrade, Serbia
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How many widget areas can you have on a WordPress powered blog?

    1, 2, 5, As much as you want

  19. #44
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    <! This is a comment.
    Did you mean
    <!-- This is a comment.
    ?
    Simon Pieters

  20. #45
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    zcorpan I figured he meant what Microsoft considered a comment.

  21. #46
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by zcorpan View Post
    Did you mean
    <!-- This is a comment.
    Egad, you are right, I made a typo. Thanks for spotting it. Hope it hasn't made it into the system yet. Sorry @James08 ! Ammended question here: http://www.sitepoint.com/forums/show...=1#post5257191

  22. #47
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also note that <!-- (and --> which also acts as a line comment if it appears at the start of a line) isn't yet specified in ECMAScript. It's specified here, though: http://javascript.spec.whatwg.org/#comment-syntax
    Simon Pieters

  23. #48
    SitePoint Member squigworm's Avatar
    Join Date
    Oct 2012
    Location
    U.S
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey all, I am brand new to web design and these are questions I am either still fumbling with, or have very recently found the answer to.


    Q) - what part of a completed site does HTML contribute to ?
    Q) - what part of this page (some dynamic page) does JS control ?
    Q) - Something related to -> When to use CSS and when to use JS if they can both produce the same results.

  24. #49
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    I think squigworm's questions are excellent in their own right, but I dunno how good they'd be in a quiz, since quizzes seem to do best with questions where the answer is obvious and look-up-able. Questions like when to use CSS vs JS for effects can have rules of thumb, but they're often best answered with explorations into reasons, effects on users and things like speed, CPU usage, etc.

    Or, if the quiz will have essay-style questions, these would be good for those.

  25. #50
    SitePoint Member squigworm's Avatar
    Join Date
    Oct 2012
    Location
    U.S
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I agree with Stomme poes in terms of how I worded the examples, the actual questions would look more like: "what part of a website does HTML typically control? A) Stylizes the page B) Creates the skeleton structure C) Handles placement of the images (something to that effect) I know this sounds so very remedial to anyone who has been doing this for a while but it is what us beginners are trying to wrap our heads around.
    Questions like when to use CSS vs JS for effects can have rules of thumb, but they're often best answered with explorations into reasons, effects on users and things like speed, CPU usage, etc.
    <- this is exactlyyyy the type of info I am looking for! A question could simply be "what will you need to consider when choosing between CSS and and JS? A) CPU usage B) I'd put something here but I only knew the first one cause you said it C) etc D) etc.


    Quote Originally Posted by Stomme poes View Post
    I think squigworm's questions are excellent in their own right, but I dunno how good they'd be in a quiz, since quizzes seem to do best with questions where the answer is obvious and look-up-able. Questions like when to use CSS vs JS for effects can have rules of thumb, but they're often best answered with explorations into reasons, effects on users and things like speed, CPU usage, etc.

    Or, if the quiz will have essay-style questions, these would be good for those.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •