WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Could we implementa a keystroke for INLINECODE tags so we don't have to use the mouse? Something like Ctrl-K would work -- for KODE

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Looks like nowadays he has developed an infatuation for bold...;)

Hopefully it's just puppy love :p

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Yes I would ask you to compulsorily make the change.

Normally the strcmp( ) returns -1 , 0 or 1.

My output from your program:
The ans is -32
The ans is -1
The ans is -2
using Borland 5.5

So some compilers convert the returns to -1/0/1, others just use the difference between the characters:
'A' - 'a' = 32
'c' - 'd' = -1
'b' - 'd' = -2

So definitely just use <|=|> 0

I also, worked out the pseudo code WaltP gave me and turned it into this:
<snip code>
I think it differs abit from the pseudo code he gave me, but, it works perfectly. In his pseudo code, he mentions to loop from first to last minus one, wich I "think" means this: for (size_t i = 0; i < 4; i++) . But, that doesn't seem to work for me.

Good job! Yes it differs from mine, and the main reason is you corrected a problem in my pseudo code :) My loops were a little off.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Beanie and Cecil -- oh, the memories!

I remember Tom and Jerry, too. We also had:
all the Warner Brothers like Roadrunner and Bugs Bunny
Rocky and Bullwinkle
Wacky Racers
Johnny Quest
Woody Woodpecker
and so many others!

Clutch Cargo was really interesting, it had such a strange style, cartoon with real human lips. Check out the link!

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

QVeen72, you've been asked multiple times to use code tags. Is there a problem with understanding what they are? How to use them? Where to get the information? All this has been mentioned... Check the post at the top if the forum labled Please use BB Code and Inlinecode tags

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Yes, I vote for a gaming board.

Gee, a little late, aren't we, sharky? :mrgreen:

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

You need to know what the format of the data file is (.dat is for data file, I assume saying it's a program is just to throw us off ;))

IOW, you need to know how each byte is defined, whether it's a byte, word, long, character, float, etc, in order to translate it. This is defined in a specification somewhere, based on the program that wrote the file.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

For all those people who are still brooding over the question, here's the solution ...

Well, a solution... ;)

Any credits for it doesn't go to me though; but to my faculty who had asked the original question..

My ghod, what a mess! If this is the formatting you are being taught, run fast! No instructor should ever give unformatted code to anyone, especially his students!

Best use of pointer i would say..

What say u??

If you like gobbledy-gook. I will assume it works, but even with formatting there is no way I'm even going to try to follow this code. Too much obfuscation just to prove it can be done. This is a perfect example IMO of "just because it can be done doesn't mean it should be done."

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

You can just do this. It checks through all the elements in the array and finds out each check which is the smallest, biggest and average value of the array so far. At the end you have your results

Your code doesn't work. It returns a minimum of 1 and 1 is not in the list you gave it. And if the list contains all negative numbers, your max will also be 1, which is also wrong.

Before doing someone's homework for them at least test your code.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Beanie and Cecil (the seasick sea serpent)

Commming Beanie-boy!!!!

Anyone remember that one?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

any longer when

(thanks you mentioned the tough word, otherwise I would have got to go to Dictionary.com :D )

Better look it up. Croissant doesn't really mean wife -- it was an allegory... :)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Brinkster.

Very nice-- very good.

Much space. Free. No ads.

Only free site I use.

I was on brinkster for a while and they changed it to a pay site. Wonder what happened?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

the term "computer engineering" is misused by most people in the USA also.

Not if we've defined the term itself to mean how we use it.
What country first used the term "computer engineering"? We should ask them.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

i totally didn't understand what you were trying to say. Go back and actually spell the words out.

Agreed. See The Rules

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Interesting. I'll bet, unlike other installations, this is a full install whereas many others are a partial and during installation more stuff is downloaded. This would make programs like FireFox seem smaller, but they aren't.

Not saying you should download it anyway, just analyzing the download package...

I know Open Office is almost twice as large as this.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Man (a non-gender expression), this is sad. purple rainx asked a perfectly acceptable question, with explanation why she was interested:

Just wonedering how many other girls are here? I know traditionally the IT industry has been male dominated and probably still is. It's cool to see more women taking an interest in areas other than what we have long been stereotyped for.

Perfectly reasonable.
FACT: industry is male dominated.
FACT: the majority of members here are male.
FACT: women's roles are stereotyped, as are men's
CURIOUS: who is actually female here?
A perfectly natural question to find out who are her comrades-in-arms.

I find it interesting that a female is the first to object to the question. Don't know why, don't care why. But it's a FACT.

Yes, there are differences. Yes, there are similarities. Yes, there is inequality. All FACTs. But it's also more equal than it used to be.

Would we have gotten so hot if she had asked "who likes brussel sprouts?" I suspect that was not an interest of hers, though. ;)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

people go to court here in USA all the time to get their names changed ...

I know someone who legally changed his name to Spock...:rolleyes:

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Ginger was pretty, but Mary Ann was really cute -- more my type. :)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

