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

"The gospel itself is anonymous, but as early as Papias in the early 2nd century, a text was attributed to Mark, a disciple of Peter, who is said to have recorded the Apostle's discourses." -- http://en.wikipedia.org/wiki/Gospel_of_Mark

"today the majority [of scholars] agree Matthew did not write the Gospel which bears his name." -- http://en.wikipedia.org/wiki/Gospel_of_Matthew

"Although the author of Luke is generally considered to be anonymous, there is some suggestion that the author of Luke also wrote the book of Acts."
"Nowhere in Luke or Acts does it explicitly say that the author is Luke, the companion of Paul." -- http://en.wikipedia.org/wiki/Gospel_of_Luke

"The authorship has been disputed since at least the second century, with mainstream Christianity believing that the author is John son of Zebedee. Modern experts usually consider the author to be an unknown non-eyewitness..." -- http://en.wikipedia.org/wiki/Gospel_of_John

Seems authorship is a little vague. Even the scholars aren't sure.

So? If anything this would prove accuracy, otherwise the writings would have never made it public, as Mathew, Mark, Luke, John and whoever else would have made it known that the writings were false.

My point was not the accuracy of the Gospels, it was that "The Gospel According to [name]" may not have been written by the man who's name is on it. Nothing was said about the veracity of the writing. Ghostwriting is an approved vehicle for authorship. It's better to put someone's name as an author credibility rather than naming it "The …

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

WaltP - you need to look at the way you judge my comments. My posts are opinions about the way I look at everything. That does not mean you have to discourage everything I say. I believe them as truths and there is nothing you can say or do to change that. I'm sure the other 2.1 billion Christians in this world would agree with me.

Believe me, I'm not trying to discourage everything you say. I'm saying if you state an opinion, make it logical. And realize opinions are not truths, they are opinions. Believing that the opinion as a truth is fine, and must be done in order to be a believer. And knowing that others do not hold them as truths make these discussion interesting, and sometimes heated. I tried hard not to do the heated version.

All I'm saying is be careful how you word your beliefs. Bullet-proof them as much as possible. I could have taken the other side and been much stronger, and the result would have been very different. I was simply trying to make you think about your side and help you rethink the way you explain your beliefs -- in essence to strengthen your ability to discuss your beliefs so as not to let people poke holes in your side.

If you reread my comments, you will note I did not say you were wrong, I generally was saying that the points you were trying to make weren't compelling, …

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

slobber

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
while (n>0);

What the.... :?:
Wouldn't a simple getchar() suffice?

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

>double i,b;

Don't use a float or double for index in a loop. Use a integer if you want
correct results.

It is fine to use floats and doubles as loop indecies.

declaring the integers inside the for loop doesn't work in all the compilers. It's outside of the C99 model.

declare it at the beginning of the main function.

If you mean for (int i=0; ...) yes
But if you mean to include the int number = ... after the FOR statement, not true.

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

It seems that you like to write some console/terminal applications. Please try to understand me now. Standard C doesn't provide any features for that. Yes it's somewhat stupid to be able to write only some command-line programs, for example, while learning C.

But it's even stupider to try to learn C and a very non-standard library like POSIX.

But C standard library is anyway only a fraction of POSIX, so it makes no sense to be restricted with C standard library.

Makes total sense. If learning C, you learn C that can be used everywhere. Learn C and POSIX, now you can only write code that has POSIX, and most jobs you are likely to get won't have it.

And such console/terminal programs can be written using only standard C and POSIX. We need really two things -- non-canonical input and clear screen. The code below shows how we can set the non-canonical input using termios.h, this code clears screen and prints immediately any character which you enter.

So now we not only add a non-standard library like POSIX, but now another non-standard header the is available only on Linux. Really helps on Windows... :rolleyes:

POSIX does not provide any control codes, functions or utilities to move cursor. And if to think about it more deeply, *you do not need to move cursor*, the gotoxy kind of functions for console are somewhat similar to goto functions in c, both seem to be convenient, but would cause a …

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

Now we have all seen that our moderators are less than perfect

