Romance › Re: Miss Nairaland Contest 2015 - Elimination Round 2 by nnasino(m): 2:53pm On May 19, 2015 |
I vote:
MzLaurel and Twaci
Goodluck.
Cc. NLJega |
Programming › Re: Trivia Coding Questions (euler Project) by nnasino(m): 6:10pm On May 16, 2015 |
kudaisi: If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage. This is my solution. Shout out to all my bosses above. Hope to improve with time. package problems;
import java.util.HashMap; import java.util.Random;
/** */ class Problems {
static HashMap<Integer, String> numberMap = new HashMap(); static StringBuffer builder = new StringBuffer(); static { numberMap.put(1, "one" ; numberMap.put(2, "two" ; numberMap.put(3, "three" ; numberMap.put(4, "four" ; numberMap.put(5, "five" ; numberMap.put(6, "six" ; numberMap.put(7, "seven" ; numberMap.put(8, "eight" ; numberMap.put(9, "nine" ; numberMap.put(10, "10" ; numberMap.put(11, "eleven" ; numberMap.put(12, "twelve" ; numberMap.put(13, "thirteen" ; numberMap.put(14, "fourteen" ; numberMap.put(15, "fifteen" ; numberMap.put(16, "sixteen" ; numberMap.put(17, "seventeen" ; numberMap.put(18, "eighteen" ; numberMap.put(19, "nineteen" ; numberMap.put(20, "twenty" ; numberMap.put(30, "thirty" ; numberMap.put(40, "forty" ; numberMap.put(50, "fifty" ; numberMap.put(60, "sixty" ; numberMap.put(70, "seventy" ; numberMap.put(80, "eighty" ; numberMap.put(90, "ninety" ; numberMap.put(100, "hundred" ; numberMap.put(1000, "thousand" ;
}
private static String noToWordsNoSpaces(int number) { builder.delete(0, builder.capacity()-1); int rem = number; int quotient = 0; //small numbers if (number <= 20) { return numberMap.get(number); } else if (number < 100) { quotient = rem / 10; rem = rem % 10; return String.format("%s%s", numberMap.get(quotient * 10), ((rem > 0) ? numberMap.get(rem) : "" ); } //larger numbers quotient = rem / 1000; rem = rem % 1000; if (quotient > 0) { builder.append(String.format("%s%s", numberMap.get(quotient), numberMap.get(1000))); } quotient = rem / 100; rem = rem % 100; if (quotient > 0) { builder.append(String.format("%s%s", numberMap.get(quotient), numberMap.get(100))); } if (rem == 0) { return builder.toString(); } else { if (rem <= 20) { builder.append(String.format("and%s", numberMap.get(rem))); } else { quotient = rem / 10; rem = rem % 10; builder.append(String.format("and%s%s", numberMap.get(quotient * 10), ((rem > 0) ? numberMap.get(rem) : "" )); } } return builder.toString(); }
public static void main(String[] args) { int answer = 0; for (int i = 1; i <= 5; i++) { answer += noToWordsNoSpaces(i).length(); } System.out.println(answer); answer = 0; for (int i = 1; i <= 1000; i++) { answer += noToWordsNoSpaces(i).length(); } System.out.println(answer); } }
Answer is 21114. |
Romance › Re: What Will You Do If Your Fiancee Does This On A Fateful Night? by nnasino(m): 5:57pm On May 12, 2015 |
mtscheww |
Politics › Re: THE IGBO AGENDA AGAINST THE YORUBA IN LAGOS - by nnasino(m): 6:05pm On Apr 06, 2015 |
Finally, we igbos dey talk too much sha. How will you say Lagos is no man's land. Please yorubas ignore all that, I assure you that most igbos in Lagos don't have that impression/line of thinking and even those that think like that; it's just mouth and nothing more. Please no need for hating the whole tribe. we are one. |
|
Programming › Re: Google Code Jam by nnasino(m): 11:32am On Apr 06, 2015 |
elfico: have u done it before? nope |
Programming › Re: Google Code Jam by nnasino(m): 4:29pm On Apr 04, 2015 |
i will participate |
Technology Market › Re: Mtn And Etisalat Data, 1gb ,,,,#1100 08062910669 by nnasino(m): 3:58pm On Apr 01, 2015 |
Just purchased mtn 1gb data. Keep up the good work sir |
Politics › Re: Buhari To Address The Nation - Vanguard by nnasino(m): 6:44pm On Mar 31, 2015 |
sai buhari  sai buhari |
Politics › Re: Jega's Announcement Of Presidential Election Results 2015: Part 4 by nnasino(m): 6:43pm On Mar 31, 2015 |
sai buhari |
Phones › Re: Any Experiencing Glo Bad Network??? by nnasino(m): 3:32pm On Mar 29, 2015 |
I wanted to create this thread before but i thought it was just my area. There is glo mast close to my house and i have full 3g service with H but it is very slow and frustrating to use. My rolled over 2500 naira 4.5 gb bundle is remaining almost 4700mb and it expires at the end of this week. I've already decided to switch over to mtn sme of 1gb at least i can be sure of accessing the internet whenever it is needed. I think they have more traffic as a result of the 3gb bis tweak as many people are using it. |
Celebrities › Re: Photo: Mercy Johnson Show Off Her Sexy Figure by nnasino(m): 11:20am On Mar 15, 2015 |
Nice |
Technology Market › Re: Smart 96000mah Laptop Computer System Power Bank For Sale by nnasino(m): 9:01am On Mar 14, 2015 |
is it INEC battery? please post the pictures and can you deliver to imo state? |
Programming › Re: Java Tutorial For Beginners by nnasino(op): 10:25am On Feb 16, 2015 |
pretizy: nice one..i also give out java tutorials on my what's app group.. i will support this movement here as well Nice one, good job sir. Been so busy but i'll be back soon |
Technology Market › Re: Sony Vio Flash Drive 512gb Works Perfectly 6k Pic by nnasino(m): 7:57pm On Feb 13, 2015 |
|
Politics › Re: Doyin Okupe Mocks Obasanjo's Endorsement Of Buhari(pic) by nnasino(m): 5:50pm On Feb 13, 2015 |
lol |
Crime › Re: 16-year-old Girl Bathes Lover With Acid For Cheating On Her by nnasino(m): 3:07pm On Feb 09, 2015 |
lookingforjob: THEY ARE WICKED AND SELF CENTERED. THEY INSIST ON INFLICTING MORE POVERTY ON THE MASSES BY VOTING GEJ hahahahahahahahaha, funny guy. Some Igbos support buhari o. I support buhari for one. You have to understand where the igbos are coming from when they reject buhari. But that's not really enough for you to hate on all igbos now.  |
Culture › Re: Top 10 Misconceptions About The Yoruba Tribe by nnasino(m): 8:10pm On Feb 05, 2015 |
I love yorubas, they have strong culture and are generally the most humble of all the tribes yet amongst the most achieving. Cheers to you guys. |
Technology Market › Re: Watchout For Jumia n Konga Black Friday Scams by nnasino(m): 9:47am On Jan 31, 2015 |
skentelelady: Please help me to ask your brother.
My brother just got a laptop from them today and it is bad. We got to know after we opened it.
We have been calling and nobody is really saying anying promising so we need to find their warehouse or office and return it
Please help  its on Allen avenue, beside access bank. though they have other ones but the one I mean is on Allen avenue ikeja. try sending them a mail |
Technology Market › Re: Watchout For Jumia n Konga Black Friday Scams by nnasino(m): 5:33pm On Jan 30, 2015 |
skentelelady: please where is konga warehouse situated
thank you The one i'm talking about is in ikeja, i can't remember the street but it's a very popular street (maybe allen). |
Tech Jobs › Talented Developers Needed For Full Time Employment by nnasino(op): 9:12am On Jan 24, 2015*. Modified: 7:43pm On Apr 07, 2015 |
Good morning everyone, I've been tasked to recommend some good developers for some jobs. So I'll like to place the vacancy here on nairaland.com.
First Vacancy Job Description Develop software according to functional and technical design specifications and maintain a "common sense" approach that serves to recognize potential design gaps and provide insight into closing them. Create efficient, scalable, reusable code with one or more of the following J2SE , J2EE, ASP.NET, PHP and other languages as needed.
Create intuitive, logical and dynamic user interfaces using HTML, DHTML, Javascript, JQuery and AJAX. Create and design databases, views, stored procedures, T-SQL statements and user-defined functions of varying complexity with a "best practices" approach to keys, indices and relationships in SQL Server 2008/2012 and MySQL.
Maintenance and other roles Assess, troubleshoot, document, upgrade and develop maintenance procedures; Review code for potential performance issues, reusability and or anomalies. Detail unit testing of code.
Qualifications and Requirements .NET PHP Mobile Java
Second Vacancy Job Description Coding in both Java and Java EE. Follow coding standards walk-through. Work on high and low level designs. Prepare and installs solutions by determining and designing system specifications, standards and programming. Develops software solutions by studying information needs; conferring with users; studying systems flow, data usage, and work processes; investigating problem areas; following the software development life cycle. Provide information by collecting, analyzing and summarizing development and service issues.
Qualifications and Requirements Minimum of HND in relevant discipline Expert Java Programmer Conversant with J2EE Technologies Experience with any of Struts, Spring
Send in your CVs to ***@live.com with the subject "Developer Job". Send your github page/url/username if you have one showing your works. If you don't you could send any of your work source code to the email. The jobs are in Lagos and we are keeping the companies hiring confidential for now. Shortlisted applicants will be contacted by sms.
Thanks all |
Tech Jobs › Talented Developers Needed For Full Time Employment by nnasino(op): 8:51am On Jan 24, 2015*. Modified: 7:35pm On Apr 07, 2015 |
Good morning everyone, I've been tasked to recommend some good developers for some jobs. So I'll like to place the vacancy here on nairaland.com.
First Vacancy Job Description Develop software according to functional and technical design specifications and maintain a "common sense" approach that serves to recognize potential design gaps and provide insight into closing them. Create efficient, scalable, reusable code with one or more of the following J2SE , J2EE, ASP.NET, PHP and other languages as needed.
Create intuitive, logical and dynamic user interfaces using HTML, DHTML, Javascript, JQuery and AJAX. Create and design databases, views, stored procedures, T-SQL statements and user-defined functions of varying complexity with a "best practices" approach to keys, indices and relationships in SQL Server 2008/2012 and MySQL.
Maintenance and other roles Assess, troubleshoot, document, upgrade and develop maintenance procedures; Review code for potential performance issues, reusability and or anomalies. Detail unit testing of code.
Qualifications and Requirements .NET PHP Mobile Java
Second Vacancy Job Description Coding in both Java and Java EE. Follow coding standards walk-through. Work on high and low level designs. Prepare and installs solutions by determining and designing system specifications, standards and programming. Develops software solutions by studying information needs; conferring with users; studying systems flow, data usage, and work processes; investigating problem areas; following the software development life cycle. Provide information by collecting, analyzing and summarizing development and service issues.
Qualifications and Requirements Minimum of HND in relevant discipline Expert Java Programmer Conversant with J2EE Technologies Experience with any of Struts, Spring
Send in your CVs to **@live.com with the subject "Developer Job". Send your github page/url/username if you have one showing your works. If you don't you could send any of your work source code to the email. The jobs are in Lagos and we are keeping the companies hiring confidential for now. Shortlisted applicants will be contacted by sms.
Thanks all |
Politics › Re: Mrs. Buhari Will Vote For Jonathan - Obasi by nnasino(m): 8:58pm On Jan 17, 2015 |
Issue based campaign please |
Programming › Re: Java Programmers Pls Your Help Is Needed by nnasino(m): 8:06pm On Jan 16, 2015 |
Richhommie: Please can anyone in the house help me with these problems. I would really appreciate it . Thanks in advance
Methods should be implemented in java
1. Given the functions f(a,b)=4a - 8b=0 g(x,y)= 9x^2 - 3y=0 ,implement a method that resolves h(x,y,a,b)= 2g(x,y)^f(a,b) (^ means raised to the power)
Show results for 10 different values in a tabular form as shown below
S/n. x. y. a. b. h(x,y,a,b) 1 2 3 4 5 6 7 8 9 10
2. Given that. f(n)=f(n -1)+ f(n - 2) where f(0)= f(1)= 5. And n>1; implement a method for evaluating f(n) using recursion. Question 1class NairalandSolution {
public static double f(double a, double b){ double result = (4 * a) - (8 *b); return result; }
public static double g(double x, double y){ double result = (9 * Math.pow(x, 2)) - (3*y); return result; }
public static double h(double x, double y, double a, double b){ double result = 2.0 * Math.pow(g(x,y), f(a,b)); return result; }
public static void main(String[] args) { double x,y,a,b; x = 6; y = 2; a = 6; b = 2; System.out.printf("S/N.\tx.\ty.\ta.\tb.\th(x,y,a,b)%n" ; for(int i = 1; i <= 10; i++){ x += 2; y++; a += 2; b++; System.out.printf("%d\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f%n", i, x, y, a, b, h(x,y,a,b)); } } }Question 2class Recursion{ public static int f(int n){ if(n <= 1) return 5; else return f(n-1) + f(n-2); } public static void main(String[] args){ System.out.println("f(9) = " + f(9)); } } |
Programming › Re: Java Tutorial For Beginners by nnasino(op): 9:41am On Jan 16, 2015 |
realowded: Please bro, explain each line of codes... realowded: Please bro, explain each line of codes... class Primes{ static boolean isPrime(int number){ //isPrime is declared as static, so we can use it within main (main is also static) if(number == 2) return true; for(int i = 2; i < number; i++){ if(number % i == 0) //If the number can be divided by any other number apart from 1 and itself return false; //Then it is not prime } return true; //If not it is prime } public static void main(String[] args){ //type psvm and press tab, netbeans will complete this for you int number = 0; //Variable for holding the maximum number Scanner scan = new Scanner(System.in); System.out.println("Please enter the maximum number" ); //type sout and press tab number = scan.nextInt(); int count = 0; //The number of primes found for(int i = 2; i <= number; i++){ if(isPrime(i)) count++; } System.out.println("The number of primes between 1 and " + number + " is " + count); } }Alright, explanation line by line line 1: We define our class Primes line 2 to 10: The function isPrime takes an integer as input and returns true if it is a prime number and false if not. line 2: declare the function. static means that we don't need to create an instance of the class Prime to use the function. boolean is the return type of the function and isPrime is the name of the function. within the parentheses, we specify that the function will take an integer as its only parameter line 3-4: if the number is equal to 2 return true; (2 is a prime number) line 5: Loop starting from 2 up to the number - 1. line 6-7: If the number can be divided without remainder by any of these numbers then it is not a prime so we return false ; line 9: If at the end of the loop (the we know that there is number from 2 to the number -1 that divides the number in question without remainder. Therefore, it is a prime number and we return true ; line 11: This is the main method which will be executed by the JVM. line 12: Variable for holding the maximum number which will be fetched from the user line 13: Create a Scanner object ( this is used to read input from the user) line 15: Read an integer from the user line 16: Create a variable that will keep count the number of primes line 17: Loop from 2 to number; |
Programming › Re: Java Tutorial For Beginners by nnasino(op): 8:53am On Jan 16, 2015 |
Good morning everyone, a happy new year to you all. Sorry I've been AWOL for so long. I'm having issues with my connection and I'm not comfortable writing with my phone but as soon as I resolve that, the thread will be revived. |
Politics › Re: LIVE Updates From Buhari And Rochas' Campaign In Owerri by nnasino(m): 2:49pm On Jan 12, 2015 |
mundus: Imo youths are already mobilizing supports for Buhari in the streets of Owerri. wow, this is. Great |
Politics › Re: LIVE Updates From Buhari And Rochas' Campaign In Owerri by nnasino(m): 2:47pm On Jan 12, 2015 |
obailala: ..and in your mind, you are automatically 101% sure that the motor assembly plant in Nnewi will be closed if GEJ leaves power?
Can you please take several seats at the back... 
If a less corrupt government is at the centre, you will surely see several more automotive assembly plants springing up across the south east. With less corruption and better security even in the north, investor confidence would be boosted in Nigeria as a whole and more foreign investors would surely troop down into the south east to tap into the juicy business environment of Nigeria.
NISSAN, FORD and TOYOTA would surely love to have a plant in Nigeria but due to the percieved insecurity and corrupt business environment (especially by govt officials demanding cutbacks), these companies have been very wary of investing a kobo in Nigeria and have kept away. The story of Virgin Nigeria and the shocking words of Richard Branson when he pulled away from Nigeria is still fresh in our minds. With the forthcoming elections, these guys are closely monitoring Nigeria and praying a less corrupt govt takes over.
Saboteur to Igbo race indeed, what Nonsense!... The kind of Igbo blood in me is too superior and does not permit blind and silly followership. By the way, is Jonathan even an Igbo man?... Okay, he's not my brother but rather my close neighbour so I can easily assume he's my brother but then, "OF WHAT USE IS MY BROTHER'S LEADERSHIP TO ME IF HE CANNOT DEVELOP THE NATION OR EVEN JUST OUR FATHER'S COMPOUND?" well said boss, its unfortunate many igbos are still easily deceived with tribal and religious propaganda after we will be forming educated and sophisticated. Mtcheew |
Programming › Facebook Hacker Cup 2015 by nnasino(op): 7:57pm On Jan 09, 2015 |
Hello everyone, the facebook hacker cup for 2015 kicked off earlier today. I hope we all from nairaland will be competing. This is my first competitive programming contest and I hope to at least make it past the elimination round. If you are competing please don't hesitate to sign in. This is a link: https://www.facebook.com/hackercupcheers |
Phones › Re: Photos: Tremendous Increase In Glo Data Cap by nnasino(m): 1:48pm On Dec 31, 2014 |
this is very good, kudos to glo |
Computers › Re: How To Install Windows From A Flash Drive Or Memory Card by nnasino(m): 3:48pm On Dec 29, 2014 |
To create a windows bootable flash drive involves more than just creating a bootable flash drive with magic iso. This would not work because windows will only boot from a flash if the flash is formatted using the NTFS file system. To create a bootable windows flash drive: download the program rufus https://rufus.akeo.ie/. Select the windows iso and make sure file system is on NTFS. Click start and wait for it to finish and you're done. Restart the computer and boot from the flash drive to install windows. To create a linux disc you can use unetbootin [url]unetbootin.sourceforge.net[/url] to create the bootable flash drive. |
Business › Re: Folorunsho Alakija Unseats Oprah As Richest Black Woman. by nnasino(m): 10:31am On Dec 29, 2014 |
should individuals own oil blocs? |