Explore Yourself !!!


An interesting/ practical view!!
January 15, 2009, 6:46 pm
Filed under: Others

Demographics:
o World Jewish Population. 14 million
o Distribution: 7 m in America
5 m in Asia
2 m in Europe
100 thousand in Africa
o World Muslim Population: 1.5 billion
o Distribution: 1 billion in Asia/Mid-East
400 M in Africa
44 M in Europe
6 M in the Americas
o Every fifth human being is a Muslim.
o For every single Hindu there are two Muslims
o For every Buddhist there are two Muslims
o For every Jew there are 107 Muslims
o Yet the 14 million Jews are more powerful than the entire 1.5 billion Muslims

Why?

Here are some of the reasons.

Movers of Current History
o Albert Einstein Jewish
o Sigmund Freud Jewish
o Karl Marx Jewish
o Paul Samuelson Jewish
o Milton Friedman Jewish

Medical Milestones
o Vaccinating Needle: Benjamin Ruben Jewish
o Polio Vaccine Jonas Salk Jewish
o Leukaemia Drug Gertrude Elion Jewish
o Hepatitis B Baruch Blumberg Jewish
o Syphilis Drug Paul Ehrlich Jewish
o Neuro muscular Elie Metchnikoff Jewish
o Endocrinology Andrew Schally Jewish
o Cognitive therapy. Aaron Beck Jewish
o Contraceptive Pill Gregory Pincus Jewish
o Understanding of Human Eye. G. Wald Jewish
o Embryology. Stanley Cohen Jewish
o Kidney Dialysis Willem Kloffcame Jewish

Nobel Prize Winners
o In the past 105 years, 14 million Jews have won 180 Nobel prizes whilst 1.5 billion Muslims have contributed only 3 Nobel winners

Inventions that changed History
o Micro- Processing Chip. Stanley Mezor Jewish
o Nuclear Chain Reactor Leo Sziland Jewish
o Optical Fibre Cable Peter Schultz Jewish
o Traffic Lights Charles Adler Jewish
o Stainless Steel Benno Strauss Jewish
o Sound Movies Isador Kisee Jewish
o Telephone Microphone Emile Berliner Jewish
o Video Tape Recorder Charles Ginsburg Jewish

Influential Global Business
o Polo Ralph Lauren Jewish
o Coca Cola Jewish
o Levi’s Jeans Levi Strauss Jewish
o Sawbuck’s Howard Schultz Jewish
o Google Sergey Brin Jewish
o Dell Computers Michael Dell Jewish
o Oracle Larry Ellison Jewish
o DKNY Donna Karan Jewish
o Baskin & Robbins Irv Robbins Jewish
o Dunkin Donuts Bill Rosenberg Jewish

Influential Intellectuals/ Politicians
o Henry Kissinger , US Sec of State Jewish
o Richard Levin, PresidentYaleUniver sity Jewish
o Alan Greenspan , US Federal Reserve Jewish
o Joseph Lieberman Jewish
o Madeleine Albright , US Sec of State Jewish
o CasperWeinberger , US Sec of Defence Jewish
o Maxim Litvinov , USSR Foreign Minister Jewish
o DavidMarshal , Singapore Chief Minister Jewish
o Isaacs Isaacs, Gov-GenAustralia Jewish
o Benjamin Disraeli, British Statesman Jewish
o Yevgeny Primakov, Russian PM Jewish
o Barry Goldwater , US Politician Jewish
o Jorge Sampaio, President Portugal Jewish
o Herb Gray, Canadian Deputy – PM Jewish
o Pierre Mendes, French PM Jewish
o Michael Howard, British Home Sec. Jewish
o Bruno Kriesky, Austrian Chancellor Jewish
o Robert Rubin , US Sec of Treasury Jewish

Global Media Influential
o Wolf Blitzer, CNN Jewish
o Barbara Walters ABC News Jewish
o EugeneMeyer , Washington Post Jewish
o Henry Grunwald, Time Magazine Jewish
o Katherine Graham , Washington Post Jewish
o Joseph Lelyeld, New York Times Jewish
o Max Frankel, New York Times Jewish

Global Philanthropists
o George Soros Jewish
o Walter Annenberg Jewish

Why are they powerful? Why are Muslims powerless?
Here’s another reason. We have lost the capacity to produce knowledge.