And so are most that try one-upmanship ;)
No formatting
Poor commenting
Casts to float that are useless.
:rolleyes:

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

The number of items in every line will be the same in the same file, but in a different input file, this number will change.

Then base the reading of the file on reading the newline (\n). When you read the pair of numbers, read one more character and test what it's value is.

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

A couple other things.
See this about gets().
See this about formatting. You need indentation and whitespace.

After you read the first character, then read the rest of the line, the rest of the line does not contain the first character. so the compare never works. Why not just use fgets() to read a full line then use strstr() to search that line?

And getch() is not standard, therefore not portable. You should use getchar() instead.

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

I'm a beginner so pls bear with me. Try to make your explanations as simple as possible. The program i'm going to make will be like this: the user enters the customer name, the items ordered by the customer, the quantity of those items, and their prices. Here are my questions:

1. Do I really need to build and incorporate databases from softwares like Access to my VB program? Or are there other alternatives? Because I don't like my program to be dependent on other software.

No. Many programs don't need a database at all. Only about 15% of my VB programming used a database. Problem with your idea, though, VB is by definition dependent on 'other software'. Specifically system DLLs, and other support files, as well as the OS itself.

2. I'm sure you experts are familiar with Clipper. It doesn't rely on databases created from other software (I think). Is this possible with VB6? How do I do it then? By using random access files (.rnd)?

You can access data any way you want. Straight text files, binary files, fixed length record files, etc. Any way you can imagine. You just have to know how to program for it.

3. If I use .rnd files, can I still use the ADO Data Control, Datalist, DataGrid and DataCombo controls of VB6?

Isn't that relying on Data control software? ;)

I think ADO will require a database of some sort.

That's it for now. Pls help …

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

any hint on each question how to begin with... i have exams tomorrow ><

Better late than never, eh? ;)

Hints? OK:

Q1)Write a program that read two integer and determined and prints if the first is a multiple of the second? {Hint: Use the modulus operator.} ?

Read about the % operator.

Q2)(Hypotenuse) Define a function hypotenuse that calculates the length of the hypotenuse of the a right triangle when the other two sides are given. Use this function in a program to determine the length of the hypotenuse for each of the triangles shown below. The function should take two double arguments and return the hypotenuse as a double.

Triangle Side 1 Side 2
1 3.0 4.0
2 5.0 12.0
3 8.0 15.0

Check out the equation of a hypotenuse, and look at the sqrt() function in the header cmath

Q3) Write a function multiple that determines for a pair of integers whether the second is a multiple of the first. The function should take two integers and return true if the second is a multiple of the first, false otherwise. Use this function in a program that inputs a series of pairs of integers.

See Q1

Q4) Write a program that inputs a series of integers and passes them one at a time to function even, which uses the modulus operator to determine whether an integer is even. The function should take an integer and return argument true if the …

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

proving

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

Mythraism doesn't exist today does it? Of course not...

So? Means nothing. It existed. Its belief system closely mirrored Christianity. And predated it by 500 years. This is a fact. This does not mean Christianity did not develop separately, but Mithraism could have been used as a basis. I'm not saying it did, just saying it could have.

But tell me why has Christianity made such an impact in the society? Why is it the biggest religion in the world?
Jesus Christ did not "simply borrow bits and pieces from other religions." What other religion had a man lay down His life for His friends. The ultimate sacrifice? Jesus did the one thing that no religion can match. That's what seperates the Power and the Divinity in my faith from a simple belief.

Impact: strong belief system, strong following. Does not necessarily mean it's the best. Just means 33% of the worlds population believes it is.
Biggest: because more people believe in its teachings that the others. That by itself doesn't mean it's true. After all, the entire world at one time believed the world was flat. Didn't make it true. Eventually, scientifically, the truth was unveiled.
Christianity is the entirety of the Jesus' teachs, life, and followers that continued well after his death. Most of this He has no direct input into. He was dead. It was his followers after the fact that organized the teachings and the stories into the form we now call Christianity …

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

raptors: Rage and pain together often raise stress

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

