Friday 30 October 2015

My Progress: Semantic and Syntax Errors.

Semantic Error and Typographical Error.




When learning programming, no matter how smart you are, two types of errors are inevitable, they're semantic error and syntax error.

I am not new to programming, but it's been a very long time since I wrote something serious, so in other to avoid frustration while working on my prototype, I have decided to read a book on python it's titled Learning Python The Hard Way.

I am not reading this book as a newbie would read it because I know most of what is inside the book, all I needed was a revision of the terms and I would be good.

Oh boy, I was wrong!

Although, I can read a complex line of codes and understand what it does, I have issues getting my code to do what I want it to do.

What this means in simple term is that, even though when I write the code, the computer (interpreter) is able to interpret it, but the output it gives is not what I want.

You can liken this to pressing (5 + 2) on a calculator, while you expect the answer to be 7, but then you get 52 or 30. This is what semantic error is all about.

#This defines the function and receives argument variables.
def cheese_and_crackers (cheese_count, boxes_of_crackers):
total = cheese_count + boxes_of_crackers
""" The next few lines print the argument variables"""
print "\n You have %d cheeses! \n You have %d boxes of crackers! \n The total of your resources is %d:" % (cheese_count, boxes_of_crackers, cheese_count + boxes_of_crackers)
print "\n Man that's enough for a party!"
print "\n Get a blanket.\n"
def number_of_rooms (Available_rooms, Assigned_rooms):
Total = Available_rooms + Assigned_rooms
print "There are %d rooms in total" % Total
print "Only %d rooms are available" % Available_rooms
print "%d rooms are occupied already" %Assigned_rooms
print "Do you still want to party?\n"
print "We can just give the function numbers directly:"
cheese_count = int(raw_input("How many cheese do you have? "))
boxes_of_crackers = int(raw_input("How many boxes of crackers do you have? "))


print cheese_and_crackers (cheese_count, boxes_of_crackers)
print "Now that you're ready for party, answer these questions: "
Available_rooms = int(raw_input("How many rooms are available? "))
Assigned_rooms = int (raw_input("How many rooms are assigned? "))

print number_of_rooms (Available_rooms, Assigned_rooms)

print "Or, We can give the function numbers directly:"
amount_of_cheese = 10
amount_of_crackers = 50

cheese_and_crackers(amount_of_cheese, amount_of_crackers)

print "Let's do some math:"
cheese_and_crackers(10 + 20, 5 +6)

print "We can combine two the two; variables and math:"
cheese_and_crackers(amount_of_cheese + 100, amount_of_crackers + 1000)


The code would execute, but the output would be wrong.

I have many issues with semantic error because I failed to read python documentation (I decided to learn on the job because this might take a week to wrap my head around it). Even though the semantic error is slowing my progress down, I still prefer this method, because I would in a week or two get over the semantic error as well as gain the right thinking hat for python.

The other error; syntax error is the normal typos you make when you write a piece of code, with this kind of error, you code would not execute, which means it won't work at all; because you're speaking a language the interpreter does not understand. This error might be frustrating, but it's not as dangerous as semantic error. Since the code won't work until it is fixed, you can be rest assured that you're still making progress until you get what is wrong and fix it. Sematic error would fool you into shouting "Eureka" until you realize that the output is wrong.

When I began programming (Almost five years ago) I learnt the basis, and one thing I believe over the years is that, a program should be able to do more with very short lines. I believe how short (minimal) your lines of code is would determine how smart a programmer you are.

The python book am reading contradicts that believe. Basically, a good programmer is the one that can write a code that a novice would understand to some extent. It's almost impossible for a novice to undersstand your code if you don't add english comment at the end of every line. So I am working on my commenting skills, because this project is a prototype, and I might not be the only one who will work on it in the nearest future, so I need to make it understandable to others to some extent.

Initially, when setting up my work environment, I wanted to use python 3.0+ but I later decided against it because 2.7+ is much more stable and I would prefer a stable and well known environment that trying to figure out my way in a newly developed technology (YouTube and Instagram were built with 2.7+).

Progress so far?


  • Setting up python
  • Speed reading a book on python
  • Creating the functions
  • Copying, Editing, and Writing files with a single argument script.


I guess thats all for now, I would update this blog as I progress.

Monday 26 October 2015

Revamping Life: I Would Build A Prototype In The Next 8 Weeks!

