WolfPack 491 Posting Virtuoso Team Colleague

Hey. I got a notification PM when somebody added me to their Contact List asking if I wanted to do reciprocate the action. Looks like I don't get them anymore because I saw a lot of pending invitations. If possible I would like to start getting them again.

WolfPack 491 Posting Virtuoso Team Colleague

In any case your problem doesn't relate to C or C++. Please refer the modem documentation, or ask your question from the particular modem manufacturer's support staff.

WolfPack 491 Posting Virtuoso Team Colleague

I want a program, which will set an alarm on a computer at a specific time according to the day and time... and a window will pop up on the screen with your own text on it.... I want the yellow notification box on the toolbar to popup indicating a specific message or reminder. An example is for my virtual enterprise class the yellow box will pop up saying "5 minutes left in the band"..... I want the program to have a list of days and then an option to set alarm time (reminder) for that day... it needs to be user-friendly.... for network use.


Has to be controlled from one privileged pc... the admin computer.

You are joking right?

WolfPack 491 Posting Virtuoso Team Colleague

Look closely at the return types of the overloaded >> and <<.

/////////////////////////////////
///  Function Definitions //////
///////////////////////////////

[B]SongInfo[/B]& operator>> (ifstream& ins, SongInfo* target)
{
   ins >> target->track_no >> target->track_pos >> target->track_length;       
   return ins;
}

[B]SongInfo[/B]& operator<< (ostream& outs, SongInfo* source)
{
   outs << source->track_no  << setw(10) 
        << source->track_pos << setw(10)  
        << source->track_length/60 << ':' 
        << source->track_length%60 << setw(10)         
        << source->runtime/60 << ':'
        << source->runtime%60 << setw(10);
   return outs;
}

Since you are returning objects of ifstream and ostream, the code should be like this.

/////////////////////////////////
///  Function Definitions //////
///////////////////////////////

[B]ifstream[/B]& operator>> (ifstream& ins, SongInfo* target)
{
   ins >> target->track_no >> target->track_pos >> target->track_length;       
   return ins;
}

[B]ostream[/B]& operator<< (ostream& outs, SongInfo* source)
{
   outs << source->track_no  << setw(10) 
        << source->track_pos << setw(10)  
        << source->track_length/60 << ':' 
        << source->track_length%60 << setw(10)         
        << source->runtime/60 << ':'
        << source->runtime%60 << setw(10);
   return outs;
}
WolfPack 491 Posting Virtuoso Team Colleague
struct SongInfo
{
   int track_no,
       track_pos,
       track_len_min,
       track_len_sec,
       runtime;

   SongInfo *next;

   friend ifstream& operator>> (ifstream& ins, SongInfo *target);
   friend ostream& operator<< (ostream& outs, SongInfo *target);
};

ifstream& [B]SongInfo::[/B]operator>> (ifstream& ins, SongInfo *target)
{
   ins >> target->track_no >> target->track_pos >> target->track_len_min
       >> target->track_len_sec;
   return ins;
}

ostream& [B]SongInfo::[/B]operator<< (ostream& outs, SongInfo *source)
{
   outs << source->track_no  << setw(10) 
        << source->track_pos << setw(10)  
        << source->track_len_min << ':' 
        << source->track_len_sec << setw(10) 
        << source->runtime/60 << ':'
        << source->runtime%60 << setw(10);
   return outs;
}

oops. I forgot to tell you to delete the parts above in red. The final code should be like below.

struct SongInfo
{
   int track_no,
       track_pos,
       track_len_min,
       track_len_sec,
       runtime;

   SongInfo *next;

   friend ifstream& operator>> (ifstream& ins, SongInfo *target);
   friend ostream& operator<< (ostream& outs, SongInfo *target);
};

ifstream& operator>> (ifstream& ins, SongInfo *target)
{
   ins >> target->track_no >> target->track_pos >> target->track_len_min
       >> target->track_len_sec;
   return ins;
}

ostream& operator<< (ostream& outs, SongInfo *source)
{
   outs << source->track_no  << setw(10) 
        << source->track_pos << setw(10)  
        << source->track_len_min << ':' 
        << source->track_len_sec << setw(10) 
        << source->runtime/60 << ':'
        << source->runtime%60 << setw(10);
   return outs;
}
Grunt commented: Helps-[G] +2
WolfPack 491 Posting Virtuoso Team Colleague

Do this

