Samual Sam has Published 2310 Articles

How to clear a chart from HTML5 canvas so that hover events cannot be triggered?

Samual Sam

Samual Sam

Updated on 24-Jun-2020 13:45:44

242 Views

To clear a chart from canvas, delete the element and then append a new element to the parent container as in the below-given code −var resetCanvas = function(){    $('#results-graph').remove();      $('#graph-container').append('');    canvas = document.querySelector('#results-graph');    ct = canvas.getContext('2d');    ct.canvas.width = $('#graph').width(); // here ... Read More

explode() function in PHP

Samual Sam

Samual Sam

Updated on 24-Jun-2020 13:28:14

327 Views

The explode() function is used to split a string by string.Syntaxexplode(delimiter, str, limit)Parametersdelimiter − The boundary stringstr − String to splitlimit − Specifies the number of array elements to return.The following are possible values −Greater than 0 - Returns an array with a maximum of limit element(s)Less than 0 - ... Read More

call_user_method_array() function in PHP

Samual Sam

Samual Sam

Updated on 24-Jun-2020 12:49:22

153 Views

The call_user_method_array() function call a user method given with an array of parameters.Note − The function is deprecated now.Syntaxcall_user_method_array(method, obj, params)Parametersmethod − Method nameobj − Object that method is being called on.params − Array of parametersAlternativeSince the call_user_method_array() deprecated in PHP 4.1.0, and removed in PHP 7.0, therefore use the ... Read More

strspn() in C

Samual Sam

Samual Sam

Updated on 24-Jun-2020 11:28:22

219 Views

The function strspn() is used to calculate the length of substring of first string which is present in second string. It returns the length of that substring.Here is the syntax of strspn() in C language, size_t strspn(const char *string1, const char *string2);Here is an example of strspn() in C language, ... Read More

Use of fflush(stdin) in C

Samual Sam

Samual Sam

Updated on 24-Jun-2020 11:27:30

7K+ Views

The function fflush(stdin) is used to flush the output buffer of the stream. It returns zero, if successful otherwise, returns EOF and feof error indicator is set.Here is the syntax of fflush(stdin) in C language, int fflush(FILE *stream);Here is an example of fflush(stdin) in C language, Example Live Demo#include #include int ... Read More

rand() and srand() in C

Samual Sam

Samual Sam

Updated on 24-Jun-2020 11:26:35

16K+ Views

rand()The function rand() is used to generate the pseudo random number. It returns an integer value and its range is from 0 to rand_max i.e 32767.Here is the syntax of rand() in C language, int rand(void);Here is an example of rand() in C language, Example Live Demo#include #include int main() ... Read More

swap() function in C++

Samual Sam

Samual Sam

Updated on 24-Jun-2020 11:22:01

22K+ Views

The swap() function is used to swap two numbers. By using this function, you do not need any third variable to swap two numbers.Here is the syntax of swap() in C++ language, void swap(int variable_name1, int variable_name2);If we assign the values to variables or pass user-defined values, it will swap ... Read More

Const member functions in C++

Samual Sam

Samual Sam

Updated on 24-Jun-2020 11:19:02

19K+ Views

The const member functions are the functions which are declared as constant in the program. The object called by these functions cannot be modified. It is recommended to use const keyword so that accidental changes to object are avoided.A const member function can be called by any type of object. ... Read More

Difference between %d and %i format specifier in C

Samual Sam

Samual Sam

Updated on 24-Jun-2020 11:17:57

2K+ Views

Format Specifier %dThe format specifier %d takes integer value as a signed decimal integer value which means values should be decimal whether it is negative or positive.Here is an example of format specifier %d in C language, Example Live Demo#include int main() {    int v1 = 7456;    int ... Read More

strpbrk() in C

Samual Sam

Samual Sam

Updated on 24-Jun-2020 11:16:33

1K+ Views

The function strpbrk() is used to find the first character of first string and matches it to any character of second string. It returns NULL, if no matches are found otherwise, it returns a pointer to the character of first string that matches to the character of second string.Here is ... Read More

Advertisements