₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,327,691 members, 8,432,127 topics. Date: Tuesday, 23 June 2026 at 10:35 AM

Toggle theme

Tundebabzy's Posts

Nairaland ForumTundebabzy's ProfileTundebabzy's Posts

1 2 3 4 5 6 7 8 9 10 (of 13 pages)

WebmastersPlease Review This Website by tundebabzy(op): 12:05am On Jan 15, 2012
Hi guys,
Please review this website: http://scrabala.com

Its built on django + mysql + jquery

Honest uncensored comments are craved.

Thanks.
ProgrammingRe: Ludo Game Algorithm Wanted For AI Project by tundebabzy: 4:34am On Oct 16, 2011
I don't think a ludo game falls into the confines of AI because ludo is a very straight forward game. Roll the dice and move the number of steps shown on your dice.
That said, you have your algorithm:
*roll dice
While doubles not rolled:
*move the number of steps shown on the dice
*if opponent token on location, move to the end and send opponent token back home

Blah blah blah
ProgrammingRe: a by tundebabzy: 11:11pm On Oct 12, 2011
omo_to_dun:
Hello Nairalanders,

Programming challenges are an easy way to apply your knowledge of a new language or an already perfected language. You can solve this deceptively simple contest:

   Crazy Multiples

if you have the time and the skill.

Once again, I'd like to thank tundebabzy for advertising my site. I had so much traffic in one day that my server almost collapsed.
grin grin
If I can't put Nigeria on the map, I could assist someone else to do so
ProgrammingRe: a by tundebabzy: 9:51am On Oct 05, 2011
I just saw you site this morning again. The unavoidable "smart ass" punks. Pele. You are taking something naija built to the map. Keep it up maiyte.
ProgrammingRe: a by tundebabzy: 8:04am On Oct 04, 2011
@omo_to_dun: I hope I won't overwhelm you and your server resources if I continue to spread the word??
ProgrammingRe: a by tundebabzy: 7:46am On Oct 04, 2011
@omo_to_dun:
cool. I could have offered to help but I don't presently have the time to learn php. However, I hope all you compilers and interpreters are in a sandboxed environment. You have given all the information about your system which leaves you open to os attacks by punks.

@pcguru: his site doesn't have provision for javascript
ProgrammingRe: a by tundebabzy: 8:15pm On Oct 03, 2011
@omo_to_dun:
There's really a lot of criticism about your site from the folks at ycombinator's hackernews including the fact that the emails on your site aren't working and others sha. Take a look at it maiyte:
http://news.ycombinator.com/item?id=3066076

Honestly i was surprised that it would make front page so fast just that it did for a lot of bad reasons.
ProgrammingRe: a by tundebabzy: 2:02pm On Oct 03, 2011
@omo_to_dun:
I just submitted your site to hackernews. You might want to add some more challenging problems just in case the link catches on
ProgrammingRe: a by tundebabzy: 6:03pm On Sep 22, 2011
@omo_to_dun:
This is off topic but do you use django?
ProgrammingRe: Microsoft Access Database - Please Help Me by tundebabzy: 1:01pm On Sep 19, 2011
@topea:
Sorry to troll and I'm not trying to diss you but you should consider upgrading your knowledge because I'm sure you are the only person in the world still using MS Access :d
ProgrammingRe: a by tundebabzy: 7:18am On Sep 16, 2011
I like the site. I would attempt the questions in my free time today.
What is the site built on.
PHP, MySql,,
ProgrammingRe: a by tundebabzy: 2:07am On Sep 16, 2011
"fayimoraissmarttramssiaromiyaf" is a palindrome not "fayimoraissmart"
ProgrammingRe: What Are The Differences Between Programming And Coding by tundebabzy: 4:01pm On Sep 09, 2011
shocked huh
ProgrammingRe: Intelligent Data Analyzer & Generation by tundebabzy: 3:57pm On Sep 09, 2011
@karnip:
The data actually changes abruptly. Just when you are finding a pattern, the pattern changes. The only thing I could say is consistent in the table is that each line consists of:
CP AQ AR TA GE CA LE VI LI SC SA
but even this is not true because 'm3' contains the code 'PA'. That is the single occurrence of that code in the whole table which screws up determining the whole pattern thing. This means the linked list will not approach will not work.