o In the entire Muslim World (57 Muslim Countries) there are only 500 universities.
o In USA alone, 5,758 universities
o In India alone, 8,407 universities
o Not one university in the entire Islamic World features in the Top 500 Ranking Universities of the World
o Literacy in the Christian World 90%
o Literacy in the Muslim World 40%
o 15 Christian majority-countries, literacy rate 100%
o Muslim majority – countries , None
o 98% in Christian countries completed primary
o Only 50% in Muslim countries completed primary.
o 40% in Christian countries attended university
o In Muslim countries a dismal 2% attended.
o Muslim majority countries have 230 scientists per one million Muslims
o The USA has 5000 per million
o The Christian world 1000 technicians per million.
o Entire Arab World only 50 technicians per million.
o Muslim World spends on research/developmen t 0.2% of GDP
o Christian World spends 5 % of GDP

Conclusion.
o The Muslim World lacks the capacity to produce knowledge.

Another way of testing the degree of knowledge is the degree of diffusing knowledge.

o Pakistan 23 daily newspapers per 1000 citizens
o Singapore 460 per 1000 citizens.
o In UK book titles per million is 2000
o In Egypt book titles per million is only 17

Conclusion.
o Muslim World is failing to diffuse knowledge

Applying Knowledge is another such test.
o Exports of high tech products from Pakistan is 0.9% of its exports.
o In Saudi Arabia is 0.2%
o Kuwait , Morocco and Algeria 0.3%
o Singapore alone is 68%

Conclusion.
o Muslim World is failing to apply knowledge.

What do you conclude? no need to tell the figures are speaking themselves very loudly we are unable to listen
Advice:
Please educate yourself and your children. always promote education, don’t compromise on it, don’t ignore your children’s slightest misguidance from education (and please, for God’s Sake, don’t use your personal contacts or sources to promote your children in their education; if they fail, let them and make them learn to pass; b/c if they can’t do it now, they can’t ever).
We are World’s biggest and strongest nation, all we need is to identify and explore our ownselves. Our victory is with our knowledge, our creativity, our literacy…And nothing else.



The MVC Architecture & Layout(Decorator Design Pattern)

[Note: 100% copy and paste from symfony web site]
If you are used to developing PHP websites without a framework, you probably use the one PHP file per HTML page paradigm. These PHP files probably contain the same kind of structure: initialization and global configuration, business logic related to the requested page, database records fetching, and finally HTML code that builds the page.
You may use a templating engine to separate the logic from the HTML. Perhaps you use a database abstraction layer to separate model interaction from business logic. But most of the time, you end up with a lot of code that is a nightmare to maintain. It was fast to build, but over time, it’s more and more difficult to make changes, especially because nobody except you understands how it is built and how it works.
As with every problem, there are nice solutions. For web development, the most common solution for organizing your code nowadays is the MVC design pattern. In short, the MVC design pattern defines a way to organize your code according to its nature. This pattern separates the code into three layers:
• The Model layer defines the business logic (the database belongs to this layer). You already know that symfony stores all the classes and files related to the Model in the lib/model/directory.
• The View is what the user interacts with (a template engine is part of this layer). In symfony, the View layer is mainly made of PHP templates. They are stored in varioustemplates/ directories as we will see later on today.
• The Controller is a piece of code that calls the Model to get some data that it passes to the View for rendering to the client. When we installed symfony the first day, we saw that all requests are managed by front controllers (index.php and frontend_dev.php). These front controllers delegate the real work to actions.

MVC Architecture

MVC Architecture

The Layout

First, if you have a closer look at the mockups, you will notice that much of each page looks the same. You already know that code duplication is bad, whether we are talking about HTML or PHP code, so we need to find a way to prevent these common view elements from resulting in code duplication.
One way to solve the problem is to define a header and a footer and include them in each template:

Header Footer

Template using Header Footer

But here the header and the footer files do not contain valid HTML. There must be a better way. Instead of reinventing the wheel, we will use another design pattern to solve this problem: the decorator design pattern. The decorator design pattern resolves the problem the other way around: the template is decorated after the content is rendered by a global template, called a layout in symfony:

Decorator Design Pattern

Decorator Design Pattern



Build a small project
January 13, 2009, 11:52 pm
Filed under: Symfony | Tags: , , ,