For now, post questions in Software Development:Legacy and Other Languages. If there's enough traffic, I'm sure something can be worked out.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Jeez, it doesn't matter if you started when you're 14 or 28. It doesn't matter if you're in New York or Atlanta. If you want to go into game programming, do it!

Start writing a few games yourself, learn what you can. Find someone in the field and ask if they will mentor you. That's the best thing you can do.

Forget the money. At the beginning, "they" will dictate how much you make. As you get better, you can slowly start dictating -- you have something to dictate with.

And don't be confused by the money thing. In New York, rent can run 2000-3000 a month, therefore salary must be $50,000 or greater. Where I'm at, you can find places for under $1000 so $30,000 is very doable.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

>>but i dont think people develop software necessarily have to be in the respective profession
most developers do know quite a lot about the business of their clients. Programmers don't work in a black box or a vacuum. You don't have to have an M.D. degree, but should know at least a little bit about their work.

But Ok, so maybe I was just a tad sharp. I apologise.

Good for you, AD. You should ;)

I know nothing about drugs but for 6 years worked with a major pharmaceutical company

I know nothing about radio communication and had a contract with a major communications company.

Also avionics and flying. I could go on...

It's not what you know, but how to get the information you need and who you are working with. If the medical profession waited for programmers to become doctors, there would be little technical advancement.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Anytime. Oh, and by the way, when you post code, don't post with line numbers. If we want to test the code it's difficult.

And good code formatting, too.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I'm using the free http://dhost.info to host my website, it offers PHP/MySQL support, 100 MB of webspace, and best of all, no ads. Sorry no CP, although it does have FTP access.

Suonds like a dream host!

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

#1) Don't post a million lines of junk, the first few lines is enough
#2) as per The Rules, answers will be posted here
#3) Don't post an email address on a public forum -- you wanna get spammed to death? ;)

The file is a binary file (there's no such thing as a hex file). This means the data is in computer-readable form, not human-readable. You will have to
1) open the file in binary mode
2) read the data into integers, floats, and other binary variables
3) understand what you are reading -- the format of the file. To get any real info out of it, you need to know what type of data you are reading which means you need a 'roadmap' of the file. Ask whoever created the file for the information.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

It seems to me you're going about this programming stuff the hard way. Based on the code you posted, you have never compiled the program. You really should be writing it a piece at a time, testing that piece, and move on when it's working. You're going to spend a lot more time trying to get it working if you try writing it all first before compiling.

And call srand() only once at the start of the program. You don't need to call it more than once.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Infarction is correct. Probably the easiest way to start this solution is one value at a time. Find the min and max. When you understand that, add the second min and max. Etc.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Try adding fflush(stdout); immediately after your fprintf() .

Linux is probably buffering the output, so the display waits until the output buffer is full before displaying the data. But it never gets filled because of the kill() . fflush(stdout) will force the buffer to be displayed and cleared.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I found it a few years ago but haven't explored it. I remember it was supposed to be a pretty good one ages ago...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

If anyone has the time or inclination, I'd be interested to hear what others think of Open Watcom C++. Unlike DevC++ it's still under development so it may be a better compiler for those that can't/won't purchase one.

I just downloaded it myself so it'll be a while before I have an opinion.

And if anyone is interested in ForTran, that compiler is available, too.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Croissant and complained

(croissant = wife -- he's a muffin after all)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Knights of the Republic --> Knights of Templar

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

i live in surrey too

Does it have a fringe on the top? :mrgreen:

(You'd better cut that out before they pummel you, WP)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I can't believe that would be his real name. That would just be shameful.

Wouldn't that depend on what country they were from? Like in his home country the name might mean "Powerful Ruler" but in another it translates into "Butt of a Dog". It ain't his fault.... :)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Did you try GOOGLE?

And in English, after each sentence you always add a SPACE. Sentences are not .com addresses. ;)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

You have to open the file in BINARY mode. This mode allows you to read files that contain binary records instead of lines of text.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Veena,
thanks, you've solve my 2nd problem, but still my main problem is if i will download all the attendance from the reader it will save only in one file..this is the sample output file... the file name is base on the date i download the file...12052006.txt

it should be separate the file base on there date i.e. 2006/12/01, 2006/12/02, 2006/12/03, 2006/12/04.. then, the file name should be in 12012006, 12022006, 12032006, 12042006...
my code saves them in one file only, that's my main problem...help me please..thanks again..

That's because you use iDate to create the file which holds only the current date. I believe you need timeStr instead. Also, it would be better to break your OPEN statement into two pieces for debugging purposes:

'' First create the file name.  You can then look at it if you need to 
'' before you open the file
fname = "C:\TNA\" & Format(timeStr, "mmddyyyy") & ".txt"

'' Then use that file name to do the actual open
Open fname For Append As #FN

The code is also easier to read this way.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

But, what WaltP is saying is right.. u will have to try and do it yourself.. if u get stuck some where , then post here, anyway we are here to help you.

WaltP also said "please read this section of the DaniWeb RULES."

I saw your New Thread is Closed.. problem resolved or what?

No, it was a disregard of the Rules (and arguing with the Moderator). She can post again with a proper question as the DaniWeb RULES state.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hey buddy,