I once heard a TED talk that discouraged people from sharing their goals before they achieve it, mainly for the fear of feeling it has been achieved (Effect of people praising your effort).

To some extent, I believe the theory proposed in the talk, on the other hand, I believe we as human tend to be more accountable of our time and action provided we tell others about our moves, we wouldn't want to come short, we wouldn't want to portray our self as a quitter, so when we set a goal and tell others about it, we would eventually do our best to achieve the said goal.


Based on this school of though, I have decided to share my goal for the next few weeks, and hopefully, I wouldn't end up quitting because am writing about it.

For the next eight weeks, I would be brushing up my skills in programming (Python and Django web frame work), the idea is to learn enough to be able to create a prototype for an web app I recently conceive.

Today, being the day one. I have successfully install python on my laptop computer, and I downloaded the book "Learning Python the Hard Way". I would frequently come here as time would permit to document my progress, and hopefully, It would be a great journey.



Thursday 15 January 2015

Clearing Cobwebs! I am still Alive!

Been ages! Since I updated this diary, if anybody is reading, be rest assured as I am still alive and not dead. A lot has changed about me lately, and I don't think I can write all the changes in a single post, I will probably share the changes as I update this diary every once in a while.

Am now a third year student! As a matter of fact, if everything work out as planned, I would be starting my penultimate year by March. The journey so far? Its been stressful, fun filled and challenging (I guess that's what uni is all about, right?) I have met bunch of people, made friends, and I am most grateful for this.

More details coming soon, before the week runs out. Until then, stay calm and meet the new me below....

Sunday 29 September 2013

Free Coca-Cola.... Oya shine face, I wan take pikzuress..

Dear Diary,

Happy Sunday, am happy today! very happy I might say, probably because I drank a free coca-cola after the church service...lol, wondering how I came about the drink? ok, let me explain myself, so my cousin was around all through the weekend, considering that my second name is boredom, you can't imagine how glad I was to have a company, so we did a lot of stuffs together, including provoking my mum (believe it or not, I love doing this, dunno why) we couldn't find a better way to piss her off than to insist on cooking our food by our-self, ahaaa, this morning we decided that we would fry our egg and make our tea, she was like, NO!!! that's not allowed, you see, when we do this kind of stuff together, there is always some sort of cheating, normally everybody is entitled to two eggs, but when you do it together, there is every tendency that I might not get my normal quantity of the fried egg, so she was like, OK, you guys will use three eggs if you want to do it by yourself, and I was like, NO!!! even in school sef (that's my defense line this days) am using three eggs, to give the notion that I was upset(wasn't upset kankan, but I am getting late for church so I said am not eating again, took my bath, get dressed, but my cousin like food ehenn, lol, the guy went behind me and make a bargain for extra milk instead of egg, so he took the milk and forgot about the egg, I had to wait for him to finish eating, it was already 9:00am, and service starts by 9:00am (God forgive me for missing the Sunday school ooo).

But we need to get to church very fast, since daddy and mummy attends the same church, they will get to use a car, so we took mummy's car, she was like "I thought we're fighting ni?" I did not answer her, normally it would take about 20minutes if i keep driving at 40km/hr but today was an exception, i had to go as high as 80km/hr, after about 10minutes into the journey, na so we saw FRSC (federal road safety commission) officers on the road, ahaaa, on Sunday? una no dey tired?? we had to wound up the glass, and drive gently (considering that I don't have a license yet, the last thing I want to do is get arrested).

Just after passing the FRSC officer, naso my cousin brought up this weird idea, he was like, there is a church around this area, that we should just worship there, since we're running late and it will be irresponsible of us to enter the church during sermon (I regret agreeing to this idea), so I said yes, let's do it that way. We got inside the church, pretty nice church, naso first timer identification time reach ooo, 'If you're worshipping with us for the very first time please signify" I wouldn't think about being a liar in the church na, so I signified, with the hope that my cousin would signify too, was i wrong? yeah, he has been to the church before!!!!! ahhaaa, I was the only stranger, I felt like cursing him out loud! na so dem give me micro-phone ooo, " Please tell us your name, occupation and location" which I did with a very nice phonetic, (don't mind me, I saw a very nice chic in the front when i stood up, I wouldn't want her to think less of me you know).

After the identification, na so dem carry me to the uttermost chair, kai!! cousin, God dey oo!!!

Don't let me bore you with the whole sermon and stuff, after service sha, I was given free coca-cola, on our way home, cousin wants to drive, lailai!!! We both learned how to drive the same year, but he is a crazy driver! Wouldn't want to start my week by denting my mum's car. OK. That's how he began to talk about the pastor sermon, he said e no sweet, na you sabi oo, shebi na you drag me go the church...(laughs wickedly).

The rest of the day went well, now he is gone, na only me remain for house, am gonna miss him though, but hey! I have my novel and computer to hang out with.

Gotta go diary, talk to you later..
See me drinking coca-cola while driving....

Monday 23 September 2013

Good Old Diary...... Here I am to Update ya.


ook, i look weird in that picture.
It's been a while, and I don't know why I have not been writing something on here, considering that am experiencing boredom at it's peak as of late. Last month was a significant month in my life, I learn a lot, part of which is the fact that you can't know all, you just have to get the basics of life and attack issue head on as they come.

Aside from surfing the internet, gaming, reading, watching movies and driving, all I do is sleep! I don't know what's wrong with me recently, I am loosing my friends, it's not like they're dying ooo, nope, most of them just kind of shun me this days, they wouldn't even say hi I hope they are all doing well, at least that's the least I could hope. I guess it's because I've not been chatting lately, I miss my school friends badly, I hope the strike ends soonest.

So I find solace in reading, just this evening, I finish reading "The lost World" by Micheal Crichton, I wouldn't bore you by telling you the whole nitty gritty of the plot, but I learned a lot about extinction, evolution, tyrannosaur, and life generally, in conclusion, the author pointed out that Life is all illusion, this generation believes that photon and electron controls the existence of matter, but he said, the coming generation would hear about our believe and say "What a joke!"

 I couldn't agree less with the author, last semester, I took a course on ancient greek philosophy and science, there was this scientist (Hippocrates to be precise) that postulated a theory that human being is controlled by four major humour, sanginue, phlegmatic yellow bile and black bile (Did I just remeber that? am proud of myself), another scientist also postulated that we're controlled by our reproductive organ (I know you would laugh, because I did when I was studying the course too) That same way, the coming generation would laugh about our theories.

Sorry for boring you out with my silly science talk, so errm what else could I possibly share, yeah! am thinking of spicing up my life by supporting a football club, i don't know which one sef, it's like chelsea is always winning, maybe if I start watching their games, i might get to make new friends and probably go out more.
for some reason, i decided to take a picture of my room desk.


Ok. gotta go now, be back when God knows.

Wednesday 1 May 2013

It's Been A while, But HEY!!! it's not like have been Travelling round the world!

Don't let the date fool you, the digital camera is kinda backdated
I know it's been a while, but don't blame me diary, please blame the busy schedules, I hardly have enough time for myself this days, Thank God for the International workers Day, i wouldn't be here if it were not for the holiday. A lot has happened in recent weeks, wrote series of test and quizzes, and our exams has been postponed to May21st, you know what that means? It means I have just 21days before the exams. God has been my help, with abundant strength!!! Yes! despite late night studying, am not feeling the stress. Ok... Special Thanks to a wonderful friend FAITH if you're reading this, I really want to thank you for the Gift-card. i started a new blog recently http://www.leverstand.com It's a blog about entrepreneurship, giving ideas and empowering young people about how we can transform our world and eliminate poverty by creating jobs and being our own boss... err-mm i think that's pretty all for now. Gotta blaze.

Thursday 18 April 2013

And The Biochemistry test was a Phew!!!

Took this while studying for the test


Yeah, the headline line says it all! The test was pretty cool, glory be to God. The question was below my expectation, but the catch was that, the time was damn too short! 5min for two questions!!! I will share the question with you, the time given was just too short, but Thank God for speed and accuracy, i was able to trash everything out and even drew some relevant structures.

The test questions are as follows:
1. Write the structure of two named saturated fatty acid, and two unsaturated fatty acids.
2. List three membrane lipids.
 Simple right? Yeah, but Imagine answering that question within 4min (a minute was used for script collection) so you know how pretty fast you should be.

Enough of the test, a lot has happened so far this week, my mum called yesternight that my grandma is dead! she's old but we're all gonna miss her. I gotta blaze right now, because i have to prepare for another GNS: Element and Philosophy of administration. test tomorrow morning. bye-bye diary