Thursday, July 9, 2009

Pythonic way to do static local variables

If you are using C++ or Java, you man have used static local variables to define variables that would retain its value between function calls.

In python there is no obvious way to do it, and you need to exploit some hidden python characteristics, namely function/method attributes.

If you need that trick with a function (not bound to an instance) it is rather straight forward:

def foo():
# foo.x is like a C static
try: foo.x +=1
except AttributeError:
foo.x = 1
return foo.x
for i in xrange(10): print foo()

If foo() is an instance method the straight froward way would have been to use an instance variable of the container class to hold the value for you, but that would pollute the instance namespace with variables of special needs and never used outside the method scope.

You can still do something similar to the trick above but it becomes a little more cumbersome.

Firstly because you have to refer to the class name, e.g. Bar.foo.*

Secondly and (less obviously) because user defined attributes are not allowed in instance methods!

I don't like as much as you do but it is a fact of life, read more here;

thus you'd have to refer to the wrapped function referenced by the method instance attribute im_func:

class Bar(object):
def foo(self):
try: Bar.foo.im_func.x += 1
except AttributeError:
Bar.foo.im_func.x = 1
return Bar.foo.x
foo = Bar().foo
for i in xrange(10): print foo()

You may argue that it is not an intuitive syntax, may be you are right, I only did it for the kicks :)


Monday, July 6, 2009

Kindle for IPhone now in Egypt

I love reading, paper book reading, where you can carry your book around, toss it anywhere, read while walking, or even read in the bathroom ... Working in the Software business made EBook and PDF reading on my PC is a must but was never as enjoyable as the intimacy you experience while holding your book
That's why always admired Kindle, Amazon's 6" Wireless Reading Device. It is really amazing, design and technology, if you don't know what is Kindle take a look here
What is amazing about it is the natural book feel
ing and the revolutionary electronic paper display


It has been on my wish list since its release in early 2008, but I live in Egypt, and we learned a lesson from our great great ancestors, the Pharaohs that you can (and in our days will have to) take your wish lists to the grave!! Kindle is supported in the US and that is it, if you live in the God forsaken parts of the Universe (which is in short outside the US) you can't have it. Of course nothing is perfect and you can argue a lot with Amazon's decision regarding the restrictions and the business model they follow with their Kindle.

A couple of days ago I was thrilled to find the Kindle for IPhone app, I downloaded the application without second thoughts and chose a sample of a book I was interested in, reading on the IPhone using this app was a rich experience and I enjoyed my 1.5 chapters of the book, now I want that book and I'm willing to pay the 8.99$ to get it on my IPhone, of course you can purchase it on Amazon used for 2.99 and up, and get free shipping with Super Saver ... but, uh, yeah, I remembered ... I live in Egypt! so shipping that 2.99 book will cost in total over 12$ so wireless shipping seems appealing.
I setup a new Amazon account, with an Egyptian Shipping Address (in case of future paper pack books shipping), and used my online credit card, typed in my Egyptian Billing address, configured 1-Click Shopping in Amazon and I'm ready to pay! !ERROR! "We are sorry ... we could not process your order because of geographical restrictions on the product which you were attempting to purchase ... blah blah blah"


"Ok, it is another one of those stupid restrictions because of the Shipping or the Billing address, or may be my online credit card has Egyptian origins and that makes it not good enough for online shopping!" I thought ... tried changing both addresses with no luck, so now it is either the credit card or the IP address I'm using to access the divine Amazon website, that should be easy. I accessed amazon using a new account from a Terminal Service on a remote machine in Europe and the same error message is there, provocatively staring at me, challenging me, depriving me from a simple item on my wish list, and dooming me with the same Pharaohs destiny of taking it along to the grave ... I searched around until I found this great tip on this blog of a fellow kindloholic in South Africa. It gave me some hope in the form of creating an account with a US shipping and billing address, NO credit card info and using an Amazon Gift Card to charge your account with the required amount of money. Can be risky but worth a try, logically a new account using a gift card shouldn't be considered 3rd-world and be deprived the luxury of reading on the go.


I purchased a Gift Card, and to add humor to the pain I personalized it with:

From: myself
To: myself
Message: Enjoy Kindle or lose a hard earned 10$ :)

Just to be sure, I used a different account to purchase the Card than the one I'm linking to my IPhone, got the redeeming code, charged my account with the 10$, trembling I clicked the 1-Click shopping and, YES! it works, I'm officially Kindled ... I was amazingly grateful that Amazon toke my money, thank you Amazon, I'm speechless ... you f*@%#ers
Now I have a Kindle book, have my IPhone and have my account balance reduced by 10$ plus fees ... I should be reading happily ever after

Sunday, July 5, 2009

Why and How to import Wordpress blog into Google's Blogger?

Why migrate from Wordpress.com to Blogger?

Wordpress is an amazing blogging framework that enables you to do a lot ... speaking of wordpress.org as a framework that you would install and host somewhere and be free to manipulate it, install plugins and addons and map your domain to your hosted blog, wordpress.com is a yet another story ... here are the shortcomings:

No free domain mapping

I was shocked after setting up my blog to know that wordpress.com won't allow me to map my domain www.shadyyoussef.com unless I purchase wordpress credit points, read the details here

No Plugins

You can't install any plugins or widgets unless from the wordpress.com collection, which is fairly good, they even have a cool widget for Twitter, still you feel bounded. They make a clear distinction between the power and flexibility of the wordpress framework, that you get by privately hosting wordpress.org software and having a blog on wordpress.com, read more about that here

Can not monetize

Like any other blogger I hoped to get some minor cash from the adSense and the like plugins, usually the cash is trivial but it pays for your domain costs at least. Wordpress.com doesn't allow any kind of ads that are linked to your account. That is fine for me, to have an Ad-Free blog is cool, but there is no guarantee that wordpress won't swamp my blog with Ads for their own profit at any point of time, and what is in it for me?, read more here

wordpress-to-blogger-blog

How to import your existing blog entries into Blogger?

For the above reasons, and the belief that Blogger blogs would have better google ratings, because I'm sure that google crawlers are not 100% fair and square indexing external content and there must be some favouritism to google platforms :) ... (I know it sounds like conspiracy theory but I think it is true) I decided to migrate my blog from wordpress.com to Blogger ... only to realize that however wordpress.com guys are smart enough to allow auto import from Blogger to wordpress, the reverse is not supported by Blogger ... too bad Google, you should have known better ...

After few hours in search and weighing the options, being extremely reluctant to do that migration manually, I found more that one tool ... one Java Swing desktop tool that doesn't work, I landed on this online app that does the conversion from the xml files you export from wordpress.com to the format that blogger can import, that neat app can be found here ... my first attempt was a failure, it did convert the xml files to "something" but Blogger refused to import that, with an error, it could have been blogger's problem or the tool's problem, we can't be sure.

My second attempt was a success, I was thrilled to see all my blog posts and comments, even the draft entries listed there in the import wizard for blogger. I selected all non-draft and hit "Publish" ... but that failed again. Now I think Blogger was the one to blame in the initial failure

Here is what you can do about it, select and publish your entries one by one, works like a charm. The entry is even published with its original date, same applies for comments ... after a few minutes and 34 clicks I had my blog up in Blogger restored in the exact state ... Me Happy

From this point on I'll be mainly posting to my Blogger blog, mapped to my domain www.shadyyoussef.com ... I admit that blogger's styles and templates looks a bit 90's to me but don't forget that you have the chance to manually edit the style sheets and import your own templates, which is great

Thursday, July 2, 2009

Thursday, June 25, 2009

Move from Nokia to IPhone with style, thanks to Google Mobile Sync

I'm continuing to enjoy my newly unlocked IPhone 3G and tonight I started to snap out of the fascination and set out to sync all my contacts and calendar entries from my (now old and obsolete and dull) Nokia N76 to my IPhone, I had a very simple strategy in mind, sync the Nokia with PCSuite on Vista, and Sync that back to IPhone using ITunes. Unfortunately it wasn't that simple ...

On Vista PCSuite sync's your contacts with Windows Contacts which is stupid and dull and so 1990's, but the real issue for me is that it drops information while syncing, specifically if a contact has more than one mobile number it just syncs the default one, and it does the same with home numbers, a limitation that you simply can't live with because nowadays everyone has a mobile number for business hours, mobile number for evenings, mobile number for weekends, you name it ... and if you care to stay connected you got to keep all those

I thought that this can be a good time to explore the world of OTA (Over The Air) Syncing of mobile data, and I was reasoning that if I managed to do that from my Nokia, there is a big chance that I can Sync back to my IPhone, a simple query on Google lead me to one of their new "Beta" services surprisingly enough named "Google Sync" :)

I started at this page, Google Sync fo Nokia S60 and panicked at the fact that if I would setup Google Sync, I will not be able to sync anymore with PCSuite afterwards without losing data or at least messing it up ... but I can do without that at the moment, after all it hasn't done me much good anyways. To make sure that I'm not loosing any information from my contact list (which is over 800 entries by the way and that makes it worth the effort) I started by doing a one time OTA Nokia-Compatible-Only Backup on OVI free OTA service just to be safe

