Free Software

Software Engineering with FOSS and Linux

4 + 1 ways to celebrate the Software Freedom Day

With the Software Freedom Day fast approaching, the Free Software Foundation and communities across the world are planning their activities and are preparing to celebrate and promote Free Software in their region. Joining your local community and partaking to its activities is strongly suggested; however, here are some ideas for individual promotion of Free Software:

  • Spread the word. Mention it to your family, your friends, your colleagues, your classmates. You may be surprised by how many people may begin to care after they actually hear about a new idea. You will find that the “people don’t care about this kind of stuff” is a common misconception; many people do care and will often seek ways to help.
  • Make a T-shirt. Select a logo of your favorite Free Software application or organization and print it on a T-shirt. Wear it in public. Some will see. Some will be curious. Some will care.
  • Promote it in your virtual community. Blog it, digg it, twit it, post it on Facebook. If you play a game, talk about it in the game. If you run a game, announce it to your players. For example, here is the announcement planned for an online game I’m currently coding for:
    Today we celebrate the Software Freedom Day; we celebrate the freedom in our
    virtual world, a world made possible by Free Software. Our code is built on
    Free Software and has been powered by and running on Free Software for 17 years
    now. Our thanks to those who allowed us to revive and enjoy Dragonlance for
    all this time.
  • Use it as a chance to get involved in activities related to software freedom. You don’t need to be a programmer to help; you can help with translations, bug reports, or even activities not related to software at all: map your neighborhood using OpenStreetMap, upload your art to the Open Clip Art Library, publish your digital content under an appropriate Creative Commons License.

Maybe the most important thing you can do that day is learn more about Software Freedom and reflect on how it applies to you and your community. Checkout The Free Software Definition, learn Why Schools Should Use Exclusively Free Software and understand why Your Freedom Needs Free Software. Don’t take these at face value; think about them, and form your own opinion. Then act.

Advertisements

September 2, 2009 Posted by | Free Software | , , | 16 Comments

OLPC Deployment in the Greek village of Sminthi

The last two days I’ve been attending the Software Freedom Kosova Conference 2009, which was really interesting and had quite an impressive turnout. In the conference I presented our work for the deployment of some XO-1 laptops, part of the One Laptop Per Child project, to some students of the High School of the Greek village of Sminthi. You can checkout the project’s Wiki for some ongoing work; here I will present the paper we submitted to the Conference.


OLPC Deployment in Sminthi

Xenofon Papadopoulos, Athanasios Priftis, Pavlos Hatzopoulos, Theodoros Karounos

Re-public Online Magazine, Greek Free/Open Source Software Community, TEI of Athens

xenofon@edu.teiath.gr, priftis@re-public.gr, phatzopoulos@re-public.gr, karounos@re-public.gr

Abstract. From September 2009 students in the Greek high school of Sminthi will use OLPC XO-1 laptops inside and outside the classroom. In this paper we present our methodology for the OLPC deployment, ranging from the creation of a human network of teachers, members of the local community, social researchers and IT specialists, to the acquisition of the laptops, the development of applications and educational content, and the technical support of the project. We describe the holistic approach used to implement the project, and highlight the role of communities as the means to bring together and mobilize end users and technical experts. We present the use of Free Software as a fundamental component of such an approach, and demonstrate how it can be used to address both technical and non-technical aspects of the implementation. Finally, we present our plans for further development and future OLPC deployments.

1. Introduction

Modern educational approaches promote blended learning, collaboration and multiple educational resources. The Greek Pedagogical Institute, designing and overseeing the educational process in the Greek public schools of Primary and Secondary education, advocates the creation of “an open and attractive educational environment, through the application of alternative pedagogical approaches and the development of teaching practices based on communication (student-centered approach, collaborative teaching)”[1]. Furthermore, the Pedagogical Institute distinguishes the notion of educational concepts to that of the book’s content, requiring teaches to deliver the first by any means necessary, using the official book as a reference. However in many Greek schools a traditional approach – use of only the official book, recited by the teacher – is still prevalent. The special conditions at the high school of Sminthi expose the shortcomings of that approach, and offer a fertile ground for the adoption of the new teaching methods.

