jwenting 1,905 duckman Team Colleague

join will make one thread wait until another completes. You can chain this (by having a joined thread join another thread itself), but it gets tricky (and if you do, why use threads at all as you're effectively moving away from concurrent processing and back to a linear application flow).

You cannot have one thread join several others at the same time for the simple reason that the action of joining makes the thread wait on the other thread (and therefore you cannot have it join something else again until the join is ended for whatever reason).

jwenting 1,905 duckman Team Colleague

Java is actually quicker than C++, since libraries are determined before its compiled. So once compiled, the library is carried with the program, unlike C, which has to determine after

almost correct. The real reason is that the bytecode compiler can create optimised code for every specific platform it may run on.
Java may LOAD slower than C++ (especially if you count JVM startup time) but once the program starts running there will not be a significant difference.
This is especially true for programs that spend most of their time waiting for user input.
What does it matter if your calculations take 10ms or 11ms if the application then has to wait a minute for the user?

jwenting 1,905 duckman Team Colleague

Some of my all-time favourites:
M.A.S.H.
Dukes of Hazzard
Battlestar Galactica

I'd indeed hardly call 1980s and 1990s shows retro ;)

jwenting 1,905 duckman Team Colleague

In the Netherlands there's been a movement by banks to get rid of cash for years now.
They have now outfitted every bankcard to be a chipcard (as well as a traditional magnetic strip swipecard), and installed machines where one can transfer money from your bankaccount onto the chip. Payment is then anonymous, no information about the chip is recorded by the recipient (and on the chip only the amount of the transaction and a timestamp are kept for a while).
Since a few years the government is stepping into the thing as well by making ever more payment machines in parking garages and on the streets accept only chips (or to accept both chips and cash).

The system works well but isn't generally accepted. Not only do banks charge people to accept payment using the system which is higher than the payment they charge to deposit cash (why the heck do they charge for that btw?) but the chips are somewhat fragile (I've had to replace my bankcard every year since the chips were introduced because the chip was damaged rather than once every 5 years previously which is the normal replacement period for the cards).

It does seem stores are now starting to get into the system as well at last, as they're starting to refuse very small cash payments just as they refuse large cash payments already (in favour of bank cards direct debit).

jwenting 1,905 duckman Team Colleague

Accepting only paypal as a payment service is a big block towards receiving donations (as are the rates which seem steep compared to what sites I donate to charge).

