Day 1 of #100DaysOfCode

No Comments

Today I started with the #100DaysOfCode challenge. The reason for starting the challenge is to force myself to code everyday and getting into the habit of coding.

The 1st project I started is to access my CCTV RTSP stream from Linux, using a Python program, since the system only supports Windows and an Android App that feeds the video to a cloud service which I am not fond of.

It took some time to figure out the correct RTSP URI format but I managed to get it working and using the RTSP library from PyPi I am now able to view a stream.

You can find my GitHub repo here. There’s still a lot of work and puzzle solving ahead but I feel confident that this is doable. Below is a gif of the RSTP stream in action. The full video is on my Youtube channel.

Share

Another blog post on Python

No Comments

Just another heads up that I posted another blog post at ExchangeTimes.Net on how to make a specific Python version the default version on Linux.

This is useful if you use one version of Python 90% + of the time and don’t want to specify which version of Python you want to run each time. You can find the post here.

Share

Convert a PyQt ui file to a Python file on Linux

No Comments

Part of my Python programming module at Unisa is based on creating GUI applications using the Qt framework, PyQt5 to be more precise.

Unfortunately the study guide is based on Windows and not everything works the same way on Linux. The problem I had was not converting the .ui file as saved from Qt Designer to the .py file but with opening and running the application. The first conversion I did was straight from the guide as per below:

Read More…
Share

Linux Academy

No Comments

I joined Linux Academy a long time ago but cancelled it because of financial reasons. This week I had another look at them and the courses they provide. There are quite a lot of courses I’d like to do and joined them again.

The idea is to learn more technologies and certify myself on other non Microsoft technologies. Like the saying goes, knowledge is power and I have a curious mind. More to follow on my journey using Linux Academy.

Share
Categories: Studying Tags: Tags: ,

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: Python

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

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