After developing a project in Zend framework, I mentioned it on my CV and started applying for a job in new organization. oops in short span of 2 days i received interview calls from two organization straight away asking about zend framework. I realized how nice it is to have third party tool on a resume. However the problem is that different organizations are working on different frameworks. some on symfony, while other on cake and zend etc.
In first interview I was ask about CakePhp, but I was blank at that time, and my reply was "I haven't had the taste of cakePhp". The reason why i choose Zend instead of cake is simple.
"Initial configuration of cake is a bit difficult".
And this was my answer in interview too.
Now I have received a second call from the same organization and sure that they would hire me. however salary can change things suddenly.
hmm I think after wasting 8 to 9 months I need to join a good software house. This is very important for my future. Although i have worked on a project in zend, know how to work in ajax and good understanding of OOPs and Databases, but i haven't developed ecommerce and social networking sites. and i think it is important to work on this type of sites to secure my future in information technology field.
Jul 21, 2008
Jul 18, 2008
Zend_Search_Lucene: amazing
I was always looking for a tool that enabled me to develop a search engine like Gooooogle. I don't like to put search on any website who direct users to google and google search pages for them. I was always looking to develop a search program that index all my website pages and when someone search a word or phrase, he/she find all the pages on my website with that word or phrase.
Although lot of websites provide the ability to search product or services they offer. The search is simple and limited because it only search the database not the website pages. however i haven't seen any which facilitate visitors to search their website pages.
Today, however I found solution in the form of Zend_Search_Lucene. It's based on the apache lucene(I don't have knowledge of apache lucene).
With the help of Zend_Search_Lucene you can crawel all your pages. Once the pages all crawled, the contents on your webiste are stored in the filesystem.
And later when someone search on your site you can programmatically retrieve those information and show them on the page.
I'll once again appraciate Zend Framework team for doing such a fabolous job.
Thanks Zend Team
Although lot of websites provide the ability to search product or services they offer. The search is simple and limited because it only search the database not the website pages. however i haven't seen any which facilitate visitors to search their website pages.
Today, however I found solution in the form of Zend_Search_Lucene. It's based on the apache lucene(I don't have knowledge of apache lucene).
With the help of Zend_Search_Lucene you can crawel all your pages. Once the pages all crawled, the contents on your webiste are stored in the filesystem.
And later when someone search on your site you can programmatically retrieve those information and show them on the page.
I'll once again appraciate Zend Framework team for doing such a fabolous job.
Thanks Zend Team
Jul 14, 2008
Zend_Db_Table: its very cool
I have already written about Zend framework. Its very nice open source framework for lazy programmers like me. You can find everything in the box.
Recently I studied Zend_Db_Table, and found it pretty helpful. After creating the database, you need to define a class for every table in the database as
class tablename extends Zend_DB_Table
{
}
Its important that tablename must match the table name in the database. It you don't want the class name to be similar to the table name in the database then define class as
class what_ever_name_you_want extends Zend_Db_Table
{
protected $_name='tablename'; // It's compulsory.
}
If you don't define the name as above, then you will encounter an error.
And that's it. you can now perform different operation like select, insert, delete etc without writing a single query.
if you want to fetch a single row then write
$object=new class_name();
$row=$object->fetchRow('conditon');// condition can be 'id=1';
The above code will now retrieve a single row from the table.
Similarly its very easy to update, insert and delete the data from the database.
If you are intrested you can visit Zend documentation.
Recently I studied Zend_Db_Table, and found it pretty helpful. After creating the database, you need to define a class for every table in the database as
class tablename extends Zend_DB_Table
{
}
Its important that tablename must match the table name in the database. It you don't want the class name to be similar to the table name in the database then define class as
class what_ever_name_you_want extends Zend_Db_Table
{
protected $_name='tablename'; // It's compulsory.
}
If you don't define the name as above, then you will encounter an error.
And that's it. you can now perform different operation like select, insert, delete etc without writing a single query.
if you want to fetch a single row then write
$object=new class_name();
$row=$object->fetchRow('conditon');// condition can be 'id=1';
The above code will now retrieve a single row from the table.
Similarly its very easy to update, insert and delete the data from the database.
If you are intrested you can visit Zend documentation.
Jul 12, 2008
Nice Weather but.....
Rain in the morning made the weather pleasant, and the breeze added some spice too when I was looking from window. However when I put on my clothes, laced my shoes up and came out of the gate the things suddenly changed, because I could see water all around. The things wasn't seemed nice to me 'coz I wasn't expecting that much water. Although whenever it rain I always expect some water in front of a house we are living in, however it was beyond my expectations. After waking for a minute or two I found myself stuck in the middle of water and there was nowhere to escape. I suddenly realized that the idea of going to office wasn't good enough. After waiting and holding my nerves under control I managed to take a lift from a person on bike. I usually hate bikes and those how ride them, but I feel better when someone give me lift whenever I need one. I thanked the person when he rode me to the bus stop. I wasn't aware of the fact that I will stuck in the middle of jammed traffic next. I found that when I reached the place where many like me were I think cursing themselves for coming out of their houses. There was more water than I just saw. Oh my God many cars were stuck in the water and the drivers just disappeared, coz it seemed nowhere for those little vehicle to go through the flood. I could see some auto rickshaws without their drivers as well.
The bus reached to the next stop after creeping for about 45 minutes-we reach the same place not more than 15 minutes in normal days.
I took a sigh of relief at that moment. I was sure that i won't face the same situation again. And I was right. Although I did faced some bed situation ahead, however they were not as bed as I just faced before. I am not sure wahter or not I will confront the same situation when I return home.
The bus reached to the next stop after creeping for about 45 minutes-we reach the same place not more than 15 minutes in normal days.
I took a sigh of relief at that moment. I was sure that i won't face the same situation again. And I was right. Although I did faced some bed situation ahead, however they were not as bed as I just faced before. I am not sure wahter or not I will confront the same situation when I return home.
Labels:
Storage
Jul 10, 2008
"A Painted House" by John Grisham
Nowadays I am reading a novel "A Painted House" by John Grisham. Its about a small boy named Luke living in a small town. His father has rented a land and grown cotton. They have hired Mexicans and hillbilly to pick their cotton. Luke, his parents and grandfather Pappy also picked cotton. Luke dream is to be in Cardinals baseball team rather than a framer like his father.
The story seems simple but quite interesting. I've enjoy every bit of it so far and feel it will be more interesting when i move forward.
Someone may have a question in his mind why a novel?
And i would simply answer because I am alone these days in Lahore. My uncle and his kids have been to village, so no one to play with. So I think its better to read a novel rather than spoil myself watching TV all the way. It will not only improve my English but also give a good company until my mamu and kids return back. The another good thing is I can read it at the bus stop waiting for bloody bus to arrive. I can even read it if luckily find a seat in the bus.
So far I feel its a good friend of mine.
The story seems simple but quite interesting. I've enjoy every bit of it so far and feel it will be more interesting when i move forward.
Someone may have a question in his mind why a novel?
And i would simply answer because I am alone these days in Lahore. My uncle and his kids have been to village, so no one to play with. So I think its better to read a novel rather than spoil myself watching TV all the way. It will not only improve my English but also give a good company until my mamu and kids return back. The another good thing is I can read it at the bus stop waiting for bloody bus to arrive. I can even read it if luckily find a seat in the bus.
So far I feel its a good friend of mine.
Labels:
Storage
Jul 9, 2008
Public transport , a delimma
When I was in Peshawar university, we were of the view that Punjab public transport is far more better then Peshawar, although we hadn't been here at that time, however it was common in us that students in Punjab travel free in buses and the condition of the buses is good. However I have been in Lahore for the last one year and the situation is completely contrary. When you travel by these buses you surely will have a sigh of relief even when think about public transport in Peshawar.
I even have been to Karachi twice and feel that they have very nice public transport.
The situation of Punjab public transport is deteriorating. Some time you need to wait for one hour at single bus top for the bus to arrive. And when the bus arrived you will be shocked to see the people been put like animals. Oh I think its not the better sentence to describe the situation. 'coz we take animal more comfortably in our village.
Some time you will feel lucky when find a place for your half foot in the bus, the remaining parts of the body will be hanging out of the bus. Once you get into the bus, you will always look for a vacant seat. The situation become more irritating when people besides you find their seats and you reach your stop striving for the vacant one.
The people of Punjab are so honest that they even sometime forget to pay the fare. Honest coz they forget and don't do it intentionally and its better to forget fare coz i feel that in situation like this you may even forget yourself. So batter be careful while traveling through public transport here in Punjab.
I won't forget to tell you about the marketing in the buses. After working for 7 to 8 hours in office, waiting on a bus stop for long time, find overloaded bus and hardly find a place, you will face very hard time when a person start promoting products like books(magic way of learning English), perfumes, medicines of hakeem sahab and so on. The way they will highlight the benefits of their products is really amazing, however listening their speech for about 10 minutes you will surely think of suicide.
At the end when you reach your home, you will take lots of deep breathes and thank God(O God you make me able to reach home safely).
I even have been to Karachi twice and feel that they have very nice public transport.
The situation of Punjab public transport is deteriorating. Some time you need to wait for one hour at single bus top for the bus to arrive. And when the bus arrived you will be shocked to see the people been put like animals. Oh I think its not the better sentence to describe the situation. 'coz we take animal more comfortably in our village.
Some time you will feel lucky when find a place for your half foot in the bus, the remaining parts of the body will be hanging out of the bus. Once you get into the bus, you will always look for a vacant seat. The situation become more irritating when people besides you find their seats and you reach your stop striving for the vacant one.
The people of Punjab are so honest that they even sometime forget to pay the fare. Honest coz they forget and don't do it intentionally and its better to forget fare coz i feel that in situation like this you may even forget yourself. So batter be careful while traveling through public transport here in Punjab.
I won't forget to tell you about the marketing in the buses. After working for 7 to 8 hours in office, waiting on a bus stop for long time, find overloaded bus and hardly find a place, you will face very hard time when a person start promoting products like books(magic way of learning English), perfumes, medicines of hakeem sahab and so on. The way they will highlight the benefits of their products is really amazing, however listening their speech for about 10 minutes you will surely think of suicide.
At the end when you reach your home, you will take lots of deep breathes and thank God(O God you make me able to reach home safely).
Labels:
Storage
Jul 7, 2008
Zend Framework is fun
I have been working as Web developer since November 2007. My areas of expertise are PHP and MySQL. Initially I was working with structural programming, putting everything i.e HTML and PHP in the same php file with php extension. Although I really like OOP right from begining when i was doing my BS from post graduate college kohat, The reason was our computer teacher who was always giving preference to OOP 'coz according to him we can't represent real things using structural programmin and that was the reason why OOP came into existance, but i didn't use it much.
Although we used a bit of C++ OOP at our Bs level, however the real practice we did was at our Masters level when we were learning Java. Its was very intrested working in java after studying c++ for two years. The reason was c++ console programming which had bothered me a lot.
I really fall in love with java when we were learning GUI(Java swing). That was the time when i decided that my final project will be in java. however time didn't allow us to do our project in java. So we turn toward Coldfussion and developed a small web based system for our department. If someone had asked me why we choose coldfussion, i was having no answer at that time as we were unaware of other language such as php and asp at that time.
hmm the discussion is going a bit long, em not a bit I think long enough.
So i was talking about OOP. Now i think i should turn towards my topic.
All the above discussion is because Zend is in OOP.
Zend team has done excellent job. The way they have done our job so easy is amazing. Zend_Db and Zend_Auth has impressed my lot so for.
Its pretty simple to manage database and perform authentication.
look at the following example
If you want to authenticate a user and save his/her information in session it is as easy as that.
1. First your need a connection to database as
$dbconn=Zend_Db::factory($config->db->adapter,$config->db->config->toarray());
Note: I am not going to discuss how to make configruation object. so go to the zend documentation and read how to do it.
2. Now you need to create Zend_Auth_Adapter_DbTable() instance as
$authAdapter= new Zend_Auth_Adapter_DbTable($dbconn);
$authAdapter->setTableName('users')
->setIdentityColumn('username')
->setCredentialColumn('password');
$authAdapter->setIdentity($username);
$authAdapter->setCredential($password);
3. As you have created the adapter, so its time to authenticate
$auth=Zend_Auth::getInstance();
$result=$auth->authenticate($authAdapter);
if($result->isValid)
{
$data=$authAdapter->getResultRowObject(null,'password');
// the about line will retrive the entire row
$auth->getStorage()->write($data);
// this line store the entire row in session(Zend_Auth_Storage_Sesssion).
}
else
{
echo 'unvlid user name or password';
}
thats it as simple as that.
Now if you want to retrive this data anywhere you will need the following
1. Create Zend_Auth_Storage_Session() object as
$sess=new Zend_Auth_Storage_Session();
$data=$sess->read();
// this will read the entire row
3. printing the result
print_r($data)
// or you can print individual fields as
echo $data->fieldname;
Although we used a bit of C++ OOP at our Bs level, however the real practice we did was at our Masters level when we were learning Java. Its was very intrested working in java after studying c++ for two years. The reason was c++ console programming which had bothered me a lot.
I really fall in love with java when we were learning GUI(Java swing). That was the time when i decided that my final project will be in java. however time didn't allow us to do our project in java. So we turn toward Coldfussion and developed a small web based system for our department. If someone had asked me why we choose coldfussion, i was having no answer at that time as we were unaware of other language such as php and asp at that time.
hmm the discussion is going a bit long, em not a bit I think long enough.
So i was talking about OOP. Now i think i should turn towards my topic.
All the above discussion is because Zend is in OOP.
Zend team has done excellent job. The way they have done our job so easy is amazing. Zend_Db and Zend_Auth has impressed my lot so for.
Its pretty simple to manage database and perform authentication.
look at the following example
If you want to authenticate a user and save his/her information in session it is as easy as that.
1. First your need a connection to database as
$dbconn=Zend_Db::factory($config->db->adapter,$config->db->config->toarray());
Note: I am not going to discuss how to make configruation object. so go to the zend documentation and read how to do it.
2. Now you need to create Zend_Auth_Adapter_DbTable() instance as
$authAdapter= new Zend_Auth_Adapter_DbTable($dbconn);
$authAdapter->setTableName('users')
->setIdentityColumn('username')
->setCredentialColumn('password');
$authAdapter->setIdentity($username);
$authAdapter->setCredential($password);
3. As you have created the adapter, so its time to authenticate
$auth=Zend_Auth::getInstance();
$result=$auth->authenticate($authAdapter);
if($result->isValid)
{
$data=$authAdapter->getResultRowObject(null,'password');
// the about line will retrive the entire row
$auth->getStorage()->write($data);
// this line store the entire row in session(Zend_Auth_Storage_Sesssion).
}
else
{
echo 'unvlid user name or password';
}
thats it as simple as that.
Now if you want to retrive this data anywhere you will need the following
1. Create Zend_Auth_Storage_Session() object as
$sess=new Zend_Auth_Storage_Session();
$data=$sess->read();
// this will read the entire row
3. printing the result
print_r($data)
// or you can print individual fields as
echo $data->fieldname;
Labels:
Storage
Jul 5, 2008
America wants to cut pakistan into pieces
Pakistan is facing great challenges these days. Poverty, hunger, inflation, extremism, enlighten moderation and war like situation has make life miserable.
However the most dangerous challenge is the American strategy of dividing Pakistan into four states i.e Punjab, NWFP, Baluchistan and Sindh.
Some American think tanks believe that everything in Pakistan is happening according to the script and Pakistan will be cut into pieces till 2005.
The question here is why America wants to do this with Pakistan instead of other Islamic countries. The answer is pretty simple. 'coz Pakistan is the only Islamic country with atomic bomb.
Western counties and media is pursuing right from the day when Pakistan did their first test that Pakistan's atomic assets can fall in the hands of extremists. This is 'coz western world have never and can never accept Islamic country having nuclear weapons. and this is the reason west is against Iranian nuclear program as well. Although Iran has cleared it so many times that its nuclear program is for peaceful purposes and they are not keen to develop atomic bomb, but still western countries have reservation and have imposed lots of restriction.
To prevent Iran from developing atomic bomb and control Pakistan's nuclear assets, we have seen lots of dramatic changes in the area in last few years.The occupation of Afghanistan, Iraq and now threats to Iran, Syria and even to Pakistan clearly indicates Americans strategy of getting hold of these countries.
I believe America will create lots of hardships for Pakistan in next few year. So we should be very careful and try not to play in the hands of western world and media.
However the most dangerous challenge is the American strategy of dividing Pakistan into four states i.e Punjab, NWFP, Baluchistan and Sindh.
Some American think tanks believe that everything in Pakistan is happening according to the script and Pakistan will be cut into pieces till 2005.
The question here is why America wants to do this with Pakistan instead of other Islamic countries. The answer is pretty simple. 'coz Pakistan is the only Islamic country with atomic bomb.
Western counties and media is pursuing right from the day when Pakistan did their first test that Pakistan's atomic assets can fall in the hands of extremists. This is 'coz western world have never and can never accept Islamic country having nuclear weapons. and this is the reason west is against Iranian nuclear program as well. Although Iran has cleared it so many times that its nuclear program is for peaceful purposes and they are not keen to develop atomic bomb, but still western countries have reservation and have imposed lots of restriction.
To prevent Iran from developing atomic bomb and control Pakistan's nuclear assets, we have seen lots of dramatic changes in the area in last few years.The occupation of Afghanistan, Iraq and now threats to Iran, Syria and even to Pakistan clearly indicates Americans strategy of getting hold of these countries.
I believe America will create lots of hardships for Pakistan in next few year. So we should be very careful and try not to play in the hands of western world and media.
Labels:
Storage
Dr AQ khan recent Statement
Recent interview of pakistani scientist and hero Dr A.Q Khan surprise many people and the news was broadcast by all pakistani news channels.
In his telephonic interview with associated press he claimed that centrifuges were delivered to North Korea under the supervision of Pakistan army and President Musharraf.
According to many annalists this statement will make more doubts in the minds of western countries about pakistan nuclear program.
In his telephonic interview with associated press he claimed that centrifuges were delivered to North Korea under the supervision of Pakistan army and President Musharraf.
According to many annalists this statement will make more doubts in the minds of western countries about pakistan nuclear program.
Labels:
Storage
Subscribe to:
Posts (Atom)