People in many countries can't use paypal at all and personally I don't trust them (there's been too much trouble with their reliability, plus extremely poor service in case of bad transactions) and as the monetary system is all about trust that means I won't use them.

I understand that pp is the easiest system to set up but please consider other options like credit card payments (which don't have to be more expensive than is pp and are a lot more secure).

I've taken up this issue with several other sites: I won't donate to a group that accepts only pp nor will I buy any product where pp is the only payment option.

Cheques and IMOs are also not really an option. Cheques don't exist here and IMOs cost a ton to use. I've sent cash through the mail successfully but you have to know how to mask the package so as to not make it look like cash (plus I've heard that in some areas it's illegal to send or receive cash through the mail).

jwenting 1,905 duckman Team Colleague

Why are you combining C++ STL with old-style C constructs anyway?

It would become a lot easier if you use list<string> instead (and fstream functions for the file handling).

jwenting 1,905 duckman Team Colleague

compiled your code using BCC55 and it does nothing like you claim.

what does happen I quote here:

put 1
MAIN: cmd = put, d = 1
put 2
MAIN: cmd = put, d = 2
put 3
MAIN: cmd = put, d = 3
put 4
MAIN: cmd = put, d = 4
pop
pop
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
ab eterno...

put 4
MAIN: cmd = put, d = 4
put 5
MAIN: cmd = put, d = 5
put 6
MAIN: cmd = put, d = 6
put 7
MAIN: cmd = put, d = 7
pop
pop
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3
i = 3

jwenting 1,905 duckman Team Colleague

Quite simple. The execution "mycat file2 2>file3" places the error output from "mycat file2" into the file "file3".
As file2 doesn't exist this new file will contain the text "file2 doesn't exist".

Remember the assignment says to print error output to stderr? What you do with 2>file3 is redirect stderr from the console to a file named "file3".

jwenting 1,905 duckman Team Colleague

One of the strengths of C (and C++ and other languages) is that you can do just about anything you want.
An image file is nothing more or less than a collection of data. If you know the algorithm you can decipher that data.
http://www.wotsit.org/ has a lot of information about file formats (not just graphic) which you can use (including quite often implementations in several languages as examples).

More platform specific, several compilers ship with their own libraries to load and display images of several formats (Borland and Microsoft for example in their C++ platforms).

jwenting 1,905 duckman Team Colleague

I made no logical changes in the code.
All I did was reformat what was there, adding some indentation...

jwenting 1,905 duckman Team Colleague

OK, done some formatting on that code to see how it looks...

#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <conio>

class phoneBook
{
	char name[20],phno[6];
	
	public:
	
	void getdata();
	void showdata();
	char *getname(){ return name; }
	char *getphno(){ return phno; }
	void update(char *nm,char *telno)
	{
		strcpy(name,nm);
		strcpy(phno,telno);
	}
};

void phoneBook :: getdata()
{
	cout<<"\nEnter Name : ";
	cin>>name;
	cout<<"Enter Phone No. : ";
	cin>>phno;
}

void phoneBook :: showdata()
{
	cout<<"\n";
	cout<<setw(15)<<name;
	cout<<setw(8)<<phno;
}


int main()
{
	phoneBook rec;
	fstream file;
	file.open("phone.dat", ios::ate | ios::in | ios:ut | ios::binary);
	char ch,nm[20],telno[6];
	int choice,found=0;
	while(1)
	{
		clrscr();
		cout<<"\n*****Phone Book*****\n";
		cout<<"1) Add New Record\n";
		cout<<"2) Display All Records\n";
		cout<<"3) Search Telephone No.\n";
		cout<<"4) Search Person Name\n";
		cout<<"5) Update Telephone No.\n";
		cout<<"6) Exit\n";
		cout<<"Choose your choice : ";
		cin>>choice;
		switch(choice)
		{
			case 1 : //New Record
				rec.getdata();
				cin.get(ch);
				file.write((char *) &rec, sizeof(rec));
				break;

			case 2 : //Display All Records
				file.seekg(0,ios::beg);
				cout<<"\n\nRecords in Phone Book\n";
				while(file)
				{
					file.read((char *) &rec, sizeof(rec));
					if(!file.eof())
						rec.showdata();
				}
				file.clear();
				getch();
				break;

			case 3 : //Search Tel. no. when person name is known.
				cout<<"\n\nEnter Name : ";
				cin>>nm;
				file.seekg(0,ios::beg);
				found=0;
				while(file.read((char *) &rec, sizeof(rec)))
				{
					if(strcmp(nm,rec.getname())==0)
					{
						found=1;
						rec.showdata();
					}
				}
				file.clear();
				if(found==0)
					cout<<"\n\n---Record Not found---\n";
					getch();
					break;
		
			case 4 : //Search name on basis of tel. no
				cout<<"\n\nEnter Telephone No : ";
				cin>>telno;
				file.seekg(0,ios::beg);
				found=0;
				while(file.read((char *) &rec, sizeof(rec)))
				{
					if(strcmp(telno,rec.getphno())==0)
					{
						found=1;
						rec.showdata();
					}
				}
				file.clear();
				if(found==0)
					cout<<"\n\n---Record Not found---\n";
				getch();
				break;

			case 5 : //Update Telephone No.
				cout<<"\n\nEnter Name : ";
				cin>>nm; …
jwenting 1,905 duckman Team Colleague

let them burn once so they never burn again. One bad grade won't hurt anything but his pride but he may learn from it to think for himself.

Not sadistic, just realism.

jwenting 1,905 duckman Team Colleague

So turn it off and then install Google desktop which stores a literal copy of every file on your harddisk, effectively doubling your storage requirements ;)

thumbs.db files are harmless and make images load faster in preview mode, leave them be. Only reason to remove them is when packing a load of images for some purpose (like when including them with a piece of software as artwork), and then only because it's unprofessional to include unnecessary files.

jwenting 1,905 duckman Team Colleague

ask specific questions, don't ask people to do your homework.
If you're stuck post what you have and tell where you're stumped so people can direct you towards a solution (they may not even give you code, but tell you in words how to go about solving it).

The last thing professionals want is (more, there are quite a lot) of people entering the industry who can't write a line of code. By doing your homework for you that would be exactly what we would be causing.

jwenting 1,905 duckman Team Colleague

More correct C++ usage is to omit the .h from the standard includes. Using the #include <x.h> instead of #include <x> turns on C compatibility mode for the module.

Depending on your compiler you'll get a warning or not about it.

jwenting 1,905 duckman Team Colleague

now why did you alert him to the fact that he shouldn't just submit that code as his assigment?

Don't we want people who're too lazy to do their own work to get burned?

jwenting 1,905 duckman Team Colleague

Another handy one is sort

For example a script that shows disk usage per directory sorted largest first:

du $1 > /tmp/du.out
sort -k1nr -odu.sort.out /tmp/du.out
rm /tmp/du.out

-k1nr tells sort to order the file on the first column, numerically, in reverse order

Tried to get it to work without the temp file but couldn't. For some reason sort refused to accept the output from du through a pipe (but maybe I did something wrong).

jwenting 1,905 duckman Team Colleague

While one currently requires a special UNIX-based computer, such as a Sun machine, to run UNIX, Linux can run on virtually any x86-based PC. (Such as your home computer.) This is definitely a plus for this operating system.

Small correction here, Linux is a Unix variant just like AIX, Solaris, BSD, etc..

UNIX, however, is an alternate OS mainly used by ... er, computer geeks.

Not hardly. Many people use Unix (in one form or another) without ever knowing it.
Mac OS/X users for example are running Unix (OS/X is based on BSD) but most will never get underneath their shiny desktop.
Some Linux distros can be made to look like Windows and there are people using those that have no clue about their OS (some might get a rude surprise trying to install that nice little program they got from that nice person they never heard of but will likely put it down to the program being broken).

And then there's the millions of office workers worldwide who connect to a Unix fileserver thinking it's a Windows machine.

Brief C++ History
Perhaps one of the main reasons why C++ goes so nicely with UNIX is its history. The C language, the predecessor to C++, was developed at Bell Labs at the exact same time (early 1970s) as the UNIX operating system was being developed there

And by some of the same people too.

XWindows
While UNIX and Linux are, theoretically, entirely …

jwenting 1,905 duckman Team Colleague

The browser doesn't care whether something is a JSP or not.

Most likely you corrupted the installation of your application server somehow and that causes it to no longer (or incorrectly) render JSPs leaving your browser puzzled as to what to make of it.

As to rational, do you have an application server at all? It sounds like you're trying to open JSP source files in your browser, which is not at all what they are intended for.

jwenting 1,905 duckman Team Colleague

first: You're not closing your constructor, check your braces!

second: count the arguments to String.format(). Your template string takes 3 arguments, you supply only 2.

jwenting 1,905 duckman Team Colleague

Borland has several compilers free for download.
These include the 5.5 version of their C++ compiler (one of the best around!) as well as a number of old versions of their C++, C and Pascal systems.
http://www.borland.com/products/downloads/download_cbuilder.html (choose "compiler").
http://bdn.borland.com/museum/
free registration required for both. Borland doesn't send anything you don't give permission for.

Microsoft has a free version of their C++ compiler for .NET (the very latest version) also available on their website.
Search microsoft.com for VCToolkitSetup.exe

Java can be freely downloaded from http://java.sun.com (for PC, for Mac contact Apple).

Python works on just about everything too, http://www.python.org

Apart from those all you really need is a good editor. I am somewhat partial to VIM (http://www.vim.org) and Eclipse (http://www.eclipse.org).

There's tons more but this should keep you occupied for a few years :)

jwenting 1,905 duckman Team Colleague

tricky...

Once wrote a complete middleware system to link store terminals (running some fancy software we would not be writing) with a Cobol backend we maintained.
Didn't write it alone of course, was part of a team of 3.
During internal beta testing (using a dummy frontend to generate the messages from textfiles) the customer decided they didn't want the product and the subproject was scrapped. But it did work.

Or the most tricky app I wrote that actually made it to production was a C program written under OS/2 to swap the assignments of the mouse buttons.
For security reasons the customer didn't want their users to access the existing control panel applet. Added complexity was that the settings would have to be stored on the network and applied whenever the user logged on to any machine in the network.
Sounds simple (that's what I thought too when I started), until you find out that the calls required are not part of the published API for the operating system.
In the end I spent about 3 days writing the program (most of it on the network code) and 3 weeks trying to figure out what calls to use and what the heck those parameters meant by using a kernel debugger from a remote terminal and hacking into the operating system code for OS/2 on a running machine.
Start debugger, launch applet, change setting, and see what calls are generated...