Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I never knew music files could generate random numbers :icon_eek:

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

1. Was this discussed or fought about as the standard emerged? and

The only people who would know the answer to that question are the people who sit on the ISO standards board. I doubt very very seriously that would include anyone at this web site. Anyone who says differently without ISO citations is just blowing smoke.

2. Is there some clever use in having the old address still around?

None that I know of. But since I don't know everything either, there could be some obscure clever use.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Also, FYI, I did not learn anything from this thread. The egos blocked any possible gain of knowledge or understanding.
.

This thread is not intended for beginners, so I'm not surprised you didn't learn a thing.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

1. I'm not demanding. I'm asking a history question

By the way, I've programmed for over 30 years at HP and TI. I'm a part-time prof at a local university and I couldn't answer this question asked by a student.

If that is true that you have programmed for over 30 years then you should already know the answer to your question, unless you have been programming with your head in the sand all those years.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>is it possible to have two different names of one functions

Short answer: no

However, what you could do is put all the common code into a single function which is called by the other two functions

int common_code(int info)
{
   // blabla
}

int do_my_server(int info)
{
    common_code(info);
}

int do_my_client(int info)
{
    common_code(info);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That data file may not be in the directory (folder) you think it is. Move it to the same directory where the *.exe executable program is located.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>1) How could time (in the form of HH: SS above) be represented in the array, so >>that they can be subtracted? How do you subtract when

Don't put the dates/times in an array at all.

Convert the time read from each line into seconds, then all you have to do is subtract the seconds. Something similar to time_t variables.

One way to do that is to populate a struct tm structure with the date/time, then call mktime() to get the time_t object. You will have to parse the line read from the file
Example:

#include <iostream>
#include <string>
#include <sstream>
#include <ctime>
using namespace std;

int main()
{
    struct tm time;
    time_t t1, t2, t3;
    char c;

    // populate first time
    std::string t = "2008/11/22 14:59"; // assume this is read from file
    stringstream str(t);
    memset(&time, 0, sizeof(struct tm));
    str >> time.tm_year >> c; // get year and / character
    str >> time.tm_mon >> c;
    str >> time.tm_mday;
    str >> time.tm_hour >> c;
    str >> time.tm_min >> c;
    // subtract 1 from month so that it is between 0 and 11
    time.tm_mon -= 1; 
    // substract 1900 from year
    time.tm_year -= 1900;
    t1 = mktime(&time);

// now to the same with the other times t2 and t3
}
tux4life commented: You're always great in simplifying things :) +3
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I won't say Dani won't do it, she wants to see a lot of demand before creating yet another forum. And I'm not sure what you mean by "content forum". Maybe this ???

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The problem might be anywhere between you and Microsoft. You obviously can get to other sites such as DaniWeb so malware on your computer is unlikely.

I moved your thread over here so you can get some serious help. Geeks' Lounge isn't the place for support questions.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what line number does that error occur on ?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Since the fields are separated with | I think it would be easier use fgets() to read the entire line then parse the string using strtok().

char line[255];
while( fgets( fp1, line, sizeof(line) ) != NULL)
{
     char* ptr = strtok(line, "|");
     strcpy(fms->headCategory->categoryID, line);
     ptr = strtok(NULL, "|");
     strcpy(fms->headCategory->fareType,, line);
    // repeat above two lines for each of the other fields

}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I think you have it -- the brand link list contains one node for each store. You can think of the stores any way you wish. And you might want to add a string to the brand structure that is the name or type of store to make it easy to keep track of which store is which.

struct brand
{
    struct brand *next;
    struct register* cash_registers;
    std::string name;
};
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

At line 17 of the code you posted the variable j is only visible in that for loop. If you want to use that variable again on line 21 it will have to be declared again just like it was on line 17. Another way to fix the problem is to declare that variable on line 14 similar to the way those other integers were declared, then remove the declaration on line 17 to make line 17 similar to line 21.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

worked for me :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It goes into an infinite loop when page count goes down to 0 but time is greater than zero. When at line 159 the value of page is 0 the program executes the else statement at line 171. Notice that the value of tim does not get decremented there.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>brand BurgerKing;
>>register ATBK;

That is not correct.

// this structure is for each of the items that the customer orders
struct item
{
    struct item* next;
     std::string item_name;
     float price;
     int quantity;
};

// one of these structures for each customer.  It contains a linked list 
// of items structures from above.
struct customer
{
    struct customer* next;
    struct item* items_ordered;

    std::string customer_name;
};


