<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ash Menon</title>
	<atom:link href="http://www.ashmenon.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ashmenon.com</link>
	<description>Design and Personal Development Junkie</description>
	<lastBuildDate>Sun, 29 Aug 2010 11:31:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Why Bad Design is Good for You</title>
		<link>http://www.ashmenon.com/why-bad-design-is-good-for-you/</link>
		<comments>http://www.ashmenon.com/why-bad-design-is-good-for-you/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 10:56:13 +0000</pubDate>
		<dc:creator>Ash Menon</dc:creator>
				<category><![CDATA[Graphic Design]]></category>

		<guid isPermaLink="false">http://www.ashmenon.com/?p=262</guid>
		<description><![CDATA[We've all had our Comic Sans moments. The ones where our ideas all look horrible and we're stumped. But are our ideas and designs really that bad? In this post, I talk about how your seemingly 'bad' designs can actually be an asset to your work.


Related posts:<ol><li><a href='http://www.ashmenon.com/logo-inspiration-1-fun/' rel='bookmark' title='Logo Inspiration #1 &ndash; Fun'>Logo Inspiration #1 &ndash; Fun</a> <small>First in a series of logo inspiration posts. Today's keyword is 'fun', so enjoy!...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>(I have to say, that image was ridiculously fun to make.)</p>
<p>As designers, we’re often taught a standard design process. Use whatever techniques to generate your ideas, and then, based on the critical requirements of the brief/client, filter out the ideas that don’t apply. Repeat the process until you’ve distilled your ideas down to the very best few, then proceed onwards.</p>
<p>One thing I notice, however, is that after a while, the generating process develops its own filter. Instead of producing ideas in the first stage and evaluating them later, we evaluate them immediately, and if found lacking, they don’t make it into our mind-map/chart/sketches at all. Those ideas are considered bad design, and since we already know that in the next step, those ideas would be eliminated, our mind takes a preemptive step by applying a negative prejudice on the idea the moment it comes out.</p>
<p>Do you know what this means? This means that<strong> a potentially good idea was eliminated from the drawing board before it had a chance to truly shine.</strong></p>
<p>But is there all that there is to it? Here are two reasons as to why not only should you not toss out bad ideas, but you should give yourself some room to expand and experiment with them.</p>
<p><strong>Failure makes for a better teacher</strong><br />
It might seem otherwise, but think about it. When you fail, you learn something. Maybe this approach didn’t work. Maybe you need to try using different materials. Maybe you do not understand the brief correctly. But success only teaches you one thing: what you did worked.</p>
<p>Observing and analyzing bad design is critical to the success of your design. Why doesn’t this design work? What can I do to improve it? If I changed element X, what would happen?</p>
<p><strong>Get the ball rolling</strong><br />
Let’s see a show of hands: how many of us have experienced designer’s block at some point in our career? Yeah, I thought so. But what do you consider designer’s block? Are you truly unable to come up with anything, or are you unable to produce anything good? Think back on the times you’ve been stumped for ideas, and analyze your thought pattern. Were you mentally writing ideas off as rubbish?</p>
<p>Does this mean you were wrong and that those ideas were actually good? No, chances are they really were rubbish. But the mind is a wonderful thing. Once you bring rubbish out of your mind onto paper or any other medium, the mind stops seeing it as rubbish and starts to see it as inspiration. And now there’s space for a new idea, one that, thanks to the aforementioned inspiration, is better. And as you slowly continue this process, your mind’s gears pick up the pace, and BOOM! Designer’s block is a thing of the past.</p>
<p>So really, when you think about it, bad design is so helpful to you that it seems unfair to call it so. After all, many great inventors and designers of the past freely admit to coming up with failed designs or ideas before they achieved the success that made them famous. But one quality that they all have which I respect profoundly is the sense of respect and importance they have for their failed ideas. The ‘bad’ designs are no less important or vital to their success than the good one.</p>
<p>So what about you? What do you consider ‘bad design’, and how much of a role has it played in your career, if at all? What is your approach to bad ideas when they appear during your brainstorming sessions, and why so?</p>


<p>Related posts:<ol><li><a href='http://www.ashmenon.com/logo-inspiration-1-fun/' rel='bookmark' title='Logo Inspiration #1 &ndash; Fun'>Logo Inspiration #1 &ndash; Fun</a> <small>First in a series of logo inspiration posts. Today's keyword is 'fun', so enjoy!...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ashmenon.com/why-bad-design-is-good-for-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logo Inspiration #1 &#8211; Fun</title>
		<link>http://www.ashmenon.com/logo-inspiration-1-fun/</link>
		<comments>http://www.ashmenon.com/logo-inspiration-1-fun/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 00:26:09 +0000</pubDate>
		<dc:creator>Ash Menon</dc:creator>
				<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[Logo Design]]></category>
		<category><![CDATA[inspiration]]></category>

		<guid isPermaLink="false">http://www.ashmenon.com/?p=235</guid>
		<description><![CDATA[First in a series of logo inspiration posts. Today's keyword is 'fun', so enjoy!


Related posts:<ol><li><a href='http://www.ashmenon.com/why-bad-design-is-good-for-you/' rel='bookmark' title='Why Bad Design is Good for You'>Why Bad Design is Good for You</a> <small>We've all had our Comic Sans moments. The ones where our ideas all look horrible and we're stumped. But are...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying this new thing, folks. You see, to me, inspiration comes in these magical bursts of light and energy, and the best way for me to get them is to browse around the web looking for random designs. Sometimes they have absolutely nothing to do with the project I&#8217;m working on, but it helps anyway, because when you&#8217;re too set on a single way of thinking, you need a completely different approach to help widen your horizons.</p>
<p>For the most part, my inspirations have come from logos. While all designs carry their own strengths, logos are particularly useful for inspiration because a good logo has identity, personality, and flavor. So in gratitude for the various logo designers that have indirectly inspired me with their works, I&#8217;m starting my own list-post series of logos. For now most of these are from Logopond and Deviantart, but I&#8217;m guessing my sources will widen as I get better with this.</p>
<p>To add a unique spin on this, I&#8217;m going to designate a keyword to each round of inspiration. Today&#8217;s keyword, of course, is <strong>fun</strong>.</p>
<p>And yes, I&#8217;m only rambling this much because it&#8217;s the first time. I promise to shut up the next time :). So without further ado.</p>
<p>&#160;</p>
<p>1) <a href="http://logopond.com/gallery/detail/109423" target="_blank">colourfly</a> by <a href="http://logopond.com/members/profile/showcase/38068" target="_blank">filipev</a></p>
<p><a title="colourfly by filipev" href="http://logopond.com/gallery/detail/109423" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="colourfly" border="0" alt="colourfly" src="http://www.ashmenon.com/wordpress/wp-content/uploads/colourfly.png" width="325" height="260" /></a></p>
<p>2) <a href="http://logopond.com/gallery/detail/112909" target="_blank">Ghost Chip</a> by <a href="http://logopond.com/members/profile/showcase/6990" target="_blank">mavric</a></p>
<p><a title="Ghost Chip by mavric" href="http://logopond.com/gallery/detail/112909" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="ghostchip" border="0" alt="ghostchip" src="http://www.ashmenon.com/wordpress/wp-content/uploads/ghostchip.png" width="325" height="260" /></a> </p>
<p>3) <a href="http://logopond.com/gallery/detail/108655" target="_blank">Foodball</a> by <a href="http://logopond.com/members/profile/showcase/8696" target="_blank">garavi</a></p>
<p><a title="Foodball by garavi" href="http://logopond.com/gallery/detail/108655" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="foodball" border="0" alt="foodball" src="http://www.ashmenon.com/wordpress/wp-content/uploads/foodball.png" width="325" height="260" /></a> </p>
<p>4) <a href="http://logopond.com/gallery/detail/111196" target="_blank">Flyer-city</a> by <a href="http://logopond.com/members/profile/showcase/19623" target="_blank">Matto</a></p>
<p><a title="Flyer-city by Matto" href="http://logopond.com/gallery/detail/111196" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="flyer-city" border="0" alt="flyer-city" src="http://www.ashmenon.com/wordpress/wp-content/uploads/flyercity.png" width="325" height="260" /></a> </p>
<p>5) <a href="http://logopond.com/gallery/detail/110603" target="_blank">Nacho Macho</a> by <a href="http://logopond.com/members/profile/showcase/8634" target="_blank">Oronoz</a></p>
<p><a title="Nacho Macho by Oronoz" href="http://logopond.com/gallery/detail/110603" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="nachomacho" border="0" alt="nachomacho" src="http://www.ashmenon.com/wordpress/wp-content/uploads/nachomacho.png" width="325" height="260" /></a> </p>
<p>6) <a href="http://logofaves.com/2010/03/toronto-bodyworks/" target="_blank">Toronto Bodyworks</a> by <a href="http://www.thedesignfirm.ca/" target="_blank">Luke Despatie</a></p>
<p><a title="Toronto Bodyworks by Luke Despatie" href="http://logofaves.com/2010/03/toronto-bodyworks/" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="torontobodyworks" border="0" alt="torontobodyworks" src="http://www.ashmenon.com/wordpress/wp-content/uploads/torontobodyworks.jpg" width="400" height="198" /></a> </p>
<p>7) <a href="http://logofaves.com/2008/12/sertifi/" target="_blank">Sertifi</a> by <a href="http://www.logodiver.com/" target="_blank">Logo Diver (Yury Akulin)</a></p>
<p><a title="Sertifi by Logo Diver (Yury Akulin)" href="http://logofaves.com/2008/12/sertifi/" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="sertifi" border="0" alt="sertifi" src="http://www.ashmenon.com/wordpress/wp-content/uploads/sertifi.jpg" width="400" height="198" /></a> </p>
<p>8) <a href="http://logopond.com/gallery/detail/110252" target="_blank">Gelato Vero v2</a> by <a href="http://logopond.com/members/profile/showcase/15657" target="_blank">andreiu</a></p>
<p><a title="Gelato Vero v2 by andreiu" href="http://logopond.com/gallery/detail/110252" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="gelatovero" border="0" alt="gelatovero" src="http://www.ashmenon.com/wordpress/wp-content/uploads/gelatovero.png" width="325" height="260" /></a> </p>
<p>9) <a href="http://logopond.com/gallery/detail/109978" target="_blank">THERMO-COOL</a> by <a href="http://logopond.com/members/profile/showcase/31327" target="_blank">Mikeymike</a></p>
<p><a title="THERMO-COOL by Mikeymike" href="http://logopond.com/gallery/detail/109978" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="thermocool" border="0" alt="thermocool" src="http://www.ashmenon.com/wordpress/wp-content/uploads/thermocool.png" width="325" height="260" /></a> </p>
<p>10) <a href="http://logopond.com/gallery/detail/109754" target="_blank">mango</a> by <a href="http://logopond.com/members/profile/showcase/11798" target="_blank">tass</a></p>
<p><a title="mango by tass" href="http://logopond.com/gallery/detail/109754" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="mango" border="0" alt="mango" src="http://www.ashmenon.com/wordpress/wp-content/uploads/mango.png" width="325" height="260" /></a></p>
<p>&#160;</p>
<p>If you&#8217;ve got any suggestions for the next round of logo inspiration (or if you have an idea for another type of inspiration post series), do let me know in the comments!</p>