At the moment, the only way i see to solving this thing is to not try and find the pattern. Instead store this data into a hash table (dictionary for python guys like me).

@skydancer:
where did you get this challenge from? If the solution beats human intelligence, how is artificial intelligence supposed to go at it
ProgrammingRe: Intelligent Data Analyzer & Generation by tundebabzy: 5:24pm On Sep 08, 2011
@skydancer,
sorry for my long silence. Just got back to town. I should be able to battle this thing when I get home. At least, something wey no get brain no fit smart pass me : grin
ProgrammingRe: Intelligent Data Analyzer & Generation by tundebabzy: 1:20pm On Sep 05, 2011
i'm on it.
Tech JobsRe: Hospital Management System by tundebabzy: 12:49pm On Sep 05, 2011
Don't you think It would be profitable to go to hospitals and market your software to them? Don't forget to do a graphic and well explained demo instead of the public announcement you just shared.
ProgrammingRe: Confused About Learning C# by tundebabzy: 4:57pm On Sep 04, 2011
my bad if my post sounded inappropriate. As you can see from netghost's post your comments sounded like you were trying to do some Pro PHP language war. But like you said, there is no one fits all language. PHP is built mainly for the web. Its easier to learn (subjective comment) than C# and its very popular so there are a lot of free tutorials and snippets all over the web which is why its very difficult to find PHP programmers that are actually skilled.
Hosting a C# web application is not free which is why you will find C# applications in corporate lines.

Meanwhile,

farouqzaib:
I still don't see .NET stuff powering some of the world's best website which is the point here. Some languages just excel at some stuff than others.
When Myspace was the next best thing on the web, it was being run on .NET (now its coldfusion)
ProgrammingRe: Confused About Learning C# by tundebabzy: 1:13pm On Sep 04, 2011
farouqzaib:
The only beef I have with microsoft is dt programmers just jump into their tech cos it's kinda easy(did VB before) without learning how to program n hence end up churning bad codes
huhhuh?? huh

farouqzaib:
And being a believer in open source tech, you can understand my bias.
oh now i get it. You could have just said you just don't like VB instead of blaming its ease. Have you ever tried Ruby on Rails? Meanwhile, being open source doesn't make a language the best. Java isn't open source.

farouqzaib:
And besides PHP powers the major websites in the world which is what it was meant to do.
So does Ruby on Rails and Python (Google.com and its sub domains including google plus)
ProgrammingRe: I Want To Start A Career In Programming Pls Help by tundebabzy: 12:36pm On Sep 04, 2011
@qtx:
a programming language is just a way of giving instructions to a computer. Its not knowing the language that makes you a good programmer but you being smart yourself. If you know all the syntax of php and all the inbuilt functions by memory, it won't help you if you dont already know in your head how to solve a problem at hand. Different programming languages have their strengths and weaknesses so you can go ahead and learn your C#.

As regards your question, I can tell you one thing:
Study with interactive software of go to firstlog but "You cannot learn to swim by reading books."
ProgrammingRe: Programmers: What Project(s) Are You Working On Now? by tundebabzy: 8:40pm On Jul 26, 2011
Anybody working on an open source project written in python?
@naija_swag: abeg give me links na. I love programming challenges
Jobs/VacanciesRe: BAT Test By Kimberly-Ryan by tundebabzy: 3:36pm On Jul 21, 2011
Yeah I did but my interview was on wednesday
Jobs/VacanciesRe: BAT Test By Kimberly-Ryan by tundebabzy: 3:22pm On Jul 21, 2011
@topdog: I was interviewed in Abuja but I'm in katsina
Jobs/VacanciesRe: BAT Test By Kimberly-Ryan by tundebabzy: 3:18pm On Jul 21, 2011
@topdog: cool. I havent got an invite, at least not yet. Best of luck
Jobs/VacanciesRe: BAT Test By Kimberly-Ryan by tundebabzy: 3:15pm On Jul 21, 2011
@topdog: cool. I havent got an invite. Best of luck
ProgrammingRe: Coding Challenge 6: Working With Arrays by tundebabzy: 8:46am On Jul 19, 2011
The way arrays are passed is language dependent. In python, all objects are passed by reference, in java arrays are passed by reference. In C# you can either pass arrays by reference or by value. And I know you can't have a destructive method from objects passed by value.