// One of these structures for each cash register in the store.  Don't 
// forget the registers used at the drive-through windows.  When the 
// customer orders something a customer structure is added to the register
// linked list.  Then when the customer pays for it the customer list is deleted
// from the register's customer queue.

struct register
{
    struct register* next;
    struct customer* customer_queue;  
};

// One of these brand structures for each band, such as BurgerKing, McDonalds
// Wendys, etc.
struct brand
{
    struct brand *next;
    struct register* cash_registers;
};

Now what you want is a linked list of brands that holds all the other linked lists brand* head = NULL; Now add a node to head above for each brand.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Are not all the forums in the Web Development and Internet Marketing menus enough?? What more do you want that doesn't already exist ?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

A little googling

How Object-Oriented Programming Started

by Ole-Johan Dahl and Kristen Nygaard,
Dept. of Informatics, University of Oslo

SIMULA I (1962-65) and Simula 67 (1967) are the two first object-oriented languages. Simula 67 introduced most of the key concepts of object-oriented programming: both objects and classes, subclasses (usually referred to as inheritance) and virtual procedures, combined with safe referencing and mechanisms for bringing into a program collections of program structures described under a common class heading (prefixed blocks).

The Simula languages were developed at the Norwegian Computing Center, Oslo, Norway by Ole-Johan Dahl and Kristen Nygaard. Nygaard's work in Operational Research in the 1950s and early 1960s created the need for precise tools for the description and simulation of complex man-machine systems. In 1961 the idea emerged for developing a language that both could be used for system description (for people) and for system prescription (as a computer program through a compiler). Such a language had to contain an algorithmic language, and Dahl's knowledge of compilers became essential.

More of this article here.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That's just convention from C language. In C++ you can omit the struct keyword.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

declare the macro _UNICODE and UNICODE, then include <tchar.h> for the macros to convert char* string literals to wchar_t* string literals. There may be more to it than that, I have not tried it with Dev-C++.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>There are several free compilers, such as Code::Blocks, Dev-C++, and VC++ 2008 Express.
( Note to OP: I am talking to Ancient Dragon, this has got nothing to do with you)
I never knew Code::Blocks and Dev-C++ are compilers!! I thought they were IDEs ;)
Or am I sensing it right?

Technically you are right, they are IDEs. But they are distributed with the programs that do the actual compiling, the libraries, and the header files. So IMHO the term "compiler" encompasses all of those packages.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>> depending on the input.
>> this creates how many type of queues burger and soda has.
>> so if someone say he wanted 5 bosses, there will be 5 bosses queues.

The code I posted is only one queue. If you want more queues, such as what you have be Burger King or McDonalds then you need multiple queues -- one for each cash register. And in that case you will need to create a linked list of linked lists. Something like below would work.

struct customer
{
    struct customer* next;
    int n;
};

struct register
{
    struct register* next;
    // linked list for people in line at the cash register
    struct customer* head;
};
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Yes, that's all there is to it. The very first two lines is there the user enters the number of nodes to be created. And the for loop is what creates them all.

cout<<"Num wanted";
cin>>numwanted;

for(int i=0; i<numwanted; i++);
{
   node* n = B; 
while( n->next != NULL)
    n = n->next;
// now add new node
node* a = new node;
n->next = a;
a->next = NULL;

}

would this be the entire code? I don't see how the input from the user creates the amount of nodes.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you can't do it with that compiler. Get yourself a free copy of a modern compiler and it will create all the nodes you want. There are several free compilers, such as Code::Blocks, Dev-C++, and VC++ 2008 Express. Just google for them and you will find them.

I ran your program on my computer and VC++ 2008 Express and it had allocated over 3,000,000 nodes before I stopped it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what don't you understand about those problems?

Q1: once you know what Pythagorean triples are then the rest is not difficult. Try to write the program yourself, and post the code you have written if you still can not solve the problem.

If you was able to do Q4 then you should be able to do the others, because I think Q4 is more difficult than the others.

tux4life commented: Oh, I didn't know it is called a 'Pythagorean triple' in English :) +2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what is it
social bookmarking website?

Read this

Here is one of the links that I though was really informative.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I get similar behavior on occasion. What I do is click somewhere else on the window that has no links, only white space. After that the blue link will usually work right.

Another thing you can try is copy the link location onto your computer's clipboard and paste it into your browser's address edit box that appears at the top of your browser, then press <Enter> key at the end of that address. That will tell you if that link is valid or not. To do this, put the mouse on top of the blue link, right-click and you will see a menu. One of the menu items is "Copy Link Location".

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Change proc_new_disk_reques() to return a pointer and your program should compile

