Source code for Insertion sort in C language.
#include
#define NUM 6
main() {
int arr[NUM],i,j;
// start reading nums
for(i=0;i
Source code for Insertion sort in C language.
#include
#define NUM 6
main() {
int arr[NUM],i,j;
// start reading nums
for(i=0;i
Tags:
The code for the selection sort in C lang is provided below.
#include
#define NUM 6
void swap(int arr[], int i, int j) {
int tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
}
main() {
int arr[NUM],i,j;
// start reading nums
for(i=0;i arr[j])
swap(arr,i,j);
// print sorted arr
for(i=0;i
Please point your web link to this page if you are using this code for any purposes.
Bookmark it!
These icons […]
Tags:
Please follow the below steps before coding the upload script in jsp.
1. Download the commons-upload.jar from Apache’s website.
2. Put that jar file into the classpath, i.e in WEB-INF/lib/ directory.
3. Then create a jsp file with the following code and any static HTML page for initial page.
The code here goes:
<%@ page import=”org.apache.commons.fileupload.*,
org.apache.commons.fileupload.servlet.ServletFileUpload,
org.apache.commons.fileupload.disk.DiskFileItemFactory,
org.apache.commons.io.FilenameUtils,
java.util.*,
java.io.File,
java.lang.Exception,
java.io.*,
java.net.*,
org.apache.poi.hssf.usermodel.*” %>
<h1>Data Received at the […]
Tags:
On the client side, the client’s browser must support form-based upload. Most modern browsers do, but there’s no guarantee. For example,
<FORM ENCTYPE=’multipart/form-data’
method=’POST’ action=’/myservlet’>
<INPUT TYPE=’file’ NAME=’mptest’>
<INPUT TYPE=’submit’ VALUE=’upload’>
</FORM>
The input type “file” brings up a button for a file select box on the browser together with a text field that takes the file […]
Tags:
In this article we’ll show you how to read and write Excel files and how to read any Microsoft file’s document properties.
Conventions
The POI project is nearing a 2.0 release and is in a stage of rapid development, with new features and changes integrating nightly. In order to keep this article relevant, we’ll refer to […]
Tags:
Start to refer the books ….
1. Knuth’s all the volumes (three) on programming/Algorithms.
2. Programming Perls
3. How to solve it by Computer by Dromey
4. Algorithms and DataStructures by Alen Wiss (standard datastructures)
Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new web pages.
Tags:
Note: Information & code samples from this article are tested on SQL Server 2005 RTM (Yukon) and found to be working. Will update the article in case of any compatibility issues.
unfortunately, there is no built-in support for arrays in SQL Server’s T-SQL. SQL Server 2000 did add some new datatypes like sql_variant, bigint etc, but […]
Tags:
A stored procedure or function can be created with no parameters, IN parameters, OUT parameters, or IN/OUT parameters. There can be many parameters per stored procedure or function.
An IN parameter is a parameter whose value is passed into a stored procedure/function module. The value of an IN parameter is a constant; it can’t be changed […]
Tags:
This example demonstrates how to call stored procedures with IN, OUT, and IN/OUT parameters.
CallableStatement cs;
try {
// Call a procedure with no parameters
cs = connection.prepareCall(”{call myproc}”);
cs.execute();
[…]
Tags:
When reading and writing text files :
it is almost always a good idea to use buffering (default size is 8K)
it is often possible to use references to abstract base classes, instead of references to specific concrete classes
there is always a need to pay attention to exceptions (in particular, IOException and FileNotFoundException)
The close method :
always needs […]
Tags: