Tag Archives: Ubuntu

Gripes with Python

22 Jan

When I started my rather large undertaking to try to complete 12 games in 12 months I took python as my language of choice. I had very little experience in it and wanted to becoming versed in the language and its intricacies by the end of the year.

For January I decided to write a small text-based adventure (specifications will be put up shortly) it seemed to be right up Pythons alley, lots of string manipulations, none to very little data storage and the code is almost script like rather than a complete program because no external modules are used. All my code is kept in a box.net folder along with a python setup executable so that I can access the data and code / debug from anywhere on almost any computer. This setup was perfect for about 2 days when I started to run into various problems.

Gripe 1 – No proper IDE
Before everyone starts chewing off my head, I come from a C / C++ background with a Windows OS. I use Linux (Ubuntu or Fedora) and have love / hate relationship with it, I regularly use the command line for compiling and debugging and often switch between Visual Studio my IDE of choice and Notepad++ when coding. However Python has no proper IDE for Windows that can match Visual Studio for convenience and in my humble opinion quality, it just works and if I’m not mistaken that Python unofficial motto.

Gripe 2 – Whitespace or Tabs
Many people attribute this as a key component for improved productivity. For me however its been nothing but a headache. I’ve been forced to change my entire coding methodology as I can’t move from Visual Studio to Notepad++ with causing some sort of white space error. I spend more time trying to correct syntax errors than actual coding.

Gripe 3 – Lack of Braces
Using braces comes naturally to me because of use in C / C++. Python does not use any while this is not a major problem I find the syntax rather a little difficult to read as I find it difficult to find out where a condition ends particularly when it is multi-lined.

Gripe 4 – Multiple Versions
Python has far too many versions and to use any tool created I need to use a different version of Python or jump through hurdles to print “hello world”. While trying to program games I’m dabbling in the Google App Engine and it requires Python 2.5, I use IronPython in Visual Studio which is compatible with Python 2.7 and when I’m using Pygame or Panda 3D I need to use Python 3+. It is very annoying as each implementation has different syntax and modules are not cross-compatible with Python 2+ and Python 3+, with most not having finished conversion as yet.

Positives
Even though I have some genuine problems and irritation working with python I’m finding its community to be very helpful and patient with new users particularly those on r/python.

Code samples are readily available in Python, especially for those looking for large projects that include scaling and other popular buzzwords used today. There are some very interesting projects that are written in Python and following them, editing some of the source is interesting and makes for a good challenge.

It is very easy and very quick to write simple scripts and small utility programs. But only if the modules you hope to use are compatible with the version of python you have installed.

The biggest relief for me was the built-in data structures, I did not have to look for or write my own templated data structures. Along with data structure I find that I prefer Python’s weakly typed arrays, mixing numbers and strings without the use of a custom data structure is a real time saver.

Conclusion
Overall while I’m struggling with the language I’m going to continue using it as it has a lot of scope for the future with its popularity in web app development and game scripting. Hopefully the guys on top sort a few of the language issues and move to Python 3+ and we can all live in peace.

Installing colorgcc in Ubuntu

14 Apr

Using the terminal and a simple text editor is my preferred method of writing code, regardless of the language its a fast and efficient method of testing code with running the overheads of an IDE on my little netbook. But deciphering errors has always been a pain as simple black and white error messages give eyestrain and are difficult to see.

Fortunately for the more tech-savvy they have the option of soft linking the colorgcc module to there compiler commands. But for the like of you and me its been a pain, atleast until quite by fluke I came across the following method of installing the module.

All you do is, go to terminal and type:

sudo apt-get install colorgcc

Thats it, it works wonders and now my error messages come in colour.

Installing Ubuntu on Acer Aspire One

24 Mar

Installing Linux on the Acer Aspire one is a hit and miss proposition as you don’t know how much work you will to do to make it work smoothly and without a hitch.

Until now I had fedora 10 installed without any problems and while I had not tested everything on it the wifi was working out of the box which was fantastic and saved me a lot of trouble of going through the internet and mucking about the system until it worked. The only problem I had was that the font size was on the large side and even though I made adjustments to the font size to make it smaller it kept bugging me. Also note that the fedora software repositories are vast and installing things is a breeze and usually involves just finding the RPM -> download and let the package manager install it.

I gave Ubuntu another try last night and despite my earlier grief I managed to get the wifi working, and now its still working almost 24 hours later although I haven’t updated the system in fear of the wifi failing again.

