Archive for the ‘I recommend’ Category
Singleton mySQL database connection using PHP
فيما يلي مثال على الـ Singleton Design Pattern
و هو ما يعطيك الإمكانية في الحصول علي فقط نسخة واحدة من أي مورد تريد إستخدامه .. في هذة الحالة مثلا الإتصال بقاعدة البيانات و ذلك بأن تستخدم الدالة getConnection بدلا من عمل نسخة جديدة من connection كل مرة هتحاول فيها الإتصال بقاعدة البيانات..
Following is a brief example for the singleton design patterns which will enable you from having only one instance of the resource you are controlling .. in this example it’s the mySQL database connection.
Else you will have multiple instances of the same class “connection” each time you want to connect.
define('DB_NAME', "test");
define('DB_USER', "root");
define('DB_PASS', "rootpass");
define('DB_HOST', "localhost");
class Connection{
private static $connection_;
private function __construct(){
$con = mysql_connect(DB_HOST, DB_USER, DB_PASS);
mysql_select_db(DB_NAME, $con);
Connection::$connection_ = $con;
}
public static function getConnection(){
if( !Connection::$connection_ )
new Connection;
return Connection::$connection_;
}
}
$con = Connection::getConnection();
في رعاية الله و أمنه
TDD using PHPUnit, NetBeans
السلام عليكم و رحمة الله وبركاته
This post is more than month on my drafts ..
It’s about using NetBeans 6.7.1 PHP IDE with PHPUnit I wanted to show how easy is it to make a test and run it ..
so I’ll share the experiment ..
As shown in the following slideshow:
1-I created a PHP Class file:
2-I created empty file with a class and couple of methods
3-I generated a test for the class and it prompted me to choose the folder where I’ll put the tests
4-Finally(My favorite part) I right click the test file to run it and I get the result in green and red … obviously
green is test passed or pending and red if it’s failed ..
Note: I used to use simple test , still can’t find equivalent test method to test the HTML interface … and it always required me to view the test results in the browser ..
PHPUnit is more fun now and it’s integrated to NetBeans, the IDE I recently love at most specially on Mac
tadabor.com, one more 7-12 website
السلام عليكم و رحمة الله وبركاته
الحمد لله والصلاة والسلام على رسول الله
أنه لمن دواعي سروري ان أعلن إني فعلا فخور بموقع الهيئة العالمية لتدبر القرآن الكريم
و شكرا لـ:
My dear framework 7-12
م.محمد العشري مدير شركة تدبر
وشكر خاص جدا .. لماهر سيف “الماهر بأمر الله ” اللي بهدل ٧-١٢ ![]()
فريق التصميم في شركة تدبر و مهندس علاء الدين حسين .
وأسأل الله العظيم رب العرش العظيم أن يجعل الموقع و المواد المتاحة عليه في ميزان حسناتنا وميزان حسنات الشيوخ القائمين عليه و الهيئة وأن ينفع الله به الكثير من الباحثين عن الهداية و طلبة العلم من المسلمين والمسلمات.. اللهم آمين .. اللهم آمين .. اللهم آمين ..
والحمد لله رب العالمين
google docs children pt.2
السلام عليكم و رحمة الله وبركاته
In this post I’m completing what I’ve started talking about in last post ..
I talked about online /web applications that are evolving so fast ..and I made google docs the father of these applications for a reason .
كلامي المره السابقة كان يقصد انظمة التشغيل اللي احنا فعلا ممكن نحس انها استغلت انها
WEB BASED
ببساطه كل التطبيقات اللي عرضتها المره السابقة كانت بتعمل version control ألى جانب الخدمة وكلها كان فيها collaboration
وكلها ممكن تشغلها مع services تانيه و يمكن يكون ليهم هما كمان api و هو ده بالظبط اللي مفروض يكون عليه الonline operating system….
الموضوع مش موضوع انك تخلي الdesktop applications تبقى webapplication لأن أكيد هتكون الغلبه والسرعة في الاخر للdesktop application اللي ليها حق الأستخدام المباشر لموارد الماكنه اللي انت بتستخدمها .. بعكس ال web browser اللي دايما ولأسباب أمنيه بحته هيفضل قدراته محدوده ..
وعشان كده انا كل يوم بيزيد إعجابي ب google docs لأنهم شافوا ان الdocs تبقى online احسن إزاي وعملوها ..
واللي كمان كان شاددني في البوست السابق اني لاحظت ان الoperating system اللي بفكر فيه في واقع الأمر ممكن يكون مش بعيد لأنه الوقتي -فقط- محتاج يلم الAPIs بتاعة التطبيقات الموجوده online ويلمها في موقع واحد ويبقى لما تشغل office تستخدم google docs ولما تعمل search تستخدم google search API و كده ..
اسف على الإطاله
في أمان الله
google docs children {yUML,minmeister,www-sql-designer,creatly}
السلام عليكم و رحمة الله وبركاته
Today I’m intending to talk about some of the websites that really made me feel like the online operating system idea is closer than what you may think ..
Following websites are illustrating the idea I’m talking about:
1-yUML.me Beta websites that lets you create a very nice UML and Use cases diagrams easily and with very easy syntax, and the most important thing is you can get these resultant designs in URLs like that one:
NOTE: the code after the “usecase/” is the code you made to create the following diagram:

