Thursday, June 28, 2012

PURPOSE OF LIFE

What Does Islam Say About Life's Purpose? 
_________________________________
Have you ever asked yourself these questions?
"What is the purpose of L I F E?"
"My life?"
"Your Life?"
People everywhere are asking the questions; "What is the purpose of life?" and "Why are we here?" You might be amazed to learn, that Islam is providing clear and concise answers for these questions.
Most of those who reflect or think about life in any detail will consider and ponder these questions. There are as many different answers to these questions as there are people asking the questions. Some would hold that the purpose of life was to acquire wealth. Yet suppose they were to acquire millions of dollars, what then would they claim is their purpose after doing so?

If the purpose of life is to become wealthy, there would be no purpose after becoming wealthy.

The fact is that when people approach their purpose here in this life from the aspect of only gaining wealth, after collecting the money they have dreamed of their lives loose purpose and then they live in restless tension suffering from a feeling of worthlessness.

How could wealth then be considered as the aim of life?

Could the acquisition of wealth guarantee happiness? Of course not.
When we hear of millionaires or members of their families committing suicide, how could we consider the purpose of life would be to gain great wealth?

A child of 5 years would obviously prefer a new toy to a deposit slip for a million dollars.
A teenager does not consider millions of dollars in the bank a substitute for movies, videos, pizza and hanging out with his friends.
A person in their 80s or 90s would never consider holding on to their wealth in place of spending it to hold on to or regain their health.

This proves that money is not the main purpose at all the stages of one's life.

Wealth can do little or nothing to bring happiness to one who is a disbeliever in Almighty God, because regardless of what he or she would gain in this life they would always live in fear of what will happen to them in the end. They would wonder what would become of them and how they would end up.

Wealth and its accumulation as a purpose would be doomed to a temporary success at best and in the end it would only spell out self destruction.

So, what is the use of wealth to a person without belief? He would always fear his end and would always be skeptical of everything. He may gain a great material wealth but he would only lose himself in the end.

Worship of the One True Almighty God of the Universe [Allah in Arabic] as a primary goal or aim in life provides a believer with everything he needs to succeed in both this life and the Next Life.

The word for total surrender, submission, obedience, purity of heart and peace in the Arabic language is "Islam". Those who try to perform these actions are called "MU-slims" [Islam-ERs].

To a Muslim the whole purpose of life is "ibadah" or worship to the One True Almighty God on Terms and under His Conditions.

The term "worship" to a Muslim includes any and all acts of obedience to Almighty Allah.

So his purpose of life is a standing purpose; Worshipping Allah by accepting Allah's Will over his own.
This act of ibadah [worshipping, thanking and extolling the Greatness Almighty Allah on His Terms and Conditions] is for the Muslim, throughout his whole life regardless of the stage. Whether he is a child, adolescent, adult or aged person, he is seeking after the Will of the Almighty in all these stages.
His life here on earth although short, is full of purpose and is totally meaningful within the complete framework of total submission [Islam].

Similarly, in the Next Life as well, his faith, intentions, attitudes and good deeds will all be weighed into his account as favorable putting him in high esteem with his Creator and Sustainer.

Because Islam teaches that this life is only a test or trial for the individual to show him his true nature it is only natural that he would accept death as not so much an ending to everything but more as a beginning of the final and lasting life in the Hereafter.

Before entering into either of the final lodging places i.e.; Heaven or Hell, there must needs be a Day of Judgment or showing of one's true self to make them aware of their own nature and thereby understand what they have sent on ahead during the life here on the earth.

Every person will be rewarded [or punished] according to their attitude, appreciation and efforts during this stay on earth. None will be asked about the actions and beliefs of others, nor will anyone be asked regarding that which he was unaware of or incapable of doing.

As the life here is considered as an examination for the individual, the death stage is considered as a resting period after the test. It could be easy for those who were faithful and dedicated or it could be grueling and horrible for the wicked.

Reward and punishment will be in direct proportion to each person and it is only Allah, alone who will be the Final Judge over us all.

So in the teachings of the True Surrender, Submission, Obedience, In Sincerity and Peace to the Almighty One God [Islam], the line of life and its purpose is logical, clear and simple:

The first life is a test

The life in the grave is a resting or waiting place before the Day of Judgment

The Day of Judgment brings about the clear understanding of what will now happen to the individual based on his own desires and actions

The Permanent or Afterlife will either be spend in luxurious splendor or miserable punishment .

Following this clear understanding of life, the Muslim's purpose is clear.

First of all, he has no doubt in his mind that:
he is only created by Allah
he is going to spend a period of time in this material world [called "Ad Dunyah" in Arabic]
he knows he will die
he knows he will spend time in the grave, either pleasant or difficult depending on his own choice of attitude and actions
he knows he will be resurrected for the Day of Judgment
he knows he will be judged according to the most fair of standards by Allah the Almighty, the All

Knowing he realizes his attitude and actions are going to come under very close scrutiny
he knows that this short life compared to the Eternal Life was in fact, only for a test

This life is very meaningful and purposeful to the Believing Muslim, as he realizes that it will determine is outcome and permanent position in the Next Life.

The Muslim's permanent purpose is to Surrender, Submit, Obey, in Purity and Peace to Allah the Almighty, carrying out His Orders and staying in some form of worship to Him as much as possible everyday.

This includes the orders of Allah in His Book, the Holy Quran and His final Messenger and Prophet Muhammad, peace be upon him as follows:

Believing and declaring that "There is no god throughout all the Creation of Allah that is worthy of worship, all worship is due only to Allah, alone and He has no partners or helpers nor does He share His Lordship with any of His creations. And Muhammad, the son of Abdullah ibn Abdul Mutallib (1450 years ago) is the last and final messenger and servant of Almighty Allah, and is the culmination in a long line of prophets sent to mankind throughout man's history, including Adam, Noah, Abraham, Moses, David, Solomon, Jesus Christ, may Almighty Allah's Peace and Blessings be upon them all."

