<?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>Sunny Man&#039;s Blog &#187; Educational</title>
	<atom:link href="http://blog.eop.org.uk/category/educational/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.eop.org.uk</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 13:53:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Student Advice: Finding Summer Employment</title>
		<link>http://blog.eop.org.uk/514-student-advice-finding-summer-employment/</link>
		<comments>http://blog.eop.org.uk/514-student-advice-finding-summer-employment/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 14:07:47 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Educational]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/?p=514</guid>
		<description><![CDATA[While this article may have come a few months too late for both most students and myself, it is still hoped that the advice shared here can be used to help those wanting to earn some extra cash over the summer holiday months after those dreaded college or university exams. Whether you are wanting to [...]]]></description>
			<content:encoded><![CDATA[<p>While this article may have come a few months too late for both most students and myself, it is still hoped that the advice shared here can be used to help those wanting to earn some extra cash over the summer holiday months after those dreaded college or university exams.</p>
<p>Whether you are wanting to work where you attend university or college or whether you&#8217;re travelling home for the summer, the ways to go about getting a job are pretty much identical. The first thing to do is prepare all the things you will need to apply for a job. This means creating your CV. There are plenty of good websites out there that will guide you along the process of creating a good, relevant CV. If you have an academic tutor at your disposal, they are an invaluable source of help for making a subject specific CV.</p>
<p>A couple of weeks before you will be available to start work, it&#8217;s a good idea to identify and apply via the post, internet and in person if possible to the places you&#8217;re hoping to work it. With these applications the most important pieces of information to include, especially for retail related jobs, are the dates you are available for work, what hours you can work and why you want to work there; all of which can be attached to your CV on a cover sheet.</p>
<p>It&#8217;s a real shame but you&#8217;ll have to get used to the idea that hearing nothing back usually means no. Most shops and companies will not even let you know if you fail in your attempt to get a job with them. While in my opinion it&#8217;s quite disrespectful, it&#8217;s common practise and so the only solution is to try until you get an answer. Be persistent.</p>
<p>Within the couple weeks before you go home, or wish to start work, it&#8217;s an extremely good idea to sign up to some employment <a href="http://www.jobsatteam.com/agency-directory/">agencies</a> in the area. They can do half the work for you and find you temporary work for over the summer. While this is attractive and I myself have gotten summer work through an agency the past two years, it doesn&#8217;t guarantee you work over the entire duration of the summer, if at all, and you can become unemployed at a whim. It also invites the possibility of doing many different things and working long shifts you may not be used to. Experience has taught myself, and people I know, that persistence with agencies is only a good thing and can make the different between getting work and not.</p>
<p>These tips are here are just a guide and are things that have worked for myself and the people I know. Earning extra money during the summer vacation can make the difference to some people between scrimping and saving for a year and enjoying your student life as you should. One thing to remember it to check your payslips if you are in full time education. As a student you do not have to pay income tax on your earnings out of term time. If you are being charged income tax, you need to contact the tax office and request a new tax code, or get them to send you a <a href="http://www.hmrc.gov.uk/incometax/refund-reclaim.htm">rebate</a>. Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/514-student-advice-finding-summer-employment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Student Advice: Managing Your Money</title>
		<link>http://blog.eop.org.uk/508-student-advice-managing-your-money/</link>
		<comments>http://blog.eop.org.uk/508-student-advice-managing-your-money/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 11:42:49 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Educational]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/?p=508</guid>
		<description><![CDATA[Reluctantly sliding on into my third year of my university course this September, I thought it wise to share some of my experiences with managing money as a student who has been living in halls for one year and privately rented accommodation for the other. Some of us are lucky in that our parents moonlight [...]]]></description>
			<content:encoded><![CDATA[<p>Reluctantly sliding on into my third year of my university course this September, I thought it wise to share some of my  experiences with managing money as a student who has been living in halls for one year and privately rented accommodation for the other. Some of us are lucky in that our parents moonlight as an infinite supply of money, but for those who don&#8217;t have that luxury we have to manage our money like responsible adults. Bummer, I know.</p>
<p>Not managing our money properly can lead to terrible decisions that have to be made; Do you buy the food for the week or the cheap beer that&#8217;s only on offer today? Do you pay your rent or go out every night in a week? As you&#8217;re a student, and because you&#8217;re reading this article, you&#8217;ve obviously gone weeks without eating and been behind on your rent. On a serious note, this can not only effect your health, well being and state of mind, but also result in you becoming homeless or having legal action taken against you. Not what you want at any point during your university life.</p>
<p>In my experience, living in halls on your campus or private halls elsewhere is the easy option. Payments are, usually, in tune with student loan payments and bills and utility payments are usually included in the price. Your first year is usually one crazy year and one you&#8217;ll want to cram lots into. For this you need money. Halls is definitely the way to go here.</p>
<p>A few simple things you can do though, to make the most of your first year and prepare for the second. Firstly, if you do receive a student loan and maintenance grants, put them into a high interest savings account. This will hopefully provide you with a few extra quid through interest. Most student accounts require you to use that current account as your main account, and they do check. So have the funds sent to that account and then transfer them to your high interest savings account. Secondly, set aside a certain amount that you will transfer from your current account to a savings account. This is the easy part, but leaving that fund alone will be the hard part. Usually, opening an e-ISA or other savings account is usually free, requiring an initial £1 deposit but this may vary. Basically, it&#8217;s easy so there&#8217;s no excuse.</p>
<p>When it comes to your second year at university, you&#8217;re probably going to move into privately rented accommodation with your mates. That was my decision, anyway. When you do, do your research. What is the normal weekly cost in your area? What length are the tenancies? Will you get a summer concession during the summer months when you&#8217;re probably not even going to be living in the house? There are a few things to consider that your SU can probably help you with. Moving into a house, or flat, is a more complicated experience. Firstly, try and go through websites such as Unipol which will hopefully keep the nasty, evil landlords from your computer screen. See the properties. Ask them about the things listed above. And most of all, ask how you&#8217;ll be paying. Some like to be paid monthly, or in instalments. Work out when the money will leave your account, and when any money will be entering it from loans or jobs etc. You don&#8217;t want to fall behind on payments; although many landlords are quite forgiving, some are not and missing a single payment, even by a day, can be a breach of contract which can lead to eviction.</p>
<p>A top tip for living privately is to plan how much you have to spend over each period between rent payments. Don&#8217;t spend more than you have. It&#8217;s not worth the hassle.</p>
<p>Other things you can do to help include getting the <a href="http://cow.neondragon.net/">best phone contract</a> you can, so downgrading to a cheaper tariff, only turning the heating on in your house for a few hours a day. Those sorts of things go a long way. Not getting Sky, Virgin Media or BT, but sticking to Freeview or better yet, just using your laptops/computers to watch your favourite programs. Looking for the best internet deal for your property and not just sticking to the provider that the previous tenants had. And, don&#8217;t use your overdraft if you don&#8217;t have to.</p>
<h2>So, what have we learnt?</h2>
<p>Well, if you&#8217;re a student you probably didn&#8217;t read all of that. So, here are Sunny Man&#8217;s top student finance tips to help you have a money trouble free year at university:</p>
<ul>
<li>Transfer your loans/grants into a high interest savings account.</li>
<li>Put aside £5/£10 a week into a savings account over the year.</li>
<li>Know when and what you have to pay and to who.</li>
<li>Try not to use your overdraft, however good it looks.</li>
<li>Have fun, it&#8217;ll be the best years of your life so far&#8230;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/508-student-advice-managing-your-money/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>3D Hill Plot with MATLAB</title>
		<link>http://blog.eop.org.uk/481-3d-hill-plot-with-matlab/</link>
		<comments>http://blog.eop.org.uk/481-3d-hill-plot-with-matlab/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 17:59:38 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Educational]]></category>
		<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/?p=481</guid>
		<description><![CDATA[I thought I&#8217;d share some of the easier things I had to do as part of the first year of my course. One of those tasks was to generate a 3D plot of a function and then also plot 2D cross sections at different values. We start off with a mathematical function that describes, what [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d share some of the easier things I had to do as part of the first year of my course. One of those tasks was to generate a 3D plot of a function and then also plot 2D cross sections at different values.</p>
<p>We start off with a mathematical function that describes, what we will call, our hill. This function represents the &#8216;height&#8217; of our hill, h if you will, at the different points in x and y.</p>
<p><a href="http://blog.eop.org.uk/wp-content/uploads/2010/07/eq1.jpg"><img class="aligncenter size-full wp-image-482" title="Hill Plot Equation" src="http://blog.eop.org.uk/wp-content/uploads/2010/07/eq1.jpg" alt="exp(-(x.^2)-(y.^2)) + 0.5.*exp(-((x-2).^2)-(y.^2));" width="434" height="107" /></a></p>
<p>So, in our MATLAB script we first of all generate a grid of points using x values from -1.5 to 3.5 and y values from -2 to 2. The follow code achieves this.</p>
<p><code>x = linspace(-1.5,3.5,50); <span style="color: #ff6600;">% 50 values of x</span><br />
y = linspace(-2,2,25); <span style="color: #ff6600;">% 25 values of x</span><br />
[xg yg] = meshgrid(x,y); <span style="color: #ff6600;">% generate points</span></code></p>
<p>And next we generate the height values of our hill, using the grid we have just created with x -&gt; xg and y -&gt;yg.</p>
<p><code>h = exp(-(xg.^2)-(yg.^2)) + 0.5.*exp(-((xg-2).^2)-(yg.^2)); <span style="color: #ff6600;">% calculate height values</span></code></p>
<p>With our hight values in the array h, all we need to do now is plot them. Firstly, to create the 3D plot we just plot x,y and h using the <strong>surf()</strong> function.</p>
<p><code>figure(1); <span style="color: #ff6600;">% create new figure window</span><br />
surf(x,y,h); <span style="color: #ff6600;">% surface plot</span><br />
title('3D Hill Plot'); <span style="color: #ff6600;">% title and axis labels</span><br />
xlabel('x');<br />
ylabel('y');<br />
zlabel('height');</code></p>
<p>Now, to look at several slices through the hill at different values of y, we need to select the different values of y from its array and plot them on the same graph.</p>
<p><code>figure(2);<br />
plot(x,h([1,10,20],:)); <span style="color: #ff6600;">% plot 1st, 10th and 20th values of y</span><br />
title('2D Hill Plot'); <span style="color: #ff6600;">% title and axis labels</span><br />
xlabel('x');<br />
ylabel('height');<br />
legend('y = -1.5','y = -0.4','y = 1.2',0); <span style="color: #ff6600;">% legend not overlapping any of the plot</span></code></p>
<p>Putting it all together you get a 3D plot of the function and the cross sections in two windows. Job done.</p>
<p style="text-align: center;"><a href="http://blog.eop.org.uk/wp-content/uploads/2010/07/matlab1.jpg"><img class="aligncenter size-medium wp-image-486" title="3D Hill Plot" src="http://blog.eop.org.uk/wp-content/uploads/2010/07/matlab1-300x224.jpg" alt="" width="240" height="179" /></a><a href="http://blog.eop.org.uk/wp-content/uploads/2010/07/matlab2.jpg"><img class="aligncenter size-medium wp-image-487" title="2D Hill Cross Sections" src="http://blog.eop.org.uk/wp-content/uploads/2010/07/matlab2-300x224.jpg" alt="" width="240" height="179" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/481-3d-hill-plot-with-matlab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Fractals with MATLAB</title>
		<link>http://blog.eop.org.uk/457-create-fractals-with-matlab/</link>
		<comments>http://blog.eop.org.uk/457-create-fractals-with-matlab/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 04:29:01 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Educational]]></category>
		<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/?p=457</guid>
		<description><![CDATA[As part of my University course we had to use the scientific MATLAB programming language, and computing environment,  for several tasks in the first year. While the set tasks were as drab and dreary as you would expect from a Physics course, it taught us the basic skills and the problem solving skills key to [...]]]></description>
			<content:encoded><![CDATA[<p>As part of my University course we had to use the scientific <a href="http://www.mathworks.com/products/matlab/">MATLAB</a> programming language, and computing environment,  for several tasks in the first year. While the set tasks were as drab and dreary as you would expect from a Physics course, it taught us the basic skills and the problem solving skills key to the course.</p>
<p>In my spare time I ported a PHP script <a href="http://cow.neondragon.net/index.php/2680-Php-Fractal-Generator">my friend</a> created to MATLAB which enables the creation of beautiful fractals from the Mandlebrot set. The maximum image size you can create depends on the amount of memory available in your system and the script isn&#8217;t something I&#8217;ve spent a lot of time on so feel free to improve on it.</p>
<p>On my laptop, a 10,000 x 10,000 pixel image took about an hour to create, using 20 iterations. You may find this differs on other machines.</p>
<p style="text-align: center;"><a href="http://blog.eop.org.uk/wp-content/uploads/2010/07/BIG.jpg"><img class="aligncenter size-medium wp-image-458" title="Example Fractal" src="http://blog.eop.org.uk/wp-content/uploads/2010/07/BIG-300x163.jpg" alt="" width="300" height="163" /></a><br />
Download the <a href="http://blog.eop.org.uk/wp-content/uploads/2010/07/fractals.txt">MATLAB Fractal Generator Code</a>.</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/457-create-fractals-with-matlab/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Life: Part 3 (University)</title>
		<link>http://blog.eop.org.uk/397-life-part-3-university/</link>
		<comments>http://blog.eop.org.uk/397-life-part-3-university/#comments</comments>
		<pubDate>Sat, 29 Sep 2007 23:27:15 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Educational]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/397-life-part-3-university/</guid>
		<description><![CDATA[University is something that wouldn&#8217;t have even crossed my mind a couple years ago. I was concentrating on GCSEs and having a good time too much to think that far into the future. I know it&#8217;s a cliché but time does fly. By the end of this calendar year, I will have a good idea [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://blog.eop.org.uk/wp-content/uploads/2007/09/university.jpg' alt='Special Article: University' /></p>
<p>University is something that wouldn&#8217;t have even crossed my mind a couple years ago. I was concentrating on GCSEs and having a good time too much to think that far into the future. I know it&#8217;s a cliché but time <em>does</em> fly. By the end of this calendar year, I will have a good idea of which Universities I have been accepted into, conditionally or not. It kind of scares me how fast we&#8217;re all thrown into this higher education business. It scares me even more because I&#8217;m the first in my family to actually finish school, let alone go to University.</p>
<p>Going into higher education isn&#8217;t something you shouldn&#8217;t, and I don&#8217;t, take lightly. It&#8217;s an expensive and hard experience but one that has the potential to reward you with the best three or four years of your life so far. Going into University is something many people have questions about and no matter how many <a href="http://www.ucas.com">UCAS</a> conferences your school take you to or how many open days you attend, I guarantee there are some questions that can never be answered until you experience it first hand.</p>
<h5>Making Choices</h5>
<p>You&#8217;ve had a minimum of eleven years to decide what you want to pursue (and spend a considerable amount of money on) at University. My own experience has been somewhat tumultuous. For many years I wanted to pursue a career in IT and it seems that fate has made sure I&#8217;ve the experience to do so. About a year ago, my attention was grabbed and has since been held by the realm of physics. I love it. Physics has excited me ever since I was taught the &#8216;good stuff&#8217;, as it were. I got full marks on most of my Science modules at GCSE and made sure I achieved a top A* in it as I was only doing Double Science and not Triple Science, something I do regret (but am glad I got an A*, so was worth it).</p>
<p><span id="more-397"></span></p>
<p>I&#8217;m lucky to go to a school that provides opportunities for students such as myself to expand their knowledge and experience in the field of Science and such opportunities have really fascinated me. I don&#8217;t think I find any area of Physics boring (although University may prove me wrong, who knows <img src='http://blog.eop.org.uk/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ). I&#8217;m also lucky to have friends that give me opportunities that they themselves have found. There are a few things I would not have done if it were not for them.</p>
<p>What you study should be something you like, something you want to study and make a career out of. You&#8217;ve had subjects pushed on you for most of your educational life, this time it&#8217;s your choice and your choice only.</p>
<p>There are two choices you have to make; the first is what course you want to study and the other is where you want to study it. In all honesty, the impression I have is this is probably one of the most important decisions you&#8217;ll make. This decision can be made much easier by visiting the University and the surrounding towns and cities. You must also consider the reputation and raking of the University for the subject you wish to take. If you like the area, facilities and people &#8211; it&#8217;s up your street basically &#8211; then you can seriously consider it.</p>
<p>My school kindly took me to a UCAS convention as well as an Oxbridge conference where I swagged more prospectuses and freebies than I care to admit as well as find out about what <a href="http://www.oxford.ac.uk">Oxford</a> and <a href="http://www.cam.ac.uk/">Cambridge</a> have to offer. I&#8217;d had my heart set on doing a Natural Sciences course at Cambridge because it offered a slice of about everything I wanted to do. My hopes where extinguished after talking to the representative who said the courses I was taking weren&#8217;t sufficient. I think that students should seriously research courses before entering Sixth Form so they can make their choices and open a few more doors there and then &#8211; at least, that is what I should have done.</p>
<p>Making my decision was made slightly easier when I went to visit universities such as Oxford, <a href="http://www.exeter.ac.uk">Exeter</a>, <a href="http://www3.imperial.ac.uk/">Imperial College</a> and <a href="http://www.qmul.ac.uk/">Queen Mary</a>. Ever since visiting Oxford, I knew I wanted to study Physics there. Their course has a lot more IT in it than others and means I can be taught by the best, learn with the best and have one of the best chances for a good career. A bad, but unfortunately expected, result in my Maths AS means those dreams are also on hold. I was only six marks off the top grade and I don&#8217;t trust myself to do exceptionally well in my A2 exams so I&#8217;m retaking the two modules I lost those six marks on. Hopefully I can keep the dream alive &#8211; god knows I&#8217;m trying my hardest.</p>
<p>So, I want to study Physics. After much deliberation between myself and the redwood forest in my UCAS convention carrier bag, I decided on my lucky Universities. Since two weeks ago, this has been the final list although I&#8217;m still not sure:</p>
<ul>
<li><s><a href="http://www.bristol.ac.uk/">University of Bristol</a></s></li>
<li><a href="http://www.nottingham.ac.uk">University of Nottingham</a></li>
<li>University of Exeter</li>
<li>Imperial College London</li>
<li>Oxford University</li>
<li><a href="http://www2.warwick.ac.uk/">University of Warwick</a></li>
</ul>
<p>You only get five choices and although that may seem a lot, when it comes to deciding which ones to fill those spaces, it becomes hard &#8211; at least, it has been for me.</p>
<h5>Counting Down</h5>
<p>As I said earlier, time has flown incredibly fast. It seems just yesterday I was receiving my Young Scientist badge at Primary School or that I was in the front row as a year seven in my first whole school assembly. I&#8217;m an extremely nostalgic person but I fear that wanting the past back or spending too much time pouring over it makes me miss out on experiences that I could do to have. I haven&#8217;t got long until I&#8217;m meeting some more new people and living up the first major event of student life, fresher&#8217;s week, but I can&#8217;t stop hoping for time to rewind. There&#8217;s that part of me that wants time to reverse and let me repeat the last eleven years.</p>
<p>A couple years ago, University wasn&#8217;t on my mind at all and now it&#8217;s all I can think off. I can&#8217;t wait to meet new people, maybe start or join a crazy society or two and delve into things that I&#8217;ve only scratched the surface of at the moment. I know I want to learn Physics &#8211; every part of it fascinates me and although I may not understand it at first, I always make it my priority to get as deep as I can and quench my thirst for knowledge.</p>
<p>When writing this post, I worried that putting my thoughts on my application would damage my chances in some way but I feel that I need my thoughts out there. I need to know other people are thinking the same and hopefully give others confirmation of that as well. I want to study Physics with the best and be taught it by the best and I think any of the Universities I&#8217;ve listed will offer me this. I suspect it&#8217;s the hope of many students to go to Oxford (or Cambridge) though, above all others. It is my hope. I&#8217;m determined to get my Maths up to an A and have the three-of-a-kind hand to put down on the table. If I don&#8217;t, I know I&#8217;ll have tried my best and that&#8217;s all I could have done.</p>
<p>Less than a year. I hope to make more friends than I lose time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/397-life-part-3-university/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iTunes U: Fun Learning</title>
		<link>http://blog.eop.org.uk/385-itunes-u-fun-learning/</link>
		<comments>http://blog.eop.org.uk/385-itunes-u-fun-learning/#comments</comments>
		<pubDate>Mon, 23 Jul 2007 12:54:33 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Film/TV]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/385-itunes-u-fun-learning/</guid>
		<description><![CDATA[I was perousing around the iTunes store the other day looking for some science and IT based podcasts when I decided to click on a small link that said &#8216;iTunes U&#8217;. It was a spontaneous decision &#8211; one of very few I make &#8211; and has probably been one of the most fulfilling clicks I [...]]]></description>
			<content:encoded><![CDATA[<p><img src='http://blog.eop.org.uk/wp-content/uploads/2007/07/itunesu-logo.jpg' alt='iTunes U' class="float_l" />I was perousing around the <a href="http://www.apple.com/itunes/">iTunes</a> store the other day looking for some science and IT based podcasts when I decided to click on a small link that said &#8216;iTunes U&#8217;. It was a spontaneous decision &#8211; one of very few I make &#8211; and has probably been one of the most fulfilling clicks I have ever made on my computer.</p>
<p>It makes a welcome surprise that, for me, overshadows the absence of TV content on the British and European iTunes stores &#8211; but that makes for another <s>rant</s> post. iTunes U is a way for university students &#8211; or anyone for that matter &#8211; to watch lectures on a number of subjects whenever they want. I&#8217;ve been watching a lecture every night for four days now.</p>
<h5>Long Distance Learning</h5>
<p>The service allows you to download video podcasts of your subjects from a number of American educational institutes and watch them on your <a href='http://blog.eop.org.uk/wp-content/uploads/2007/07/itunesu-1.jpg' title='iTunes U start page'><img src='http://blog.eop.org.uk/wp-content/uploads/2007/07/itunesu-1.thumbnail.jpg' alt='iTunes U start page' class="float_r" /></a>computer and/or video iPod. Over the past few days I&#8217;ve been watching lectures on &#8216;Introductory Astronomy&#8217; from <a href="http://www.mtu.edu">Michigan Tech University</a> with Prof. Robert Nemiroff. The lectures that I&#8217;ve watched have been quite interesting and, although recorded from September last year, up to date. The lecturer, Prof. Robert Nemiroff, is one of the people responsible for writing the <a href="http://antwrp.gsfc.nasa.gov/apod/">Astronomy Picture of the Day</a> (APOD) descriptions as well.</p>
<p>I have found that in the first five lectures to be extremely interesting and it was funny to see the class slowly decrease in size as more and more people found out they didn&#8217;t have to attend the lectures. Some of the content was pretty basic while some went into more depth such as the lectures on black holes &#8211; this was very interesting and I learnt a lot more that I would have at my current A-Level course. I must warn you that Prof. Nemiroff attempts to inject some humour into the lectures and if I&#8217;m honest, fails the majority of the time but you may appreciate it more than me.</p>
<h5>Are U Ready?</h5>
<p>I don&#8217;t know the figures of the uptake on this service but as a British A-Level student it&#8217;s been interesting to learn things on the side while I have some spare time. There are other more hardcore Physics courses on there and a host of other subjects that you can subscribe to. <a href='http://blog.eop.org.uk/wp-content/uploads/2007/07/itunesu-2.jpg' title='Watching ‘Introductory Astronomy’ with Prof. Robert Nemiroff'><img src='http://blog.eop.org.uk/wp-content/uploads/2007/07/itunesu-2.thumbnail.jpg' alt='Watching ‘Introductory Astronomy’ with Prof. Robert Nemiroff' class="float_l" /></a>The list of institutions that provide these courses seems to have increased since I first laid eyes on the service a few days ago and I only hope that more continue the trend.</p>
<p>Personally, I don&#8217;t agree with courses that don&#8217;t require attendance at lectures as I think that&#8217;s half the reason you go to University but I love the fact that these places are recording lectures and allowing people from around the world to learn more about their interests.</p>
<p>I know it may be a stretch to ask Windows users to <a href="http://www.apple.com/itunes/download/">download iTunes</a> but do it anyway, for me. Check out the library of lecture-casts under iTunes U in the iTunes store and give it a go. Download 7 video podcasts and watch one every day for a week. Give us a comment.</p>
<p><em>Oh, and thanks to <a href="http://www.derby.ac.uk/">Derby University</a> for supplying the iPod.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/385-itunes-u-fun-learning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 8</title>
		<link>http://blog.eop.org.uk/349-php-lesson-8/</link>
		<comments>http://blog.eop.org.uk/349-php-lesson-8/#comments</comments>
		<pubDate>Wed, 14 Feb 2007 12:16:31 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/349-php-lesson-8/</guid>
		<description><![CDATA[My lessons are now into their second week and we’ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we’ll also look into arrays near the end of the week. Yesterday we did a simple lesson on $_GET and how to get values [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />My lessons are now into their second week and we’ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we’ll also look into arrays near the end of the week.</p>
<p><a href="http://blog.eop.org.uk/348-php-lesson-7/">Yesterday</a> we did a simple lesson on $_GET and how to get values from a URL. Today another simple lesson on $_POST and the confusion that comes with it. I introduced you to $_POST in last Friday&#8217;s big special and today we are going into much more detail.</p>
<h5>Lesson 8: $_POST and Forms</h5>
<p>As I showed in Friday&#8217;s round up, we use $_POST to collect the values of submitted form data. Some confusion that I had for a while was whether or not to use the <strong>name</strong> or <strong>id</strong> attribute in the form fields to let $_POST work. I&#8217;ll settle this now &#8211; for $_POST to collect the data from the form fields, you need to assign a name attribute to them. The <strong>id</strong> can be used for labels, <abbr title="Cascading Style Sheets">CSS</abbr> classes and other things. Here&#8217;s a sample form <strong>form.php</strong>:</p>
<p><code>&lt;form action="process.php" method="post"&gt;<br />
First Name: &lt;input type="text" name="fname" size="25" /&gt;<br />
Last Name: &lt;input type="text" name="lname" size="25" /&gt;<br />
Over 16? &lt;input type="radio" name="age" value="1" /&gt; Yes &lt;input type="radio" name="age" value="0" /&gt; No<br />
&lt;input type="submit" value="submit form" /&gt;<br />
&lt;/form&gt;</code></p>
<p>In the above form we would get 3 values returned through $_POST. These would be the first name, last name and over 16 values. Here&#8217;s how we&#8217;d capture these values. This file would be <strong>process.php</strong>, as determined in the form&#8217;s first line:</p>
<p><code>&lt;?php<br />
$fname = $_POST['fname'];<br />
$lname = $_POST['lname'];<br />
$age = $_POST['age']; <span style="color:#0cf;">//either 1 or 0</span><br />
<br />$name = $fname." ".$lname; <span style="color:#0cf;">//stitch the first and last names together</span><br />
?&gt;</code></p>
<p>Pretty simple to get the form fields&#8217; values. On Friday we are going to combine everything and a lot of form fields to create a signup form which will include this, arrays and a bit of validation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/349-php-lesson-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 7</title>
		<link>http://blog.eop.org.uk/348-php-lesson-7/</link>
		<comments>http://blog.eop.org.uk/348-php-lesson-7/#comments</comments>
		<pubDate>Tue, 13 Feb 2007 18:34:47 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/348-php-lesson-7/</guid>
		<description><![CDATA[My lessons are now into their second week and we’ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we’ll also look into arrays near the end of the week. In the previous lesson we went into detail about IF and WHILE statements [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />My lessons are now into their second week and we’ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we’ll also look into arrays near the end of the week.</p>
<p>In the <a href="http://blog.eop.org.uk/345-php-lesson-6/">previous lesson</a> we went into detail about IF and WHILE statements and in Friday&#8217;s big round up I introduced you to $_POST and $_GET. Today we&#8217;re going to look further at $_GET and what it&#8217;s used for.</p>
<h5>Lesson 7: $_GET and URLs</h5>
<p>When we have a URL that includes the values of certain variables, we can use this to get the values. Say we had a URL like this:</p>
<p><code>http://www.eop.org.uk/index.php?name=sunny%20man&#038;cool=yes</code></p>
<p>We use $_GET to grab the values of the <em>name</em> and <em>cool</em> variables. Obviously this isn&#8217;t a secure way to transport variables around your site &#8211; we&#8217;ll look at a more secure way later on into the tutorials &#8211; this is the most simple way.</p>
<p><code>&lt;?php<br />
$name = $_GET['name']; <span style="color:#0cf;">//$name = "sunny man"</span><br />
$cool = $_GET['cool']; <span style="color:#0cf;">//$cool = "yes"</span><br />
?&gt;</code></p>
<p>Tomorrow I&#8217;ll be talking about $_POST and how it can be confusing when to use the name and id attributes on form field inputs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/348-php-lesson-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 6</title>
		<link>http://blog.eop.org.uk/345-php-lesson-6/</link>
		<comments>http://blog.eop.org.uk/345-php-lesson-6/#comments</comments>
		<pubDate>Mon, 12 Feb 2007 10:25:37 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/345-php-lesson-6/</guid>
		<description><![CDATA[My lessons are now into their second week and we&#8217;ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we&#8217;ll also look into arrays near the end of the week. As always we will find a useful example we can apply everything to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />My lessons are now into their second week and we&#8217;ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we&#8217;ll also look into arrays near the end of the week.</p>
<p>As always we will find a useful example we can apply everything to at the end of the week as well as introducing some things we are going to look at in the following week. I hope you&#8217;ve learnt something in the previous week but don&#8217;t worry we will get more advanced as time goes on.</p>
<h5>Lesson 6: IF and WHILE</h5>
<p>In last week&#8217;s final day lesson I introduced you to an IF statement. I&#8217;m going to go over them in more detail today as well as introducing you to a WHILE loop. Here&#8217;s the IF statement I used in Friday&#8217;s example:</p>
<p><code>if ($username == "username" &#038;&#038; $password == "password") {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<br />
}</code></p>
<p>This says: <em>if $username&#8217;s value is &#8220;username&#8221; and if $password&#8217;s value is &#8220;password&#8221; then do this&#8230;</em> If the statement in the <strong>( )</strong> brackets are true then it executes the instructions within the <strong>{ }</strong> brackets.</p>
<p>There are a variety of comparison operators that you can use. The one used in the example is <strong>==</strong> which means equal to. There is also <strong>!=</strong> &#8211; not equal to, <strong>===</strong> &#8211; exactly equal and of the same type, <strong>!==</strong> not exactly equal and not of the same type, <strong>&gt;</strong> &#8211; is bigger than, <strong>&lt;</strong> &#8211; is smaller than, <strong>&gt;=</strong> &#8211; is bigger than or equal to, <strong>&lt;=</strong> &#8211; is smaller than or equal to.</p>
<p>If you want to check more than one thing in an IF statement then you need to use logical operators, such as in the example I&#8217;ve used <strong>&#038;&#038;</strong> to indicate that the statement should be true if the username <strong>and</strong> the password are both correct. Here are some examples:</p>
<p><code>if ($username || $password) { ... } <span style="color:#0cf;">// OR</span><br />
if (!$username) { ... } <span style="color:#0cf;">// NOT</span><br />
if ($username XOR $password) { ... } <span style="color:#0cf;">// XOR (exclusive OR)</span></code></p>
<p>Now we have got the hard bit out of the way we can now look at WHILE statements. WHILE statements are a little different to IF statements because they perform the instructions inside the <strong>{ }</strong> brackets while a comparison remains true.</p>
<p><code>&lt;?php<br />
$a = 1;<br />
$b = 5;<br />
<br />while ($a &lt; $b) { <span style="color:#0cf;">//while $a is less than $b</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $a;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$a++; <span style="color:#0cf;">//increment $a by 1</span><br />
}<br />
?&gt;</code></p>
<p>WHILE loops come in very handy sometimes &#8211; for example when we look at arrays we will use a WHILE loop to good effect. A famous example of using &#8216;the loop&#8217; is the WordPress blogging system. This is the basic form of IF and WHILE loops. Remember them!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/345-php-lesson-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 5</title>
		<link>http://blog.eop.org.uk/344-php-lesson-5/</link>
		<comments>http://blog.eop.org.uk/344-php-lesson-5/#comments</comments>
		<pubDate>Fri, 09 Feb 2007 19:18:30 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/344-php-lesson-5/</guid>
		<description><![CDATA[Well we&#8217;ve reached the end of week one of my series of lessons on PHP. We are going to incorporate everything we have learnt in lessons one, two, three and four. In today&#8217;s lesson we&#8217;re going to create a login script in PHP and you&#8217;ll see all you&#8217;ve learnt in it as well as some [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />Well we&#8217;ve reached the end of week one of my series of lessons on PHP. We are going to incorporate everything we have learnt in lessons <a href="http://blog.eop.org.uk/336-php-lesson-1/">one</a>, <a href="http://blog.eop.org.uk/338-php-lesson-2/">two</a>, <a href="http://blog.eop.org.uk/339-php-lesson-3/">three</a> and <a href="http://blog.eop.org.uk/342-php-lesson-4/">four</a>.</p>
<p>In today&#8217;s lesson we&#8217;re going to create a login script in PHP and you&#8217;ll see all you&#8217;ve learnt in it as well as some new things that we are going to cover in next week&#8217;s lessons &#8211; 6 to 9. Enjoy and try it out yourself on your own server. We will take another look at this script later on and implement a mySQL connection into the script &#8211; but don&#8217;t worry about this until later.</p>
<h5>Lesson 5: Simple Login Script</h5>
<p>First of all we will take the simple username and password form from lesson 4 and use this. This will be our <strong>login.php</strong> file. Here it is again:</p>
<p><code>&lt;form action="process.php" method="post"&gt;<br />
Username: &lt;input type="text" name="username" size="25" /&gt;<br />
Password: &lt;input type="password" name="password" size="25" /&gt;<br />
&lt;input type="submit" value="submit form" /&gt;<br />
&lt;/form&gt;</code></p>
<p>Now we&#8217;ll extend this with some extra PHP code which will be used to display any error messages if the user inputs an invalid username or password. This will be added above the form code.</p>
<p><code>&lt;?php<br />
if($_GET['e']) {<br />
        $error = "Wrong username or password. Please try again.";<br />
}<br />
<br />if($error) {<br />
        ?&gt;<br />
        &lt;p style="padding:10px;border:red;color:black;"&gt;<br />
        &lt;?php echo $error; ?&gt;<br />
        &lt;/p&gt;<br />
        &lt;?php<br />
}<br />
?&gt;</code></p>
<p>Okay so now we can create the <strong>process.php</strong> file which will digest the submitted form data. Take a look at the file and go over the previous four lessons to see what you can remember how to do.</p>
<p><code>&lt;?php<br />
$username = $_POST['username'];<br />
$password = $_POST['password'];<br />
<br />if(!$username || !$password) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header("Location:login.php?e=1");<br />
}<br />
else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($username == "username" &#038;&#038; $password == "password") {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header("Location:members.php");<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header("Location:login.php?e=1");<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br />
?&gt;</code></p>
<p>There may be things in there you don&#8217;t understand just yet but I assure you we&#8217;ll get to them. IF statements, $_GET global and some other things are what we&#8217;re going to visit in next week&#8217;s tutorials. When we&#8217;ve learnt functions and mySQL connections we will revisit this form and make it more dynamic. Hope you enjoyed these extremely simple and basic tutorials. See you next week.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/344-php-lesson-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 4</title>
		<link>http://blog.eop.org.uk/342-php-lesson-4/</link>
		<comments>http://blog.eop.org.uk/342-php-lesson-4/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 09:03:31 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/342-php-lesson-4/</guid>
		<description><![CDATA[Previously we looked at some of the methods PHP offers to sort and manipulate strings and we specifically looked at str_replace() and encryption methods like md5() and sha1(). In this lesson, the final one before a big project, we&#8217;re going to take a look at how to capture inputs from form fields. Also I&#8217;m going [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' /><a href="http://blog.eop.org.uk/339-php-lesson-3/">Previously</a> we looked at some of the methods PHP offers to sort and manipulate strings and we specifically looked at <strong>str_replace()</strong> and encryption methods like <strong>md5()</strong> and <strong>sha1()</strong>.</p>
<p>In this lesson, the final one before a big project, we&#8217;re going to take a look at how to capture inputs from form fields. Also I&#8217;m going to talk about the secure and insecure ways to transfer the data.</p>
<h5>Lesson 4: Form Field Input</h5>
<p>Getting the input from a form is pretty simple and in this lesson we are going to keep it that way by using two files: <strong>form.php</strong> and <strong>process.php</strong>. The first will contain the form we are going to create which a user will fill in. The latter file will take the input, process it and output it.</p>
<p>Here&#8217;s the sample form we&#8217;re going to use. In this case it&#8217;s just a simple username and password form. This form does not validate and is in no way conforming to accessibility either.</p>
<p><code>&lt;form action="process.php" method="post"&gt;<br />
Username: &lt;input type="text" name="username" size="25" /&gt;<br />
Password: &lt;input type="password" name="password" size="25" /&gt;<br />
&lt;input type="submit" value="submit form" /&gt;<br />
&lt;/form&gt;</code></p>
<p>Once the user submits the information by the button they&#8217;ll be taken to <strong>process.php</strong> along with the values of the form fields. We use the <strong>$_POST</strong> global to take the form values. For example if we wanted to take the value of the username field and assign it to <em>$username</em>:</p>
<p><code>$username = $_POST['username'];<br />
<span style="color:#0cf;">//getting the value of the form field with the name of 'username'</span></code></p>
<p>The variable in between the square brackets refers to the <em>name=&#8221;"</em> part of the inputs in the form. So now we can create the <strong>process.php</strong> file from what we&#8217;ve learned.</p>
<p><code>&lt;?php<br />
$username = $_POST['username'];<br />
$password = $_POST['password'];<br />
<br />echo "You're username is ".$username." and your password is ".$password.".";<br />
?&gt;</code></p>
<p>So there is the simple way to collect and assign form variables sent over pages. The next lesson, lesson 5, is where we are going to put all we&#8217;ve learnt from lessons 1 to 4 into practise. You&#8217;ll use what you&#8217;ve learnt and some new stuff that will introduce you to lessons 6 to 9. Learn it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/342-php-lesson-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 3</title>
		<link>http://blog.eop.org.uk/339-php-lesson-3/</link>
		<comments>http://blog.eop.org.uk/339-php-lesson-3/#comments</comments>
		<pubDate>Wed, 07 Feb 2007 07:56:56 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/339-php-lesson-3/</guid>
		<description><![CDATA[In lesson 2 we touched on variables in PHP and how to create one and then change it via a number of processes. Today we&#8217;re going to use some of the functions that PHP provide which allow us to manipulate and query strings and that will most likely become very handy in the future. If [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />In <a href="http://blog.eop.org.uk/338-php-lesson-2/">lesson 2</a> we touched on variables in PHP and how to create one and then change it via a number of processes. Today we&#8217;re going to use some of the functions that PHP provide which allow us to manipulate and query strings and that will most likely become very handy in the future.</p>
<p>If you wish to take a look at the functions it offers then head on over to the <a href="http://uk.php.net/manual/en/ref.strings.php">PHP Manual</a>, specifically the string functions.</p>
<h5>Lesson 3: String Functions</h5>
<p>Last week we touched on how to find the length of a string using the <strong>strlen()</strong> function. Today we&#8217;re going to look at a few more functions and put them into a practical example. To find the length of a string all we have to do is employ this function as is shown here:</p>
<p><code>&lt;?php<br />
$five = strlen("mouse"); <span style="color:#0cf;">//$five's value is 5</span><br />
$word = "mousemat";<br />
$eight = strlen($word); <span style="color:#0cf;">//$eight's value is 8</span><br />
?&gt;</code></p>
<p>Now we&#8217;re going to look at replacing characters or phrases within a string with something else. To do this in the simplest way we are going to use the <strong>str_replace()</strong> function. There&#8217;s several <strong>parameters</strong> to this function. This means that we have to provide more information within the functions. In this case the format is <strong>str_replace(</strong><em>string to search for</em>, <em>string to replace it with</em>, <em>string to search within</em><strong>)</strong>.</p>
<p><code>$string = "Sunny Man’s Blog";<br />
$string = str_replace("Man","Boy",$string); <span style="color:#0cf;">//replace 'Man' with 'Boy'</span><br />
echo $string; <span style="color:#0cf;">//displays Sunny Boy's Blog</span></code></p>
<p>Later on when we get to talking about SQL and databases you&#8217;ll need to be able to encrypt strings. There are several different types of encryption available in PHP. All of them are simple enough to use but, as we will will discuss later on, knowing when to use the correct one is vital. First let&#8217;s take a look at the different types.</p>
<p><code>$password = md5("password");<br />
echo $password; <span style="color:#0cf;">//5F4DCC3B5AA765D61D8327DEB882CF99</span><br />
<br />$password = sha1("password");<br />
echo $password; <span style="color:#0cf;">//5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8</span></code></p>
<p>Both md5 and sha1 have their advantages and disadvantages but they&#8217;re both quick to generate and once stored in a variable, easy to remember. Say we wanted to take a raw password that was given to us by a form (we&#8217;ll cover this soon), replace the letter &#8216;i&#8217; with &#8216;z&#8217; and encrypt it for storage in a database, this is how we would do it:</p>
<p><code>&lt;?php<br />
$password = "birmingham";<br />
$password = str_replace("i","z",$password);<br />
$password = md5($password);<br />
?&gt;</code></p>
<p>This is the end of lesson 3. In the next lesson we&#8217;ll talk about taking variables from a form, collecting them and manipulating them in a real life situation. After than we&#8217;re going to put all we&#8217;ve learnt into a logging in script in lesson 5 which will introduce you to salts, database queries and some other stuff we will cover in lessons 6 to 10.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/339-php-lesson-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 2</title>
		<link>http://blog.eop.org.uk/338-php-lesson-2/</link>
		<comments>http://blog.eop.org.uk/338-php-lesson-2/#comments</comments>
		<pubDate>Tue, 06 Feb 2007 08:03:30 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/338-php-lesson-2/</guid>
		<description><![CDATA[In a previous post I started you off on the basics of PHP and you managed to get Hello World! displayed on the screen. This lesson we are going to learn about how to create, use and manage variables. Hope you enjoy it&#8230; Lesson 2: Variables Unlike programming languages such as C++, in PHP you [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />In a <a href="http://blog.eop.org.uk/336-php-lesson-1/">previous post</a> I started you off on the basics of PHP and you managed to get <strong>Hello World!</strong> displayed on the screen. This lesson we are going to learn about how to create, use and manage variables. Hope you enjoy it&#8230;</p>
<h5>Lesson 2: Variables</h5>
<p>Unlike programming languages such as C++, in PHP you don&#8217;t have to state what type of variable you&#8217;re creating when you create one. A variable such as <em>$myvar</em> could just as well be a number as it could be a word. It&#8217;s as easy as pie to create different variables:</p>
<p><code>&lt;?php<br />
$age = 15;<br />
$name = "John";<br />
?&gt;</code></p>
<p>Here we created 2 variables: <em>$age</em> and <em>$name</em> which values&#8217; are 15 and &#8216;John&#8217; respectively. It&#8217;s that easy to create variables. Now that we have created variables we can manipulate them. Say for example we wanted to increase the <em>$age</em> variable and assign the new value to <em>$age</em> again, this is what we would add before the end of the script:</p>
<p><code>$age = $age+1;</code></p>
<p>If we now output the <em>$age</em> variable we would find that it displays <strong>16</strong> and not 15.</p>
<p><code>echo $age; <span style="color:#0cf;">//this would display '15'</span></code></p>
<p>We can also attach strings together. Take the <em>$name</em> variable we created earlier. We can take that and also create a last name in a different variable and then string them together to make the <em>$name</em> variable include the first and last name. Here we go:</p>
<p><code>$lastname = "Smith";<br />
$fullname = $name.$lastname; <span style="color:#0cf;">//this would create "JohnSmith"</span><br />
$fullname = $name." ".$lastname; <span style="color:#0cf;">//this would create "John Smith"</span></code></p>
<p>So, let&#8217;s try and put this all together and make a useful program out of it. Here we manipulate the age by turning it into dog years. We also here string the first and last names together and then as a step towards the next lesson we&#8217;ll count the number of characters in the names.</p>
<p><code>&lt;?php<br />
$age = 15;<br />
$firstname = "John";<br />
$lastname = "Smith";<br />
$i = 0; <span style="color:#0cf;">//used later on as a counter</span><br />
<br />$dog = $age*7;<br />
echo "You're ".$age." human years old and ".$dog." dog years!";<br />
echo "&lt;br /&gt;"; <span style="color:#0cf;">//create a new line; just regular html</span><br />
<br />$name = $firstname." ".$lastname;<br />
$i = $i + strlen($firstname); <span style="color:#0cf;">//0 + 4</span><br />
$i = $i + strlen($lastname); <span style="color:#0cf;">//4 + 5</span><br />
echo $name.", you have ".$i." letters in your name!";<br />
?&gt;</code></p>
<p>Try it out and play around with it! Next lesson we&#8217;re going to look at some of the functions we can apply to strings such as getting the length of the string and searching for a specific item within a variable.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/338-php-lesson-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 1</title>
		<link>http://blog.eop.org.uk/336-php-lesson-1/</link>
		<comments>http://blog.eop.org.uk/336-php-lesson-1/#comments</comments>
		<pubDate>Mon, 05 Feb 2007 17:13:18 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/336-php-lesson-1/</guid>
		<description><![CDATA[I&#8217;m going to start producing a few classes for those people who wish to start learning the wonderful programming language of PHP. These will be pretty simple classes and will reach until the end of my knowledge of the language. First, a bit of my experience &#8211; albeit a relatively short one. My History I [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />I&#8217;m going to start producing a few classes for those people who wish to start learning the wonderful programming language of <a href="http://www.php.net/">PHP</a>. These will be pretty simple classes and will reach until the end of my knowledge of the language. First, a bit of my experience &#8211; albeit a relatively short one.</p>
<h5>My History</h5>
<p>I first started to learn PHP 3 years ago and have since then done some things I&#8217;m quite proud of in the language. I&#8217;ve built a system for a hospital in Reading, my own blogging software (although quite simple, it does the job) and also a file directory viewer with AJAX technology. But, my PHP knowledge is quite limited and I have not used the language now for some times as I have been concentrating on the design aspect of the web.</p>
<h5>Lesson 1: Hello World!</h5>
<p>Every programmer starts off with the &#8216;Hello World!&#8217; program. Here we are going to get PHP to output the text &#8216;Hello World!&#8217; to the screen. From this point out I&#8217;ll assume you&#8217;ve installed PHP and have it running on <a href="http://www.apache.org/">Apache</a> or the like.</p>
<p>So, as with any PHP script we have to tell the server it&#8217;s going to be dealing with PHP. So we start it off with the opening and closing tags. All code goes between these tags:</p>
<p><code>&#60;?php<br />
?&#62;</code></p>
<p>Now, as I said all PHP code goes in between these tags. So, now we have to make it do what we want it to do. So, in between those tags we know insert this line of code which tells it to output the text to the screen:</p>
<p><code>echo "Hello World!";</code></p>
<p>Once we&#8217;ve put this all together we should be able to achieve the result we wanted. Try it yourself on your own server! Just save the following code as a .php file and run it!</p>
<p><code>&#60;?php<br />
echo "Hello World!";<br />
?&#62;</code></p>
<p>It&#8217;s going to get a bit more complicated than this, I can assure you. I&#8217;ll post a lesson every weekday &#8211; every Friday we&#8217;ll do a roundup of everything we&#8217;ve learnt!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/336-php-lesson-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