struct SongInfo
{
   int track_no,
       track_pos,
       track_len_min,
       track_len_sec,
       runtime;

   SongInfo *next;

   [B]friend [/B]ifstream& operator>> (ifstream& ins, SongInfo *target);
   [B]friend [/B]ostream& operator<< (ostream& outs, SongInfo *target);
};

[B]ifstream[/B]& SongInfo::operator>> (ifstream& ins, SongInfo *target)
{
   ins >> target->track_no >> target->track_pos >> target->track_len_min
       >> target->track_len_sec;
   return ins;
}

[B]ostream[/B]& SongInfo::operator<< (ostream& outs, SongInfo *[B]source[/B])
{
   outs << [B]source[/B]->track_no  << setw(10) 
        << [B]source[/B]->track_pos << setw(10)  
        << [B]source[/B]->track_len_min << ':' 
        << [B]source[/B]->track_len_sec << setw(10) 
        << [B]source[/B]->runtime/60 << ':'
        << [B]source[/B]->runtime%60 << setw(10);
   return outs;
}

There are a lot of other errors in your code. Pay attention to the compiler errors and you will be able to fix them yourself.

WolfPack 491 Posting Virtuoso Team Colleague

I've placed a CSV file into an array with C++ with each row being a single array element, but the file contains many, many columns that I don't need. I only need columns 1,2,3,4,6,7 out of about 50. Is is best to read the full value into the array and then edit it or only read in those values that I need?

This depends on what you are going to do with the data read. If you are going to edit the data in those columns and write it back to a file, along with the rest of the columns, you will have to read and store all the data. If you only want the values, and they are discarded after use, you can create an array of only 6 elements with multiple rows, and store the columns you need to that array.

As for how to proceed, paste the current code where you are reading the csv values into the array, and maybe we can work something out.

WolfPack 491 Posting Virtuoso Team Colleague

hmmm. This is getting out of hand. Is it just me or are more and more people expecting us to do their work?

What should i add on so that user can enter the four weights from the keyboard. The program should print an error message is the weights are out of range?

But is there amuch easily way of writing that part as it's seem pretty tough for me to understand.Please advise. Thanks.

But seem to hv compilng errors...can anyone please help me out where should i amend correctly yo make it works?

Can kindly advise what's wrong and what should i input into the program to make it complete? Please advise.

Please advise what should i change or input inorder for the program to work

It seem like my program doesn't work. Could you kindly advise what part should i amend or input for this program to work based on your professional skill in c programming. Please kindly advise.

All these are just asking someone else to do your work for you. All the code and error messages are next to crap. Do your own work, and ask proper questions with proper error messages next time. Use code tags also. Post crap and I delete.

WolfPack 491 Posting Virtuoso Team Colleague

What is the question? Use code tags the next time.

WolfPack 491 Posting Virtuoso Team Colleague

He he. That is not a bad post flag. That is negative reputation. Just forget it. I think you have more than 400 reputation points if my calculations are correct (probably second only to her majesty the queen herself), so no need to worry about a small red dot. I am waiting for someone to give me one so that I can see how much is subtracted from my rep points. Your post wasnt out of place.
We have a saying that goes like DOGS bark, but the caravan goes on or The MOON does not heed the barking of dogs.

'Stein commented: Well Said -'Stein +3
WolfPack 491 Posting Virtuoso Team Colleague

Okay. How do you know that someone flagged your post as bad in the first place? Only moderators can read the bad post reports. And I double checked the bad posts section. Nothing has been reported on that post. Are you sure that you got reported?

Yep. Checked again. A notification comes to a moderator of the C/C++ forum if a post in that forum gets reported. No notification either.

WolfPack 491 Posting Virtuoso Team Colleague

I've been called many things, but cute is a new one :)

