Keyword

Result: 252 questions

Which video formats are supported by HTML5?

Answer:

HTML 5 supports three types of video format:

  • mp4
  • webm
  • ogg
View

Is audio tag supported in HTML 5?

Answer:

Yes. It is used to add sound or music files on the web page.

View

What is the use of figure tag in HTML 5?

Answer:

The figure tag is used to add a photo in the document on the web page.

View

What is button tag?

Answer:

The button tag is used in HTML 5. It is used to create a clickable button within HTML form on the web page. It is generally used to create a "submit" or "reset" button.

View

What is datalist tag?

Answer:

The HTML 5 datalist tag provides an auto complete feature on form element. It facilitates users to choose the predefined options.

View

How tags are migrated from HTML4 to HTML5?

Answer:

No. Typical HTML4 Typical HTML5
1) <div id="header"> <header>
2) <div id="menu"> <nav>
3) <div id="content"> <section>
4) <div id="post"> <article>
5) <div id="footer"> <footer>

Header and Footer Example

HTML 4 Header and Footer:

<div id="header">  
  <h1>Monday Times</h1>  
</div>  
.  
.  
.  
<div id="footer">  
  <p>&copy; JavaTpoint. All rights reserved.</p>  
</div>

HTML 5 Header and Footer:

<header>  
  <h1>Monday Times</h1>  
</header>  
.  
.  
.  
<footer>  
  <p>© JavaTpoint. All rights reserved.</p>  
</footer>

Menu Example

HTML 4 Menu:

<div id="menu">  
  <ul>  
    <li>News</li>  
    <li>Sports</li>  
    <li>Weather</li>  
  </ul>  
</div>

HTML 5 Menu:

<nav>  
  <ul>  
    <li>News</li>  
    <li>Sports</li>  
    <li>Weather</li>  
  </ul>  
</nav>

 

View

If I do not put <!DOCTYPE html> will HTML 5 work?

Answer:

No, browser will not be able to identify that it is a HTML document and HTML 5 tags will not function properly.

View

What is the use of required attribute in HTML5?

Answer:

It forces user to fill text on textfield or textarea before submitting form. It is used for form validation.

Example:

Name: <input type="text" name="name" required>

 

View

What are the new <input> types for form validation in HTML5?

Answer:

The new input types for form validation are email, url, number, tel and date.

Example:

<input type="email">

 

View

Inside which HTML element do we put the JavaScript?

Quiz

What is the correct JavaScript syntax to change the content of the HTML element below?

<p id="demo">This is a demonstration.</p>

Quiz

Which event occurs when the user clicks on an HTML element?

Quiz

What are the advantages of using Django for web development?

Answer:

  • It facilitates you to divide code modules into logical groups to make it flexible to change.
  • It provides auto-generated web admin to make website administration easy.
  • It provides pre-packaged API for common user tasks.
  • It provides template system to define HTML template for your web page to avoid code duplication.
  • It enables you to define what URL is for a given function.
  • It enables you to separate business logic from the HTML.
View

What does the Django templates contain?

Answer:

A template is a simple text file. It can create any text-based format like XML, CSV, HTML, etc. A template contains variables that get replaced with values when the template is evaluated and tags (%tag%) that controls the logic of the template.

View

What does of Django field class types do?

Answer:

The Django field class types specify:

  • The database column type.
  • The default HTML widget to avail while rendering a form field.
  • The minimal validation requirements used in Django admin.
  • Automatic generated forms.
View

What is MVC?

Answer:

Most programmers know this, but interviewers will likely look for a deep understanding of MVC, and some explanation or examples on how/why/ when you used it. 

MVC - Model, View, Controller - is simply a way of organizing your code into 3 separate layers each with there own job. 

Model - Usually contains data access code and all of you business logic code. 
View - Contains markup/design code, generally html,xml, json. 
Controller - Usually contains very little code, just whatever is needed to call the Model code and render the View code.

http://www.symfony-project.org/book/1_0/02-exploring-symfony-s-code

View

What does ob_start do?

Answer:

Makes it so PHP does not output anything. Companies ask this because many large frameworks wrap a bunch of code in ob_start() and ob_get_clean(). So understanding how that function works is pretty important.

http://myphpsource.blogspot.com/2010/01/obstart-save-php-output-to-string-php.html

View

What does "&" mean in '&$var' ?

Answer:

'&' indicates a reference

http://schlueters.de/blog/archives/125-Do-not-use-PHP-references.html

View

Python and multi-threading. Is it a good idea? List some ways to get some Python code to run in a parallel way.

Answer:

Python doesn't allow multi-threading in the truest sense of the word. It has a multi-threading package but if you want to multi-thread to speed your code up, then it's usually not a good idea to use it. Python has a construct called the Global Interpreter Lock (GIL). The GIL makes sure that only one of your 'threads' can execute at any one time. A thread acquires the GIL, does a little work, then passes the GIL onto the next thread. This happens very quickly so to the human eye it may seem like your threads are executing in parallel, but they are really just taking turns using the same CPU core. All this GIL passing adds overhead to execution. This means that if you want to make your code run faster then using the threading package often isn't a good idea.

There are reasons to use Python's threading package. If you want to run some things simultaneously, and efficiency is not a concern, then it's totally fine and convenient. Or if you are running code that needs to wait for something (like some IO) then it could make a lot of sense. But the threading library won't let you use extra CPU cores.

Multi-threading can be outsourced to the operating system (by doing multi-processing), some external application that calls your Python code (eg, Spark or Hadoop), or some code that your Python code calls (eg: you could have your Python code call a C function that does the expensive multi-threaded stuff).

View

Place the following functions below in order of their efficiency. They all take in a list of numbers between 0 and 1. The list can be quite long. An example input list would be [random.random() for i in range(100000)]. How would you prove that your answer is correct?


def f1(lIn):
    l1 = sorted(lIn)
    l2 = [i for i in l1 if i<0.5]
    return [i*i for i in l2]

def f2(lIn):
    l1 = [i for i in lIn if i<0.5]
    l2 = sorted(l1)
    return [i*i for i in l2]

def f3(lIn):
    l1 = [i*i for i in lIn]
    l2 = sorted(l1)
    return [i for i in l1 if i<(0.5*0.5)]

Answer:

Most to least efficient: f2f1f3. To prove that this is the case, you would want to profile your code. Python has a lovely profiling package that should do the trick.

import cProfile
lIn = [random.random() for i in range(100000)]
cProfile.run('f1(lIn)')
cProfile.run('f2(lIn)')
cProfile.run('f3(lIn)')

For completion's sake, here is what the above profile outputs:

>>> cProfile.run('f1(lIn)')
         4 function calls in 0.045 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.009    0.009    0.044    0.044 :1(f1)
        1    0.001    0.001    0.045    0.045 :1()
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        1    0.035    0.035    0.035    0.035 {sorted}


>>> cProfile.run('f2(lIn)')
         4 function calls in 0.024 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.008    0.008    0.023    0.023 :1(f2)
        1    0.001    0.001    0.024    0.024 :1()
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        1    0.016    0.016    0.016    0.016 {sorted}


>>> cProfile.run('f3(lIn)')
         4 function calls in 0.055 seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.016    0.016    0.054    0.054 :1(f3)
        1    0.001    0.001    0.055    0.055 :1()
        1    0.000    0.000    0.000    0.000 {method 'disable' of '_lsprof.Profiler' objects}
        1    0.038    0.038    0.038    0.038 {sorted}
View

© 2017 QuizBucket.org