Here are the steps to setup OTA sync for Contacts, Calendar, Tasks and (Soon) Mail on Google Sync for your S60



Get Google Sync on your phonenokia_smart_large



  1. Backup your data

  2. Download mail software

  3. Set up Google Sync



First few times I tried to Sync with Google from my S60 I got errors, obvious ones like "Server Error, please try again later", and another more subtle one like "your account doesn't have permission to sync with current settings contact your administrator" ... guess that referred to the server side account, I looked around on my Google Account for something that can be related to Sync permissions but didn't find any. After a short while and some perseverance in re-trying as advised by the first error ... it succeeded. I located some forums and blog entries talking about the Google Sync Exchange server not being stable at the moment

Now for the Easier part Syncing with IPhone, that is an easy one, and doesn't require any software installation or re-tries, here are the steps I followed:

Get Google Sync on your phoneapple_large



  1. Backup your data

  2. Set up your iPhone

  3. Learn about options and features


While setting this up, I chose to delete all contacts on the IPhone when asked, usually you are asked when you turn ON Contacts Sync, and the same applies for the Calendar, after finishing the configuration just open your IPhone Contacts app and wait for few seconds, Sync will start automatically provided that you enabled "Push" for the Exchange Account you created.

Now I have my personal Contacts and my personal Calendar Sync'd with my personal Gmail account, life should be pink enough, but not for me ... My expectations are now raised and I wanted to do the same with my Business email account, hosted also on Gmail Business mail, but life can't be perfect ...

There is a limitation that you can only setup ONE and only ONE Microsoft Exchange account on your IPhone, so here goes my dream, I reduced my expectations and wanted to overwrite the Exchange account settings for my business email and choose to Sync my business Calendar only, such that I have my personal Contacts (Sync'd once in the begining and left in peace) and my business Calendar (actively syncing) on my IPhone, so I tried to switch off the Contacts Syncing now in order not to delete or mess up my happily stashed 800 contacts, but if you do so IPhone tells you that if you turned it off all contacts on your IPhone would be deleted!! didn't find a way to work around this one yet ... again looks like life indeed can't be perfect

Still at least I have all my Contacts, and active Syncing is really cool, add, edit or delete either on the mobile or on your email account and the changes are reflected to the other side, another neat service from logo_sm

Tuesday, June 23, 2009

IPhone 3G firmware 2.2.1, BB 2.30.03, BL 5.9 UNLOCKED !

Finally and after a lot of waiting and frustration I unlocked my two IPhone 3G with the cursed 2.2.1 operating system, baseband version 2.30.03 that were not downgradable to 2.28 because both had Boot Loader 5.9 ... yes, I have 2 and got them separately from eBay and both were stuck and have been used as thick IPods for the past 2 months

I tried to get an Ultra SIM, I purchased one from a reseller in Mansoura, Egypt, here is their website http://www.gsmegypt.com/VB/index.php, they started by stating that it doesn't work for Mobinil Egypt SIM cards, not sure why ... then they got it to work once on a Vodafone Egypt line of their own, when I tried my own Vodafone SIM, it didn't work, taking the iPhone back to them they tried to re-program the Ultra SIM to work with my SIM card, but failed big time and they refused to refund the money, that attempt costed 70 EGP and a lot of time from my "Mansourian" colleagues, thanks to Ahmed Abdalla and Ahmed Soliman for the help in that. Bottom line is that I won't recommend that Ultra SIM to anyone, because it is not stable and it can register to your network for a while and later you would lose that and get back to the locked state.

Finally the Dev-Team guys released ultrasn0w, the unlock for IPhone 3G firmware 3.0, the previously blogged here that they are skipping the Bootloader 5.9 problem and had an unlock ready for firmware 3.0 but according to the cat and mouse game they won't release it until Apple has done its official release of the new IPhone 3G S fearing that if they would release it earlier Apple would notice the crash that allowed them to inject the unlock and fix it and they would have lost an important edge

so, here it is, and without further ado, the steps that I followed and redeemed my IPhone, quoted from the Dev-Team official blog with a couple of links added




Ultrasn0w for iPhone 3G is ready!

  1. Ensure you have upgraded to iPhone OS 3.0 (download the image here), press SHIFT while clicking on the restore button in iTunes then browse for the image file

  2. Jailbreak your iPhone 3G using redsn0w or PwnageTool (this will also install Cydia/Icy)

  3. Run Cydia or Icy

  4. Please add the repo repo666.ultrasn0w.com to Cydia or Icy. That last “o” is actually the number zero “0”! If you use the letter “o” you’ll get an error.

  5. Search for ‘ultrasn0w’ in cydia or icy and install ultrasn0w

  6. Reboot your iPhone 3G

  7. T-Mobile USA users should disable 3G before using ultrasn0w

  8. Enjoy



And I'm enjoying indeed


Big thanks to Ahmed Soliman for his support in this one as well, Soli, you are the God Father of my iPhone ;)

Sunday, June 14, 2009

Getting You Started with Python

I was introduced to the world of Python 18 months ago, and since then I love the language and always consider it my first choice and my fluent tongue, specially for fast prototyping or small to medium scale web development

A problem that many software engineers confront when they first come to python is that they are very occupied with (and religious to) their original tongue and they are trying to speak python with a Java accent or adding a C/C++ dialect to the language ... simply don't try to do that, you would only feel the beauty of a language and benefit from its strength when you surrender to its unique nature.

Long time ago when I was still struggling with my English, a teacher gave me a very useful piece of advice that helped me a lot since then, he said "if you wish to be a good English speaker, you got to THINK in English" ... he put a lot of emphasis on how harmful it is to your learning of a new language to think in your mother tongue and then translate the meaning to the new language, you would learn very slowly and your English will be also polluted with odd words and language constructs that are not applicable in such context.

I have a lot to say in this subject, but I thought it is better to share here some basic resources, blog entries, articles and videos that I used to learn to THINK in Python and allow you to be shaped by that literature first hand ...

Python is not Java (A must read if you have a Java background)

http://dirtsimple.org/2004/12/python-is-not-java.html
http://www.ferg.org/projects/python_java_side-by-side.html


Basics


Python home:
http://python.org/

Official Tutorial

http://docs.python.org/tutorial/

Are you using Eclipse, here is the Eclipse plugin for python development:
http://pydev.sourceforge.net/

Be Pythonic
http://wordaligned.org/articles/essential-python-reading-list
http://eikke.com/how-not-to-write-python-code/

Noteworthy Persons


Guido Van Rossom

Alex Martelli

Python on Youtube

a very soft introduction to python, by Alex Martelli, Author of the Oreily book "Python in a nutshell":
http://www.youtube.com/watch?v=bDgD9whDfEY (part 1)
http://www.youtube.com/watch?v=y7vwZ20SDzc (part 2)

python, a dynamic language for all kind of applications (Guido van Rossum):
http://www.youtube.com/watch?v=ImfbpMjpKe8

More advanced, Design Patterns in python (may be you would come to those later):
http://www.youtube.com/watch?v=1Sbzmz1Nxvo (part 1)
http://www.youtube.com/watch?v=tJXhtncDBu4 (part 2)

More and more advanced, in depth talks:
http://www.youtube.com/watch?v=VOzvpHoYQoo (python object model)
http://www.youtube.com/watch?v=23s9Wc3aWGY (python internals)

Guido talking about the new python, 3000:
http://www.youtube.com/watch?v=66NThkgfc1U

Python & Machine Learning

Peter Norvig talks to facebook engineers about Google translate and machine learning in general, and uses python code to demo his ideas

Have a good code

Monday, June 1, 2009

كويس, بس في أحسن من كده


حلو بس مش رائع" ... "شغال بس مش مميز" ... "عجبني بس مش مدهش", "عملتها بالظبط زي ما طلبت منك, مش أحسن" !!!

لو حظك المذكر حطك معايا في شغل, أكيد هتسمع مني جمل من النوع ده من وقت للتاني ... مش طول الوقت طبعا, أوقات هأهشكك, و أدلعك, و أطبطب عليك و ألاعبك "أبه و ألقف" ... (لو مافهمتش دي اللعبه لما ترمي النونه في الهوا, و تمسكه تاني فيكركع) ... بس هتسمع يعني هتسمع جمله بتتحداك و تستفذك و تغيظ إمكانياتاك عشان تطلع





عارف بتفكر في أيه, في الهجوم المألوف و الإتهامات اللي ياما ناس قالتهالي: "بيرفيكشونيست" ... "شارب", "ديماندينج", "أبو رجل مسلوخه", "أمنا الغوله" ... إتهمني, براحتك, ماهياش شطاره منك يعني انك تبخ الكلمتين دول, زيك زي غيرك, بتهاجمني عشان تدافع عن نفسك, بتتهمني عشان ترتاح و تغلوش علي غيظك, بس ده بعدك!!


