Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,162,194 members, 7,849,702 topics. Date: Tuesday, 04 June 2024 at 08:15 AM

Logic101's Posts

Nairaland Forum / Logic101's Profile / Logic101's Posts

(1) (2) (3) (4) (5) (6) (of 6 pages)

Programming / Re: Improve The Speed Of This Java Code. by logic101: 10:48pm On Oct 22, 2011
@ omo t0 dun happy weekend bros, just a small question
i am a little bit confused  with this part.i understand the [c-48] part but i cant see any character being passed into the c.
the only time a character is passed into the c is c = squared.charAt(i).i also dont understand how your increasing the frequency.

++tens_digit[c - 48] > 1
Programming / Writting A Method In C by logic101: 11:23pm On Oct 21, 2011
hi, i am trying to write a method that checks if the terminator of an email is valid.
its takes two parameters char * addrress which contains the email
and char * terminator which ontains the terminator
my problem is it seems that i am not copying the termitor in the string address to my buffer correctly or my terminator arrray is empty/
here is an e.g A terminator is a final string such as "com" or "net" that ends an
email address. The set of all valid terminators is stored in the
parameter array "terminators"


int isTerminator(char * address,char *terminator){
int index=0;
char buffer[55];
int length=strlen(address);
//getting the length of my first index
while(address[length]!='.'){
length--;
}
length++; // incrementing by one due to o indexing so my first character starts at index 23

//copying frm string to my array buffer
while(address[length]!='\0'){
buffer[index++]= address[length++];
}

int i=0;

for(i;i<5;i++){
if(0==strcmp(buffer,terminator))
return 1;
}

return 0;

}

int main(int argc, char** argv) {

const int length = 5;
char *terminators[length];
char * address1, address2;

terminators[0] = "com";
terminators[1] = "net";
terminators[2] = "edu";
terminators[3] = "ie";
terminators[4] = "tv";

address1 = "fana.bosss@north.south.com";
address2 = "I.am@flh";







// int x=containsvalidIdentifiers(mm);
int y= isTerminator(address1,terminators);

printf("%d",y);

return 0;
}
Programming / Re: Improve The Speed Of This Java Code. by logic101: 12:34am On Oct 20, 2011
Thank you omotodun, Your a good teacher.I am still litttle bit confused on your algorithm but i would figure it tonight lol,
Programming / Re: Improve The Speed Of This Java Code. by logic101: 7:38am On Oct 19, 2011
and also can you tell me if you know why my output was missing some results
Programming / Re: Improve The Speed Of This Java Code. by logic101: 7:37am On Oct 19, 2011
omotodun i would luv to be your programming  son lol,
please do you mind explaining this bit of your code

public static boolean isSet(String squared) {
      int[] tens_digit = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
      char c;

      for(int i = 0; i < 9; ++i)
         if((c = squared.charAt(i)) == '0' || ++tens_digit[c - 48] > 1)
            return false;

      return true;
   }
Programming / Improve The Speed Of This Java Code. by logic101: 11:10pm On Oct 18, 2011
Aim .the aim of this code is to print out all 9 digits numbers that have perfect squares .
all 9-digit perfect squares, if any, that uses all the digits 1 to 9 exactly once.
For example, 139,854,276 is a solution as 11,8262 = 139,854,276.

this is my own code but my run time is slow,


public class NineDigitPerfectSquare {
         private final static int BEGINNING=10000000;
         private final static int END=999999999;

public static void main(String[] args) {
//System.out.println(isPerfect(65));

String s= printPerfectNumbers();

for(int i=0;i<s.length();i++){
System.out.println(s.charAt(i));

}


}

public static boolean isOrdered(int []numbers){
// int value=1;
 

for(int i=0,value=1;i<numbers.length;i++,value++){
if(numbers[i]!=value)
return false;
}
return true;

}


public static void bubblesort(int[]numbers){
int temp=0;
for(int i=numbers.length-1; i>1;i--){
for(int j=0;j<i;j++){
if(numbers[j] > numbers[j+1]){
temp=numbers[j];
numbers[j]=numbers[j+1];
numbers[j+1]=temp;

}
}
}
}


public static int[] convertStringToIntArray(String s){
int permutation[]=new int[s.length()];
for(int i=0;i<permutation.length;i++)
permutation[i]= Character.digit(s.charAt(i),10);

return permutation;

}

public static boolean isPerfect(int n){


int x=1;
int sum=1;

while(sum<n){
x=x+2;
sum=sum+x;

}
return (sum==n);
   
}

public static boolean isPerfectSquare(int n){
return (Math.sqrt(n)==Math.floor(Math.sqrt(n)));
}



public static String printPerfectNumbers(){
int [] number1=new int[9];
String s=" "; String p="";
for(int i=BEGINNING ; i<=END ; i++){
if(isPerfectSquare(i) )
{
p=""+i;
// p.trim();
number1=convertStringToIntArray(p);
bubblesort(number1);
if(isOrdered(number1))
{
s=  s +  "  ,  " + i;
}

}
}
return s;
}
}
Programming / Re: C Programming Challenge To Be Solved Under 10 Minutes by logic101: 1:36am On Oct 17, 2011
your welcome omo to dun , something more interesting hopefully