Installing Fedora or Ubuntu.

Part A
Getting the OS on a USB:

  1. Download the OS from the Ubuntu website
  2. Download Unetbootin
  3. Plug in a formatted USB which is 1GB or more
  4. Open Unebootin and look for Disk Image and select it and where the ‘…’ are press and go to where you downloaded Ubuntu and select it. *
  5. By default it chooses the USB, so all you need to do now is press ok and wait while it creates a bootable USB.
  6. After it is done reboot and press F12 when you see the ACER startup screen.
  7. Choose the USB option.
  8. Select default and wait for the Ubuntu Live CD to load.
  9. * Alternatively you can skip step 1 and use Unebootin to download the Ubuntu distribution you want to use.

    Part 2 coming tommorow.

Netbook + Linux = ?

17 Feb

Netbooks have come a long way from the tiny EeePC that first debuted almost two and a half years ago on the 16th of October 2007, from that day the world was taken by storm by these sub-sized laptops and their potential.

Especially the GNU/Linux community who have tried to port the Linux kernel from microwaves to the PS3 and everything in between. Seriously they have tried to port the kernel into some really strange things just try googleing it the answer may surprise you. In fact its fairly fascinating how far into the market the Linux kernel has penetrated, such as digital watches or microwaves.

After successful ports of the Linux kernel to Desktops and Laptops the community turned its attentions onto these new netbooks, a device with unlimited potential, being the first netbook on the market the EeePC got tremendous exposure by enthusiasts who immediately started to port their distro of choice onto the little machine.

Linux Distributions for EeePC

Keyboard / Console Mouse X11 Graphics Audio Ethernet Wireless 802.11b/g Wireless 802.11n SDHC Cardreader UVC Webcam
FreeBSD Yes Yes Yes Yes Yes Yes Yes No
OpenBSD Yes Yes Yes Yes Yes Yes No
NetBSD Yes Yes Yes Yes Yes Yes with patch Yes Yes
Arch Linux Yes Yes Yes Yes Yes Yes Yes Yes Yes
Debian Yes Yes, as PS/2 or ImPS/2[87]; no fine tuning of Elantech touchpads without a kernel patch Yes Yes Yes Yes Yes Yes Yes
Windows XP Yes Yes Yes Yes Yes Yes Yes Yes Yes
openSUSE Yes Yes Yes Yes Yes Yes Yes Yes Yes
Mac OS X Yes Yes Yes out only No Yes Yes No Yes

Source: Wikipedia

Along we come to fall 2008 a year later and countless other companies have seen the profits to be made by making netbooks, and jumping in as part of the craze I got myself a Acer Aspire One (AAO).

The specs are:
Processor: Intel Atom 270 1.6Ghz
HardDrive: 120GB
Ram:       512Mb
OS:       Windows XP Home

Now being a windows user I have never paid much attention to the Linux distributions, but I was curious to try and run one but refused to do so on my desktop so AAO was going to be my test machine. After spending countless hours on google trying to figure out how to dual boot on the AAO as it does not come with a CD/DVD drive I need to borrow an external DVD drive.

I installed Ubuntu 8.10 and spent a couple of days trying to get the wifi drivers to work I found it too much work and gave up as the settings refused to work despite the excellent guide posted on the Ubuntu website and switched to Fedora 10 with which the wifi worked out of the box.

Installing Fedora as with the Ubuntu setup was a fairly simple process the only thing I needed to be cautious about was not to overwrite my Windows XP or do a full system format. After that the install pretty much took its own course without have to keep pressing OK or choosing options like in a Windows setup.

Being a novice GNU/Linux user I was fairly suprised by how easy I found it to get around and do my tasks, also the boot time is significantly faster on Fedora than Windows XP but the battery life is about half an hour shorter. The only complain I have about Fedora and other GNU/Linux Distros are how complicating installing software is, you need to download the RPM or Source Code and the either compile the sorce and install or install the program directly, I found the process too cumbersome and annoying especially if I need to install dependencies.

But apart from that its a seemless transition from windows to linux and I found a few resources online with which to learn linux on check them out its a great beginners resource even more experienced users will find it helpful.

The Shuttleworth Foundation: Learn Linux

This is by the visionary behind Ubuntu its a perfect beginner guide and has sections on System and Network Administration as well as a section on Shell Scripting.

It also has an interactive training environment (forum) so you can connect with others studying as well. I haven’t tried it yet as I found google a faster help.

%d bloggers like this: