<?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>Ogremindes.net &#187; TAFE</title>
	<atom:link href="http://ogremindes.net/archive/blog/tafe/feed/" rel="self" type="application/rss+xml" />
	<link>http://ogremindes.net</link>
	<description></description>
	<lastBuildDate>Thu, 18 Feb 2010 21:41:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Internet Database Options</title>
		<link>http://ogremindes.net/blog/internet-database-options/</link>
		<comments>http://ogremindes.net/blog/internet-database-options/#comments</comments>
		<pubDate>Mon, 30 Apr 2007 05:05:52 +0000</pubDate>
		<dc:creator>Ogremindes</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[TAFE]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://ogremindes.net/blog/internet-database-options/</guid>
		<description><![CDATA[There are a number of database management systems (DBMS) suitable for web applications...]]></description>
			<content:encoded><![CDATA[<h3>Database technologies</h3>
<p>There are a number of database management systems (DBMS) suitable for web applications. MySQL is possibly the most ubiquitous, but other DBMS may be better suited for specific applications</p>
<p>MySQL is, as mentioned above, extremely common. It is suitable for most applications because it provides many different ways of storing information. One format may be faster, another may allow for more users at once.</p>
<p>An alternative DBMS is PostgreSQL. PostgreSQL offers more flexibility, and as such has significantly more complexity. It can recognize several different languages for retrieving data, rather than just SQL, and has many object orientated features, such as tables being able to inherit properties of &#8216;parent&#8217; tables.</p>
<p>I, personally, am only familiar with MySQL, and in the rest of this article I&#8217;ll discuss how MySQL works with PHP.</p>
<h3>Connecting to and accessing a database</h3>
<p>In PHP, there are five steps to accessing a database. The first is actually connecting to the host where the database is found. For MySQL the method of connecting follows the form <code>mysql_connect(DB_HOST, DB_USER, DB_PASSWORD)</code>.  DB_HOST being the address where the database is found, DB_USER and DB_PASSWORD being the username and password used in MySQL.</p>
<p>The second part is selecting the database to be used. A particular copy of MySQL can, and probably will be hosting several databases. <code>mysql_select_db(DB_NAME)</code> is how to choose a particular MySQL database, where DB_NAME is the name of the database in question.</p>
<p>The third part is to create a SQL query. SQL, or Structured Query Language is an almost universal way of accessing data from databases. Most types of database use this language, including MySQL, Microsoft Access and many others. The results of the query are usually stored in a variable for later access. <code>$linkresult = mysql_query("SELECT * FROM `links` WHERE `category` = 'games'");</code> is an example of a SQL query being used to access a MySQL database in PHP.</p>
<p>The fourth stage is reading and displaying the results from the query. The following snippet reads off the results and displays them as an HTML list of links with images:</p>
<p><code>            if (mysql_num_rows($linkresult) &amp;gt; 0) {<br />
            while($row = mysql_fetch_object($linkresult)){<br />
                echo "&amp;lt;li&amp;gt;&amp;lt;a href=\"".$row-&amp;gt;url."\"  title=\"".$row-&amp;gt;linkname."\" &amp;gt;&amp;lt;img src=\"img/".$row-&amp;gt;id.".gif\" alt=\"".$row-&amp;gt;linkname."\" /&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;";<br />
            }<br />
            }</code></p>
<p>This is a fairly complicated example, but there are many different ways to display the query results.</p>
<p>Finally, after using the database&#8217;s data, one should clean up after oneself, to free up system resources, and to prevent clashes should you need to run other database queries in the same script. <code>mysql_free_result($linkresult);</code> empties the variable holding the query results.
<p>To summarize, the steps in connecting to and accessing a database are:</p>
<ol>
<li>Connecting to the database host</li>
<li>Selecting the database</li>
<li>Querying the database</li>
<li>Displaying query results</li>
<li>Cleaning up</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ogremindes.net/blog/internet-database-options/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emerging Technologies Research Activity: Gary&#8217;s Email</title>
		<link>http://ogremindes.net/blog/emerging-technologies-research-activity-garys-email/</link>
		<comments>http://ogremindes.net/blog/emerging-technologies-research-activity-garys-email/#comments</comments>
		<pubDate>Thu, 07 Sep 2006 04:52:34 +0000</pubDate>
		<dc:creator>Ogremindes</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[TAFE]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://ogremindes.net/emerging-technologies-research-activity-garys-email/</guid>
		<description><![CDATA[G&#8217;day
Look, I know you people in the IT department don&#8217;t like to be disturbed  , but the MD seems to think that you&#8217;re pretty well-informed...]]></description>
			<content:encoded><![CDATA[<blockquote><p>G&#8217;day</p>
<p>Look, I know you people in the IT department don&#8217;t like to be disturbed <img src='http://ogremindes.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> , but the MD seems to think that you&#8217;re pretty well-informed. We&#8217;re going to need another web-developer in a months time for the Humanet 2.0 project, so I thought I&#8217;d pop this question your direction.</p>
<p>I&#8217;m quite familiar with HTML from my experience on the Humanet project, but oneof our web developers keeps insisting on us using XHTML rather than HTML. He&#8217;s new on the job and so I don&#8217;t want to make a big decision based on a new recruit&#8217;s insistence.</p>
<p>Is XHTML a new language? How does it relate to HTML and why should we use it? And what is the Document Object Model (DOM) that the newby keeps referring to? And finally, how do you keep up with your tech-information? I don&#8217;t have much time, but I want to be able to keep up with developments in the industry, especially new web-standards.</p>
<p>As I said, I do want to look into these things myself, but am quite busy at the moment. It would be extremely helpful if you could answer my questions and provides links so I can find out more over the weekend.</p>
<p>Thanks in advance,<br />
Gary<br />
Project Manager &#8211; Humanet<br />
KorTech Pty. Ltd.</p>
</blockquote>
<p>XHTML is not really a new language. It is basically a simplified version version of HTML that has been modified to follow XML conventions.</p>
<ul>
<li>Many tags that are now superfluous with the use of CSS have been removed in XHTML</li>
<li>XHTML has a more consistent syntax than HTML.
<ul>
<li>All tags must be closed, such as &lt;p&gt;&lt;/p&gt;. If a tag is empty (would have nothing between the opening and closing tags) such as an image tag, it has a closing slash, for example: &lt;img src=&#8221;example.jpg&#8221; /&gt;</li>
<li>Tag attributes always follow the attribute=&#8221;value&#8221; syntax. Some attributes that could be written in a shorthand fashion in HTML cannot in XHTML. For example, what used to be written as &lt;textarea disabled&gt; must be written as &lt;textarea disabled=&#8221;disabled&#8221;&gt; in XHTML.</li>
<li>Tags and their attributes must be written in lower-case in XHTML. HTML allows these to be written in whatever case you like.</li>
</ul>
</li>
<li>In theory, XHTML should be sent to the browser as an XML application. In practice this is almost never done.</li>
</ul>
<p>XHTML is a newer standard, it&#8217;s simpler to write and maintain than HTML and the code written for XHTML tends to be cleaner and lighter. Well written XHTML will be usable on a greater number of devices, as XHTML&#8217;s consist ant syntax means that it can interpreted by less powerful devices, such as mobile phones, which have difficulty getting HTML right.</p>
<p>That said, strict HTML is still a perfectly usable standard to write to, and some purists say it&#8217;s better to use HTML as XHTML should be treated as XML rather than text, and most users (read: those that use Internet Explorer) can&#8217;t use XML pages.</p>
<p>Using XHTML is widely regarded as the better option. Because it&#8217;s cleaner and more consistent it&#8217;s easier to write for and faster for computers to render. Because it&#8217;s based on XML it will be usable well into the future as, well, XML is in almost everything.</p>
<p>HTML vs XHTML Links</p>
<ul>
<li><a href="http://www.w3schools.com/xhtml/xhtml_html.asp" onclick="javascript:urchinTracker ('/outbound/article/www.w3schools.com');">Differences Between XHTML And HTML</a></li>
<li><a href="http://www.webstandards.org/learn/articles/askw3c/oct2003/" onclick="javascript:urchinTracker ('/outbound/article/www.webstandards.org');">HTML Versus XHTML</a></li>
<li><a href="http://www.456bereastreet.com/archive/200606/html_vs_xhtml_on_standards_compliant_websites/" onclick="javascript:urchinTracker ('/outbound/article/www.456bereastreet.com');">HTML vs. XHTML on standards compliant websites</a></li>
</ul>
<p>The DOM (Document Object Model) is a way of referring to any part of a document, such as a web page. &#8216;DOM Scripting&#8217; is basically using JavaScript, although some of the techniques have changed in recent years. It uses the &#8216;dot syntax&#8217;: to refer to the element with the ID &#8216;foo&#8217; I would use the code documet.getElementByID(&#8217;foo&#8217;), for example.</p>
<p>DOM Links</p>
<ul>
<li><a href="http://www.w3.org/DOM/" onclick="javascript:urchinTracker ('/outbound/article/www.w3.org');">Document Object Model</a></li>
<li><a href="http://www.clagnut.com/blog/286/" onclick="javascript:urchinTracker ('/outbound/article/www.clagnut.com');">Discovering DOM scripting</a></li>
</ul>
<p>To keep up with new developments in the industry I follow a wide range of blogs written by high-profile web professionals. Using an &#8216;aggregator&#8217; or RSS reader, ether a web-based one such as <a href="http://www.bloglines.com/" onclick="javascript:urchinTracker ('/outbound/article/www.bloglines.com');">Bloglines</a> or a small program on the computer, one can subscribe to a large number of these sites and see if there are any updates, or even read the posts without having to visit the sites individually.</p>
<p>Aggregator Links</p>
<ul>
<li><a href="http://www.bloglines.com/" onclick="javascript:urchinTracker ('/outbound/article/www.bloglines.com');">Bloglines</a></li>
<li><a href="http://www.solutionwatch.com/501/tracking-the-web-with-single-page-aggregators/" onclick="javascript:urchinTracker ('/outbound/article/www.solutionwatch.com');">Tracking the web with Single Page Aggregators</a></li>
</ul>
<p>Informative Web Design Sites</p>
<ul>
<li><a href="http://www.456bereastreet.com/" onclick="javascript:urchinTracker ('/outbound/article/www.456bereastreet.com');">456 Berea Street</a></li>
<li><a href="http://www.alistapart.com/" onclick="javascript:urchinTracker ('/outbound/article/www.alistapart.com');">A List Apart</a></li>
<li><a href="http://www.zeldman.com/" onclick="javascript:urchinTracker ('/outbound/article/www.zeldman.com');">Jeffrey Zeldman Presents</a></li>
<li><a href="http://www.maxdesign.com.au/" onclick="javascript:urchinTracker ('/outbound/article/www.maxdesign.com.au');">Max Design</a></li>
<li><a href="http://www.thinkvitamin.com/" onclick="javascript:urchinTracker ('/outbound/article/www.thinkvitamin.com');">Vitamin</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ogremindes.net/blog/emerging-technologies-research-activity-garys-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction To Programming: Web Programming Languages &#8212; CGI</title>
		<link>http://ogremindes.net/blog/introduction-to-programming-web-programming-languages-cgi/</link>
		<comments>http://ogremindes.net/blog/introduction-to-programming-web-programming-languages-cgi/#comments</comments>
		<pubDate>Mon, 19 Jun 2006 04:19:00 +0000</pubDate>
		<dc:creator>Ogremindes</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[TAFE]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[cgi]]></category>

		<guid isPermaLink="false">http://ogremindes.net/introduction-to-programming-web-programming-languages-cgi/</guid>
		<description><![CDATA[Common Gateway Interface, or CGI was the first method of server side scripting. It was developed by the NCSA to more easily allow for dynamic applications...]]></description>
			<content:encoded><![CDATA[<p>Common Gateway Interface, or <acronym title="Common Gateway Interface">CGI</acronym> was the first method of server side scripting. It was developed by the <acronym title="National Center for Supercomputing Applications">NCSA</acronym> to more easily allow for dynamic applications. Before <acronym title="Common Gateway Interface">CGI</acronym>, the only way to create, say, a search engine, was to directly alter the code of the web server itself.</p>
<p><acronym title="Common Gateway Interface">CGI</acronym> is not a language unto itself. Rather, it takes the data in the <acronym title="Common Gateway Interface">CGI</acronym> file and inputs it to an external program, which then sends it&#8217;s output back to the server. Any program than can handle the input/output streams used by <acronym title="Common Gateway Interface">CGI</acronym> can be used by the <acronym title="Common Gateway Interface">CGI</acronym> script.
<p>When writing a <acronym title="Common Gateway Interface">CGI</acronym> script you could put all the code you need for the task at hand in the <acronym title="Common Gateway Interface">CGI</acronym> file, much like you would for <acronym title="Hypertext Preprocessor. Or maybe Professional Home Page. Possibly Personal Home Page.">PHP</acronym>. The code would then be sent to an interpreter program to be executed. Alternatively, you could write the program separately and compile it, having only the inputs to activate it in the <acronym title="Common Gateway Interface">CGI</acronym>.</p>
<p>A chief weakness of <acronym title="Common Gateway Interface">CGI</acronym> is that it makes a separate running instance of the program it calls every time it is run. If there are many simultaneous connections this can add up quickly.</p>
<p>Being the first of it&#8217;s kind, <acronym title="Common Gateway Interface">CGI</acronym> is widely used. However, newer sites are not commonly written using <acronym title="Common Gateway Interface">CGI</acronym>, as it is highly inefficient compared to other methods for sever-side scripting.</p>
<ul>
<li>
<a href="http://www.oreilly.com/openbook/cgi/" onclick="javascript:urchinTracker ('/outbound/article/www.oreilly.com');">CGI Programming on the World Wide Web</a>
</li>
<li>
<a href="http://www.wdvl.com/Authoring/CGI/" onclick="javascript:urchinTracker ('/outbound/article/www.wdvl.com');">CGI: The Common Gateway Interface for Server-side Processing</a>
</li>
<li>
<a href="http://modperlbook.org/html/index.html" onclick="javascript:urchinTracker ('/outbound/article/modperlbook.org');">Practical mod_pearl</a>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ogremindes.net/blog/introduction-to-programming-web-programming-languages-cgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction To Programming: Web Programming Languages &#8212; JSP</title>
		<link>http://ogremindes.net/blog/introduction-to-programming-web-programming-languages-jsp/</link>
		<comments>http://ogremindes.net/blog/introduction-to-programming-web-programming-languages-jsp/#comments</comments>
		<pubDate>Thu, 08 Jun 2006 01:21:20 +0000</pubDate>
		<dc:creator>Ogremindes</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[TAFE]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[jsp]]></category>

		<guid isPermaLink="false">http://ogremindes.net/introduction-to-programming-web-programming-languages-jsp/</guid>
		<description><![CDATA[JSP is a server side programming platform developed by Sun Microsystems. It uses the Java programming language for server side scripting...]]></description>
			<content:encoded><![CDATA[<p><acronym title="Java Server Pages">JSP</acronym> is a server side programming platform developed by <a href="http://www.sun.com/" onclick="javascript:urchinTracker ('/outbound/article/www.sun.com');">Sun Microsystems</a>. It uses the Java programming language for server side scripting.</p>
<p>The basis of <acronym title="Java Server Pages">JSP</acronym> is Java Servlets, which was first distributed in 1996. Servlets were not widely used, being difficult to code for and otherwise implement compared to other server-side scripting techniques.</p>
<p>In 1999 <acronym title="Java Server Pages">JSP</acronym> 1.0 was first released, soon followed by 1.1, and then 1.2 in 2001 <acronym title="Java Server Pages">JSP</acronym> still uses Servlets, but now they are created by the server automatically.</p>
<p>There are a number of different <acronym title="Java Server Pages">JSP</acronym>-enabled servers, but an Apache variant called &#8216;<a href="http://tomcat.apache.org/" onclick="javascript:urchinTracker ('/outbound/article/tomcat.apache.org');">Tomcat</a>&#8216; is probably the most significant, as Apache is the most commonly used web server software.</p>
<p>Like <acronym title="Hypertext Preprocessor. Or maybe Professional Home Page. Possibly Personal Home Page.">PHP</acronym>, <acronym title="Java Server Pages">JSP</acronym> takes the form of Java code imbedded in a web document. The <acronym title="Java Server Pages">JSP</acronym> code goes between <code> and &lt;code&gt;%&amp;gt;</code>, the same as  <acronym title="Active Server Pages">ASP</acronym>. A <acronym title="Java Server Pages">JSP</acronym> web page will be suffixed .jsp instead of .html.</p>
<p><acronym title="Java Server Pages">JSP</acronym> is of rapidly rising popularity. It has functionality in excess of that of <acronym title="Hypertext Preprocessor. Or maybe Professional Home Page. Possibly Personal Home Page.">PHP</acronym>, and can be used on a variant of the most popular web server.</p>
<ul>
<li>
<a href="http://www.samspublishing.com/articles/article.asp?p=31072" onclick="javascript:urchinTracker ('/outbound/article/www.samspublishing.com');">Getting Started with JSP</a>
</li>
<li>
<a href="http://raibledesigns.com/page/rd?entry=the_history_of_jsp" onclick="javascript:urchinTracker ('/outbound/article/raibledesigns.com');">Rainle Designs: The History of JSP</a>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ogremindes.net/blog/introduction-to-programming-web-programming-languages-jsp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction To Programming: Web Programming Languages &#8212; ASP</title>
		<link>http://ogremindes.net/blog/introduction-to-programming-web-programming-languages-asp/</link>
		<comments>http://ogremindes.net/blog/introduction-to-programming-web-programming-languages-asp/#comments</comments>
		<pubDate>Thu, 01 Jun 2006 00:45:44 +0000</pubDate>
		<dc:creator>Ogremindes</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[TAFE]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[asp]]></category>

		<guid isPermaLink="false">http://ogremindes.net/introduction-to-programming-web-programming-languages-asp/</guid>
		<description><![CDATA[ASP is a server-side scrpting platform that is used by Windows servers. Like PHP, ASP is used to prepare web pages dynamically before sending them to the browser...]]></description>
			<content:encoded><![CDATA[<p><acronym title="Active Server Pages">ASP</acronym> is a server-side scrpting platform that is used by Windows servers. Like <acronym title="Hypertext Preprocessor. Or maybe Professional Home Page. Possibly Personal Home Page.">PHP</acronym>, <acronym title="Active Server Pages">ASP</acronym> is used to prepare web pages dynamically before sending them to the browser.
<p><acronym title="Active Server Pages">ASP</acronym> was first distributed in 1997 as part of Microsoft&#8217;s Internet Information Server. Various versions of <acronym title="Internet Information Server">IIS</acronym> have been subsequently shipped as part of Windows 98, Windows 2000, and Windows XP Pro.</p>
<p>To call <acronym title="Active Server Pages">ASP</acronym> a programming language would be a misnomer. Rather, <acronym title="Active Server Pages">ASP</acronym> is a platform that interprets scripting done in a number of different languages (by default VBScript, but also others such as JavaScript or JScript) at the server</p>
<p>In an <acronym title="Active Server Pages">ASP</acronym> file, everything written between <code> and &lt;code&gt;%&amp;gt;</code> is executed at the server. A line at the start of the file like <code></code> defines what scripting language the file is using.</p>
<p><acronym title="Active Server Pages">ASP</acronym> is far less popular than <acronym title="Hypertext Preprocessor. Or maybe Professional Home Page. Possibly Personal Home Page.">PHP</acronym>, largely because it only runs on <acronym title="Internet Information Server">IIS</acronym>, which, aside from being only usable on one <acronym title="Operating System">OS</acronym>, is a web platform notorious for being vulnerable to hacker attacks. Additionaly, a new server environment, <acronym title="Active Server Pages">ASP</acronym>.NET, is now being distributed by Microsoft. <acronym title="Active Server Pages">ASP</acronym>.NET is more efficient and powerful, capable of using more languages, such as C.</p>
<ul>
<li>
<a href="http://www.wilsonmar.com/1asp.htm" onclick="javascript:urchinTracker ('/outbound/article/www.wilsonmar.com');">ASP Programming</a>
</li>
<li>
<a href="http://www.codeproject.com/aspnet/Internet_Programming.asp" onclick="javascript:urchinTracker ('/outbound/article/www.codeproject.com');">Internet programming primer (general overview and history of ASP.NET)</a>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ogremindes.net/blog/introduction-to-programming-web-programming-languages-asp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction To Programming: Object Orientated Programming Principles</title>
		<link>http://ogremindes.net/blog/introduction-to-programming-object-orientated-programming-principles/</link>
		<comments>http://ogremindes.net/blog/introduction-to-programming-object-orientated-programming-principles/#comments</comments>
		<pubDate>Tue, 30 May 2006 01:37:58 +0000</pubDate>
		<dc:creator>Ogremindes</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[TAFE]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[oop]]></category>

		<guid isPermaLink="false">http://ogremindes.net/introduction-to-programming-object-orientated-programming-principles/</guid>
		<description><![CDATA[Although I didn&#8217;t know it at the time, my first exposure to OOP was with TADS, a language for developing text-based adventure games...]]></description>
			<content:encoded><![CDATA[<p>Although I didn&#8217;t know it at the time, my first exposure to <acronym title="Object Orientated Programming">OOP</acronym> was with <acronym title="Text Adventure Development System"><a href="http://www.tads.org/" onclick="javascript:urchinTracker ('/outbound/article/www.tads.org');">TADS</a></acronym>, a language for developing text-based adventure games. I didn&#8217;t stick with <acronym title="Text Adventure Development System"><a href="http://www.tads.org/" onclick="javascript:urchinTracker ('/outbound/article/www.tads.org');">TADS</a></acronym> for very long, just for a few weeks between finishing year 12 and getting a copy of <a href="http://www.blizzard.com/diablo2/" onclick="javascript:urchinTracker ('/outbound/article/www.blizzard.com');">Diablo II</a></p>
<p>Object Orientated Programming (<acronym title="Object Orientated Programming">OOP</acronym>) is programming by referring to, well, <em>things</em>.</p>
<p>In regular(linear) programming everything that the program does is laid out by the programmer. In <acronym title="Object Orientated Programming">OOP</acronym>, we have use of <em>objects</em>: self-contained collections of data and instructions.</p>
<p>So, while in linear programming if we wanted to know the length of a string we&#8217;d have to construct a loop to count through each of the letters, in <acronym title="Object Orientated Programming">OOP</acronym> we could call up the &#8216;length&#8217; property of the already-defined string object. The code for counting the letters still exists, but it is inside the string object and the programmer never needs to know how it gets the number. All the programmer needs to know is an what properties an object has, and what it can do: its methods.</p>
<h3>What are Properties and Methods? What&#8217;s the difference?</h3>
<p>The properties of an object are information about it: the colour of a paint or the date of a diary entry would be considered properties of those things. Conversely methods are the things that an object can do: a car can accelerate, an alarm bell can ring.</p>
<p>Let us take, for the purpose of example, a printer:<br />
<img src="http://ogremindes.net/wp-content/uploads/2006/05/lexmark-e321-laser-printer.thumbnail.jpg" alt="lexmark-e321-laser-printer.jpg"></p>
<ul>
<li>
<h4>Properties</h4>
</li>
<li>Paper Left</li>
<li>Ready Status</li>
<li>Power Status (on/off)</li>
<li>Ink Level</li>
</ul>
<ul>
<li>
<h4>Methods</h4>
</li>
<li>Print Single Sided</li>
<li>Print Double Sided</li>
</ul>
<h3>The Dot Syntax</h3>
<p>In many object orientated programming languages the <em>dot syntax</em> is used for referring to objects and their properties and methods. To take the example above, the syntax to refer to the &#8216;Paper Left&#8217; property would be <code>printer.paperLeft</code>. The syntax for telling it to print a document single-sided would be <code>printer.printSingleSided(myDocument)</code>, where myDocument is the document to be printed. Methods always have a pair of brackets at the end, if the method needs information to work then that information is but inside the brackets.</p>
<h3>JavaScript Objects</h3>
<p>JavaScript is an object orientated language, with its own collection of objects. It also uses the <acronym title="Document Object Model">DOM</acronym> to access objects within HTML files.</p>
<p>The variable is one of the most common JavaScript objects. For a variable containing a string called <var>myString</var>, containing the word &#8220;script&#8221; there would be properties such as <code>myString.value</code>, which would be &#8220;script&#8221;, and <code>myString.length</code>, which would be 6. Methods for myString would include <code>toUpperCase()</code>, which converts the letters all to uppercase, and <code>indexOf()</code>, which would give the position of a given letter in the string.</p>
<p>The &#8220;text&#8221; object corresponds to a HTML <code></code>. Properties include <code>disabled</code>, which will either be true, in which case the input is disabled, or false, where the input can be activated, and <code>defaultValue</code>, which is the default text in the input. Methods include <code>focus()</code>, which puts the curser in the input, and <code>blur()</code>, which removes the curser from the input.</p>
<p>The &#8220;image&#8221; object corresponds to a HTML <code>&lt;img /&gt;</code> element. Properties include &#8220;src&#8221;, the source file of the image, &#8220;width&#8221; and &#8220;hight&#8221;. Methods include <code>click()</code>, which has the effect of clicking on the image (for the purposes of an <code>onClick()</code> event, for example).</p>
]]></content:encoded>
			<wfw:commentRss>http://ogremindes.net/blog/introduction-to-programming-object-orientated-programming-principles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction To Programming: General Programming Principles</title>
		<link>http://ogremindes.net/blog/introduction-to-programming-general-programming-principles/</link>
		<comments>http://ogremindes.net/blog/introduction-to-programming-general-programming-principles/#comments</comments>
		<pubDate>Thu, 25 May 2006 00:36:23 +0000</pubDate>
		<dc:creator>Ogremindes</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[TAFE]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://ogremindes.net/introduction-to-programming-general-programming-principles/</guid>
		<description><![CDATA[Why do we even want to learn programming languages for Web Design...]]></description>
			<content:encoded><![CDATA[<h3>Why do we even want to learn programming languages for Web Design?</h3>
<p>While HTML and CSS are the basis for making most web pages, the pages created with these alone are static and incapable of much interactivity. By incorporating other languages such as JavaScript and PHP we can create pages that respond to user input, websites that can be easily updated with new content and other dynamic functionality.</p>
<h3>What is a variable?</h3>
<p>A variable can be thought of as a box with a label. We can put things in said box, and find them again by looking for the label. We do this because if we were to get something and just leave it lying around it&#8217;d get lost and we&#8217;d never find it again. We can change the contents of the box after filling it should we so desire &#8212; if we could not then the box would represent a constant rather than a variable.</p>
<p>In javascript, there are a few kinds of variable. Most sorts of data are stored simply in var. Boolean Variables, Dates and Arrays require a special syntax to use. <code> var myDate = new Date</code> is the syntax for a date variable, and the other special variables follow the same pattern.</p>
<p>In many programming languages the type of data to be stored in a variable must be defined at creation. Unlike javascript, where in most cases the type of data is automatically implied by what you put in the variable, languages such as C++ require you to declare the variable as a data type such as string, integer, or double, amongst others. Those of you who have begun working with Access should find the concept of Data Types familliar.</p>
<h3>What are Control Structures?</h3>
<p>Control Structures are the ways that we can control the flow of a program. Usually a program will go through it&#8217;s instructions one after the other, just reading through the lines in order. With control structures we can make it skip over parts, or go back and do parts over again.</p>
<p>There are two main types of Control Structure: Conditions (such as &#8216;if&#8217; statements) and Loops.</p>
<p>Conditions are used where something should only happen if something else is true (or false). Form validation, where an alert is only given when a field is incorrectly filled (of not filled at all) is one use of a condition.</p>
<p>Loops (alternatively Repetition or Iteration) is used where identical or similar code blocks need to be used many times in a row. Some tasks require many passes to complete, such as sorting a list. These require virtually the same instructions to be run time after time. By using a loop we can have a program keep on going through the same block until the task is complete.</p>
<p>There is a third control structure &#8212; the Jump, which is used to redirect the program to a specific line. It is not used in modern programming &#8212; Conditions and Loops are enough for any program, and Jumps make code <em>much</em> harder to understand.</p>
]]></content:encoded>
			<wfw:commentRss>http://ogremindes.net/blog/introduction-to-programming-general-programming-principles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

