Thoughts Over IP

A blog by Muhammad Hassan Nasr

0 notes &

There are only two hard things in Computer Science: cache invalidation and naming things
Phil Karlton

0 notes &

للرجال فقط … ياترى انت مسيطر ولا هى إلى مسيطره

عايز تعرف انت مسيطر ولا لأ
تعالى معايا
شوف نفسك قبل رمضان وبعده لو لقيت ان لسه فى معاصى ماسبتهاش وانك لسه مش مبتصلى فى المسجد -وبتسيب ٢٧ ضعف للثواب يروحوا منك - يبقى الشياطين هى إلى مسيطره عليك حتى وهى مربوطه ومتكتفه 
ازاى الكلام ده؟
 قال رسول الله (إذا كان أول ليلة في شهر رمضان صُفِّدت الشياطين ومَرَدَة الجن ، وغلقت أبواب النار فلم يُفتح منها باب ، وفتحت أبواب الجنة فلم يغلق منها باب ، وينادي منادٍ : يا باغي الخير أقبل، ويا باغي الشر أقصر . ولله عُتقاء من النار وذلك كل ليلة ) . حسنه الألباني في صحيح الجامع .
يعنى الشياطين متكفته ومنادى الخير ينادى 
ما الذى يمنعك من الخير؟
طب الحل ايه؟
ازاى اسيطر؟
بسيطه: حصن نفسك من الشيطان - قول اعوذ بالله من الشيطان الرجيم واقرأ ايه الكرسى واتوضا 
{اللهُ لاَ إِلَهَ إِلاَّ هُوَ الْحَيُّ الْقَيُّومُ لاَ تَأْخُذُهُ سِنَةٌ وَلاَ نَوْمٌ لَّهُ مَا فِي السَّمَاوَاتِ وَمَا فِي الأَرْضِ مَن ذَا الَّذِي يَشْفَعُ عِنْدَهُ إِلاَّ بِإِذْنِهِ يَعْلَمُ مَا بَيْنَ أَيْدِيهِمْ وَمَا خَلْفَهُمْ وَلاَ يُحِيطُونَ بِشَيْءٍ مِّنْ عِلْمِهِ إِلاَّ بِمَا شَاء وَسِعَ كُرْسِيُّهُ السَّمَاوَاتِ وَالأَرْضَ وَلاَ يَؤُودُهُ حِفْظُهُمَا وَهُوَ الْعَلِيُّ الْعَظِيمُ}
طيب انت كده ضحكت عليا انا كنت فاكرك حتقولى ازاى اسيطر على الجماعه فى البيت؟
لأ ماهو انت لو بعيد عن المعاصى وقريب من ربنا ومن طاعته انت اكيد حتسيطر على كل حاجه وحتكون فى معيه الله
 قال رسول الله صلى الله عليه وسلم “من صلى الصبح في جماعة فهو في ذمة الله تعالى”  اى فى ضمان الله - رواه مسلم
قال بعض الصالحين : “ إني لأجد أثر معصيتي في خلق دابتي وزوجتي “.
اشوفك بعد ما تسيطر : )

1 note &

Apple, Slowly but Surely…

It’s Apple again, moves slowly but surely. 

Applea company admired by many people around the world. I will not talk much about its success but I talk about something I noticed in the way it pushes new technology and features.

I noticed that Apple slowly pushes new features and it continues to enhance them step by step to surely result in a better implementation over other ordinary solutions, which ultimately lets Apple overbeat its competitors.

Sounds not clear, lets take some examples:

1. iOS Multitasking:

The first iPhone generation was release in June 2007, It was running iOS 1.x which did not support any kind of multitasking (almost). Only one app could be run at a time. This fact continued to exist till iOS 4.0 was released 3 years later (2010). For these 3 years the iPhone have been showing competency with other smart phones through its unique UI/UX, long lasting battery and other powerful features. During those years multitasking have been a weak point for the iPhone. Apply was not concerned with just pushing dozens of features, Apple was much concerned about the quality. It could have pushed multitasking since iOS 1.0 like other competitors (For ex: Android and even Symbian OS had years multitasking before iOS).

But Apple don’t want its device performance or battery to get affected. It wanted to keep its edge in what it is better in (which is user friendly UI and amazing hardware experience). The results is that iOS 4.0 had mutlitasking that is much usable to the user and the iPhone battery lasts for days comparable to Android devices which barely last for one day of similar usage.  Apple have implemented multitasking with some limitation to allow only important features/apps to run in the background. And apps that have nothing to do are just put to sleep and waked up again (in the same state) when user needs them. That way the processor (and battery) is not drained.

It did not stop there, 3 years laters again, iOS 7 now (2013) have smart multitasking, the iOS learns when the user likes to use his/her apps and can update the app content before the user launch them.  which give a much better user experience that other systems can’t offers currently.

2. Automatic Reference Counting (ARC) 

ARC is another example of how Apple goes slowly but surely for handling memory.

Years ago, most iOS apps and Mac OS X was built using objective-c which used release-retain memory management pattern. This required that developer send retain message (call retain) to each object that’s being used and send a release message it when he is done with that object, so object gets freed from memory when no one is retaining it.

Of course this was an overhead for developers, specially for those who were coming from the Java world where garabage collection is a builtin feature that comes for free. But when we look at release-retain pattern, we find that it is much better than automated garbage collectors (gc).

In Java world you don’t know when the gc will start to clean the memory. Suddenly while you run a Java program you find it hanging for a few seconds and then you say, oh gc must be running now.

In release-retain memory management, objects are freed just when they are not needed not when the gc decides. So you get free memory much sooner than gc and the app does not hang everywhile.

The only problem with release-retain was the overhead required by the developer to maintain release/retain calls approperly.

This was finally solved in 2011 when Apple introduced Automatic Reference Counting (ARC) which handles sending release/retains messages automatically. Actually ARC is done on the compiler level so it does not affect runtime performance as the gc does.

Now the developer have the luxury of using gc (almost) and the app is much faster and better in memory than gc apps which translates into better UX, battery usages and better Apple…


Do you have other examples that makes Apple “Slowely but shorely”? add them as a comment below.

Have a mobile idea and wanna convert to a real app? We will be happy to give a free quotation.

Filed under ios ios 7 ios 4 multitasking gc automatic reference counting arc apple ux