IMG_1229

Training the facilitators

In preparation for Maker Party, I organised a training day for everyone who is going to be a facilitator. The training went well. Facilitators were introduced to persona,thimble popcorn and lightbeam tools.

Pictures below:

After this event I felt we were ready to host Maker Party in Bulawayo. I’ll write a follow up post about that.

IMG_1221

IMG_1229

IMG_1254

IMG_1255

HiAppHere_com_kr.aboy.unit

The new Unit Conversion App

A few weeks ago I blogged about a unit conversion app that I was working on.
I doubt that I’ll be working on that project anymore. I found on github a similar project that was written better than mine(its design is modular, the style is clean and just better than my own) but the said project had a lot of bugs and in need of a coder to implement some of the features in the specification. The open source volunteer in me didn’t need any more convincing. I was sold.

I took up the challenge, forked the project and started testing it. I identified as many bugs as I could and after that I started work on coding the missing functionality and fixing the bugs I found(there were many **YaY Me **).

After a lot of hard work, I’m happy to state that the project is now at a good stage and all the functionality in the specification is up to date.I suspect that it is still buggy. My focus was on creating a unit conversion app that has an API that I can integrate into my own web applications. This Unit converter has an easy to use API that works.
Have a look at the Unit converter app here: .

The next stage in the application’s development is designing a web based user interface for it. I’m making progress towards this end.
Stay tuned.

Image courtesy of http://www.hiapphere.com/

Python 101: Your first python program

This post is part 2 of Get started with Python programming series, in which I do my best to share my experiences in learning python and hope that this becomes some sort of guide to help you become a Python programmer.

In today’s post, I explain how to write your first Python program.

If you followed the instructions in my previous post, you already have python installed.

Python programs can be run in two ways, interactively, from the terminal or run as scripts.
To explain what this means, let’s write some python code in interactive mode. Open your terminal and type in ‘python’ without the quotes. This will start the python interpreter.
You should see something like this if the interpreter is running:

Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

In this mode, python allows us to start writing python code in the terminal window. There’s no need for it to be compiled, it’s ready the minute you hit the Enter key.
Type this in : print("Hello World") and hit Enter
You should see this:

>>> print("Hello World!")
Hello World!
>>>

There you go, that’s how easy it is to code in python. The interactive mode can also be used as a calculator. Try it!

More complex code
——————-

Writing single line code that prints stuff to the screen isn’t fun or useful, so if we want to write more complex code, we need a special weapon that every coder needs: The text editor. Which one you use depends entirely on you and your style, so any text editor(or IDE) will do just fine. I use gedit, which is a text editor that comes pre installed with my Linux distribution. I like it because it offers syntax highlighting and auto indentation(a very useful feature).

Let’s write up more interesting code in the text editor. To do this, launch your text editor and type the following in:

def hello_world():
    print("Hello Universe! I am a Pythonista in the making")
    name = raw_input("What is your name?__")
    print("May the force be with you %s in your quest to be a pythonista") %name

It is important to type in the above code as it is and note the spacing difference between the first line and the lines that follow after that. This is no mistake. Let me go through each line to explain what is going on.

def hello_world():

This defines a function called hello_world that does not take any arguments

The second line has a print statement that you’re familiar with now. An important point to note here, the lines after the function signature are indented by four spaces. This is done to show that the lines that follow are part of a code block or a suite.

The third line is a variable assignment, the variable name is created and assigned to input that the user will type in.
In the fourth line, we’re just printing out what the user typed in in line 3.

The next step now is to save this file. Save it on your computer with the .py extension appended to it. For example you can save it as hello.py. Once that is done, you can run it from the terminal by navigating to the folder where the file is saved and typing python hello.py
.

That’s all there is to it. You’re a python programmer now!

Thanks for reading

Python 101: Getting it

This post is part 1 of Get started with Python programming series, in which I do my best to share my experiences in learning python and hope that this becomes some sort of guide to help you become a Python programmer.

In today’s post, I explain how to get and setup Python.

Getting Started with Python
============================

Python is an easy to learn and powerful programming language with elegant syntax and dynamic typing and it is available freely for all major operating systems. This is great news because no one is left out here.

The first thing you need to do is to install the Python interpreter in your system, this is the program that reads Python programs and carries out their instructions. This has to be installed before you can do any programming in Python.

If you have Linux or Mac OSX installed in your computer, happy days for you already have the python interpreter is included with your operating system. If you’re a Windows user, you can visit http://www.python.org/download/ and download a package installer that will install python interpreter for you.

Linux/Mac users: To check if python is installed load the terminal and type python and hit enter. If all is well, you should see a message like this:

Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>>

That is a sign that the interpreter is ready to receive python commands.

Congratulations, you have successfully installed python. The next post will be about how to write your first python program. Thanks for reading.

DOCTEST : An easy testing tool

According to author Daniel Arbuckle, Doctest is the easiest and fastest way to write tests for your python software.Doctest is a program that comes bundled with python that allows you to write down what you expect from your code in a way that’s easy to understand.

