Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,408 members, 7,954,622 topics. Date: Saturday, 21 September 2024 at 02:05 AM |
Nairaland Forum / Science/Technology / Programming / Programming Challenge: Convert String to Json with a Loop (5570 Views)
Professional Html,bootstrap,php,java,json Web Deloper. Pay After Service! / Jamb Past Questions API In JSON / English Dictionary In Xml/json Format (2) (3) (4)
Re: Programming Challenge: Convert String to Json with a Loop by nnasino(m): 7:48am On Apr 24, 2016 |
.... |
Re: Programming Challenge: Convert String to Json with a Loop by nnasino(m): 7:50am On Apr 24, 2016 |
Febup:Thanks boss dhtml18: Lol, Oga dhtml18 na 14 lines o Abi na sarcasm? |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 5:05pm On Apr 24, 2016 |
Hmn, maybe it is 14 lines, but i got scared so the code looked very looooong in my eyes. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 6:01pm On Apr 24, 2016 |
dhtml18: Don't be scared bro, Naija's got dangerous programmers and you are one of us, you just need to give the challenge a go and you'll be smiling too with an e-champagne . |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 7:07pm On Apr 24, 2016 |
No o, this kind of challenge is bad for my help, you know i now use a walking stick. As much as i will love to try, i am just too e-old for this. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 7:45pm On Apr 24, 2016 |
dhtml18: If you have e-faith as small as a kilobyte you can say to your walking stick and the e-old age be cast into cyber space, then you can take this e-challenge like an e-lion. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 10:51pm On Apr 24, 2016 |
Febup:Hmn, maybe I can ask seun to change my username to daniel! |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 12:40pm On Apr 25, 2016 |
dhtml18: Alright bro, waiting for the change of username from the oga of nairaland, then you can take this challenge. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 5:28pm On Apr 25, 2016 |
cyrielo: Febup: Hope you are okay trying this challenge. Just checking on you as I've not heard back from you for a while. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 9:26pm On Apr 25, 2016 |
I hear that some people actually fainted when they attempted this challenge. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 9:04am On Apr 26, 2016 |
dhtml18: Only dangerous programmers should attempt this challenge, else I'll advice other programmers to wait till they get to that level. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 11:21am On Apr 26, 2016 |
Febup:Yeah, because this kind of thing can result in a real-life death. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 12:37pm On Apr 26, 2016 |
Now I have concern for 'cyrielo' as there has been no sign of him since Apr 23 after I informed him that "the string has to remain the same for this challenge" Can someone that knows cyrielo please help us check to know if he is ok. |
Re: Programming Challenge: Convert String to Json with a Loop by cyrielo(m): 2:42pm On Apr 26, 2016 |
Febup:Are you seriously serious LMAO Been busy man, will drop the other version this evening.. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 3:09pm On Apr 26, 2016 |
cyrielo: Nice to hear from you bro. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 7:01pm On Apr 26, 2016 |
output: [{ "Country":"Nigeria", "State":"Lagos State", "Town":"Lagos"}, { "Country":"USA", "State":"Texas", "Town":"Dallas"}, { "Country":"Nigeria", "State":"Bauchi State", "Town":"Toro"}, { "Country":"Nigeria", "State":"Plateau State", "Town":"Apata(jos north)"}, { "Country":"Biafra", "State":"Anambra(light house)", "Town":"Mbaukwu"}, { "Country":"Nigeria", "State":"Kaduna State", "Town":"Saminaka"}] :::MODIFIED:::::: validated
|
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 7:36pm On Apr 26, 2016 |
^^^The programmer above me is a desperado, he is so confident that he can code that he is even thumping his chest and trying to prove that he is the only programmer on this board. @op, please help him to debug his code (and prove to him that he is just a learner). |
Re: Programming Challenge: Convert String to Json with a Loop by codemarshal08(m): 10:10pm On Apr 26, 2016 |
C++ Qt:
OutPut:
|
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 11:16pm On Apr 26, 2016 |
codemarshal, them don epp you ni? this no be your original id now? by the way, this your code long like River Niger. Meanwhile, Kudos to all you guys that have been writing codes o, i have only been contributing to this thread with my mouth. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 12:47am On Apr 27, 2016 |
dhtml18: Oga dhtml18 please O make we let these guy rest O. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 12:53am On Apr 27, 2016 |
crotonite: You are the 3rd winner, well done mate. Enjoy your e-champagne. You even went beyond Lagos and Texas, two bottles for you.
|
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 12:56am On Apr 27, 2016 |
codemarshal08: Another dangerous programmer. Congrats bro you're are the 4th winner.
|
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 1:15am On Apr 27, 2016 |
All them 1st - 4th winners dey tire me, as me no be winner - that means i am a gaddamn OLODO. |
Re: Programming Challenge: Convert String to Json with a Loop by codemarshal08(m): 3:56am On Apr 27, 2016 |
dhtml18:Master I sight you !. This is the Id I have been using. Your contribution was useful. Thanks. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 7:09am On Apr 27, 2016 |
codemarshal08:Oh i see, old age must be worrying me to think the ID was fake. Meanwhile, @OP, you need to disqualify cryptonite for using BIAFRA somewhere in his code, that is tantamount to e-secession/e-treason - i hereby e-charge him to the |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 8:08am On Apr 27, 2016 |
dhtml18: You're very right, I now hand him over to the commander in charge of nairaland. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 8:11am On Apr 27, 2016 |
Here is my solution attached as an image. When i tried posting the source code, the spam bot epp me - dhtml18
|
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 8:18am On Apr 27, 2016 |
@cyrielo, even without using json-lint, your solution does not use the correct output, and you are using too much javaScript (that has confused me sef), but still a nice try. My own solution used very simple javaScript to solve a very trivial problem. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 8:35am On Apr 27, 2016 |
donjayzi: Nice try but you'll need to open up this function: JSON.stringify(obj, null, "\t" as this is where the real challenge starts. |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 9:00am On Apr 27, 2016 |
I see, not a problem for me at all, here we go. . . .and i have attached the html source code as well
|
Re: Programming Challenge: Convert String to Json with a Loop by cyrielo(m): 9:23am On Apr 27, 2016 |
donjayzi:Is that right? |
Re: Programming Challenge: Convert String to Json with a Loop by Nobody: 10:26am On Apr 27, 2016 |
cyrielo:Is what right? my solution produces the correct output, and i have expanded the JSON.stringify function as requested. I shall leave it to the judge to determine. |
If You Are A Developer, Take This Survey And Win $1000(New Survey ) / What PHP Framework Do You Consider As The Best / Retrieving/selecting A Particular Number Of Random Rows From A Database Table
(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. 46 |