Located on the remote, mountainous region of Xanthi, in Greece, the high school of Sminthi has approximately 140 students enrolled, but attendance varies each year. The lessons are exclusively in Greek. Students, however, are all members of the Muslim minority living in Greece, with their mother tongue being either Pomak or Turkish (or a mix of both), and have graduated from elementary schools where lessons are given in Turkish and Greek. Thus their grasp of the Greek language is weak. The language barrier alone imposes great obstacles to the education of the students.

In 2008, two high school teachers, Dionysia Psychoyos and Vasilis Rigas, explored alternative teaching approaches that would help them transcend the language barrier. Their subjects, Mathematics and Computer Programming respectively, seemed promising since they are based on concepts, abstractions and symbolisms that depend less on a firm grip of the spoken or written language. They had already ventured in collaborative learning approaches when they encountered Thanasis Priftis and Pavlos Hatzopoulos, editors of the Re-public on-line magazine, who suggested exploring the possibilities offered by the One Laptop Per Child (OLPC) initiative.

2. The One Laptop Per Child initiative
2.1 General

The mission of the One Laptop Per Child organization is “to create educational opportunities for the world’s poorest children by providing each child with a rugged, low-cost, low-power, connected laptop with content and software designed for collaborative, joyful, self-empowered learning”[2]. Its current focus is on the development, construction and deployment of the XO-1 laptop, an inexpensive notebook computer initially intended to be distributed to children in developing countries around the world, to provide them with access to knowledge, and opportunities to “explore, experiment and express themselves”[2]. It is shipped with a stripped-down version of the Fedora GNU/Linux operating system and a GUI and set of applications called Sugar, that is intended to help young children collaborate.

The OLPC project involves several organizational and technological decisions. We could, very broadly, sum them up as follows:

  • Innovative, worldwide compatible, children friendly, hardware.

  • Free / Open Source educational operating system and applications influenced from the constructionists movement and other learning theories.

  • A deployment plan focused on decisions and funding of the centralized government.

  • A third-world development theory based on education as an answer to poverty.

There has been a well documented critique[3] on all of these issues and several more. Again, a brief layout:

  • Developing countries have different kind of basic priorities (clean water, better nutrition, infrastructures, need for teachers, schools and so on). The OLPC project exploits their resources without taking under consideration local needs, networks, and practices.

  • Although around 800.000 XO1 have been shifted to different developing countries, there is a wider consensus that smaller orders are very difficult to be placed and they were definitely not encouraged or planned.

  • Local teachers’ participation during the projects deployment has been low, campaigning on the wider educational changes needed in order to apply the learning and technological innovations of OLPC in schools has been insignificant.

  • The OLPC project has fallen short on the Free / Open Source tool promise by, among other things, inviting Microsoft to install a trimmed-down Windows XP version on the laptop.

2.2 The case of Greece

In Greece, as well as elsewhere, a group of school teachers, academics and open source developers formed an initiative to promote the adoption of OLPC in the Greek primary and secondary education. The initiative promoted the use of the OLPC tools and created tutorials for the development of educational applications on the platform. Furthermore, it proceeded to develop educational content based on concepts included in the school books, including material on astronomy, physics and mathematics[4].

The original model of deployment as conceived by the OLPC was based on large scale orders by the central government and distribution to the students by the Ministry of Education. As the original model failed to deliver, our team attempted to exploit what it perceived as the legacy of the OLPC project:

  • A fresh, better documented, initiative-based discussion on new educational practices, stemming from a reinforced need to look upon new paradigms of learning.

  • A better, more affordable, technology built on F/OSS principles and tools, creating a new market of educational applications.

  • A concept focused on motivating local actors, one worth building local communities upon.

Based on the above, the Re-public team sought an alternative model that would not depend on the central government, but on local communities facing their own, specialized needs. As part of these efforts, the team in cooperation with the Union of African Women has in the past organized an evening of “play and experiments” with the OLPC, aiming to support the free distribution of XO-1 laptops to the children of immigrants, and has issued an open call to the community for cooperation in projects related to the OLPC. The case of the OLPC deployment in the high school of Sminthi emerged as a result of these actions.

3. The OLPC Deployment in Sminthi

