Python from __future__ import syntax error

No Comments

At long last I got my Unisa registration for this semester sorted. Unfortunately I could only register for 2 modules (these cover C++ and Python) as it was extremely difficult to talk to a human at Unisa to find out what is going on.

Anyway! Busy working through the text book for INF1511 (Introduction to Python Programming and Developing GUI Applications with PyQT) I ran into a problem with importing the division module/class(?)

The import I need is for true division (from __future__ import division) and the book’s space are not really visible. I typed from__future__import division as per the text book and when I run the program received the below syntax error.

It took some digging and testing for me to find out that the statement should have a space in-front and after __future__ . It should be from (space) __future__ (space) import (space) division. i.e from __future__ import division. Note the 2 underscores before and after future.

Hope this helps anyone else that struggled to get this simple statement working.

Share
Categories: Uncategorized

2018 was a good year

No Comments

I passed all but one of my Unisa exams last year and I’m feeling positive with continuing to study for my degree this year.

This semester I registered for Introduction to Programming (C++) which I unfortunately failed last semester as well as Visual Programming I, Maths and Mining (Physics, Chemistry) as part of my extended program. Now I have to wait for Unisa to approve the registration before I can kick off this year’s studying.

I also started game development using C# and Unity with a colleague to make a few small games with the end goal being a competitive FPS.

Share

Access Unity API help from within Visual Studio

No Comments

I am currently working through a Unity tutorial and one of the tasks I had to do is access the Unity API help documentation from within my code editor which happens to be Visual Studio 2015 which I am using on my Windows 10 PC. Unfortunately the API help documentation plugin is not installed by default.

To add the plugin browse to this link and download the Visual Studio 2015 Tools for Unity. Install the Unity Tools for Unity and then follow the below steps to setup a shortcut.

Keep in mind that I used ctrl + ‘ as the shortcut as used in Monodevelop. This will overwrite a teams shortcut. This was done for 2 reasons, to use the same shortcut from Visual Studio on my Windows PC and in Monodevelop on my Linux machines. Using ctrl + m and ctrl + h did not open the API documentation for me as described in the official documentation.

  •  Open Visual Studio
  •  Browse to: Debug -> Options
  • Drop down Environment and click on Keyboard
  • On the right hand side look for Help.UnityAPIReference
  • Set your desired shortcut key and click on “OK”

I only tested this for Visual Studio 2015, not sure if later versions are supported.

 

Share

Change of plans

No Comments

I started a new job a few months ago. With all the changes in my work life I decided to start learning Java as it’s the preferred technology used at our office.

This year was also a new chapter for me as I started my Bsc Computer science degree where I will be doing programming in C and C++. The journey has properly started and I should start blogging more on my experiences with getting to know Java, C and C++.  I have a few ideas for programs I’d like to write and release but more on that later this year or early next year.

Share
Categories: Studying

A great resource for free eBooks. All legal.

No Comments

I stumbled on a site called Packtpub.com where they release a free eBook for download everyday. Packt Publishing has a large variety of eBooks for sale on most technologies so go and visit the site to see what they offer.

You will be able to download a free eBook everyday after you have created a free account. Login every day to see what they have available as the daily download and if it’s a book that you are interested in, download it.

They also have specials running every now and then. For instance I bought a few video courses (yes they also have video courses available for purchase) for $5 each in December. Keep an eye on the site for any specials as well as any books you might be able to get for free or maybe for a bit cheaper than at other stores.

Please note this is not a paid post, I just want to share this resource with you as I have found quite a few gems on their site.

Share

Beginning C# 6.0 Programming with Visual Studio 2015

No Comments

I’ve been playing with different ways of learning to program like reading books and watching videos.

There’s a huge amount of resources to go and learn and I always felt that videos are the best way for me to learn programming as it is the medium I use to study for my Microsoft exams. That is till I bought the book Beginning C# 6.0 Programming with Visual Studio 2015 by Benjamin Perkins, Jacob Vibe Hammer and Jon D. Reid.

I found it much easier to learn programming from books especially the book mentioned above. My issue is that my mind wonders when watching videos and I noticed that I miss key concepts when watching and following the videos. However, I still use videos to learn programming as it just feels easier to get through the information presented.

Basically what I’m saying here is that I will be working through this book and then come back and blog about my experience using a book to study versus using videos to study.

Click on the links to buy the book Beginning C# 6.0 Programming with Visual Studio 2015 if you also feel that books might be more to your liking in studying a specific topic or technology.

Share