I am trying to run the code that was run on Jboss already from the command line. Now i want to make it as a Tomcat project running from the IDE. Don't know how to deploy the WAR file and EAR file to get it run.. .. To code compile fine and run to the home page, but when ia mtrying to access the database i have this error J un 22, 2012 12:13:39 PM org.apache.catalina.core.ApplicationContext log INFO: action: Processing a GET for /login Jun 22, 2012 12:13:39 PM org.apache.catalina.core.ApplicationContext log INFO: action: Setting locale 'en_US' Jun 22, 2012 12:13:39 …

Member Avatar
Member Avatar
+0 forum 1

I am trying to write the string to text file after heap sort.... it works correctly, just don't know why there's some weird charracter in the output file.. Any help with be appreciated. Content of input file in1 is abc efg ghi q w Thanks [CODE]#include <stdio.h> #include <ctype.h> #include <string.h> #include<iostream> using namespace std; #define DISPLAY 80 #define PAGE_LENGTH 20 void fnSortHeap(char array[], int arr_ubound); int main(int argc, char *argv[]) { char filename[80]="in1.dat"; FILE *pfile; char buffer[80]; int count = 0; int lines = 0; int i = 0; if((pfile = fopen(filename, "rb")) == NULL){ printf("Sorry, can't open %s", …

Member Avatar
Member Avatar
+0 forum 1

I am writing code to open file and read info from that file to open other files, dont' know why it's only open the first file, not file after that THanks [CODE] /* strtok example */ #include <stdio.h> #include <string.h> #include <iostream> using namespace std; void remove ( char str[] ,int rem) ; int main () { FILE *file; int i; int j=0; // char fileparam1[16] ; char arraytotal [15000]; int start =0 ; int k = 0 ; // for the rest int u = 0 ; //for final loop int t = 0; // for in.dat file char …

Member Avatar
Member Avatar
+0 forum 2

I am writing a code to read file and output stuff for two files and combine them together... Don't know why they read good at the first file but wit the same code , it didn't show up for the second file Please help Thanks [CODE]#include <stdio.h> #include <string.h> #include <stdio.h> #include <stdlib.h> using namespace std; #include <iostream> int main() { FILE *file; int i; int j=0; char fileparam[16] ; char arraytotal [200]; int start =0 ; int k = 0 ; if(sprintf(fileparam, "in0.dat",i) ) { file = fopen(fileparam,"r"); if(file==NULL) { printf("Error: %s does not exist\n",fileparam); } else { printf("%s …

Member Avatar
Member Avatar
+0 forum 6

I want to readfile and merge them all to the arraytotal array , It works fine for individual file, don't know why, it printed out some weird character for the final Thanks [CODE]#include <stdio.h> #include <string.h> #include <stdio.h> #include <stdlib.h> using namespace std; #include <iostream> void fnSortHeap(char array[], int arr_ubound); int main() { FILE *file; int i; int j=0; char fileparam[200] ; // char fileparam1[16] ; char arraytotal [1000]; int start =0 ; int k = 0 ; if(sprintf(fileparam, "in0.dat",i) ) { file = fopen(fileparam,"r"); if(file==NULL) { printf("Error: %s does not exist\n",fileparam); } else { printf("%s was opened successfully.\n", fileparam); …

Member Avatar
Member Avatar
+0 forum 1

I want to open different file names, at first it work well on couple files, but it has to be in order, what if i open random file like fall01, fall05,srping09 etc Thanks [CODE]#include <stdio.h> #include <string.h> #include <stdio.h> #include <stdlib.h> using namespace std; #include <iostream> int main() { FILE *file; int i; char fileparam[16]; for(i =1; i<=10;i++) { if( sprintf (fileparam, "fall%d.dat", i) == true ) { file = fopen(fileparam,"r"); } if(file==NULL) { printf("Error: %s does not exist\n",fileparam); printf("Error: can't open file.\n");system("pause"); } else { printf("%s was opened successfully.\n", fileparam); printf("Good\n"); system("pause"); } }// done for // the rest …