كل الناس بتتكلم عن "القياده" و مبادئها, "الأداره" و علمها و ده عظيم, أنا أنحني قدام العلم, العلم لا يكيل بالبذنجان. اللي بيضحكني لما يبدأوا يطبقوا حاجات من مبادئ رعاية الطفل في وسط الزحمه "دلعهم مش كده" ... "بلاش تطلب منهم حاجات كتير" ... "قولهم برافو لو (ولا مؤاخذه) إتكرعوا" ... "حرام تطلب منهم يقروا كل ده" ... "سيبهم يروحوا بدري, لازم يستمتعوا بطفولتهم" (طبعا لأن الطفوله مرحله من الحياه تتميز بعدم المسئوليه و المسائله و كل الشباب المتخرجين لازم يأخدوا فرصتهم للأستمتاع بيها)
لكن ناس قليله قوي بتميز المشكله دي ... أن سهل جدا أن طبيعتنا الكسلانه تخدعنا, و نستخبى ورا شويه مبادئ شكلها صح لكن متطبقه بطريقه ملتويه عشان نتعب أقل, و نشتغل شغل أسهل و نفضل مصر أم الدنيا ... "ماما الحاجه" يعني, طيبه و علي نياتها و عندها أمراض الدنيا ... أنا نفسي نبقي "مصر المزه" (مش بزمتك ينفع أسم حزب, يعني مش أروش من الحزب اللي أسمه "مصر الفتاه").


النهارده قابلت "إسكندراني" ... واحد من الشباب اللي دربتهم و علمتهم لمده سنه و بعدين سافر يعمل ماجستير في أمريكا ... كنت هاتفرتك من الفخر بيه و هو بيقوللي أن الحاجات اللي كنت بأقولهاله و أعلمهاله و أجبره يقرأها خلته أحسن من زمايله هناك و أنه لما بيعلمهالهم بينبهروا... و كمان أنه بيعمل رسالته مع مؤلف واحد من الكتب اللي درستهالهم في الشغل
"إسكندراني" يا أبني ... قطّعهم!!!


من وقت للتاني بأخد حد من الشباب للميتنج رووم أو البلكونه و أديله "زا توك" ... مع الوقت أثبتت فعاليتها
فقررت أكتبها يمكن تفيدك النهارده و أنت في مكانك, من غير ماحياتك تبوظ و تضطر تشتغل معايا و أقولهالك, جاهز؟ يالا بينا ...

"قبل أي حاجه أنا عايز أقوللك أنك عندك كل الأمكانيات اللي تخليك من أحسن الناس في مجالك في العالم, صدقني, لولا عندك الأمكانيات دي ماكنتش بقيت في التيم بتاعي النهارده! خليك فاكر الحقيقه دي طول قعدتنا.
أنت عملت حاجات كتير كويسه, بس حجمها كان محدود و تابعتك فيها خطوه بخطوه. ده شجعني أديلك مسئولية حاجات أكبر و أثق فيك إنك تحتاج متابعه أقل. لكن إتكرر و أكتر من مره أني أديلك موضوع من بابه و أثق فيك أنك تعمله حلو, و ماتطلعش حاجه أنا و أنت نفخر بيها. الشغل اللي طالع جودته ضعيفه و مش متقفل كويس, حاجات متكروته و لجأت أكتر من مره للفهلوه! و لما سألتك عن حاجات في شغلك جاوبت بالشبه!!
المشكله مش إمكانيات, أنا و أنت عارفين كده, و مش وقت لأنك أنت اللي حددت الوقت. المشكله في "طريقه تفكير" و "روح" معينه مش موجوده في الشغل ده, خليني أوضحلك:

لازم تحس أن الشغل ده بتاعك, الحاجه اللي في إيدك جزء من سمعتك و نجاحك, ملكك, لازم يكون عندك "روح المالك" أنت مش بتعمللي الشغل بتاعي, أنت لازم تتطلع الشغل بتاعك حلو لأنك بتستمد فخرك من جودته ... بتاعك هي الكلمه المفتاحيه هنا.


لازم تكون مستعد كمان تمشي الخطوات الزياده, حتي بعد ما "تخلص" بالمفهوم المصري البلدي, حسن, جمل, جرب, قارن مع شغل عاملينه ناس تانيه علي الأنترنت ... ماتسكتش غير لما تحس بالفخر. لو حاجه ماعرفتش إزاي تعملها للأخر ماتسكتش غير لما تقرأ و تدور و تفكر, عشان حتي لو مانفعتش يكون عندك سبب يقنع كل الناس و نعرف أنت وقفت فين و نكمل من بعدك


و أنت بتشتغل فكر كده: الوقت و المجهود اللي هأقضيه في تجهيز دفاعات و أسباب ليه الشغل وحش بعد ما "أخلص" و أدافع عني أنا الضحيه المسكين قدام مديري المفتري و العملاء الإنتهازيين الماديين, هأقضيه دلوقتي أشتغل و أطلع أحسن حاجه




Raise the bar
Raise the bar


تفضل مشكله واحده, لو مش عارف تحكم إن ده مش علي المستوى المطلوب, لو بتفتكر أن كده رضا و كفايه عليهم قوي في مرحله بدري عن المفروض. تقديرك و معيارك الشخصي ل"كفايه" و "كويس" مش نفس تقدير غيرك و معيارهم ... مشكله فعلا.
حلها يبدأ لما تتأكد إنك مش أقل من زملائك في أي مكان في العالم, ومش العادي أن شغلك يكون أوحش و أضعف و مش كامل ... مايضرش كمان لو بس على سبيل الحذر تأكدت إنك عملت أحسن منهم و عرفت أكتر منهم, كده يزيد إحتمال نجاحك شويه كمان و حتى لو مديرك غبي و ظالم مش هيلاقي طريقه يطلعك غلطان. مش كده أفيد من لعب دور الضحيه و الدفاع عن نفسك من الذئاب البشريه في الشغل و عن "عدم الجوده" كأنها "بنت خالتك"

تحب تكون كده؟ لو إجابتك "أيوه" مش هأسحب ثقتي منك و هأساعدك المره دي في الموضوع الكبير ده و نطلعه سوا أحسن حاجه, بس بشرط تطلّع دايما نفس المستوي



لو إجابتك لأ ... عادي, خليك عادي و أنا هأبذل مجهود إني أتأكد أني ماظلمكش أبدا بشغل فوق العادي.
"عادي" هي محور الجمله

هتقرر النهارده تكون عادي و للا مميز؟



أشجعك تكون مميز, الحياه أقصر من أنها تتعاش بشكل عادي




Sunday, May 31, 2009

حوكمة القطاع الخاص


من عجائب الدنيا التسعه في مصر المحروسه و التي تضمحل مع الوقت زيها زي غيرها (بسبب خروجنا من تصفيات بلاد العجائب بنتيجه "صفر" أو لأسباب التحلل الطبيعي للحضاره) "وظائف الحكومه" أو "الميري" و التي كانت لزمان طويل من الأمور المدهشه و الساخره التي تميز مصر عن غيرها من المناطق المأهوله من سطح الكوكب


الجيل السابق من المصريين الشرفاء, جيل اﻷباء و الأجداد عاشوا و ماتوا و عندهم إيمان عتيد أن كل شئ ممكن يتغير و إن الأيام دول و مافيش حاجه مضمونه ... ماعدا الوظيفه الحكوميه اليوميه, هي المرادف اﻷول للأستقرارا و هي الموضوع الذي يشغل المجتمع كله لمده 3 ساعات صباحا في اﻹنتاج و 13 ساعه في الرغي عنه على القهاوي البلدي باقي اليوم. و جيلنا المسكين إتربي عل منظر الموظف المحترم أبو بدله صيفي و جرنال و بطيخه و بيجري ورا اﻷوتوبيس ... و أبتزنا المجتمع عاطفيا بشكل بشع بوضعنا في الصراع النفسي بين إجبارنا علي إحترام هذا اﻷفندي "المحترم" الرصين و التعاطف مع هذا المخلوق المسكين و بين عدم إقتناعنا بجداره هذا اإنسان و وضوح حقيقه إنه عاله علي النظام (ده لو كان النظام سليم يعني) و أنه غير منتج ... قد أيه أنا شخصيا اتصدمت صدمه حضاريه لما كبرت ووعيت علي الدنيا و رحت بنفسي "أخلص مصلحه" في مؤسسه حكوميه و أضطررت أن أتعامل مع البرود و الرشوه و الامبالاه و السلبيه و الكسل و عدم الكفاءه الواضحه في سلوك هذه الفئه النادره من الأجناس البشريه


