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

>>Afterall, Red Hat makes about $330 million per year
If they give their software away for nothing then how can they make any money? They have to be selling $330 million worth of something. What that shows is that it is not the open source programs that make money but the spin-offs that are sold for $$$. And the assertion that YOU CAN MAKE MONEY ON OPEN SOURCE SOFTWARE. is false. It's not the open source that makes money -- if it was then it wouldn't be open source now would it :) You can't have it both ways -- you can given something away for free and get $$$ for it too.

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

Just in case anyone hasn't heard yet Obama won in Iowa tonight and Hillory came in 3d. I'm glad it turned out that way and hope it's like that in all 49 other states.

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

The code you posted is C, not C++ and that's why I moved your thread to the C board.

Is the length of all the words in that file less than 14 characters? If not then you need to increase the buffer size on line 5.

lines 10 through 13 should be replaced by a while loop like this:

while( fscanf(fp,"%s", naam) )
{
    printf("%s\n", naam);
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I finally finished creating the UBCD4Win bootable DVD. Thanks for pointing me to that site. I booted up with it and it appears to have a lot of useful utilities that help with windows problems.

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

Welcome to Daniweb and congratulations on your very first post :) Please go to Coffee House and post in Community Introductions to tell us a little about yourself.

To answer your question, start out by just writing a program that reads the words from a file. You can use <ifstream> std::ifstream and <string> std::string objects to read that in a loop. After you get that working then you can do another part of the assignment.

Post the code you have written and ask more questions if you need to.

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

How many times do I have to reiterate this? Are people just plain stupid? YOU CAN MAKE MONEY ON OPEN SOURCE SOFTWARE.

Yes, some have. Most have made nothing at all. Just look at all the shareware, freeware and open source programs. If you want to use and steel something steel one or more of those.

I use the term "morality" to mean "conducive to a good society"

Whose good society? Like in the movie Escape From New York ?

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

Here is what I used. What you posted isn't a complete program -- this one is.

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main()
{
    char str[500] =  {0};


    char error[]="Windows IP Configuration"; //error string to find
	system("ipconfig>output.txt");
    fstream file("output.txt",ios::in);
	
    int i=0,l=1,counter=0;
	
    while( file.getline(str,500) )
    {
        cout<<"\nLine #"<<l<<" (length:" << strlen(str) << "):\n\n";

        while(str[i]==error[i])
        {
            cout<<"[ "<<str[i]<<" ]"<<" = "<<"[ "<<error[i]<<" ]\n";	
            i++;
            counter++;				
        }

        if(strcmp(error,str)==0 || counter==24)
        {
            cout<<"\nerror found!\n";cin.ignore();
        }

        i=0;l++;counter=0;
    }
    file.close();
    return 0;
}

And here's the output, which I think is what you want.


Line #1 (length:0):


Line #2 (length:24):

[ W ] = [ W ]
[ i ] = [ i ]
[ n ] = [ n ]
[ d ] = [ d ]
[ o ] = [ o ]
[ w ] = [ w ]
[ s ] = [ s ]
[ ] = [ ]
[ I ] = [ I ]
[ P ] = [ P ]
[ ] = [ ]
[ C ] = [ C ]
[ o ] = [ o ]
[ n ] = [ n ]
[ f ] = [ f ]
[ i ] = [ i ]
[ g ] = [ g ]
[ u ] = [ u ]
[ r ] = [ r ]
[ a ] = [ a ]
[ t ] = [ t ]
[ i ] = [ i ]
[ o ] = [ o ]
[ n ] = [ n ]
[ ] = [ ]

error found!

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

happened to me once. I easily deleted the file using dos commands from cmd

Such a simple solution -- now why didn't I think of that :) It worked. Thanks

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

>>Proprietary software is immoral and antisocial
Who was it that accused me yestarday of trying to force my version of morality on someone else (see your post #9)? Software does not posses the qualities of being either social or antisocial. If you want something social then go to the local pub and have a beer with the other guys. Just because we write software for a livinig doesn't mean we work for free. Well, I'm a mod here for free but that's different. If we didn't get paid for our work then there would be no software for you and others to steal. You wouldn't even be using a PC.

If you want free software there is always Open Source software such as Open Office and *nix operating systems. There are also a few free online games you can play legally, such as Dunegon Runners and free anti-virus scanners such as avast!

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

Thanks Dani -- glad its intended feature :)

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

>>and it did not work for me
The code you posted is not what I used. Line #1 is not the same, see my post #33 for the correction.

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

>>Its strange that Safe Mode doesn't help then. Did you try taking ownership?
Vista doesn't permit changing ownership of individual files. And I tried to remove the read-only flag from the directory d:\windows, it went through all the motions but didn't work.

>> recommend the UBCD
I downloaded and installed the file ok. But it doesn't support Viata (yet anyway) and XP Pro install CD must contain SP1 or better, mine doesn't. So I can't use that either.

Thanks for all those suggestions anyway.

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