Member Avatar
Member Avatar
+0 forum 7

[CODE]#include <iostream> using namespace std; int main() { //delcare varialbe char selection; //declare function void counting_loop(); void impossible(); void missing_item(); void odd_even(); void poem(); void pause_m(void); do { cout << " Welcome to the Fun Program" << endl; cout << " Select from the menu " << endl ; cout << "A gets Counting loop. " << endl; cout << "B gets Impossible."<< endl; cout << "C gets Missing Item."<< endl; cout << "D gets Odd or Even." << endl ; cout << "E gets Poem." << endl; cout << " Enter the letter of your choice. " << endl; …

Member Avatar
Member Avatar
+0 forum 3

Can you guy help me to test this program.... Its compile ... but just want to make sure that its completely right And I wanna add the function to set error when dividing to 0

Member Avatar
+0 forum 0

[CODE]using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; namespace WebApplication5 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { SqlConnection conn = new SqlConnection( " Server =localhost\\SqlExpress; Database= Dorknozzle; " + "Integrated Secutiry = True" ) ; SqlCommand comm = new SqlCommand( "SELECT EmployeeID, Name FROM Employees", conn); conn.Open(); SqlDataReader reader = comm.ExecuteReader(); reader.Close(); conn.Close(); while (reader.Read()) { employeesLabel.Text += reader["Name"] + "<br/>"; } reader.Close(); conn.Close(); } } }[/CODE] [CODE] <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication5._Default" %> <%@ …

Member Avatar
Member Avatar
+0 forum 5