Once you have this working, modify the function so that there
are checks on the maximum lengths of the strings to ensure that
you don't go over the ends of the array:

int tokenise(char str[], int max_str, int start,
char result[], int max_result);

If the length of a token to be returned is longer than will fit in
'result', the token should be truncated.
Programming / Re: C Programming Challenge To Be Solved Under 10 Minutes by logic101: 12:22am On Oct 17, 2011
9ice work omo to dun,
Programming / C Programming Challenge To Be Solved Under 10 Minutes by logic101: 3:22pm On Oct 16, 2011
Write a function with the following prototype:
int tokenise(char str[], int start, char result[]);

The function should find the next token starting at index 'start'
in the string 'str'. The token should be copied into the string
'result', which is another character array passed to the function,
so that the string is communicated back to the caller.

The function returns an integer value, which should be the next
position in 'str' after the returned token. Next time the function is
called, this will be the next value of start. If there are no more
tokens, then the returned integer value should be -1.

You might use this function as follows:
char line[] = "Nothing but the rain";
char result[256];
char start;

start = tokenise(line, 0, result);
while ( start != -1 ) {
printf("%s\n", result);
start = tokenise(line, start, result);
}
Religion / Re: Is It Compulsory To Go To Church On Sunday? by logic101: 12:19pm On Oct 14, 2011
The origin of christians worshipping God on sunday comes from the early romans worshiping the indo -aryan / iran/ persian God called mithra.
Politics / Re: Why Are African Leaders So Easy To Influence? by logic101: 1:32am On Oct 09, 2011
great thread i would like to make my own contributions.
There are five key areas we need to get hold of
1.Education
2.Military
3.Economics
4.culture(religion,identity,means to solving our problems)
5.Concept of nationhood.


books to read.
frants fanonn the wretched of the earth
walter rodney how the west underdeveloped africa
cheikh anta diop the african origin of civilization
amos wilson power economics
ivan van sertima they came before columbus
any book on chinas history between 1600=2000
any book on japanes history between the same time frame
books on singapore
books on understanding how so called imf and worldbank operate

european history fromm 1500-present

geography books.


2.Military,

2 Likes

Religion / Re: Why Do Many Christians Love False Prophets? ( Edited ) by logic101: 11:13pm On Oct 06, 2011
“Show me a population that is deeply religious, and I will show you a servile population, content with whips and chains, contumely and the gibbet, content to eat the bread of sorrow and drink the waters of affliction. The present condition of the Negroes of America is a touching bit of testimony to the truth of this assertion. Here in America the spirit of the Negro has been transformed by three centuries of subjection, physical and mental, so that they have even glorified the fact of subjection and subservience.”
― Hubert H. Harrison
Religion / Re: Why by logic101: 11:13pm On Oct 06, 2011
“Show me a population that is deeply religious, and I will show you a servile population, content with whips and chains, contumely and the gibbet, content to eat the bread of sorrow and drink the waters of affliction. The present condition of the Negroes of America is a touching bit of testimony to the truth of this assertion. Here in America the spirit of the Negro has been transformed by three centuries of subjection, physical and mental, so that they have even glorified the fact of subjection and subservience.”
― Hubert H. Harrison
Foreign Affairs / Re: Is It Possible For Black People To Be Racist? by logic101: 9:21pm On Oct 01, 2011
cap28 it seems your my clone lol we watch the same things,
Religion / Re: Was Abraham An Arab Or A Jew? by logic101: 11:16am On Sep 16, 2011
islam is an ad religion for those who didnt know , bilal who was a teacher of mohammed was an ethiopian, He was never a slave as purported by history.It has been turned into a political instrument which has been used to increase the influence of the arabs.