See the words in the grey square large font right half of the screen. What is that supposed to be ? Anti Copyright France <snip>

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

Two words ;) :Spare the rod, spoil the child..

That is not just two words :)

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

It looks like the second has profanity in the name. You'll have to translate the asterisks before it'll work.

Yes it does. When I first posted it I tested the link and it worked. Guess the bad-words filter (or someone) edited it. Oh well, what's good for one is good for all. I just though it wouldn't apply in this case since the link was hidden from immediate view and it was a the URL of an actual non-porn site.

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

I would build the world's largest bar.

I like that idea -- especially if it has some strippers :)

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

>>This action can be accomplished manually by simply bringing up a telnet window and typing in the appropriate commands
When you bring up that telenet program doesn't it require you to log into the *nix box before you can do anything? Yes, then at that point there is a server program running on the *nix and your telenet session is nothing more than another terminal type to the *nix login shell. I don't think that is the same type session that you have in mind for your C# program.

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

If you want to get down and dirty then you can always post here and here.

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

It worked for me (famous expression) -- VC++ 2008 Express. Before the change the program was iterating beyond the end of the string and displaying junk characters. That stopped after I made that change. Instead of just saying you don't think it will work you should try it to find out for yourself.

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

>>cut it from its folder and paste it into the recycle bin
Didn't work. Here is the error message

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

Looks like the problem is unitialized buffer. Change this and it works ok char str[500] = {0}; . Now then why its considered an error to find that string is another matter.

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

Are the line lengths the same?
Is capitalization, spaces and punctuation the same?

Have you called stricmp() to see if that resolves the problem ?

Will you zip up the file and attach it to your post so I can view it on my computer. Don't post it as *.txt file so that DaniWeb doesn't change it

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

Trying to delete d:\windows\gzip32.exe (my vista installation) but can't, nor can I rename it. If I copy it I can't delete the copies either no matter where I put them. I now have three other copies that I can't delete.

Anyone know a solution to this:

Things I have tried and failed to resolve the problem,

  • Reboot
  • Reboot into Safe Mode
  • Reboot with XP Pro
  • Empty recycle bin
  • View properties, the file is not hidden or read-only
  • View task manager. It doesn't seem to be an orphan process or application.

Any other ideas ?

Thanks

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

>> From were Money Comes???
Many people think it comes off a money tree. And the plastic cards everyone in USA seems to have today have made paper money less useful. I assume many other countries such as UK also has simpliar experience with plastic.

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

Jesus H. Christ... Does that represent a decline in morals with me saying that?

No, just a lack of religious upbringing. If you're not a Christian then why would you (or anyone else for that matter) bother to prise His name. Or are you talking about someone else you might know. And what does the H stand for ? I could be wrong but I didn't know He has a middle name.

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

>>Write a program to input a string in sentence format. Change all occurence of strings
>>within the sentence with length of 4 to "AHA". Print the original string and the new string.

For this create a std::string sentence object and call getline(sentence, cin); to get the sentence from the keyboard. After that you can use std::stringstream object to split the string into its individual words inside a loop. If the word does not have length 4 just call cout to print it to the screen, otherwise if the word has length 4 then print "AHA" to the screen. I see no requirement to save any of the information anywhere.

stringstream is declared in <sstring>. It works very similar to cin and cout but it gets its information from another string instead of the keyboard. Here is a simple example of how it might work.

