Category: Code . Programming Samples . প্রোগ্রাম উদাহরন

Code . Programming Samples . প্রোগ্রাম উদাহরন

FruitTest.java: A class that connects to either an Oracle or a Sybase database and prints out the values of predetermined columns in the “fruits” table.

# FruitTest.java  A class that connects to either an Oracle or a Sybase database and prints out the values of predetermined columns in the “fruits” table. package cwp; import java.sql.*; /** A JDBC example that connects to either an Oracle or  *  a Sybase database and prints out the values of  *  predetermined columns in …

Continue reading

ContactSection.jsp A snippet of a JSP page. It defines a field (accessCount), so pages that include it and want to directly utilize that field must use the include directive, not jsp:include.

ContactSection.jsp হচ্ছে JSP পৃষ্ঠার একটি অংশ।এটি একটি ফিল্ডকে সঙ্গায়িত করে (accessCount), সুতরাং যে পৃষ্ঠায় এটি অন্তর্ভুক্ত থাকে এবং সরাসরি উক্ত ফিল্ড ব্যবহার করাতে চায় তাকে আবশ্যই include directive ব্যবহার করতে হবে, jsp:include নয়।. <%@ page import=”java.util.Date” %> <%– The following become fields in each servlet that      results from a JSP page that includes this file. –%> <%! …

Continue reading

J2SE : LinkedList and Iterators in Java

/*  * LinkedList.java  *  * Created on January 10, 2008, 8:51 PM  *  * To change this template, choose Tools | Template Manager  * and open the template in the editor.  */ package linkedlist; import java.util.List; import java.util.LinkedList; import java.util.Iterator; import java.util.ListIterator; import java.util.Collections; import java.util.Random; /**  *  * @author Sayed  */ public class LinkedListTest …

Continue reading

Use sorting criterion in sort function

/* The following code example is taken from the book  * “The C++ Standard Library – A Tutorial and Reference”  * by Nicolai M. Josuttis, Addison-Wesley, 1999  *  * (C) Copyright Nicolai M. Josuttis 1999.  * Permission to copy, use, modify, sell and distribute this software  * is granted provided this copyright notice appears in …

Continue reading

Sort objects stored in deque

/* The following code example is taken from the book  * “The C++ Standard Library – A Tutorial and Reference”  * by Nicolai M. Josuttis, Addison-Wesley, 1999  *  * (C) Copyright Nicolai M. Josuttis 1999.  * Permission to copy, use, modify, sell and distribute this software  * is granted provided this copyright notice appears in …

Continue reading

Expressions.jsp Page that demonstrates JSP expressions. Uses the JSP-Styles style sheet.

Expressions.jsp  Page that demonstrates JSP expressions. Uses the JSP-Styles  style sheet. <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”> <!– Example of JSP Expressions.     Taken from Core Web Programming Java 2 Edition from Prentice Hall and Sun Microsystems Press, . May be freely used or adapted. –> <HTML> <HEAD> <TITLE>JSP Expressions</TITLE> <META NAME=”keywords”       …

Continue reading

A simple C++ Program code

#include <iostream> #include <fstream> using namespace std; int main() {   ifstream in(“test”, ios::in | ios::binary);   if(!in) {     cout << “Cannot open input file.\n”;     return 1;   }   double num;   char str[80];   in.read((char *) &num, sizeof(double));   in.read(str, 14);   str[14] = ‘\0’; // null terminate str   cout …

Continue reading

valarray with double value inside

/* The following code example is taken from the book  * “The C++ Standard Library – A Tutorial and Reference”  * by Nicolai M. Josuttis, Addison-Wesley, 1999  *  * (C) Copyright Nicolai M. Josuttis 1999.  * Permission to copy, use, modify, sell and distribute this software  * is granted provided this copyright notice appears in …

Continue reading

Print minimum, maximum, and sum of the valarray

/* The following code example is taken from the book * “The C++ Standard Library – A Tutorial and Reference” * by Nicolai M. Josuttis, Addison-Wesley, 1999 * * (C) Copyright Nicolai M. Josuttis 1999. * Permission to copy, use, modify, sell and distribute this software * is granted provided this copyright notice appears in …

Continue reading

valarray slice

/* The following code example is taken from the book * “The C++ Standard Library – A Tutorial and Reference” * by Nicolai M. Josuttis, Addison-Wesley, 1999 * * (C) Copyright Nicolai M. Josuttis 1999. * Permission to copy, use, modify, sell and distribute this software * is granted provided this copyright notice appears in …

Continue reading