Yeah I did a double take when I saw that too. But then it dawned to me that maybe, just maybe, Inanna was describing herself in a word. (Hope I didn't spoil your moment of happiness:evil:)


Edit:
Oh and as for me,
Mad.

WolfPack 491 Posting Virtuoso Team Colleague

it features a seperate close buttons for each tab, that it now has a built-in RSS reader

The RSS feeds are cool. But I would really like the close button to be at the previous place. That way, when I have to close a lot of tabs at the same time. I can just click the same place, and the tabs will be closed. This way, I have to move the mouse a lot. I am lazy. The standard shortcut to close a MDI tab is to use Ctrl+F4. That doesnt seem to work either. The new drop down list to change the active tab (where the previous close button was)seems to be a good idea.

I use a lot of extensions (A japanese-english dictionary, a weather forecaster ...). All those doesnot work, but I think it will be okay once you get the final release. After all no developer targets a beta.

WolfPack 491 Posting Virtuoso Team Colleague

Happy Birthday:!:

WolfPack 491 Posting Virtuoso Team Colleague

The certificates were provided since 2004. But it started to appear in the side of the daniweb page only recently (even I noticed it yesterday). That should be the reason that you were not aware this feature existed.

WolfPack 491 Posting Virtuoso Team Colleague
WolfPack 491 Posting Virtuoso Team Colleague

I believe you are looking for something like this.

WolfPack 491 Posting Virtuoso Team Colleague

I think one solution is to use getline and put it into a strstream and maybe extract the values one at a time from the stream. This way I can separate it by lines.

Yes that is the best way to do it

The problem is I want to IN the float values, so I don't know how to test for a newline if I'm using something (psuedo-code) like cin >> int x Any ideas?

Why do you want to test for a newline?

WolfPack 491 Posting Virtuoso Team Colleague

please give me some sugestions and ideas bout that and i need to know how to declear chareters and how to take inputs of characters
saqib.

How about buying a C/C++ book, or taking a C/C++ class or reading a C/C++ tutorial?

WolfPack 491 Posting Virtuoso Team Colleague

No. To listen to songs I boot to Windows. :mrgreen:

WolfPack 491 Posting Virtuoso Team Colleague

just said "FC5" because it was a more obscure reference to Linux, which you'd need to be sufficiently Geeky to get.

I am running FC5, at the moment. Does that make me more than sufficient a geek? :eek:

WolfPack 491 Posting Virtuoso Team Colleague

What were the compile errors? Give the error messages and the lines where the error occured. Don't give the line numbers. We can't count.

WolfPack 491 Posting Virtuoso Team Colleague

Question

Let's see if I can help you with that sound card. What is your sound card that can't seems to work in FC5?

Reply


And of the sound problem, I did in jest speak,
for the truth it be told, I'm a real Linux Geek!

WolfPack 491 Posting Virtuoso Team Colleague

...you guys are nuts...

Didn't it show before?

WolfPack 491 Posting Virtuoso Team Colleague

Oh Lupine One, my heart it doth sink,
that only of Windows I see that you think.

For the crufty old code of that horrid OS,
hast made of my box a right bloody mess.

So of that abomination, I speaketh no more,
and the "FC" I mentioned is Fedora Core.

And of the sound problem, I did in jest speak,
for the truth it be told, I'm a real Linux Geek!

:mrgreen:

You are good. :idea:

WolfPack 491 Posting Virtuoso Team Colleague

Now- tell me, Oh Uberly One: how do I get my sound card working under FC5?

An uberly one I'm certainly not
so confusion arose in my simple thought
Surely in your marsupial abode
Ought to be a disc of windows stored?

WolfPack 491 Posting Virtuoso Team Colleague

Dont know where you found out about this one

Nothing like getting bitten once or twice while writing a bat(cmd) script.

WolfPack 491 Posting Virtuoso Team Colleague

Some interesting points you made there.

But then again, this Pete guy he talks about seems to have quite a bit of street knowledge about computers. 6 years now, and he's doing well for himself. So no doubt he would have hear of Apple computers and their MaxOS. The facts would have drifted over to him saying that it is pretty much completely different in use than Windows. I'm just thinking out loud about what should be expected. But assuming what I thought to be relatively correct, then Pete would expect to be stepping into a whole other system when sitting in front of the white computer. The keyboard looks different that a windows keyboard... so wouldn't he expect it to react differently and not have the same shortcuts?

Once again, I really think the author described a typical situation very well. But to someone with 6 years of knowledge on windows, I'd expect him to jump into Mac OS, not with utter astonishment, but entertainment of sorts. This is something new, and should be experimented with.

Sorry for rambling, hopefully it came out legible and comprehendable.

Well, yeah, Pete would have heard of the MacOS. But as a person who has had no experience with a MacOS, what would have he heard about it? It would not have been wrong to say that he would have heard his MacOS using friends say, how nice a GUI it has, how seemlessly it's programs tend to work, how marvellously crash free …

WolfPack 491 Posting Virtuoso Team Colleague

I guess you should take a look at this if you already haven't.

WolfPack 491 Posting Virtuoso Team Colleague

Not sure whether it would work for TurboC and the old command.com shell, but you could try creating the command using double quotes to handle filenames with spaces. Don't know what will happen for long file names though.

e.g.

copy [B]"[/B]c:\yserver.txt[B]"[/B] [B]"[/B]c:\documents and settings\luffy-san\desktop\tcp1241_assignment3\lecture notes\server.txt[B]"[/B]
~s.o.s~ commented: good one [~sos~] +4
Salem commented: Good answer - beat me to it - Salem :) +3
WolfPack 491 Posting Virtuoso Team Colleague