To make this easier, just tell me which line in the closestNum() code alters the object - the numbers array. That way I can figure out what I have been missing.
ProgrammingRe: Coding Challenge 6: Working With Arrays by tundebabzy: 8:15pm On Jul 18, 2011
Fayimora:
@naija_swag. Just like omo_to_dun said I wasn't looking for a working solution.  The question specifically said 1 method and if you don't supply one method then you havent answered the question.

Here is a possible solution:Its done destructively so would still leave the constructive part to anyone.
static int closestNum(int[] numbers, int target)
{
int currentClosest=numbers[0];
int lowest = Math.abs(target - currentClosest);

for(int i=1; i<numbers.length; i++)
{
int difference = Math.abs(target - numbers[i]);
if(difference == 0)
return numbers[i];
if(difference < lowest){
currentClosest = numbers[i];
lowest = difference;
}
}
return currentClosest;
}
Guys, please a little education for me. A destructive method is one that alters the attributes of a given object. In the challenge, the particular object was not given so I assumed the destructive method should alter the array object given as the argument. If that's true then the above method (function) is not destructive since the initial object for the function is the array object supplied as an argument. The int (int target) is a literal which in java isn't an object (if I remember my java right).
huh huh huh
ProgrammingRe: Coding Challenge 6: Working With Arrays by tundebabzy: 7:49pm On Jul 18, 2011
omo_to_dun:
Try posting your code without using the code command. It stopped banning me when I did that. This is the freaking programming section, the bot shouldn't be acting this dumb.
My posts that initially got me banned have shown up on the thread:-
tundebabzy:
Nairaland has to train its spambot. It kicked me out again yesterday. And at least nairaland could give a helpful less annoying reason instead of 'reason: you were blocked by anti-spam bot, '

Anyway, My solution using python. First of all, python does not have arrays. Its data structure similar to arrays is Lists and the difference is that objects of different types including other types of data structures can be stored in a single lists.
Also, python allows you to create static methods by using the 'staticmethod' decorator.

I've commented my code so it should be easy to understand

Constructive (extremely inefficient and has the potential to run for ages):

class C:
@staticmethod
def load_shed_d(l, num):
"""
C.load_shed_d(3,4,5,6,7],7)------>6
This function takes a list and an integer and returns the number closest
to the given number.
"""

highest = 0
for x in range(len(l)):
if l[x] > highest and l[x] < num:
highest = l[x]

return highest

since its a static method, you can run thus: C.load_shed_d(list, int). With the example given it runs in 0.0 second

For the efficient (destructive) solution:

class C:
@staticmethod
def load_shed(l, num):
"""
C.load_shed([3,4,5,6,7],7) ----> 6
This function takes a list and an integer and returns the number closest
to the given number.
"""

l = sorted(l) #sort ascending to make things easier
cache = l
for count in range(len(l)):
size = len(cache) #needed so the list can be divided into 2
up = cache[sadsize/2)] # The first half of the list
down = cache[size/2:] #The second half of the list

# If the highest num in up is less than the least num in down
# and if the least num in down is greater than the given int,
if max(up) < min(down) and min(down) >= num:
return max(up)

elif max(up) > num:
cache = up # Shed the 2nd half of the list

else:
cache = down # Shed the 1st half of the list

With the example given runs in 0.0 seconds

+1
, maybe dumb-bot got a query

1 2 3 4 5 6 7 8 9 10 (of 13 pages)