Quickpost this image to Myspace, Digg, Facebook, and others!
mindmeister.com : besides being a very nice and easy to edit mind maps tool.. it has a very nice option which is collaborative work ..
which means you can invite your friends and work together in the same mind map .. which is super fun ..
And guess what again it’s free and i tried it in some applications and the last one was CAT document and I worked on it with Mohammed Safwat and mohammed el Emam ![]()
Another Suppper option is the Export option .. which is the ability to export PDF, Images. rtf, and other desktop mind map tools {mindmanager, free mind}formats if you want from the online one you made .. which saved a loooot of time to me .. and YOU HAVE TO TRY it ..!
زز
Quickpost this image to Myspace, Digg, Facebook, and others!
And for programmers; you have to see this ..
http://ondras.zarovi.cz/sql/demo/
….to be continued انا رايح ألعب ينج بونج ..
في رعاية الله و أمنه
Bing Search Engine – big search engine ?
السلام عليكم ورحمة الله وبركاته
If you are a technology freak and following IT news websites and if you are not ..If you are following Microsoft news and if you are not ..if you are closed source supporter and if you are not ..
If you have heard about
Or not ..
Here’s my personal feedback and review on bing…
First while talking about bing you may need to open these links in new tabs:
http://alexa.com/siteinfo/bing.com+google.com
http://alexa.com/siteinfo/google.com+bing.com
Commenting Alexa
It’s obvios that google is #1 and is going to be there stable for long time .. but it’s great to notice the unbelievable increase in bing statistics ..
you may also change the resolution to trailing 7 days to understand how fast it’s ..
WHY ?
For the following reasons I’m posting about bing
1-I was wondering why do someone bing like Microsoft insist on competing with google enhancing live or even launching bing although they really know that google is google ..!
2-bing became a buzz word lately on internet
3-When I gave it a try it wasn’t live search disguised as I expected .. It’s some features to talk about..
4-It’s well known that microsoft wants to acquire yahoo and suddenly I heard the news that they withdrawn the proposal .. and I don’t mean that there is a conspiracy here but it’s so strange ..
Technically Personally Speaking
Technically It sounds like google is faster but i’m not talking about that now, specially that I’ll not be fair if I commented any of them technically .. so that what I saw from my eye-balls..
I visited it once I got the news that it was launched and I was about to bounce once I opened the site ..
Google -as a competitor in my head- has a great simple home page and I’m quite sure that no one will lose his direction or search alot to reach the destination and as I can see it’s a super picture here that sounds to be over design for the first moment..
- BUT,It’s not any RANDOM picture
bing is placing a new picture everyday and related links on the picture which is great from many point of views that you may deduce yourself but for sure the one you may not get directly is the impact of that picture on people living in the picture and you may get the feeling by imaging
Mansoura university the background of bing search engine
.. ok I should stop day dreaming ..
- Maps
While talking with Mohammed Atia he pointed me that bing maps is different than google maps as they are in angle and not a very high top view like the google ones ..
I still like google maps and it’s highly integrated, specially with open APIs but bing really uses maps WISELY .. specially in integration with people search which is NEW to me.. - Other features like your dinner tonight/ breakfast, popular now and Travel are nice enough to check also ..
- I’m not a big fan of M$ so I’m totally satisfied with google .. and still can’t get what microsoft is heading to ..!
Sorry for the long post and here comes my personal news:
بس انا لغاية الوقتي مطمئن عشان عدد الساعات اللي بحس فيها بتضيع الوقت قل جدا وحتى لو حصل بلاقيها ظبطت من ناحية تانيه او وفرت شغل في يوم تاني وكده ..
الموضوع القادم إن شاء الله
yUML.me, google docs and mindmeister.com
ولاحقا..
day dreaming: GAE and web2py