well here we are for build second symfony project. previously we have seen, how difficult first project was without a single line of php code. here is the second one similar to first project. but this time not only signp form. instead we implement a small project. lets start
propel:
article:
id: ~
title: { type: varchar(255), required: true }
slug: { type: varchar(255), required: true }
content: longvarchar
status: varchar(255)
author_id: { type: integer, required: true, foreignTable: author, foreignReference: id, OnDelete: cascade }
category_id: { type: integer, required: false, foreignTable: category, foreignReference: id, onDelete: setnull }
published_at: timestamp
created_at: ~
updated_at: ~
_uniques:
unique_slug: [slug]

author:
id: ~
first_name: varchar(20)
last_name: varchar(20)
email: { type: varchar(255), required: true }
active: boolean

category:
id: ~
name: { type: varchar(255), required: true }

tag:
id: ~
name: { type: varchar(255), required: true }

article_tag:
article_id: { type: integer, foreignTable: article, foreignReference: id, primaryKey: true, onDelete: cascade }
tag_id: { type: integer, foreignTable: tag, foreignReference: id, primaryKey: true, onDelete: cascade }

now goto command prompt and run few commands we already practice yesterday:

  • from DOS prompt d:\dev\small_project> php symfony propel:build-all
  • from DOS prompt d:\dev\small_project> php symfony propel:generate-crud frontend article Article
  • from DOS prompt d:\dev\small_project> php symfony propel:generate-crud frontend author Author
  • from DOS prompt d:\dev\small_project> php symfony propel:generate-crud frontend category Category
  • that’s it. readymade module for you. browse your project using:
    http://loclhost:420/author

    Hey!! i have no idea which client like this project ;) but yes developer might like it for customization and build a genuine one :)



Build your first symfony project
January 11, 2009, 9:41 am
Filed under: Symfony | Tags: , , , ,

Good time to build first simple symfony project. The project is very simple one. Build a Signup form. Don’t blame me, how a signup form can be a project !!!. Yes it is :) Lets Start.

Before start follow the instructions make sure you have successfully configured symfony in your local PC. which mean, your PHP, MySql and Apache are perfectly installed. Moreover, PEAR library is also installed and you have enabled PHP CLI (Command Line Instruction). Fair enough :) you have all these installed and support. So lets get start!!!

First create a folder with your project name. for example, for this tutorial we name the project signup. Say we create a folder at d:\dev\signup and we create two sub folder named lib and vendor. which mean the directory structure is exactly d:\dev\signup\lib\vendor. okay !! now donwload symfony latest stable package from here and extract it inside d:\dev\signup\lib\vendor. rename the extract folder to symfony. which mean our structure is like D:\dev\signup\lib\vendor\symfony\ and at this location we get some folders (data, doc, lib, etc etc).

Hang ON!! Don’t dive!! Before that, we need to analyze what exactly we are going to do. we have to build a signup page and a success page. That’s all !!!! Signup Form: only 3 fields: name, email and sex(male or female). as though you all are quite mature lets define specific. we use html text box for name and email and radio button for sex. Success Form: simply a message. Operation Successful !! Very easy requirement for us. if we start write raw coding then it must not take more then 20 minutes of us. Right? Let’s see how long symfony take for this tiny requirement.

LETS DIVE !! DIVE !! DIVE !! DIVE !! DIVE !! DIVE !!

  • Goto Start->Run->cmd press enter
  • navigate to d:\dev\signup
  • Setup your PROJECT by d:\dev\signup>php lib\vendor\symfony\data\bin\symfony generate:project signup =) lot of files automatically generated for you :)
  • Create frontend application using d:\dev\signup>php symfony generate:app –escaping-strategy=on –csrf-secret=Unique$ecret frontend =) lot of file again automatically generated for you at d:\dev\signup\app\frontend :)

Upto this step these are common for any types of projects like facebook.com or ebay.com. :) Lets dive into symfony to build our HUGE signup project. Till now we have not write a single line of code and it’s time for us to do that. Let’s remember our requirement. it was a signup form with only 3 fields. This is the most most most tricky one. Lot’s of class, form, validation etc etc will create automatically based on our object signup. So lets build our object first. How? very easy


// D:\dev\signup\config\schema.yml
propel:
member: id: ~ name: { type: varchar(255), required: true }
email: { type: varchar(255), required: true }
sex: { type: varchar(255), required: true }

and customize your database file

