Python Celery Asynchronous Task Decorator

A while ago I was working on a project in Django that had many tasks that needed to be executed asynchronously such as sending emails, generating reports, and checking some database related issues. Executing asynchronous tasks in Python can be made in multiple ways, one of them is using celery, a distributed task queue written in Python which has proved itself to be a great solid task queue system. And if you’re using Django then there is a Django app to make your life easier, django-celery. Now as always I like to make my own life easier also by implementing generic solutions for my needs, so I have written this simple piece of code to create a function decorator that declares the function as an asynchronous task, which means that by just adding this decorator to the function it becomes asynchronous. ...

October 10, 2012 · 4 min · Abdullah Diab

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: It is written from right to left. 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 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. ...

May 10, 2012 · 3 min · Abdullah Diab

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. ...

December 15, 2011 · 3 min · Abdullah Diab

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. ...

December 12, 2011 · 5 min · Abdullah Diab

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: A Tribute to Mahmoud Darwish iCommunity Introduction Introduction Problem Definition Introducing Version Control System Definitions How it works Introducing SVN How to SVN: Hosting Projects. Local Servers. Installing TortoiseSVN. Basic Operations Advanced Operations. Conclusion ...

October 19, 2010 · 1 min · Abdullah Diab

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 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. ...

September 27, 2010 · 7 min · Abdullah Diab

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: ...

May 25, 2010 · 4 min · Abdullah Diab

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. ...

March 30, 2010 · 3 min · Abdullah Diab

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) ...

February 15, 2010 · 2 min · Abdullah Diab

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) ...

February 12, 2010 · 2 min · Abdullah Diab