Search

maxichimaximind

Endless Openmindedness

Category

Linux Way of Life

Non Stop educational experiences on Linux

Baby steps – Python programming

Its Been a while since I dropped an original post here. Lately, I’ve been sharing tech related articles am interested in as opposed to actually writing one. During this period, I’ve been trying to build up my Backend programming skills. it hasn’t been an easy ride so far. Started off with Php and the laravel framework but I immediately realized that am no good at Php. The framework was amazing to use but I just found it hard to comprehend the Php bit. (A solid understanding of Php is actually a prerequisite for using the framework.)

The time spent trying to study Php helped me realize that I needed to strengthen my core computer science skills. So, I’ve decided to focus on fundamental programming concepts such as Object oriented programming, algorithms, regular expressions, classes, methods etc. Once am comfortable with these fundamental programming concepts, I can get back to working with Backend frameworks like laravel and Django.

On my quest to rebuild these fundamental programming skills, i have picked a keen interest in the python programming language. Unlike PHP, i find it easy to understand the language and the concepts I need to brush up on. So, moving forward, I will use this blog to document my progress on the python programming language. I will share the exercise questions and my solutions to those questions as i encounter them in the various textbooks I’ve decided to read.

I hope this will be the beginning of a very exciting journey into python programming.

CURRENT BOOK AM READING: PYTHON PROGRAMMING (a Free book available here)

Exercises on Lists

Q1. Use a list comprehension to construct the list [’ab’, ’ac’, ’ad’, ’bb’, ’bc’, ’bd’].

item = [x + y for x in 'ab' for y in 'bcd']
print(item)
['ab', 'ac', 'ad', 'bb', 'bc', 'bd']

Q2. Use a slice on the above list to construct the list [’ab’, ’ad’, ’bc’].

item2 = item[::2]
print(item2)
['ab', 'ad', 'bc']

Q3. Use a list comprehension to construct the list [’1a’, ’2a’, ’3a’, ’4a’].

item3 = [x + y for x in '1234' for y in 'a']
print(item3)
['1a', '2a', '3a', '4a']

Q4. Simultaneously remove the element ’2a’ from the above list and print it.

print(item3.pop(1))
2a

Q5. Copy the above list and add ’2a’ back into the list such that the original is still missing it.

print('item3 popped: ', item3)
item3 popped: ['1a', '3a', '4a']
item4 = item3[:]
print('item4 as copy of item3 popped: ', item4)
item4 as copy of item3 popped: ['1a', '3a', '4a']
item4.append('2a')
print('item4 with new item added: ', item4)
item4 with new item added: ['1a', '3a', '4a', '2a']
print('item3 still popped: ', item3)
item3 still popped: ['1a', '3a', '4a']

Q6. Use a list comprehension to construct the list [’abe’, ’abf ’, ’ace’, ’acf ’, ’ade’, ’bbe’, ’bbf ’, ’bce’, ’bcf ’, ’bde’, ’bdf ’]

item5 = [x+y+z for x in 'ab' for y in 'bcd' for z in 'ef']
print('item5: ', item5)
['abe', 'abf', 'ace', 'acf', 'ade', 'adf', 'bbe', 'bbf', 'bce', 'bcf', 'bde', 'bdf']

Okey Chima

The one glitch in Canonical’s convergence plan – TechRepublic

Canonical is moving ahead, full steam, on its convergent platform. Jack Wallen believes there is one major glitch in these plans that will severely hobble Ubuntu’s ability to cross platform barriers.

Source: The one glitch in Canonical’s convergence plan – TechRepublic

Converting Mum to a Linux User

My Mum recently purchased this low end HP laptop with model number HP15-d001sia that came pre-installed with windows 8 but performed poorly right off the box. Anytime you turned on the laptop, the operating system took ages to boot up and the when it finally booted up, the applications kept running slowly or freezing up. In fact, this laptop scored 2.0 on the windows performance index. I wouldn’t recommend getting this particular HP notebook model. After going through the embarrassing process of finding the drivers for this particular model of HP notebook, the next step was to upgrade the operating system from windows 8.0 to windows 8.1 as the drivers were designed for windows 8.1.

Okay, so in the process of upgrading to windows 8.1, Microsoft advised that we check for and install every update recommended by the update manager before we can upgrade to windows 8.1. I followed this advise and updated windows 8.0 with every update recommended. On completing the update process, I headed back to the windows store to commence the upgrade to windows 8.1 but the windows store app kept on loading continuously to no end. I visited the Microsoft website to see if there was an alternative way of upgrading the system.

I didn’t want to be a naughty boy and download the software from unauthorized sources as this was a free upgrade anyways.

On getting to Microsoft’s website, I found this handy utility that checks if your system has all the prerequisites for upgrading to windows 8.1. As it turns out, this shitty laptop failed to pass the test as the Windows 8.0 operating system that shipped with it was licenced using one of those volume licencing stuff, hence it wasn’t eligible for the free upgrade. So my options included:

  1. Buying a legitimate windows 8.1 Operating system from windows (Ain’t nobody got time for that).
  2. Buying a pirated copy of windows 8.1 from my brothers in Zone 3. This is actually a good option if you do not have the time and bandwidth to download directly from Microsoft. Besides, my “homies” in Zone 3 will hook you up with extra software goodies for nothing.
  3. Download a pirated version from your nearest torrent site.

I opted to go for the third option because I had the time and I thought I had the bandwidth, but on getting to my favorite torrent site, I discovered that the size of the software was between 3 GB – 4 GB. That was a problem because I only had 9 GB of my Spectranet bandwidth left for the rest of the month.

At this point, I started thinking of Linux. Most Linux OS installation files are between 700 MB to 1.5 GB. I settled on downloading Ubuntu because I felt it would be easier for my mum to use as she is completely new to using computers in general. She hasn’t used any other operating system before, so she can’t say windows is easier to use than Linux. In reality, windows 8.0 is even more difficult to navigate than most mordern Linux operating systems. All my Mum needs to do on her laptop is to browse the internet and occasionally type up some document.

After installing Ubuntu on her laptop, I had to install Microsoft office using wine (that’s another story altogether). Mum is now using her Ubuntu OS with no performance or driver related issues. I think she will love and use it just fine (fingers crossed).

Sorting out the “system program problem detected” Pop up problem on Ubuntu

PROBLEM

Ever since I installed the MTN ZTE Modem on my Ubuntu 13.10 OS, I have been plagued with this pop up message every time I boot up my system:

System program problem detected, Do you want to report the problem now?”

Pop up message that appears every time my system is booted up
Pop-up message that appears every time my system is booted up

After you click on the “Report Problem” button, you get the following message as shown in the image below:

Sorry, Ubuntu has experienced an internal Error.
Sorry, Ubuntu has experienced an internal Error.

You click on the “Continue” button and the dialogue box disappears. Presumably, a message has been sent to Ubuntu, but this pop-up message continues to appear every time the system is restarted.

SOLUTION

A quick search on Google and I land up on this Ask Ubuntu community support page where I found a couple of potential solutions. The first suggestion I tried offered by Jason advised me to do the following:

Open a Terminal (Ctrl+Alt+T),type the following command and hit enter:
$ sudo rm /var/crash/*

You will be prompted for your password, type in your password and hit enter. As Jason states in his suggestion, “This will remove any old crashes, that might still be reported (in error). After a reboot/re-starting, any further pop-ups still need to be investigated.”

After re-booting my system, I noticed that the annoying pop-up messages had disappeared. Then I proceeded to use my Modem as usual. As soon as the modem’s application started, the annoying pop-up message appeared again. I moved over to the next advise offered by Ziyaddin Sadigov:

Open your terminal and type the following and hit enter:
$ gksudo gedit /etc/default/apport
Change enabled=1 to enabled=0, then save and exit.

After running the commands stated above, I also restarted apport with the following command:

$ sudo restart apport

You can run this command instead of restarting your system. After running all these commands, I ensured that the annoying pop-up messages were gone by disconnecting and connecting the modem back to the system. This time, the pop-up messages were gone.

 Okey Chima.

Installing Visual CertExam Suite on Ubuntu Linux

For a couple of months now, my Windows 7 installation on my Compaq presario CQ62 laptop has been acting up while on battery power. I live in a country where the power supply is sporadic so at certain times of the day, there is no power supply and you are left depending on your Laptop’s battery power. While the power supply is on, my Laptop running Windows 7 works perfectly fine but once the power supply cuts off, the Windows 7 operating system grinds to a halt. Once this happens, you can’t even close an already opened application until the power supply comes back on. This particular laptop has an installation of Ubuntu 13.10 running on a separate partition and works perfectly fine while on power supply and battery power. I am in the process of sorting out the windows 7 battery power issue but while that is ongoing, I need to run some Windows applications on Ubuntu and Visual certexam is one of those applications. This article explains the installation process of Visual certexam on Ubuntu and I hope it helps anyone who needs to install Visual certexam on a Linux operating system.

Visual certexam suite is a commercial application, therefore it requires a purchase of an activation key. However, there are numerous cracked versions out there for people to download. The installation process explained here is that of a cracked version. Continue reading “Installing Visual CertExam Suite on Ubuntu Linux”

MTN and ZTE modem documentation failure on linux

I’ve always been a lover of all things Linux and open source because it forces you to learn cool new stuff on a daily basis in your quest to use other devices with your system. When you experience problems on your Microsoft OS, you just want to blame Microsoft whether or not they are to blame. But when you experience problems on your Linux OS, you feel like you’ve broken something even when your Linux OS is to blame. If different people from all over the world testify to the wonders of open systems like the Linux OS and it doesn’t work properly for you, then you haven’t done something right, right? This feeling motivates you to learn more and more. I just love that feeling and I try to apply it to other aspects of my life.

Enough about my obsession with Linux OS. I recently purchased an MTN ZTE MF667 HSPA+ USB modem and as soon as I connected it to my Microsoft OS, it auto ran itself and installed the MTN GUI and in no time, I was Googling and Facebooking. Next on my agenda was to use the modem on my Ubuntu OS because that’s what I use most of the time. Normally, on Ubuntu, once you connect a modem like the popular Huawie ones, it appears under the Network connection icon and once you click it, you just need to go through a simple set-up like selecting your country and your mobile network provider’s name from a preoccupied list. Once that is done, you are up and running but in some cases, you might need to enter additional details like the Access Point Name (APN), Username and Password. These details are readily available to find on the almighty Google. Continue reading “MTN and ZTE modem documentation failure on linux”

Blog at WordPress.com.

Up ↑

%d bloggers like this: