Archive for Programming

Journey to Python Part 2: Input, Output, and Documentation

In the last article in the Journey to Python series, I had gotten as far as doing some basic math, and displaying some data to the screen. Over the last few days I’ve been working on two new facets of Python which will hopefully allow me to get up to speed in writing programs that are actually useful. This week I’ve played around a bit with reading input from the command line in a python program, as well as interacting with the operating system with the OS library; I’ve also had a chance to look at pydoc to get some documentation, and as per a reader request I’ve spent a bit of time thinking about pythons type system, and how it compares to more strict type systems in languages such as C++ and Java.
Read the rest of this entry »

Comments

Journey to Python Part 1: First Steps

After yesterdays rather long introduction into the whys and wherefores of my decision to learn python, today I’m going to begin to talk about my first steps into learning python. In this post I’ll talk about how I fared getting up and running with python, what references I chose, and discuss my impressions after writing my first program.
Read the rest of this entry »

Comments (2)

Journey to Python: Introduction

There is something that I have to admit, even though it may cost me a few geek points. I’m not fashionable. I’m not quite the old codger who things things were fine with punchcards and this internet thing is just a fad, I certainly enjoy using the latest version of $whizbang_app, and I’m happy to upgrade my hardware with acme’s Greatest-Thing-Ever(tm). I was using Linux on the desktop when most people were trying to decide if they should upgrade to Windows 98, and I was running Compiz when it was just a couple of tarballs and a neat video from Novell. In certain areas however, I am far more conservative.
Read the rest of this entry »

Comments (1)

Understanding /proc

/proc is often considered one of the most mysterious parts of the linux file system.  For those comming from the windows world especially, but also those who have been using Linux for years, proc seems an at times incomprehensible web of mysterious files and directories.

Understanding the mysteries of /proc can greatly aid in administrering and programming on linux systems, because proc is itself a key into the depths of the system.  In some ways, proc can be thought of as similar to the windows registry; it contains specific files that contain information about the system, and control how the system operates.

Read the rest of this entry »

Comments

Extending Nautilus With Scripts (Part 1)

One of the great benefits of Linux is it’s extensibility. For Gnome users, one of the great ways that you can easy expand and customize your desktop is with Nautilus scripts. In this article I discuss using Nautilus scripts to enhance your Gnome experience, as well as providing a couple of starter scripts.
Read the rest of this entry »

Comments

Creating a File Tree with Gtk+

I thought that today, rather than going for an in-depth tutorial, I would post a useful snippet of code for anyone out there doing GUI development with GTK+. Although Gtk+ is a nice toolkit, one thing that I found that it was lacking was a nice widget to automatically display directories. I had hoped that since it had such a nice file open dialog, there might be something out there, but alas I was unable to find anything. So, I present here a useful function to automatically populate a GtkTreeView with a directory structure.
Read the rest of this entry »

Comments

Pointer-to-Member functions & pthreads in C++

A common development problem, and one that is becoming even more important as processors gain more cores, and computers themselves gain more processors, is the issue of concurrency. Dealing with concurrency, that is to say multithreaded programming, is vitally important for obtaining top level performance on modern systems. Even in cases where performance isn’t critical, multithreaded programming (especially for GUIs) can vastly improve the user experience of an application. In this part 1 of a series on concurrent programming with C++, I examine what makes using pthreads with C++ difficult at times, and suggest two methods for easily integrating pthreads with an Object-Oriented C++ application, along with an in-depth look at pointer-to-member function syntax and in the light of this practical application.

Read the rest of this entry »

Comments

Lines of Code – The Most Meaningless Metric

$70,000,000(USD) – Seventy Million Dollars, an absolutely meaningless estimate of the cost of an average mid-sized in-house enterprise business application.  I say meaningless here for two primary reasons.  The first is that this number has almost no relation to the actual cost that an average company would spend to create the software, and second because it has absolutely no relation to what an average business would by or could sell the software for.  So where does this perfectly meaningless number come from?  It is an estimate based off of one of the mostly ill-conceived metrics in use in the software industry today, Lines of Code (LoC).  There is an interesting insidiousness to the measurement, it’s one that everyone seems to recognize as inherently flawed, and yet it’s popularity never seems to waver.  In order to really address this issue we need to first understand why Lines of Code is such an ineffective metric for measuring a codebase; once we understand why it’s so bad, it is necessary to look at why we keep using it- what information do we hope to convey by using this metric, and finally, what other terms and metrics might be useful in conveying this information, without the pitfalls of the Lines of Code measurement.

Read the rest of this entry »

Comments (2)