the roots of christianity was born in egypt in the nile valley.it was not until the 365 bc that the europeans adopted christianity through the roman emperor constantin.This was for political reasons.
As an african i really dont give a toss about abraham. @ frosbel please what has your knowledge of abraham brought to nigerians because people have been suffering since europeans set their foot on our land .
Religion / Re: Was Abraham An Arab Or A Jew? by logic101: 11:10am On Sep 16, 2011
KDULAR:

Abraham was neither . He was either a Chaldee or Persian .He did did not practice any of these two religions that we have today. A Muslim means some one that subjects himself to the will of Allah and a Christian is someone that behaves like Christ while a Traditional Yoruba bei;iever believes God is the most supreme and the dieties are means through which their prayers can be answered . All are after one thing knowing God. To the Muslims that will not stop at nothing to discredit what the Al-Qouran does not discredit answer it yourself if you are subjecting yourself to the will of Allah and to the Christian that condemns  heap curses and refuse to Love his neighbour ( Christian Muslims and neither of the two ) .
The truth as to me is what are we loosing our sanity for ?  Arabs and jews who di not give a poo about us. As an African, I am least interested in this politics we need to sieve out the truth out of it all and use it for our own.
Will I not be happy to have people pay pilgrimaga and earn lots of money and influence for my society than continue to propagate and perpetuate some other peoples cultures.

Arabs brought Islam and enslaved us up till the present, communities are upturned and their scions are Emirs and so on these days still perpetrating and like those who did not convert to their foreign religion were enslaved and sold into north africa and the middle east.
The Christian came and did their own thing too enslaving majority into Europe and America and foolish as we are we are still helping in perpetrating.
The old totally Unchriatian   and Unislamic war of the premedieval times between the west and the Arabs are still beeing fought by African Muslims and Christians alike and we refuse to see the damages these had done to Humanity.

I am surprised at the so called educated Africans nay Nigerian in the name of religion not concentrating on the spirituality of the religions and get to know more about God through their religion which has nothintg in real sense has to do with some histories of. Abraham sacrificed, the lesson inthat is Faith in God and ability to listen and change gear at any given time as instruction could change. It teaches praying without ceasing. Wheter God has a son or slaves does not matter their  or does it?

What is given to you hold on to it because it is on that you will be judged and not what is given to others. Why are Christians and Muslims in Nigeria and elsewhere greedy?
You need not discredit the other person before I  convert to your religion . This is what he / she believes and you don't have the right to  tell him it's not so.

IF ALL BELIEVE THAT GOD IS GREAT AND GREATER THAN ALL THEN, FACE YOUR OWN BELIEVE AND DO RIGHT SO AS TO HAVE MORE PEOPLE FOLLOW YOU ACCORDING TO THE EXAMPLES GIVEN RATHER THAN MAKING NOISE AND THREATENING THEM TO ACCEPT YOUR OWN WAY[/b].

I wish to say more cause I am tired of all these religious bigots from both sides if this side are wrong why God allowed them to remain? Abeg we no need this religious nonesense from these oversabi and over read religious jingoists. Haba angry angry angry angry angry angry
word
Foreign Affairs / Re: Why Do You Give A Damn About Libya Or Gaddafi? by logic101: 3:05pm On Sep 05, 2011
Beaf:

Who is talking about what Gaddafi did or didn't do?
Al qaeda rides on the back of anti-Western propaganda. Its simple really.
food for thought ,
who created alqaeda and for what reason?
what has been alqaeda's achievements?
Business / Re: System Collapse: Power Supply Stabilises At 3,700mw by logic101: 3:03pm On Sep 05, 2011
Johndoe100:

You see, we who are in Nigeria actually live the stuff we post. We have had UNINTERRUPTED supply of power for the last week. Sorry I don't have a link to any report.
typical nigerian with a high level of ignorance and apathy.
3700mw watts available and probably the area you live has your so-called un interrupted power supply.what about the rest of the country.
You should be scratching your head and thinking how on hell does nigeria in 2011 produce only 3900 mw of electricity.
Foreign Affairs / Re: Check Out Muammar Gaddafi's Leadership In Libya. by logic101: 2:57pm On Sep 05, 2011
Beaf:

^
They have electricity, yet they import every last pin and manufacture nothing. Dude, thats the definition of useless; even without electricity in 9ja we still have boys and girls trying to build new things, start up businesses and create a better life. Nobody is in lock down like it was in Libya.
using your logic very few countries create/manufacture things.The worlds manufacturing hub right now is asia in europe its germany
1.you said libya should be like dubai, and you say that libya manufactures nothing, dubai has no manufacturing industries and i see no difference between dubai and libay and point of correction dubai is an emirate while libya is a nation.du please bai is basically a hub for businesses.
and can you please enlighten me on the corrolation between libya(an african country) and europeans invading the country.

your exhibit signs of a mis educated negro who never understands that every thing in life is political and the west has no friends but permanent interest.
Politics / Re: Racial Inequality - Black Unemployment At Highest Level In 27-years In The US by logic101: 1:58pm On Sep 04, 2011
you can also check put the works of amos wilson

https://www.youtube.com/watch?v=2ObcKimXHIY
Politics / Re: Racial Inequality - Black Unemployment At Highest Level In 27-years In The US by logic101: 1:56pm On Sep 04, 2011
buzugee:

John Henrik Clarke. thats my nigga. so i went to a salvation army store in chicago. and for some weird reason someone had dumped all these wonderful black books. i picked them all up and paid 45 cents for each of them. John Henrik clarke was one of them. there was james badwin, malcolm x,martin luther king, walter mosley etc

Uploaded with ImageShack.us


yes boss that man should be studied in african curriculums.His books are one of a kind.Its actually interesting that you bought those books at that price because they are gems.
Politics / Re: Boko Haram: Jonathan Employs Israeli Security For Aso Rock by logic101: 12:00am On Sep 04, 2011
"If the Israeli Zionists believe their present occupation of Arab Palestine is the fulfillment of predictions made by their Jewish prophets, then they also religiously believe that Israel must fulfill its "divine" mission to rule all other nations with a rod of irons, which only means a different form of iron-like rule, more firmly entrenched even, than that of the former European Colonial Powers. These Israeli Zionists religiously believe their Jewish God has chosen them to replace the outdated European colonialism with a new form of colonialism, so well disguised that it will enable them to deceive the African masses into submitting willingly to their 'divine' authority and guidance, without the African masses being aware that they are still colonized , The Israeli Zionists are convinced they have successfully camouflaged their new kind of colonialism. Their colonialism appears to be more 'benevolent,' more 'philanthropic,' a system with which they rule simply by getting their potential victims to accept their friendly offers of economic 'aid,' and other tempting gifts, that they dangle in front of the newly-independent African nations, whose economies are experiencing great difficulties , The modern 20th century weapon of neo-imperialism is 'dollarism.' The Zionists have mastered the science of dollarism: the ability to come posing as a friend and benefactor, bearing gifts and all other forms of economic aid and offers of technical assistance. Thus, the power and influence of Zionist Israel in many of the newly 'independent' African nations has fast-become even more unshakeable than that of the 18th century European colonialists, and this new kind of Zionist colonialism differs only in form and method, but never in motive or objective."
malcom x
Politics / Re: Racial Inequality - Black Unemployment At Highest Level In 27-years In The US by logic101: 11:57pm On Sep 03, 2011
Afrikan people need to be shocked out of our 'waking coma' and face the harsh realities of the world we are in. No one but ourselves is going to change our generally pitiful economic condition. This is a fiercely competitive world in which different groups compete against each other, whilst many of us are locked into an individualistic fantasy; thinking that success is a purely individual pursuit. Group identity, solidarity, trust, co-operation and accountability provide the platform for individuals to achieve economic success. This is why Afrikans are at the bottom of the economic pile wherever we live, despite the Oprahs, Bob Johnsons, athletes, entertainers etc.
Politics / Re: Racial Inequality - Black Unemployment At Highest Level In 27-years In The US by logic101: 11:56pm On Sep 03, 2011
The most dangerous of all dependencies is to depend on your wealthy oppressor to free you and share wealth with you, because wealthy people (and nations) never train poor people (and nations) to take wealth away from them."
Politics / Re: Racial Inequality - Black Unemployment At Highest Level In 27-years In The US by logic101: 11:55pm On Sep 03, 2011
"The most dangerous of all dependencies is to depend on your powerful oppressor to free you and share power with you, because powerful people never train powerless people to take their power away from them."