زمان كنت ناقم على هذه الفئه (و ده طبعا كان بيحسسني بالذنب) لأني كنت فاكر أن هذا الوضع سببه نوع معين من الناس هم اللي خلقوا جو الامبالاه و عدم اﻹنتاج و أنهم هم المجرمين المسئولين عن فشل و خسارة القطاع العام و شلل و تخلف المؤسسات الحكوميه ... لكن في أخر كام سنه أدركت أنهم ضحايا و مفعول بهم لما شفت إزاي غباء اﻹداره في القطاع الخاص بيحول أشخاص أذكياء و موهوبين, متحمسين و نفسهم يعملوا فرق إلي موظفين محبطين بيروحوا الشغل و يعدوا الثواني عشان الساعه تيجي 5 و أصبح كل الفرق بينهم و بين من سبقوهم هو أنهم بيقضوا 8 ساعات من عدم اﻹنتاج صباحا و 12 ساعه في "الكافيه" مساءا في النم و السب و اللعن في الشركات و المديرين و أصحاب رأس المال و يناموا 4 ساعات فقط متكلين على رفاهيه "نسكافيه الصباح" في القطاع الخاص ... هذا الظاهره المدمره موجوده في كل مكان و ينفذها أصحاب المال و المديرين الكبار بتصميم و فعاليه و كأنهم بينفذوا برنامج "تدمير إقتصادي" مماثل لبرنامج الحكومه المصونه في "خصخصه القطاع العام" و لكن هذا البرنامج دوره "حوكمة القطاع الخاص", حقيقه غريبه و غير منطقيه, ليه الناس تضر مالها الخاص و تعقم اﻹبداع و اﻹنتاج في مؤسسات مملوكه لشخصهم؟


لحسن حظي بأشتغل مع عملاء و شركات أوروبيه في ال 18 شهر السابقين (بعد ثلاث سنوات و نصف مع الخليج ), أتفاجأت بالطريقه اللي بيحسبوا بيها إنتاجيه الفرد. بالنسبه لهم إضافه مهندس واحد للفريق حدث كبير لازم يسبب في زيادة أداء الفريق بطريقه واضحه, شخص واحد = الكثير من الإنتاج.


السنوات السابقه كمان علمتني حقيقه مهمه و هي أن فريق العمل المتحمس الملتزم المحترف اللي بيحس بالجوده و بيسعي لعمل فرق, اللي عنده إحساس كأنه بيشتغل في ملكه (طبعا قصدي من ناحيه الأمانه و التفاني مش من ناحيه أنه بيجي الشغل بعد الساعه 12!!) ممكن ينجح و ينتج أكتر بكتير من فريق مشابه في العدد, أعلي في المهاره و الخبره لكنه "متحوكم" و مطفي , مش طايق نفسه


خليني أذكر بعض التقنيات و الديناميكيات التي تؤدي لخطه "حوكمه" ناجحه و بيزنس فاشل بإذن الله:




  1. عدم التقدير و توصيل إحساس للشخض المميز أو المتفاني أن النظام عقيم و مافيهوش طرق نظاميه لتقدير و مكافأه التميز فياريت يكمل يموت نفسه في الشغل بس كل النتائج هي حق مكتسب للشركه و لا يجب أن يتوقع عنه مكافأه أو تقدير

  2. اﻷوامر الدكتاتوريه و القوانين غير المنطقيه, مثلا زي "مافيش أجازات لأخر السنه" أو "مافيش حاجه إسمها مكافأه وقت إضافي" مع الحرص علي توصيل معلومه ضمنيه أن القانون الغبي يمكن عمل إستثنائات فيه بإضافه جملة "لكن يعني عمر حد منكم طلب أجازه إستثنائيه و قلناله لأ؟" لقانون اﻷجازات السابق ذكره. و بكده نكون (1) لغينا حق الناس الشرعي في اﻷجازه (2) حسسناهم أنها جميل من الشركه أنهم إستثنائيا يرتاحوا و (3) فتحنا باب اﻹستثناء و المحسوبيات و التفضيل ... 3 إنجازات مدمره

  3. تجاهل أفكار و إقتراحات الموظفين بسبب ضعف شخصية صاحب السلطه و شعوره بالتهديد من كل المخلوقات المفكره المتكلمه أو بسبب أن صاحب الفكره إبن سوسو الزعلانه أو البطه السوده

  4. جميع الأفكار أو الإقتراحات التي تؤثر علي مسيره الشركه و تزيد من فرص النجاح يجب أن تأتي من صاحب السلطه أو صاحب رأس المال ... و لو صاحب السلطه ماعندوش أفكار, لازم ماحدش غيره يطلع بأفكار و إلا يعتبر ذلك إهانه مباشره لصاحب السلطه و أتهام صريح له بالغباء

  5. دخول الشركه في مزاد علي التعيينات الجديده و حده المنافسه في سوق العمل علي تعيين الموظفين الكفء و تحقيق السيوله الماديه اللازمه لذلك التوسع بقصقصه مزايا الموجودين و تجاهل مكافأتهم و زياداتهم المستحقه تحت شعار "ماهو موجود جوه خلاص, هيروح فين؟" و أعتبار وجودهم و مجهودهم أمر مسلّم به

  6. السلبيه بكل صورها, فمثلا ترد السلطه على تعليق شخص مجتهد بخصوص عدم جوده أمر ما و أنه بيتعمل غلط برد من نوع "و أنت مالك" ... صدقوني هتبقى أخر مره يحذركم من الطوفان

  7. عدم وجود "قياده" حقيقيه أما بسبب غيابها و إنشغالها بصرف الأرباح يمين و شمال أو بسبب ضعف شخصية السلطه و غياب موهبة و علم القياده

  8. تضارب الرؤى و الأهداف, يوم يمين و يوم شمال أو التصريح لمدير ما أن سياسة الشركه هي التوسع و التصريح لأخر أن سياسة الشركه هي تقليل النفقات و صرف العماله إنطلاقا من منطق "فرق .. تسد" ... و هو في رأيي الخطه المبتذله التي يتبعها القائد الضعيف خوفا من الأنداد

  9. دايما يلقي اللوم لحظة وقوع أي خطأ علي الشخص الي بيشتغل, بدون أخذ الدوافع أو الحكمه وراء ما فعل في اﻹعتبار و كأن السلطه معصومه من الخطأ لكن من "يفعل" هو مصدر جميع الأخطاء. إذا أتت الرياح بما لا تشتهي السفن, إستدعي اللي بيشتغل و تأكد من أنك تجرح كرامته و أنت بتلومه علي كل حاجه حتي علي الكوارث العالميه و الطبيعيه و تساقط النيازك الفضائيه و بذلك نشجع الموظفين على تطبيق الحكمه الأذليه الحكوميه "تشتغل كتير, تغلط كتير, تتجازي كتير ... ماتشتغلش خالص, ماتغلطش خالص, ماتتجازاش خالص" ... حِكَم

  10. خلط "اﻹحساس بالمسئوليه" أو "روح صاحب العمل" بالتسلق و الصراع علي السلطه و وضع الشخص الذي يعمل بجد و أمانه كأنها شركته في قالب "الطماع المتأمر" أو"الخائن العميل" الساعي للإستيلاء على الحكم و الضغط عليه حتي يكفر و يصرخ: "خلاص ولعوا في روحكم, ماهي مش شركة أبويا" ... برافو أهو أعترف على نفسه و كمان تاب

  11. توزيع المسئوليات و سحبها بطريقه عشوائيه أو متعجله, و عدم ترك وقت كافي لتقييم نتائج عمل الشخص في إطار مسئوليته أو حتي إعطاءه فرصة رؤيه ثمر تعبه (إحباط صعب وصفه بكلام) ... بالضبط زي مستشفي الولاده التي تعدم جميع الأجنه كخطه أكيده للقضاء علي اﻷجنه المشوهه

  12. تذكير الناس طول الوقت بأن السلطه هي ولي نعمتهم, اللي بيأكل أولادهم و يدفع فواتيرهم مع اﻹشاره أن مراتباتهم كبيره (زي ما تدي شحات 10 جنيه بس و تمدله إيدك عشان يبوسها) و كأن الناس المجتهده دي مش هم اللي بيدفعوا فواتير الفنادق و إشتراك نوادي الجولف و دفعات السيارات البورش المملوكه للسلطه

  13. الوعود الغير محققه, ظن رأس المال أنه ذكي لما يعلق "الجذره" للموظفين ... اللي ماخدش باله منه أنهم لو كانوا فعلا بهائم بينخدعوا بالجذره فهو رايح في داهيه و لو ماكانوش و فاهمين لعبته الساذجه فهو برضو رايح في داهيه

  14. عدم الشفافيه, توكيل موظف بعمل و توكيل زميله بمراقبته مع توكيل موظف من قسم أخر بنفس العمل من باب اﻹحتياط

  15. التهديد ب"قطع العيش" ... التحفيذ بالخوف بصفه عامه يضمن خلق "سجن" أو "إصلاحيه" منضبطه وعمره ماينتج أفكار مبدعه أو حلول خلاقه

  16. أول ما الشركه تتزنق ... تقلع ... أنسي المعايير و القيم و الرؤيا و الخطط, المهم نحقق فلوس أو نزود الحجم مثلا حتى لو عيننا أي واحد يخبط علي الباب عشان يسأل "خالتي عندكم؟"

  17. تطبيق المساواه في الثواب و العقاب, لو في مشكله عاتب و عاقب الكل من منطلق "اﻹرهاب" و "إضرب المربوط يخاف السايب" أهي فرصه كلهم يتلموا!!! و لو في مكافأه وزعها علي الكل (و نصيب الفرد يبقي ملاليم طبعا) عشان مانعملش مشاكل, مش مهم بأه مين اللي إشتغل و مين اللي ماشتغلش, إحنا لسه عنقعد نتابع و نقيم

  18. لو السلطه في "موود" وحش, كل الموظفين لازم يستحملوا نفسنته و مشاعره الأنثويه و تصرفاته الغبيه تحت شعار "إدارة المدير" و الكلام الكبير و لو نفسه يطلع ضيقه علي حد, يسأله "عملت كذا؟" و لو جاب ب "نعم" يلومه على تهوره و تسرعه و لو جاوب ب "لا" يلومه علي بطأه و كسله و لو إمتنع عن الإجابه يلومه علي سلوكه الغير محترف و الغير متعاون و لو ماراحلوش أساسا يلومه علي عدم خضوعه للسلطه و تمرده و قتله لروح الفريق ... و كأن الموظفين لازم يستحملوا الكام يوم إياهم في الشهر اللي فيهم السلطه (كلمه مؤنثه في اللغه العربيه) بتبقى مقريفه و عصبيه و كأنهم تتابع الليل و النهار أو تغيير الفصول ... ماباليد حيله فيهم