Doctests are written in plain text usually in code documentation. The computer reads and runs the tests but ignores the rest of the text that is not part of the test i.e the rest of the documentation. Tests can therefore be embedded in code comments or explanations.

Here is a quick example of a doctest:

def testable(x):
"""
The testable function returns the square root of its parameter, or 3, whichever
is larger.

>>> testable(7)
3.0
>>> testable(16)
4.0
>>> testable(9)
3.0
>>> testable(10) == 10 ** 0.5
True
"""

if x < 9:
return 3.0
return x ** 0.5

Notice that in the code above the first 13 lines are commented out, the comment simply states how the testable function works and gives examples of expected output when different parameters are passed to it. When running doctest, doctest will read through the comments and try out examples in the comment to see if they return the expected results. This is a great feature especially if you want to check if the documentation is accurate.

More information on doctest can be found here:

https://docs.python.org/2/library/doctest.html

Thank you ORAP

Many of you know that I have been working at ORAP for the past three months or so.
As expected, I enjoyed being there and I definitely would encourage you to volunteer there if you can.
I say this because my time at ORAP has come to its end. At this point I doubt very much if I’ll be renewing my contract. I’ll make up my mind over the weekend.

What was my motivation for working for ORAP?
———————————————–

I have worked for ORAP before, as an intern and as an employee. This time around I was a volunteer.ORAP is the kind of organisation where your opinion counts, no matter who you are, where out of the box thinking is encouraged and where crazy is normal (at least in the IT department). The ORAPIANS as they like to call themselves, are super friendly, always eager to offer a helping hand and joke about it in the process.

My real motivation to volunteer lay in the fact that I wanted to learn new skills whatever they may be, and learn I did. I’m happy to say that as a result, some of the systems that are in place now were made by me(I had help of course). This gives me fulfillment you know, knowing that my brain-children(if there is such a thing) are at ORAP.

So what did I learn?
———————–

My knowledge of Linux server administration improved greatly and I now have a few more skills in my skills bag. I don’t have badges to show for it unfortunately. Working on the website taught me one thing: manual testing sucks! Its necessary but still, its slow, painful (yes mentally it hurts) and boring. This just fueled my drive to learn automation. I am making big strides towards that goal too.

Overall experience
——————–

It was good, I learned what I needed to learn and I contributed where could and I’m happy.
Will the orapians miss me? Probably not, many of them didn’t even notice that I was there.
I hope that those who remember me remember me as the person who broke things to fix them, who treated computers equally because they have rights too and generally as the guy who was fun to be around.

I have served my time and it’s time to move on to something else now.
Thank you ORAP

If what I said about ORAP interests you, check out their site:

Another unit conversion app?

I’ve always had a challenge in understanding the meaning of data transfer rates I hear whenever I’m asking about an ISP package. What does 15Mbps even mean? I think better in terms of how many megabytes of data I can download per second, so I’ve always had to use an online converter to convert the Mbps to MB/s. I’ve done it this way until I thought to myself, why don’t I just build my own app to do this for me?

I did it, coded the python app and it works! I also went on to add distance and weight conversions.
Continue reading

A text Based Game that you can’t win

–You really can’t win this one, and no, it’s not a bug, its a feature. Yes I just had to say that.

Here’s a linkĀ  to a game I’ve been working on. This game is command line based and presents you with a series of menus where you choose an outcome. There’s really no point to this game and it cannot be won. Check it out in my github here.

Please review my code and help me in my goal to be a Pythonista!

How Python chose me

Every time i learn something new, I put it up here.
I’m in the (never-ending) process of learning Python, a general purpose language
that is used extensively by Mozilla’s WebQA team.

Why Python
————–

I didn’t choose Python, instead, it chose me.
Unlike java, I didn’t google it to weigh its pros and cons and determine whether its a language worth learning or not. No instead I had to learn it because it is the language that is at the heart of WebQA automation and If I’m serious about being a software tester, this is the language to learn. I’m in good company. because I have a community of experienced developers and testers that I work with who are more than happy to help me along the way.

My journey so far
——————-

To be blatantly honest, I haven’t been disciplined in my study of python, its been on and off,
but I today decided to put an end to this, today I’ve decided that I want to be a GREAT programmer!
Python is the language i’ll master and I will attain guru status after a few years.

What I find most interesting
——————————-

Whitespace matters! Unlike most programming languages, in python, whitespace, tabs really matter.
There are no braces to group together blocks of code but instead they are grouped by indentation blocks? lost? let me use an example:

Python gets straight to the point:
In java, this is what you’d need to type in to get a hello world program:

public class HelloWorld {
public static void main(String[] args) {
System.out.println(“Hello, World”);
}
}

In python:

print (“Hello world”)

Python is easy to read and write and if you’re new to programming I would definitely recommend starting with Python. I would be more than happy to help any newbies begin their journey. If you need any help, throw me a line, my email is terrameijar at google’s mail service. Not only will I get to help you get started, but I’ll also become a better programmer in the process.