Completely agree on this. I've almost stopped going to the Geek Lounge because it's filed with the same 5 word games and a few links each time. Every few days there'll be something interesting. Maybe we could have a play forum for the word games, and the geek lounge could be for random - but still geeky - topics?

I like this. And posts to games don't increase your post count :mrgreen:

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

Oops.... so it is. Thanks Sannie :D

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

Or:

int main()
{
    int rtn;
...
    if (Get( cin, d1, d2, d3, d4, d5)&& Valid( d1, d2, d3, d4, d5 ))
    {
        cout << "The code has been vaildated" << endl;
        rtn = 0;
    }
    else
    {
        cout << "The code is invalid";
        rtn = 1;
    }
    getchar();
    return rtn;
}

I personally prefer this method because only one exit from the program is used. But it's strictly a personal style issue.

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

Are all your lines formatted exactly like you specified, with 5 numbers?

If so, Just duplicate the two reads instead of using the DO loop. Or if you need to use a loop, make it a FOR loop and just loop 2 times.

Also, see this about your use of .eof() (it's identical to C's feof() .)

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

And please format your code -- it's really too hard to read. This is at least the third time it's been mentioned. Infractions are costly...

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

now if you want to give a range you can do it by this syntax

(minimum+rand())%maximum;
for example if you want to generate the numbers between 1 and 10,000 simply do it this way

(1+rand())%10000;

Not quite. it's minimum + (rand() % maximum);

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

That my friend is also a theory. It's based on just another irrelevant thought "according to Issac Asimov." Just because he found something to be somewhat "relevant" does not mean Creationism is a "lie." Sorry.

Of course it's a theory. Creationism and Evolution are both theories. There is no proof of either. But there is evidence to support them. The thought is not irrelevant. It's an honest interpretation of the facts as he understood them. Keep in mind, many people are critical of Creationism because it's simply unscientific. This fact is not irrelevant. Many people are critical of evolution because they don't like the idea of coming from monkeys. This is irrelevant. But there are other ideas that support Creationism that are not irrelevant. But neither have been proven. Each is just as likely as my pet theory:
The Earth and it's creatures took billions of years to evolve from the formation of the planet, cells splitting, evolving, advancing life. Then Adam and Eve crash landed on the planet from another civilization and were lost to their people, given up as dead. They survived and here we are... :)


What individuals are you trying to reveal that have not been proven to have existed? Jesus Christ is the greatest phenomenon that has ever crossed the horizon of this world. He's the centerpiece of civilation. He is the loftiest idea in literature. He's the highest personality in philosophy. He's the fundamental doctrine of true theology. So with …

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

I know, it's great isn't it? ;)
Thanks..

Depends... You did it by making so many posts to games I'm not so sure it counts... :)

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

Convince

(victim doesn't work -- too many changes)

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

Should be able to, sort of.

The ping command probably has parameters to accomplish the first half of the process. As for the wait, I don't know of anything specifically, but one can be written quite easily in C/C++.

So the batch file could be

ping [parameters]
    if errorlevel 1 goto noping
    wait [time]
    backup [parameters]
    goto done
:noping
    rem Machine never answered
:done

The errorlevel line tests whether the previous command exited with success or failure. Don't know if ping does this, though.

Then wait would be a program to simply waits as long as the parameters state. I'm not sure if this will actually be needed. You'd know better. This can easily be written in minutes if you can't locate one on the web.

Finally, start the backup.

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

It is, but I just go by Walt. Walter is soooo formal, it doesn't suit me. :)

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

Two options:
#1) Lerner's idea will work well
#2) Input the number as a string of characters. If you input 3157, you wil have a string with '3','1','5','7'. Each character is then converted to an integer by subtracting '0', or 48.

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

I repeat:
See this, paragraph 3, and this

You will get a faster and more accurate answer.

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

VB Script is for html pages. You might want actual VB programs, which is harder. What is it you want to do? There may be something better out there for you.

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

See this, paragraph 3, and this

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

preppy

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

Interesting.... A few comments -- opinions, to be sure (except the first):

Theories are not facts. The are based on observations and seem to hold true, but aspects of the theory still have not been proven. That's why they are called theories instead of facts.

Creationism: According to Isaac Asimov, based on scientific evidence (carbon dating for one) Creationism could only be true if the world was created by a deceitful creator. The proven age of the world does not coincide with the 'stated' or 'created' age, therefore the scientifically provable data had to be manufactured and is therefore a lie. It's an interesting thought...

Evolution: An alternate 'subtheory' is that we did not evolve from apes. Instead, apes and humans have a common ancestor farther back that split into what eventually became us on one line and apes on another.

As for other current species eventually becoming human, not likely. No more so than the egg that evolves into a cake could eventually become an omelet. Their current path has taken them away from the possibility of being human.

Genesis: Possibility is that it was written to explain where we came from in terms that were understandable to the population at the time (1600-400 BC, somewhere in there -- see http://mb-soft.com/believe/txs/genesis.htm)

Six-day/24 hour debate. C'Mon, it's poetic license. That means in 144 hours the world was created. But Jupiter would have been created in 60 hours, Mars in 147.72 hours... Day

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

vision

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

"Please release me. Let me go!"

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

since: Seldom is necromancy commendably entertaining

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

Open the header file in an editor and take a look?

Or cheat and look here :)

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

u ... u ... u ... u ...

:confused:
Read this please.

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

you can read the novel War And Peace between compiles.

Good one :). Not only do programming work but also you get educated in literacy.

