[Cakephp] Save multiple associated data

In a one to many relationship, say a question to answers, and I am using javascript to add some answers to the question. It’s best to add the answer fields as follows in the views (replace 0 with a counter variable or something)

<input name="data[Answer][0][answer]">

and make use of the save associated in the controller’s function that handles adding the question as



الحمد لله استلمت شهادة الاعفاء النهائي من الجيش النهاردة ودى الاوراق المطلوبة فى الحالة التالية فقط: وحيد والديه والاب متجاوز ال60

ستحتاج الى

1. صورتين من البطاقة
2. صورتين من بطاقة الوالد
3. قيد عائلي مميكن (كمبيوتر) وده بيطلع من القسم اللى انت تابع ليه وميعديش على تاريخ صدوره 3 شهور
4. بطاقة ال6 جند او لو ضاعت ال7 جند اللى هى البدل فاقد
5. شهادة زواج والديك كمبيوتر – ساعات بيبصوا عليها فخدها معاك احتياطى

تحط الكلام ده فى فايل او دوسيه زى ده

وتاخد معاك قلم جاف ازرق وتروح بدري .. النظام فى الرماية كالتالي
1. الباب بيفتح سابعة صباحا فالاحسن تروح من 6 او 6.30 عشان الطابور بيبقى زحمة عالباب
2. اول مالباب يفتح تدخل على المجمع على طول (اول شمال زي مالعسكرى هيقول) تاخد رقم وده اهم حاجة
3. تروح على النماذج (قدام المجمع الناحية التانية) تجيب كشف عيلة
4. ترجع المجمع تانى  وتملى الورقة الصفراء من القيد العائلي .. كشف العيلة بحوالى 20 جنيه
5. لما الشباك يفتح هتلاقيهم بياخدوا مجموعة دوسيهات مع بعض يخلصوهم .. مثلا ياخدوا 10 دوسيهات يخلصوهم ياخدوا ال10 اللى بعدهم وهكذا عشان كده ضروري تروح تاخد رقم بدرى

استلام الاعفاء خلال 3 ايام عمل عادة بس ساعات بتطلع اسرع من كده والاحسن انك تروح بعد ميعادك بيوم عشان تستلم اول متروح ومتقعدش ملطوع ساعة

The big escape

So I’ve been depressed since last May – Not “literally” depressed (with suicide and all), but never been that sad in my life. Anyway, one of the main properties/features in my personality is that, I relate. I relate everything to everything. Let’s say If I went to a place and bought something that turned out to NOT be as expected, that item is related to the place – both marked as not good enough.

Nowadays, the reason for my sadness is kind of related to the last 3 years. Every single place I’ve been to, friends I met, and even my one time abroad trip – I can relate everything. That lead to, what I call, the big escape. I am avoiding all places that I used to hangout at, got involved in a couple of new activities (I go to the gym now – not regularly but I started), got a job after graduation, planning to not going to my graduation ceremony, thinking about leaving the country and having my masters degree abroad for a couple of years, and others.

Although that is not a solution and is not what a strong person would do, but that turned out to be a very good solution – yet, it takes a lot of time and a lot of, how to say it in a non-ceec way, pain(?). My main problem now is that, people got involved. I am not only avoiding places, I started to avoid people. Just because some of them may (and may not) remind me – just by looking in their face – with some moments. I am avoiding gatherings and a lot of  group hangouts just because they’re at places that I won’t go to, for now. That, unfortunately, led to disappointments and ignorance from my friends and colleagues side. That is exactly what used to happen about 8 years ago – but harder.

The good part is that – I will turn out a better person out of all this isA. Never been that close to Allah as I am now, and I won’t go back to any previous state isA. Ya Rab.

Using Facebook PHP SDK 3 with CodeIgniter 2.1

To access the Facebook API, there exists the Facebook PHP SDK to simplify the process. I needed Facebook OAuth in one of my projects using CodeIgniter but had some hard time trying to get it done. I faced a lot of errors, the main one though was that: getUser always returns 0. I found out that this is pretty much popular on stackoverflow and other websites – each proposing different solution. In this post, I try to organize all the steps and collect them in one place. References and downloads are provided at the end of the post. Continue reading

Zakerny Bellah

@Zakerny_Bellah is a twitter bot that tweets an “Islamic prayer” every one hour. It’s developed by my friends and I. It’s done using a PHP Twitter API wrapper and Cron Jobs.  It’s inspired by an iPhone application – was intrduced to it by a friend – that has the same name and all the other bots out there that does the same thing. It’s implemented because when I came to think: How did I use my knowledge to do something useful for the community? – the answer was, unfortunately, none.

Salma Hamed
Dina Helal
Mohamed Ibrahim
Ahmed Mostafa

Use Python to parse Microsoft Word documents using PyWin32 Library

Python is like a disease. Once you start coding, your skills with other languages’ syntax will be heavily affected. Anyways, that’s not the topic.

Last year, I had to grade about 50 word documents by following a grading scheme. I spent an approximate of 3 hours grading the documents and was pretty much frustrated. A couple of days ago while learning python, I decided to learn it while developing an application and the first thing that popped out to my mind is to automate the grading process. So, after following Hadeer’s tutorial on how to install python on windows I started to develop the application.
Continue reading

[jQuery plugin] G-Filter

I’ve never been good at Javascript. However, in the last couple of projects I had to write a Javascript (with jQuery of course) function that filters a given list based on the user’s input with minor changes. Although it’s simple for most of the developers out there but it’s boring and there is no point in writing it over and over again – even copy and paste is not sufficient. Therefore, I decided to learn something new and benefit from it. That is, I converted my function to a general jQuery plugin – called ‘G-Filter’ – that would save me some time in the future. I am not planning on updating or enhancing it still ideas might come up later on that would be added.

Here is a link if you want to check it out: https://code.google.com/p/g-filter/