Prabhas has Published 74 Articles

What are method local inner classes in Java?

Prabhas

Prabhas

Updated on 16-Jun-2020 09:18:52

2K+ Views

In Java, we can write a class within a method and this will be a local type. Like local variables, the scope of the inner class is restricted to the method.A method-local inner class can be instantiated only within the method where the inner class is defined. The following program ... Read More

What are generator functions in JavaScript?

Prabhas

Prabhas

Updated on 16-Jun-2020 06:27:28

280 Views

Generator Functions allows execution of code in between when a function is exited and resumed later. So, generators can be used to manage flow control in a code. Cancel asynchronous operations easily since execution can be paused anytime.Here’s the syntax; do not forget to add an asterisk after the “function” ... Read More

Can we delete the “getContext” property of HTML5 Canvas tag through script?

Prabhas

Prabhas

Updated on 02-Jun-2020 08:12:21

122 Views

There is no description in HTML5 specification, which says deletion of a getContext property by the script is valid.We can write a code in which we delete getContext property of HTMLCanvasElement and then in the separate statement we make it undefined.Delete window.HTMLCanvasElement.prototype.getContext; _assertSame(window.HTMLCanvasElement.prototype.getContext, undefined,    "window.HTMLCanvasElement.prototype.getContext", "undefined");Read More

How to add multi-language content in HTML?

Prabhas

Prabhas

Updated on 29-May-2020 22:35:53

4K+ Views

The lang attribute in HTML allows you to set content for languages other than English. You can try to run the following code to implement lang attribute.ExampleHere, we have added content in French and Spanish as well.           English       This is demo text   ... Read More

Include information about the document in HTML

Prabhas

Prabhas

Updated on 27-May-2020 21:00:49

220 Views

Use the tag to include information about the document. The HTML tag is used for indicating the head section of the HTML document. Tags included inside head tags are not displayed in the browser window.ExampleYou can try to run the following code to include information about the document ... Read More

How to access nested Python dictionary items via a list of keys?

Prabhas

Prabhas

Updated on 05-Mar-2020 07:19:36

2K+ Views

The easiest and most readable way to access nested properties in a Python dict is to use for loop and loop over each item while getting the next value, until the end. exampledef getFromDict(dataDict, mapList): for k in mapList: dataDict = dataDict[k] return dataDict a = {    'foo': 45, 'bar': ... Read More

Streaming a video file to an HTML5 video player with Node.js so that the video controls continue to work

Prabhas

Prabhas

Updated on 04-Mar-2020 05:25:44

289 Views

Use createReadStream to send the requested part to the client. The function call createReadStream() will give you a readable stream. ExampleThe following is the code −stream = fs.createReadStream(path); stream.on('open', function () {    res.writeHead(206, {       "Content-Range":"bytes " + begin + "-" + end + "/" +total, "Accept-Ranges":"bytes",   ... Read More

Why is not in HTML 5 Tag list while is?

Prabhas

Prabhas

Updated on 03-Mar-2020 12:40:45

190 Views

Unlike HTML 4.01, HTML 5 does not support the tag. The makes the text font size one size smaller down to the browser's minimum font size. For example, the use of the tag in a text which is of large font size makes the font size to ... Read More

Execute a script when a file can be played all the way to the end without pausing for buffering in HTML?

Prabhas

Prabhas

Updated on 03-Mar-2020 12:25:33

82 Views

Use the oncanplaythrough attribute to execute a script when a file can be played all the way to the end without pausing for buffering in HTML.ExampleYou can try to run the following code to implement oncanplaythrough attribute −                         ... Read More

Execute a script when the element is being dragged in HTML?

Prabhas

Prabhas

Updated on 03-Mar-2020 09:50:12

166 Views

Use the ondragover attribute in HTML to execute a script when the element is being dragged in HTML.ExampleYou can try to run the following code to implement the ondragover attribute −                    .drag {             float  : ... Read More

Advertisements