<p>Related posts:<ol><li><a href='http://www.ashmenon.com/why-bad-design-is-good-for-you/' rel='bookmark' title='Why Bad Design is Good for You'>Why Bad Design is Good for You</a> <small>We've all had our Comic Sans moments. The ones where our ideas all look horrible and we're stumped. But are...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ashmenon.com/logo-inspiration-1-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Design Mindset &#8211; 8 Principles You Can Apply in Your Life</title>
		<link>http://www.ashmenon.com/the-design-mindset-8-principles-you-can-apply-in-your-life/</link>
		<comments>http://www.ashmenon.com/the-design-mindset-8-principles-you-can-apply-in-your-life/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 16:27:38 +0000</pubDate>
		<dc:creator>Ash Menon</dc:creator>
				<category><![CDATA[Happiness]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[motivation]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[positive]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://www.ashmenon.com/?p=218</guid>
		<description><![CDATA[When I first entered college, and I was being given an introduction to the different majors available, my first question once my guide had finished talking was &#8220;Can I take all five?&#8221;. Looking back now, it seems like a hilarious thing to even consider (one major alone had enough hours in it to kill a [...]


Related posts:<ol><li><a href='http://www.ashmenon.com/set-yourself-on-fire/' rel='bookmark' title='Set Yourself on Fire'>Set Yourself on Fire</a> <small>Calm down, I don&#8217;t actually mean that. I treasure my readers very much, and I&#8217;d be rather upset if I...</small></li><li><a href='http://www.ashmenon.com/smile/' rel='bookmark' title='Smile'>Smile</a> <small>I was recently reading a very inspiring post by Oscar at Freestyle Mind entitled '27 Traits of Successful People'. What...</small></li><li><a href='http://www.ashmenon.com/tying-tighter-shoelaces-10-tips-to-increase-productivity-at-home/' rel='bookmark' title='Tying Tighter Shoelaces: 10 Tips to Increase Productivity at Home'>Tying Tighter Shoelaces: 10 Tips to Increase Productivity at Home</a> <small>To a runner, tying tigher shoelaces may help shave off a few milliseconds from his time, which could mean the...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>When I first entered college, and I was being given an introduction to the different majors available, my first question once my guide had finished talking was &#8220;Can I take all five?&#8221;. Looking back now, it seems like a hilarious thing to even consider (one major alone had enough hours in it to kill a small animal), but I can sort of understand why I was thinking that. You see, I love design, but in a general sense. Even now the five majors (advertising and graphic design, illustration, animation, multimedia, and interior design) still pull at me with equal strength. I ended up going into advertising and graphic design, but for a very specific reason: I want to develop a design mindset in myself.</p>
<p><b>What is a design mindset?</b></p>
<p>Like many things in the design lexicon, &#8216;design mindset&#8217; is a term that is very much open to interpretation. I can probably tell you that if you ask me what a design mindset is, I would give you a different answer 3 years ago than I would have today, and 3 years down the road my answer would be completely different again. Even while searching the web for some reading material while writing this post, I came across completely different ideas regarding design thinking and the design mindset. I can only hope to give you my version of it, and to hear yours.</p>
<p>A design mindset is a way of thinking that continuously evolves, changes, and adapts. It is based on a series of principles most commonly found and practiced in the design industry (thus earning it its name), but is not exclusive to the design industry. The main points of design thinking can be summarized as follows:</p>
<p>1) Practicing a methodology that involves identifying the problem, issue, or question at hand, and approaching it from various perspectives.</p>
<p>2) Allowing any idea, regardless of quality, to appear on the table before it is judged.</p>
<p>3) Taking risks with approaches and solutions that have never been applied or attempted before.</p>
<p>4) Continuously striving to improve upon a current situation or condition, in an endless cycle.</p>
<p><b>How is a design mindset important in my life?</b></p>
<p><b></b></p>
<p>An excellent question. In fact, promoting design thinking in daily life is one of the main reasons I started this blog. A design mindset is important in your life because <b>your life is a product of your design</b>. Just like your car, or your clothes, your life is the result of the various choices, improvements, and mistakes that you have made so far. But most people don&#8217;t realize this and allow their lives to run on autopilot, just leaving it as it is. But think about it: if Nike had let their products remain as they were, the World Cup would have been played in t-shirts and sandals. Implementing design thinking into your life will allow you to continuously improve your quality of life, as well as to critically and objectively analyze your life, to find areas in which you can become a better person.</p>
<p>So what principles of design thinking can be used in daily life? I&#8217;ve listed 8 that I try my best to live my life by, but take note that these are far from an exhaustive list, and even within these 8 I bet opinions are going to differ.</p>
<p><b>There is no limit to learning.</b></p>
<p>I&#8217;ve encountered it in hundreds of people, yet it still bewilders me each time I do so: meeting a person who thinks his/her learning days are over once he/she reaches a certain age. A person can spend his entire life learning new things, and yet he/she will never reach omniscience. Even more so when you consider the ever-changing nature of science and technology. Like how constantly updating your design knowledge will help your designs stay fresh and unique, opening yourself up to learning something new every day is great for your spiritual and mental health.</p>
<p><b></b></p>
<p><b>For every problem, there is a solution.</b></p>
<p>Repeat after me: <i>There is NO SUCH THING as an unsolvable problem</i>. </p>
<p>Design thinking has overcome the most challenging of problems in the past. Millions of pages worth of data stored in a tiny chip no bigger than a button? Done. A convenient way to fasten and unfasten fabric? Hello, zipper. </p>
<p>If a solution doesn&#8217;t exist for your problem, it just means that one hasn&#8217;t been created yet. If so, what are you waiting for?</p>
<p><b></b></p>
<p><b>And for every solution, there will be a problem. </b></p>
<p><b></b></p>
<p>How many times have you experienced this one? You have a major breakthrough at work, only to find that your solution created another problem further ahead. While sometimes the problem that appears may not be the direct result of the solution, it always seems like there&#8217;s one more obstacle in your way than you have the energy to overcome. </p>
<p>The key to controlling this is to understand that this is simply nature&#8217;s love of balance working here. Don&#8217;t think of it as new problems, but instead as new questions to ponder, and new challenges to conquer, and you&#8217;ll soon realize that every problem that crops up in your path only serves to motivate you further.</p>
<p><b></b></p>
<p><b>You are your loudest audience.</b></p>
<p><b></b></p>
<p>You are your biggest fan, and you are your strongest critic. The one person who will most appreciate your achievements will be you, as will the one person who is most critical and harsh regarding your failures or mistakes. It is a natural fact of life. The reason behind this is simple: <i>the person who pays the most attention to you, is you</i>. Understanding this and accepting this is a vital key in improving your self-confidence and personal image. </p>
<p>Don&#8217;t be afraid to try new things, or to do things that seem silly. It may seem like everybody would laugh at you, but in reality, they have much better things to do than to circle around you and wait for you to fall. In fact, they may be supportive of your risks, and you may even end up inspiring them to take some risks themselves. It&#8217;s your life, and what you want to do with it is what counts. </p>
<p><b></b></p>
<p><b>No one key works for every lock.</b></p>
<p><b></b></p>
<p>Bob the Colleague finds yoga to be his outlet. Since he started going for yoga classes, you find him to be happier, calmer, healthier, and much nicer to be around. So you try it yourself. After a few awkward balancing poses and muttered swears, you arrive at the office the next day with a snappy temper and a sore side. What happened?</p>
<p>It may seem obvious when you look at it from a third person&#8217;s perspective, but it&#8217;s not always so clear when you&#8217;re going through the problem yourself. What works for one person may not always work for you. It&#8217;s great that you&#8217;ve tried it out, and you&#8217;ve found that it isn&#8217;t helping. Accept that, and try something else. Perhaps pole-dancing would give you the same calmness that Bob gets from yoga. Hey, it&#8217;s worth a shot, right? Which brings me to my next point.</p>
<p><b></b></p>
<p><b>Judgment does not come before a trial.</b></p>
<p><b></b></p>
<p>The courtrooms have it right: don&#8217;t judge something before you try it. Pole-dancing may seem like a bizarre thing to try, and really, if you&#8217;re a guy, you&#8217;d probably rather <i>be </i>the pole that be wrapped around it. </p>
<p>But you&#8217;re never going to find out what it can do for you unless you try it yourself. You don&#8217;t have to commit to anything yet. If you&#8217;re taking a physical class like pole-dancing or yoga, try looking for an option to try one class, or even for a one-time workshop. Thinking of studying a language? Pick up a phrase book and start pronouncing the words, and think of how it makes you feel. And while there&#8217;s no workshop or trial option for a career change, perhaps you could take a few days off and experience aspects of your new career (like being a professional shopper, or an artist). </p>
<p>Prepare for these one-time experiences by telling yourself that you are going to accept every experience that happens to you during this time, good or bad. You are here to try something new, and with that comes the acceptance that it doesn&#8217;t always work out. </p>
<p><b></b></p>
<p><b>If you can&#8217;t see, try changing glasses.</b></p>
<p><b></b></p>
<p>Persistence is a virtue often praised. After all, if at first you don&#8217;t succeed, you are told to try and try again. But sometimes, it just doesn&#8217;t work, and it only results in frustration, and in certain cases you could even burn out.</p>
<p>Try tackling the issue from a different angle. See it from another person&#8217;s point of view. You&#8217;ll begin to notice aspects of this issue that you would have never seen otherwise. Again, an open mind is vital here, because if you keep insisting that your way is right, you&#8217;re never going to learn anything new.</p>
<p>This idea of different perspectives can also be applied when you have an idea. Even the most analytical of us will be biased to our own ideas. Forcing yourself to look at your own ideas from an external perspective will highlight flaws and points of improvement that you would have otherwise been oblivious to.</p>
<p><b></b></p>
<p><b>Enjoy the journey, and you will enjoy the destination.</b></p>
<p><b></b></p>
<p>In Robin Sharma&#8217;s book &#8220;The Monk Who Sold His Ferrari&#8221;, the main character asks his newly-enlightened friend regarding the final goal of this new, spiritually wholesome life. I forget the exact words the friend used to reply, but it was something like this: &#8220;If you keep one eye on the horizon, only one eye is enjoying the road.&#8221; Today, I was in a bookstore, flipping through a book on meditation, where they advise the reader to &#8220;meditate not for the benefits it can bring in the end, but for the benefits you get from each meditation.&#8221;</p>
<p>Both touch on the same meaning: in any journey, the destination only holds part of the value. There is real experience and value to be gained during the journey itself. And this is doubly important if you are doing something that involves long periods of effort or discipline, like getting fit or studying. It&#8217;s always good to focus on your final goal, but the truth is that most of us end up focusing on the entire stretch of road that is between us and that goal. Try instead to focus on the journey. Learn for the sake of learning. Pick up a musical instrument not because you want to wow your friends (although having that as a final goal is perfectly acceptable), but because you like the sound of the instrument, and because you want to try playing a particular piece of music. When you focus on the journey, your development and learning rate seems to accelerate rapidly, and pretty soon you&#8217;ll be amazing your friends with a world-class bongo drum performance.</p>
<p>Since this is an issue that I strongly relate to, I can probably go on for pages. However, I&#8217;d much rather hear your perspective (see what I did there?) about this. What are some of the things you do in your life that you think qualifies as &#8216;design thinking&#8217;?</p>