DiskRequest*  proc_new_disk_request(int procnum, int sectornum, ReadOrWrite rw)
{
	DiskRequest *new_request;
	
    new_request = (DiskRequest *) checked_malloc(sizeof(DiskRequest));
    new_request->dr_procnum = procnum;
    new_request->dr_sectornum = sectornum;
    new_request->dr_rw = rw;
    new_request->dr_next = NULL;
    
    return new_request;
}

Note that at some point in the program that pointer has to be free()'ed.

xyster commented: Amazingly fast reply and so helpful in his reply. Thankyou! +2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

What compiler did you use to compile that ? I tried to compile it with VC++ 2008 Express and got billions of errors. The first error was undefined function count_file_values() that appears on line 15 of the code you posted.

So, don't complain about the program not working right when there are so many errors and warnings. Fix all the compile errors/warnings before even attempting to run it.

count_file_values() always returns 0 because the file contains alphabetical character values but the function is attempting to read double numbers. Change the data type of next_value from double to char.

also, array things must be of type char, not int because it will hold characters, not integers.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

why are you using std::list< std::string > rolodex instead of std::list< Card > rolodex ?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you want the friend function then preceed the function name by :: return ::gcd(nominator, denominator);

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Well, not so fast. I solved the stack problem by changing one of the Link options, but the program still will not run. The os won't even start it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

tux> If your computer has more than a GB of RAM that wouldn't be a problem

But the OPs computer crashed with just a megabyte-sized array. :( So it's not about total space available, but about how much stack space is reserved (which of course can be increased with a compiler option).

You are right. My computer has 8 gig RAM, compiled with VC++ 2008 Express, and it crashed when I ran it.

booker commented: GRATE KNOWLEDGE +1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

win32 api function is very simple -- just a one-liner MessageBox(NULL, "Testing", "Title Here", MB_OK); MFC is even a little easier. I think the .NET version is just as easy System.MessageBox(<blabla>); or something like that.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>If we have free alternatives why we should steel ?
Depends on the free software. If its free because its open source or the author made it free (e.g. public domain) then its not stealing.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

depends on the compiler and operating system. most likely that matrix is overrunning stack space.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Welcome to DaniWeb. Location: Do you mean Colorado USA? We have a lot of non-Americans here and CO doesn't mean much to them.

>>Relationship Status: Married--I live in a zoo.
Maybe you should think about sleeping in separate bedrooms from now on :)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

google found this example pretty quickly

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

How much time did you say you have ??? Here is one such software that took 15 years to develop.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Do you also think that unix and programming on unix sucks?

Absolutely yes. I hate *nix because its just too damn complicated to get anything done. There are, however, a few features I like, such as shell programming, awk and sed. MS-Windows batch files aren't in the same league with *nix shell programs. But doing simple things like installing programs on *nix is a nightmare.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>so I have no fear about using priate copies anymore\\

Oh I understand now. You can't stand killing an animal for food, but you don't have a problem from stealing the food out of someone else's mouth. Software piracy is theft.

stephen84s commented: Good catch +8
Sturm commented: lulz. You should buy a dictionary. -1
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

put the class declaration in one header file, but put the implementation code in a *.cpp file.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I don't know a thing about boost. So you're on your own for that one. You may have to use a 64-bit integer for total file size because they could get quite huge.

>>and it didn't work
What exactly does that mean?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

You need to talk to this guy because it looks like you are both writing the same program.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>how would i actually add up the extension count?
on line 6 just simply increment the count variable it->count++; what do you mean by "file size" ? The size of all files with that extension? That could be a very very time consuming thing to calculate because you would have to search every file on your hard drive for those file extensions. If that is not what you mean -- and I hope it isn't, then I have no idea how to increment the file size. If you already have a filename, then use fstat() to get the size of the file. There are other ways too, but IMO fstat() is the simplest to use.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you may have to write the drawing code yourself, but QT is a GUI library that is portable between MS-Windows a *nix. There a few others too, I think wxWidgets is one of them.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

when you read a line from the file you have to search the vector to see if there is an extension already in it. A loop similar to the one I posted for printing the data will do it. If the extension isn't in the vector then add it. If it is found in the vector then increment the counter variable.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
ostream & operator << (ostream  & out , Student & Data)
{
	out << "The name is : " << Data.name << "\nThe Level is : " << Data.level<< "\nThe ID is :"<<Data.key;
	return out;
}

That error message means that the above function appears in more than one *.obj file. You put that function in a header file, then included the header file in more than one *.cpp file. Move that function from the header file into just one *.cpp file and the error will be resolved.