The project aims to provide XO-1 laptops to the third grade students of the high school of Sminthi, along with a set of applications (“activities” is the term used by the OLPC to highlight their interactive and educational nature) fully translated in Greek. The laptops will belong to the school, however the students will keep them for an entire year, both inside and outside the classroom, at the end of which they will be returned to the school.

The project does not plan to use the laptops as a means to deliver the official educational material already distributed in the classroom, i.e. it does not plan to employ it as an e-book reader of the official school books or as a platform for the existing educational software. Although both are possible, the main goal of the project is to give the teachers and students a platform to develop their own activities, as they see fit. Also the project aims to aid the teachers to develop new content, based on the exclusive needs of the class, and deliver it to the students in any way they deem proper. We should note that, regardless of the need to translate all the applications in Greek, according to the Sugar HCI guidelines the interface of most activities is based on icons and interactive graphical elements, reducing the effects of the language barrier.

The project is based on the creation of a human network with a broad and mixed background, centered around the local school community. Participants of the network deliver their own special skills to the project; communication, coordination and cooperation among the team members are essential. Furthermore, a major goal of the project is communicating and delivering its results to a broader circle of researchers, teachers and IT practitioners not involved with the Sminthi case, thus attempting to expand its human network, discover synergies and form links with other communities.

3.1 Roadmap

The following roadmap outlines the history of the project so far and highlights the creation and growth of the human network as the core factor of the project:

Figure 1 - Roadmap of the OLPC Deployment in Sminthi