Establishing the regular five times ritualistic prayer [salat] in the stated times (in the mosques for the men when possible)

Paying the charity tax [Zakat = about 2.5% of one's holdings - not his income, annually]

Fasting the month of Ramadhan [lunar calendar]

Pilgrimage to the House of Allah in Mecca at least once in the life of the person, provided he has the ability and the way is safe


For a disbeliever the purpose of this life is to collect and amass great wealth, money, power and position. Over indulging in eating, drinking, drugs, sex and gambling are a high priority to them. But all of this will not avail them anything good in the grave, on the Day of Judgment or in the Next Life. Eventually he will be faced with the question:
Now what?
What's Next?
Where am I going?
What will happen to me?

He will come to know. For sure he will come to know. But then what will the knowledge avail him?

Look how Islam solves the mystery of the puzzle of life. It provides the answers to the questions and concerns of the human beings on all levels and in every aspect. It is really quite simple.

The purpose of life as understood by the Believing Muslim can be simply stated in only two (2) words:
Obey God.

Our only purpose and salvation lie in these two words.

We must come to know our Creator, Sustainer and Ultimate Judge. We must learn to believe in Him, thank Him, praise Him, honor Him and worship Him, alone without any partners from His Creation. We must learn about His Messengers and Prophets, peace be upon them, and the message with which they were all sent. We must learn the Word of God as was directly revealed, preserved and memorized and passed down by memory throughout all the generations of Muslims to the present day.

Those who are in search of truth, having open minds and hearts will recognize this as a message in truth and sincerity. Open your heart and your mind now and ask the Almighty God of the Universe [Allah] to guide you now to His True Way. And then be ready to accept your true purpose in life.

9 Mistakes Unproductive People Make

I’ve often wondered what makes people successful. What is it that motivates them to want more, to be more? Is there a secret recipe for success? So in my quest to find these answers, I’ve read many books that talk about the keys to unlocking a successful life, and I’ve found a general theme: successful people are PRODUCTIVE people!


They are the proverbial ‘go getters’ who don’t just sit around and bide their time, waiting for something to happen or for things to change. They are creative and innovative in their thinking, and they know that one of the main ingredients to being successful is working smarter, not harder.
Unproductive people seem trapped in a world that is moving in slow motion. For the majority of ‘unproductives’ out there, there are common mistakes, and while they try desperately to sever the bonds of lethargy that keep them prisoner, life swiftly passes them by as they watch helplessly through the rear-view mirror.
While the literary market is flooded with millions of books and manuals which serve as excellent references to leading a productive, successful life, I think that, as Muslims, our most essential references lie in the Qur’an, the Sunnah and the Hadith.

Mistake #1: Procrastination and Laziness

“Procrastination is the thief of time” – indeed it is! Many times we put things off because we’re tired or just don’t feel like it. These are all tell-tale signs of laziness, and unfortunately the more we procrastinate, the lazier we become. The Quran mentions repeatedly the issue of procrastination: “Until, when death comes to one of them, he says: “My Lord! Send me back so that I may do good in that which I have left behind” [23:99-100]. The time for doing is NOW! Those who procrastinate and waste precious time are doing themselves a grave injustice. Time is an Amaanah (gift given in trust) from Allah (Subhanahu wa Ta’ala), so use it wisely! Laziness is an unbecoming characteristic of a Muslim – rid yourself of it, Insha’Allah. Ask Allah (Subhanahu wa Ta’ala) to remove this vice. Even the Prophet Muhammad (peace and blessings upon Him) would often pray, “O Allah! I seek Your protection from anxiety and grief, from incapacity and laziness, from stinginess and cowardice, and from the burden of debt and domination of people.” [Bukhari]

Mistake #2: Ingratitude to Allah (Subhanahu wa Ta’ala)

How often do we thank Allah (Subhanahu wa Ta’ala) for all that He has given us? Unproductive people are so focused on the things they desire that they overlook the bounties that He has bestowed upon them. “O Mankind, remember the favour of Allah upon you. Is there any creator other than Allah who provides for you from the heaven and the earth? There is no deity except Him, so how are you deluded?” [35:3] Allah (Subhanahu wa Ta’ala) has granted us countless blessings, lest we forget! His promise to the believers is that He will increase favours upon those who are grateful to Him:“And [remember] when your Lord proclaimed, ‘If you are grateful, I will surely increase you [in favour]; but if you deny, indeed My punishment is severe.” [14:7] Try to write down five things each day, that you are truly grateful to Allah for; soon you’ll find that your list far exceeds just five things!

Mistake #3: Arrogance in prayer

Human beings have not come into existence by their own accord. Allah (Subhanahu wa Ta’ala), in His infinite wisdom, has created man to worship Him and to work righteousness on this Earth; “I created not the Jinns and mankind except to worship me.” [51:56]. Nothing can ever be, except by the Divine Decree of the Almighty. We cannot expect to do things on our own without saying “Insha’Allah” (if Allah wills).”And never say of anything, ‘I shall do such and such thing tomorrow. Except (with the saying): ‘If Allah wills!’ and remember your Lord when you forget.” [18:23] Therefore, it is the duty of a Muslim to pray to Allah, to seek sincerely and to remain hopeful of the mercy of Allah. You can’t do it on your own – turn to Allah, in Him is our ultimate refuge.

Mistake #4: Lack of responsibility and ownership

Part of a Muslim’s fundamental beliefs is Qadr (Divine Decree), but we need to take responsibility at some point, for our actions. Allah (Subhanahu wa Ta’ala) has given man the gift of reasoning and choice, “He giveth wisdom unto whom He will, and he unto whom wisdom is given, he truly hath received abundant good. But none remember except men of understanding” [2:269]; and therefore man knows the difference between right and wrong. On the Day of Accountability (Youmul Hisaab), we will all be questioned as to our deeds and actions, as well as how we have spent our time.

Mistake #5: A dwindling desire to seek knowledge

To become successful, you need to possess some type of skill, and this means an active pursuit in acquiring knowledge. It is narrated in al-Bukhari that the Prophet (peace and blessings upon Him) has said, “Whoever follows a path in the pursuit of knowledge, Allah will make a path to Paradise easy for him.” It is thus the responsibility of a Muslim to seek beneficial knowledge, “And say: My Lord! Increase me in knowledge” [20:114], and to pass it on to others, as this will benefit him in Akhira. Once people lose their desire to learn new things, the battle is as good as lost.

Mistake #6: “I wish I may, I wish I might”

Wishing doesn’t make it so! Waiting for something to change without making an effort is a futile exercise. In order to break the vicious cycle of unproductiveness, you need to do things differently. Einstein said “Doing the same thing over and over again and expecting a different result is insanity” – take risks, do things differently. Nothing will change unless YOU do! “Truly, Allah does not change the condition of a person until they change what is in themselves” [13:11].

Mistake # 7: Holding on to regrets

Let it go! “And whoever does a wrong or wrongs himself, but then seeks forgiveness from Allah, he will find Allah forgiving and merciful” [4:110]. The past is over and Allah does not want you to dwell in it. Allah is ar-Rahmaan (the Forgiving), ar-Raheem (the Merciful). “Say: O My Servants who have transgressed against their own souls, despair not of the mercy of Allah. Indeed, Allah forgives all sins. Truly, He is Most Forgiving, Most Merciful” [39:53]. Mistakes happen to teach us a lesson – take the lesson and move on. A common denominator among unproductive people is their inability to move forward once they have hit a stumbling block. Pick yourself up and keep moving.

Mistake # 8: Purpose

Many unproductives wander aimlessly through life, without the slightest inclination of what their purpose on this earth is. Snap out of it! Ask yourself why you are here. Surely, Allah (Subhanahu wa Ta’ala) does not create without purpose; He has placed you here for a very specific reason. Your challenge is to find that purpose. Don’t waste precious moments on trivialities, rather seek out things that will earn you the pleasure of Allah (Subhanahu wa Ta’ala) and bring you closer to Him.

Mistake # 9: Fear of hard work

There are no shortcuts on the road to success. Man must work hard in order to achieve success, both in Dunya and Aakhira – “There is nothing for man but what he strives for” [53:39]. Both physical and intellectual labour are recognized in Islam.
So work hard – Allah has ordained it for you! ”As to those who believe and work righteousness, Allah will pay them (in full) their reward; but Allah loveth not those who do wrong.”[3:57].
I hope these words will inspire you to make the changes necessary in your life, Insha’Allah. Let go of negative thoughts and rid yourself of bad habits. Find your purpose and make every minute worthwhile. “Know the true value of time; snatch, seize, and enjoy every moment of it. No idleness, no laziness, no procrastination: never put off till tomorrow what you can do today” – Lord Chesterfield
About the Author
Faiza Dean is a vibrant young professional – her field of specialization is adult learning and she is employed as a Learning and Development Consultant for a multi-national company based in SouthAfrica. She holds a Bachelor’s degree in Applied Psychology, as well as qualifications in Project Management and Business Administration. One of her favourite pastimes is reading about Islamic History. Faiza’s motto is PURPOSE and in an effort to fulfill her purpose, is actively involved in community upliftment projects and youth forums.

Wednesday, June 27, 2012

Top 10 Best Laptops in 2012

I think its my best effort to provide you this article because as updated you may be, checking on the latest laptops to use and abuse in 2012 would make you more than satisfied with the selections included on this list. Thus, if you want to be on the top of the game during the earlier times of the year, then buying these laptops can give you a dose of coolness, while these toys are still hot let’s check the top 10 best laptops in 2012 as following.

10. Toshiba Qosmio X775-Q7272

10. Toshiba Qosmio X775 Q7272 Top 10 Best Laptops in 2012
Power is the name of the game with this particular model of the Toshiba Qosmio. The Core i7 Processor is actually put into good use, thanks to a huge 17.3-inch screen, and a 1TB hard disk space. The processor does not do all the speed work as a mighty fast NVIDIA GeForce GTX 560M and a 6GB DDR3 multiplies the speed manifold. Oh, was it mentioned that this baby includes a nice set of Harman/Kardon speakers?
Display: 17.3-inch Widescreen
Storage: 1.0 TB (500GB 7200rpm Serial ATA x2)
Processor: Intel Core i7-2630QM processor
Memory: 6GB DDR3 1333MHz
Graphics: NVIDIA GeForce GTX 560M w/NVIDIA Optimus Technology
Battery and Power: Li-Ion (47Wh, 8-Cell), 180W (19V x 9.5A) Auto-sensing,100-240V AC Adapter
Wireless: Wi-Fi® Wireless networking (802.11b/g/n)
Audio: Stereo Headphone Jack, Built-in microphone, Microphone input port with Sleep and Music, harman/kardon® stereo speakers



9. Samsung Series 3 NP350U2B-A01

9. Samsung Series 3 NP350U2B A01 Top 10 Best Laptops in 2012
Customers love seeing something so light, yet so packed up with things of the good stuff, specifically a lightweight Series 3 with a Core i5 processor, an Intel GMA HD graphics card, and a 500GB internal storage to match. The 4GB DDR3 RAM in this device makes a small laptop fly high at speeds that make the user really happy.
Display: 12.5-inch
Storage: 500GB
Processor: Intel® Core™ i5 2410M Processor
Memory: 4GB DDR3
Graphics: Intel GMA HD
Battery and Power: 6Cell, 60W
Wireless: 802.11 a/b/g/n
Audio: 3 W Stereo Speaker (1.5 W x 2)


8. HP ProBook 4530s-XU015UT

8. HP ProBook 4530s XU015UT Top 10 Best Laptops in 2012
If you are looking for a toy that looks expensive, then the HP ProBook 4530s-XU015UT will not disappoint you. The physical is well built and made, while considering the insides still at par with the fastest laptops in town. Keyboards are user-friendly as it does not make the fingers slip and speakers are phenomenal, thanks to the SRS features included. This is the device that can make a statement for looking hot while spending less.
Display: 15.6-inch HD
Storage: 320GB 7200rpm SATA
Processor: Intel Core i3-2310M 2.1GHz Processor
Memory: 4GB DDR3 1333MHz
Graphics: Intel HD Graphics 3000
Battery and Power: 6-cell (47 WHr) Li-Ion, 65-watt AC adapter
Wireless: Atheros 802.11b/g/n WiFi
Audio: SRS Premium Sound Integrated microphone


7. Lenovo G770-10372KU

7. Lenovo G770 10372KU Top 10 Best Laptops in 2012
Despite of being big, thanks to its 17.3-inch screen and a Core i5 to match, the Lenovo G770-10372KU is loved by heavy users due to its long lasting battery, which lasts for 4-5 hours at maximum performance on graphics, sounds, and multifunction tasks. One of the promising features in this laptop is that you can switch graphic performance based on the programs you use, without the need of manually routing info via settings.
Display: 17.3-inch
Storage: 750GB 5400rpm SATA
Processor: Intel Core i5-2410M 2.30GHz Processor
Memory: 6GB DDR3 1333MHz
Graphics: AMD Radeon HD 6650M 1GB DDR3 VRAM
Battery and Power: 6-cell Lithium Ion (48 WHr)
Wireless: 802.11b/g/n Wireless LAN
Audio: Integrated Sound card, Internal 2 x 1.5W speakers


6. Acer AS7741G-6426

6. Acer AS7741G 6426 Top 10 Best Laptops in 2012
The Acer AS7741G-6426 is also following the trends of using large screens in displaying sharp and crisp images that have a lot of say when it comes to HD quality videos and pictures. Thanks to a Core i5, a 4GB RAM, and a Radeon HD 6550M 1GB DDR3 SDRAM, performance is as big as the body indicates.
Display: 17.3-inch Active Matrix TFT
Storage: 640 GB 5400rpm Serial ATA
Processor: Intel Core i5-480M 2.66 GHz Processor
Memory: 4 GB DDR3 SDRAM
Graphics: Radeon HD 6550M 1GB DDR3 SDRAM
Battery and Power: 6-cell Lithium Ion (Li-Ion), 4400 mAh
Wireless: Acer InviLink Nplify IEEE 802.11b/g/n


5. HP Pavilion DV6-6140us

5. HP Pavilion DV6 6140us Top 10 Best Laptops in 2012
Aside from doing documents, presentations, and spreadsheets in a laptop, it has also turned into an all-in-one media center for playing movies, music, and even in playing video games. The HP Pavilion DV6 is sure to please audiophiles and other music critics, thanks to the Beats Audio included in the system.
Display: 15.6-inch
Storage: 640GB 5400rpm SATA
Processor: AMD A-Series A8-3500M 1.5GHz Processor
Memory: 6GB DDR3
Graphics: Integrated AMD Radeon HD 6620G Discrete-Class Graphics
Battery and Power: 6-Cell 55WHr Lithium-Ion Battery, 65-watt AC adapter
Wireless: 802.11b/g/n Wireless LAN
Audio: Beats Audio, Integrated digital microphone, Internal Speakers


4. Acer Aspire TimelineX AS1830T-6651

4. Acer Aspire TimelineX AS1830T 6651 Top 10 Best Laptops in 2012
The Acer Aspire TimelineX AS1830T-6651 is loved for its size, its weight, and the performance that is uncompromised despite of its outer appearance. Be surprised however, as this is one of those things that are small but terrible when it comes to audio and sounds, thanks to a full armada of Dolby Sound goodness at every inch. The fun lasts long due to a powerful battery that can last for more than 5 hours.
Display: 11.6-inch
Storage: 500GB 5400rpm SATA
Processor: Intel Core i5-470UM 1.33GHz Processor
Memory: 4GB
Graphics: Intel HD Graphics
Battery and Power: 6-cell Li-ion Battery (5800 mAh)
Wireless: 802.11b/g/n Wireless LAN
Audio: Optimized 2nd Generation Dolby Sound Room audio enhancement, featuring Dolby Headphone, Dolby Natural Bass, Dolby Sound Space Expander


3. ThinkPad X120e 05962RU

3. ThinkPad X120e 05962RU Top 10 Best Laptops in 2012
To its 11.6-inch size, the hard disk space of 320GB, a dual-core processor, a 4GB RAM, and an AMD Radeon HD 6310 for graphics is more than enough of a treat. Yes, it does not only look small for convenience, but every part of it will make you feel comfortable, thanks to performance found on every part, from the camera, down to the fan of the CPU.
Display: 11.6-inch
Storage: 320GB 7200rpm SATA
Processor: AMD Fusion Dual-Core Processor E-350 1.6GHz
Memory: 4GB DDR 1333MHz
Graphics: AMD Radeon HD 6310
Battery and Power: 6-cell lithium ion, 65-watt AC adapter
Wireless: 802.11b/g/n Wireless LAN
Audio: High Definition (HD) Audio, Built-in digital mono microphone, Internal stereo speakers, 1 watt x 2


2. Apple MacBook Air MC965LL/A

2. Apple MacBook Air MC965LLA Top 10 Best Laptops in 2012
It can be ironic for a fact that other models are better performing than this baby, but this is flocked by more people. Many may be disappointed with the 128GB internal storage, but knowing it’s a MacBook Air is more than enough satisfaction.
Display: 13.3-inch Wide XGA+
Storage: 128GB SSD
Processor: Intel Core i5 1.7GHz Processor
Memory: 4GB DDR3 1333MHz
Graphics: Intel HD Graphics 3000
Wireless: 802.11a/b/g/n Wireless LAN
Audio: Omnidirectional microphone, Support for Apple Earphones with Remote and Mic, Built-in stereo speakers


1. Apple MacBook Pro MD314LL/A

1. Apple MacBook Pro MD314LLA Top 10 Best Laptops in 2012
No matter what kind of device it is, whether an iPad, an iPhone, or an iPod Touch, Apple devices are almost always on the top of the list, thanks to its quality, reputation, and value. However, unlike the latest MacBook Air, the MacBook Pro is great on every aspect from storage, to processor, and even memory. There is no room for doubt on this baby. last year MacBook pro was top listed as one of the best laptops as well.
Display: 13.3-inch
Storage: 750GB 5400rpm Serial ATA
Processor: Intel Core i7 2.8GHz Dual-core Processor
Memory: 4GB DDR3 1333MHz SDRAM
Graphics: Intel HD Graphics 3000
Battery and Power: 60W MagSafe Power Adapter, AC wall plug, power cord
Wireless: 802.11a/b/g/n Wireless LAN
Audio: Stereo speakers with subwoofer, omnidirectional microphone, combined headphone/line in

Monday, June 25, 2012

jQuery 1.5.1 Offline Learning Kit


Hey guys. Quick post for you today. So by now, chances are you’ve had an opportunity to play around with jQuery 1.5 (and 1.5.1) and you may have even checked out some of the great new Deferred features that that release came with. Today I wanted to share an offline learning pack for anyone interested in tweaking their jQuery skills offline.

What does this learning pack come with? Well, for starters it will include printable reference sheets so that whenever you’re wondering what selector or method might be best to use, you’ll have access to material that can assist with that. The pack also comes with all the 1.5.1 documentation in an easily browseable offline format (with all our API examples included) and a chrome extension allowing you to easily search the API offline while you code.
I’m also actively recommending all beginner and intermediate developers read Rebecca Murphey’s excellent jQuery Fundamentals book as it’s a wonderful starting point for increasing your knowledge and skills with both jQuery and JavaScript in general. You’ll find exercises for this included under her subfolder.
The 1.5.1 Offline Learning Kit Includes
  • Selectors Printable that explains what each selector does and how it should be used (PDF)
  • Woork jQuery 1.5 Printable Cheatsheet showing all the different methods supported by 1.5 (PDF)
  • The jQAPI 1.5 Offline Documentation pack that lets you browse the documentation and API examples on your desktop
  • jQuery 1.5 VSDocs for Visual Studio users
  • Rebecca Murphy’s excellent jQuery Fundamentals book and exercises (pack)
  • jQuery 1.5.1 Offline API Browser extension for Google Chrome
  • jQuery.sub and jQuery Deferreds Examples
  • Current 1.5.1 Release


For record purposes, if you’re interested in picking up the 1.4.3 kit from last year, I’m going to leave it up below. The main difference between the kits (other than versioning) is that this older kit also came with tutorials and sample code for building mobile applications. If you’d like to grab this pack, remember to update to 1.5 and the latest version of jQuery mobile if you want to keep playing around with the examples.
The 1.4.3 Offline Learning Kit Includes
If you’re looking to start working with jQuery Mobile, it can be nice to have a minimalist example at your fingertips to start off with. That’s why this pack also includes a jQuery Mobile demo application – one for PHP developers and another for Rails developers. I’ve noticed quite a few apps utilize these for their jQuery mobile app-setup so this should hopefully give you an idea of how to get started.
  • My 1.4.3 Selectors Printable that explains what each selector does and how it should be used (PDF)
  • The FutureColours 1.4.3 Cheatsheet showing all the different methods supported by 1.4.3 (PDF)
  • The jQAPI 1.4.3 Offline Documentation pack that lets you browse the documentation and API examples on your desktop (thanks to the guys at yayQuery and the awesome Ben Alman)
  • A Complete Developer’s jQuery 1.4.3 Mobile Demo Application (PHP courtesy of DevGrow, Rails courtesy Fuel)
  • Rebecca Murphy’s excellent jQuery Fundamentals book and exercises (PDF)
  • 1.4.3 and our 1.4.4 Release Candidate Preview


Feel free to share the kit or any ideas you may have for what else should be included in it. Speak soon! – Hafiz.

10 Things You Can Do to Become a Better PHP Developer

Website Monitoring Service
10 Things You Can Do to Become a Better PHP Developer
PHP is probably the most popular web development language right now. At least 20 million domains use PHP and it’s the language used on major sites such as Wikipedia and Facebook as well as in some of the world’s biggest open source projects like WordPress and Drupal.

In this article, I’ll share with you ten things I wish I was told when I was just getting started with PHP development, and I’m hoping you’ll be able to learn a thing or two if you’re just taking your first steps into this awesome web development language.

1. Use PHP Core Functions and Classes

If you’re trying to do something that seems fairly common, chances are, there’s already a PHP function or class that you can take advantage of. Always check out the PHP manual before creating your own functions. There’s no need to create a function to remove the white space at the beginning and at the end of a string when you can just use the trim() function. Why build an XML parser for RSS feeds when you can take advantage of PHP’s XML Parser functions (such as xml_parse_into_struct)?

2. Create a Configuration File

Instead of having your database connection settings scattered everywhere, why not just create one master file that contains its settings, and then include it in your PHP scripts? If you need to change details later on, you can do it in one file instead of several files. This is also very useful when you need to use other constants and functions throughout multiple scripts.

Using a config file is a popular web application pattern that makes your code more modular and easier to maintain.

3. Always Sanitize Data That Will Go into Your Database

SQL injections are more common that you may think, and unless you want a big headache later on, sanitizing your database inputs is the only way to get rid of the problem. The first thing you should do is learn about popular ways your app can be compromised and get a good understanding of what SQL injections are; read about examples of SQL injection attacks and check out this SQL injection cheat sheet.
Luckily, there’s a PHP function that can help make a big heap of the problem go away: mysql_real_escape_string. mysql_real_escape_string will take a regular string (learn about data types through this PHP variables guide) and sanitize it for you. If you use the function together with htmlspecialchars, which converts reserved HTML characters (like

25 jQuery Tutorials for Creating and Working with Forms

Working with jQuery, Part 1: Bringing desktop applications to the browser

Summary:  jQuery is emerging as the JavaScript library of choice for developers looking to ease their creation of dynamic Rich Internet Applications. As browser-based applications continue to replace desktop applications, the use of these libraries will only continue to grow

Introduction
jQuery has distanced itself from other JavaScript library options to become the library of choice for Web developers and is fast becoming the first choice for programmers looking to ease their client-side development and create Rich Internet Applications (RIA) quickly and efficiently. As the use of RIA becomes ever-more prevalent in the world, the use of JavaScript libraries to assist in their development will continue to increase as well. RIAs are defined (loosely) as applications run through the browser that use a combination of CSS/JavaScript/Ajax to create the appearance of working on a desktop application. The latest features being added to recent releases of Firefox, Internet Explorer, Safari, and the recent release of Google's new Chrome browser, are focused on beefing up the speed of each browser's internal JavaScript engine for the sole purpose of making it more conducive to the type of RIAs that the browser makers picture us using in the near future. These companies envision Web pages that contain tens of thousands of lines of JavaScript code, making the importance of a mature and bug-free library from which to start all the more crucial.
So, as the future of Web applications moves toward these rich and immersive interfaces, Web developers increasingly turn to tools to ease that work. There are several JavaScript libraries out there in the world right now, each with its own strengths and weaknesses and its own fanboys and critics. I'm not here to debate which one is better than the other as far as features, because ultimately it doesn't really matter. Ultimately, what matters most is what library is getting used more than the others—volume matters. Take a look at the Google Trends graph of the four most popular JavaScript libraries below. It is apparent that over the past six to eight months, jQuery has become the dominant choice for JavaScript libraries and is growing rapidly.

Figure 1. Google Trends of common JavaScript libraries
Google Trends of Common JavaScript Libraries
The job market is also showing the emergence of jQuery as the JavaScript library of choice. A non-scientific look at Monster.com shows there are 113 jobs with "jQuery" listed, and only 67, 19, and 13 jobs listed for YUI, ExtJS, and mootools, respectively.
This first article in this jQuery series begins by exploring the syntax of jQuery, how it is set up, and how its functions are called. Later sections in this article explore the core functions in the library and how it uses its powerful selectors and filters to make DOM traversal easy and straightforward. Later articles will address CSS manipulation, form control, text changes, Ajax simplicity, and animations (everyone's favorite eye candy). One of the most interesting features of jQuery is its plug-in architecture, allowing many developers to add on to the functionality of jQuery. The final article will introduce you to many of the powerful plug-ins available to complete your RIA development process.
This series of articles is intended for people who have prior knowledge of JavaScript syntax, CSS syntax, and DOM syntax. If you need a refresher on this syntax before reading the articles in this series, I highly recommend the W3Schools links in the Resources section of this article.
The basics
Before getting into the fun stuff with jQuery, we need to get the basics out of the way—how to install it, get it started, and so on. Start by downloading the jQuery library provided in the Downloads section, and link to it like you would any other external JavaScript file:

Listing 1. How to install jQuery in your code
    

Because jQuery calls or manipulates the DOM objects, you would run into problems if you were manipulating these objects in JavaScript code immediately, before the document finished loading all the elements on the page. Conversely, you also don't want to have to wait until everything on the page has loaded—all the images, banner ads, analytic code, and YouTube video previews— before you can call jQuery code. Appropriately, a middle ground allows you to call jQuery code in a safe and error-free manner once the document has finished loading all the elements on the page, but before all the image, linking, and rendering is complete. To stress this again in a different way, all of your jQuery code needs to be in this function on a page, or in its own function. Do not put jQuery code in a JavaScript code section if it's not in a function.

Listing 2. How to properly call jQuery functions
    
// Incorrect


// Correct
$(document).ready(function(){
   $("div").addClass("a");
 });

// - or -

$(document).ready(function(){
   myAddClass();
 });

function myAddClass()
{
   $("div").addClass("a");
}

Also, one additional helpful note: You can have as many document.ready() functions as you need on one page, and they will be called in succession. This is a good thing to keep in mind if you are building your pages dynamically with modules, and each module has its own supporting jQuery code (for example, a PHP page constructed of many smaller PHP page snippets).
One of the most interesting features of jQuery is its "chainability", its ability to put together a series of functions in order to improve readability and ease coding. Almost every jQuery function returns a jQuery object, meaning you can simply call additional functions on it over and over again to chain together a complete jQuery command. I compare this to the String class in Java, in which several functions return a String object, allowing you to chain together multiple functions on one line:

Listing 3. jQuery chainability
    
String man = new String("manipulated").toUpperCase().substring(0,5).toLowerCase();

$("div").addClass("a").show().text("manipulated");

Finally, the last thing to remember when working with jQuery, or any JavaScript library, is that they don't always work well with each other. In other words, when working with two or more libraries, the variable "$" is used by more than one library, meaning the engine won't know which library should be referenced with a "$" call. A perfect example of this is the CakePHP library, which includes prototype.js built in. Attempting to use jQuery on these pages will result in errors unless corrected. To get around this problem, jQuery provides a way to map the "$" variable to a different variable, for example:

Listing 4. jQuery conflict resolution
    
j$ = jQuery.noConflict();
j$("div").addClass("a");

Selection
The root of all jQuery is its ability to select certain elements on a page and manipulate them. In a sense, these are the objects around which the jQuery library is built to function. So, with the numerous options available on a normal HTML page, you need a way to quickly and efficiently select the elements you wish to work with on the page, selecting only those you want (no more and no less). Expectedly, jQuery provides powerful selection methods that allow you to find and select objects on the page. jQuery has created its own syntax for selection, and it is quite easy to learn.
(Many of the examples below use functions I won't get into until the next article, but they should be straightforward enough to understand what they are trying to do.)
At its root, the selection process in jQuery is really a giant filter process, whereby every element on the page is put through the filter you supply in your command, and it returns either the single matching object itself, or an Array of matching objects, from which you can traverse.
The first three examples are probably the most commonly used. They are finding objects by HTML tag, by ID, or by CLASS.
HTML
To get an array of all the matching HTML elements in a page, you can simply pass the HTML tag itself, without the braces, into the jQuery search field. This is the "quick and dirty" way of finding objects and is useful for attaching attributes to generic HTML elements.

Listing 5. HTML selection
    
// This will show every 
tag in the page. Note that it will show // every
, not the first matching, or the last matching. // Traversing Arrays is discussed later in the article. $("div").show(); // This will give a red background to every tag in the page. $("p").css("background", "#ff0000");

ID
Proper page design calls for every ID on a page to be unique, though this is sometimes broken (intentionally or unintentionally). jQuery only returns the first matching element when using the ID selection, because it expects you to follow proper page design. If you need to attach a tag to several elements on the same page, the CLASS tag is the proper choice.

Listing 6. ID selection
    
// This will set the innerHTML of a span element with the id of "sampleText" to "Hi".  
// Note the initial "#" in the command.  This is the syntax used by jQuery to search 
// for IDs, and must be included.  If it is excluded, jQuery will search for the HTML
// tag instead, and with no  tags on a page, will ultimately do
// nothing, leading to frustrating and hard-to-find bugs (not that that has ever 
// happened to me of course).

$("#sampleText").html("Hi");

CLASS
Classes are a lot like IDs, except that they can be used for one or many elements on a page. Thus, while you are limited by having only one element per ID on a page, you can have many elements with the same CLASS on a page. This results in giving you the leeway to perform functions across wide-ranging elements on a page while passing in only one CLASS name.

Listing 7. CLASS selection
    
// This will create a red background on every element on the page with a CLASS of 
// "redBack".  Notice that it doesn't matter which HTML element this "redBack" 
// CLASS tag is attached to.  Also notice the period in the front of the query
//  term -- this is the jQuery syntax for finding the CLASS names.

$(".redBack").css("background", "#ff0000");

This is a paragraph
This is a big div
Sample table

Combining search criteria
The above three search criteria, and all of the filters presented below, can be combined in a search. By separating search criteria with a ",", the search will return a union of all matches of the search terms.

Listing 8. Combining searches
    
// This will hide every , , or 
. $("p, span, div").hide();

Further filters
While those are certainly the three most commonly used search parameters in jQuery, there are many others that can help you quickly find the elements you are looking for on a page. These further filters all start with a ":" to denote that they are the filters in the jQuery search term. Though they can stand alone as search criteria, they are designed primarily to be used with the three search criteria provided above, to allow you to fine tune search criteria to find the specific element you are looking for.

Listing 9. Further filters
    
// This will hide every  tag on a page
$("p").hide();

// This will hide the first element on a page, no matter its HTML tag
$(":first").hide();

// Notice how these can be used in combination to provide more fine tuning of 
// search criteria.  This will hide only the first 
tag on a given page. $("p:first").hide();

Multiple filters can be used as search elements, and though I won't list them all here (that's what an API page is for after all), some of them are very handy in working with pages and searching for elements.
I will spend more time on some very important filters in the Selection package, and that is the form element filters. Rich Internet Applications today seem to focus on the form and its contained elements (text fields, buttons, check boxes, radio buttons, and so on) that gather and transmit information to and from the server. Because of their importance in RIAs, these filters have a particular importance in working with jQuery in today's types of Web applications.
These filters work like the other filters introduced in this article and are preceded with a ":" character to denote they are a filter. Also, they can be used in combination with other search filters to provide more refining. So, a search filter of ":text" will return every text field on a page, while a search filter of ".largeFont:text" will return only the text fields on a page that are part of the "largeFont" class. This will allow for further refinement and manipulation of form elements.
The form filters also include individual attributes of the elements as well, things that might be appropriate and good to know for developers. So, things like ":checked", ":disabled", and ":selected" will further refine the search criteria for a given search.
Traversal
Now that you've learned how to search and filter all of the elements on a page, you need an efficient way to traverse over the results and take actions on these elements. Not surprisingly, jQuery offers several ways of traversing over the results of these searches.
The first and most commonly used traversal technique is the each() function. This is programmatically the same as a "for loop", looping through each of the elements and incrementing the element with each iteration. Additionally, a reference to each element in the loop can be made with "this" (for using regular JavaScript syntax) or $(this) (for use in jQuery commands).
Take a look at the following example.

Listing 10. Each loop
    
// Will loop through each  tag on the page.  Notice the use of the
// inline function here -- this is analogous with the anonymous classes in Java.
// You can either call a separate function, or write an inline function like this.

var increment = 1;
$("p").each(function(){

    // now add a paragraph count in front of each of them.  Notice how we use the
    // $(this) variable to reference each of the paragraph elements individually.

    $(this).text(increment + ". " + $(this).text());
    increment++;
});

Since the search results are being stored in an array, you'd expect functions to work through the array like you would any data object in any programming language. Thus, to find the length of a given search result, you can call $().length on the array. Further array traversal functions are as follows in Listing 11 and fit appropriately with array traversal in other programming languages.

Listing 11. Additional array functions
    
// the eq() function lets you reference an element in the array directly.  
// In this case, it will get the 3rd paragraph (0 referenced of course) and hide it
$("p").eq(2).hide();

// The slice() function lets you input a start and an end index in the array, to 
// create a subset of the array.  This will hide the 3rd through 5th paragraphs on the
// page
$("p").slice(2,5).hide();

In addition to these array traversal functions, jQuery also offers functions that let you find elements nested right around your search terms. Why might this be useful? Well, oftentimes you want to embed a text label next to a picture, or an error message next to a form element. Using these commands lets you search for a specific form element and then place an error message directly next to it by placing it in the next element, a span tag. Listing 12 is an example of this design:

Listing 12. Example of next() function
    


function validateForm()
{
    $(".validate:text").each(function(){
    if ($(this).val()=="")
    //  We'll loop through each textfield on the page with a class of "validate"
    //  and if they are blank, we will put text in the  immediately afterwards
    //  with the error message.

        $(this).next().html("This field cannot be blank");
});
}

Bringing the lessons all together
To see how all of these lessons come together, take a look at the demo application included in this article. (See the Downloads section.)
A quick primer on the demo application is probably in order here. I'll be using the demo application throughout the article series, as it utilizes a number of different jQuery examples, and is an application that nearly everyone is familiar with—a Rich Internet Application for Web mail! This demo app is a simple mail client, utilizing jQuery to give users the feeling of working with an e-mail client that is actually a desktop application. By the end of the final article, you'll see how the simple application creates that look and feel for users, and ideally you'll see how easy it is to create this with jQuery.
This article focuses on the "Select All"/"Deselect All" check box that appears at the top left column in Web mail tables (highlighted below). When this check box is selected, it selects every check box in the column, and when it's deselected, it deselects every check box in the column.

Figure 2. "Select All" check box
Select All Check box

Listing 13. Bringing the lessons together
    










// remember that all jQuery setup code must be in this document.ready() function, 
// or contained within its own function in order to function correctly.

$(document).ready(function(){
   // We use the jQuery selection syntax to find the selectall checkbox on the page
   // (note the '#' which signifies ID), and we tell jQuery to call the selectAll()
   // function every time someone clicks on the checkbox (we'll get to Events in a
   // future article).

   $("#selectall").click(selectAll);
});

// This function will get called every time someone clicks on the selectall checkbox
function selectAll()
{
    // this line determines if the selectall checkbox is checked or not.  The attr()
    // function, discussed in a future article, simply returns an attribute on the
    // given object.  In this case, it returns a boolean if true, or an undefined if
    // it's not checked.

    var checked = $("#selectall").attr("checked");

    // Now we use the jQuery selection syntax to find all the checkboxes on the page
    // with the selectable class added to them (each row's checkbox).  We get an array
    // of results back from this selection, and we can iterate through them using the
    // each() function, letting us work with each result one at a time.  Inside the
    // each() function, we can use the $(this) variable to reference each individual
    // result.  Thus, inside each loop, it finds the value of each checkbox and matches
    // it to the selectall checkbox.

    $(".selectable").each(function(){
       var subChecked = $(this).attr("checked");
       if (subChecked != checked)
          $(this).click();
    });
}

Conclusion
jQuery is becoming the preferred JavaScript library in the Web application development community, and it likely will continue to grow in importance as Rich Internet Applications become more and more prevalent. As multiple companies migrate their internal applications online, and as companies move their everyday desktop applications online (including word processors and spreadsheets), JavaScript libraries that ease development and promise cross-platform support will become part of the technology choice when an application is architected.
This first article in the series on jQuery introduced you to the jQuery syntax, how to use jQuery correctly in your own JavaScript code, and how to avoid any pitfalls when using it with other libraries. Further, it introduced you to the jQuery search and selection syntax, from which all the other functionality in jQuery is based. It allows you to find any page element you want, simply and quickly, and take actions on them. The article also showed you how to navigate through the results from these searches, letting you take actions on the elements individually. These two aspects of jQuery will be the fundamental basis on which the next articles in the series will build and on which all of your jQuery code will be based.
Finally, the demonstration application was introduced, a rich client Web mail application. In this article, you created the Select All/Deselect All check box by using the jQuery you learned in the article, and you saw that with only a few lines of code, you could create a common widget seen in many Web sites.
The next article in the series will add some interactivity to our sample Web application. You'll learn how to handle page events (clicking on elements, button clicks, combobox choices, and so on), how to get values from elements on the page, and how to alter the standard CSS on a page to change colors, layouts, and so on, without having to reload the page.

Downloads
DescriptionNameSizeDownload method
Zip file containing the sample applicationjquery.zip68KBHTTP
War file containing the sample applicationjquery.war68KBHTTP
Information about download methods

Resources
Learn
Discuss
About the author
Mike Abernethy In his 13 years in technology, Michael Abernethy has worked with a wide variety of technologies and a wide variety of clients. He currently works as a freelance programmer specializing in Java high availability and jQuery. His focus nowadays is on Rich Internet Applications and making them both more complex and simpler at the same time. When he's not working at his computer, he can be found on the golf course, or more accurately in the bushes, looking for his ball.