علي غرار البرامج التلفزيونيه علي القنوات الفضائيه و التي تتبع كل مشهد يحتوي علي مخاطره يقوم بها فريق محترفين بعباره "لا تجرب هذا في المنزل" ... أنا بأخلى مسئوليتي من توابع تجربه الخطوات المكتوبه أعلاه في بيئه العمل ... أو جربها علي مسئوليتك


السؤال اللي محيرني ... هل العامل البشري فعلا مالوش ذنب و أن "الحوكمه" هي سبب فشل القطاع الخاص و إنهيار القطاع العام ... يعني تخيل لو عملنا تجربه ميدانيه و بعتنا بعثة مديرين مصريين لشركة "جوجل" و طبقوا الخطه علي الناس هناك. هل النتيجه هتكون أنك تدخل عبارة البحث في محرك جوجل البحثي و تضغط "إبحث" فيظهر لك علي الشاشه بالبنط العريض



فوت علينا بكره


و عجبي




Thursday, May 28, 2009

Convert Videos for IPhone on Linux using Avidemux

Recently I downloaded some amazing video lectures from MIT Open Courseware program, an great initiative by MIT to avail top level online education to the rest of us who won't dream of studying there (although I always feel free to dream), I was specially interested in the Introduction To Algorithms course by Prof. Charles Leiserson

I planned to have all the videos loaded on my IPhone to have some brain food for the road, finding all videos in mp4, I was hoping that they would be compatible with IPhone, but unfortunately ITunes refused to sync the videos with a message:
"file" was not copied to the IPhone because it can not be played on the IPhone"

I searched and found many blogs and articles going in details about the complex specification of video and audio mux supported by IPhone, such info is informative but won't help you much to actually get it to work, when I googled around I found long lists of software products that would help you convert your videos in one click, most of the software is running on Windows and Mac, and I did tried a couple of those on windows and the result was a garbled video image or cluttered sound.

I learned that Avidemux 2.4.4, a free video editor on Linux can manipulate almost all video formats, but using trial and error to try to get the right combination of Video and Audio Encoders, bit rate, partition decision, ... wasn't a user friendly experience at all, not even close to a human one

Here is the right settings that works with Avidemux:

  1. Set video encoder to MPEG-4 AVC (x264)

  2. Click Configure

    1. Motion tab: set partition decision to 4

    2. Misc tab: uncheck CABAC

    3. Partition and Frames tab:

      1. Uncheck 8x8 transform

      2. B-Frames, set max. Consecutive to 0





  3. Click Filters (Under Video on the left) and enable MPlayer resize filter, set target size to 480x320

  4. Set Audio Encoder to AAC (FAAC)

  5. Set Format to MP4

  6. Save your file with extension .mp4


That's it, it will take a while to finish, you are looking at 10 minutes to convert a 1 hour 250MB video in incompatible mp4 format (as the ones I got off the MIT OCW website) to IPhone friendly mp4, and Avidemux doesn't allow multiple selection, so you would have to do one file at a time (although you can run multiple instances of the application and challenge your CPU) ... It would have been nice to find out about command line arguments (if any) for Avidemux to be able to wirte a little script to do the hard work overnight for me

!!!ما بلااااااااااش


في البدء أراد الأنسان أن يعرف أكثر مما كان مقدر له أن يعرف ... كانت أيه النتيجه؟!
ربنا خلقه عارف الخير بس, و كمان عارف ربنا و عنده كل اللي هو محتاجه, ليه كان عايز يعرف أكتر أو بمعنى أدق عايز يعرف اللي مش مفروض يعرفه. حتى مع التحذير العادل اللي أخده, قرر بغباء أنه يعرف أكتر من غير حساب للعواقب و كلنا دفعنا الثمن

أسمحلي أطلع بأستنتاج دلوقتي و أثبته بعد كده على مهلي: يعني "عدم معرفه مالايجب معرفته و معرفه بس اللي محتاجين نعرفه هو الجنه بعينها". مش متفق معايا!! طب هأقنعك ...


كونفوشيوس قال "لا تنظر لما لا يليق, لا تنصت لما لا يليق, لا تتكلم بما لا يليق" و أخذ عن حكمته مثل "القرود الثلاثه الحكيمه"



http://en.wikipedia.org/wiki/Three_wise_monkeys

hear, see, speak no evil




هأسمح لنفسي أضيف "لاتنظر إلي ما لا تحتاج أن تراه, لا تنصت إلى ما لا تحتاج لسماعه و لا تتكلم بما لا تحتاج لقوله"

دخلت شله جديده, أيه أحسنلك ... تحاول لحد ما تعرف كل القصص القديمه و كل المشاكل التاريخيه, "بيسو" متخانق مع "كيكو" و "بيبو" فرقع "جيجي"؟ "توتو" كان صاحبنا زمان و باعنا أو بعناه و "توتا" ليها ماضي مش ممكن ننساه ... وللا أحسنلك تعرف النهارده و بكره و بس, تعرف الناس ببساطه زي مامقدمين نفسهم ليك, و تعرف عنهم اللي باين في معاملتهم معاك, مش يمكن اللي فات ده كان ليه ظروفه, مش يمكن اتغيروا, مش يمكن ندموا؟ ليه تقفل نفسك عنهم و تسد نفسك منهم و تحكم على ماضيهم اللي حتى ربنا بيغفره و ينساه ... أقتنعت. لسه, طيب خد عندك ...


ربنا كرمك بوظيفة أحلامك بالمرتب اللي كان نفسك فيه, حماسيه جدا, متفصله عليك, بالضبط زي ما تمنيت ... لازم تعرف اللي كان قبلك إستقال و للا أترفد و ليه, طب مرتبه كان كام؟ أيه ده أكتر منك ب 17 جنيه طب و لما مره إتخانق مع المدير قاله أيه؟ و إتقاله أيه؟... أيه الشغلانه البايخه اللي مش جايبه همها دي. قفشت!!! ولا تفتكر كده يعني أنت خبرتك زادت لما عرفت


يعني كان لازم لما أخدت الزياده ال8% اللي كنت مستنيها بفارغ الصبر تسأل و تدور فتعرف أن زميلك اللي شعره أبيض اللي شغال بقاله 63 سنه في نفس المكان ده أخد زياده 9.5% ... فجأه حسيت بالظلم, الشركه دي بتسرقك؟! الزياده فجأه بقت مش مكفيه و كل حماسك و تشجيعك للسنه الجديده في الشغل إختفى!!!


أديك مثل دراماتيكي عن كده؟ حبيت البنت دي (أو الولد ده) بجد ... حصل حاجات مالهاش معنى؟ ... إتقاللك إبعد و مش هينفع من غير سبب معين أو موقف له معنى؟ ... لازم يعني تحاول تعرف ليه و إزاي, لازم تسمع بودانك حاجات أغلب الظن هتجرحك, غاوي يعني تعذب نفسيتك و تكرمش مشاعرك؟ تحت شعار "لازم أعرف", و "مش هأرتاح ولا يهدالي بال إلا لما أعرف"!


عايز مثل نفساوي عن كده؟ قابلت الشخص اللي بتحترمه ده, اللي ينفع ينصحك في حاجات كتير و كمان ممكن يكون مثل أعلى ليك. ساعدك و أرشدك كتير بالفعل ووفر عليك وجع تجارب و إحباطات فشل ... وفر عليك أنك تتعلم كل حاجه بالغالي. ليه عايز تقرأه أفكاره و تعرف كل أسراره؟ عرفت؟ سمعت و شفت أنه إنسان ضعيف زيك و يمكن أضعف؟! عرفت أنه الحاجات اللي بينصحك بيها أوقات هو نفسه بيغلط و يتلخبط فيها؟ مبسوط؟ هتعرف تحترمه و تأخد رأيه في الإعتبار تاني؟ طب هتعمل أيه؟ هتعيش علي رأسك ... مالكش كبير و لا ناصح؟ ... لأ ناصح! فخور أوي أنك عرفت, و أيه الفايده من المعرفه دي؟


