Govinda Sai has Published 74 Articles

How to get signal names from numbers in Python?

Govinda Sai

Govinda Sai

Updated on 17-Jun-2020 14:55:56

297 Views

There is no straightforward way of getting signal names from numbers in python. You can use the signal module to get all its attributes. Then use this dict to filter the variables that start with SIG and finally store them in a dice. For example, Exampleimport signal sig_items = reversed(sorted(signal.__dict__.items())) ... Read More

If a number is read as a String, how to Count the no of times the highest number repeated in the string? a. Ex: 2 4 3 4 2 4 0 -> (3)

Govinda Sai

Govinda Sai

Updated on 16-Jun-2020 08:59:00

48 Views

To do so, Trim the given string and split it using the split() method (Removing the empty spaces in-between).Create an integer array and in loop convert each element of the string array to an integer using Integer.parseInt() method and assign it to the respective element of the integer array.Sort the obtained integer ... Read More

What is the lifetime of JavaScript variables?

Govinda Sai

Govinda Sai

Updated on 15-Jun-2020 12:14:35

748 Views

The lifetime of a JavaScript variable begins when it is declared −var rank;A local variable will be visible only within a function where it is defined. Function parameters are always local to that function.The completion of a function deletes the local variable.A global variable has a global scope which means ... Read More

Websockets Apache Server compatibility in HTML5

Govinda Sai

Govinda Sai

Updated on 04-Jun-2020 11:29:30

161 Views

When an app is to be developed that displays new data whenever it is stored in a folder through XML, we use websockets apache server.Mod_websocket or php websocket can be used.we can also use self-hosted realtime web technology for realtime communication between server and client.A hosted realtime web solutions and ... Read More

Execute a script when a element is shown as a context menu in HTML?

Govinda Sai

Govinda Sai

Updated on 30-May-2020 22:16:07

86 Views

When a element is shown as a context menu in HTML, the onshow event fires.ExampleYou can try to run the following code to execute a script when a element is displayed as a context menu −           HTML menu         ... Read More

What is the role of ctrlKey Mouse Event in JavaScript?

Govinda Sai

Govinda Sai

Updated on 23-May-2020 09:32:42

128 Views

The ctrlkey mouse event property is used to show whether the CTRL key is pressed or not when the mouse button is clicked.ExampleYou can try to run the following code to learn how to implement ctrlKey Mouse event in JavaScript.           Press and hold CTRL key ... Read More

What is the usage of onfocus event in JavaScript?

Govinda Sai

Govinda Sai

Updated on 22-May-2020 11:12:41

394 Views

The onfocus event is triggered when element gets focus. You can try to run the following code to learn how to implement onfocus event in JavaScript.Example           Write below:                      function newFunc(x) {             x.style.background = "blue";          }          

How to generate prime twins using Python?

Govinda Sai

Govinda Sai

Updated on 05-Mar-2020 10:07:04

6K+ Views

Twin primes are pairs of primes which differ by two. The first twin primes are {3, 5}, {5, 7}, {11, 13} and {17, 19}. You can generate prime twins in python by running a for loop and checking for primality of the numbers as you do so. exampledef is_prime(n):    for ... Read More

Execute a script when the element loses focus in HTML?

Govinda Sai

Govinda Sai

Updated on 03-Mar-2020 11:11:35

203 Views

Use the onblur attribute execute a script when the element loses focus in HTML. You can try to run the following code to implement onblur attribute −Example           Type text below!       Country:                function display() {             var str = document.getElementById("myid");             str.value = str.value.toUpperCase();          }          

Set the relationship between the current document and the linked document in HTML

Govinda Sai

Govinda Sai

Updated on 03-Mar-2020 11:04:19

161 Views

Use the rel attribute to see the relationship between the current document and the linked document. It works for , , HTML elements. ExampleYou can try to run the following code to implement rel attribute. The example sets the CSS files −                         Heading       This is demo content.    

Advertisements