Programming Archive

  • Compiling Ada with GCC in Ubuntu

    Compiling Ada with GCC in Ubuntu

    A helpful guide for college students out there just getting their feet wet with ADA.

    Full Story

  • Tip of the Day: Run a C Program Directly

    Tip of the Day: Run a C Program Directly

    For this short tip you'll need tcc, the Tiny C Compiler, which comes with most distributions out there, including Debian and Ubuntu. tcc is a small ANSI C compiler which offers the ability to run the program after compiling it, unlike GCC, which (as far as I know) doesn't offer this option. To install tcc in Debian and Ubuntu:

    In Debian, as root:

    apt-get install tcc

    In Ubuntu, use:

    sudo apt-get install tcc

    Now let's test this. First, create your C source file, e.g.:

    #!/usr/bin/tcc -run
    #include <stdio.h>

    int main ()
    {
    printf ("Hello, world!\n");
    return 0;
    }

    Now, save this file as example.c or some other name and make it executable:

    chmod 755 example.c # or chmod +x example.c

    And the next step is just to run it!

    ./example.c

    tcc will compile the source and run it automatically.

    Full Story

  • Practical Python Programming #1

    Practical Python Programming #1

    Welcome to my Practical Python Programming post, hopefully this will be the first of many. If you have been following my 'An Introduction to Python Programming' posts series, then you may already know that in this post we are going to be having some fun. We are going to be creating a text based 'Guess the Number' game.

    Full Story

  • An Introduction to Python Programming #4

    An Introduction to Python Programming #4

    Welcome to my forth Python Programming introduction post. In this post we are going to be looking at lists and random numbers.If you have used another programming language before, then you have probably heard of an array, well, a python list is just an array, and in the same way you can have multi dimensional lists.

    Full Story

  • An Introduction to Python Programming #3

    An Introduction to Python Programming #3

    Hi, welcome to my third Python programming introduction post. In post #2 we looked at the basics of flow control using conditional statements. In this post we will be taking a look at another fundamental aspect of flow control; loops. A loop is a way of running a particular block of code more than once [...]

    Full Story

  • An Introduction to Python Programming #2

    An Introduction to Python Programming #2

    Welcome to my second python programming post. In the first post we looked at the print statement used to print to the screen, and we also looked at basic user input via the raw_input() function. We also looked at basic variable declaration and useage. In this post we will be taking a look at some [...]

    Full Story