Okay. So microsoft hasn't compiled that code before submitting. Now what about whether it serves as a good example for _localtime64_s ? That is it's main objective isn't it? Once a programmer tries out the example and finds that exit() isn't defined, he will add the stdlib line and get it to compile. That is not much of an issue. It would have been a different matter if the example showed a wrong way of using the _localtime64_s function.

Everybody accepts the fact that the Microsoft examples ( or early compilers for that matter) are not standard compliant. Some examples start using the void main () function. But somehow a large number of programmers have managed to learn through those examples and continue to do so. For you it maybe just one example that needs one line to be added. But what about those all void main lines that need to be changed to int main ? Maybe those examples came from the days before the standard made it mandatory for main to return an int . So while we understand that it is wrong, we are also fedup of hearing how MS suck from time to time.

I think you have succesfully brought the mistake in the example to our attention. You have taken it up to Microsoft and they will hopefully correct it in the future. That is the least you can do. Now it is time you quit overdoing things.

WolfPack 491 Posting Virtuoso Team Colleague

Click Start--->Run and type "control userpasswords2" in the run dialog without the quotes. You can disable it in the Advanced tab of the dialog that appears.

A more fine grained customization can be done in the dialog that appears by typing gpedit.msc in the Run dialog box.

WolfPack 491 Posting Virtuoso Team Colleague

Well, if you want you can disable it. Windows can be customized a lot you know.

WolfPack 491 Posting Virtuoso Team Colleague

Jul 20th 2005, 3:46 am

Better late than never, eh Davey? ;)

WolfPack 491 Posting Virtuoso Team Colleague

A Canadian Highway Patrolman pulled a car over on Christmas Eve day and told the Guyanese driver that because he was wearing his seat belt he had just won $5,000 in the Province Christmas Safety Competition.
"What are you going to do with the money?" asked the policeman.
"Well, I goin get a driver’s license," he answered.
"Oh, don’t listen to him," yelled the Trini woman in the passenger’s seat . . . "He’s a smart ass when he drunk."
This woke up the Bajan guy in the back seat, who took one look at the cop and moaned, "I knew we was not gonna get far in dis thiefin car, we gon spen Christmas in jale."
At that moment, there was a knock from the trunk and a Jamaican voice said, in patois, "Yow!, I man mek it ‘crass di barder yet?"
The Canadian Highway Patrolman smiled, and handed the $5,000 check to the driver and said: "I always loved the island talk, but I could never understand a word of it. Have a Merry Christmas and a Happy New Year."


----------------------------------------------------------------------------------------


A Guyanese man is having breakfast one morning; coffee, croissants, bread, butter & jam — when a Trini man, chewing gum, sits down next to him.
The Guyanese ignores the Trinidadian who, nevertheless starts a conversation.
Trini: "You Guyanese folks eat the whole bread?"
Guyanese: (in a bad mood): "Stupid, of course."

WolfPack 491 Posting Virtuoso Team Colleague

In your former code, the data string was like this. There were no new lines in it.

char temp[] = "<title>probably be that of the total potential available </title><title>The compost process combines the natural organic materials</title>" ;

What is your new data string?

WolfPack 491 Posting Virtuoso Team Colleague

Pfff, N00Bs... :rolleyes:
Why do you use binary when something like this is soooo much prettier?

Something pretty like that almost cost us the ability to use colour.

