Bizycodin's Posts
Nairaland Forum › Bizycodin's Profile › Bizycodin's Posts
1 (of 1 pages)
Have you ever done any other type of programming nay be object oriented or procedural ?If not, then I think you just have to stay at it. That's the way it will seem initially. all you need to do is just stay glued to it. re-read, research and practise. Welcome to our world!! |
Great! Can't wait to use a "made in Nigeria by a Nigerian" IDE. Curiously waiting and hope it's gonna b innovative? I also don't mind being a part of the project for leisure coding.. |
dhtml18:Ok.! It's good to be vast. |
dhtml18:Whao! Ok. Cool! I would also love to pick up android again but 4 now I am crzy digging the web.. All d best on your app bro! |
dhtml18:Cool protoyping. But by improvement I mean rewriting the code to improve performance. A different way of thinking abt the problem! And have u tried inspecting the execution time? |
dhtml18:@dhtml. Kudos for d clean-up. Is there anyway solution can be improved? |
I have test this it worked fine. But the algorithmic complexity is O(n^2) due to the nested for loop. The effect of this is the larger the input, the slower the time of execution. I would love to see other solutions and let's compare our time of execution. This should also pass most test cases. function patternChaser(str){ //If string is less than 4 return No Pattern if(str.length < 4) return "No Pattern"; //IF there are mulitple occurence of decimals return No Pattern ss if(/^\d+/.test(str)) return "NO Pattern"; var newString, newString2, nmatch, maxTestCase, testRes = "", len = str.length; for (var i = 0; i < len; i++) { //If iteration has gotten to the second to the last string break out of the loop // and return testResult //NOte: if there are no match an empty string is returned. if (i === str.length-2) break; /*maxTestCase is used to evaluate the maximum test case for each iteration * The maxTestCase is gotten by dividing the length of the string into 2 * IF the value is odd ad one before division * The maxTestCase reduces for every iteration*/ maxTestCase = ((len - i) % 2 == 0) ? (((len - i)/2)+1) : (((len -i) + 1)/2); for (var j = 2; j < maxTestCase; j++) { //Get a substring from the string newString = str.substr(i, j); var regEx = new RegExp(newString, "g" ;//CHeck for matches for this substring in the whole string. nmatch = str.match(regEx); //If there is match and match is greater than one if (nmatch.length > 1) { newString2 = nmatch[0]; //If length of string is greater than the existing testREs length //testRes = newString if (newString2.length > testRes.length) { testRes = newString2; } } } } return testRes; } console.log(patternChaser("howarekddkdkdieeialskdoeiedkdklskdiamaboyandeiei383838iamaboyexx,x" );returns "iamaboy".... |
Jregz:Uwc sir. Enjoy ur development.. @pelizbiz@gmail.com, sanyolu.isaac@yahoo.com, pls I will send d files when work resumes fully on tuesday. Thanks for d patience. |
pelij18:Inbox ur mail address to thrustinv@yahoo.com. I will send u d ones I have or go to ebookee.org. It's a filesharing site. |
Greatfes17:Nope. Any programming language. Let's learn from u. |
Jregz:Sir, you're really on point. I use slim because of its simplicity, easy routing amongst others. Most importantly because d version of php d host I use is 5.4.3. Lumen is also a good one but d php requirement is higher. I would check out dat book on php security now! |
Standing5:Yeah. Deitel is such a good book. I started Java Programming with (David Eck - Introduction to Java Programming).. That was my "First Love".!! |
Promhize:Cool.. bro you really need to see Josh Lochart. |
It's !(mysterious) the amazing connection between Good Books and Good Codes. These books are just invaluable for me.. PHP 1. Josh Lochart (Modern Php) - (Exposures to psr-4 standard, generators, traits, components.) He's also the guy behind sliim micro-framework which I am currently using in one of my projects) 2. Hasin Hayder (Object Oriented Programming with PHP 5) - This guy is such a bad guy. (SPL, one of the invaluable things I learnt here was d use of ArrayObject, ArrayIterators, Reflection and code organization). 3. Matt Zandstra (PHP Objects, Patterns and Practice) Nother bad guy. (Design Patterns and core PHP) 4. Zdenek Machek (PHPUnit Essential) - though I am yet to implement unit testing in my projects, it was a good read. I read over 60% nd got bored. 5. Janet Valade (PHP and MySQL for dummies) - My PHP list would be incomplete without this book. It was a cool introduction to server side scripting for me. JS 1. David Flamagan (the Definitive Guide) - I was almost mistook for a mad man when reading dis book. It got me in "Flow" most of d time. 2. John Resig, Bear Bebeault (secrets of the javscript ninja) - I am currently reading this and I have read over 80 out of 394 pages nd u can imagine d kind of "whao" feeling I have reading dis book. It's such a deep-dive into JS. Other good books I'm currently eyeing now are Martin Fowler's Patterns of Enterprise Architecture, Donald Knuth's Art of Computer Programming and any book on algorithms. Books are indispensable to becoming a "bad guy". Add yours nd let's spread d "word" |
Cool.. Keep it up son! |
Hi, I am interested. Hit me up @ (Skype: codesmata).. Mobile: (Gmail: Thrustinv@gmail.com). |
1 (of 1 pages)
;