Programming Articles

Page 2525 of 2547

What is the function of action in JSP?

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 537 Views

This action lets you insert files into the page being generated. The syntax looks like this −Unlike the include directive, which inserts the file at the time the JSP page is translated into a servlet, this action inserts the file at the time the page is requested.Following table lists out the attributes associated with the include action −S.No.Attribute & Description1pageThe relative URL of the page to be included.2flushThe boolean attribute determines whether the included resource has its buffer flushed before it is included.ExampleLet us define the following two files (a)date.jsp and (b) main.jsp as follows −Following is the content of ...

Read More

C++ Program to Implement First Fit Decreasing for 1-D Objects and M Bins

Nancy Den
Nancy Den
Updated on 30-Jul-2019 229 Views

Here is a C++ Program to implement First Fit Decreasing for 1-D objects and M binsRequired functions and pseudocode:Begin    function binPack() returns number of bins required.    Initialize binC = 0    Initialize an array to store binVal.    Place items one by one.    function sort() to perform bubble sort in the descending order. EndExample Code#include using namespace std; void binPack(int *a, int s, int n) {    int binC = 0;    int binVal[n];    for (int i = 0; i < n; i++)    binVal[i] = s;    for (int i = 0; i < ...

Read More

What are JSP declarations? In how many ways we can write JSP declarations?

Samual Sam
Samual Sam
Updated on 30-Jul-2019 351 Views

A declaration declares one or more variables or methods that you can use in Java code later in the JSP file. You must declare the variable or method before you use it in the JSP file.Following is the syntax for JSP Declarations −You can write the XML equivalent of the above syntax as follows − code fragment Following is an example for JSP Declarations −

Read More

Create Ennead Tuple from another collection in Java

Arjun Thakur
Arjun Thakur
Updated on 30-Jul-2019 179 Views

To create Ennead Tuple from another collection, use the fromCollection() method. Using this method, create an Ennead Tuple using List collection. Let us first see what we need to work with JavaTuples. To work with Ennead class in JavaTuples, you need to import the following package.import org.javatuples.Ennead;Note Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path -> Add External Jars and upload the downloaded JavaTuples jar file. Refer the below guide for all the steps to run JavaTuples.Steps: How to run JavaTuples program in EclipseThe ...

Read More

C++ Program to Compare Binary and Sequential Search

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 706 Views

Binary Search and Sequential or Linear Search both are used in computer programming to search an element. The time complexity of Binary Search is O(log(n)) and Sequential Search is O(n).AlgorithmBegin    Algorithm for Binary Search:    BinarySearch() function with ‘arr’ the array of data and ‘n’ the number of values, start and end index, iteration count and element to be searched in the argument list.    Increment iteration counter and compare the item value with the a[mid].    If item < a[mid] choose first half otherwise second half to proceed further.    Return iteration value on successful search. EndExample Code#include ...

Read More

How to declare an object of a class using JSP declarations?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 1K+ Views

A declaration declares one or more variables or methods that you can use in Java code later in the JSP file. You must declare the variable or method before you use it in the JSP file.Following is the syntax for JSP Declarations −You can write the XML equivalent of the above syntax as follows − code fragment Following is an example of Object declaration in JSP Declarations −

Read More

How are variables scoped in C

Anvi Jain
Anvi Jain
Updated on 30-Jul-2019 149 Views

Here we will see how the C variables are scoped. The variables are always statically scoped in C. Binding of a variable, can be determined by the program text. These are independent of runtime function call stack.Let us see one example to get the idea.Example# include int x = 0; int my_function() {    return x; } int my_function2() {    int x = 1;    return my_function(); } int main(){    printf("The value is: %d", my_function2()); }OutputThe value is: 0Here the result is 0. Because the value returned by my_function() is not depends on the function, which is ...

Read More

What is the difference between include action and include directive in JSP?

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 2K+ Views

include action lets you insert files into the page being generated. The syntax looks like this −Unlike the include directive, which inserts the file at the time the JSP page is translated into a servlet, this action inserts the file at the time the page is requested.

Read More

C++ Program to Perform Searching Using Self-Organizing Lists

George John
George John
Updated on 30-Jul-2019 465 Views

Self-Organizing list basically updates the list of given range of items on the basis of last searched item. In this method, the sequential searching approach is used. This algorithm shifts the more important data to the beginning of the list. The time complexity of this search technique is O(n).AlgorithmBegin    Function FibonacciSearch().    Calculate the mid value using ‘start+fib[index-2]’ expression.    If the chosen item is equal to the value at mid index, print result and return to main.    If it is lesser than the value at mid index, proceed with the left sub-array.    If it is more ...

Read More

C++ Program to Implement a Binary Search Algorithm for a Specific Search Sequence

Ankith Reddy
Ankith Reddy
Updated on 30-Jul-2019 614 Views

In this Program we need to implement binary search to find the existence of a search sequence in an array. The time complexity of Binary search is O(log(n)).Required steps and pseudocodesBegin    BinarySearch() function has ‘arr’ the array of data and ‘n’ the number of values, start and end index, iteration count and b[0] be the element to be searched in the argument list.    Increment the iteration counter and compare the item value with the a[mid].    If item < a[mid] choose first half otherwise second half to proceed further.    Return index value to main.    In main(), ...

Read More
Showing 25241–25250 of 25,469 articles
Advertisements