Hmmm. I read the comic pages. Should I change?

Psst..don't let Walter hear this. He can infract you, you know. :D

Who's Walter:?:

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

All you're trying to do is output the values in order. That's not a sort.

Check if x > y. If so, move x into y and y into x (switch the values).

Then do it again for y and z.

You'll have to go back and retest x and y again.

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

I don't think that would work.

Why not?

Agree. If you're going to complain about something, the least you can do is give some kind of explanation.

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

I have this program that counts characters in a string is there a way to modify this code so that for example it counts specific characters entered. Exmaple.. user entered Hello, and I wanted the program to say there are 2 "L"''s entered in that word. THanks for your help!

#include <stdio.h>
#define MAXNUM 15

int countchar (char []);
int main()

{
        char message [MAXNUM];
        int numchar;

        printf("\nType in a word: ");
        gets(message);
        numchar = countchar (message);
        printf ("The number of characters entered is %d\n", numchar);
        return 0;

} // END OF MAIN

//FUNCTION IMPLEMENTATION

int countchar (char list[])
{
        int i, count = 0;

        for (i = 0; list[i] != '\0'; i++)
        count++;

        return (count);
}

From this point, change count to an array of 256 values. Then for each character increment count using list[i] as the subscript: count[list[i]]++; This will count each and every character in your input, letters, numbers, SPACES, TABS, everything! Although you will have to change message and line to unsigned char to properly count the high-bit ASCII characters.

Also, see this.

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

I see Ancient Dragon has typed faster than I and with a more precise version of what to do. As a learning experience here's a sampling of ideas I have about your code:

1) use int main(), not void main()

Yes, see this

3) when using statements requiring braces format your code such that you line up the braces so it's easier to make sure you have matching numbers of opening and closing braces. You appear to have 1 too many closing curly brace in the code you posted.

Yes, see this

4) if you're going to use scanf(), and for beginners it's okay, though it's not the best way to obtain input, then read in an entire string with use of %s, words instead of %c, &words.

No, see this and this. Recommending scanf("%s"...) is the same as recommending gets()

All of the above are issues commonly seen in code written by beginners, and more frequently than I like to think, in code I write still.

Hmmmm.... :D

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

Years ago i was young

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

How about this one...

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

solvents: Some orangutans live very efficiently near tree shelters

Cecil, it helps to read the rules:

We take up the last word of the sentence and use its letters to make up a sentence..

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

Contact hit company http://www.hitcorporation.com/ and ask them how to interface with their modale MP200.

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

No. Not even close.

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

See this about system("pause"); system("cls"); is conceptually similar.

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

What does everyone else think of this?

Makes sense to me. Problem is, where would it go? DB is generally used in conjunction with a language...

You people are weird :)