حصل حاجه في مجتمعك بين أتنين تعرفهم و بتعزهم؟ ليه تعرف كل التفاصيل؟ مش يمكن التفاصيل تحرجك! تجرحك! تزنقك بينهم؟ ولما يتطلب منك تتدخل, و لما حد يسألك عن اللي حصل اللي مش عايز تحكيه. أكدب بأه أو خليك سخيف و قول عارف بس مش هأحكي, و أنت أصلا مش مفروض تكون عارف. إرتحت, أستنرت, حسيت إنك الحكيم الروحاني العالم بكل شئ؟ إحكيلي عن كوابيسك و أحلامك و عن صفاء ذهنك و حلاوة أيامك



عرفت فلانه ماتجوزتش فلان ليه؟ عرفت فلان مشاكله إيه مع مراته (رغم أن الناس بتضرب بيهم المثل) و فلان عمل أيه زمان و هو شاب في سن الضياع؟ عرفت مرتبات كل زمايلك؟ و فضايح كل زميلاتك؟
عرفت نقاط ضعف أهلك و أصحابك؟ عرفت حقيقه فلان اللي كل الناس بتحترمه؟ عرفت إتقال أيه في الموقف اللي ماكنتش موجود فيه؟ و الناس بتقول عليك من وراك أيه؟ عرفت خطايا رجال الدين؟ و فضايح السياسين؟ و لون الملابس الداخليه للفنانين؟

مبسوط؟ مرتاح البال؟ نايم نوم الأطفال؟ بزمتك مش اللي ماتعرفوش مايضركش؟ و عمي الجهل أهون من عذاب المعرفه



هتقوللي الفضول وقود المعرفه و الحاجه أم الإختراع ... سلملي بأه على ليالي الأرق المقرفه و علي كل يوم من راحة بالك ضاع
وعجبي

Tuesday, May 26, 2009

My IPod Touch 3G 2.2.1/BB 2.30.03/BootLoader 5.09 ... The ultimate frustration

Recently I decided to live on the fancy side of the street and get myself a 3G IPhone, because that costs over 700$ in Egypt and is locked to GSM providers I played it more smart and got myself 2 iphones from USA, my brother bought them for me on eBay and his focus, with good intention was getting a phone that is in the best shape, in other words recently manufuctred and good as new, the single device cost average 450$ so it felt like a bargain at the moment ...

I asked a couple of my geeky colleagues to join me in the adventure of the unlocking, Ahmed Soliman (Soli) one of the youngest & smartest system/software engineers I've ever worked with, a living idea generator and amazingly a geek with a sense of humor, and Ahmed Kamal (Kimo) a Linux guru who I gladly grants a root access to my Linux machine at all times to be a friend in need, he talks command line, tell jokes with parameters, socialize with network protocols and have a memory of a 100TB ZFS system with daily snapshots ... we set out for the adventure with full belief that it will work and we are the masters of the universe. Unfortunately I was too confident

The brand new iPhone, that looks good as new has OS version 2.2.1, baseband version 2.30.03 pre-installed. At first glance I got worried because all the posts out there speaks of baseband 2.28 unlock, then a small window for hope opened with posts taking abou thow to downgrade your 2.30.03 baseband to 2.28 and then apply the unlock, we followed this tutorial with high hopes and enthusiasm, the tutorial started with this pragraph:
These are instructions on how to downgrade your baseband from 2.30 to 2.28 for iPhone 3Gs with the 5.8 bootloader.

So what, who cares, let's do it, we Jail Broke it! cool making progress, I'm thrilled and starting to imagine myself flipping my photos back and forth, syncing my google calendar, browsing my favourite feeds, watching youtube videos and suddenly I get a call :) wow that will be amazing ... my fancies ends and I was brought back to reality and down to the ground with my friend's Ahmed Soliman's voice yelling "Crap, it is not working" and we searched for explanations and landed on some blogs saying that it won't work on devices with boot loader version 5.9 ... at this moment I haven't yet known my Bootloader version, so I was in denial phase and was rejecting the fact that mine could have this version (which is the freaken latest, uncracked yet version), so as an action of bargaining to dodge the shock we followed another tutorial to find out about my Bootloader version and there was the shocking fact, the iPhone sat their, smiling at us daringly and displaying 5.09 on the screen ...

