Abdullah Diab’s Blog

  • Python Arabic Text Reshaper

    I was trying today to generate PDF reports using Geraldo Reports and I needed to generate reports with Arabic text in them. Arabic is a very special script language with two essential features:

    1. It is written from right to left.
    2. The characters change shape according to their surrounding characters.

    So when you try to print Arabic text in an application – or a library – that doesn’t support Arabic you’re pretty likely to end up with something that looks like this:

    Arabic text, broken, left to right

    Arabic text, broken, left to right

    We have two problems here, first, the characters are in the isolated form, which means that every character is rendered regardless of its surroundings, and second is that the text is written from left to right.

    Read more…
  • Android Map View With Pan & Zoom Events

    I was working an Android application, and I had an activity that contains a map in it, the map is hosted inside a MapView. The application had to show some pins over the map, the pins locations are obtained from a web service. I had to retrieve the pins locations after the user pans the map or zooms in or out.

    Google didn’t provide events for panning and zooming inside MapView class, but you can extend the class and do it your self, and that’s what I did.

    Read more…
  • Log to a file on computer in Android

    It’s been a long time since the last time I blogged about something, and many things have changed since then,

    I graduated, got engaged and moved to Dubai.

    I have plenty of things in my mind to blog about, many solutions and many tools that I developed that I’d like to share it with everyone, but I haven’t settled down, and my schedule is not stable yet, so I haven’t got enough time to sort things out and start blogging, anyway this post is simple and it doesn’t need much description so I thought I’d share it with you now.

    Now let’s move to business, so I was working on an Android application and I needed to log some debug messages, normally I’d use Log.d(TAG, message); and this will send the message to logcat, but logcat is not useful for long messages, like for example if I needed to log the response I received from a web service, this response might be long and sending it to logcat will truncate it.

    Read more…
  • Collaborative Software Development with SVN Lecture

    Today I gave a lecture in my faculty about “Collaborative Software Development with SVN”, it was prepared and set by the collaboration of iCommunity, Syrian Computer Society and Damascus University.

    The lecture included the following points:

    1. A Tribute to Mahmoud Darwish
    2. iCommunity Introduction
    3. Introduction
    4. Problem Definition
    5. Introducing Version Control System
    6. Definitions
    7. How it works
    8. Introducing SVN
    9. How to SVN:
      1. Hosting Projects.
      2. Local Servers.
      3. Installing TortoiseSVN.
      4. Basic Operations
      5. Advanced Operations.
    10. Conclusion

    Read more…
  • Google Buzz, OAuth And Python

    Google Buzz is a social networking and messaging tool from Google Inc. that’s integrated into GMail. Google Buzz was released in early February this year (9th Feb 2010), and since then it has emerged as an important social network for GMail users, and many people (including me) prefer it now to other social networking platforms such as Facebook.

    Logos of Google Buzz, OAuth And Python
    Logos of Google Buzz, OAuth And Python

    In May Google revealed the Buzz API to the public so developers around the world could write applications to interact with Google Buzz to read and/or write.

    Read more…
  • Google Talk Status Countdown

    A few days ago I was counting down to a presentation in my faculty. As I was setting counters all over my world (Side Bar Gadget, To Do List) I thought of a way to change my Google Talk status to a counter also.

    Since I know that Google Talk uses XMPP protocol, and since my friends and I implemented XMPP last year in our faculty I tried to make a program to set my status to a counter; and here is the result:

    XMPP Status Changer

    Read more…
  • Display Sub-terms In Drupal Term Page

    After working with Drupal in the last two months I’ve really got used to searching for modules for every problem I face and installing them.

    While I was working on iCommunity website, I was creating taxonomy terms to categorize the files using them. I created terms with sub terms. The problem was that when browsing a specified term the term page doesn’t display the sub terms of that term.

    Read more…
  • Simple AJAX Comment Preview in Drupal 6

    As I said in my previous post, I’m working on upgrading Computer Science in Syria website to Drupal 6.

    I wanted also to have AJAX comment preview in nodes, but I wanted it to be simple without lots of JavaScript loaded. So as usual I got pissed off and decided to create my own code to do it. 8)

    Read more…
  • Simple AJAX Quote in Drupal 6

    I’ve been upgrading the forum of Computer Science in Syria for a week now.

    The forum uses Drupal, and it ran a beta version of Drupal 4, and I upgraded it to the latest Drupal version now.

    I wanted to have AJAX quoting in the forum, but I wanted it to be simple without lots of JavaScript loaded. So as usual I got pissed off and decided to create my own code to do it. 8)

    Read more…
  • Notepad++ Plugin To Run Python Scripts

    I use Python everyday, it has become my first tool to use when I need to do anything. In Arabic (in Syrian Arabic specifically) I’d say that Python has become my hand and leg 😛

    Yesterday I was writing a small Python script to read the YACC file and generate a list of all the specified rules inside it, so I don’t have to scroll through the long file to find out what rules are inside it 😉

    I use Notepad++ as my default text editor on Windows, and I was writing the script using it – Notepad++. I wanted to test if the script is working, so I ran an instance of Command Line Prompt, and as I was going to change the directory to the directory of the script I thought; “Why doesn’t Notepad++ have a Run In Python command in it?”. So as usual I got pissed off and decided to create my own plugin to have that command in Notepad++ 8)

    Read more…