// D:\dev\signup\config\databases.yml
dev:
propel:
param:
classname: DebugPDO
test:
propel:
param:
classname: DebugPDO
param:
classname: DebugPDO
dsn: 'mysql:host=localhost;dbname=signup_test'
username: root
password: null
all:
propel:
class: sfPropelDatabase
param:
classname: PropelPDO
dsn: mysql:dbname=signup_dev;host=localhost
username: root
password:
encoding: utf8
persistent: true
pooling: true

Is the class, form etc etc created by writing only these above line of code? It’s impossible. Yes it’s really impossible until you run few lines of code at command prompt. Lets do that.

  • first create create two database named signup_dev and signup_test from your browser http://localhost/phpmyadmin
  • now from command promt: d:\dev\signup>php symfony propel:build-all automatically generate lot of classes for you inside d:\dev\signup\lib\. don’t get any file? don’t worry look inside model, form, filter folder :D

i hope you have fair experience of PORT BASED SETUP. if No then you are most welcome :) . simply add these lines at the end of your configuration file apache\conf\httpd.conf


Listen 127.0.0.1:8081
DocumentRoot "D:\dev\signup\web" DirectoryIndex index.php
AllowOverride All Allow from All
Alias /sf D:\dev\signup\lib\vendor\symfony\data\web\sf
AllowOverride All Allow from All

Run http://localhost:8081/frontend_dev.php what comes in browser? “Symfony Project Created”. right? which mean’s you are Successful at first stage!! YEAAAAAAA !! Lets celebrate!!

Well let’s move forward.
From command promt: d:\dev\signup>php symfony generate:module frontend member
Have a look inside app\frontend\module. A ready made module named member for us :)
another one: d:\dev\signup>php symfony propel:generate-crud frontend member Member

That’s it!!! Member module is 100 % complete. which means you can add, edit, update, delete a member with proper VALIDATION. did you write a single line of php code? i don’t think so. browse

http://localhost:8081/member
default display a list of members and option for add new one, edit existing one, delete or update any one.

hope you have not enjoyed. because either you know symfony very well, then this article is waste of time for you :D in contrast, no knowledge of symfony means this article is not fair enough to understand. i am afraid but you need to http://www.symfony-project.org. which means waste of time with this article :D

BEST OF LUCK :)



build first symfony project
January 11, 2009, 8:09 am
Filed under: Symfony | Tags: , ,

Good time to build first simple symfony project. The project is very simple one. Build a Signup form. Don’t blame me, how a signup form can be a project !!!. Yes it is :) Lets Start.

Before start follow the instructions make sure you have successfully configured symfony in your local PC. which mean, your PHP, MySql and Apache are perfectly installed. Moreover, PEAR library is also installed and you have enabled PHP CLI (Command Line Instruction). Fair enough :) you have all these installed and support. So lets get start!!!

First create a folder with your project name. for example, for this tutorial we name the project signup. Say we create a folder at d:\dev\signup and we create two sub folder named lib and vendor. which mean the directory structure is exactly d:\dev\signup\lib\vendor. okay !! now donwload symfony latest stable package from here and extract it inside d:\dev\signup\lib\vendor. rename the extract folder to symfony. which mean our structure is like D:\dev\signup\lib\vendor\symfony\ and at this location we get some folders (data, doc, lib, etc etc).

Hang ON!! Don’t dive!! Before that, we need to analyze what exactly we are going to do. we have to build a signup page and a success page. That’s all !!!!

Signup Form: only 3 fields: name, email and sex(male or female). as though you all are quite mature lets define specific. we use html text box for name and email and radio button for sex.
Success Form: simply a message. Operation Successful !!

Very easy requirement for us. if we start write raw coding then it must not take more then 20 minutes of us. Right? Let’s see how long symfony take for this tiny requirement.

LETS DIVE !! DIVE !! DIVE !! DIVE !! DIVE !! DIVE !!

  • Goto Start->Run->cmd press enter
  • navigate to d:\dev\signup
  • Setup your PROJECT by d:\dev\signup>php lib\vendor\symfony\data\bin\symfony generate:project signup
    =) lot of files automatically generated for you :)
  • Create frontend application using d:\dev\signup>php symfony generate:app –escaping-strategy=on –csrf-secret=Unique$ecret frontend
    =) lot of file again automatically generated for you at d:\dev\signup\app\frontend :)

Upto this step these are common for any types of projects like facebook.com or ebay.com. :) Lets dive into symfony to build our HUGE signup project.

