₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,327,692 members, 8,432,130 topics. Date: Tuesday, 23 June 2026 at 10:36 AM

Toggle theme

Tundebabzy's Posts

Nairaland ForumTundebabzy's ProfileTundebabzy's Posts

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

ProgrammingRe: Any Lisp/scheme Programmers In Here? by tundebabzy: 8:14am On Jun 09, 2010
oops,
tundebabzy:
@DonSegmond:
this is what i think that snippet should look like with lexical scoping:

(define (func-n n)
(define (step-up n1 n2 n3)
(+ n1 (* 2 n2) (* 3 n3)))
(define (calc counter n1 n2 n3)
(if
(= n (+ counter 1))
(step-up n1 n2 n3)
(calc n (+ counter 1) (step-up n1 n2 n3) n1 n2)))
(cond
[(< n 3) n]
[(= n 3) 4]
[(= n 4) 11]
[(= n 5) 25]
[(> n 5) (calc n 5 25 11 4)]))
should have been this:
(define (func-n n)
(define (step-up n1 n2 n3)
(+ n1 (* 2 n2) (* 3 n3)))
(define (calc counter n1 n2 n3)
(if
(= n (+ counter 1))
(step-up n1 n2 n3)
(calc (+ counter 1) (step-up n1 n2 n3) n1 n2)))
(cond
[(< n 3) n]
[(= n 3) 4]
[(= n 4) 11]
[(= n 5) 25]
[(> n 5) (calc 5 25 11 4)]))

n in func-n is now a free variable so i didnt include it in the definition of calc.
ProgrammingRe: Any Lisp/scheme Programmers In Here? by tundebabzy: 8:05am On Jun 09, 2010
@DonSegmond:
this is what i think that snippet should look like with lexical scoping:

(define (func-n n)
(define (step-up n1 n2 n3)
(+ n1 (* 2 n2) (* 3 n3)))
(define (calc counter n1 n2 n3)
(if
(= n (+ counter 1))
(step-up n1 n2 n3)
(calc n (+ counter 1) (step-up n1 n2 n3) n1 n2)))
(cond
[(< n 3) n]
[(= n 3) 4]
[(= n 4) 11]
[(= n 5) 25]
[(> n 5) (calc n 5 25 11 4)]))

Like i said earlier,i don't know if i'm wrong (but DrScheme does think i am wrong). It seems DrScheme does not allow more than one expression when creating a procedure. Is it a LISP thing or I should just start reading the book all over again?
ProgrammingRe: Any Lisp/scheme Programmers In Here? by tundebabzy: 9:00pm On Jun 08, 2010
@DonSegmond
silly me, you were right. i didnt think towards that angle cos i would have been expecting to see an error like this:

reference to an identifier before its definition: average. Thanks

sorry to bother you again but help me out with this code:
;;A function f is defined by the rule that f(n) = n if n<3 and f(n) = f(n - 1) ;;+ 2f(n - 2) + 3f(n -3) if n> 3. Write a procedure that computes f by means ;;of a recursive process. Write a procedure that computes f by means of an ;;iterative process.

