<?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>Ruelicke.net &#187; Coding</title>
	<atom:link href="http://www.ruelicke.net/tag/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ruelicke.net</link>
	<description>...when coding passion, gaming addiction, Internet surfing syndrome and the real life collide...</description>
	<lastBuildDate>Mon, 05 Apr 2010 17:11:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The 6 steps of creating a website</title>
		<link>http://www.ruelicke.net/2008/01/14/the-6-steps-of-creating-a-website/</link>
		<comments>http://www.ruelicke.net/2008/01/14/the-6-steps-of-creating-a-website/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 21:00:38 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[General Tips]]></category>
		<category><![CDATA[Advice]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.ruelicke.net/2008/01/the-6-steps-of-creating-a-website/</guid>
		<description><![CDATA[One of my hobbies, actually my favorite hobby, is to write HTML, CSS and PHP code. Or better: creating websites.
If I&#8217;m not working on an existing website, I like to think about creating a new one. Based on that, I thought it would be interesting to share my personal steps in creating websites, ranging from [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/aaroscape/455035074/" title="The 6 steps of creating a website"><img src="http://www.ruelicke.net/wp-content/uploads/2008/01/6-steps-of-creating-a-website.jpg" alt="The 6 steps of creating a website" title="The 6 steps of creating a website" class="alignleft" /></a><span class="c_letter">O</span>ne of my hobbies, actually my favorite hobby, is to write HTML, CSS and PHP code. Or better: creating websites.</p>
<p>If I&#8217;m not working on an existing website, I like to think about creating a new one. Based on that, I thought it would be interesting to share my personal steps in creating websites, ranging from the first idea to the boredom of just maintaining the final page.</p>
<p>You can devide the whole process in 6 steps:</p>
<ol>
<li>The Idea</li>
<li>Evaluation and Preparation</li>
<li>Creation and Testing</li>
<li>Reviewing and Optimizing</li>
<li>Release</li>
<li>Maintenance</li>
</ol>
<p><span id="more-163"></span></p>
<h3>The Idea</h3>
<p>Before you can start your work you need an idea, if possible a good and unique idea.</p>
<p>If you have no idea, think about what would be useful for you and other people. Have look at existing pages and try to figure out what you would do different, or what you would add/remove to increase the user experience.</p>
<p><strong>I don&#8217;t want to make you copy an existing page</strong>, just try to get an own idea based on an existing website.</p>
<p>Now get the idea on paper and we proceed to step 2:</p>
<h3>Evaluation and Preparation</h3>
<p>Use paper to arrange your idea. Make notes on what you&#8217;ll need when you start working on the new website.<br />
Also, try to come up with a good name and after you got the name have a look for the proper domain. If you have bad luck the domain of your choice is already in use, so make sure you have a few alternatives at the ready.</p>
<p>Then have a look at the exact requirements for your page. Do you need a database? Will it be done using PHP, ASP or any other server side programming language? How much space and traffic will you need? Based on your answers to these questions you may look for a hosting company which offers what you need at a reasonable price (and with a good service).</p>
<p>Maybe you own already a website and intend to use your current web space for the new website. In this case have a look if you need to upgrade to meet the requirements of your new website.</p>
<p>Now get into details of the techniques used. Are there any open source / freeware solutions which can be used and may reduce your own development process?</p>
<p><a href="http://www.flickr.com/photos/shockie/156713983/" title="The 6 steps of creating a website"><img src="http://www.ruelicke.net/wp-content/uploads/2008/01/6-steps-of-creating-a-website-2.jpg" alt="The 6 steps of creating a website" title="The 6 steps of creating a website" class="alignright" /></a>I prefer writing everything on my own, but I slowly get myself to the point where I say &#8220;Why do I have to spent hours to code my feature X while said feature is already available for free?&#8221; Decide on your own if it is better to find an own solution or to use an existing one.</p>
<h3>Creation and Testing</h3>
<p>After you finished your preparation you are good to start writing the page. Usually it is better to have a design right from the beginning. So if you have already a design in mind, create the design before you start coding the back-end of your website.</p>
<p>If you have no real idea I suggest you create at least a developer design and while you are working on the page you also create the final design.</p>
<p>During your work on the website make sure you test it on a regular base or you may have a harder time finding the bugs in your code. I usually test my code as soon as one essential code block is finished. Depending on my speed I&#8217;d say I test it every hour.</p>
<h3>Reviewing and Optimizing</h3>
<p>Actually this runs hand in hand with the previous step, but I separated it to get a little bit more into detail about the meaning of &#8220;reviewing&#8221; and &#8220;optimizing&#8221;.</p>
<p>It is proved that when you are working on a website you will have additional ideas. Maybe you even decide to drop the one or the other part. That&#8217;s where the &#8220;reviewing&#8221; occurs:</p>
<ul>
<li>You learn that idea X sounded great but is not possible to implement.</li>
<li>You learn that idea Y could be changed a little bit.</li>
<li>You have another, additional idea to make your website even better.</li>
</ul>
<p>While you are working on a site you may also learn new things about the coding language you are using. So it is natural that there are things you can (and shall) change to increase the overall performance of the page.</p>
<p>Last but not least, under optimizing I also understand &#8220;SEO&#8221;. Yes, it is a good idea to apply your Search Engine Optimization knowledge to the new website. The new site will definitely have a better start once it is released.</p>
<h3>Release</h3>
<p>Everything is working, there are no bugs left and the design is finished. I guess now it is time to allow the public access the new website.<br />
When I&#8217;m releasing a new website, I tell friends about it. I also make posts on forums and if it fits, as comments on blogs. Sometimes I also write an article on my own blog to raise attention.</p>
<p>Additionally I submit the website to all major search engines.</p>
<h3>Maintenance</h3>
<p>Everything is done. The website is up and running. Only one thing remains: Maintenance.<a href="http://mufflershopinc.e-siteworks.com/nss-folder/pictures/MufflerSHopMaintenanceColor.jpg" title="The 6 steps of creating a website"><img src="http://www.ruelicke.net/wp-content/uploads/2008/01/6-steps-of-creating-a-website-3.png" alt="The 6 steps of creating a website" title="The 6 steps of creating a website" class="alignleft" /></a></p>
<p>Yes, it is probably the most boring if not annoying part but it still has to be done.</p>
<p>Any website needs small, regular updates as previously unknown bugs are discovered, parts of the website get broken or used techniques can be optimized. So here is a list of possible maintenance actions you should take care of regularly:</p>
<ul>
<li><strong>Design Update</strong> &#8211; Any design gets boring after a while. So try to have a new design every 6 months. Depending on the page it may also be enough to change the design once a year.</li>
<li><strong>Bug Fixing</strong> &#8211; Not much to say about it. Just listen to any bug reports and get the bugs out of your code.</li>
<li><strong>Optimization</strong> &#8211; If the site seems to slow down, have a look if there is a section you can optimize. Also, if you learn something new, see if you can apply it to the website</li>
<li><strong>Updates</strong> &#8211; If it is new content or new features, see what you can do to keep your visitors interested</li>
</ul>
<p>My list is far away from being complete but I believe I covered the most essential parts of the maintenance section.<br />
If everything turned out well, your website should be up and running and hopefully you have many visitors. Who knows, maybe it becomes as famous as one of the other big sites on the Internet?</p>
<h3>Wrap Up</h3>
<p>These are my 6 steps. I hope they are somewhat helpful for those who want to create an own website but have no real idea about what the website could be. Keep in mind, these steps work for me and in the basics they reflect standard procedures all designer and programmer go through.</p>
<p>And how do you approach the process of creating a website?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruelicke.net/2008/01/14/the-6-steps-of-creating-a-website/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>C#/C++ &#8211; Hello World!</title>
		<link>http://www.ruelicke.net/2008/01/09/c-sharp-c-plus-plus-hello-world/</link>
		<comments>http://www.ruelicke.net/2008/01/09/c-sharp-c-plus-plus-hello-world/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 07:00:51 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[C#/C++]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[C Plus Plus]]></category>
		<category><![CDATA[C Sharp]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.ruelicke.net/2008/01/c-sharp-c-plus-plus-hello-world/</guid>
		<description><![CDATA[As I have the fortune to learn C#/C++ at school I thought it is a good idea to share what I learned and what I&#8217;m learning. Additionally it helps me to repeat what I learned and I can make sure that I really understood it.
Here we go:
Hello World
At first we need a program which allows [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ruelicke.net/wp-content/themes/ruelicke/images/icon-c-sharp-c-plus-plus.png" alt="C#/C++" title="C#/C++" class="alignleft" /><span class="c_letter">A</span>s I have the fortune to learn C#/C++ at school I thought it is a good idea to share what I learned and what I&#8217;m learning. Additionally it helps me to repeat what I learned and I can make sure that I really understood it.</p>
<p><span class="c_letter">H</span>ere we go:</p>
<h3>Hello World</h3>
<p><span class="c_letter">A</span>t first we need a program which allows us to write and compile C#/C++ code. We are using the <a href="http://www.codegear.com/products/cppbuilder">Borland C++ Builder</a> but as I&#8217;m a fan of open-source programs I&#8217;m training my knowledge using the <a href="http://www.bloodshed.net/devcpp.html">Bloodshed Dev-C++</a> program unless I&#8217;m forced to use Borland.</p>
<p><span class="c_letter">N</span>ow let&#8217;s have a look at our first program.<span id="more-159"></span></p>
<h3>The Code</h3>
<p><code style="background-color:#FFF;color:#000;display:block;padding-left:0.2em;"><br />
<span style="background-color:#FFF;color:#008000;">#pragma hdrstop</span><br />
<span style="background-color:#FFF;color:#008000;">#include &lt;conio.h&gt;</span><br />
<span style="background-color:#FFF;color:#008000;">#include &lt;iostream.h&gt;</span><br />
<span style="background-color:#FFF;color:#5E81BC;font-style:italic;">//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</span><br />
<span style="background-color:#FFF;color:#008000;">#pragma argsused</span><br />
<span style="font-weight:700;">int</span> main(<span style="font-weight:700;">int</span> argc, <span style="font-weight:700;">char*</span> argv[])<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout &lt;&lt; <span style="background-color:#FFF;color:#F00;">"Hello world!"</span>;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getch();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:700;">return</span> <span style="background-color:#FFF;color:#800080;">0</span>;<br />
}<br />
&nbsp;<br />
</code><br />
<span class="c_letter">C</span>opy and paste the code into your C++ program, compile and execute it. A console window should open displaying &#8220;Hello world!&#8221;. Press any key to close the window again.</p>
<p><span class="c_letter">N</span>ow as your program is working, let&#8217;s have a look at the code itself.</p>
<h3>Detailed Explanation</h3>
<p><code style="background-color:#FFF;color:#000;display:block;padding-left:0.2em;"><span style="background-color:#FFF;color:#008000;">#pragma hdrstop</span><br />
[...]<br />
<span style="background-color:#FFF;color:#008000;">#pragma argsused</span><br />
</code><br />
These two lines hide possible error warnings in Borland. The program will even work if you leave them out.</p>
<p><code style="background-color:#FFF;color:#000;display:block;padding-left:0.2em;"><span style="background-color:#FFF;color:#008000;">#include &lt;conio.h&gt;</span><br />
<span style="background-color:#FFF;color:#008000;">#include &lt;iostream.h&gt;</span><br />
</code><br />
<strong>&#8220;conio.h&#8221;</strong> is a library required to create a program which runs in a console window. This &#8220;abbreviation&#8221; means <strong>CON</strong>sole<strong>I</strong>nput<strong>O</strong>utput.</p>
<p><strong>&#8220;iostream.h&#8221;</strong> is a library required to allow the program to output streamed content, also it allows streamed input. This &#8220;abbreviation&#8221; means <strong>I</strong>nput<strong>O</strong>utput<strong>STREAM</strong>.</p>
<p><code style="background-color:#FFF;color:#000;display:block;padding-left:0.2em;"><span style="background-color:#FFF;color:#5E81BC;font-style:italic;">//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -</span><br />
</code><br />
The <strong>&#8220;//&#8221;</strong> allows you to add a single line comment to the code. We use the line &#8220;- &#8211; - -&#8221; to separate the includes from the actual code.</p>
<p><code style="background-color:#FFF;color:#000;display:block;padding-left:0.2em;"><span style="font-weight:700;">int</span> main(<span style="font-weight:700;">int</span> argc, <span style="font-weight:700;">char*</span> argv[])<br />
{<br />
[...]<br />
}<br />
</code><br />
This function is the main function. Inside it you have every code you need to run the program. Later you will learn to create your own functions, so I stop here only stating that this function is always the last one of the whole program. Meaning: It has to stay at the bottom of the whole code.</p>
<p>As <a href="http://www.slevi.net">Slevi</a> outlined in his comment, the &#8220;<span style="font-weight:700;">int</span> argc, <span style="font-weight:700;">char*</span> argv[])&#8221; is used to receive the arguments in case you start the exe via console e.g. &#8220;example.exe foo bar&#8221;. As this is already advanced coding I skip a more detailed description. I&#8217;ll come back to it in a later tutorial.</p>
<p><code style="background-color:#FFF;color:#000;display:block;padding-left:0.2em;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout &lt;&lt; <span style="background-color:#FFF;color:#F00;">"Hello world!"</span>;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getch();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="font-weight:700;">return</span> <span style="background-color:#FFF;color:#800080;">0</span>;<br />
</code><br />
Now we look at the actual code which allows us to display &#8220;Hello world!&#8221; in the console.</p>
<p><strong>&#8220;cout&#8221;</strong> allows you to output any kind of data. In this case it is &#8220;Hello world!&#8221;, later you will also learn about other types of data..</p>
<p><strong>&#8220;&lt;&lt;&#8221;</strong> is a shift operator which moves the output to the console screen. You could say said &#8220;cout&#8221; is the screen and &#8220;Hello world!&#8221; is moved to the screen by the &#8220;&lt;&lt;&#8221;.</p>
<p><strong>&#8220;Hello world!&#8221;</strong> is a so-called string which is displayed in the console. That&#8217;s why it is required to wrap it with the quotation marks.</p>
<p><strong>&#8220;getch()&#8221;</strong> is a function which waits for any kind of user input, basically it waits that the user is pressing any key to continue. We use it here to prevent the console from closing again right after displaying our &#8220;Hello world&#8221;. For the record, this is a solution I was looking for when I tried to learn C++ on my on a couple of years ago. All other tutorials on the Internet did not have this function in the code, leading to an instantly closed console window. Hopefully this tutorial will help other beginners to avoid my problem back then.</p>
<p><strong>&#8220;return 0&#8243;</strong> informs the program that the code has been processed and the console window can be closed, after the mentioned user input. It is not possible to avoid using &#8220;getch()&#8221; and use &#8220;return 1&#8243; instead, as this one will also exit the program.</p>
<h3>Wrap Up</h3>
<p><span>N</span>ow we are finished and got our first program working, if you encounter any kind of problem, leave me a message and I&#8217;ll try to help you.</p>
<p>P.S. Feel free to play around and try different messages just for the fun of it. <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><ins datetime="2008-01-12T20:55:29+00:00">Update:</ins><br />
<span class="c_letter">I</span> just had to add this note about <strong>getch()</strong>:<br />
The getch() function is a C function, but since I&#8217;m writing a C#/C++ tutorial it would be more appropriate to use <strong>cin.get()</strong> instead. It does the same but is the C++ variant of the command. Either method should work and I will get back to cin.get() in one of my next tutorials to make sure that any questions about cin.get() get answered.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruelicke.net/2008/01/09/c-sharp-c-plus-plus-hello-world/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Useful Tools for validating HTML, CSS and Accessibility</title>
		<link>http://www.ruelicke.net/2007/09/15/useful-tools-for-validating-html-css-and-accessibility/</link>
		<comments>http://www.ruelicke.net/2007/09/15/useful-tools-for-validating-html-css-and-accessibility/#comments</comments>
		<pubDate>Sat, 15 Sep 2007 08:00:39 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[General Tips]]></category>
		<category><![CDATA[Advice]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.ruelicke.net/2007/09/useful-tools-for-validating-html-css-and-accessibility/</guid>
		<description><![CDATA[Who doesn&#8217;t know the situation when you release a website and within a short time you get complaints of users with browser X who say that xyz doesn&#8217;t work on the page.
These days there are many browsers out there and of course you can test your page on them if you have the time. Even [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/herbet/16237678/"><img src="http://www.ruelicke.net/wp-content/uploads/2007/09/accessibility.png" alt="Useful Tools for validating HTML, CSS and Accessibility" title="Useful Tools for validating HTML, CSS and Accessibility" class="alignleft" /></a><span class="c_letter">W</span>ho doesn&#8217;t know the situation when you release a website and within a short time you get complaints of users with browser X who say that xyz doesn&#8217;t work on the page.</p>
<p><span class="c_letter">T</span>hese days there are many browsers out there and of course you can test your page on them if you have the time. Even then there is the chance you missed one or two and then you are back at zero. Also, it is possible that a design doesn&#8217;t allow users with a disability to use the page.</p>
<p><strong>So what to do?</strong></p>
<p><span class="c_letter">F</span>irst of all it is a good advise to use valid HTML and CSS. Also make sure you don&#8217;t abuse JavaScript, Flash and Gifs. If you are reading this article, I assume I don&#8217;t have to tell you about these things&#8230;</p>
<p><strong>But how can you validate your HTML, CSS and Accessibility?</strong></p>
<p><span class="c_letter">W</span>ell, I will tell you which tools I&#8217;m using to validate my websites. These tools are not perfect, but if you use them properly you make sure that they cover each others weakness and leaving you with a valid website at the end. Also, there are some things you can&#8217;t validate by using a tool. You need to know the guidelines for <a href="http://www.w3.org/TR/xhtml1/">HTML</a>, <a href="http://www.w3.org/TR/REC-CSS2/">CSS</a> and <a href="http://www.w3.org/TR/WAI-WEBCONTENT/">Accessibility</a> (<a href="http://www.w3.org/TR/WAI-WEBCONTENT/">WCAG</a>)<span id="more-130"></span></p>
<p><img src="http://www.ruelicke.net/wp-content/themes/ruelicke/images/icon-html.png" alt="HTML Validation" title="HTML Validation" class="alignright" /><br />
<h3 style="margin-top:0;padding-top:0;">HTML Validation</h3>
<p><span class="c_letter">M</span>y major validator is the official <a href="http://validator.w3.org/">W3C validator</a>. It is always up-to-date to the latest spec&#8217;s and allows you to either test a page directly if said page is online or you upload/copy the page to the validator. You can reach the validator from any location as long as you are online, which can be very handy.</p>
<p><span class="c_letter">A</span>dditionally I&#8217;m using my Firefox for testing my websites. I have two very powerful extensions installed:</p>
<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/249">HTML Validator</a> by Marc Gueury</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer</a> by Chris Pederick</li>
</ul>
<p><strong><span class="c_letter">T</span>he HTML Validator by Marc Gueury</strong> allows you to validate the page inside the browser without the need to visit a validator page like the W3C validator. The extension has 3 algorithm to validate the page.</p>
<ul>
<li>The &#8220;<em>HTML Tidy</em>&#8221; algorithm is based on the <a href="http://www.w3.org/People/Raggett/tidy/">HTML Tidy from W3C</a></li>
<li>The &#8220;<em>SGML Parser</em>&#8221; is based on the <a href="http://www.w3.org/TR/html4/sgml/intro.html">SGML reference information for HTML</a></li>
<li>The &#8220;Serial&#8221; uses both validator algorithms one after the other.</li>
</ul>
<p><span class="c_letter">T</span>he first algorithm is recommended for all while the other two are recommended for professionals. I myself prefer the Serial algorithm, but I believe you need to test which one works best for you.</p>
<p><strong><span class="c_letter">T</span>he Web Developer tool by Chris Pederick</strong> does not have a built in validator, but it allows you to easily check a page with the W3C validator. Also it allows you to easily disable scripting or it outlines your HTML elements. It has many more options and is also useful for validating your CSS or W3C.</p>
<p><img src="http://www.ruelicke.net/wp-content/themes/ruelicke/images/icon-css.png" alt="CSS Validation" title="CSS Validation" class="alignright" /><br />
<h3 style="margin-top:0;padding-top:0;">CSS Validation</h3>
<p><span class="c_letter">I</span>&#8216;m using the official <a href="http://jigsaw.w3.org/css-validator/">W3C validator</a> for validating my CSS code. It is always up-to-date to the latest spec&#8217;s and allows you to either test a page directly if said page is online or you upload/copy the page to the validator. You can reach the validator from any location as long as you are online, which can be very handy.</p>
<p><span class="c_letter">A</span>dditionally I&#8217;m using the <a href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer toolbar</a>. It allows you to disable CSS if you want to. You can edit the CSS code and see the result without having to edit the original file and upload it again. You can even resize your browser window to test your layout for different resolutions.</p>
<h3 style="margin-top:0;padding-top:0;">Accessibility Validation</h3>
<p><span class="c_letter">W</span>hen writing a website I always rely on the <a href="https://addons.mozilla.org/en-US/firefox/addon/249">HTML Validator</a> extension. It tells you almost everything you need to know.</p>
<p><span class="c_letter">T</span>here are also online validators available, one of them you can easily access with the Web Developer toolbar. If it is not enough, you can always Google for other <a href="http://www.google.com/search?hl=en&#038;q=accessibility+validator&#038;btnG=Google+Search">accessibility validators</a>.</p>
<p><strong>Wrap Up</strong></p>
<p><span class="c_letter">N</span>ow you know which tools I&#8217;m using. I hope these tools will also help you. Or are you using them already? Do you know other tools you can recommend?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruelicke.net/2007/09/15/useful-tools-for-validating-html-css-and-accessibility/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>CSS &#8211; Make your list different</title>
		<link>http://www.ruelicke.net/2007/09/12/css-make-your-list-different/</link>
		<comments>http://www.ruelicke.net/2007/09/12/css-make-your-list-different/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 19:49:22 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.ruelicke.net/2007/09/css-make-your-list-different/</guid>
		<description><![CDATA[If you have a look at my sidebar, you see that my menu options have little dots (or images) to the left. Thanks to CSS, Cascading Style Sheets, you have many options to style your list, ranging from no style to one of the many default styles. You are even able to use an image [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ruelicke.net/wp-content/themes/ruelicke/images/icon-css.png" alt="CSS - Cascading Style Sheets" title="CSS - Cascading Style Sheets" class="alignleft" /><span class="c_letter">I</span>f you have a look at my sidebar, you see that my menu options have little dots (or images) to the left. Thanks to CSS, Cascading Style Sheets, you have many <a href="http://www.w3schools.com/css/css_reference.asp#list">options to style your list</a>, ranging from no style to one of the many default styles. You are even able to use an image of your choice!</p>
<p><strong><span class="c_letter">S</span>o how do you edit and style your list?</strong></p>
<p><span class="c_letter">O</span>f course you are able to use almost any of the available CSS properties, like <a href="http://www.w3schools.com/css/css_reference.asp#border">borders</a>, <a href="http://www.w3schools.com/css/css_reference.asp#background">background</a>, <a href="http://www.w3schools.com/css/css_reference.asp#font">font</a> and so on.</p>
<h3>A list without icons</h3>
<p><span class="c_letter">L</span>et&#8217;s assume you want to use the list to create a menu, but you don&#8217;t want to have the default list icons added by the browser, because it would break with the design. How do you remove the icons? With a tiny bit of CSS of course:<br />
<code><br />
ul, ol {<br />
list-style:none;<br />
}<br />
</code><br />
This code will remove any list style, leaving you a <a href="http://www.ruelicke.net/example/css/tutorial01.html#list-2">list without the list icons</a>. It works for both types of lists, order and unordered. If you prefer using in-line editing, just add a <code>style="list-style:none;"</code> to the &#8220;ul&#8221; or &#8220;ol&#8221; tag and you are set.<span id="more-127"></span></p>
<h3>A list with one of the default icons</h3>
<p><span class="c_letter">N</span>ow let&#8217;s have a look at how we can use one of the many default icons. Please keep in mind that some of those icons are show different in different browsers. I recommend testing them before you use them.</p>
<p><span class="c_letter">B</span>efore we can set an icon, we need to know which icons exist. I took the time and compiled you a list:</p>
<ul>
<li>disc</li>
<li>circle</li>
<li>square</li>
<li>decimal</li>
<li>decimal-leading-zero</li>
<li>lower-roman</li>
<li>upper-roman</li>
<li>lower-alpha</li>
<li>upper-alpha</li>
<li>lower-greek</li>
<li>lower-latin</li>
<li>upper-latin</li>
<li>hebrew</li>
<li>armenian</li>
<li>georgian</li>
<li>cjk-ideographic</li>
<li>hiragana</li>
<li>katakana</li>
<li>hiragana-iroha</li>
<li>katakana-iroha</li>
</ul>
<p><span class="c_letter">A</span>nd before you start yelling at me &#8220;How does those icons look like&#8221; just <a href="http://www.ruelicke.net/example/css/tutorial01.html#list-2">have a look at my example</a> and try them all.</p>
<p><span class="c_letter">T</span>o add one of the icons you can use this code:<br />
<code><br />
ul, ol {<br />
list-style-type:<em>liststyle</em>;<br />
}</code></p>
<p>Replace the <em>liststyle</em> with the name of the icon you want to use. Of course you can also use the in-line style <code>style="list-style-type:<em>liststyle</em>"</code>.</p>
<p><span style="c_letter;">E</span>asy so far, isn&#8217;t it?</p>
<h3>A list with an icon/image of your choice</h3>
<p><span class="c_letter">N</span>ow let&#8217;s go a step further. I believe you can imagine that the default icons limit you in your design efforts. Fortunately CSS enables you to use an own image by using the code:<br />
<code><br />
list-style-image:url(<em>path-to-image</em>);<br />
</code><br />
<span class="c_letter">R</span>eplace the <em>path-to-image</em> with the url to your image. For the image I use in <a href="http://www.ruelicke.net/example/css/tutorial01.html#list-3">my example</a> the path would be:<br />
<em>http://www.ruelicke.net/wp-content/themes/ruelicke/images/feed-icon.png</em></p>
<p><span class="c_letter">Y</span>ou can use any kind of image, but depending on it&#8217;s size you need to play with the padding and font size to make it fit with the list.</p>
<h3>Wrap up</h3>
<p><span class="c_letter">C</span>ongratulation, you are now able to adjust the list style icon to your needs. You no longer need to use <a href="http://www.ruelicke.net/example/css/tutorial01.html#list-1">the default</a> icon.</p>
<p><span class="c_letter">I</span>f you like it fancy, you could <a href="http://www.ruelicke.net/example/css/tutorial01.html#list-5">style the list as I did</a> although I would never use that design. Of course I would never use that one on a site, but I think it is always good to play around with the CSS to get an idea about how it works.</p>
<p><strong>Any questions left?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruelicke.net/2007/09/12/css-make-your-list-different/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>JavaScript &#8211; Playing with a Form</title>
		<link>http://www.ruelicke.net/2007/09/09/javascript-playing-with-a-form/</link>
		<comments>http://www.ruelicke.net/2007/09/09/javascript-playing-with-a-form/#comments</comments>
		<pubDate>Sun, 09 Sep 2007 17:26:24 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.ruelicke.net/2007/09/javascript-playing-with-a-form/</guid>
		<description><![CDATA[I assume you already saw one of those forms which show something like &#8220;Enter query&#8221; in one of the input fields and as soon as you enter a letter or press a key on the keyboard, the &#8220;Enter query&#8221; vanishes.
As I needed such a feature for a project of mine, I decided to write this [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ruelicke.net/wp-content/themes/ruelicke/images/icon-js.png" alt="JS - JavaScript" title="JS - JavaScript" class="alignleft" /><span class="c_letter">I</span> assume you already saw one of those forms which show something like &#8220;Enter query&#8221; in one of the input fields and as soon as you enter a letter or press a key on the keyboard, the &#8220;Enter query&#8221; vanishes.</p>
<p><span class="c_letter">A</span>s I needed such a feature for a project of mine, I decided to write this tutorial to share a couple of techniques you can use for such an interesting form.</p>
<h3><a href="http://www.ruelicke.net/example/javascript/tutorial02.html#form-1">Form #1</a></h3>
<p><span class="c_letter">T</span>he first form has the mentioned feature that removes the text in the input field as soon as you hit a key:<span id="more-123"></span><br />
<code style="text-align:left;">&lt;script type="text/javascript"&gt;<br />
&lt;!--<br />
function clear_input($input)<br />
{<br />
if (document.getElementById($input).value == "Name" || document.getElementById($input).value == "Password")<br />
{<br />
document.getElementById($input).value = '';<br />
};<br />
}<br />
window.onload = document.getElementById("name-1").value="Name";<br />
window.onload = document.getElementById("password-1").value="Password";<br />
//--&gt;<br />
&lt;/script&gt;</code></p>
<p><span class="c_letter">P</span>ut this code at the bottom of the page, <em>replace the getElementByID values and IDs with the ones you are using</em>, then add the event <code style="text-align:left;">onkeypress=""</code> to the input box you want to have using this feature. Inside the <code style="text-align:left;">onkeypress=""</code> you add <code>clear_input('id of the input field');return true;</code>.<br />
For <a href="http://www.ruelicke.net/example/javascript/tutorial02.html#form-1">my example</a> it would be for the &#8220;name&#8221; input field: <code>onkeypress=" clear_input('name-1'); return true;"</code></p>
<p><span class="c_letter">T</span>he &#8220;return true&#8221; is a bug fix for some browsers which won&#8217;t clear the input field as we want it.</p>
<h3><a href="http://www.ruelicke.net/example/javascript/tutorial02.html#form-2">Form #2</a></h3>
<p><span class="c_letter">T</span>his form will check the input data before it submits it:<br />
<code style="text-align:left;">&lt;script type="text/javascript"&gt;<br />
&lt;!--<br />
function check_input()<br />
{<br />
if (document.getElementById("name-2").value != "Name" &#038;&#038; document.getElementById("name-2").value != "" &#038;&#038; document.getElementById("password-2").value != "Password" &#038;&#038; document.getElementById("password-2").value != "")<br />
{<br />
return true;<br />
}<br />
else<br />
{<br />
return false;<br />
}<br />
}<br />
function clear_input($input)<br />
{<br />
if (document.getElementById($input).value == "Name" || document.getElementById($input).value == "Password")<br />
{<br />
document.getElementById($input).value = '';<br />
};<br />
}<br />
window.onload = document.getElementById("name-2").value="Name";<br />
window.onload = document.getElementById("password-2").value="Password";<br />
//--&gt;<br />
&lt;/script&gt;</code></p>
<p><span class="c_letter">A</span>s you see I&#8217;m using the <code>clear_input()</code> function again and added a <code>check_input</code> function. Add <code>onsubmit="return check_input;"</code> to the opening form tag and make sure you are using the right IDs in your script.</p>
<p><span class="c_letter">I</span>f everything is working, your <a href="http://www.ruelicke.net/example/javascript/tutorial02.html#form-2">form should behave like mine</a>.</p>
<h3>Wrap Up</h3>
<p><span class="c_letter">I</span> hope this tutorial gave you an idea or two on how to improve your form a little bit. An idea which just pops up right now is to combine the <code>clear_input</code> method with Ajax to provide search suggestions, if it is a search form. Or you add a check_mail variant which validate an inserted email on the fly.</p>
<p><span class="c_letter">T</span>here are many options. Do you know a special one and have no idea how to achieve it? Or do you want to share an idea or script? I&#8217;m happy about any kind comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruelicke.net/2007/09/09/javascript-playing-with-a-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS &#8211; First letter of a paragraph larger than the others</title>
		<link>http://www.ruelicke.net/2007/09/06/css-first-letter-of-a-paragraph-larger-than-the-others/</link>
		<comments>http://www.ruelicke.net/2007/09/06/css-first-letter-of-a-paragraph-larger-than-the-others/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 21:12:58 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.ruelicke.net/2007/09/css-first-letter-of-a-paragraph-larger-than-the-others/</guid>
		<description><![CDATA[Pro Blog Design had an article about formating blog posts for readability the other day. As we discussed further methods of styling your blog articles, we started talking about &#8220;the concept of making the first letter of a paragraph larger than the others&#8220;.
I then decided to give this technique a try on my blog and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ruelicke.net/wp-content/themes/ruelicke/images/icon-css.png" alt="CSS - Cascading Style Sheets" title="CSS - Cascading Style Sheets" class="alignleft" /><a href="http://www.problogdesign.com"><span class="c_letter">P</span>ro Blog Design</a> had an article about <a href="http://www.problogdesign.com/blog-usability/format-your-posts-for-readability/">formating blog posts for readability</a> the other day. As we discussed further methods of styling your blog articles, we started talking about &#8220;<cite>the concept of making the first letter of a paragraph larger than the others</cite>&#8220;.</p>
<p><span class="c_letter">I</span> then decided to give this technique a try on my blog and we continued talking about it, which helped me to tweak my CSS code to make this &#8220;magic&#8221; happen. The code for this &#8220;magic trick&#8221; was posted as comment, but I think it is better to put it into an extra tutorial article although it is nothing special if you know how to use Cascading Style Sheets.</p>
<p><span class="c_letter">T</span>here are <strong>two methods</strong> to achieve the goal, I will tell you how to do it and mention the advantages and disadvantages.<span id="more-119"></span></p>
<h3>First method</h3>
<p><code>div.entry p:first-letter {<br />
font-size:1.5em;<br />
font-weight:700;<br />
text-transform:capitalize;<br />
}</code></p>
<p><span class="c_letter">T</span>his one will auto-add the &#8220;first letter of a paragraph larger than the others&#8221; effect, which saves you a lot of time. Unfortunately you are not able to not use it in an article. <strong>The effect will be always created.</strong> If you only write articles and it works for your design and style of writing, great! <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span class="c_letter">I</span>n my case I have a problem when I post a story like my <a href="http://www.ruelicke.net/2007/08/star-wars-soldiers-vs-jedi/">Soldiers vs. Jedi</a>. So I had to look for an alternate way.</p>
<h3>Second method</h3>
<p><code>div.entry p span.c_letter {<br />
font-size:1.5em;<br />
font-weight:700;<br />
text-transform:uppercase;<br />
}</code></p>
<p><span class="c_letter">H</span>ow do you enable the effect now?<br />
You just have to wrap a <code>&lt;span class=”c_letter”&gt;</code> around the letter you want to capitalize and you get that effect. This will only work if the span is inside a paragraph:</p>
<p>e.g.:<br />
<code style="text-align:left;">&lt;p&gt;&lt;span class="c_letter"&gt;T&lt;/span&gt;he first letter is huge[…]&lt;/p&gt;</code></p>
<p><span class="c_letter">T</span>his method allows you to decide if you want to have a capital letter or not. However, it requires you to spend some time on wrapping the code around the letter.</p>
<p><span class="c_letter">S</span>o you need to see which method works best for you.</p>
<p><em><strong>#1 Note:</strong> The first method will also edit your older blog posts, so if you don&#8217;t want to &#8220;auto-edit&#8221; them, you should use the second method.</em></p>
<p><em><strong>#2 Note:</strong> Maybe you noticed the <code>text-transform:uppercase;</code> piece in the second method. It means that even a non-capital character will be shown as capital character. I added in case you could use it for <span class="c_letter">highlighting</span> a word without actually writing it in capitals. You may remove it if you don&#8217;t want it</em> <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span class="c_letter">I</span> hope this tutorial was helpful for you. If you have any questions or need help with this, feel free to leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruelicke.net/2007/09/06/css-first-letter-of-a-paragraph-larger-than-the-others/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>JavaScript &#8211; Hello World</title>
		<link>http://www.ruelicke.net/2007/09/03/javascript-hello-world/</link>
		<comments>http://www.ruelicke.net/2007/09/03/javascript-hello-world/#comments</comments>
		<pubDate>Mon, 03 Sep 2007 10:00:11 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.ruelicke.net/2007/09/javascript-hello-world/</guid>
		<description><![CDATA[Unlike my PHP and HTML tutorials this tutorial will be different.
Although I know JavaScript I don&#8217;t use it often because of a few reasons. So I&#8217;m using this &#8220;tutorial&#8221; to
1. refresh my knowledge about JavaScript
and
2. teach you the one or the other useful thing.
Let&#8217;s begin
For this &#8220;tutorial&#8221; you should have some basic understanding about HTML [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ruelicke.net/wp-content/themes/ruelicke/images/icon-js.png" alt="JS - JavaScript" title="JS - JavaScript" class="alignleft" /><span class="c_letter">U</span>nlike my <a href="http://www.ruelicke.net/category/tutorial/php/">PHP</a> and <a href="http://www.ruelicke.net/category/tutorial/html/">HTML</a> tutorials this tutorial will be different.</p>
<p><span class="c_letter">A</span>lthough I know JavaScript I don&#8217;t use it often because of a few reasons. So I&#8217;m using this &#8220;tutorial&#8221; to<br />
<strong>1. refresh my knowledge about JavaScript</strong><br />
and<br />
<strong>2. teach you the one or the other useful thing.</strong></p>
<h3>Let&#8217;s begin</h3>
<p><span class="c_letter">F</span>or this &#8220;tutorial&#8221; you should have some basic understanding about <a href="http://www.ruelicke.net/category/tutorial/html/">HTML</a> and CSS, later it could be useful to know <a href="http://www.ruelicke.net/category/tutorial/php/">PHP</a>, but that&#8217;s some time later&#8230;<span id="more-116"></span></p>
<p><strong><span class="c_letter">T</span>o use JavaScript in an HTML document</strong> you have 2 methods:</p>
<ul>
<li>Using an external JavaScript file.</li>
<li>Having the JavaScript code right on the page.</li>
</ul>
<p><span class="c_letter">W</span>hich method you use is up to you but at the end you need to use more or less same technique to include the JavaScript in the HTML page.<br />
To embed a JavaScript you are using:<br />
<code style="text-align:left;"><br />
&lt;script type="text/javascript"  src="path/to/file"&gt;&lt;/script&gt;<br />
</code><br />
<strong><span class="c_letter">T</span>he above example is used when you have an external javascript file.</strong> Otherwise you will be using this code:<br />
<code style="text-align:left;"><br />
&lt;script type="text/javascript"&gt;<br />
&lt;!--<br />
<em>...javascript code...</em><br />
//--&gt;<br />
&lt;/script&gt;<br />
</code></p>
<p><span class="c_letter">Y</span>ou place this HTML code either in the &lt;head&gt; or &lt;body&gt; part of the page, then you are ready to write your first Javascript script.</p>
<h3>Hello World!</h3>
<p><span class="c_letter">W</span>e want to write our first script and we want to execute it as soon as the page is loaded. The JavaScript event handler we need for this is onload() although we could also do it in a different way.</p>
<p><span class="c_letter">O</span>ur &#8220;hello world&#8221; script will bring up an alert box with the message &#8220;Hello world!&#8221;:<br />
<code style="text-align:left;">&lt;script type="text/javascript"&gt;<br />
&lt;!--<br />
function hello_world()<br />
{<br />
alert("Hello world!");<br />
}<br />
//--&gt;<br />
&lt;/script&gt;<br />
</code><br />
<em>Note: If you are using an external file, just take the javascript inside the html comments and put it into the external file.</em></p>
<p><span class="c_letter">W</span>e got our first function and now we need to call it somehow. As I said already, we will be using the onload() handler.<br />
To make sure that the code works as intended, you have to put the code in the &lt;head&gt; part of your HTML page.<br />
Now add <code>onload="hello_world();"</code> in the opening body tag. Save the page and load it in a browser.<br />
To have a comparison, <a href="javascript:alert('Hello%20world!');">try my &#8220;Hello world&#8221; alert</a>.</p>
<p><strong><span class="c_letter">T</span>he <code>onload()</code> handler is useful, but is often abused.</strong> I recommend you only use it when you have to. Same applies for the <code>alert()</code> message.</p>
<h3>Better &#8220;Hello World!&#8221;</h3>
<p><span class="c_letter">D</span>epending on the amount of your JavaScript code, the page needs longer to load. If you put the code into the head, it will take some time before the visitors see any content of your page. <strong>It is recommended to put the JavaScript into the foot part of the body.</strong><br />
<span class="c_letter">I</span>f you try it, you will see that <code>onload()</code> will not work, so we have to use a different approach:<br />
<code style="text-align:left;">&lt;script type="text/javascript"&gt;<br />
&lt;!--<br />
function hello_world()<br />
{<br />
alert("Hello world!");<br />
}<br />
window.onload = hello_world();<br />
//--&gt;<br />
&lt;/script&gt;<br />
</code><br />
<span class="c_letter">N</span>ow the script will be <strong>executed after everything on the page is loaded</strong>.</p>
<h3>Wrap up and some hints</h3>
<p><span class="c_letter">T</span>his is all I want to teach you for now. Have a look at <a href="http://www.w3schools.com/js/default.asp">w3school&#8217;s JavaScript Tutorial</a> if you can&#8217;t wait to go on with learning JavaScript. Before you visit this page, please <strong>listen to my hints as these are based on my knowledge of coding nice, user-friendly websites</strong>:</p>
<ul>
<li>Never ever use JavaScript to open PopUps <strong><em>without</em></strong> informing the user before.</li>
<li>Only use JavaScript if it increases the experience of the website.</li>
<li>Try to <strong>avoid excessive use of JavaScript</strong> just because you can do that.
<li>Don&#8217;t use JavaScript to &#8220;link&#8221; to another page. It can break the browser history and result in a bad experience of the user.</li>
<li>Never ever use JavaScript to resize the browser window of the user</li>
<li>When using JavaScript, make sure that those who disabled JavaScript won&#8217;t miss parts of the website someone with JavaScript enabled would be able to see.</li>
</ul>
<p><span class="c_letter">I</span> know, if you read this list you will most likely not know how to create the mentioned effects. I suggest you keep this list in mind when I continue with my tutorial because then I will show you some of those things you shouldn&#8217;t do just for the purpose of showing it.</p>
<p><span class="c_letter">I</span> hope you enjoyed this introduction to my JavaScript tutorials. If you want to be informed on the publish of new tutorials, <a href="http://www.ruelicke.net/what-the-heck-is-rss/"><strong>subscribe to my RSS Feed</strong></a> or <a href="http://www.ruelicke.net/mail-subscription/"><strong>sign up for the newsletter</strong></a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruelicke.net/2007/09/03/javascript-hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Standards and Accessibility Guidelines used in a Blog?</title>
		<link>http://www.ruelicke.net/2007/08/29/web-standards-and-accessibility-guidelines-used-in-a-blog/</link>
		<comments>http://www.ruelicke.net/2007/08/29/web-standards-and-accessibility-guidelines-used-in-a-blog/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 18:18:52 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[General Tips]]></category>
		<category><![CDATA[Advice]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://www.ruelicke.net/2007/08/web-standards-and-accessibility-guidelines-used-in-a-blog/</guid>
		<description><![CDATA[The majority of the Internet users should have heard about the World Wide Web Consortium or better known as W3C.
The W3C is the main international standards organization for the World Wide Web (W3). It is arranged as a consortium where member organizations maintain full-time staff for the purpose of working together in the development of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.w3c.org"><img src="http://www.ruelicke.net/wp-content/uploads/2007/08/w3c_home_nb.png" alt="Web 3 Consortium" title="Web 3 Consortium" class="alignleft" /></a>The majority of the Internet users should have heard about the <a href="http://www.w3c.org">World Wide Web Consortium</a> or better known as W3C.<br />
The W3C is the main international standards organization for the World Wide Web (W3). It is arranged as a consortium where member organizations maintain full-time staff for the purpose of working together in the development of standards for the W3.</p>
<p>Or as <a href="http://www.problogdesign.com/">Michael Martin from ProBlogDesign.com</a> described it in his article <a href="http://www.problogdesign.com/general-tips/does-valid-code-help-your-blog/">&#8220;Does Valid Code Help Your Blog?&#8221;</a>:</p>
<blockquote><p>The W3C is the internet’s daddy. They created HTML, CSS, and dozens of other specifications that govern the use of the technologies that makes the internet thrive today. Valid code is code which meets their guidelines, and can be tested in a validator, such as the <a href="http://validator.w3.org/">HTML</a> and <a href="http://jigsaw.w3.org/css-validator/">CSS</a> ones.</p></blockquote>
<p>I don&#8217;t want to discuss if using valid code should be used in a blog or if it is actually helpful for a blog. To be honest, I had it in mind, but somehow <a href="http://www.problogdesign.com">ProBlogDesign.com</a> beat me to it, which is actually helpful because I can skip this part <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>To sum <a href="http://www.problogdesign.com/general-tips/does-valid-code-help-your-blog/">Michael Martin&#8217;s article</a> up I dare to say that it is useful to use valid code, or better: Web Standards, in a blog.<br />
His reasons are all great, but I have to add one more reason why you should use Web Standards: chances are higher that your blog is accessible by all humans, especially those with disabilities.</p>
<p>Less known among the Internet users is the Web Accessibility Initiative (<a href="http://www.w3.org/WAI/">WAI</a>) of the W3C. Although some webmaster and &#8220;webcoder&#8221; know and follow the <a href="http://www.w3.org/WAI/intro/wcag.php">Web Content Accessibility Guidelines</a> (WCAG) put together by the staff of the WAI there are way more webmaster / &#8220;webcoder&#8221; who are not following these guidelines.<span id="more-91"></span></p>
<p>I&#8217;m aware that these guidelines are not a must have for a website, however I try to write templates and websites following the WCAG as closely as possible. I&#8217;m not perfect on this part and I know that my blog template still needs to adjusted to follow the WCAG, but I&#8217;m working on it and I&#8217;m using one of the many <a href="http://www.w3.org/WAI/ER/tools/complete">WAI validators</a>.</p>
<h3>So, why I am talking about the whole accessibility thing?</h3>
<p><a href="http://www.ruelicke.net/2007/08/web-standards-and-accessibility-guidelines-used-in-a-blog/text-only-browser/" rel="attachment wp-att-92" title="Lynx - a Text-Only browser"><img src="http://www.ruelicke.net/wp-content/uploads/2007/08/lynx.thumbnail.png" alt="Lynx - a Text-Only browser" title="Lynx - a Text-Only browser" class="alignright" /></a>As you know, there are many different browsers out there. Most of them showing the nice designed content of your website, however, there are <a href="http://www.google.com/search?q=text+only+browser">text-only browsers</a> like <a href="http://lynx.browser.org/">Lynx</a>. These users won&#8217;t be able to appreciate your nice layout, but they are able to either enjoy your website or just ignore it because of it&#8217;s structure. Have a look at your website without the usage of images and CSS, does the &#8220;layout&#8221; show up in an order which allows you to easily navigate through your page? If not, I&#8217;d guess that text-only browser user will ignore your website.</p>
<p>I&#8217;m aware of the fact that text-only browser users are a minority, on most page statistics they won&#8217;t even show up, but do you really want to loose the  few percent of possible customers?</p>
<p>Aside the text-only browser users there is a minority which most people tend to ignore if not forget. I believe it is really sad and of course wrong.<br />
I&#8217;m talking about people with a disability. Yes, believe me or not, there are people browsing the Internet who are suffering from blindness or they are deaf or they have epilepsy&#8230;I could go on, but I think you get the idea.</p>
<p><img src="http://www.ruelicke.net/wp-content/uploads/2007/08/disabled_blue_badge.thumbnail.png" alt="Disabled People Sign" title="Disabled People Sign" class="alignleft" />It doesn&#8217;t require much additional time to make your template more friendly for this target group. For instance, you can avoid using animated gifs so a visitor with epilepsy can enjoy your website. Also, you can avoid the excessive usage of Flash. I know, there are people who would like to lynch me, but be honest. Can you easily navigate through a flash animation without the usage of a mouse? Not really, additionally the animation could prevent the visitor with epilepsy to visit your website at all. Last but not least, (<em>I&#8217;m pretty sure that I missed many examples</em>) are the people with some kind of color blindness, like the Red-Green-Blindness. If you use a red-green template you should make sure that either the colors are ok for people with red-green blindness or that you have at least an alternate design available.</p>
<p>Everything I mentioned here is my personal opinion. I know that it can be difficult to maintain a accessibility friendly website and I&#8217;m also aware that many major websites like <a href="http://www.amazon.com">Amazon</a> or <a href="http://www.microsoft.com">Microsoft</a> are not accessibility friendly, but maybe you can make a change.</p>
<p>Whenever I discuss this topic with other people, I hear many excuses for not following the WAI. In return, I always have a solid argument against the excuse.</p>
<h3>Bad vs. Good &#8211; The Accessibility Discussion</h3>
<ul>
<li><strong>It will take more time to finish my site!</strong><br />
<em>Not really, if you follow the WCAG right from the beginning, you will be done at the same time as you would without following it.</em></li>
<li><strong>It will make the page more ugly.</strong><br />
<em>Sorry, but you are wrong here. Actually even the average visitor can benefit from the accessibility optimized website because of the clearer navigation and so on&#8230;</em></li>
<li><strong>Those disabled don&#8217;t have to visit my site and/or shouldn&#8217;t use the Internet.</strong><br />
<em>Ignoring the fact that this is really racist, you should keep in mind that one day you could also suffer from some kind of disability. Of course, it is up</em></li>
<li><strong>Major websites like <a href="http://www.amazon.com">Amazon</a> or <a href="http://www.microsoft.com">Microsoft</a> are not following the WCAG either, so why bothering?</strong><br />
<em>True, but you know you could make a change? Just because &#8220;famous&#8221; websites are not following the WCAG doesn&#8217;t mean your website wouldn&#8217;t help to spread the word and encourage other people to optimize their own websites.</em></li>
</ul>
<p>Of course at the end it is your own decision if you try to follow <a href="http://www.w3.org/WAI/intro/wcag.php">the guidelines</a> or not. I myself will continue to optimize my website(s) into this direction.</p>
<p><strong>What about you?</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruelicke.net/2007/08/29/web-standards-and-accessibility-guidelines-used-in-a-blog/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>HTML Tutorial 103: Design with tables and CSS</title>
		<link>http://www.ruelicke.net/2007/07/31/html-tutorial-103-design-tables-css/</link>
		<comments>http://www.ruelicke.net/2007/07/31/html-tutorial-103-design-tables-css/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 22:27:00 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://blog.ruelicke.net/2007/07/31/html-tutorial-103-design-tables-css/</guid>
		<description><![CDATA[You know how to write a valid XHTML document, however, the page is still not as nice looking as ruelicke.net or google.com or any other website out there.
What I teach you today is not how to create a professional website, but it is the basic design method any web programmer started with.
It is the old [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ruelicke.net/wp-content/themes/ruelicke/images/icon-html.png" alt="HTML - HyperText Markup Language" title="HTML - HyperText Markup Language" class="alignleft" />You know <a href="http://www.ruelicke.net/2007/04/html-tutorial-102-tags-validation/">how to write a valid XHTML document</a>, however, the page is still not as nice looking as <a href="http://www.ruelicke.net">ruelicke.net</a> or <a href="http://www.google.com">google.com</a> or any other website out there.</p>
<p>What I teach you today is not how to create a professional website, but it is the basic design method any web programmer started with.<br />
It is the old school table, but I add Cascading Style Sheets (CSS) to the table to get it a nice look.</p>
<p>But before you can start, you need to have an idea how you want to structure your page. The best thing to do is to grab a piece of paper and make a draft. As example I made a draft in a graphic program, although I prefer the paper method:<br />
<a href="http://www.ruelicke.net/2007/07/html-tutorial-103-design-tables-css/draft-for-page/" rel="attachment wp-att-59" title="Draft for a page"><img src="http://www.ruelicke.net/wp-content/uploads/html103_img01.thumbnail.png" alt="Draft for a page" /></a></p>
<p><span id="more-58"></span></p>
<p>Now let&#8217;s think about how to convert the design into HTML&#8230;<br />
You remember reading in the W3Schools reference something about &lt;table&gt;? If not, it is no problem as I explain it now <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>But first let&#8217;s get the basic page code done, which is:<br />
<code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Hello world!&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;</code></p>
<p><code>&lt;/body&gt;<br />
&lt;/html&gt;</code></p>
<p>Now let&#8217;s see how we add the basic structure of the original design by using</p>
<h3>Tables</h3>
<p>To create a HTML table you need the &lt;table&gt;, &lt;tr&gt; and &lt;td&gt; tag. I will post the code I used for the table of my final example page and then I explain you the additional attributes used to modify the table:</p>
<p><code>&lt;table&gt;<br />
         &lt;tr&gt;<br />
            &lt;td colspan="2"&gt;<br />
               Hello World!<br />
            &lt;/td&gt;<br />
         &lt;/tr&gt;<br />
         &lt;tr&gt;<br />
            &lt;td&gt;<br />
               menu<br />
            &lt;/td&gt;<br />
            &lt;td&gt;<br />
               text<br />
            &lt;/td&gt;<br />
            &lt;td rowspan="2"$gt;<br />
            	 whatever<br />
            &lt;/td&gt;<br />
         &lt;/tr&gt;<br />
         &lt;tr&gt;<br />
            &lt;td colspan="2"&gt;<br />
               foot<br />
            &lt;/td&gt;<br />
         &lt;/tr&gt;<br />
      &lt;/table&gt;</code></p>
<p>Put the whole table code inside the body tags and have a look it it. I know it isn&#8217;t looking nice, but we will take care of it later.<br />
So what does the code do&#8230;<br />
<strong>the &lt;table&gt; tag</strong> defines a new table,<br />
<strong>the &lt;tr&gt; tag</strong> defines a new row in the table. If you count our &#8220;&lt;tr&gt;&#8230;&lt;/tr&gt;&#8221; you will count 3 rows,<br />
<strong>the &lt;td&gt; tag</strong> defines a new cell/column in a row. Our first row has one cell/column, the second has 3 cells/columns and the third has one cell/column again.</p>
<p>Please keep the following &#8220;method&#8221; in mind when you build a table. It served me good back when I used tables for layouts:<br />
1. define the table: &lt;table&gt;&lt;/table&gt;<br />
2. count how many rows you need and add them inside the &lt;table&gt; tags: &lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&#8230;<br />
3. have a look at the first row and count how many cells/columns you need. Then insert the amount of cells you need by adding the appropriate code into the &lt;tr&gt;&lt;/tr&gt; tags: &lt;td&gt;&#8230;&lt;/td&gt;&lt;td&gt;&#8230;&lt;/td&gt;</p>
<p>If you used the above method you will see that our table doesn&#8217;t work as intended if we use my draft. So here we are using those attributes I have in my sample code already:<br />
<strong>rowspan</strong> tells the browser if a cell is stretched over multiple rows. In my example the third cell of the second row stretches over 3 rows, so we are using rowspan=&#8221;3&#8243;<br />
<strong>colspan</strong> tells the browser if a cell is stretched over multiple cells/columns. The cells of the first and the third row in our example are stretched over 2 cells/columns, meaning that the cells of the first and third row are as long as the 2 cells of the second row. We use colspan=&#8221;2&#8243; here to achieve the proper behavior.<br />
I assume it is difficult to visualize, so let me try to explain it in a different way:<br />
<strong>rowspan</strong> stretches a cell vertical while the <strong>colspan</strong> stretches a cell horizontal.</p>
<p>Now as our table is behaving the way we want it to, it is time to add some optical</p>
<h3>design with <abbr title="Cascading Style Sheets">CSS</abbr></h3>
<p>For a <a href="http://www.w3schools.com/css/css_reference.asp">full list of <abbr title="Cascading Style Sheets">CSS</abbr> properties</a> <a href="http://www.w3schools.com">visit the w3schools website</a></p>
<p>Let me show you the code of the final result of my example, using what we have learned and updated with the <abbr title="Cascading Style Sheets">CSS</abbr> I want to teach you:</p>
<p><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;<br />
&lt;html&gt;<br />
   &lt;head&gt;<br />
      &lt;title&gt;<br />
         Hello World<br />
      &lt;/title&gt;<br />
   &lt;/head&gt;</p>
<p>   &lt;body style="background:#333333;color:#FFFFFF;"&gt;</p>
<p>      &lt;table  style="background:#222222;border:1px solid #555555;width:100%;"&gt;<br />
         &lt;tr&gt;<br />
            &lt;td style="background:#999999;border:1px solid #555555;font-size:50px;font-weight:700;width:auto" colspan="2"&gt;<br />
               Hello World!<br />
            &lt;/td&gt;<br />
         &lt;/tr&gt;<br />
         &lt;tr&gt;<br />
            &lt;td style="background:#990000;border:1px solid #555555;font-size:12px;font-weight:700;text-align:right;vertical-align:top;width:180px;"&gt;<br />
               &lt;a href="http://www.ruelicke.net/2007/04/html-tutorial-101-basics/" style="color:#00FFFF;"&gt;HTML Tutorial 101:&lt;br /&gt;Basics&lt;/a&gt;<br />
               &lt;br /&gt;&lt;br /&gt;<br />
               &lt;a href="http://www.ruelicke.net/2007/04/html-tutorial-102-tags-validation/" style="color:#FFFF00;text-decoration:overline;"&gt;HTML Tutorial 102:&lt;br /&gt;Tags and Validation&lt;/a&gt;<br />
               &lt;br /&gt;&lt;br /&gt;<br />
               &lt;a href="#"&gt;HTML 103&lt;/a&gt;<br />
               &lt;br /&gt;<br />
            &lt;/td&gt;<br />
            &lt;td style="background:#009900;border:1px solid #555555;text-align:left;vertical-align:top;width:auto;"&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
               &lt;br /&gt;<br />
               This is my first website.<br />
            &lt;/td&gt;<br />
            &lt;td rowspan="2" style="width:50px;"&gt;<br />
            	 right tab, covering all 3 rows<br />
            &lt;/td&gt;<br />
         &lt;/tr&gt;<br />
         &lt;tr&gt;<br />
            &lt;td style="background:#999999;border:1px solid #555555;font-size:6px;font-weight:700;text-align:center;width:auto" colspan="2"&gt;<br />
               Goodbye World!<br />
            &lt;/td&gt;<br />
         &lt;/tr&gt;</p>
<p>      &lt;/table&gt;</p>
<p>   &lt;/body&gt;<br />
&lt;/html&gt;<br />
</code></p>
<p>I know the code is a mess on here, so I recommend you copy and paste it into a text editor to have a proper look at it <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Let&#8217;s start with the body tag. You see the attribute &#8220;style&#8221; which tells the browser that inside this attribute you are using <abbr title="Cascading Style Sheets">CSS</abbr> to modify how the page is displayed.</p>
<p><strong>background</strong> let you change the background color of the overall website. You need to use <a href="http://html-color-codes.com/">hexadecimal colors</a> although there are also named colors, like yellow or black. I recommend you <a href="http://www.google.com/search?hl=en&#038;q=hexadecimal+color">use Google to find more informations about hexadecimal colors.</a><br />
<strong>color</strong> let you change the font color of the overall website. The same as for the background color applies.</p>
<p>I also added the style attribute to the table tag as I wanted to change the style of the table. I also wanted to make the table stretch over the whole width of the browser window.</p>
<p><strong>border</strong> let you create a border around the table. I decided to use a solid 1px width border and gave it a grey color. There are some more border styles, so <a href="http://www.w3schools.com/css/css_reference.asp#border">visit the CSS reference</a> <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<strong>width</strong> let you define how broad the table is. In my case I used 100% which means that the table fills the whole browser window. Alternately you can use pixel to give a fixed size, like 800px or what you like.</p>
<p>To manipulate the style inside or of a cell itself, you again add the style attribute. Basically you can add the style attribute to any tag, except the closing tag of a tag of course.<br />
So, what did I do to my cells:</p>
<p>the cell of the first row got a<br />
<strong>font-size</strong> of 50px, which means that the size of the displayed font is 50px.<br />
The <strong>font-weight</strong> of 700 displays the text as bold.</p>
<p>the text in the first cell of the second row got<br />
aligned to the right with the proprietary: <strong>text-align</strong>. Additional to &#8220;right&#8221; you can use &#8220;center&#8221; and &#8220;left&#8221;.<br />
<strong>vertical-align:top;</strong> aligns the whole text in the cell to the top of the cell as our second cell, the one with the in it, is a lot longer. Wouldn&#8217;t we set it to the top, it would be vertical aligned in the middle, as it happens in the third cell. There are <a href="http://www.w3schools.com/css/pr_pos_vertical-align.asp">a few more vertical align behaviors</a>, <a href="http://www.w3schools.com/css/pr_pos_vertical-align.asp">have a look at them</a> and play around <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I also changed the color of the links in the cell and used <a href="http://www.w3schools.com/css/pr_text_text-decoration.asp"><strong>text-decoration</strong></a> to show you that you can change a lot more with the right style proprietaries.</p>
<p>The other cells and rows got style proprietaries I explained earlier. I just used different colors to show you how the table layout looks like, so you can compare what the attributes are doing with a cell or row or the table&#8230;</p>
<p>I hope you understood everything, so <a href="http://www.ruelicke.net/example/html/tutorial103.html">have a look at my example page</a>.<br />
If you are not able to get your page working the way you want, feel free to use the comment section to ask for help.</p>
<p>Right now I have no idea what I will do in the next tutorial, so it will be a surprise. Meanwhile, use and train what you have learned. <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruelicke.net/2007/07/31/html-tutorial-103-design-tables-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Tutorial 102: Manipulating Variables and doing Mathematics</title>
		<link>http://www.ruelicke.net/2007/04/28/php-tutorial-102-variables-mathematics/</link>
		<comments>http://www.ruelicke.net/2007/04/28/php-tutorial-102-variables-mathematics/#comments</comments>
		<pubDate>Sat, 28 Apr 2007 18:27:21 +0000</pubDate>
		<dc:creator>Marco</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://blog.ruelicke.net/2007/04/28/php-tutorial-102-variables-mathematics/</guid>
		<description><![CDATA[Now, after we learned how to show content and also had a first glance at variables, we will now go a step further.
To define a variable in PHP you just need to use $ and a variable name: $variable.
You can use as variable name whatever you like, however you are not allowed to let it [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.ruelicke.net/wp-content/themes/ruelicke/images/icon-php.png" alt="PHP - Hypertext PreProcessor" title="PHP - Hypertext PreProcessor" class="alignleft" />Now, after we learned <a href="http://www.ruelicke.net/2007/04/php-tutorial-101-hello-world/">how to show content</a> and also had a first glance at variables, we will now go a step further.</p>
<p>To define a variable in PHP you just need to use $ and a variable name: <code>$variable</code>.<br />
You can use as variable name whatever you like, however you are not allowed to let it start with a number, like <code>$1variable</code> and there are also some predefined variables, about which I will talk later.</p>
<p>There are many types of variables, but for now we concentrate on 4 types (actually 5, but the fifth will follow in another tutorial).<span id="more-13"></span></p>
<p>So, which 4 types do we have?</p>
<p><strong>string</strong><br />
e.g. <code>$string = "This is a string";</code></p>
<p><strong>boolean</strong><br />
e.g. <code>$boolean = True;</code></p>
<p><strong>integer</strong><br />
e.g. <code>$integer = 123456;</code></p>
<p><strong>float</strong><br />
e.g. <code>$float = 1.234;</code></p>
<p>so, let&#8217;s make a script where can play a bit with those variables:</p>
<p><code>&lt;?PHP<br />
$string= "This is a string"; // String<br />
$string_alt= 123456; // String<br />
$boolean= True; // Boolean<br />
$integer= 123456; // Integer<br />
$float= 1.234; // Float</code></p>
<p><code>print 'The variable "$string" has the type of: '.gettype($string).'&lt;br /&gt;';<br />
print 'The variable "$string_alt" has the type of: '.gettype($string_alt).'&lt;br /&gt;';<br />
print 'The variable "$boolean" has the type of: '.gettype($boolean).'&lt;br /&gt;';<br />
print 'The variable "$integer" has the type of: '.gettype($integer).'&lt;br /&gt;';<br />
print 'The variable "$float" has the type of: '.gettype($float);<br />
?&gt;</code></p>
<p>Run this script and the gettype() function will tell you which type a variable has.<br />
If you have a look at the output, you will see a mistake. Isn&#8217;t &#8220;$string_alt&#8221; supposed to have the type &#8220;string&#8221;?<br />
Yes, it is supposed to be a string, however, PHP does not know that your number shall be a string. So how can fix this problem?<br />
It is quite easy, just add <code>(string)</code> infront of it, so it looks like <code>$string_alt= (string) 123456; // String</code>.</p>
<p>Everything should be fine now, you could even turn the string back to integer, just add (integer) again:<br />
<code>&lt;?PHP<br />
$string_alt= (string) 123456; // String</code></p>
<p><code>print 'The variable "$string_alt" has the type of: '.gettype($string_alt).'&lt;br /&gt;';</code></p>
<p><code>$string_alt = (integer )$string_alt; // convert to Integer<br />
print 'The variable "$string_alt" has the type of: '.gettype($string_alt);<br />
?&gt;</code></p>
<p>What we did here is called &#8220;type casting&#8221; and it is always useful if you have script where you need to change the variable type to prepare it for a special function or whatever you plan to do with it. You can find a complete list of the type casting in the <a href="http://php.net/manual/en/language.types.type-juggling.php#language.types.typecasting">PHP documentation at the official website.</a></p>
<p>Type casting is not the only thing you can do variables. You can also add $variable1 at the end (or beginning) of $variable2:</p>
<p><code>&lt;?PHP<br />
$start = "The little brown fox ";<br />
$end = "jumped over the green fence.";</code></p>
<p><code>$start_merge = $start;<br />
$start_merge .= $end; // adds behind the existing content</code></p>
<p><code>print 'Start sentence: '.$start.'&lt;br /&gt;';<br />
print 'End sentence: '.$end.'&lt;br /&gt;&lt;br /&gt;';<br />
print 'Correct sentence: '.$start_merge.'&lt;br /&gt;';<br />
print 'Correct sentence: '.$start.$end.'&lt;br /&gt;';<br />
?&gt;</code></p>
<p>As you will see our sentence will be shown in different ways. So let us have a closer look at the code itself:<br />
The &#8220;.=&#8221; means, that the variable which shall be added to another one will be added at the end of the other variable<br />
The &#8220;$start.$end&#8221; looks, familiar, doesn&#8217;t it? I mentioned it in <a href="http://www.ruelicke.net/2007/04/php-tutorial-101-hello-world/">PHP Tutorial 101: Hello World!</a> and the same behavior you see there also happens here.</p>
<p>Before I go on with some mathematical things we can do, I will tell you about the &#8220;//&#8221; I added to the code because I assume you are wondering what it means <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
The double-slashes only exclude a comment of the code. Beside the &#8220;//&#8221; you can also use &#8220;/* comment */&#8221; and &#8220;#&#8221;<br />
The &#8220;//&#8221; comment will end either at the end of the line of code where it is placed; Everything on the same line and behind of the slashes belong to the comment.<br />
The &#8220;/* comment */&#8221; starts at &#8220;/*&#8221; and ends at &#8220;*/&#8221; no matter if there are multiple lines of code or not.<br />
The &#8220;#&#8221; comment behaves like the &#8220;//&#8221; comment.</p>
<p>So, as we have this explained, I&#8217;m able to use more comments in the code and avoid longer &#8220;outside of code&#8221; explanations <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Now let&#8217;s do some mathematics!</p>
<p>With PHP (as with any other programming language) you are able to make all kind mathematic calculations. For this tutorial, I only stick to the most basic mathematic functions and refer you to the <a href="http://php.net/manual/en/ref.math.php">PHP Manual: Mathematical Functions</a></p>
<p>We will use the following script as a start for some calculations:<br />
<code>&lt;?PHP<br />
$a = 5;<br />
$b = 2.3;<br />
$c = -6;<br />
$d = 100;</code></p>
<p><code>$ad = $a + $d; // Adds $d to $a<br />
$da = $a - $d; // Subtracts $d from $a<br />
$bc = $b / $c; // Divides $b through $c<br />
$dc = $d * $c; // Multiplies $b with $c</code></p>
<p><code>print $a.' + '.$d.' = '.$ad.'&lt;br /&gt;';<br />
print $a.' - '.$d.' = '.$da.'&lt;br /&gt;';<br />
print $b.' / '.$c.' = '.$bc.'&lt;br /&gt;';<br />
print $d.' x '.$c.' = '.$dc.'&lt;br /&gt;';<br />
?&gt;</code></p>
<p>We just did the basic mathematic calculations you and I think it is self-explanatory, so let&#8217;s have a look how we can get a random number, divide it by another random number and make sure the result is rounded to 2 decimal places, if it is a floating number:<br />
<code>&lt;?PHP<br />
$random_a = rand(1,1000); // get a random number between 1 and 1000<br />
$random_b = rand(500,1500); // get a random number between 500 and 1500</code></p>
<p><code>$random = $random_a / $random_b;<br />
$random_round = round($random,2); // rounds result to 2 decimal places</code></p>
<p><code>print 'First random number is: '.$random_a.'&lt;br /&gt;<br />
Second random number is: '.$random_b.'&lt;br /&gt;<br />
Result is: '.$random.'&lt;br /&gt;<br />
Rounded result is: '.$random_round;<br />
?&gt;</code></p>
<p>Of course there are way more things you can do, but I think this is enough for mathematics. I recommend you have a look at the <a href="http://php.net/manual/en/ref.math.php">PHP Manual: Mathematical Functions</a> and play around because it is proved that you learn much more by the &#8220;Trial and Error&#8221; concept that any other Tutorial.<br />
A tutorial is always a start, but you really learn something by doing it on your own. So use the time to the next tutorial by training what you have learned. <img src='http://www.ruelicke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><ins datetime="2007-07-29T20:49:05+00:00">Update:</ins> <a href="http://www.ruelicke.net/example/php/tutorial102.php">Here you see a page with the results of the code used in this tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruelicke.net/2007/04/28/php-tutorial-102-variables-mathematics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