Figure 1 - Roadmap of the OLPC Deployment in Sminthi

  • The local teachers met the Re-public team, and discuss the conditions in the classroom of the Sminthi high school. The Re-public team suggests using OLPC as an experiment.

  • Theodoros Karounos, coordinator of the Greek OLPC initiative and member of the Re-public Board of Directors works with the team to publicize its idea and seeks links with communities and experts from several disciplines to realize the project. Furthermore, funding is aquired to purchase 30 XO-1 laptops, part of which will be given to the high school of Sminthi.

  • The Re-public team contacts members of the Greek Free/Open Source Software (F/OSS) Community (ELLAK) to handle the technical aspects of the project, which involve the configuration of the XO-1 laptops, the translation of selected activities into Greek and the development of new applications.

  • The project is presented at a workshop of the F/OSS Conference (http://conf.ellak.gr/2009/) at the National Technical University of Athens. In the workshop several activities around the OLPC in Greece are presented. Apart from the core team members, participants in the workshop include high school teaches and independent open source programmers. During the workshop, an elementary school teacher requests additional XO-1 laptops for use in his own school.

  • The local teachers, having explored the capabilities of the XO-1 laptops and the Sugar platform running on them, request the development of two new applications that will help introduce the students to the concepts of 1st and 2nd degree polynomials and the properties of simple geometrical shapes. Xenofon Papadopoulos, a member of the Greek F/OSS community working for the Technical Educational Institute of Athens, agrees to develop the polynomials activity for the Sugar platform.

  • Αrlen Dilsizian, a researcher in social anthropology, gets involved with the project and decides to live in Sminthi for one year and study the impact of the OLPC deployment to the classroom, the broader educational process, and the students’ life in general on behalf of the Re-public team.

  • The Re-public team, in cooperation with the Greek Research and Technology Network (GR-Net), organizes an event where the 30 laptops are tested. In the same event, a prototype of the new polynomials activity is presented for public trial and comments, and a roadmap for further action is laid out.

  • The Greek F/OSS community finalizes the translation Sugar, Etoys and selected activities into Greek. A wiki, describing the entire project and on the development of the new activity, is created at http://olpc-gr.wikia.com. After several iterations of improvements, the activity is uploaded to the central repository of Sugar and announced to the community, which offers suggestions to improve it and better integrate it with the entire Sugar ecosystem.

  • The Re-public team organizes the integration of the various components (laptops, configuration, network connectivity, translated and newly developed activities) and lays out the plans for the deployment.

As Figure 1 demonstrates, the entire project is revolving around the local school. It begins with the students’ needs, as perceived and understood by the local teachers. It is co-ordinated by the Re-public team, its technical aspects are implemented by the Greek F/OSS Community, and it is evaluated by an independent researcher of social anthropology, who will live and work with the children for the duration of the project. Subsequently, the results will be processed by the teachers and delivered to the rest of the team, which will provide feedback and technical support in a cyclic, iterative process.

3.2 The Role of Free / Open Source Software

Open source software has been a core ingredient of the project in every step from its conception to its implementation. An important pedagogical goal of the project is to encourage the high school children – and other IT practitioners, such as university students and teachers – to explore the platform and its applications and possibly develop their own content. The open nature of the platform and all its tools makes it possible to look at the current code, learn from it, modify it and use it as the basis for further development, unencumbered of both technical obstacles and licensing issues. Furthermore, the community-based development and support model practiced by the open source movement makes it possible to realize the project by drawing upon the resources of local and remote communities such as the Greek F/OSS and the Sugar Development communities.

4. Conclusion

The project of the OLPC deployment in Sminthi does not attempt to introduce IT technologies or alter the educational approach in the Greek Primary and Secondary education. Nor does it care about the digital representation of existing material. It is a project revolving around the students and the local teachers, their exclusive needs as they, themselves, understand them. It advocates and supports the creation of ad-hoc applications and content, and monitors the projects’ impact on the teachers’ and students’ both inside and outside the classroom. It is based on a new model of action: a model of small, low-cost deployments, supported by unofficial communities forming a human network with a broad and mixed multidisciplinary background, centered around local representatives and end-users to address real, local needs.

5. Future plans

Future plans of the project include the actual deployment, that will take place at the beginning of September 2009. Of particular interest to the project is the evaluation of the deployment’s effects, both inside and outside the classroom, which will take place during the entire year. Finally, the project aims to create links that will result to an active community which will advocate and promote the use of free software in education.

6. References

[1] Sotirios Glavas, Quality of Education and Pedagogical Institute, http://www.edugate.gr/ek-ty/01-06-09-13, 2009

[2] One Laptop Per Child Association, One Laptop per Child (OLPC), a low-cost, connected laptop for the world’s children’s education, http://laptop.org/en/vision/index.shtml, 2008

[3] Lee Felsenstein, Problems with the OLPC approach, http://www.fonly.typepad.com/fonlyblog/2005/11/problems_with_t.html, 2005

[4] Theodoros Karounos, Web Site of the OLPC at the University of Patras / CTI, http://www.karounos.gr/blog/?p=32, 2007

August 30, 2009 Posted by | Free Software | , , , , | 66 Comments

Free Software in Education

The notion of Free Software is definitely political. I’m not stating the obvious, that any human work that affects a community in any way is political. Neither I suggest that the ideological (as opposed to purely technical) reasons of many Free Software supporters (and its critics) automatically brand it as a political issue. They alone might as well characterize it as philosophical, artistic or simply iconic. Free Software is political because it is strongly tied with a deep political question: that of education, and access to it.

Every modern society claims to strive for the welfare of its members. All political parties implicitly project this as their primary goal; one’s idea of ‘welfare’, ‘member’ and the means to accomplish this goal differs, but a handful of ideas is common in the rhetoric of all bands of the political spectrum. Predominate among them is that primary and secondary education (at the very least) should be freely available to all.

The thought of education as a few hours in the classroom with a teacher lecturing to a group of students is awfully obsolete. Education is a continuous, blended, all-encompassing process. Access to and manipulation of information is a crucial part of the learning process. It is the obligation of every modern society to guarantee and safeguard the access of its members to information; this is a direct result of its obligation to guarantee access to education. A large portion of the information we draw upon to learn from is nowadays digital; in the future the vast majority may very well be so. Software is the means of accessing and manipulating that information, an increasingly large portion of which is generated outside the classroom walls or even the entire state-sanctioned education system. Imposing barriers to its use not only misses the point of education, it strangles it.

One might grudgingly argue that this issue can be addressed by adhering to open standards and open formats; surely that would be enough to ensure universal access to information without having to go all the way to Free Software, right? Wrong! Obviously open standards and open formats are a necessary prerequisite, but they are not enough. Alone, they are analogous to claiming that filling a library with books written in your native language, so that everybody can read them, and then charging a hefty entrance fee, promotes access of children to knowledge. So free of charge tools to access and manipulate information is also necessary. But why Free, as in freedom of thought? Why Free Software and not just free of charge open source? Or even free of charge proprietary software?

You can read two great articles that support this: Richard Stallman’s Why schools should exclusively use free software and Jean Peyratout’s Why give precedence to Free Software at Schools. To summarize them, Free Softwares helps students assimilate and generate knowledge, instead of simply acquire technical skills; it offers education, instead of training. It helps build communities, and promotes (actually depends on) discussion, cooperation, initiative and active participation to the development process. In an increasingly expanding digital world, it embodies the ideals of education.

May 22, 2009 Posted by | Free Software | , , | 29 Comments

Debugging and profiling your C/C++ programs using Free Software

Every developer in Linux knows (and most likely uses) the GCC, a set of compilers, tools and libraries that form the foundation of pretty much all C and C++ development in the FOSS world. However, fewer people, even among professional software developers, are aware of the superb debugging and profiling options available to them.

Before introducing new tools, I will first talk about a few gcc options. Note that several GCC options change with each release. I am using 4.3.3; if something doesn’t work for you, check the documentation for your version.

Let’s begin with a few compiling options that will help you detect errors at compile time. This means less debugging will be needed in the future, which is always a Good Thing.

-Wall

Enable most warnings. According to GCC’s man page,

“This enables all the warnings about constructions that some users consider questionable, and that are easy to avoid (or modify to prevent the warning), even in conjunction with macros.”

Note that as of version 4.3.3, two of the most powerful features enabled by -Wall, warnings about uninitialized variables use and out of bounds array checking will only work if you specify an optimization level (-O1 for uninitialized variables, -O2 for array bounds checking). This is planned to change in future GCC versions.

It is generally suggested that all your programs are compiled with the -Wall option enabled. My suggestion is to also compile your program with -O2 to let GCC test for uninitialized variables and out of bounds array use; turn it off afterwards if you wish to have full access to debuging info.

-Wshadow

Warn about shadow variables. Shadow variables (i.e. variables declared inside an inner block with the same name as a variable already existing in the scope) are valid in C/C++, but they are quite error prone. You should avoid using them; this compiler option will help you track unintended use.

-Werror

Treat warnings as errors. This will make the compiler treat all warnings as errors, interrupting compilation. Specific warnings can be exempted from this flag. A common example is using the -Wno-invalid-offsetof flag to supress warnings about using the offsetof() marco to reference member variables of uninitialized objects.

The following flags are related to debugging and profiling:

-g

Generate debugging info in the operating system’s native format. You can use the GNU debugger (gdb) to debug programs compiled with the -g option. Note that even though you can generate debugging info for programs compiled with an optimization (-On) option, debugging data will be less informative.

You should always use the -g option when developing your programs; you can turn this off in your final product.

-pg

Generate profiling info. When running a program compiled with this option, a file named gmon.out will be generated, containing profile information; you can use the GNU profiler (gprof) to analyse this file. Note that the -pg option must be specified both in compiling and in linking options. Personally I never use -pg; I prefer the profiling tool of valgrind, which I will mention later in the article.

As I mentioned, you can use the GNU debugger (gdb) to debug a program compiled with the -g option. An extended description of gdb is beyond the scope of this post; you can check one of the numerous tutorials available on the Internet. However, a few points of interest:

  • You can debug a running process of an executable. Use ps to find the process id (pid) of an executable, run gdb <executable> to begin gdb, and use the attach <pid> command to attach gdb to the running process.
  • You can debug an executable based on a core dump. Simply run gdb <executable> <core>. Note that nowadays programs will not generate a core when they crash, unless the ulimit -c option has been specified in the shell. This is done for security reasons, as an unintented core file can be used to hack into a program. Do not forget to enable this option when developing.

There are several graphical front-ends to gdb available. I prefer to work from the command line, since most of the time I’m debugging remote programs using a terminal window. However I have found kdbg to be an excellent front-end. Here is a screenshot:kdbg - A graphical front-end to gdb

Other available options include ddd, xxgdb and nemiver. Most C/C++ IDEs, such as Eclipse, Netbeans,  KDevelop and Anjuta also contain integrated front-ends to gdb. However getting familiar with the core gdb functionality outside an IDE is probably a good idea.

Valgrind, which I already mentioned earlier, is an invaluable set of tools to anyone dealing with non-trivial debugging and profiling. The platform currently contains the following tools:

  • A memory error detector
  • Two thread error detectors, including race conditions
  • Three profilers: cache and branch-prediction profiler, call-graph generating cache profiler, and heap profiler

Extended documentation on the various tools is provided on http://valgrind.org. Here I will display examples of my favotire tools: the memory error detector, and the call-graph generating cache profiler.

Consider the following trivial and utterly useless program:

#include <string.h>
#include <stdio.h>

void myfunc( const char *arg )
{
    char *p, *ptr;
    ptr = strdup( arg );
    /* process ptr here, but forget to free memory */
}

int main( int argc, char *argv[] )
{
    myfunc( "hello world" );
    return 0;
}
Checking this program with valgrind will reveal the memory leak:
xenofon@umbra:~/tmp$ valgrind --track-origins=yes --leak-check=full ./a.out |tee valgrind.out
[...]
==21882== 12 bytes in 1 blocks are definitely lost in loss record 1 of 1
==21882==    at 0x4026FDE: malloc (vg_replace_malloc.c:207)
==21882==    by 0x40BB34F: strdup (in /lib/tls/i686/cmov/libc-2.9.so)
==21882==    by 0x80483D4: myfunc (in /home/xenofon/tmp/a.out)
==21882==    by 0x80483F6: main (in /home/xenofon/tmp/a.out)
[...]

In non-trivial examples this alone can be a big saver. But the memory check of valgrind is MUCH more than this. Consider the following example:

#include <iostream>
#include <string>
using namespace std;

class Person {
private:
    string name;
    int age, sex;
public:
    enum { MALE, FEMALE };
    Person( string name, int age, int sex )
    {
        this->name = name;
        this->age = age;
        //this->sex = sex; /* we forgot this! */
    }
    void Print( )
    {
        cout << "Name: " << name << endl;
        cout << "Age : " << age << endl;
        cout << "Sex : " << ( sex == MALE ? "Male" : "Female" ) << endl;
    }
};

int main( int argc, char *argv[] )
{
    Person p( "alphamale", 32, Person::MALE );
    p.Print();
    return 0;
}

Valgrind will catch the error:

[...]
Name: alphamale
Age : 32
==22871== Conditional jump or move depends on uninitialised value(s)
==22871==    at 0x8048BCC: Person::Print() (in /home/xenofon/tmp/a.out)
==22871==    by 0x8048A5B: main (in /home/xenofon/tmp/a.out)
==22871==  Uninitialised value was created by a stack allocation
==22871==    at 0x80489D0: main (in /home/xenofon/tmp/a.out)
Sex : Female
[...]

Even though this example is also trivial, using uninitialized variables is an extremely common mistake. The -Wuninitialized compiler option of gcc (which is automatically included if you specify the -Wall flag) will help in some cases, but not all. It will not detect the above case, and it certainly cannot detect any case that can only occur at run-time. Valgrind checks all the allocated memory at bit level, and issues a warning when you attempt to use uninitialized areas.

Valgrind can also be used for profiling. I commonly use the call-graph cache profiler to generate profile data which can be analyzed by specialized tools. First, ask valgrind to use the appropriate tool:

xenofon@umbra:~/program/arctic/server$ valgrind --tool=callgrind ./server 2702

Once the program terminates, a file named callgrind.out.<pid> is generated. This file contains the profiling info of your program. If your program forks, a seperate callgrind.out file is generated for every child, distinguished by the pid extension. You can then use the amazing kcachegrind tool to inspect the info:

kcachegrind

Kcachegrind lets you inspect CPU time spent in each function and all its subroutines, navigate through the call graph, check a list of callers and callees, and is generally an invaluable tool to detect bottlenecks in the performance of your program. Furthermore, it is extremely user-friendly. Give it a try, you will love it.

Obviously there are several more tools to help you debug and profile your C/C++ programs. Furthermore, debugging and profiling, just like all programming, is more about the process than the tools. However, once you learn to make them part of your programming activities, you will happily find out that there are several superb free software tools to support your endeavours.

May 18, 2009 Posted by | Programming | , , , , , , , , | 12 Comments