(define (func-n n)
;; f(1),f(2),f(3),f(4),f(5) are already calculated
(cond
[(< n 3) n]
[(= n 3) 4] ;;pre calculated f(3)
[(= n 4) 11] ;;pre calculated f(4)
[(= n 5) 25] ;;pre calculated f(5)
;; calc will do the calculation from f(6) and above
;; calc consumes
;;*a number n(which is user defined as in f(n),
;;*a number counter (a counter to determine where the program should stop and return,
;;*3 starting numbers to calculate the iteration
[(> n 5) (calc n 5 25 11 4)]))

(define (calc n counter n1 n2 n3)
(if
(= n (+ counter 1))
(step-up n1 n2 n3)
(calc n (+ counter 1) (step-up n1 n2 n3) n1 n2)))

(define (step-up n1 n2 n3)
(+ n1 (* 2 n2) (* 3 n3)))

I want it written so that i can make use of lexical scoping. You can write it in common LISP, i should be able to understand. i have my own "solution" (it looks right to me) but it didnt work. It gives me the error i mentioned earlier and in this case all the function

just in case its different in common LISP, ";;" starts a comment
ProgrammingRe: Any Lisp/scheme Programmers In Here? by tundebabzy: 12:40pm On Jun 08, 2010
i understand lexical scoping. what i dont understand is why that code didnt work
ProgrammingRe: Any Lisp/scheme Programmers In Here? by tundebabzy: 12:29pm On Jun 08, 2010
please help me with this code.It is supposed to be an implementation of lexical scoping

The initial code is this:
(define (sqrt x)
(sqrt-iter 1.0 x))

(define (sqrt-iter guess x)
(if (good-enough? guess x)
guess
(sqrt-iter (improve guess x) x)))

(define (good-enough? guess x)
(< (abs (- (square guess) x)) 0.001))
(define (improve guess x)
(average guess (/ x guess)))

Taking advantage of lexical scoping it should be like this:
(define (sqrt x)
(define (good-enough? guess)
(< (abs (- (square guess) x)) 0.001))
(define (improve guess)
(average guess (/ x guess)))
(define (sqrt-iter guess)
(if (good-enough? guess)
guess
(sqrt-iter (improve guess))))
(sqrt-iter 1.0))
;;and that is exactly what is in the book i am reading.

However, when i run it on DrScheme i get this error:
define: expected only one expression for the function body, but found at least one extra part (referring to where improve is being defined)

The text book i am using is MIT's 'Structure and Interpretation of Computer Programs' so i'm wondering how can this be wrong. I tried changing the mode of my DrScheme to Advanced mode but still the same error(i'm using beginner mode).

Can anyone help me with the problem?
WebmastersRe: Guyz: Rescue Me From This Css by tundebabzy: 4:25pm On Jun 07, 2010
lol!
WebmastersRe: Help! I've Learnt Html And Css But I Still Cant Design A Website! by tundebabzy: 4:02pm On Jun 07, 2010
Dual Core:
My point: Dont rely on these IDEs (e.g dreamweaver). Let them rely on you.

I'm not against your using dreamweaver in its entirety. Just dont look for short-cuts in it. You may want to stay away from the "design view" and make the "code view" your home view.
I support 109%. Thats one of my coding philosophies.
WebmastersRe: Guyz: Rescue Me From This Css by tundebabzy: 3:39pm On Jun 07, 2010
the problem is not complex and can be solved online. i'm sure the problem has already been solved
WebmastersRe: Guyz: Rescue Me From This Css by tundebabzy: 10:51am On Jun 07, 2010
kehers is right. I call it the great collapse and it happens when all the contents of a block element are floated.

this is my recommendation. Add this code after #mid-left closing tag (i.e after the tag that closes mid-left:
<div style="clear: both;"></div>
this will clear the float after #mid-left (thats why you have to put it after the closing tag for mid-left.
The only problem with this is that semanticists might frown at it because the div does not show any meaning (as in it just seems to be there, no content, nothing) but it does the job and is not harmless. So you could try this.

Please lets know if you get the problem solved with any of the suggestions
CareerRe: About Sap? by tundebabzy: 10:16am On Jun 07, 2010
sappiel:
Markos, Ehiagwam, winneijay and a few others, I will intro u to another naija site i know, with a lot of interesting ang and informative threads on SAP.
You could have just ignored the cat calls from the random guy that you can't even see. That is easier than offering to take the guys with the most information with you.
Its understandable why kiwi992 left and its understandable why you want to leave. Just in case you have that much influence, pllllllllllllllllllllleeeeeeeeeaaaaaaaaassssssssseeeeeeeeee don't take away the other guys with so much real information that are left on the thread so that the rest of us can learn "About SAP?".
Meanwhile, you don't have to leave the forum, you can just ignore the dude. I swear to God, its not that hard.
ProgrammingRe: I Need Urgent Help With Facebook Fbml by tundebabzy: 1:21am On Jun 07, 2010
Hi divyesh and dacraziest
There is nothing wrong in contacting off the forum but sites like this are meant to share information. If we communicate what we know and solve the problem on the forum, you never know how many other people with the same problem will be able to access the solution to such problems from here. So please consider communicating on the forum and help make a lot of nigerians better coders.

(Its just a comment so you dont have to take me serious)
CareerRe: About Sap? by tundebabzy: 1:12am On Jun 07, 2010
@all:
now that we all know that sappiel's comment was rude and unprofessional, can we get back to the topic?
Thank you
CareerRe: About Sap? by tundebabzy: 2:35pm On Jun 04, 2010
@bordeaux
as markos said, go through the whole thread. You will get 1 year worth of information and you will definetely find where your skill fits
Tech JobsRe: Could I Get An E-book On Coldfusion? by tundebabzy: 11:28am On Jun 04, 2010
ProgrammingRe: Sap In Nigeria by tundebabzy: 11:22am On Jun 04, 2010
Go to this thread:
https://www.nairaland.com/nigeria/topic-149807.0.html

Its been running for over a year and you will find practically all the information about SAP that you could ever need (apart from SAP trouble shooting). A lot of inputs are from SAP consultants and gurus (both functional and technical).

The thread is 25 pages so you might not be able to read through in 3 hours, that shows the amount of information that you could find there, plus networking opportunities with real SAP professionals both home and abroad.
ProgrammingRe: Any Lisp/scheme Programmers In Here? by tundebabzy: 6:50am On May 30, 2010
@Tomx
LISP is still the most suitable language for complex applications and like DonSegmond said earlier, its early implementation was hampered due to its hardware requirements. I am personally attracted to LISP because of its macros which is a program that writes another program which might write another program. Now thats powerful
ProgrammingRe: Any Lisp/scheme Programmers In Here? by tundebabzy: 6:34am On May 28, 2010
@DonSegmond
already have its ebook and been reading it for a while. I also have How to Do Programming which is also a nice one and similar plus videos of MIT's Stucture and Interpretation of Computer Programs course lectures. The syntax is quite funny but i'm enjoying it.
What part of AI are you into or planning to go into?
ProgrammingRe: Any Lisp/scheme Programmers In Here? by tundebabzy: 12:41pm On May 26, 2010
I just started learning Scheme.hard to look at syntax but i was made to believe that it is the best programming language (apart from Python) to learn programming cos it has a lot of concepts of abstraction that are not present in a lot of other popular programming languages.

, and i'm interested in AI
ProgrammingRe: I Want To Be A Programmer by tundebabzy: 12:54pm On May 25, 2010
You can also learn Scheme (which is a dialect of LISP) and then use that to enter into java.
You can get materials from MIT's OCW (www.ocw.mit.edu). You will have access to MIT(Massachusetts Institute of Technology) undergraduate and graduate courses materials for free and that includes videos and audio recordings.
Best of luck
CareerRe: About Sap? by tundebabzy: 9:24pm On May 20, 2010
@felixv
you just made BASIS look yummier for me than before. I'll soon get there
Jobs/VacanciesRe: Anybody Knows Format Of Unilag Pgd Entrance Exam? by tundebabzy(op): 8:41pm On May 20, 2010
tundeakinyanmi(at)yahoo(dot)com
Jobs/VacanciesRe: Anybody Knows Format Of Unilag Pgd Entrance Exam? by tundebabzy(op): 8:55pm On May 19, 2010
@damidre:
still bouncing
Jobs/VacanciesRe: Anybody Knows Format Of Unilag Pgd Entrance Exam? by tundebabzy(op): 8:42pm On May 19, 2010
if its GMAT, then i'm okay. because i wasnt able to get in touch with dami dre i had to buy some past questions from one guy like that. The questions there are really technical in nature. seems like the guy just went to pack actual MSc past questions for me instead of entrance exam past questions. I wish i saw this earlier cos i was already getting really scared.

i'm doing the pgd. I'm an economics graduate trying to cross over.

thanks for the info guys. Please what kind of IT questions though? (as in are they like about algorithms or computer general knowledge like parts of a computer, or computer history like 1st,2nd and 3rd generation of computers or programming stuff)
ProgrammingRe: Beginners Programming Challenge by tundebabzy: 5:49am On May 19, 2010
@pcguru:
you didnt have to give out the answer. You are defeating the whole essence of project-euler
Jobs/VacanciesRe: Anybody Knows Format Of Unilag Pgd Entrance Exam? by tundebabzy(op): 5:46am On May 19, 2010
@ asamuel:
how do you you prepare for a battle without finding out who you are fighting with, their strenghts and weaknesses?

@damidre:
the email you posted seems not to be existent. It keeps bouncing
Jobs/VacanciesRe: Anybody Knows Format Of Unilag Pgd Entrance Exam? by tundebabzy(op): 7:35pm On May 16, 2010
Help! Time is running out
Jobs/VacanciesRe: Anybody Knows Format Of Unilag Pgd Entrance Exam? by tundebabzy(op): 9:42pm On May 14, 2010
Sorry i didnt specify initially:
I'm talking of the pgd in computer science
Jobs/VacanciesAnybody Knows Format Of Unilag Pgd Entrance Exam? by tundebabzy(op): 9:35pm On May 14, 2010
Hi guys,
I need your help. Is there anyone who knows the format for unilag's pgd entrance exam? I tried to find out from the department but the lady i met there told me they dont sell past questions and that i should read GMAT. I dont know but I expected something more , harder (forgive my grammer).
ProgrammingRe: Beginners Programming Challenge by tundebabzy: 1:55pm On May 07, 2010
@cruworld
i use java.
in java, 4 million falls within comfortable range for int.
A hint: You just need a loop. recycle your variables.

My code for no 2 was less than 20 lines so believe me you can do it.
ProgrammingRe: Beginners Programming Challenge by tundebabzy: 9:45pm On May 06, 2010
i'm presently at number 7. just keep trying,you'll solve it.
WebmastersRe: How One Can Design A Transparent Background Website! by tundebabzy: 2:50pm On Apr 30, 2010
nice one dhtml

but im still laffing at transparent background, lol!
PoliticsRe: Reps Okay 10 New States by tundebabzy: 2:46pm On Apr 30, 2010
those guys are just crazy.
Nigerian has billions as excess crude money. Instead of using that money to develop the country, states are sharing the money. Now they want to create 10 more liabilities, just a plot to have more to steal

God help us

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