WolfPack 491 Posting Virtuoso Team Colleague
#include <stdio.h>
#include <string.h>
int main (void)
{
    int a;
    char temp[] = "<title>probably be that of the total potential available</title><title>The compost process combines the natural organic materials</title>" ;
    printf ("%s\n", temp) ;
    char* string1 = temp ;
    int stringLen = 0;
    char output[100];
    while(*string1 != '\0')
    {
        // Find the first '>'
        string1 = strpbrk(string1, ">" ) ;
        string1++ ;
        // Search for the next '<'
        stringLen = strcspn (string1, "<") ;
        if(stringLen >= 1)
        {
            strncpy(output,string1,stringLen);
            output[stringLen] = '\0';
            string1 = string1 + stringLen;

            char delims[] = " ";
            char *result = NULL;
            result = strtok( output, delims );
            while( result != NULL )
            {
                printf( " %s \n", result );
                result = strtok( NULL, delims );
            }
        }
    }
    return 0 ;
}
WolfPack 491 Posting Virtuoso Team Colleague

What have you tried so far? Why don't you modify the example shown here?

WolfPack 491 Posting Virtuoso Team Colleague

Fate of a Man - Mikhail Sholokhov (Short Story)
The First Teacher - Chingiz Aitmatov
The Cigarette Sellers of Three Crosses Square - Joseph Ziemian
The Godfather - Mario Puzo
Christine - Stephen King
Bag of Bones - Stephen King ( This was the book that got me hooked to King)
Executive Orders - Tom Clancy
The Seven of Diamonds - Max Brand

WolfPack 491 Posting Virtuoso Team Colleague

Well, you have 4 moderators for the site management section who I think are fairly active in that section.
The number of theads in that section is less than 300 for most forums.
There is a button which you can use to remove all the formatting of text. So it is just a matter of select and click. How many color abused threads are we talking per day here? Is it so bad that 4 moderators cannot handle?
Before the addition of new moderators I was adding code tags for a fair amount of post per day in the C/C++ forums. An year ago, only Narue and Dave were the active moderators of that forum. They must have gone through the same thing then too.
Why do you cripple a forum that has over 5000 threads in favour of a section that in total has much less of a number of threads? 3 moderators of the C/C++ section have asked for the color button to be bought back. What will make you change your mind?

PS:
I just saw the other thread regarding re-enabling of colour. Thanks.

WolfPack 491 Posting Virtuoso Team Colleague

Yes. That is all you need to start coding.
But If you are a beginner, first try the Visual studio express edition, which can be downloaded for free.

Grunt commented: Still one green dot...that's not fair [G] +2
WolfPack 491 Posting Virtuoso Team Colleague

Why have you declared a as float if you want to take the operator ie + - * / ? You should declare it as char .
Also, if a is the operator what is the meaning of a-b , a-c , a*d , and a/e ?
Looks like you dont have a clear idea of what to program. First write down what you want to do, what the user inputs should be, the sequence of user inputs. Then start programming.

WolfPack 491 Posting Virtuoso Team Colleague
WolfPack 491 Posting Virtuoso Team Colleague

and i am restricted to use either C or C++ only...no GUI...

Give us an example on how this text editor should look like.
Is it something like notepad in windows or like the old command line edit program in windows?

WolfPack 491 Posting Virtuoso Team Colleague

An algorithm is a sequence of steps that describe what a program should do. It is normally written before the program. So, if you can describe step by step what this program does, that is the algorithm. It is not rocket science. Just tell us what you think this program does, in point form. Since this is a small program, you may have to be explicit.

For example.

Step 1 - Declare an integer variable int
Step 2 - Display "Enter age"
Step 3 -  ....
WolfPack 491 Posting Virtuoso Team Colleague

Simple. Just use nested for loops.

bool x1[2] = {true, false}
bool x2[2] = {true, false}
for ( i = 0 ; i < 1; i++ )
          for ( j = 0 ; j < 1; j++ )
                  print x1[i], x2[j];

will print the answer for two variables. Expand it for n variables.

WolfPack 491 Posting Virtuoso Team Colleague

You have to include it in the resource .rc file and the resource.h file like this.
Assume the icon file is iconfile.ico
resource.h: #define IDC_CURSOR1 1001 resource.rc:

#include "resource.h"
IDC_CURSOR1 ICON "iconfile.ico"

Then you have to compile it using the rc.exe which is included in the platform sdk bin folder. rc.exe resource.rc this results a resource.res file in your source folder.

after that you have to link the resource.res file to the executable when building. cl /EHsc source.c /link resource.res What is the IDE that you are using?

WolfPack 491 Posting Virtuoso Team Colleague

Okay then. Try sending the EM_GETLINE Message. That surely ought to work.

WolfPack 491 Posting Virtuoso Team Colleague

Change the registry key value for

HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper
chunkmartinez commented: thanks real simple! +1