February 19, 2013
الحذاء وطبق الكريستال
قصة للأطفال، تحكي عن حذاء جديد يتسخ من اول استخدام مما يجعله عرضة للسخرية من قبل صحن الكريستال.
بعد فترة يمل الطبق من السخرية ويبدأ الحديث مع الحذاء عن كيفية تعرضه للاتساخ، ويبدأ الحذاء بالحديث عن مغامراته اليومية خارج المنزل، وكيف انه يفيد صاحبه كل يوم.
بعد ما تشبعت مخيلة الطبق من مغامرات الحذاء اليومية بدأ يحس بمدى تفاهة حياته، وحاجته لان يكون مفيداً أكثر من الاستخدام النادر عند قدوم الضيوف.
February 10, 2013
My First Makefile
The following is a sample Makefile for simple project, here I am building a simple “Bloom Filter” library, and “main” program to use it.
The library will have the following files:
hash.h and hash.c bloom.h and bloom.c and we should get “libbloom.a” out of it.
The “main” program will use:
main.c bloom.h libbloom.a and we should get “main” executable. So our make file should look like this:
February 3, 2013
Minimal Django Project: Part 2 … Flat Pages
In this step we will setup the Flatpage App, Flatpage allows you to create simple static pages from the Admin interface:
**mycms$ mkdir templates** **mycms$ vi mycms/settings.py** : MIDDLEWARE_CLASSES = ( : # Add Flatpage Middleware 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', ) : TEMPLATE_DIRS = ( : '/Users/rayed/python/mycms/templates', ) : INSTALLED_APPS = ( : # Add Flat Pages App 'django.contrib.flatpages', : ) : **mycms$ vi mycms/urls.py** : # Your other patterns here # SHOULD BE THE LAST RULE urlpatterns += patterns('django.
February 3, 2013
Minimal Django Project: Part 1 … First Run
Update: Django 1.6+ don’t need any of these steps! it will work out of the box.
The following is the shortest way to create DB backed Django project, it uses SQLite as a backend, which make the setup very easy and fast.
I usually use for testing new Django modules or apps.
**$ django-admin.py startproject mycms** **$ cd mycms** **mycms$ chmod +x manage.py ** **mycms$ vi mycms/settings.py ** import os PROJECT_ROOT = os.
January 23, 2013
PostgreSQL: New Project Setup
For each new project that need PostgreSQL you should create its own user and its own DB, the following are the steps need for that.
Installation $ sudo aptitude install postgresql $ sudo aptitude install python-psycopg2 # For Django access Require a Password $ sudo vi /etc/postgresql/9.1/main/pg_hba.conf : #local all all peer local all all md5 : $ sudo service postgresql restart Create Postgres User $ sudo -u postgres createuser -P my_user Enter password for new role: Enter it again: Shall the new role be a superuser?
January 14, 2013
My Python and Django bookmarks
This a list of Django and Python websites I found useful, I hope you find it useful as well, and may be add to it in the comments:
Django | Django documentation | Django documentation The Django Book Django Packages : Django Packages reusable apps, sites and tools directory 170+ Django conference videos | Equally True ubernostrum / django-registration — Bitbucket GoDjango.com – Going Through Django Screencasts Sourcefabric | Django Software Stack Drupal or Django?
November 11, 2012
Japan Trip Photos
In October 2012 I visited Japan with my lovely family, overall Japan was great country to visit, and I will be writing more extensive post about my visit, mean while I hope you enjoy my photos.
Flickr Japan Set
/* Images are wrapped in divs classed "flickr_badge_image" with ids "flickr_badge_imageX" where "X" is an integer specifying ordinal position. Below are some styles to get you started! */ #flickr_badge_uber_wrapper {text-align:center; width:260px;} #flickr_badge_wrapper {padding:10px 0 10px 0;} .
June 15, 2012
Supporting right to left writing (for Arabic) in WordPress (Updated)
UPDATE: I found an easier way to do the same thing Check it out
This post is an update of previous old post: Supporting right to left writing (for Arabic) in WordPress
In my blog I write in both languages English and Arabic, but I have to switch text direction from the template default English direction “Left to Right” to Arabic “Right to Left”. One way do to it is to add HTML tags in each Arabic entry.
June 8, 2012
Kiva systems: innovative warehouse robotics
Kiva Systems is a company that makes order fulfillment systems that use mobile robots for warehouse automation. Its material handling systems are used by Staples, Walgreens, GAP, Crate and Barrel, Toys “R” Us and Gilt Groupe, among others.
Wikipedia Kiva Systems
Amazon bought them for $775 million, you must watch the videos!