After digesting the painful facts I formed a very simple query and googled it, my query had three numbers "2.2.1", "2.30.03" and "5.09" (I thought of adding 450$ as well may be God would answer my query and refund my money, then I thought that this won't happen on google) ... the results were very frustrating with hundereds of people crying all over the web, blogs, forums, etc that "It is not possible", "No hope for that yet", "Strong chance that it won't be there an unlock for 5.09 bootloader" and the like ...
To ease my pain and go on with my life I decided to call my IPhone a nick name that would help me live in denial: "IPod touch 3G" ... actually there is nothing 3G about it and even GPS doesn't wotk, but proudly my iPod has a microphone and a speaker so I can use skype and this is an advantage over (old only) IPods ... isn't it?!

Sunday, May 3, 2009

تحويل الكاكا الي طاقه


و جدتها ... وجدتها ... !!!


صرخت و أنا قايم أجري من علي الكنيف, تمام زي ما "أرشميدس" صرخ وهو طالع يجري من البانيو لما أكتشف قانون الطفو, و اللي ساعده علي حساب "الكثافه" بدقه لأي جسم صلب ... بس أنا أتعلمت من أخطاء من سبقوني و إفتكرت ألبس هدومي قبل ما أنزل السلم و أطلع أجري في الشوارع ... تفصيله بسيطه نسيها العالم الأغريقي العظيم



اللي أنا أكتشفته هو الحلقه المفقوده في ترشيد استهلاك الطاقه و المحافظه علي البيئه, و توليد طاقه نظيفه ...
أنا اخترعت "جهاز تحويل الكاكا إلي طاقه" ... تحسها مش طاقه نظيفه قوي, بس أنت إيش فهمك ... سيب الحكم في المواضيع دي لينا أحنا المهندسين و العلماء و المخترعين

الجهاز فكرته بسيطه جدا, لدرجه أن أي حد منكوا مش مهندس ولا يفهم في الطاقه ... هيحس أن خبرته في انتاج الكاكا كافيه لفهم المبدأ البسيط لعمل الجهاز المدهش ده



أسطوانه معدنيه طولها حوالي متر, و قطرها 2 مترو هتركب علي مواسير الصرف في أخر الماسوره, تحت العماره. بداخل الأسطوانه (اللي حنسميها المحول من هنا و رايح) في "توربينه" صغيره. التوربينه للناس الأدبي و علمي العلوم هي عباره عن ملف من ماده جيده التوصيل للكهرباء ملفوف حول محور معدني علي شكل مستطيل موصل للكهرباء, و يدور الملف بحريه داخل مجال مغناطيسي يولده مغناطيس طبيعي قوي المجال, لما يدور الملف يتولد تيار كهربائي في المحور المعدني, و لا سحر و لا شعوذه.
تسقط حبيبات الكاكا بعنف بفعل الجاذبيه الأرضيه و يصل التسارع لقمته قبل الأرتطام بشفرات التوربينه ... تلف التوربينه, تتولد الكهرباء ... نستخدم أحنا بقه الكهرباء ال... أحم ... نظيفه دي لتشغيل موتور رفع الميه و نبقي حافظنا علي البيئه
تبان سهله, مع البدايه في التطبيق ظهرت الكثير من التحديات:

1. نحتاج تعاون من الناس في ضبط معدل هبوط الكاكا علشان نحصل علي تيار كهربائي مستمر
2. قطر المحول العريض مكلف لكن مافيش غني عنه ... الناس بتأكل فول كتير و يفضل تجنب انسداد المحول
3. أيام معينه في السنه, خاصه في المناسبات, كل الشعب بيأكل فسيخ مثلا أو قلقاس, ده بيحِّمل علي المولد و بيأثر كيميائيا علي القطع المكونه
و تحديات تانيه كتير تعف النفس عن ذكرها ... برضه المخترع مننا لازم يراعي وجود ناس مالهاش في العلم في وسطينا

أنا بدأت في أجراءات تسجيل براءه و نظافة الأختراع الثوري ده, و أتمني أن مصر تكون أول من يطبقه لأن من المعرف أن أنتاجيه مصر السنويه من الكاكا تصل الي 11 ضعف نظيراتها من الدول المتقدمه. و ده يرجع لأسباب كتير هنشرها بالتفصيل أن شاء الله في المذكره اللي هأقدمها لوزارتي "البترول و الطاقه" و "البيئه"




Clean Energy
Clean Energy

خلوني أحكيلكم عن حاجه تانيه, تبانلك بعيده عن الهندسه و العلم, اتعلمت من فتره عن "نموذج المراحل الخمسه للتعامل مع الصدمات النفسيه" أو الحزن الشديد لفقدان شخص عزيز أو شئ غالي, حلم مثلا فجأه أكتشفت استحاله تحقيقه.
النموذج ده وضعته الطبيبه "اليزابيث كوبلر" لوصف نماذج متكرره من رد فعل الأنسان

http://en.wikipedia.org/wiki/Elisabeth_K%C3%BCbler-Ross
http://en.wikipedia.org/wiki/Five_Stages_of_Grief

النموذج يقترح 5 مراحل بنمر بيها, غالبا بالترتيب لكن مش شرط
1. الأنكار (من المعروف أن الأنكار هو أكثر رد فعل متوقع من الجنس البشري ... إرجع للبدايه, أبونا أدم مثلا)
2. الغضب
3. المساومه
4. الإكتئاب
5. القبول

في الأنكار بتغلوش و تتخيل أن الخساره ماحصلتش و أن الوضع مؤقت ... بعد كده بتغضب من اللي حصل و من الشخص اللي فقدته نفسه و من ربنا في أوقات, صحيح غضبك مالوش معني لكنها طاقه لازم تخرج.
المرحله التاليه مثيره للإهتمام, المساومه مع الله و الناس, زي مثلا طفل صغير يقول "هبقى كويس, هبقى مؤدب, بس بابا يرجع".
بعد فهم استحاله المساومه و أن استعاده المفقود مش نافعه, تبدأ مرحلة من الأكتئاب و النوح اللي يفضل يكون من النوع الصحي (تعرف أن في حاجه اسمها إكتئاب صحي, لو مش عارف تبقي مسكين و محتاج مساعده الطبيب النفسي الفذ د. "أوهم" انصحك تقرأله كتب أو تسمعله محاضرات)
بعد ما تشبع أكتئاب, بتقبل الوضع و تصدق اللي حصل و "تتصالح مع الفكره" (سمحت لنفسي أقتبس المصطلح ده من "شامي فوري" المحاضر المعروف و الذي يقوم بنشر أفكاره عن بشاعه الزواج كمبدأ ... يا رب إغفر له لأنه لا يعلم ماذا يفعل)

أيه علاقه ده بالطاقه, اسمحلي أفهمك: من المعروف أن "الطاقه لا تفني و لا تستحدث من العدم" يعني أدي الله و أدي حكمته و بالبلدي للأخوه و الأخوات اللي مش علماء: "عد غنماتك يا جحا"



لما تعدي بالمراحل السابق ذكرها, بعد " خساره و فقد" أو "فشل" أو "صدمه" من أي نوع "إنكارك" بيكون زي
مقاومه المواد للكهرباء, و ده بينتج عنه حراره و يضيع طاقه كتير.
"غضبك" ده شكل أخر من الطاقه الغير موجهه و الغير موظفه, بيخرج في الوقت الغلط بالشكل الغلط, يضرك و يضر غيرك و يساهم في جعل و ضعك أسوأ
"المساومه" زي شد الحبل, مجهود رهيب لكن ماتشوفلوش أي نتيجه محسوسه
"الأكتئاب" كأنك و لعت نار و طفيتها بالرمل أو لمبه قويه و دفنتها في التراب, المزيد من أهدار الطاقه

مافتكرش أنك سوبرمان, و أن اقتناعك باللي قلته ده هيخليك تتجنب المرور بالمراحل دي في حاله الخساره, نفسي أتمنالك ماتخسرش أبدا, بس أبقي بضحك عليك. الخساره و التغيير من ثوابت الحياه. لكن هاقترح عليك تتعلم من الفكره البسيطه اللي ورا الأختراع المدهش اللي حكيتلك عنه ... الطاقه اللي هتخرج جايه من و قتك (اللي هو أنقي أشكال الطاقه البشريه و أغلاها زي الضوء كده في الفيزياء) كمان من نفسيتك و أعصابك و روحانياتك لو جاز التعبير, يعني مكلفه جدا, خساره تسيبها تضيع.



أحساسك بالضياع و عدم فهم سبب حصول اللي حصل معاك أكبر دافع للتأمل...
إحباطك فرصه لإعادة النظر و لأكتشاف مواهب جديده أو اعاده اكتشاف مواهب قديمه ...
صحيح الغضب حماقه بس لو أستخدمته في الجيم في رفع الأثقال بيبني العضلات و يقلل الكوليسترول. أو ممكن يتحول لطاقه أبداع مثلا, رسم, موسيقي, كتابه ...
الفشل مدرس خصوصي اجره غالي معلش بس هيعلمك صح و عمرك ما هتنسي اللي أتعلمته لأنه بيستخدم وسائل إيضاح مبتكره...
إحساسك بالرفض يقودك للتعاطف مع الناس ...
شعورك بالعجز و عدم الإستحقاق هو السبيل الوحيد لفهم النعمه ...

خليك دايما متأكد أن كل موقف عدي عليك ثقيل و أثر فيك. معناها انه شكِلَك و علمك و حولك من طاجن قبيح لفازه جميله أو عي الأقل من حته صفيحه مسطحه الي حله غويطه مفيده

Friday, May 1, 2009

The eMagi is not here yet?!

This evening and for the second time I watched the amazing inspiring geeky movie The First $20 Million Is Always the Hardest and I realized the amazing fact that the genius author of the Novel with the same name Po Branson predicted Cloud Computing and the Multitouch Surfaces and predicted the huge revolution that they would make to the computer industry as early as 1997, the year in which his novel was published, the movie was in theatre in 2002, still it is amazing how crystal he pictured the future.


In summary the film tells a story about a marketing hot shot "Andy" with an engineering degree, who got nostalgic to "Intellectuals with higher purposes" (as his 2nd girl friend in the movie put it) by getting back to the research field and involve in a life changing technology research project instead of making easy money in marketing ... a feeling the we engineers working in the ICT market usually get, we look back with passion to the days when things were simpler and we just focused on creating genuine ideas and great software even if we barely get paid for doing so, again "Intellectuals of higher purpose", got a ring to it, doesn't it?


Andy applies to the research labs of "La Honda" and he ends up with a team of geeks rejected by all major projects and were destined for failure because they lack the looks and the charisma. The team was assigned a left-over project of creating a 99$ PC for 3rd world kids, a noble purpose attached to an impossible target.


History does repeat itself all the time, this movie document the era of early 2000's right after 911 and few years after the the infamous .com crisis, in a time where all VCs and investors are in doubt and reluctant to hear any word that starts with a "re" and ends with a "search" or a ".com" that is why the 99$ PC seemed like a good project in the bad economy ... rings a bell? it is just like the circumstances in which Cloud Computing is thriving now after the mortgage crisis.


After a geeky-action packed story they end up with a miracle and cleverly shows the struggle of the entrepreneurs and the never ending battle with the investors and institutions monopolizing the market, a device in the size of a torch light, and that's it. Their motto was




"Simplify, Clarify, Economize"



so they put storage, processing and ram in cyber space, wow, that is cloud computing spelled out as early as 1997 guys, do you see the irony here. Next and to save more money they got rid of the Keyboard and Mouse and replaced it with a multitouch hologram, you can interact with icons and objects in thin air. I'm not sure that multitouch surfaces can even compete here, Microsoft Surface, and iPhone looks like stone age gadgets compared to the idea in the movie. You just twist your eMagi 2nd generation and "Let there be light", you have your desktop floating in front of you with 3D icons and movable objects, and a neat keyboard modeled in empty space so that you can type if you would have to, the laser beams detects the tip of your fingers when you reach inside the hologram to "touch the soul of your computer" as "Andy" put it in the movie.


I searched all over the web and I was not able to locate a single picture or a video that documents the magical revolutionary device "eMagi" from the movie, as if the world deliberately overlooked the insight and innovation in this novel.


This movie left me wondering how slow and late we are today, Cloud Computing is indeed here, still it doesn't play a major role in end user day to day computing yet. Still many small and medium size enterprises are already setting up their Cloud Office to save money in hard times, so that is one down.


Multitouch surfaces are still dull, buggy and expensive, and worst of all it is still a surface, having 2D written all over it. But thanks to bright people like Johnny Lee you can have a multitouch "space" and the charm is that you can have it at home with a Wiimote and a little piece of custom software the Lee open sources, "Big Ups" for Johnny Lee (quoting the movie), Watch him presenting his simple genius ideas on TED


So what is missing to realize eMagi 2nd generation, yes, you guessed it, the hologram display, can this be the answer to the need, or this new touchable hologram be the more fancy answer? I do hope so, I would hate to put my money into an Apple Mac Air just because it is thing and has solid state hard drive, I would like to get something really new when I get a new PC, not just the same old fat lazy machine, crippled by Windows 7.0 or Lazy Vista, and has a mind of its own, as if Microsoft and its operating system own your hardware, and if windows wishes to run a task of its own now, screw the user, his work got to wait because he is not as important as the Royal OS.


Or the other side of the coin a stable fast Linux that suffers frequent seizures because an update is need or an update is messed up or your hardware is not yet supported by the community. I have Fedora 10, running on a Fujitsu Siemens Laptop, all Intel Chipset, 2Gigs of RAM, Dual Core CPU and the works yet I'm not able to operate dual monitors in year 2009, not even with the help of Linux geeks fellows at work. We are living in hard times, we make advances really slow because innovation is crippled and the market is monopolized, no advances are made unless they works for the interest of giant corporates like Microsoft and Apple, who would come up with the eMagi 3rd generation, isn't it already overdue, we need it, 2009 Q2 is about to end, how will be the bright team that would quit their dull money making jobs and put on our desks the next generation of PCs? I wish it would be the open source community and every one would get a chance to add up to the ideas and the magic in the eMagi 3rd generation.


Don't we own a tribute to Po Bronson, you are the man, you saw it all coming, may be Microsoft and Google need to hire fiction writers to start creating innovative retail products and shake the dust off the industry





أنتيه فاكر نفسك في أروبه؟؟

من الحقائق المعروفه في علم الأجناس أن الشعب الأوروبي الأمور, ذو الشعر الذهبي و العيون الفيروزيه و السلوك الحضاري هم نسل "سام", أحد أعضاء الجيل الثاني من رواد فلك "نوح".
اللي نفسي أعرفه, الشعب المصري دول ولاد أيه؟! و هل هم ولاد حد من أسرة العم "نوح" أساسا و لا ولاد جنس أخر من نزلاء الفلك


كنت سايق عربيتي في أمان الله, طالع من نفق الأزهر, و رايح علي ميدان التحرير. أيا كان الطريق المفتكس اللي بأحاول أخرمه بأوصل لمدخل من مداخل ميدان طلعت حرب.
مؤخرا, و تنفيذا لتعليمات السيد المحافظ, ركبت الحكومه أشارات المرور الرقميه زي ما بعضكم أكيد أخد باله. طبعا متهيألي ده كده دخلنا عصر الحاسب الألي و تكنولوجيا الفضاء في الوقت المناسب و من أوسع أبوابه.
بس, و الله تشكر الحكومه, و أية نقله حضاريه هذه ... بعد ماكان قائد المركبه مطالب بحده بصر الصقر و عمق بصيرة الكاهن البوذي عشان يتمكن بمعجزه من تحديد إتجاه إشارة صباع عسكري المرور, أثناء الحركه بسرعه في تقاطع ضلمه كحل. النهارده كل المطلوب منه أنه يتابع العد التناذلي المسلي جدا و الممتع للنظر في إنتظار تحوله من اللون الأحمر للون الأخضر, عمار يأم الدنيا ...
علي كل نشكر الحكومه و نطالب بتعميم الإشارات الرقميه المدهشه.


رجوعا لموضوعنا, و أنا داخل على ميدان طلعت حرب, و شايف من بعيد الإشاره العبقريه تومض بالأرقام الرقميه باللون الأخضر المبهج, وصل العد التنازلي للصفر, و قلبت الإشاره أحمر و بدأت تعد من 20 ثانيه و أنت نازل.
طبعا أكتر من عربيه قدامي قرروا أن 20 ثانيه ده عمر تاني, و أنهم كأفراد منتجه و مفيده في المجتمع لو وفروا العشرين ثانيه دي ممكن يساهموا في حل الأزمه الإقتصاديه العالميه و زياده الإحتياطي القومي المصري, و إنطلاقا من هذا الأيمان قرروا يجروا بسرعه و يكسروا الإشاره في خلال ثوانيها الأولى.

أنا بأه غبي, مش من هنا, و بكل تخلف و عدم تفكير, و بما أني فكرت بسرعه و مالقتش رساله ساميه أأديها في ال 20 ثانيه دول, و لدهشه السواقين اللي ورايا و قفت !!! تخيلواّ وقفت في إشاره حمره ... حمره يا عالم


طبعا اللي ورايا حسوا بغضب و إحباط, و عبروا عن مشاعرهم بكل جراءه و لباقه بوصله من الكلاكسات و الألفاظ الخارجه ... كل ده مش مهم, المذهل هو رد فعل واحد من المشاه, اللي كان بيعبر الطريق, مش من خطوط عبور المشاه, اللي أنا متأكد أن الناس فاكراها مرسومه في الشارع علشان موضة المقلم رجعت تاني.





[caption id="attachment_6" align="aligncenter" width="470" caption="Crossing the street in Cairo "]Crossing the street in Cairo[/caption]


طبعا الراجل ده نط في الشارع, عارف أن العربيات مش هتقف, و أنه هيحتاج يكون خفيف الحركه و سريع البديهه عشان ينجو من فقرة عبور الشارع في إطار صراعه من أجل البقاء, كان عامل حسابه أني عادي, زي زي غيري هأكسر الإشاره فأفسح أمامه ثغره تمكنه من الفرارا بأمان للناحيه التانيه من الشارع ... لما أنا وقفت قبل خطوط عبور المشاه... باظت خطته. أنا كده واقف بالعرض قدامه, يعني لسه هيضطر يلف لفه كامله حوالين العربيه علشان يعدي. و الأغبياء الباقيين اللي وقفوا ورايا في تشكيل عشوائي هيحولوا رحلته في عبور الطريق من خط مستقيم لدهليز متلولو ... (المذهل أن منطقه خطوط عبور المشاه كانت فاضيه تماما) ... الراجل بان على وشه مشاعر السخط, و زعق في: "ماتخش يا عم أنت, خايف ليه, خش, ماكلهم دخلوا" ... فأنا أبتسمت من فكرة "خايف ليه" دي و بكل ذوق قلتله:
"أتفضل, عدي الشارع, الإشاره بتاعتك"
إندهاشي ماكانش ليه حدود لما رد بغضب أكتر و قاللي:

"ما تخش يا عم, إشارة أيييييه و بتاعتي أيه و بتاعتك أيه؟! أنتيه ("أنت" بس بالصعيدي القح الجواني) فاكر نفسك في أروبه؟!"


فجأه تبخر ذوقي, و غلى دمي و خرج الدخان من وداني, و خصوصا لما شاركه أكتر من حد من المشاه عابرين الطريق في التساؤل, "وقف ليه ده؟" و مشاعري غلبتني و زعقت فيهم كلهم:




"عدوا, إجروا, عدوا قدامي عشان أدوسكم, يا جهله يا همجيين يا مصريين يا ولاد ال*تخ**فه ... أنا غلطان إني وقفت عشان تعدوا في الإشاره الحمراء يا ب**يم, إنشاله تفرمكم عرييه"

فاتت هوا العشرين ثانيه, و تحولت الإشاره تاني للون الأخضر المبهج و بدأ العد التنازلي من 59 ... و إنفجرت في الضحك مابطلتش غير في ميدان التحرير.

My First Blog Ever ... It's never too late to add my own mess to the web

This is my first blog, at age of 28 and after being professionally in the software business for almost 10 years.

I've been a Software Engineer, a Team Leader, a Scrum Master (I adore agile development and I totally believe that this is the only way to do software that works in today's always changing world, but this is another subject), a Development Manager, and recently a CTO, I've developed software in x86 assembly, Pascal, C, C++,Oracle PRO* C, Visual Basic, Centura, ML, Java, Python, and had some exposure to a few other languages like Power Builder, Delphi, PHP, LISP, PROLOG, ... you name it.