std::string word;
std::stringstream stream;
std::string line = "Once upon a time";
stream = line;
while( stream >> word) // while not end of sentence
{
   // do somewith with this word
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

moved because this is not a c++ question.

To answer your question, download ITunes free from Apple.

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

Good night. No point continuing this conversation with a stupid idot -- one who is incapable of knowing the difference between right and wrong. Or the difference between lawful and illegal acts, and one who could care less.

PCSAWICK829 commented: You can't change the oppositions' mind on this, so you resort to name calling. Yeah, you deserve this negative reputation. +0
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>Do laws dictate your moral outlook on the world
>>Who are you to claim that your morality is superior or "more right" than mine?

I was not referring to morality but what is the law of the land. Here is just one of many explainations, but you probably already know that, or you should know it. When you steal software you are violation federal and international copyright laws.

>>They certainly don't influence mine
Then you are a fool.

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

>So depriving someone of money by taking something without paying for it isn't theft?

If I wasn't going to buy it in the first place, no it's not.

Oh, so now shoplifting isn't theft either. Do you go into your local Wal-Mart store with no intention of buying anything and walking out with your pockets full of movies and games ? If you get caught (which you will) most likely the police will be called and you will be invited to spend several days (if you are lucky) as the guest in the local jail.

>>You can villainize it all you want. That doesn't change what it is
Absolutely -- its a criminal offense.

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

A supervisor who can't remember from one day to the next what he told everyone in a meeting. We started tape recording the meetings so that he couldn't deny what he said.

In a similar case was a female supervisor that constantly asked the childish question why. No matter what you tell her she will want to know why. At one point I got so fed up I simply replyed Because, that's why!

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

call ifstream.seekg() to move the file position to there you want to start, then read until eof or until 16384 bytes have been read. all you need is another counter to count the number of bytes already read and stop when that is >= 16384.

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

read 32 bytes at a time until end-of-file

char iobuf[32];
ifstream in("filename");
while( in.read(iobuf,sizeof(iobuf))
{
   // write it out
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Piracy is illegal. period. Its the same as stealing money from someone. If you have a job would you like it if someone else was paid for the hours that you worked ?

>>On the other hand, those who practice/support piracy say that the original product is too expensive to buy and therefore have resorted to illegal means of getting the product.
Bullpucky. A thief is still a thief by any other name.

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

i wish the USA would stop supporting israel it creates problems

Why America Supports Israel. I don't know how accurate or true that is, but it is one theory.

The answer is obvious to almost everyone who had studied the subject. America supports Israel because Fundamentalist Christians in America support Israel

<snip>
Whereas the Jews are divided in their support of Israel, the Fundamentalist Christians are united in their support of Israel. This explains why no political candidate can be elected in America who is opposed to Israel.

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

"How to make MMORPG game? I have a very great MMORPG game idea."

How is that annoying?

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

give it all away to relatives and charity. I would hate to be filthy rich -- people who have lots of money have to work their tails off just to keep it. I'm perfectly happy with what I have now.

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

people who don't flush the toilet -- gross!

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

Can somebody explain to me how presidential elections work? Why are Clinton and Obama both Democrats? Aren't they sort of running against each other?

I don't get it...

All 50 US States will be holding conventions, meetings or caucuses to decide which candidates their state will vote for duirng the national convension. At the national convention the delegates from the 50 states will vote for the presidential candidate of their party. The two major parties in the US are Democrats and Republicans. There are other parties but only those two have been in power during at least the last century.

The Democratic National Convention will be held in Denver Colorado on Monday, August 25 to Thursday, August 28.

The Republican National Convention will be held in Minneapolis-Saint Paul Minnesota from September 1-4

The US Presidential Election will be held on November 8, 2008. The US American people do not vote directly for the President and Vice President, but instead vote for electors who meet in January to elect the President. And the new President and VP assume office in January 20.

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

Why does someone always take a cheap shot at her name? Frankly, I didn't expect that from you AD. You should be ashamed.

Maybe I should, but I'm not :)

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

>>no matching symbolic information found." I couldn't find the cause of this problem.
You are uisng the release version of those DLLs which do no contain debug information. That's just a warning saying you can not step into any of the functions that's in those DLLs. Otherwise you should be able to debug your own program normally as long as you compiled it for debug instead of release.

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

did you include <sstream> as illustrated in my previous example ?

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

I reread the original post and you are all correct -- the kid is in the 8th grade, not 8 years old! That's why I said he needs to just play games for a couple years. My apologies to everytone who tried to correct me. Most kids in 8th grade are probably 12 or 13 years old -- thats a lot different than 8 years old.

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

>>if(strcmp(error,str)==0 || counter==24)
jamthwee is correct about the error in the above line. It should be if(strcmp(error,str) != 0 || counter==24)

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

The command-line arguments in WinMain programs are passed in the lpCmdLine argumenmt. Parse it just as you would any other white-space separated string

#include <string>
#include <iostream>
#include <sstream>
#include <vector>
...
...
	vector<string> parameters;
	if(lpCmdLine != NULL)
	{
		string word;
		stringstream str(lpCmdLine);
		while(str >> word)
			parameters.push_back(word);
	}

Or if you are just passing a couple integers then it simplifies to this:

#include <string>
#include <iostream>
#include <sstream>
#include <vector>
...
...
	int X = 0, Y = 0;
	if(lpCmdLine != NULL)
	{
		stringstream str(lpCmdLine);
                str >> X >> Y;
	}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>I'm in eighth grade
>>I HIGHLY disagree with Ancient Dragon
You are quite a bit older than that 8 year old who is only in 3d grade. :) You can at least read Dick and Jane book without stumbling over big words like run

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

Obama is the smoothest talker of the bunch. Hillarity Klinton wants to cut all the senior citizen's social security and medicare benefits, freeze all raises for the next 4 years, and cut all military pay and benefits. She has already written/sponsored a bill to do exactly that. That's terrible.

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

Do you mean you are using an html editor to write the csv file? Then why is this question in the C board?

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

call RegEnumKey() to iterate through all the timezone keys. The Display name contains the timezone offset from GMT. You need to create a string in similar format so that it can be compared to what's in the registry.

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

There are none for him at this time. Tell him to wait a few more years to grow up a little and finish grade school. There are a lot of necessary things he probably doesn't know yet, such as a good foundation in algebra. In the meantime he should be concentrating on school subjects and just playing games.

Sturm commented: boooh. Stop insulting his intelligence +0
Narue commented: Equalizer. +19