[CODE]namespace WebApplication4 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnAdd_Click(object sender, EventArgs e) { if (upImage.HasFile) { if (CheckFileType(upImage.FileName)) { string fielPath = " !/UploadImages/" + upImage.FileName; upImage.SaveAs(MapPath(filePath)); } } } bool CheckFileType(string fileName) { string ext = Path.GetExtension ( fileName); switch (ext.ToLower()) { case ".gif" : return true; case ".png:" : return true; case ".jpg" : return true; case " .jpeg" : return true ; default : return false ; } } void Page_Prerender() { string upFodler = MapPath("~/UploadImages/"); DirectoryInfo dir = new DirectoryInfo(upFolder); dlstImages.DataSouce = dir.GetFiles(); dlstImages.DataBind(); …

Member Avatar
Member Avatar
+0 forum 3

I was trying to link those file but it occur the compiling error anyhellp would be appriciated

Member Avatar
Member Avatar
+0 forum 2

[CODE]//****************************************************** // Filename: Solution_Lab_03.cpp // Purpose: Paint Your House Calculations // Author: Ken Busbee; ? 2008 Kenneth Leroy Busbee // Date: Dec 24, 2008 //****************************************************** // Headers and Other Technical Items #include <iostream> using namespace std; // Function Prototypes void pause(void); double getValue(); double calculateArea(); double numgallons(); double totalCost(); //****************************************************** // main //****************************************************** int main(void) { // Input - Test Data = 100, 40, 10, 28.49, 250 // - Alternate Test Data = 20, 30, 10, 12.34, 350 getValue(); // function get value calculateArea(); // calculate total area numgallons(); // calculate the number of fallons totalCost() ; // calculate the …

Member Avatar
Member Avatar
+0 forum 6

[CODE]#include <iostream> #include <iomanip> #include <cctype> #include "account.h" #include "CharRange.h" using namespace std; void displayMenu(); void makeDeposit(Account &); void withdraw(Account&); int main() { Account savings; // account object to model a saving account CharRange input('A', 'G') char choice; cout << fixed << showpoint << setprecision (2); do { displayMenu(); choice = input.getChar(); switch (choice) { case 'A' : cout << " The current balance is $ " ; cout << savings.getTransactions() << " transactions.\n"; break ; case 'B' : cout << " There have been " ; cout << " savings.getTransactions () <<" transactions.\n " ; break; case 'C' : …

Member Avatar
Member Avatar
+0 forum 2

[CODE]#include <iostream> using namespace std; class BigNum { private : int biggest; void determineBiggest ( int num) { if (num > biggest) biggest = num ; } public : BigNum () { biggest = 0 ; bool examineNum(int); int getBiggest() { return biggest; } }; bool BigNum::examineNum(int n) { bool goodValue = true ; if (n>0) determineBiggest(n); else goodValue = false; return goodValue; } void getNumbers(BigNum&); int main() { Bignum stockShares; cout <<" This program determines which stock purchase involved\n" <<" the largest number of shares of stock. \n\n " ; getNumbers(stockShares); cout << "\n The largest number of shares …

Member Avatar
Member Avatar
+0 forum 2

[CODE]#include <iostream> #include <iomanip> using namespace std; int main() { string name; char indicator = 'c' ; // Input indicator char answer1,answer2,answer3,answer4,answer5; int count1,count2,count3,count4,count5; cout << " Welcome to Risk master, answer those 5 questions to calculate how risky your partner is"; cout << " Rule : press Y for Yes, N for No, No space for the name " ; cout << " Enter name : " << endl; cin >> name ; while ( indicator == 'c' || indicator == 'C' ) { cout << endl << " Income > 100k/year : " ; cin >> answer1; if …

Member Avatar
Member Avatar
+0 forum 9

[CODE]#include <iostream> #include <stdlib.h> using namespace std; void GetTime ( int*, int*, int* ); int CalcSeconds ( int, int, int ); int main() { int hr, min, sec; char another; int total_sec; cout << " \n\n Welcome to a time-conversion program ! \n\n " ; do { GetTime( &hr,&min, &sec); total_sec = CalcSeconds( hr, min, sec); cout << "\n\n You entered " << hr << ":" << min << ":" << sec; cout << "\n It is" << total_sec << " seconds " ; cout << "\n\n Do another ? y or n "; cin >> another ; } while …

Member Avatar
Member Avatar
+0 forum 10

[CODE]#include <iostream> using namespace std; #include <iomanip> #include <cstdlib> enum RequestType { ZERO_BALANCE = 1 , CREDIT_BALANCE, DEBIT_BALANCE,END} int getRequest(); bool shouldDisplay ( int, double); void outputLine ( int, const char*const, double); int main () { ifstream inClientFile( "clients.txt", ios::in); if ( !inClientFile) { cerr << " File could not be opened " << endl; exit (1); } int request; int account ; char name [30]; double balance; request = getRequest(); while ( request !=END) { switch (request) { case ZERO_BALANCE : cout << " \nAccounts with zero balance : \n"; break; case CREDIT_BALANCE: cout << " \nAccounts with credit …

Member Avatar
Member Avatar
+0 forum 5

[CODE]#include <iostream> using namespace std; #include <string> class Engine { int power; public: Engine() {power=0;}; Engine (int pIn) { power = pIn;}; void show (); float getPower () {return power;}; }; void Engine::show() { cout << " This is an engine have a power of " << power << " KWH " << endl; return; } class Car : public virtual Engine { int speed; char mark [20]; float price; public : Car(); Car (int ,int ,char[],float); void show(); float getSpeed () {return speed;}; char[] getMark() {return mark;}; float getPrice() {return price;); }; Car :: Car():Engine () { speed =0 …

Member Avatar
Member Avatar
+0 forum 1

[CODE]#include <iostream> #include <cmath> using namespace std; const float G = 32.17; // function declaration float caltime ( float,float, float ); float calheight ( float,float,float); // main function int main() { float theta, cotheta, sitheta, distance, velocity, time, height; cout << " Input the angle of elevation : " << endl; cin >> theta; cotheta = cos(theta); sitheta = sin (theta); cout << " Input the distance : " << endl ; cin >> distance; //use function time = caltime ( distance,velocity, cotheta); height = calheight ( velocity, sitheta, time) ; cout << " The flight will reach in the …

Member Avatar
Member Avatar
+0 forum 3

[CODE]#include <iostream> #include <cmath> using namespace std; const float G = 32.17; // function declaration float caltime ( float,float, float ); float calheight ( float,float,float); // main function int main() { float theta, float cotheta, float sitheta, float distance, float velocity, float time, float height; cout << " Input the angle of elevation : " << endl; cin >> theta; cotheta = cos(theta); sitheta = sin (theta); cout << " Input the distance : " << endl ; cin >> distance; //use function time = caltime ( distance,velocity, cotheta); height = calheight ( velocity, sitheta, time) ; cout << " …

Member Avatar
Member Avatar
+0 forum 4

[CODE]#include <iostream> #include <cmath> using namespace std; float scale (float,int) ; int main() { float num1; int num2 ; cout << "Enter a real number : " ; cin >> num1; cout << " Enter an integer: " ; cin >> num2; cout << " Result of call to function scale is " << scale (num1,num2) << endl; return 0; } float scale ( float x, int n) { float scaleFactor; scaleFactor = pow(10, n ); return (x * scaleFactor); } [/CODE] the problem is : " 22 C:\Documents and Settings\QuynhlNguyen\My Documents\Final\scale.cpp call of overloaded `pow(int, int&)' is ambiguous "

Member Avatar
Member Avatar
+0 forum 1

[code] #include "magic.h" #include <conio.h> #include <iostream> using namespace std; int main() { float throttle; float frate_; const float time = 10000; float vvel_ = 5; cout << "Hey, this is starfleet, your orders are to safely land this ship" << " with a " << endl << "velocity greater than " << vvel_ << "good luck captain "<< endl << endl; lunar_lander s(1000.0, 0.0, 10.0,900.0,0.0,5000.0,900.0); while(s.getalt() > 0) { cout <<"Altitude is " << s.getalt() << endl; cout <<"Fuelleft " << s.getmassl() << endl; cout <<"Thrust " << s.frate(throttle/10) << endl; cout <<"Velocity is " <<s.vvel() << endl; cin …

Member Avatar
Member Avatar
+0 forum 3

[CODE] // Description: This is a computer version of the game hangman, the user // can play against a 2nd player or the computer, and he can enter how many // guesses he gets, // // Start of program // Header file definitions #include <iostream> // Standard input/output #include <string> // String manipulation #include <cctype> // Character manipulation and testing #include <fstream> // File stream #include <cstdlib> // Used for random function #include "DRAW.h" // Draws hangman using namespace std; // Function declerations void DrawGallows(int State); void instruction(int& choice); // Gives instructions and gets choice void usergame(int i); // Plays …

Member Avatar
Member Avatar
+0 forum 1

[CODE]// file: hangman.cpp // name: Kyle Burmark // professor: M. Gelotte // date: 2/26/02 // Description: This is a computer version of the game hangman, the user // can play against a 2nd player or the computer, and he can enter how many // guesses he gets, // // Start of program // Header file definitions #include <iostream> // Standard input/output #include <string> // String manipulation #include <cctype> // Character manipulation and testing #include <fstream> // File stream #include <cstdlib> // Used for random function #include <time.h> // Used for better random number #include <draw.h> // Draws hangman using namespace …

Member Avatar
Member Avatar
+0 forum 32

void EnterWord() { char solution[20]; //holds solution char blank[20]; //holds "*"'s for unsolved letters int Subscript=0; int State=1; char Guess[20]; char Copy [20]; char Letter; int Correct =0 ; // input the string and getline it cout<<"Enter phrase 20 chars or less."<<endl; cin.getline(solution, 20); int Word; // this will hold the subscript of our word int Size; // this will hold the length of our word int State = 1 ; // This will hold the game state. int Subscript= 0; // This will hold the subscirpt char Guess [MAX_WORD_SIZE]; // this will hold their current word char Copy [MAX_WORD_SIZE]// …

Member Avatar
Member Avatar
+0 forum 6

[CODE]#include <iostream> #include <fstream> #include <string> #include <cctype> using namespace std; #define MAX_WORD_SIZE 15 // The maximum size of word #define MAX_WORDS 255 // the max number of words void EnterWord(); void LoadFile(); void ChooseWord(); void RunGame(); void instruction(); void DrawGallows(int State); typedef char String [MAX_WORD_SIZE]; // a char type with 15 characters String Words [MAX_WORDS-1]; int Count; // word count char menu; char Continue; char choice; int main() { instruction(); cout << "Choice: "; cin >> choice; cout << " " << endl; while (Continue =='Y') { cout<<"Welcome to Hangman . . . Don't lose your head!"<<endl; switch(choice) { …

Member Avatar
Member Avatar
+0 forum 6

[CODE]#include <iostream> using namespace std; #include <string> #include <cctype> void DrawGallows(int ); int main() { char solution[20]; //holds solution char blank[20]; //holds "*"'s for unsolved letters int counter = 0; //general-use counter int right = 0; //1 = right guess, 0 = wrong guess. char guess; cout<<"Enter phrase 20 chars or less."<<endl; cin.getline(solution, 20); int puzzLength = strlen(solution); //finds lengtrh of puzzle, stores INT value to puzzlength //convert puzzle to full uppercase for (counter = 0; counter < puzzLength; counter++){ solution[counter] = toupper(solution[counter]); } //done converting strcpy(blank, solution); //copy solution to the 'blank' array for (counter = 0; counter < …

Member Avatar
Member Avatar
+0 forum 1

[CODE] // filename = isbn.cpp // Kyle Burmark // Prof. Gelotte // 02/12/02 // Program 4 - Validate ISBN numbers program // Description: This program asks the user whether he wants to validate // ISBN numbers from his own input or from a file of isbn numbers // Start program // Header files #include <iostream> // In/Out, standard #include <fstream> // File input/output #include <cctype> // Character testing #include <string> // String using namespace std; // Constant declarations const char NWLN = '\n'; // Defines newline in stream // Function declarations void instruction(); // Displays instructions void userinput(char&); // Gets …

Member Avatar
Member Avatar
+0 forum 1

[CODE=cplusplus]// CS 210 EDDIE CHEN // THIS IS PROGRAM 4 (ISBN-Check), a program that verifies ISBN. #include <iostream> #include <fstream> // REQUIRED FOR FILE STREAMS #include <cstdlib> // FOR DEFINITION OF EXIT_FAILURE #include <cctype> #include <string> using namespace std; // ASSOCIATE STREAMS WITH EXTERNAL FILE NAMES #define inFile "isbntest.txt" // LINKED ISBN FILE (LIST) SOURCE // FUNCTIONS USED void menuPrompt (); // MAIN MENU USER INSTRUCTION void userVal (); // MANUAL INPUT VALIDATION int readFile (); // LINKED FILE VALIDATION bool isbnCheckForUser (string isbn); // ISBN VALIDATION FUNCTION FOR USER INPUT bool isbnCheckForFile (string isbn); // ISBN VALIDATION FUNCTION FOR …

Member Avatar
Member Avatar
+0 forum 8

[code]An ISBN (International Standard Book Number) identifies a unique publication. An ISBN is ten digits. The first nine digits must be decimal digits (0...9). The tenth may a decimal digit or the letter X, according to the checksum, discussed below. Three single dashes may be between any of the characters, but an ISBN must not begin or end with a dash. Some example ISBNs: 0-201-88337-6 0-13-117334-0 0821211315 (no dashes ok) 1-57231-866-X The last character of an ISBN number is a checksum. The checksum is the determined by the first 9 digits; it is computed by taking modulo 11 (the remainder …

Member Avatar
Member Avatar
+0 forum 8

The End.