₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,081 members, 8,420,205 topics. Date: Thursday, 04 June 2026 at 01:30 PM

Toggle theme

OlaMichael's Posts

Nairaland ForumOlaMichael's ProfileOlaMichael's Posts

1 (of 1 pages)

Christianity EtcRe: The Most Misunderstood Person On Earth by OlaMichael(m): 4:06pm On Mar 18, 2011
@Jenwitemi
You say you disagree with the write-up and yet you agree with what the writer says. Here's what you said.
Jenwitemi:
I disagree with this write up. Jesus is most misunderstood by the people who "follow" his teachings. They mistake the teachings of the institutionalized religion, the teachings of the clergy who claim to represent him, for the teachings of Jesus. That is the great error. Nobody misunderstand Jesus more than the christians themselves. [/b]And it is because of the misunderstanding that there are so many christian denominations around
And here's what he/she said.
PastorAde:
[center][b]The Most Misunderstood Person on Earth
[/center]
Most of all, He is misunderstood by Christians who think Jesus Christ is the founder of a religion called Christianity. All of these are misconceptions of Jesus Christ.
Errm,  which part do you disagree with again?  Did you even read the post?  huh
Christianity EtcRe: The Most Misunderstood Person On Earth by OlaMichael(m): 2:30pm On Mar 18, 2011
Very apt teaching. Indeed, God hates religion. Anything that is centred around religion is abominable to God.

As already pointed out, Jesus was not a "Christian". Jesus was God made flesh. In fact the word "Christian" was somewhat more of a derogatory term used to refer to those who were deemed to be like Christ. Jesus came to preach the good news about God's kingdom. He was about establishing a personal relationship between man and God. He was about reconciling the world and man to God.
ProgrammingRe: Post Your Csharp, Cplusplus, Java And Assembly Questions Here. by OlaMichael(m): 4:31pm On Sep 17, 2009
@adewaleafolabi
I posted a response to your question on the other thread you opened.
ProgrammingRe: A Little Help With Java by OlaMichael(m): 2:49pm On Sep 17, 2009
Problem 2: I wrote a program to roll a pair of die and count the number of rolls. The program would end if it gets a 1,1.

public class NewEmptyJavaApp2 {


   public static void main(String args[])
   {
            int x=0;
            int y=0;
            int count = 0;
            int count1 = 0;
            int count2 = 0;

            while(true)
            {
                x=(int)(6*Math.random()+1);
                y=(int)(6*Math.random()+1);
                count++;
                if(x!=1 && y!=1) //Here lies the problem.if changed to || works well
                {    count1++;
                     System.out.println("'"+x+"','"+y+"'"wink;
                }
                else
                {
                    count2++;
                    System.out.println("'"+x+"','"+y+"'"wink;
                    break;
                }
               
            }
            System.out.println("Total:"+count);
            System.out.println("Non snake:"+count1);
            System.out.println("snake:"+count2);
   }
}

The problem here is the && operator. From my understanding && is supposed to evaluate both conditions but in this case if x=1 and y>2 the program would end which is totally incorrect.

Please could someone help me clarify these issues. Thanks.
Your understanding of the && operator is not correct.  The && operator evaluates to true only (and thats a big ONLY) if all conditions specified evaluates to true.

so in your case, the first part evaluates to false (i.e. x != 1) and the second part will return true, as y != 1 will be true for all values of y excepting 1. Thus causing your if block to be evaluated.

There are two solutions. One is simply switching your test so that instead of what you have up there, you do the following.
if(x==1 && y==1) //Here lies the solution
{
count2++;
    System.out.println("'"+x+"','"+y+"'"wink;
    break;
}
else
{
     count1++;
     System.out.println("'"+x+"','"+y+"'"wink;
}

So in effect, you're testing for when both dice return 1(i.e. equals 1) and if nthey do, you quit, else you continue.

The Second and PREFERED solution is to re-write the entire program properly as it is quite crappy the way it is now.
Too many counters, bad variable names, etc.

Here's a solution I came up with,

public class RollCounter
{
private int firstDice = 0;
private int secondDice = 0;
private int numRolls = 0;

private void rollDice()
{
firstDice = (int) (6* Math.random() + 1);
secondDice = (int) (6* Math.random() + 1);
numRolls++;
}

public void run()
{
while(true)
{
rollDice();
if (firstDice == 1 && secondDice == 1)
break;
else
{
System.out.println("Dice 1: " + firstDice + ", Dice 2: " + secondDice);
}
}
System.out.println("Total Rolls: " + numRolls );
}
/**
* @param args
*/
public static void main(String[] args)
{
RollCounter counter = new RollCounter();
counter.run();
System.out.println("Game Ended!"wink;
}
}

As seen, the names represent the program more effectively, only 1 counter used etc etc,


As for question 1, I am at a loss as to what the problem ishuh
ProgrammingRe: Is Programming A Talent? by OlaMichael(m): 12:02pm On Sep 10, 2009
I echo Cactus' sentiment.

Certain abilities innate to the person may make it easier for that individual to lean towards programming. However, programming is a learnt skill, not a natural talent.

1 (of 1 pages)