Till now we have not write a single line of code and it’s time for us to do that. Let’s remember our requirement. it was a signup form with only 3 fields. This is the most most most tricky one. Lot’s of class, form, validation etc etc will create automatically based on our object signup. So lets build our object first. How? very easy
// D:\dev\signup\config\schema.yml
propel:
member:
id: ~
name: { type: varchar(255), required: true }
email: { type: varchar(255), required: true }
sex: { type: varchar(255), required: true }

and customize your database file
// D:\dev\signup\config\databases.yml
dev:
propel:
param:
classname: DebugPDO

test:
propel:
param:
classname: DebugPDO
param:
classname: DebugPDO
dsn: 'mysql:host=localhost;dbname=signup_test'
username: root
password: null

all:
propel:
class: sfPropelDatabase
param:
classname: PropelPDO
dsn: mysql:dbname=signup_dev;host=localhost
username: root
password:
encoding: utf8
persistent: true
pooling: true

Is the class, form etc etc created by writing only these above line of code? It’s impossible. Yes it’s really impossible until you run few lines of code at command prompt. Lets do that.

  • first create create two database named signup_dev and signup_test from your browser http://localhost/phpmyadmin
  • now from command promt: d:\dev\signup>php symfony propel:build-all
    automatically generate lot of classes for you inside d:\dev\signup\lib\. don’t get any file? don’t worry look inside model, form, filter folder :D

i hope you have fair experience of PORT BASED SETUP. if No then you are most welcome :) . simply add these lines at the end of your configuration file apache\conf\httpd.conf

Listen 127.0.0.1:8081

DocumentRoot "D:\dev\signup\web"
DirectoryIndex index.php

AllowOverride All
Allow from All

Alias /sf D:\dev\signup\lib\vendor\symfony\data\web\sf

AllowOverride All
Allow from All


now try to run http://localhost:8081/frontend_dev.php what comes here? “Symfony Project Created”. right? which mean’s you are Successful at first stage!! YEAAAAAAA !! Lets celebrate!!



Start taking Taste of Web development with PHP
January 6, 2009, 12:09 am
Filed under: LAMP | Tags: , ,

 

Taste of Web development using PHP

 Well at this stage, we know how to setup PHP, MySql and Apache. We have installed either XAMP or WAMP (ready made package of PHP, MySql and Apache). Moreover we run a simple PHP script hello_world.php. Which means now we are able to create a project, write php code and run it in browser.

Lets move forward with a simple page with some HTML controls. Lets define our requirement first.

It’s a member information page with the following fields: first name, last name, email, contact no, present address and sex. When we enter data and submit this page it will goes to another page and shows the information. That’s all for today.

Lets start. Our first task is to create a simple page member_info.php. Now lets add the fields first name, last name, email, contact no, present address and sex. Before write a single line of code we have to think first, which HTML fields we will use. For first name, last name, email address it’s fair to choice text box. Moreover, for present address wise to select text area as though address need multiple line of input. Lastly, for sex it’s clever decision to choose radio button with predefined values Male and Female. So here is our page member_information.php.

 

Untitled Document

Welcome to Member Information Page
First name
Last Name
Email
Address
Sex Male

Female

 

Now when you browse this page (like: http://localhost/project_name/member_information.php ) you will get all fields of your page. When you enter some informations and press submit the page goes to http://localhost/project_name/success.php. Lets clarify how is it works. if you observe this page closely you found

//some html controls.. text box, radio button and submit button


A submit button is fully responsible to submit the page to server along with all inputed informations. And form action=”success.php” define where these informations will be submitted. As a result it submits to success.php. Hey!!! It shows you No page Found 404 Error Right? Don’t worry. You are correct. Just make sure your URL (at address bar) end with success.php.

Well at second step. lets build success.php. This is a simple page where we show all data inputed at member_information.php. Here is the code of success.php

Untitled Document

Welcome to Member Information Page
First name
Last Name
Email
Address
Sex

So you get your inputed data. right? Right now you url in address bar is http://localhost/project_name/success.php Lets analyze success.php. Actually we use here $_POST['field_name'] to display any field_name value. By example, we have

which means address is a HTML field what is submitted to success.php through a POST method. Lets remind our mind we have

in member_information.php page.

that’s all for today. Try yourself to understand how this page is working. test by add some fields like phone number in member_information.php page and display it at success.php.

Best of luck :)