John Henrik Clarke
Foreign Affairs / Re: Australia Totally Loses The Plot And Discards AD And BC For BCE, BP And CE by logic101: 11:41pm On Sep 03, 2011
"Cultural continuity is maintained by educating children in the ways of their culture. And they are educated in the ways of their culture to MAINTAIN their culture, to advance its interests, and ultimately to try to maintain its very survival. That is the fundamental reason people are educated. What does it matter if you learn physics and computer science and everything else and you cannot defend yourself against a military assault by Europeans or a germ warfare assault? A knowledge of computer science, a knowledge of law, a knowledge of all of these other things matters not at all if you are unable to use that knowledge for your self defense. If Bush decided to wipe the face of this earth clean of African people there's not an African nation that could defend us against these people. And as long as we are not educated to defend ourselves against these people then we are being incorrectly educated. Nothing else matters.

Ultimately then, intelligence must be defined in terms of the degree in which it solves YOUR PROBLEMS. The nature of education today prepares you to solve THEIR PROBLEMS and not your own. That's why you study THEIR books, you go to THEIR schools, you learn THEIR information, THEIR language, THEIR styles, THEIR perceptions, so when you come out of school you can do a humdinger of a job solving European's problems, but you can't solve your own. And then you DARE call yourself "intelligent?" C'mon. That's the height of stupidity." - Dr. Amos Wilson
frosbel whats your problem with whats happening in australia
Foreign Affairs / Re: Why Do You Give A Damn About Libya Or Gaddafi? by logic101: 11:29pm On Sep 03, 2011
"Cultural continuity is maintained by educating children in the ways of their culture. And they are educated in the ways of their culture to MAINTAIN their culture, to advance its interests, and ultimately to try to maintain its very survival. That is the fundamental reason people are educated. What does it matter if you learn physics and computer science and everything else and you cannot defend yourself against a military assault by Europeans or a germ warfare assault? A knowledge of computer science, a knowledge of law, a knowledge of all of these other things matters not at all if you are unable to use that knowledge for your self defense. If Bush decided to wipe the face of this earth clean of African people there's not an African nation that could defend us against these people. And as long as we are not educated to defend ourselves against these people then we are being incorrectly educated. Nothing else matters.

Ultimately then, intelligence must be defined in terms of the degree in which it solves YOUR PROBLEMS. The nature of education today prepares you to solve THEIR PROBLEMS and not your own. That's why you study THEIR books, you go to THEIR schools, you learn THEIR information, THEIR language, THEIR styles, THEIR perceptions, so when you come out of school you can do a humdinger of a job solving European's problems, but you can't solve your own. And then you DARE call yourself "intelligent?" C'mon. That's the height of stupidity." - Dr. Amos Wilson
Programming / Re: Confused About Learning C# by logic101: 11:14am On Sep 02, 2011
you can get chsarp tutorials from the new boston his very good.
http://www.thenewboston.com/
Romance / Re: Would You Date An Atheist? by logic101: 1:55am On Sep 02, 2011
My main point here is that if you are the child of God and God is a part of you, the in your imagination God suppose to look like you. And when you accept a picture of the deity assigned to you by another people, you become the spiritual prisoners of that other people.
John Henrik Clarke
Romance / Re: Would You Date An Atheist? by logic101: 1:54am On Sep 02, 2011
Religion is the organization of spirituality into something that became the hand maiden of conquerors. Nearly all religions were brought to people and imposed on people by conquerors, and used as the framework to control their minds.
John Henrik Clarke
Politics / Re: Let's Be Honest , The Un Bombing In Abuja Was Carried Out By The Americans ! by logic101: 3:20pm On Aug 29, 2011
wirinet:

Nigerians like to blame every one else but themselves for their woes instead of taking pragmatic actions. They blame western media for misinformation and yet most of us are glued to these western media 24/7. What prevents our own media from providing us with correct information?. The us had been warning us about al-qaeda infiltration in Nigeria for years, yet we all remained blind. Now the chicken has come home to roost and we are blaming the west and western media. Was it the US that trained andulMutallab to bomb a us bound train? Or was he working for CIA? Remember he said he and others Deon nigeria was trained by Al-Qaeda in yemen, maybe OT was CIA
that was doing the training.
who created alqaeda, what are the objectives of alqaeda
Politics / Re: Nigeria Needs America Military Base To Deal With Terrorism by logic101: 3:19pm On Aug 29, 2011
@ op i would pretend that you are joking but if your serious your one hell of a misinformed or uninformed person.

(1) (2) (3) (4) (5) (6) (of 6 pages)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 81
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.