If u really got ur review done from WaltP , can i have the code plz.

I am in a hurry u know !!

That's not how it's done here. If you want the code, you write it. We will help, but since we don't get your grade, we don't do your homework for you. We don't care how "in a hurry" you are -- cheating is cheating.

And please read this

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

nuclear power plant -> glow in the dark

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

people always tell me im not like normal people

meh........ thier loss

Or, their benefit... ;)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

his wazoo which

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

>So, any other females here besides myself and Dani
I'm having trouble deciding how to categorize your motivation in asking that. I've settled on one of these three:

1) You couldn't think of anything better to talk about.
2) You're trolling by subtly bringing up a topic that will divide people.
3) You delight in reminding everyone of past prejudices despite their irrelevance.

Or my favorite
4) How many females are in this male-dominated field, and is it time to make plans to crush the opposition?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

first let me apoligize for the title of the post... i was unaware of that rule but i do apoligize.

Not a big problem. Just annoying when it happens a lot. Title of the post is best when it gives us an idea what the question is about.

is there anyway in C++ to change numbers that are generated by the random number generator to letters?? i search through my text book and on websites and cant seem to find anything

You don't change the numbers, you use the numbers as
1) an index into an array of letters
2) as a base to calculate the 'value' of a letter

I still have no idea what exactly you are asking, but assuming it's number one and you want 1 == 'A', 2 = 'T', etc, you can create an array char letters[4] = 'A','T','C','G'; Now you can get a random value from 0-3 random_integer = rand() % 4; Now, your letter is letters[random_integer]; If this is not what you are trying to do, please explain.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Welcome, enjoy your time here. Ask what you need, help when you can.

Please take the time to read the Rules

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

First of all, your title violates our rules. Please Read This

In the code

char 1 = 'A';
char 2 = 'T';
char 3 = 'C';
char 4 = 'G';

where are the variable names? Variables cannot start with a number. What you are trying to do is change the value of the number 1. Ain't gonna work.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Sweety, the point Narue is trying to make is that rather than posting only a description of the project, post what you've already written. It will save you time and trouble. All the people that can help will help. You don't have to ask if someone will help. They just will.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

The Guru's have spoken!
OK, OK,!! So it's NOT the ultimate in programming, but it does work as advertised!!! That's all I'm saying about, not that it's better!

I, am NOt by ANY stretch of the imagination, a profesional programmer! I just thought it was a creative solution to an exercise.

Yes, it was very creative. Kudos for finding that solution. I apologize for for not saying this before....

If I knew what I was doing, i probably wouldn't have messed with that particular item as much as I did.

Good way to learn...

I didn't know that resetting the loop was taboo! Now I do...
The compiler didn't complain at all!

That's because it's a logic error, not a compiler error. As you discovered, you can in fact modify a loop parameter to alter the way the loop processes. There are cases when this is a good thing I suppose, but it's rare. There isn't a standard that says you can't, but a guideline that says you shouldn't. Kinda like chocolate covered liver. You can do it, but it's just not a good idea.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

In principle I agree with WaltP. Filling the array, finding the maximum value of the array, finding the minimum value of the array, and finding the average of the array should ideally be done with separate functions.

:)

However, for teaching purposes, to compare the function posted by the OP with ways to correct it using their logic seemed most appropriate.

True, except OP had no code for anything except average, and that was in a function. Therefore starting out with additional functions is a preferred way -- it starts the learning process in the right direction rather than attempting to modularize after the all-in-one function is written. Takes twice as much work, and no unlearning bad habits in the future.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I agree, it doesn't really matter on an individual basis.

The thing to keep in mind is the other functions in the system. How do they order similar function params.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Man! That doesn't look ANYThing like your ORIGINAL work, which was basically OK!

No it wasn't, it didn't work and the logic was wrong.

Below is my solutiion using your work.
The commented out part is how to fix YOUR original method.
The current solution uses that handy swap funtion that appeared out of thin air.

Both will work. To toggle the solutions, just uncomment the code, but be sure to comment out the swap functon.

for ( int next = 1; next < ArraySize; next++ )
{

if( (strncmp(Array[next-1],Array[next],3) ) > 0)
{

    //const char* temp[ArraySize];
    //temp[next-1] = Array[next-1];
    //Array[next-1] = Array[next];
    //Array[next] =temp[next-1];
    swap(Array[next],Array[next-1]);

    next=0;
}

You had it all along! You just needed a few tweeks!!!!

Beg to differ. Rerun your program. All it does is place the largest value in the last position. It does nothing to any other position in the array. Try again.
[OOPS]Sorry. Missed the actual reason it worked. So it does. See below.[/OOPS]

I tested both versions before i posted!
His original code is in this thread.
cut 'n paste 'n compile 'n run!
Simple, compact and a thing of beauty (if I must say so myself-LOL)

Unfortunatly, I'm not smart enough to be able to cut and paste the output terminal in codeblocks!!

Click on the far left of the title bar
Choose EDIT:MARK
Use arrow keys to highlight the section you want to cut
Press ENTER. It's now in your clipboard. Paste …