<p>Related posts:<ol><li><a href='http://www.ashmenon.com/set-yourself-on-fire/' rel='bookmark' title='Set Yourself on Fire'>Set Yourself on Fire</a> <small>Calm down, I don&#8217;t actually mean that. I treasure my readers very much, and I&#8217;d be rather upset if I...</small></li><li><a href='http://www.ashmenon.com/smile/' rel='bookmark' title='Smile'>Smile</a> <small>I was recently reading a very inspiring post by Oscar at Freestyle Mind entitled '27 Traits of Successful People'. What...</small></li><li><a href='http://www.ashmenon.com/tying-tighter-shoelaces-10-tips-to-increase-productivity-at-home/' rel='bookmark' title='Tying Tighter Shoelaces: 10 Tips to Increase Productivity at Home'>Tying Tighter Shoelaces: 10 Tips to Increase Productivity at Home</a> <small>To a runner, tying tigher shoelaces may help shave off a few milliseconds from his time, which could mean the...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ashmenon.com/the-design-mindset-8-principles-you-can-apply-in-your-life/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginner PHP Chapter 4 &#8211; Conditional Statements</title>
		<link>http://www.ashmenon.com/beginner-php-chapter-4-conditional-statements/</link>
		<comments>http://www.ashmenon.com/beginner-php-chapter-4-conditional-statements/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 12:27:43 +0000</pubDate>
		<dc:creator>Ash Menon</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.ashmenon.com/?p=214</guid>
		<description><![CDATA[In the previous chapters, we've covered variables, functions, and operators. We've also touched slightly on conditional statements. In this chapter, I'm going to cover the rest of conditional statements.


Related posts:<ol><li><a href='http://www.ashmenon.com/beginner-php-chapter-3-operator/' rel='bookmark' title='Beginner PHP Chapter 3 &#8211; Operators'>Beginner PHP Chapter 3 &#8211; Operators</a> <small>Operators are to PHP what grammar particles are to English. They connect the various important bits you have to become...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-1-the-meet-n-greet/' rel='bookmark' title='Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet'>Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet</a> <small>Imagine this scenario. You're a kick-ass designer, you make gorgeous website mocks in Photoshop, and you already know how to...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-2-functions-and-variables/' rel='bookmark' title='Beginner PHP Chapter 2 &ndash; Functions and Variables'>Beginner PHP Chapter 2 &ndash; Functions and Variables</a> <small>In the previous chapter, you learned what PHP is and what you could be capable of achieving with it. In...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>(Note: Originally this chapter was meant to cover both conditional and loop statements. Due to the length of the post, I&#8217;ve decided to split it into two chapters.)
</p>
<p>In the previous chapters, we&#8217;ve covered variables, functions, and operators. We&#8217;ve also touched slightly on conditional statements. In this chapter, I&#8217;m going to cover the rest of conditional statements. Like the elements that you&#8217;ve learned in the previous chapters, conditional statements are basic building blocks that enable you to build powerful scripts. Once you master these, you&#8217;ll be able to create complex and sophisticated systems with just a few lines of code. But first let&#8217;s get to know this statement type.
</p>
<h3>Conditional Statements</h3>
<h4>What are conditional statements?</h4>
<p>In chapter 3, we touched a little bit on conditional statements when we covered conditional operators, as the two can&#8217;t be separated. A conditional statement is <strong>a block of code that is executed if certain requirements are met</strong>. Using these will allow you to achieve greater sophistication within your codes, as it allows your script to react to current conditions.
</p>
<h4>What type of conditional statements are there?</h4>
<p>Conditional statements can be divided into four major keywords, <strong>if</strong>, <strong>else</strong>, <strong>elseif</strong>, and <strong>switch</strong>. There are also three minor keywords that are used with the &#8217;switch&#8217; keyword, which are <strong>case</strong>, <strong>default</strong>, and <strong>break</strong>.
</p>
<h4>Why should I use conditional statements?</h4>
<p>And this is where I go crazy with the examples. The &#8216;if&#8217; keyword is pretty simple to explain. Let&#8217;s say you&#8217;re driving. If you&#8217;re low on gas, stop at a station and refill. Easy, no? So let&#8217;s give another example that&#8217;s a bit more script-related. Let&#8217;s say you&#8217;re asking a user to enter his email address. If the email address space is empty when the user submits the form, let him know that he/she forgot about it.
</p>
<p>Next is the &#8216;else&#8217; keyword. I&#8217;ll reuse the previous two examples so you can better understand. Let&#8217;s say you DO stop at that gas station. We can use an &#8216;if&#8217; statement that goes something like this:
</p>
<blockquote><p>If you have cash, pay using cash.</p></blockquote>
<p>The problem with this is that if you DON&#8217;T have cash, nothing happens. Even worse, you&#8217;ll just continue on with your action, which would result in you filling up without paying. Not good. Now let&#8217;s add an &#8216;else&#8217; to that:
</p>
<blockquote><p>If you have cash, pay using cash. <strong>Else</strong>, pay using your credit card.</p></blockquote>
<p>Much better. As you can see, the end result is that you end up paying for the gas one way or the other. Which tends to help you not get arrested. How about the user with the missing email address, then? Let&#8217;s look at it with just the &#8216;if&#8217; keyword:
</p>
<blockquote><p>If the space for email address is empty, alert the user.</p></blockquote>
<p>Can you predict the problem here? Your script will alert the user, but will also continue to process the form. Even if this doesn&#8217;t result in problems in your code, you&#8217;re left with no email address to contact him/her with. Let&#8217;s add an &#8216;else&#8217; keyword into that.
</p>
<blockquote><p>If the space for email address is empty, alert the user. <strong>Else</strong>, continue processing the form.</p></blockquote>
<p>Now, if the user doesn&#8217;t enter his/her email address, the script will stop processing the form. You&#8217;ll find that when you create forms for user input, these kind of conditions will ensure that your user is more likely to fill the form up properly, which will greatly benefit both you and him/her.
</p>
<p>Now let&#8217;s move on to the &#8216;elseif&#8217; keyword. Some of you have probably surmised that since the word is basically &#8216;else&#8217; and &#8216;if&#8217; mashed together, it should function like both those keywords combined, and you&#8217;d be right about that. The &#8216;elseif&#8217; keyword allows you to expand a conditional statement by adding a third possible outcome, or a fourth, or as many as you want. Let&#8217;s head back to our gas station example then. This is where we were:
</p>
<blockquote><p>If you have cash, pay using cash. Else, pay using your credit card.</p></blockquote>
<p>Let&#8217;s assume you don&#8217;t have any cash, and you don&#8217;t have your credit cards with you either. Talk about bad planning. So when it comes time for me to pay, the following would happen: you&#8217;d check if you had cash, and find out that you have none. Then you&#8217;d reach for your credit card. At that point, you&#8217;d realise that you don&#8217;t have your card with you. What you DO have, however, is a problem. And a rather annoyed gas station attendant. So let&#8217;s add a third possiblity to this:
</p>
<blockquote><p>If you have cash, pay using cash. <strong>Elseif</strong> you have your credit card, pay using your credit card. Else, withdraw some cash using your ATM card and pay.</p></blockquote>
<p>You&#8217;ll notice that the &#8216;elseif&#8217; keyword comes before the &#8216;else&#8217; keyword. This is because &#8216;else&#8217; is the what the script considers as a Plan-Z, something to use when nothing else works out. Thus, logically, it is written at the end of the conditional block.
</p>
<p>And last but not least, is the &#8217;switch&#8217; keyword. This keyword is slightly different from the others, because it requires you to have a variable beforehand. So to explain this, I&#8217;m going to use a different situation. Let&#8217;s say you&#8217;re a bartender at a fancy hotel in Vegas (hey, why dream small?). You get an order for a drink. Naturally, the first thing that you&#8217;d do is get a glass ready. But as any self-respecting bartender would tell you, you can&#8217;t just pick ANY glass. What did the customer order? If it&#8217;s a martini, get a martini glass. If it was champagne, get a flute. So the type of glass you reach for, depends on the order.
</p>
<p>In that scenario, the order is your variable. You&#8217;d have a bunch of options beforehand, along with a default choice that would happen if the order didn&#8217;t fit any category (maybe he just wanted plain water?). That&#8217;s where the &#8216;default&#8217; keyword comes in. The choices you are prepared for beforehand (e.g. martini, champagne, vodka, scotch, etc) are defined using the &#8216;case&#8217; keyword. And finally, the &#8216;break&#8217; keyword is used to separate each choice, so we don&#8217;t end up reaching for all the glasses for that one drink. You&#8217;ll be able to better understand this structure by looking at the code samples below, so don&#8217;t worry if you haven&#8217;t got it yet.
</p>
<h4>How do I write conditional statements?</h4>
<p>Note that for all the conditional statements, and also for the loop statements later on, you&#8217;ll see that there are two major ways of writing them. One uses curly brackets, while the other uses a colon (:) and a type of &#8216;end&#8217; syntax to end a block. The latter is popularly known as the <strong>alternative syntax</strong>. Both ways will work, both ways have their pros and cons. Deciding which one to use when writing your scripts is entirely up to you, so choose the one you&#8217;re more comfortable with.
</p>
<p>Let&#8217;s start with the &#8216;if&#8217; keyword. I&#8217;ll reuse the previous example to make things clearer. First up is the old-school, or standard syntax:
</p>
<pre class="brush: php;">

&lt;?php

if($gas=='low'){
	stop_at_petrol_station();
	refill_gas();
};

?&gt;
</pre>
<p>And next is the alternative syntax for writing the same thing.
</p>
<pre class="brush: php;">

&lt;?php

if($gas=='low'):
	stop_at_petrol_station();
	refill_gas();
endif;

?&gt;
</pre>
<p>There are really only two points of difference between the two syntaxes, and they&#8217;re both at the curly brackets. The opening curly bracket is replaced by a colon (:), while the closing curly bracket is replaced by the keyword &#8216;endif&#8217;. How about our second example? Using the standard syntax:
</p>
<pre class="brush: php;">

&lt;?php

if($email_address==''){
	alert_user('It looks like you forgot to enter your email address');
};

?&gt;
</pre>
<p>And using the alternate syntax:
</p>
<pre class="brush: php;">

&lt;?php

if($email_address==''):
	alert_user('It looks like you forgot to enter your email address');
endif;

?&gt;
</pre>
<p>Now let&#8217;s move on to the else keyword. Starting with our gas station example, here are both syntaxes:
</p>
<pre class="brush: php;">

&lt;?php

if($got_cash=='yes'){
	$payment_method = 'cash';
} else {
	$payment_method = 'credit card';
};

if($got_cash=='yes'):
	$payment_method = 'cash';
else:
	$payment_method = 'credit card';
endif;

?&gt;
</pre>
<p>Pay careful attention to the differences between the two. The curly brackets are all gone in the alternative syntax, and there are colons where the opening curly brackets used to be. Finally, the last curly bracket is replaced by the &#8216;endif&#8217; keyword. Another element that you will want to pay attention to is the usage of semicolons and colons in your blocks. Make sure you don&#8217;t mix the two up, as it is likely to cause your script to break.
</p>
<p>Now let&#8217;s move on to our second example, the user with the missing email address:
</p>
<pre class="brush: php;">

&lt;?php

if($email_address==''){
	alert_user('It looks like you forgot to enter your email address');
} else {
	continue_processing_form();
};

if($email_address==''):
	alert_user('It looks like you forgot to enter your email address');
else:
	continue_processing_form();
endif;

?&gt;
</pre>
<p>And now our &#8216;elseif&#8217; keyword.
</p>
<pre class="brush: php;">

&lt;?php

if($got_cash=='yes'){
	$payment_method = 'cash';
} elseif ($got_credit_card=='yes'){
	$payment_method = 'credit_card';
} else {
	withdraw_money();
};

if($got_cash=='yes'):
	$payment_method = 'cash';
elseif ($got_credit_card=='yes'):
	$payment_method = 'credit card';
else:
	withdraw_money();
endif;

?&gt;
</pre>
<p>Note: For the standard syntax, &#8216;elseif&#8217; can also be written as &#8216;else if&#8217;.
</p>
<p>Now for the &#8217;switch&#8217; keyword. As you&#8217;ve probably noticed, the &#8216;if&#8217;, &#8216;else&#8217;, and &#8216;elseif&#8217; keywords all fit into the same structure. The &#8217;switch&#8217; keyword, however, uses a different structure entirely. Here&#8217;s an example:
</p>
<pre class="brush: php;">

&lt;?php

switch($variable){
	case 'valueA':
		//Any code here is executed if $variable's value is 'valueA'.
		break;
	case 'valueB':
		//Any code here is executed if $variable's value is 'valueB'.
		break;
	default:
		//Any code here is executed if $variable's value is neither 'valueA' nor 'valueB'.
};

?&gt;
</pre>
<p>The biggest difference between the &#8216;if&#8217; structure and the &#8217;switch&#8217; structure is that the &#8217;switch&#8217; structure only looks at possible values for a variable. The &#8216;if&#8217; structure, along with &#8216;else&#8217; and &#8216;elseif&#8217;, is infinitely more flexible and powerful (in my opinion, anyway), but since programmers tend to use both of these structures interchangeably, I&#8217;d recommend familliarising yourself with both types.
</p>
<p>Like it&#8217;s &#8216;if&#8217; counterpart, the &#8217;switch&#8217; structure also has an alternative syntax. Here it is:
</p>
<pre class="brush: php;">

&lt;?php

switch($variable):
	case 'valueA':
		//Any code here is executed if $variable's value is 'valueA'.
		break;
	case 'valueB':
		//Any code here is executed if $variable's value is 'valueB'.
		break;
	default:
		//Any code here is executed if $variable's value is neither 'valueA' nor 'valueB'.
endswitch;

?&gt;
</pre>
<p>The differences are pretty much the same as the other alternative syntaxes: the opening curly bracket is replaced by a colon, and the closing curly bracket is replaced by an &#8216;endswitch&#8217; keyword. Like any other time you use the alternate syntax, be aware of where your colons and semicolons are supposed to go. Now let&#8217;s try that using our bartender example:
</p>
<pre class="brush: php;">

&lt;?php

switch($order):
	case 'martini':
		$glass = 'martini glass';
		break;
	case 'vodka':
		$glass = 'vodka glass';
		break;
	case 'champagne':
		$glass = 'champagne flute';
		break;
	default:
		$glass = 'normal glass';
endswitch;

?&gt;
</pre>
<p>So if the bartender receives an order for a martini, vodka, or champagne, he brings out the appropriate glass. Otherwise, he just takes a normal glass. You&#8217;ve probably realised it by now, but the &#8216;default&#8217; keyword pretty much acts the same way as the &#8216;else&#8217; keyword. It provides the script with a last resort to turn to when all the previous options can&#8217;t be used.
</p>
<p>Note the &#8216;break&#8217; keyword in between each &#8216;case&#8217; keyword. The &#8216;break&#8217; keyword ensures that the script won&#8217;t execute the next case&#8217;s codes, and the next one, and so on. For example, if we took out the &#8216;break&#8217; keywords, and ran the same script, the following would happen:
</p>
<blockquote><p>
If the bartender receives an order for something other than a martini, vodka, and champagne, he will take a normal glass.<br />
If the bartender receives an order for champagne, he will take a champagne flute, and then take a normal glass.<br />
If the bartender receives an order for a vodka, he will take a vodka glass, then take a champagne flute, then take a normal glass.<br />
If the bartender receives an order for a martini, he will take a martini glass, then take a vodka glass, then take a champagne flute, then take a normal glass.
</p></blockquote>
<p>The &#8216;break&#8217; keyword allows us to structure the flow by putting blockades in between each case. Note that there may be times when you&#8217;d rather not have the &#8216;break&#8217; keyword there. A simple example of this:
</p>
<pre class="brush: php;">

&lt;?php

switch($level){
	case 'level 1':
		finish_level_1();
	case 'level 2':
		finish_level_2();
	case 'level 3':
		finish_level_3();
	case 'all finished':
		get_prize();
};

?&gt;
</pre>
<p>If the value of $level was &#8216;level 1&#8242;, all four functions would be called in the order that they are listed. If the variable&#8217;s value is &#8216;level 2&#8242;, then it would start from calling &#8216;finish_level_2()&#8217;, and then working it&#8217;s way down from there. And so on and so forth. For 90% of the time, you&#8217;ll probably want to use the &#8216;break&#8217; keyword to separate your cases, but it&#8217;s worth knowing about this stair-step kind of technique.
</p>
<p>And that about wraps it up for the conditional statements. Like all other PHP coding elements, if you&#8217;re not sure about whether a certain combination of elements or a certain method will work, the easiest way is to try it out for yourself. PHP will be only too happy to let you know if there&#8217;s an error :).
</p>
<p>Of course, in our next chapter, I&#8217;ll be covering loop statements. I&#8217;ll also be covering how you can combine conditional and loop statements within and around each other to create massively useful code blocks. Sounds confusing? Trust me, it&#8217;s pretty simple once you understand the basics. Till then, I&#8217;d love to hear what you have to say. If you have any questions, comments, or feedback about how I can improve my tutorials, please let me know in the comments. Thanks!</p>


<p>Related posts:<ol><li><a href='http://www.ashmenon.com/beginner-php-chapter-3-operator/' rel='bookmark' title='Beginner PHP Chapter 3 &#8211; Operators'>Beginner PHP Chapter 3 &#8211; Operators</a> <small>Operators are to PHP what grammar particles are to English. They connect the various important bits you have to become...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-1-the-meet-n-greet/' rel='bookmark' title='Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet'>Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet</a> <small>Imagine this scenario. You're a kick-ass designer, you make gorgeous website mocks in Photoshop, and you already know how to...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-2-functions-and-variables/' rel='bookmark' title='Beginner PHP Chapter 2 &ndash; Functions and Variables'>Beginner PHP Chapter 2 &ndash; Functions and Variables</a> <small>In the previous chapter, you learned what PHP is and what you could be capable of achieving with it. In...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ashmenon.com/beginner-php-chapter-4-conditional-statements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set Yourself on Fire</title>
		<link>http://www.ashmenon.com/set-yourself-on-fire/</link>
		<comments>http://www.ashmenon.com/set-yourself-on-fire/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 16:15:10 +0000</pubDate>
		<dc:creator>Ash Menon</dc:creator>
				<category><![CDATA[Happiness]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[motivation]]></category>

		<guid isPermaLink="false">http://www.ashmenon.com/?p=210</guid>
		<description><![CDATA[Calm down, I don&#8217;t actually mean that. I treasure my readers very much, and I&#8217;d be rather upset if I triggered some sort of self-immolation trend. What I AM talking about, however, is that inner sense of inspiration. You probably know what I&#8217;m talking about. In every office, or any other workplace for that matter, [...]


Related posts:<ol><li><a href='http://www.ashmenon.com/the-design-mindset-8-principles-you-can-apply-in-your-life/' rel='bookmark' title='The Design Mindset &ndash; 8 Principles You Can Apply in Your Life'>The Design Mindset &ndash; 8 Principles You Can Apply in Your Life</a> <small>When I first entered college, and I was being given an introduction to the different majors available, my first question...</small></li><li><a href='http://www.ashmenon.com/tying-tighter-shoelaces-10-tips-to-increase-productivity-at-home/' rel='bookmark' title='Tying Tighter Shoelaces: 10 Tips to Increase Productivity at Home'>Tying Tighter Shoelaces: 10 Tips to Increase Productivity at Home</a> <small>To a runner, tying tigher shoelaces may help shave off a few milliseconds from his time, which could mean the...</small></li><li><a href='http://www.ashmenon.com/smile/' rel='bookmark' title='Smile'>Smile</a> <small>I was recently reading a very inspiring post by Oscar at Freestyle Mind entitled '27 Traits of Successful People'. What...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Calm down, I don&#8217;t actually mean that. I treasure my readers very much, and I&#8217;d be rather upset if I triggered some sort of self-immolation trend. What I AM talking about, however, is that inner sense of inspiration. You probably know what I&#8217;m talking about. In every office, or any other workplace for that matter, there is that one individual who has a light in his eyes. He or she tackles his work with a consistent sense of enthusiasm that leaves you wondering if you&#8217;re in the presence of aliens. Fear not, they&#8217;re still human. The only difference is that they&#8217;ve found something that ignites their passions. And if they can do it, so can you.</p>
<p>A campfire analogy would probably work best here. It takes some effort to start a campfire, but with the correct spark and a receptive bunch of kindling, you can get a good fire going. After that it&#8217;s just a matter of minor maintenance, and that fire will keep you warm without much effort on your part. Similarly, all you need to build up a long-term, consistent sense of motivation in yourself is three things.</p>
<ol>
<li>The spark &#8211; do something that inspires you</li>
<li>The kindling &#8211; be open-minded about changes that happen in your life</li>
<li>The maintenance</li>
</ol>
<h4>The Spark</h4>
<p>This is actually the easiest part of the whole thing. Doing something different, even if it&#8217;s a minor thing, opens your life up for changes that you could have never imagined. True, there are stories of people who suddenly quit their successful jobs to become artists or to work in the mountains, but don&#8217;t let that fool you; even small actions can bring big changes. Here are a few things that you can try:</p>
<ol>
<li>Take a language class &#8211; ever felt like picking up Spanish? Or how about Chinese? An additional language is not only a practical and highly useful skill to have; it&#8217;s also a great way to see things from a completely different perspective. I especially like dissecting phrases and old sayings to see what life must have been like for the native speakers.</li>
<li>Dabble in the arts &#8211; Sure, you&#8217;re not going to be the next Picasso, and neither will Virgin Records bang on your door to sign a music contract, but picking up an instrument, or a paintbrush, or even a new dance move is a great way to shake the way you think up a little. And who knows? You might make a new friend along the way.</li>
<li>Spirituality and meditation &#8211; Now don&#8217;t get me wrong, I&#8217;m not about to preach religion here. Spirituality isn&#8217;t necessarily about God; it can also mean getting in touch with your soul. Whether the power that you want to connect to is above or inside you, or even somewhere else, taking the time to explore this side of you can often yield amazing results. It also provides a great platform for you to evaluate yourself and see if you&#8217;re who you want to be.</li>
<li>Voluntary work &#8211; this one is a no-brainer. Unless you chew puppies for breakfast, helping another person (especially someone who cannot help himself) is sure to make you feel better about yourself. And the great thing about voluntary work is that there are hundreds of ways you can do it. There&#8217;s no such thing as too many volunteers. </li>
<li>Do something different. Read a book you&#8217;d never read otherwise, listen to music that&#8217;s completely out of your genres. The idea is to try something different, and to pay attention to the difference.</li>
</ol>
<h4>The Kindling</h4>
<p>This is where most people have trouble. Pushing yourself to do something different may be easy for some people, but the tendency to avoid and reject change is so common, it&#8217;s practically hardwired into our DNA as human beings. </p>
<p>Think about it: you can&#8217;t ignite stone. For inspiration to happen, you have to be open enough to accept change. It&#8217;s much easier said than done, I&#8217;ll admit. Unconsciously we balk at any changes inflicted upon our lives (job transfers, new neighbors, etc). Try this then; every time you try something different, mentally tell yourself that you are going to experience this to the fullest, because you are never going to do this again. Taking part in a play? Then give your very best, and hold nothing back, because chances are that it&#8217;s a one-time thing. You&#8217;ll find that you&#8217;re less likely to hold back, and more likely to open your mind and soul to whatever is waiting for you. And of course, the audience always loves an actor who gives his best.</p>
<h4>The Maintenance</h4>
<p>(Also known as The Occasional Poke.) Once you get the fire going, you&#8217;ve more or less won the battle. But even the best of fires will die if you don&#8217;t tend to them. Take some time every once in a while, like say one in two weeks. Think about yourself. Think about the motivation that you have and how it feeds into everything you do. What can you do to continue this feeling? Let&#8217;s say you get inspired by yoga. Perhaps you&#8217;ll build a stronger network of motivation by talking about your passion with other fans of yoga. You&#8217;ll also learn something new about yoga, which will definitely feed your motivation. Or perhaps you could try teaching yoga to a class. Actions based around what inspires and motivates you are your best options for continuously feeding your inner fire.</p>
<p>Now that you&#8217;ve got a good sense of inspiration and motivation going for you, you&#8217;ll feel like a new person. You&#8217;ll start the day brighter and bushier-tailed, and you&#8217;ll smile and laugh more often. Even during bad days, you&#8217;ll be able to face things with a smile, because you know that every day, there is something good happening in your life, and you&#8217;re becoming a better person for it.</p>
<p>At this point I&#8217;d like to point you to a website that you may already know, <a title="Stepcase Lifehack" href="http://www.lifehack.org/" target="_blank">Stepcase Lifehack</a>. If you aren&#8217;t already a regular visitor to that site, make it a point to read their articles. A large majority of the articles focus on various ways, both big and small, to improve your life. In particular, I find the articles written by Celestine Chua (who has a seven-part article series on <a title="How To Find Out If You Are Living Your Real Purpose Now by Celestine Chua" href="http://celestinechua.com/blog/2008/12/how-to-find-out-if-you-are-living-your-real-purpose-now/" target="_blank">finding your true purpose in life</a> on her blog) to be very motivating when I need to remind myself what I&#8217;m aiming for in life. I highly suggest you give it a read.</p>
<p>What would you like to try to spark your motivation? If you&#8217;ve already got your fire going, what do you do to keep it going? Share it with us in the comments.</p>


<p>Related posts:<ol><li><a href='http://www.ashmenon.com/the-design-mindset-8-principles-you-can-apply-in-your-life/' rel='bookmark' title='The Design Mindset &ndash; 8 Principles You Can Apply in Your Life'>The Design Mindset &ndash; 8 Principles You Can Apply in Your Life</a> <small>When I first entered college, and I was being given an introduction to the different majors available, my first question...</small></li><li><a href='http://www.ashmenon.com/tying-tighter-shoelaces-10-tips-to-increase-productivity-at-home/' rel='bookmark' title='Tying Tighter Shoelaces: 10 Tips to Increase Productivity at Home'>Tying Tighter Shoelaces: 10 Tips to Increase Productivity at Home</a> <small>To a runner, tying tigher shoelaces may help shave off a few milliseconds from his time, which could mean the...</small></li><li><a href='http://www.ashmenon.com/smile/' rel='bookmark' title='Smile'>Smile</a> <small>I was recently reading a very inspiring post by Oscar at Freestyle Mind entitled '27 Traits of Successful People'. What...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ashmenon.com/set-yourself-on-fire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginner PHP Chapter 3 &#8211; Operators</title>
		<link>http://www.ashmenon.com/beginner-php-chapter-3-operator/</link>
		<comments>http://www.ashmenon.com/beginner-php-chapter-3-operator/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 12:08:18 +0000</pubDate>
		<dc:creator>Ash Menon</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.ashmenon.com/?p=171</guid>
		<description><![CDATA[Operators are to PHP what grammar particles are to English. They connect the various important bits you have to become a fully functional code. In this chapter I'm going to guide you through the four types of operators, how they're used, and some pitfalls that you should look out for.


Related posts:<ol><li><a href='http://www.ashmenon.com/beginner-php-chapter-4-conditional-statements/' rel='bookmark' title='Beginner PHP Chapter 4 &#8211; Conditional Statements'>Beginner PHP Chapter 4 &#8211; Conditional Statements</a> <small>In the previous chapters, we've covered variables, functions, and operators. We've also touched slightly on conditional statements. In this chapter,...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-1-the-meet-n-greet/' rel='bookmark' title='Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet'>Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet</a> <small>Imagine this scenario. You're a kick-ass designer, you make gorgeous website mocks in Photoshop, and you already know how to...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-2-functions-and-variables/' rel='bookmark' title='Beginner PHP Chapter 2 &ndash; Functions and Variables'>Beginner PHP Chapter 2 &ndash; Functions and Variables</a> <small>In the previous chapter, you learned what PHP is and what you could be capable of achieving with it. In...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>In the previous chapter, you learned about variables. You learned what a variable was, how to use it, and how to assign a value to it. If you noticed carefully, you&#8217;d have seen that I used the equals symbol (=) when assigning a value to a variable. This symbol, and many others, are called operators. Like other elements in these first few chapters of the tutorials, they are essential to building a PHP script, so learning what operators are and how they work will help you greatly when you start coding.
</p>
<p>
<h4>What are operators?</h4>
</p>
<p>By simple definition, an operator is a symbol that performs some basic function in your script. Examples of these functions are assignment, like the equals sign that I just mentioned earlier, and calculation, like the +, -, *, and / symbols that you used while doing math in school.
</p>
<p>Operators in PHP can be grouped into four groups based on their function. Here is a list of all operators in PHP:
</p>
<p><b>Arithmetic Operators</b>
</p>
<p>Also known as <b>mathematical operators</b>, these guys perform basic mathematical calculations. You&#8217;ll be very familliar with most if not all of them.
</p>
<table class="operator_table" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>Symbol</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>+</td>
<td>Addition</td>
<td>Adds two variables or values together, and returns the new total.</td>
</tr>
<tr>
<td>-</td>
<td>Subtraction</td>
<td>Subtracts a first value or variable from the second, and returns the remainder.</td>
</tr>
<tr>
<td>*</td>
<td>Multiplication</td>
<td>Multiplies the first value or variable by the second, and returns the new amount.</td>
</tr>
<tr>
<td>/</td>
<td>Division</td>
<td>Divides the first value or variable by the second, and returns the new amount.</td>
</tr>
<tr>
<td>%</td>
<td>Modulus</td>
<td>Divides the first value or variable by the second, and returns the undividable remainder.</td>
</tr>
<tr>
<td>++</td>
<td>Increment</td>
<td>Increases a variable&#8217;s value by 1.</td>
</tr>
<tr>
<td>&#8211;</td>
<td>Decrement</td>
<td>Decreases a variable&#8217;s value by 1.</td>
</tr>
</table>
<p>As you can see, you&#8217;ve already seen most of these in basic math. The only ones that tend to trip beginner programmers up are the modulus, increment, and decrement operators. Before I go into explaining those three, allow me to provide some examples of the first four operators.
</p>
<pre class="brush: php;">

&lt;?php

$value = 3 + 5; //$value is now 8.
$value = 7 - 3; //$value is now 4.
$value = 24*4; //$value is...err...carry the 1...96! Yes, $value is now 96.
$value = 6/4; //$value is now 1.5. 

?&gt;
</pre>
<p>As you can see, I&#8217;ve put spaces in between some of the operators, and not put spaces in the others. It doesn&#8217;t matter either way, and it&#8217;s a matter of personal preference. I find that not putting spaces in my operators helps me read them better, but feel free to use whatever works for you.
</p>
<p>Now for the remaining three. The modulus operator (%) is probably the toughest among the three, and even then it&#8217;s a piece of cake. Let&#8217;s say you divide 10 by 3. You&#8217;d end up with 3.33333333. If you were to see that in fractions, it would look something like this: 3 1/3. A modulus operator basically will give you that value of 1 when you use it. Let&#8217;s try that in code with a few examples:
</p>
<pre class="brush: php;">

&lt;?php

$value = 5%2; //$value is now 1.
$value = 10%6; //$value is now 4.
$value = 10%2; //Since 10 can be divided completely by 2 with no remainder, $value is now 0.
$value = 144%11; //$value is now 1.
$value = 0%4; //In this case, $value is, of course, 0.

?&gt;
</pre>
<p>A good example of when modulus would come in handy is when you&#8217;re doing pages for a blog. Using a modulus will tell you if you have just enough posts to fill give you full pages, or if there is some leftover posts that need an extra page.
</p>
<p>Now, we&#8217;ll go to the increment and decrement operators. What they basically do is increase or decrease the value of a variable by 1. This may seem to you as being very specific, and not very helpful to general coding, but you&#8217;ll be surprised at how many functions rely on this tiny change in value.
</p>
<pre class="brush: php;">

&lt;?php

$value = 5;
$value++; //$value is now 6.
++$value; // $value is now 7.
$value = 11;
$value--; //$value is now 10.
--$value; //$value is now 9.
?&gt;
</pre>
<p>The way you use the increment and decrement operators differ slightly from the previous five mathematical operators, and it&#8217;s vital that you understand this. First, you&#8217;ll notice that in the examples above, I didn&#8217;t use an assignment operator. This is because I&#8217;m not assigning a value to a new variable, I&#8217;m just increasing or decreasing the value of the current one. Second, notice how I can use the operators either before or after the variable? This is unique to increment and decrement operators, but here&#8217;s the thing: while they may look similiar from the outset, they actually vary slightly, and can change the value that you get in return. Take a look at these examples:
</p>
<pre class="brush: php;">

&lt;?php

$number = 6;
$value = $number++;

$number = 6;
$value = ++$number;

?&gt;
</pre>
<p>The difference only becomes apparent when you use an assignment operator with it, to assign the new value to a second variable. In the first example, my $number variable has a value of 6. I then assign the value of 6 to the $value variable, and then increase the value of $number by 1, making it 7. So at the end of the these two lines, the value is $value is 7, while the value of $number is 6.
</p>
<p>In the second example, I again start with a variable $number that has a value of 6. Then, in the second line, <b> because the increment operator comes before the $value variable, the increment happens before the assignment</b>. This means that the value of $number is increased by 1, making it 7, <b>and then</b> it is assigned to $value. So at the end of <b>these</b> two lines, the value of $value and $number are both 7.
</p>
<p><b>Assignment Operators</b>
</p>
<p>Assignment operators are, as the name suggests, operators that allow you to assign a value to a variable. Now, you may be thinking, what other way of assigning could there possibly be other than the equals sign (=)? And you&#8217;d be right to think so: there actually isn&#8217;t. However, PHP provides some assignment operators that have some arithmetic operators mixed in, to basically act as shortcuts. Here are the available operators:
</p>
<table class="operator_table" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="46">Symbol</th>
<th width="217">Name</th>
<th width="722">Description</th>
</tr>
<tr>
<td>=</td>
<td>Assign</td>
<td>Assigns a value to a variable</td>
</tr>
<tr>
<td>+=</td>
<td>Add and Assign</td>
<td>Adds a value to a variable&#8217;s existing value, and updates the variable with the new value.</td>
</tr>
<tr>
<td>-=</td>
<td>Subtract and Assign</td>
<td>Subtracts a value from a variable&#8217;s existing value, and updates the variable with the new value.</td>
</tr>
<tr>
<td>*=</td>
<td>Multiply and Assign</td>
<td>Multiplies a variable&#8217;s existing value by a value, and updates the variable with the new value.</td>
</tr>
<tr>
<td>/=</td>
<td>Divide and Assign</td>
<td>Divides a variable&#8217;s existing value by a value, and updates the variable with the new value.</td>
</tr>
<tr>
<td>%=</td>
<td>Modulus and Assign</td>
<td>Divides a variable&#8217;s existing value by a value, and updates the variable with the undividable remainder.</td>
</tr>
<tr>
<td>.=</td>
<td>Concatenate and Assign</td>
<td>Joins a value to a variable&#8217;s existing value, and updates the variable with the new string.</td>
</tr>
</table>
<p>The first one is a no-brainer, so I&#8217;ll skip on ahead and talk about the next five, from Add and Assign to Modulus and Assign. For each one of them, they&#8217;re basically a shortcut for the longer arithmetic operators. Here&#8217;s an example:
</p>
<pre class="brush: php;">

&lt;?php

$value+=6;
$value=$value+6;

?&gt;
</pre>
<p>These two strings mean the same thing, and will give you the same result. A few more examples:
</p>
<pre class="brush: php;">

&lt;?php

$value = 10;
$value-= 2; //$value is now 8.

$value = 11;
$value*= 2; //$value is now 22.

$value = 14;
$value/= 7; //$value is now 2.

$value = 100;
$value%= 40; //$value is now 20.

?&gt;
</pre>
<p>Now for the last one. I know that some of you looking at the table above would have been going &#8220;Concata-what?&#8221;. Before I go into what the Concatenate and Assign operator does, allow me to explain the concatenate operator. To concatenate is to join two or more elements together. For example, if I were to concatenate the string &#8220;Hello&#8221; with the string &#8220;world&#8221;, I&#8217;d get the string &#8220;Helloworld&#8221; in return. Note that unlike the arithmetic operators that you saw previously, the Concatenate operator is meant to be used on strings. If your variables hold intergers and you concatenate them, PHP will convert them to strings first. To better explain the concept, here are some examples:
</p>
<pre class="brush: php;">

&lt;?php

$string = &quot;Hello&quot;.&quot;world&quot;; //$string is now &quot;Helloworld&quot;
$number1 = 6;
$number2 = 14;
$value = $number1.$number2; //$value is now &quot;614&quot;, NOT 20
$value = $number2.$number1; //$value is now &quot;146&quot;, NOT 20
$value = $number1.$string.$number2; //$value is now &quot;6Helloworld14&quot;. Yikes.

?&gt;
</pre>
<p>When using concatenation in your codes, it&#8217;s vital to remember this string-interger difference. If you put interger values into variables and then concatenate those variables, PHP will convert them to strings first, as seen in the example above. However, if you put the values in directly, you&#8217;ll see why PHP doesn&#8217;t concatenate the values:
</p>
<pre class="brush: php;">

&lt;?php

$number1 = 6.14; //$number1 has the value of 6.14
$number += 2; //$number1 is now 8.14

?&gt;
</pre>
<p>If intergers are used, PHP sees the period mark (.) as a decimal point indicator, instead of a concatenation operator, which makes sense. If you want to concatenate two intergers together, either convert them to strings by wrapping them with quote marks, or assigning them to variables and then concatenating those variables.
</p>
<p>Now that you have a strong understanding of what the concatenate operator does, understanding what the Concatenate-and-Assign operator does should be a breeze. Here are some examples to help you anyway:
</p>
<pre class="brush: php;">

&lt;?php

$number = 54;//$number is now 54
$number .= 5;//$number is now '545'
$number.='random';//$number is now '545random'

?&gt;
</pre>
<p>Note that when using the Concatenate-and-Assign operator, the new string automatically comes after the old string. If you want it to come before instead, you&#8217;re going to have to do it the old-fashioned way.
</p>
<pre class="brush: php;">

&lt;?php

$value1 = 30; //$value1 is now 30
$value1 = &quot;Level&quot; . $value1; //$value1 is now &quot;Level30&quot;

?&gt;
</pre>
<p><b>Comparison Operators</b>
</p>
<p>As the name suggests, comparison operators serve to compare two values or variables according to a certain rule, and return either true or false. You will be using these operators a lot in your conditional statements and loops, which I will cover in the next chapter, so it&#8217;s a good idea to get the hang of using these early on. Here are the various types of comparison operators:
</p>
<table class="operator_table" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>Symbol</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>==</td>
<td>Is Equal To</td>
<td>Returns true if the two values are equal, false otherwise.</td>
</tr>
<tr>
<td>!=</td>
<td>Is Not Equal To</td>
<td>Returns true if the two values are not equal, false otherwise.</td>
</tr>
<tr>
<td>&lt;&gt;</td>
<td>Is Not Equal To</td>
<td>Returns true if the two values are not equal, false otherwise.</td>
</tr>
<tr>
<td>&lt;</td>
<td>Is Lesser Than</td>
<td>Returns true if the value on the left is lesser than the value on the right, false otherwise.</td>
</tr>
<tr>
<td>&gt;</td>
<td>Is Greater Than</td>
<td>Returns true if the value on the left is greater than the value on the right, false otherwise.</td>
</tr>
<tr>
<td>&lt;=</td>
<td>Is Lesser Than or Equal To</td>
<td>Returns true if the value on the left is lesser than <strong>or equal to</strong> the value on the right, false otherwise.</td>
</tr>
<tr>
<td>&gt;=</td>
<td>Is Greater Than or Equal To</td>
<td>Returns true if the value on the left is greater than <strong>or equal to</strong> the value on the right, false otherwise.</td>
</tr>
<tr>
<td>===</td>
<td>Is Exactly Equal To</td>
<td>Returns true if the two values are equal <b>and of the same data type</b>, false otherwise.</td>
</tr>
<tr>
<td>!==</td>
<td>Is Not Exactly Equal To</td>
<td>Returns <b>false</b> only if the two values are equal <b>and of the same data type</b>, <b>true</b> otherwise.</td>
</tr>
</table>
<p>First of all, I&#8217;m going to show you a sample conditional statement to show you how to use conditional operators.
</p>
<pre class="brush: php;">

&lt;?php

if(1==2){
	echo &quot;The values are equal!&quot;;
};

?&gt;
</pre>
<p>Don&#8217;t worry too much about the &#8216;if&#8217; keyword and the curly brackets and all that for now. What we&#8217;re going to focus on is the statement between the parantheses (1==2). What we&#8217;re basically telling PHP to do is that if that statement is true, then perform the commands in the curly bracket (in this case, you&#8217;re telling PHP to echo the string &#8220;The values are equal!&#8221;). Now, of course, you know that 1 is not equal to 2, so PHP will not perform the following commands, and will skip until the end of the curly bracket. Now let&#8217;s look at a few other conditions for the Is Equal To operator:
</p>
<pre class="brush: php;">

&lt;?php

(2==3) //false
(20==20) //true
$number1 = 5;
$number2 = 7;
$number3 = 5;
($number1==$number2) //false
($number3==$number1) //true

?&gt;
</pre>
<p>Got the idea? No? Don&#8217;t worry, you&#8217;ll get the hang of it in the next chapter. For now let&#8217;s move on to the other operators.
</p>
<p>The next two (!= and <>) serve the exact same function. I have no idea why there are two of them, but for the most part, you&#8217;ll see the first version (!=) being used much more than the second. This is basically the opposite of the Is Equal To operator that we learned above. Here are some examples:
</p>
<pre class="brush: php;">

&lt;?php

(2!=3) //true
(20!=20) //false
$number1 = 5;
$number2 = 7;
$number3 = 5;
($number1!=$number2) //true
($number3!=$number1) //false

?&gt;
</pre>
<p>The next two are Is Greater Than and Is Lesser Than. I&#8217;m going to cover them at once since if you understand one, you understand the other. Basically when you use the Is Greater Than operator, you are saying &#8220;Value on the left is greater than value on the right&#8221;, and likewise for Is Lesser Than. The important thing to remember here is which side are you looking at, and which side are you comparing it to. To further illustrate it, here are some examples:
</p>
<pre class="brush: php;">

&lt;?php

(20&gt;35) //false
(20&lt;35) //true
(20&gt;10) //true
(20&lt;10) //false
(1&gt;1) //false
(1&lt;1) //false

?&gt;
</pre>
<p>Note that the last two examples return false, because the values are equal. The operators Is Greater Than and Is Lesser Than will return false if the values on both sides are equal. What if we want it to return true if it was equal? That&#8217;s where the next two operators come in. The Is Greater Than Or Equal To and Is Lesser Than Or Equal To operators (wow, that was a mouthful) are similiar to their non-equal counterparts, except that if values on either side are equal, they will return true. To illustrate the difference, I&#8217;ll use the same values again for examples.
</p>
<pre class="brush: php;">

&lt;?php

(20&gt;=35) //false
(20&lt;=35) //true
(20&gt;=10) //true
(20&lt;=10) //false
(1&gt;=1) //true
(1&lt;=1) //true

?&gt;
</pre>
<p>Note that when using these two operators, the equals sign must come after the pointy arrow thingy (yeah, I know, but you get what I meant).
</p>
<p>The last two are considered somewhat of an advanced pair of operators, and most basic PHP operator tutorials I&#8217;ve seen don&#8217;t include them, but nonetheless, they ARE operators, and you should learn about them now to get a solid understanding of them when you use them later on. The Is Exactly Equal To and Is Not Exactly Equal To operators are very similiar to Is Equal To and Is Not Equal To respectively, but have the added element of checking the TYPE of data. To make it clear, here are some examples:
</p>
<pre class="brush: php;">

&lt;?php

$value1 = &quot;4&quot;; //This is a string.
$value2 = 4; //This is an interger.
($value1==$value2) //As you already know, this will return true, because the value is the same.
($value1!==$value2) //This will return false, because even though they are equal, they are not EXACTLY the same. A minor, but crucial difference.

?&gt;
</pre>
<p>In the first comparison, the Is Equal To operator doesn&#8217;t check for datatype, so when one variable holds a string and one holds a value, it will still return true. In the second comparison, however, the Is Exactly Equal To operator checks for datatype, notices the difference, and proceeds to return as false. This difference also applies to their Not Equal counterparts, so the Is Not Exactly Equal To operator will only return false if both values are equal and of the same datatype.
</p>
<p>Still with me? We&#8217;re almost done!
</p>
<p><b>Logical Operators</b>
</p>
<p>Logical operators differ slightly from the other three groups in that they don&#8217;t really work alone, but with a comparison operator. That sounds rather confusing, but will become clear once I bury you in more examples. But before I do that, let&#8217;s take a look at the available logical operators:
</p>
<table class="operator_table" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>Symbol</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>&amp;&amp;</td>
<td>AND</td>
<td>Returns true if statements on both sides are true</td>
</tr>
<tr>
<td>||</td>
<td>OR</td>
<td>Returns true if either statement is true</td>
</tr>
<tr>
<td>!</td>
<td>NOT</td>
<td>Returns true if statement is false</td>
</tr>
</table>
<p>(Note: In case it&#8217;s not terribly clear, the symbol for the OR operator is actually Shift + the &#8216;\&#8217; key.)
</p>
<p>The basic idea behind logical operators is simple: what if you want to modify a scenario based on different logical outcomes? Logical operators let you work with the various &#8216;true&#8217; and &#8216;false&#8217; statements that comparison operators will return, which allows you to tailor your code to exactly how you want to use it.
</p>
<p>Let&#8217;s start with the AND operator (&amp;&amp;). Let&#8217;s say you want to check the weight of a bag. If it&#8217;s below 4kg, it&#8217;s too light, but if it&#8217;s over 8kg, it&#8217;s too heavy. So basically, an acceptable weight is above or equal to 4kg <b>AND</b> below or equal to 8kg. If you were doing comparison operators, you already know how to check for either one of these conditions. But that would mean you only define one end of the range (either the minimum or the maximum), while ignoring the other. For example:
</p>
<pre class="brush: php;">

&lt;?php

//Define a minimum.
if($weight&gt;=4){
	$status = &quot;okay&quot;;
};

?&gt;
</pre>
<p>Any bag that weighs less than 4kg would be filtered out as not okay, which is what we want. However, even a 16kg bag would get passed as okay if we just used this. Not good, then. This is where the logical operator AND comes into play. Here&#8217;s how we do it:
</p>
<pre class="brush: php;">

&lt;?php

//Define a minimum AND a maximum.
if($weight&gt;=4 &amp;&amp; $weight&lt;=8){
	$status = &quot;okay&quot;;
};

?&gt;
</pre>
<p>By using the AND operator (&amp;&amp;), I am telling PHP that the status is okay only if the statement on the left ($weight&gt;=4) and the statement on the right ($weight&lt;=8) <b>BOTH</b> return as true. If either one comes back as false, the condition fails, and PHP doesn&#8217;t run the command ($status=&#8221;okay&#8221;). You can stack as many AND operators as you like. Here&#8217;s an example:
</p>
<pre class="brush: php;">

&lt;?php

if($bed==&quot;made&quot; &amp;&amp; $clothes==&quot;folded&quot; &amp;&amp; $homework==&quot;done&quot; &amp;&amp; $dog==&quot;fed&quot; &amp;&amp; $plates==&quot;washed&quot; &amp;&amp; $car==&quot;polished&quot; &amp;&amp; $fish_tank==&quot;cleaned&quot;){
	$cookie_limit_for_today+=1;
};

?&gt;
</pre>
<p>I know. I&#8217;m such a cruel parent.
</p>
<p>Once you understand the AND operator, the OR operator becomes much simpler to learn. The difference is that instead of requiring BOTH statements to come true, the OR operator will return true if EITHER statement is true. Let&#8217;s say you&#8217;re shopping for shoes. Fun! You&#8217;re looking for either tan coloured shoes, or dark brown shoes. You already have all the other colours. Here&#8217;s how we&#8217;d write it:
</p>
<pre class="brush: php;">

&lt;?php

if($shoe_color==&quot;tan&quot; || $shoe_color==&quot;dark brown&quot;){
	$buy_shoes=&quot;yes&quot;;
};

?&gt;
</pre>
<p>So basically if the salesperson shows you black, white, or funky orange shoes, you&#8217;re not going to buy it. Like the AND operator, you can extend it to as many as you want. I&#8217;m not going to give you examples of that, instead I&#8217;m going to move on to the NOT operator.
</p>
<p>If the exclamation mark looks familliar, it&#8217;s because you&#8217;ve already used it. The Is Not Equal To and Is Not Exactly Equal To operators use the exclamation mark as the &#8216;not&#8217; in their statement. Basically this operator flips the logic of whatever statement follows it. If that statement returns true, the NOT will return false, and vice versa. Let&#8217;s bring that shoe-buying example again. If the salesperson asks you if you&#8217;d like a bag for your shoes, chances are that you&#8217;ll say yes. But if you&#8217;re rather eco-friendly, you may think that you can just use whatever bag you have with you right now (from some other purchase), or may have even brought your own bag. So basically, if you have a bag, you&#8217;ll tell her no, but if you don&#8217;t have a bag, you tell her yes. This is how we&#8217;d write it:
</p>
<pre class="brush: php;">

&lt;?php

if(!($have_bag==&quot;yes&quot;)){
	$take_bag=&quot;yes&quot;;
};

?&gt;
</pre>
<p>Pay careful attention to the existence of that exclamation mark, now. Otherwise you&#8217;d be taking the bag if you already have a bag. Not very eco-friendly of you, is it?
</p>
<p>Now you may be thinking, I can just use the Is Not Equal To operator here, like so:
</p>
<pre class="brush: php;">

&lt;?php

if($have_bag!=&quot;yes&quot;){
	$take_bag=&quot;yes&quot;;
};

?&gt;
</pre>
<p>And I&#8217;d be so proud of you, because yes, that&#8217;s exactly what you can do. In a conditional statement where we&#8217;re only checking one condition like the example above, the NOT operator doesn&#8217;t really become useful. But you can combine the AND, OR, and NOT operators to create as precise a combination of conditions as you&#8217;d like, and THAT&#8217;s where the NOT operator really shines. I&#8217;ll expand on the previous example, and create a few more conditions:
</p>
<p>1) If you have a bag AND my bag has space, don&#8217;t take the bag. Or, if you have a spare hand and can carry the shoebox without a bag, don&#8217;t take the bag.
</p>
<pre class="brush: php;">

&lt;?php

if(($have_bag==&quot;yes&quot; &amp;&amp; $bag_has_space==&quot;yes&quot;) || $can_carry_box==&quot;yes&quot;){
	$take_bag=&quot;no&quot;;
};

?&gt;
</pre>
<p>2) If you don&#8217;t have a bag, take the bag. OR, if you have a bag but(AND) the store&#8217;s bag is pretty, take the bag. OR, if you have a bag but(AND) there is not enough space, take the bag.
</p>
<pre class="brush: php;">

&lt;?php

if(($have_bag!=&quot;yes&quot;) || ($have_bag==&quot;yes&quot; &amp;&amp; $store_bag==&quot;pretty&quot;) || ($have_bag==&quot;yes&quot; &amp;&amp; $bag_has_space!=&quot;yes&quot;)){
	$take_bag=&quot;yes&quot;;
};

?&gt;
</pre>
<p>3) If neither is the store&#8217;s bag pretty nor is the box very heavy, don&#8217;t take the bag.
</p>
<pre class="brush: php;">

&lt;?php

if(!($store_bag==&quot;pretty&quot; || $box_weight==&quot;heavy&quot;)){
	$take_bag=&quot;no&quot;;
};

?&gt;
</pre>
<p>I can go on and on, but it&#8217;s pointless if you get lost in the process. I suggest you go and start experimenting with some simple conditions, and build up the complexity each time you try it, until you&#8217;re capable of wielding superbly complex conditions to filter your code&#8217;s purposes. It also makes for some excellent shoe-shopping.</p>
<p>Finally! We&#8217;re done with operators. I know it may seem like a lot, but really, you don&#8217;t have to memorize everything right now. You can always refer back here as and when you need to use them, and eventually you&#8217;ll know them like the back of your own hand. In the next chapter I will be covering conditional statements more thoroughly, and I will also be introducing you to loops. Until then, happy coding, and if there are any questions or comments, please let me know in the comments below!</p>


<p>Related posts:<ol><li><a href='http://www.ashmenon.com/beginner-php-chapter-4-conditional-statements/' rel='bookmark' title='Beginner PHP Chapter 4 &#8211; Conditional Statements'>Beginner PHP Chapter 4 &#8211; Conditional Statements</a> <small>In the previous chapters, we've covered variables, functions, and operators. We've also touched slightly on conditional statements. In this chapter,...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-1-the-meet-n-greet/' rel='bookmark' title='Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet'>Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet</a> <small>Imagine this scenario. You're a kick-ass designer, you make gorgeous website mocks in Photoshop, and you already know how to...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-2-functions-and-variables/' rel='bookmark' title='Beginner PHP Chapter 2 &ndash; Functions and Variables'>Beginner PHP Chapter 2 &ndash; Functions and Variables</a> <small>In the previous chapter, you learned what PHP is and what you could be capable of achieving with it. In...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ashmenon.com/beginner-php-chapter-3-operator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginner PHP Chapter 2 &#8211; Functions and Variables</title>
		<link>http://www.ashmenon.com/beginner-php-chapter-2-functions-and-variables/</link>
		<comments>http://www.ashmenon.com/beginner-php-chapter-2-functions-and-variables/#comments</comments>
		<pubDate>Sun, 23 May 2010 07:50:29 +0000</pubDate>
		<dc:creator>Ash Menon</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.ashmenon.com/?p=82</guid>
		<description><![CDATA[In the previous chapter, you learned what PHP is and what you could be capable of achieving with it. In this chapter, I'm going to introduce you to two of PHP's essential building blocks: functions and variables.


Related posts:<ol><li><a href='http://www.ashmenon.com/beginner-php-chapter-3-operator/' rel='bookmark' title='Beginner PHP Chapter 3 &#8211; Operators'>Beginner PHP Chapter 3 &#8211; Operators</a> <small>Operators are to PHP what grammar particles are to English. They connect the various important bits you have to become...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-1-the-meet-n-greet/' rel='bookmark' title='Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet'>Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet</a> <small>Imagine this scenario. You're a kick-ass designer, you make gorgeous website mocks in Photoshop, and you already know how to...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-4-conditional-statements/' rel='bookmark' title='Beginner PHP Chapter 4 &#8211; Conditional Statements'>Beginner PHP Chapter 4 &#8211; Conditional Statements</a> <small>In the previous chapters, we've covered variables, functions, and operators. We've also touched slightly on conditional statements. In this chapter,...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>In the previous chapter you learned what PHP was, had a passing brush with its history, and had a peek at just what it was capable of. In this chapter I&#8217;m going to teach you two basic elements of coding in PHP: functions and variables.</p>
<h3>Variables</h3>
<h4>What is a variable?</h4>
<p>The easiest way to define a variable is take a look in your storage closet or  attic (stick with me here, I haven&#8217;t <em>quite</em> lost my marbles). Chances are you&#8217;ll find boxes of things, and some of them will have labels. They&#8217;ll probably contain things like last year&#8217;s Christmas decorations, or the clothes that don&#8217;t fit anymore (in a fit of self-denial, I labeled <em>that</em> box as &#8216;The Damn Machine Shrunk My Clothes&#8217;), or old books, or heck, the box could be even be empty.</p>
<p>A variable is much like one of those boxes. The only difference is that there is no size limit. Each variable has a <strong>variable name</strong> (like the label on the box) and may have something stored in it, which in PHP is known as the variable&#8217;s <strong>value</strong>. And like your boxes, a variable can store anything from strings of text (for example, your house address) to numbers (for example, the amount of tax you owe the IRS. Yikes.).</p>
<h4></h4>
<h4>So why use variables?</h4>
<p>Let&#8217;s say you have a 6 beach balls, 2 old bathing suits, and an old summer hat that makes you wonder what you were thinking. If you were to rearrange your storage closet, you&#8217;d have to move each individual item. How about if you were going to bring it out into the living room? Or sent it to a local charity? Yup, you&#8217;d have to move each thing one by one. </p>
<p>However, if you were to put it in a box (let&#8217;s call it the &#8217;summer&#8217; box) , you&#8217;d only have to move one item: the box. Instantly you&#8217;ve cut down the amount of tedious effort required by only doing one task instead of nine. Variables are much the same. Instead of typing the same values again and again and again, you just assign it to a variable, and then use that variable in your code. Also, if that number happens to change, you only have to change it at one point in your code.</p>
<p>Another good reason to use variables is a no-brainer: they&#8217;re <em>variable</em> (get it? No? Dang.). The value that they represent can change, and you may not always know what that value is. Say you&#8217;re making an online survey. You won&#8217;t know what your user&#8217;s answer is, so it&#8217;s impossible to write a code that records that answer. Instead, you tell PHP to assign the user&#8217;s answer to a variable (perhaps we&#8217;ll call it <em>$answer</em>) and then you use this variable name in your code.</p>
<h4>How do I write a variable?</h4>
<p>If you liked math or algebra in school, this&#8217;ll be a breeze.</p>
<pre class="brush: php;">

  &lt;?php $variablename = 'value'; ?&gt;
</pre>
<p>Seriously, it&#8217;s that simple. Here&#8217;s a breakdown of the process.</p>
<ol>
<li>Write the dollar sign ($). The dollar sign is required for all variable names in PHP. </li>
<li>Write your variable&#8217;s name. As with all other aspects of PHP coding (and with all other languages, really), name it something relevant to its value. &#8216;$something&#8217; can mean anything, but &#8216;$amount_due&#8217; would be much clearer. This will help you out a lot when you&#8217;re juggling 20-30 different variables and you can&#8217;t remember what each one holds. </li>
<li>Use the assignment operator, which is really just a fancy programmer way of referring to the equals sign (=). </li>
<li>Write in your value. If your value is a string, you&#8217;ll want to enclose it with either single quote marks (&#8221;) or double quote marks (&#8221;"). If your value is an integer, then go right ahead and write it in without any quote marks. </li>
<li>End your value with a semi-colon (;). The semi-colon is used to end the line that you&#8217;re writing, so in this case it means you&#8217;re done telling PHP what this variable holds. This is a necessary step and can often trip you up, as it&#8217;s tiny and can be rather hard to spot. </li>
</ol>
<h4>What should I watch out for when writing a variable?</h4>
<ol>
<li>Always remember the dollar sign. </li>
<li>Variable names can only <strong>start</strong> with letters or an underscore (_). </li>
<li>Variable names can only <strong>contain</strong> letters, numbers, and underscores. No special characters or spaces allowed. </li>
<li>When you&#8217;re assigning a value to a variable, you have to use the assignment operator (=). </li>
<li>Use names that are relevant. PHP won&#8217;t stop you from naming your variables after your pets or celebrities, but if you&#8217;re sharing your code with someone, or if you revisit this code later on, it may be a bit tricky figuring out what values you assigned to $foofy_the_chihuahua or $gloriaEstefan. </li>
<li><strong>Variable names are case-sensitive. </strong>I cannot stress this enough. &#8216;$number&#8217; and &#8216;$Number&#8217; are two different variables, and PHP will treat them as such. </li>
<li>Some programmers prefer to use a combination of uppercase and lowercase letters (e.g.: $variableName) instead of underscores (e.g.: $variable_name). You may even find some variables in all lowercase (e.g.: $variablename). It&#8217;s a personal preference and either one is fine to use, but it&#8217;s a good idea to maintain a consistent pattern throughout your codes. For sake of clarity, however, I suggest you avoid the third option. Compare $birdsHit, $birds_hit, and $birdshit, and you&#8217;ll understand why. </li>
</ol>
<h4>How do I use a variable?</h4>
<p>To use a variable, all you have to do is call it by the name you gave it. For example:</p>
<pre class="brush: php;">
&lt;?php
  $number = 6;
  $myname = 'Ash';

  echo($number);
  //This will display the number 6. 

  echo($myname);
  //This will display the string 'Ash'.
?&gt;
</pre>
<p>If you feel like you don&#8217;t like the number 6 (or if, for some bizarre reason, your name isn&#8217;t Ash), all you have to do is to change the values in the first two lines, where we assigned the values. The next time you run the script, the number you prefer and your name will be displayed instead. But seriously, you mean everyone isn&#8217;t named Ash?</p>
<h4>Examples of variables</h4>
<pre class="brush: php;">
&lt;?php

$name = &quot;Ash&quot;;

$age = 20; //Yeah, right.

$_hobbies = array('design', 'art', 'music', 'dance');
//Don't be alarmed by this strange new 'array' word. I'll be covering it coming chapters.

$favourite_quote = &quot;Everything's okay in the end. If it's not okay, it's not the end.&quot;;

$what_I_suspected_my_fourth_grade_teacher_was = &quot;A penguin who learnt to speak English.&quot;;

?&gt;
</pre>
<p>Have fun experimenting with variables and what you can do with them, it&#8217;s a great way to practice writing them. </p>
<h3>Functions</h3>
<h4>What is a function?</h4>
<p>Imagine telling Person A to do something, such as sweeping the floor. In order for this to happen, two conditions must be fulfilled:</p>
<ol>
<li>Person A must actually know what &#8217;sweep the floor&#8217; means, and </li>
<li>You must tell Person A to sweep the floor. </li>
</ol>
<p>No seriously, I actually know people who don&#8217;t know what sweeping the floor means. Using functions in PHP is pretty much the same thing, only we don&#8217;t assume that Person A knows what &#8217;sweep the floor&#8217; means, so we explain it for them. In PHP (and in many other programming languages), this is called <strong>defining or declaring a function</strong>. </p>
<p>Once we&#8217;ve explained to Person A about this magical art of sweeping, we must then make sure we actually TELL Person A to sweep the floor. After all, PHP assumes nothing, so just because you declare a function doesn&#8217;t mean you&#8217;re actually going to use it. In PHP, using a function that you declared is known as <strong>calling a function</strong>.</p>
<p>Functions are one of the building blocks of almost every PHP script you will find, so a solid understanding of the idea behind it will really help you later on.</p>
<h4>How do I declare a function?</h4>
<p>The basic syntax for defining a function is extremely simple:</p>
<pre class="brush: php;">
&lt;?php
  function functionname(){ 

  //The code goes here.
  };

?&gt;
</pre>
<ol>
<li>First, write the word &#8216;function&#8217;, which tells PHP that you&#8217;re declaring a new function. </li>
<li>Then, add a space, and type in the name of the function. It can be anything you want, with some exceptions (which I&#8217;ll be covering later on in this chapter). You&#8217;ll be using this name to call the function later on, so it&#8217;s a good idea to name it something relevant to the function&#8217;s purpose. </li>
<li>Insert a closed pair of parentheses &#8216;()&#8217; after the function name. The space between those parentheses is used for <strong>parameters</strong>, which I&#8217;ll be covering further on in this chapter. </li>
<li>Add a left curly bracket &#8216;{&#8217;. </li>
<li>Type in the code that tells PHP what to do when this function is called. In can be as many lines as you want, and can tell PHP to do anything. </li>
<li>Add a right curly bracket to close &#8216;}&#8217;. </li>
<li>As a best practice, add a semi-colon &#8216;;&#8217; after step 6. It&#8217;s not necessary here, since the closing curly bracket already defines where the function&#8217;s codes stop, but it&#8217;s necessary for some other codes, and it&#8217;s a good habit to establish.</li>
</ol>
<h4>What should I watch out for when declaring a function?</h4>
<p>The rules for declaring a variable can pretty much be applied here too. Of course, instead of using the dollar sign, functions use the &#8216;function&#8217; keyword. Like variables, you can only start with letters or an underscore, and can only contain letters, underscores, and numbers. Function names are also case-sensitive. Like variables, it&#8217;s a good idea to name your functions something relevant (in this case, relevant to what task they perform). And I think you already know the last bit about uppercase and lowercase naming, so I&#8217;ll avoid making any more lame birdshit jokes.</p>
<h4>How do I call a function?</h4>
<p>You call a function by calling it&#8217;s name, and then a closed pair of parentheses, like so:</p>
<pre class="brush: php;">
&lt;?php
  functionname();
?&gt;
</pre>
<p>Remember, you don&#8217;t have to write the word &#8216;function&#8217; any more, since you&#8217;re not declaring it.</p>
<h4>What are parameters?</h4>
<p>To explain what parameters are, I&#8217;m going to give you an example. Let&#8217;s say you&#8217;re in charge of a class of second-graders. There are forty of them. And for each one student, you have to write the following line:</p>
<blockquote>
<p>&#8220;Ash is a boy.&#8221;</p>
</blockquote>
<p>Of course, you&#8217;d have to substitute &#8216;Ash&#8217; for the name of the student, and if the student was a girl, you&#8217;d have to change that bit, too. If you didn&#8217;t know about functions, you&#8217;d have to do it this way:</p>
<pre class="brush: php;">
&lt;?php

echo('Ash is a boy.');
echo('Katie is a girl.');
echo('Jimmy is a boy.'); 

?&gt;
</pre>
<p>And so on, and so on, which would be extremely time-consuming. Now that you know how to use functions, however, you could just do it like this:</p>
<pre class="brush: php;">

&lt;?php
function isBoy(){
	echo ' is a boy';
};
function isGirl(){
	echo ' is a girl.';
}; 

echo 'Ash';
isBoy();
echo 'Katie';
isGirl();

?&gt;
</pre>
<p>Which helps <em>ever so slightly</em>, but now you have to write two eighty lines instead of fourty. Not very helpful, then. </p>
<p>This is where parameters come in handy. Parameters are basically variables that you pass to a function, to give it some information. You use parameters like so:</p>
<pre class="brush: php;">
&lt;?php
function functionname($parameter1, $parameter2){
	//Your code goes here.
};
?&gt;
</pre>
<p>You can have as many parameters as you like. For the next part of the example, we&#8217;re going to use two.</p>
<pre class="brush: php;">
&lt;?php
function introduce_student($name, $gender){
echo ($name . ' is a ' . $gender . '.'); 

};
?&gt;
</pre>
<p>When we put $name and $gender within the parentheses, PHP treats them as variables while it&#8217;s performing the function. This means that you can use them as if they were regular variables like the ones you just learnt earlier. In this case what I&#8217;ve done is created a function called <em>introduce_student</em>, which takes two parameters, a name, and a gender. When called, the function displays the following: the name that I provided, followed by the phrase &#8216; is a &#8216;, and then the gender that I provided, and finally a period. The other periods that you see scattered among the line are used to join two values together. In this case, we join a variable with a string, and then another variable, and finally another string (the actual period). Also do note that I&#8217;ve put spaces <em>inside</em> the string. Otherwise, your sentences would come out looking like &#8216;Ashisaboy.&#8217;. </p>
<p>So how do you use this newfound power of yours? Like so:</p>
<pre class="brush: php;">
&lt;?php
	introduce_student('Ash', 'boy');
	introduce_student('Katie', 'girl');
?&gt;
</pre>
<p>You insert two string values (the name, and the gender) when calling the function. PHP will then proceed to use those two string values as $name and $gender within the function, and will proceed accordingly. You can also use variables as parameters, like so:</p>
<pre class="brush: php;">
&lt;?php
$name1 = 'Ash';
$gender1 = 'boy';
introduce_student($name1, $gender1);
?&gt;
</pre>
<p>Now you&#8217;re back to forty lines, and only one function. You can shorten it even further, in fact, by giving the function a shorter name than &#8216;introduce_student&#8217;. </p>
<p>There&#8217;s one more aspect to parameters that you should learn, and I&#8217;ll make things interesting. Let&#8217;s say that Ash and Jimmy are the only two boys in the class. If you&#8217;ve been keeping track, that means there are 38 girls in the class. A happy story indeed. But that means you&#8217;ll have to write the word &#8216;girl&#8217; 38 times when writing your function. </p>
<p>This is where parameters have a hidden trick up their sleeve. You can specify a default value for a parameter when declaring the function, by doing so:</p>
<pre class="brush: php;">
&lt;?php
function introduce_student($name, $gender = 'girl'){
echo ($name . ' is a ' . $gender . '.');
};
?&gt;
</pre>
<p>Basically you&#8217;re telling PHP to assume that the value of $gender is &#8216;girl&#8217; unless stated otherwise. So for Katie and the rest of the girls, all you&#8217;d have to write is this:</p>
<pre class="brush: php;">
&lt;?php
introduce_student('Katie');
?&gt;
</pre>
<p>And for Ash and Jimmy, you&#8217;d write it this way:</p>
<pre class="brush: php;">
&lt;?php
introduce_student('Ash', 'boy');
introduce_student('Jimmy', 'boy');
?&gt;
</pre>
<p>Parameters that have default values are called <strong>optional parameters</strong>, while parameters that don&#8217;t are called <strong>required parameters</strong>. The names are self-explanatory: you are required to put a value or a variable for each of the required parameters when calling a function, but you have the option of not doing so for the optional parameters.</p>
<p>There are two important rules when using parameters. Firstly, when declaring a function, <strong>all the required parameters must come before all the optional parameters</strong>. If you think about it, it makes sense. Let&#8217;s take for example this function:</p>
<pre class="brush: php;">
&lt;?php
function describe_cat($name, $body_color, $paw_color = 'white', $tail_color){
	//Do some code that describes the cat.
};
?&gt;
</pre>
<p>If you look at it, you&#8217;ll see that the function has three required parameters, and one optional one. So by logic, you could call the function like this:</p>
<pre class="brush: php;">
&lt;?php
describe_cat('Purrzilla', 'brown', 'black');
?&gt;
</pre>
<p>But how would PHP know which part of the cat is colored brown, or black? When calling functions, you must supply the parameters in the order that you declared them. So in this case, PHP assumes that you&#8217;ve supplied values for $name, $body_color, and $paw_color. It then sees that there is no value for $tail_color, and will show an error.</p>
<p>PHP helps prevent this mess from happening somewhat by requiring that when you declare a function, all required parameters must come first. So if you do this:</p>
<pre class="brush: php;">
&lt;?php
function describe_cat($name, $body_color, $tail_color, $paw_color = 'white'){
	//Do some code that describes the cat.
};

describe_cat('Purrzilla', 'brown', 'black');

?&gt;
</pre>
<p>PHP will accept the three values for the three required parameters, and will take the default value &#8216;white&#8217; for the fourth parameter, $paw_color. It will then describe a cat that named Purrzilla that has a brown body, black tail, and white paws. How&#8217;s that for funky?</p>
<p>The second rule is basically an extension of the first one. Let&#8217;s say I change the previous function:</p>
<pre class="brush: php;">
&lt;?php
function describe_cat($name, $body_color = 'brown', $tail_color = 'black', $paw_color = 'white'){
	//Do some code that describes the cat.
};
?&gt;
</pre>
<p>If you had this function, all you&#8217;d have to do is to call the function with the cat&#8217;s name, and you&#8217;d be good to do. But what if the cat&#8217;s paws are pink? Look at the next bit of code:</p>
<pre class="brush: php;">
&lt;?php
  describe_cat('Purrzilla', 'pink');
?&gt;
</pre>
<p>Would that work? Nope, you guessed it. PHP would assume that &#8216;pink&#8217; is the value for $body_color, and would give you a pink-bodied cat. Ew. It&#8217;s not possible for you to skip one or more optional variables to specify another one further down the road. If you want to specify the value for $paw_color, you&#8217;ll have to specify the values for $body_color and $tail_color as well. You only have to specify values for the ones before the one that you want, so for example if you wanted to specify a value for $tail_color, you&#8217;d only have to specify a value for $body_color as well. Keep this in mind when writing your functions, as it will save you a lot of headache.</p>
<h4>Coming Soon</h4>
<p>I hope you&#8217;ve benefited from this tutorial, even if it&#8217;s in some small way. In the next chapter, I&#8217;ll be covering two more essential PHP building blocks: arrays, and classes. Meanwhile, if you have any questions about this tutorial, or any suggestions on how I can improve my tutorials in general, do let me know in the comments, and I&#8217;ll be extremely grateful!</p>


<p>Related posts:<ol><li><a href='http://www.ashmenon.com/beginner-php-chapter-3-operator/' rel='bookmark' title='Beginner PHP Chapter 3 &#8211; Operators'>Beginner PHP Chapter 3 &#8211; Operators</a> <small>Operators are to PHP what grammar particles are to English. They connect the various important bits you have to become...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-1-the-meet-n-greet/' rel='bookmark' title='Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet'>Beginner PHP Chapter 1 &ndash; The Meet n&rsquo; Greet</a> <small>Imagine this scenario. You're a kick-ass designer, you make gorgeous website mocks in Photoshop, and you already know how to...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-4-conditional-statements/' rel='bookmark' title='Beginner PHP Chapter 4 &#8211; Conditional Statements'>Beginner PHP Chapter 4 &#8211; Conditional Statements</a> <small>In the previous chapters, we've covered variables, functions, and operators. We've also touched slightly on conditional statements. In this chapter,...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ashmenon.com/beginner-php-chapter-2-functions-and-variables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginner PHP Chapter 1 &#8211; The Meet n&#8217; Greet</title>
		<link>http://www.ashmenon.com/beginner-php-chapter-1-the-meet-n-greet/</link>
		<comments>http://www.ashmenon.com/beginner-php-chapter-1-the-meet-n-greet/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 14:50:57 +0000</pubDate>
		<dc:creator>Ash Menon</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.ashmenon.com/beginner-php-chapter-1-the-meet-n-greet/</guid>
		<description><![CDATA[Imagine this scenario. You're a kick-ass designer, you make gorgeous website mocks in Photoshop, and you already know how to turn them into basic HTML websites. But you want to learn how to take your skills to the next level, by adding server-side functionality. Here's one programming language that's about to rock your world.


Related posts:<ol><li><a href='http://www.ashmenon.com/beginner-php-chapter-3-operator/' rel='bookmark' title='Beginner PHP Chapter 3 &#8211; Operators'>Beginner PHP Chapter 3 &#8211; Operators</a> <small>Operators are to PHP what grammar particles are to English. They connect the various important bits you have to become...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-4-conditional-statements/' rel='bookmark' title='Beginner PHP Chapter 4 &#8211; Conditional Statements'>Beginner PHP Chapter 4 &#8211; Conditional Statements</a> <small>In the previous chapters, we've covered variables, functions, and operators. We've also touched slightly on conditional statements. In this chapter,...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-2-functions-and-variables/' rel='bookmark' title='Beginner PHP Chapter 2 &ndash; Functions and Variables'>Beginner PHP Chapter 2 &ndash; Functions and Variables</a> <small>In the previous chapter, you learned what PHP is and what you could be capable of achieving with it. In...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Imagine this scenario.</p>
<p>You&#8217;re a kick-ass designer, you make gorgeous website mocks in Photoshop, and you already know how to turn them into basic HTML websites. The world thinks you&#8217;re awesome. Your clients think you&#8217;re awesome. You think you&#8217;re awesome. And now you want to step up to another level, by learning how to program a website to give it extra functionality. Perhaps you&#8217;d like to know how to make login systems. Or you&#8217;re looking to make your clients&#8217; websites more secure. Regardless of what your reason may be, having a web-programming skill is a valuable addition to your arsenal of skills.</p>
<p>So what programming code do you choose?</p>
<p>Even among the popular ones, there are several to choose from. You could go for Javascript, which is so closely entwined with HTML that you&#8217;ve probably already used it once or twice. You could try C#. There&#8217;s also Python and Ruby, which have their own legions of faithful worshippers.You could even abandon your HTML altogether and become a Flash-Actionscript programmer.</p>
<p>However, there is one language that I haven&#8217;t mentioned, one that if you start with and if you&#8217;re anything like me, you&#8217;ll soon learn to love.</p>
<p>PHP.</p>
<h4>Introduction</h4>
<p>PHP is a server-side scripting language that was created in 1995 by a programmer named Rasmus Lerdorf. Back then PHP stood for <em>Personal Home Page</em> (You were expecting some long, tech-sounding name too, weren&#8217;t you?).&#160; It then went through development and improvement in the hands of a few other developers, and in the process acquired its recursive name, <em>PHP: Hypertext Preprocessor</em> (a detailed account of the history of PHP is available <a href="http://en.wikipedia.org/wiki/PHP" target="_blank">here</a>).&#160; It is completely free, and comes with most web hosting packages by default. Currently the latest stable release is PHP5 (specifically, 5.3.2, released on March 4th). PHP6 is also in the making, although there is no release date set for that yet.</p>
<h4></h4>
<h4>Why PHP?</h4>
<dl>
<dt><strong>Easy       <br /></strong>PHP is a command-line language, which means exactly what it says: all your commands are listed line by line. Think of them as recipes, and you&#8217;ll pick it up in no time. To make your life even easier, there are TONS of resources online for PHP coding. Whether you&#8217;re having trouble with basic concepts and terminology, or whether you want to know what this particular function does, or even if you want to accomplish some function of your own, there are thousands of PHP-savvy developers out there who share their knowledge and progress with everyone.
<p>Also, PHP&#8217;s native error displaying system is extremely useful for helping you debug your codes. You can play with the various settings available to find a setting that suits you. Personally I don&#8217;t mind errors popping up here and there, as it draws my attention immediately to a problem I have in my code. </p>
</dt>
<dt><strong>Powerful        <br /></strong>You already know that PHP is a server-side language, and that it&#8217;s command line, so you know that you have a powerful yet easy-to-use and flexible programming language in your hands. How about I take it one step further and show you PHP&#8217;s power over databases? The details of it are extensive enough to warrant their own chapter in these tutorials, so we&#8217;ll skip it for now, but with this power you can control information and display it in any way you could possibly imagine. Millions of websites around the world make extensive use of databases and backend systems, so you&#8217;ll be gaining an invaluable skill.
<p>Two more facets of PHP&#8217;s functions that I should mention here are PHP&#8217;s mail() function, and PHP&#8217;s file uploading capabilities. Both of these are considered simple enough for beginners to use, and help to give your site massive functionality. Using these codes, you can allow your viewers to upload files, send mails to you or anyone else they choose, or even to get an email whenever someone visits a particular page. However, before you dive into learning how to do those, you should be aware that just popping the codes into your web page is highly insecure, and opens you up for all sorts of spam and viruses. Security aspects of coding, especially related to these two issues, will be covered in another chapter. </p>
</dt>
<dt><strong>No software requirement       <br /></strong>PHP doesn&#8217;t require any special software to run. You can use anything from Adobe Dreamweaver to Notepad to any text editor that you use. If it can view and edit HTML (and it probably can), then it can view and edit PHP. However, some programs like Microsoft Word will automatically format your quote marks, which is good for writing normal English, but bad for programming. Either turn the autocorrect feature off, or use a regular text editor for your programming.</dt>
<dt>&#160;</dt>
<dt><strong>No special requirement       <br /></strong>A large majority of web hosting packages will come with PHP software bundled in by default. If it doesn&#8217;t, it&#8217;s probably available as an add-on to your hosting package for a small fee.
<p>If you feel uncomfortable about using hosting packages and paying extra fees before you know more about PHP, you can always set up a mock server on your computer, using software such as XAMPP or WAMP (several other options exist, so do a little snooping around if you&#8217;re curious. If you already know of an excellent one that you think deserves more attention, let me know in the comments!). These mock servers (also known sometimes as localhosts or localhost servers) create a simulated server right on your computer, allowing you to use the code as if it was a server. Almost all the code that you use for live servers can be used for localhost, which makes it an ideal place to train yourself, or to test your codes without waiting for pages to load. </p>
</dt>
</dl>
<h4>How does PHP work?</h4>
<p><a href="http://www.ashmenon.com/wordpress/wp-content/uploads/diagram_PHP_works.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Print" border="0" alt="Print" src="http://www.ashmenon.com/wordpress/wp-content/uploads/diagram_PHP_works_thumb.jpg" width="400" height="415" /></a> </p>
</p>
<p>An easy way to understand the concept of PHP (or any server-side script) is to think of a layer before your HTML. Something like a preceding filter or brain before your HTML. </p>
<p>Let&#8217;s run through an example. Here&#8217;s an extremely simple code, designed to show the words &#8220;Hello World!&#8221; on your browser screen:</p>
<p><pre class="brush: php;">
&lt;?php echo ('Hello World!'); ?&gt;
</pre>
</p>
<p>The <code>echo</code> function basically displays a string of characters on the screen. In some examples or tutorials you may find <code>print</code> used instead. Don&#8217;t worry, it performs the exact same function.</p>
<h4>End of Chapter</h4>
<p>Since this is the first chapter, you didn&#8217;t really learn much more than what PHP actually is. In future chapters, I&#8217;ll discuss extra functions, as well as other PHP aspects like variables and classes. </p>
<p>I&#8217;m kind of new to writing tutorials, so if there&#8217;s something you find here that could have been done better, do let me know in the comments below. Also, if you have any suggestions/requests for future chapters, let me know!</p>


<p>Related posts:<ol><li><a href='http://www.ashmenon.com/beginner-php-chapter-3-operator/' rel='bookmark' title='Beginner PHP Chapter 3 &#8211; Operators'>Beginner PHP Chapter 3 &#8211; Operators</a> <small>Operators are to PHP what grammar particles are to English. They connect the various important bits you have to become...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-4-conditional-statements/' rel='bookmark' title='Beginner PHP Chapter 4 &#8211; Conditional Statements'>Beginner PHP Chapter 4 &#8211; Conditional Statements</a> <small>In the previous chapters, we've covered variables, functions, and operators. We've also touched slightly on conditional statements. In this chapter,...</small></li><li><a href='http://www.ashmenon.com/beginner-php-chapter-2-functions-and-variables/' rel='bookmark' title='Beginner PHP Chapter 2 &ndash; Functions and Variables'>Beginner PHP Chapter 2 &ndash; Functions and Variables</a> <small>In the previous chapter, you learned what PHP is and what you could be capable of achieving with it. In...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ashmenon.com/beginner-php-chapter-1-the-meet-n-greet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Year of the Tiger! 12 Wallpapers to Bring Good Luck to Your Desktop</title>
		<link>http://www.ashmenon.com/happy-year-of-the-tiger-12-wallpapers-to-bring-good-luck-to-your-desktop/</link>
		<comments>http://www.ashmenon.com/happy-year-of-the-tiger-12-wallpapers-to-bring-good-luck-to-your-desktop/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 10:40:16 +0000</pubDate>
		<dc:creator>Ash Menon</dc:creator>
				<category><![CDATA[Wallpapers]]></category>
		<category><![CDATA[new year]]></category>
		<category><![CDATA[tiger]]></category>
		<category><![CDATA[wallpaper]]></category>

		<guid isPermaLink="false">http://www.ashmenon.com/happy-year-of-the-tiger-12-wallpapers-to-bring-good-luck-to-your-desktop/</guid>
		<description><![CDATA[To everyone that celebrates the Lunar New Year, I&#8217;d like to wish you guys a happy and joyous Lunar New Year. It&#8217;s a great time of year that&#8217;s full of fun, family, and food. And to everyone not celebrating it, I&#8217;m going to wish you anyway, because it&#8217;s just an awesome thing to do :) [...]


Sorry, I couldn&rsquo;t find anything related for you. Maybe you could browse the categories?

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>To everyone that celebrates the Lunar New Year, I&#8217;d like to wish you guys a happy and joyous Lunar New Year. It&#8217;s a great time of year that&#8217;s full of fun, family, and food. And to everyone not celebrating it, I&#8217;m going to wish you anyway, because it&#8217;s just an awesome thing to do :) .</p>
<p>This year is the year of the tiger, the third animal in the zodiac. I did a bit of digging (read: Wikipedia-ing) and found some fascinating facts about the majestic cat and its place in the zodiac. </p>
<ol>
<li>The Tiger&#8217;s motto is &#8220;I Win&#8221;. How awesome is that? This year is DEFINITELY your year to succeed, folks. </li>
<li>It&#8217;s usually associated with spring, the month of February, the element of wood, and the diamond. And a person can never have too many diamonds. </li>
<li>Countries that have a stronger connection to the tiger zodiac are Russia, Romania, Spain, Turkey, El Salvador, and North Korea. I wonder how they calculate that? </li>
</ol>
<p>&#160;</p>
<h3></h3>
<h3>Victory Stripes</h3>
<p>As you can see, the tiger zodiac is a powerful one that heralds success. So, to help you harness some of that energy, here are some tiger wallpapers for you from some amazingly talented people at Deviantart.</p>
<h4></h4>
<h5><a title="Tiger in the Grass" href="http://benbenhotep.deviantart.com/art/Tiger-in-the-grass-79330452" target="_blank">Tiger in the Grass</a> by <a title="Benbenhotep on Deviantart" href="http://benbenhotep.deviantart.com" target="_blank">Benbenhotep</a></h5>
<h4><a title="Tiger in the Grass by Benbenhotep on Deviantart" href="http://benbenhotep.deviantart.com/art/Tiger-in-the-grass-79330452" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Tiger_in_the_grass_by_benbenhotep" border="0" alt="Tiger_in_the_grass_by_benbenhotep" src="http://www.ashmenon.com/wordpress/wp-content/uploads/Tiger_in_the_grass_by_benbenhotep.jpg" width="400" height="250" /></a></h4>
<h5><a title="Tiger Splat by thegenome on Deviantart" href="http://thegenome.deviantart.com/art/tiger-splat-77051668" target="_blank">Tiger Splat</a> by <a title="thegenome on Deviantart" href="http://thegenome.deviantart.com" target="_blank">thegenome</a></h5>
<p><a title="Tiger Splay by thegenome on Deviantart" href="http://thegenome.deviantart.com/art/tiger-splat-77051668" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="tiger_splat_by_thegenome" border="0" alt="tiger_splat_by_thegenome" src="http://www.ashmenon.com/wordpress/wp-content/uploads/tiger_splat_by_thegenome.jpg" width="400" height="250" /></a></p>
</p>
<h5></h5>
<h5></h5>
<h5><a title="Tiger by Baddad on Deviantart" href="http://baddad.deviantart.com/art/Tiger-82922900" target="_blank">Tiger</a> by <a title="Baddad on Deviantart" href="http://baddad.deviantart.com" target="_blank">Baddad</a></h5>
<h5><a title="Tiger by Baddad on Deviantart" href="http://baddad.deviantart.com/art/Tiger-82922900" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="864b01743b206a422f5966aa211f44b9" border="0" alt="864b01743b206a422f5966aa211f44b9" src="http://www.ashmenon.com/wordpress/wp-content/uploads/864b01743b206a422f5966aa211f44b9.jpg" width="400" height="320" /></a></h5>
<h5><a title="Jungle Tiger by owdesigns on Deviantart" href="http://owdesigns.deviantart.com/art/jungle-tiger-88960271" target="_blank">Jungle Tiger</a> by <a title="owdesigns on Deviantart" href="http://owdesigns.deviantart.com" target="_blank">owdesigns</a></h5>
<p><a title="Jungle Tiger by owdesigns on Deviantart" href="http://owdesigns.deviantart.com/art/jungle-tiger-88960271" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="jungle_tiger_by_owdesigns" border="0" alt="jungle_tiger_by_owdesigns" src="http://www.ashmenon.com/wordpress/wp-content/uploads/jungle_tiger_by_owdesigns.jpg" width="400" height="300" /></a></p>
<h5><a title="Night of the Tiger by BlackHawk00021 on Deviantart" href="http://blackhawk00021.deviantart.com/art/Night-of-the-Tiger-59080123" target="_blank">Night of the Tiger</a> by <a title="BlackHawk00021 on Deviantart" href="http://blackhawk00021.deviantart.com" target="_blank">BlackHawk00021</a></h5>
<p><a title="Night of the Tiger by BlackHawk00021 on Deviantart" href="http://blackhawk00021.deviantart.com/art/Night-of-the-Tiger-59080123" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Night_of_the_Tiger_by_BlackHawk00021" border="0" alt="Night_of_the_Tiger_by_BlackHawk00021" src="http://www.ashmenon.com/wordpress/wp-content/uploads/Night_of_the_Tiger_by_BlackHawk00021.jpg" width="400" height="300" /></a></p>
<h5><a title="Tiger, Black and White by tompot on Deviantart" href="http://tompot.deviantart.com/art/Tiger-black-and-white-42470408" target="_blank">Tiger, Black and White</a> by <a title="tompot on Deviantart" href="http://tompot.deviantart.com" target="_blank">tompot</a></h5>
<p><a title="Tiger, Black and White by tompot on Deviantart" href="http://tompot.deviantart.com/art/Tiger-black-and-white-42470408" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Tiger__black_and_white_by_tompot" border="0" alt="Tiger__black_and_white_by_tompot" src="http://www.ashmenon.com/wordpress/wp-content/uploads/Tiger__black_and_white_by_tompot.jpg" width="400" height="320" /></a></p>
<p>and a white version as well.<a href="http://www.ashmenon.com/wordpress/wp-content/uploads/Tiger_by_tompot.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Tiger_by_tompot" border="0" alt="Tiger_by_tompot" src="http://www.ashmenon.com/wordpress/wp-content/uploads/Tiger_by_tompot_thumb.jpg" width="400" height="320" /></a></p>
<h5><a title="Tiger by tommy999999 on Deviantart" href="http://tommy999999.deviantart.com/art/Tiger-30940812" target="_blank">Tiger</a> by <a title="tommy999999 on Deviantart" href="http://tommy999999.deviantart.com" target="_blank">tommy999999</a>&#160;</h5>
<p><a title="Tiger by tommy999999 on Deviantart" href="http://tommy999999.deviantart.com/art/Tiger-30940812" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Tiger_by_tommy999999" border="0" alt="Tiger_by_tommy999999" src="http://www.ashmenon.com/wordpress/wp-content/uploads/Tiger_by_tommy999999.jpg" width="400" height="300" /></a> </p>
<h5><a title="Tiger Funkeh Go by artemiscrow on Deviantart" href="http://artemiscrow.deviantart.com/art/Tiger-Funkeh-Go-122041592" target="_blank">Tiger Funkeh Go</a> by <a title="artemiscrow on Deviantart" href="http://artemiscrow.deviantart.com" target="_blank">artemiscrow</a></h5>
<p><a title="Tiger Funkeh Go by artemiscrow on Deviantart" href="http://artemiscrow.deviantart.com/art/Tiger-Funkeh-Go-122041592" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Tiger_Funkeh_Go_by_artemiscrow" border="0" alt="Tiger_Funkeh_Go_by_artemiscrow" src="http://www.ashmenon.com/wordpress/wp-content/uploads/Tiger_Funkeh_Go_by_artemiscrow.jpg" width="400" height="300" /></a>&#160;</p>
<h5><a title="Tiger Girl Wallpaper by mashi on Deviantart" href="http://mashi.deviantart.com/art/Tiger-Girl-Wallpaper-147344596" target="_blank">Tiger Girl Wallpaper</a> by <a title="mashi on Deviantart" href="http://mashi.deviantart.com" target="_blank">mashi</a></h5>
<p><a title="Tiger Girl Wallpaper by mashi on Deviantart" href="http://mashi.deviantart.com/art/Tiger-Girl-Wallpaper-147344596" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="Tiger_Girl_Wallpaper_by_mashi" border="0" alt="Tiger_Girl_Wallpaper_by_mashi" src="http://www.ashmenon.com/wordpress/wp-content/uploads/Tiger_Girl_Wallpaper_by_mashi.jpg" width="400" height="300" /></a> </p>
<h5><a title="White Tiger by monkeymagico on Deviantart" href="http://monkeymagico.deviantart.com/art/White-Tiger-101630850" target="_blank">White Tiger</a> by <a title="monkeymagico on Deviantart" href="http://monkeymagico.deviantart.com" target="_blank">monkeymagico</a></h5>
<p><a title="White Tiger by monkeymagico on Deviantart" href="http://monkeymagico.deviantart.com" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="White_Tiger_by_monkeymagico" border="0" alt="White_Tiger_by_monkeymagico" src="http://www.ashmenon.com/wordpress/wp-content/uploads/White_Tiger_by_monkeymagico.jpg" width="400" height="250" /></a> </p>
<h5><a title="Wild Tiger by comradekowalski on Deviantart" href="http://comradekowalski.deviantart.com/art/Wild-Tiger-109653014" target="_blank">Wild Tiger</a> by <a title="comradekowalski on Deviantart" href="http://comradekowalski.deviantart.com" target="_blank">comradekowalski</a></h5>
<p><a title="Wild Tiger by comradekowalski on Deviantart" href="http://comradekowalski.deviantart.com/art/Wild-Tiger-109653014"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Wild_Tiger_by_comradekowalski" border="0" alt="Wild_Tiger_by_comradekowalski" src="http://www.ashmenon.com/wordpress/wp-content/uploads/Wild_Tiger_by_comradekowalski.jpg" width="400" height="250" /></a></p>


<p>Sorry, I couldn&rsquo;t find anything related for you. Maybe you could browse the categories?</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ashmenon.com/happy-year-of-the-tiger-12-wallpapers-to-bring-good-luck-to-your-desktop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tying Tighter Shoelaces: 10 Tips to Increase Productivity at Home</title>
		<link>http://www.ashmenon.com/tying-tighter-shoelaces-10-tips-to-increase-productivity-at-home/</link>
		<comments>http://www.ashmenon.com/tying-tighter-shoelaces-10-tips-to-increase-productivity-at-home/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 17:14:53 +0000</pubDate>
		<dc:creator>Ash Menon</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[manage]]></category>
		<category><![CDATA[organize]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.ashmenon.com/?p=55</guid>
		<description><![CDATA[To a runner, tying tigher shoelaces may help shave off a few milliseconds from his time, which could mean the difference between first and second place. Here are 10 things you can change at home to make your own day more productive.


Related posts:<ol><li><a href='http://www.ashmenon.com/the-design-mindset-8-principles-you-can-apply-in-your-life/' rel='bookmark' title='The Design Mindset &ndash; 8 Principles You Can Apply in Your Life'>The Design Mindset &ndash; 8 Principles You Can Apply in Your Life</a> <small>When I first entered college, and I was being given an introduction to the different majors available, my first question...</small></li><li><a href='http://www.ashmenon.com/set-yourself-on-fire/' rel='bookmark' title='Set Yourself on Fire'>Set Yourself on Fire</a> <small>Calm down, I don&#8217;t actually mean that. I treasure my readers very much, and I&#8217;d be rather upset if I...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Have you ever seen runners at the beginning of a race? Their eyes are focused, muscles coiled, ready to spring into action. While it&#8217;s easy to think that winning is simply about being the fastest, the truth is that there are hundreds of other factors (or microfactors, if you will) that contribute towards it.</p>
<p>While shaving milliseconds off of your daily routine may not sound like much, there are changes that you can make at home to save minutes and even hours. Read on for some ideas.</p>
<p>1. The night before, prepare some juice or milk in a sealable container, and put it in the fridge. In the morning, instead of running out with a biscuit in your mouth, grab the drink. You&#8217;ll get your morning perk, it&#8217;s healthy, and it&#8217;s cooling.</p>
<p>2. Get a tray by the door for all your keys. If you live with someone, consider a separate tray or maybe a hook for only your key bunches, so you can grab everything in one motion.</p>
<p>3. <strong>The standby</strong> &#8211; You can combine this with the key tray. Get a shelf, rack, or even a corner of the kitchen counter that has plug point access. When you come back home, immediately put your phone, music player, PDA, and any other gadget that you might have, on that counter. You don&#8217;t necessarily have to charge it (in fact, overcharging is not good for most gadgets), but it&#8217;s important that you make a habit of automatically putting your chargeables on that counter, and only then considering whether to charge them. Also make sure that the standby is in a convenient location on your way out so you&#8217;ll remember to grab everything in the morning. <strong></strong></p>
<p>4. Is your bathroom in one corner of the house, your towels in another corner, and your laundry basket in a third? You get where I&#8217;m going with this, right? <strong></strong></p>
<p>5. Invest in single-portion containers and no-brainer recipe books. On the weekend, cook up a batch each of two recipes (if you share a living space, this is a great &#8216;together&#8217; activity, or you could even take turns surprising the others!) and store it in those containers. You now have instant fuss-free dinners that you can just heat up and enjoy. (Extra tip: some recipes can be varied with some herbs, garnishing, or seasoning. Experimenting will make you enjoy your food more.)<strong></strong></p>
<p>6. Take number 5 further by investing in a good rice cooker. I&#8217;m not sure how common it is in other parts of the world, but in Southeast Asia it&#8217;s a staple for most houses. Although most obviously known for cooking rice, the rice cooker can actually be used for a whole variety of dishes, and the best part is that it requires almost no management from you. <strong></strong></p>
<p>7. Stick a piece of paper to your fridge or pantry door, and jot down items as you notice your need for them. If you can, reduce your shopping to once per week, at off-peak hours, so you can get in and out with minimum delay. Also, before you make that trip, look at your list, and sort them by your aisles in the mall. (Bonus prep: The next trip you make to the mall, take a pen and paper and list down the categories in each aisle. You&#8217;ll be zipping through the aisles with a smirk on your face.)<strong></strong></p>
<p>8. Lists. They save time, tension, and temper. A list of things you usually pack on trips, a list of documents you need to makes copies of, or even a list of things your kid needs for his field trip. I usually take one weekend morning and make a list of chores and other tasks I need to do. In fact, I find this to be quite motivating.<strong></strong></p>
<p>9. A dry-erase board, or a whiteboard as it&#8217;s sometimes known, may be an odd thing to find around the house, but the advantage of having a space to combine grocery lists, to-do lists, birthdays, memos, and anything else, far outweighs the wall space it may take up. Just be sure to stick it in a place you&#8217;ll see. <strong></strong></p>
<p>10. Arrange your office clothing in advance. This tip may seem more geared towards women, but you&#8217;ll be surprised by the number of men who really wonder if that shirt and that tie go together. Setting aside even ten minutes on the weekend can really work wonders for those frantic mornings.</p>
<h3>But can he walk the walk?</h3>
<p>Those of you who know me will be surprised that I&#8217;m writing a post about time-management, since my own time management skills are less than impressive. However, I find that the best way to commit myself to these changes is to also spread word about them.</p>
<p>I have managed to practice some of these tips at home. All my keys are in a key holder that I cannot miss on my way down the stairs. Since my phone doubles as my alarm, my gadgets are always beside my bed. I&#8217;m naturally a list nazi, so I&#8217;ve got that covered. And while I don&#8217;t have any particular office clothing (ah, the sweet life of a designer), I do find that packing my gym bag the day before saves me a lot of rushing the next morning.</p>
<p>What time management methods do you practice around the house? Share your ideas in the comments section.</p>


<p>Related posts:<ol><li><a href='http://www.ashmenon.com/the-design-mindset-8-principles-you-can-apply-in-your-life/' rel='bookmark' title='The Design Mindset &ndash; 8 Principles You Can Apply in Your Life'>The Design Mindset &ndash; 8 Principles You Can Apply in Your Life</a> <small>When I first entered college, and I was being given an introduction to the different majors available, my first question...</small></li><li><a href='http://www.ashmenon.com/set-yourself-on-fire/' rel='bookmark' title='Set Yourself on Fire'>Set Yourself on Fire</a> <small>Calm down, I don&#8217;t actually mean that. I treasure my readers very much, and I&#8217;d be rather upset if I...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.ashmenon.com/tying-tighter-shoelaces-10-tips-to-increase-productivity-at-home/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