I have used and developed software on Windows, Linux and Unix platforms, I've instructed successful software courses as a free lance instructor and in the work place in the form of training sessions for the team I worked with and managed about Data Structures, Database Design, Object Oriented Programming, Agile Development, Test Driven Development, Design Patterns, Matlab Scientific Programming.

I've hired at least 3 dozens of Engineers, fired a couple, and Interviewed few hundreds (I'm really picky and interviewing people is an experience that I enjoy and would share a lot about) and through all that, and in Frank Cenatra's eternal words "I did it my way" and I had fun all the way, still I never have written a single blog!!

I really dunno why, may be I didn't want to add more mess to the web or something, but come on it's web 3.0 already and every kid that has nothing to say is adding his foot print to the web from his mobile phone, iPod, and soon enough from his little cute brain implant or something, so I thought, what the heck, why not me, it is never to late and I believe that I have stuff to say, and I can be useful at times, and really funny at other times, being 28 shouldn't stop me for starting doing to today! right? my prime spans 20 years, and I still have 12 to go, wow, that is an encouraging thought in itself, 12 years or prime, max productivity, (hopefully) health and (if I'm lucky) occasional happiness, that sounds like a good deal, and NOW always sound like a good time to start, yeah ...

So, here you would read a mix of deeply personal and extremely technical blogs, in English and in Arabic as well, you shall laugh, learn, like me, share stuff with me, and hate me occasionally, I don't mind, hope I have fun bloging, at first place and you have fun reading