<?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>words &#187; web stuff</title>
	<atom:link href="http://www.pzed.ca/words/category/libraries/music-2/web-stuff/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pzed.ca/words</link>
	<description>what do you read, m'lord?</description>
	<lastBuildDate>Sun, 11 Jul 2010 11:10:49 +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>music stuff, bookmarked for later</title>
		<link>http://www.pzed.ca/words/2010/03/09/music-stuff-bookmarked-for-later/</link>
		<comments>http://www.pzed.ca/words/2010/03/09/music-stuff-bookmarked-for-later/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 19:56:29 +0000</pubDate>
		<dc:creator>pzed</dc:creator>
				<category><![CDATA[libraries]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[web stuff]]></category>

		<guid isPermaLink="false">http://www.pzed.ca/words/?p=394</guid>
		<description><![CDATA[How to Digitize an LP
Streaming audio on GNU/Linux
Audacity
Gnome Wave Cleaner
icecast.org
and many more software links at Wikipedia: List of Linux audio software
]]></description>
			<content:encoded><![CDATA[<p><a href="http://internetarchive.wordpress.com/2008/06/19/how-to-digitize-a-lp/">How to Digitize an LP</a><br />
<a href="http://www.linux.ie/articles/streamingaudio.php">Streaming audio on GNU/Linux</a></p>
<p><a href="http://audacity.sourceforge.net/">Audacity</a><br />
<a href="http://sourceforge.net/projects/gwc/">Gnome Wave Cleaner</a><br />
<a href="http://www.icecast.org/index.php">icecast.org</a></p>
<p>and many more software links at Wikipedia: <a href="http://en.wikipedia.org/wiki/List_of_Linux_audio_software">List of Linux audio software</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pzed.ca/words/2010/03/09/music-stuff-bookmarked-for-later/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL and PHP</title>
		<link>http://www.pzed.ca/words/2008/01/30/mysql-and-php/</link>
		<comments>http://www.pzed.ca/words/2008/01/30/mysql-and-php/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 17:49:00 +0000</pubDate>
		<dc:creator>pzed</dc:creator>
				<category><![CDATA[libraries]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[web stuff]]></category>

		<guid isPermaLink="false">http://www.pzed.ca/words/archives/2008/mysql-and-php/</guid>
		<description><![CDATA[I learned some SQL a few years ago, and with a refresher find that it&#8217;s fairly straightforward. And of course the nice thing about scripting your queries is that you can test them until they&#8217;re correct, and then forget about them.
Integrating this into PHP is still a bit of a challenge for me after, what, [...]]]></description>
			<content:encoded><![CDATA[<p>I learned some SQL a few years ago, and with a refresher find that it&#8217;s fairly straightforward. And of course the nice thing about scripting your queries is that you can test them until they&#8217;re correct, and then forget about them.</p>
<p>Integrating this into PHP is still a bit of a challenge for me after, what, a day-and-a-half of trying? Things to remember:</p>
<ul>
<li>Five basic steps to querying</li>
<ol>
<li>Open the database connection</li>
<li>Select the database (it seems to me these first two have been combined in PHP&#8217;s mysqli functions, but I&#8217;m using a slightly older text)</li>
<li>Run the query</li>
<li>Fetch the query results into an array</li>
<li>Format and print the results</li>
</ol>
<li>Steps one through three require error handling</li>
<li>The array that&#8217;s created in step three is an associative array in which the field name given in the query corresponds to the data returned. The array is processed one row at a time. There&#8217;s no need to include the table name, because the array corresponds to the query structure, rather than the table structure. This is easy to visualize if you think of the table that is displayed when a query is run from the mysql command prompt.</li>
</ul>
<p>So it&#8217;s fairly simple to generate a flat html table from data that exist across multiple database tables. I&#8217;d like to figure out how to generate not-so-flat data; for example, suppose (just suppose) I had a database in which a number of books are stored in one table, and their chapters are stored in another. I&#8217;d like an output that would list the book, then the contents, for each book. The simple approach described above won&#8217;t do it. Maybe in another day-and-a-half this too will seem simple, but right now I just can&#8217;t quite figure it out.</p>
<p class="cited">Williams, Hugh E. and David Lane. <em>Web Database Applications with PHP and MySQL.</em> Sebastapol, CA: O&#8217;Reilly, 2004.
<p/>
]]></content:encoded>
			<wfw:commentRss>http://www.pzed.ca/words/2008/01/30/mysql-and-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a quick note</title>
		<link>http://www.pzed.ca/words/2008/01/25/a-quick-note/</link>
		<comments>http://www.pzed.ca/words/2008/01/25/a-quick-note/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 14:28:44 +0000</pubDate>
		<dc:creator>pzed</dc:creator>
				<category><![CDATA[libraries]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[web stuff]]></category>

		<guid isPermaLink="false">http://www.pzed.ca/words/archives/2008/a-quick-note/</guid>
		<description><![CDATA[-&#62; means &#8220;is being passed to.&#8221; 
I&#8217;m sure I whipped right past this yesterday, but it makes sense to me now. The books I&#8217;m working through are both read to go to MySQL, but I don&#8217;t think I am. For most of the last two days I haven&#8217;t had access to the internet, so I [...]]]></description>
			<content:encoded><![CDATA[<p><code>-&gt;</code> means &#8220;<a href="http://us.php.net/manual/en/language.oop5.basic.php">is being passed to</a>.&#8221; </p>
<p>I&#8217;m sure I whipped right past this yesterday, but it makes sense to me now. The books I&#8217;m working through are both read to go to MySQL, but I don&#8217;t think I am. For most of the last two days I haven&#8217;t had access to the internet, so I put aside my music library reading to focus on the basics of PHP. These are, of course, related, and I soon have to get back the the music stuff. I want to keep at the PHP, though. It&#8217;s straightforward enough, but there are some conceptual aspects that I&#8217;m struggling with a bit, and I think another day&#8217;s immersion will do the trick.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pzed.ca/words/2008/01/25/a-quick-note/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>includes and functions</title>
		<link>http://www.pzed.ca/words/2008/01/24/includes-and-functions/</link>
		<comments>http://www.pzed.ca/words/2008/01/24/includes-and-functions/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 20:55:14 +0000</pubDate>
		<dc:creator>pzed</dc:creator>
				<category><![CDATA[libraries]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[web stuff]]></category>

		<guid isPermaLink="false">http://www.pzed.ca/words/archives/2008/includes-and-functions/</guid>
		<description><![CDATA[includes

the usefulness of reusing code should be obvious to everyone!
require() and include() call code from a file
the main difference is that if something goes wrong, require() will return a fatal error, include() will only give a warning
data need not be passed to the include because it is inserted in the code and executed as if [...]]]></description>
			<content:encoded><![CDATA[<h3>includes</h3>
<ul>
<li>the usefulness of reusing code should be obvious to everyone!</li>
<li><em>require()</em> and <em>include()</em> call code from a file</li>
<li>the main difference is that if something goes wrong, require() will return a fatal error, include() will only give a warning</li>
<li>data need not be passed to the include because it is inserted in the code and executed as if present all along (I think)</li>
<li>it&#8217;s a good idea to store include files outside the document tree, making them invisible to internet interlopers</li>
</ul>
<h3>functions</h3>
<ul>
<li>&#8220;A function is a self-contained module of code that prescribes a calling interface, performs some task, and optionally returns a result&#8221;</li>
<li>a library of user-defined functions can be stored in an include file</li>
<li>data must be passed to a function using a parameter (see &#8220;scope&#8221;, below)</li>
<li>user-defined functions must be declared, e.g.</li>
<p><code>&nbsp;&nbsp;function say_hi()<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;echo 'hi';<br />
&nbsp;&nbsp;}</code></p>
<li>function names can only contain letters, digits, underscores; cannot begin with a digit; and cannot be the same as an existing function name</li>
</ul>
<h3>scope</h3>
<ul>
<li>scope controls where a variable is visible and useful</li>
<li>variables declared inside a function are in scope from the declaration until the function&#8217;s end brace; this is <em>function scope</em>, the variables are <em>local variables</em></li>
<li>variables declared outside functions are in scope from the declaration to the end of the file, but not inside functions; this is <em>global scope</em>, the variables are <em>global variables</em></li>
<li>if a require() or include() statement is used within a function, function scope applies; if not, global</li>
<li>the keyword <em>global</em> can be used to give a variable defined within a function global scope</li>
<li>to allow functions to operate on global variables, use a <em>pass by reference</em>; the function receives a reference to the original variable, and any modifications performed on the reference are also performed on the original</li>
<li>a pass by reference is created by prefixing an ampersand to the variable name in the function&#8217;s parameter list</li>
<li>the <em>return</em> keyword can be used to stop a function, usually in response to some condition; return can also be used to return a value</li>
<li>it is possible to call a function recursively, but this seems dangerous and doesn&#8217;t appear to have many benefits</li>
</ul>
<p class="cited">Welling, Luke and Laura Thomson. <em>PHP and MySQL Web Development.</em> 2nd ed. Indianapolis: Sam&#8217;s, 2003.</p>
<p><!--922a7470102817acb849be3a13c2fccd--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pzed.ca/words/2008/01/24/includes-and-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>arrays in php</title>
		<link>http://www.pzed.ca/words/2008/01/23/arrays-in-php/</link>
		<comments>http://www.pzed.ca/words/2008/01/23/arrays-in-php/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 21:44:19 +0000</pubDate>
		<dc:creator>pzed</dc:creator>
				<category><![CDATA[libraries]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[web stuff]]></category>

		<guid isPermaLink="false">http://www.pzed.ca/words/archives/2008/arrays-in-php/</guid>
		<description><![CDATA[
an array is a type of variable used to store a set of values (that much I knew)
numerically indexed arrays are indexed numerically (!) starting at 0
an array can be initialized directly or an array can be created by copying from another array using the = operator
an array can also be created using data stored [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>an <em>array</em> is a type of variable used to store a set of values (that much I knew)</li>
<li><em>numerically indexed arrays</em> are indexed numerically (!) starting at 0</li>
<li>an array can be initialized directly or an array can be created by copying from another array using the = operator</li>
<li>an array can also be created using data stored in a file, or in a database</li>
<li>loops are convenient ways to access numerically indexed arrays</li>
<li>an <em>associative array</em> allows the association of any key or index with each value</li>
<li>the <em>each()</em> function can be used to loop through an associative array</li>
<li>the <em>list()</em> function can be used to split an array into a number of values &#8211; I assume this corresponds to the number of associations</li>
<li><em>multidimensional arrays</em> are created by nesting</li>
<li>one advantage of associative arrays is that data can be accessed by the name of the key, which makes more sense than a simple digit</li>
<li>thus it is easier to identify and access a single value in a complex array</li>
<li>however, looping is simpler with numerically indexed arrays, so these will be preferable in some situations</li>
</ul>
<p class="cited">Welling, Luke and Laura Thomson. <em>PHP and MySQL Web Development.</em> 2nd ed. Indianapolis: Sam&#8217;s, 2003.<br />
<!--9df91f5471a0e38f447eb18402dca3c1--><!--2048f836ed42d98c4f057e660e0845d5--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pzed.ca/words/2008/01/23/arrays-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a mishmash of basic php</title>
		<link>http://www.pzed.ca/words/2008/01/23/a-mishmash-of-basic-php/</link>
		<comments>http://www.pzed.ca/words/2008/01/23/a-mishmash-of-basic-php/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 16:40:39 +0000</pubDate>
		<dc:creator>pzed</dc:creator>
				<category><![CDATA[libraries]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[web stuff]]></category>

		<guid isPermaLink="false">http://www.pzed.ca/words/archives/2008/a-mishmash-of-basic-php/</guid>
		<description><![CDATA[
literal is the term (noun) used to describe raw data, such as text
variables and literals can be combined in output in two ways: variable names can be placed alongside literals within double-quoted strings, or single quoted literals can be concatenated with variables. The concatenation symbol is the period.
this distinction occurs because php attempts to evaluate [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><em>literal</em> is the term (noun) used to describe raw data, such as text</li>
<li>variables and literals can be combined in output in two ways: variable names can be placed alongside literals within double-quoted strings, or single quoted literals can be concatenated with variables. The concatenation symbol is the period.</li>
<li>this distinction occurs because php attempts to evaluate the contents of double-quoted strings, whereas single-quoted strings are not evaluated</li>
<li>found a nice discussion of the difference between GET and POST methods here: <a href="http://www.cs.tut.fi/~jkorpela/forms/methods.html">http://www.cs.tut.fi/~jkorpela/forms/methods.html</a></li>
<li><em>identifier</em> is a generic term for the names given to variables, functions, classes</li>
<li>php identifiers are case sensitive, and cannot begin with a digit (I haven&#8217;t quite figured out the use of $ yet)</li>
<li>php does not require variables to be declared before they are used</li>
<li>constants can be declared using the <em>define()</em> function</li>
<li>variables can have one of four types of <em>scope</em></li>
<ol>
<li>built-in superglobal variables are visible everywhere within a script</li>
<li>global variables declared in a script are visible throughout the script, <em>but not inside functions</em></li>
<li>variables used inside functions are local to the function</li>
<li>variables used inside functions that are declared as global refer to the global variables of the same name</li>
</ol>
</ul>
<p>I think this last should read &#8220;variables that are declared as global inside functions refer to the global variables of the same name&#8221;.</p>
<p class="cited">Welling, Luke and Laura Thomson. <em>PHP and MySQL Web Development.</em> 2nd ed. Indianapolis: Sam&#8217;s, 2003.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pzed.ca/words/2008/01/23/a-mishmash-of-basic-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I should just know this stuff</title>
		<link>http://www.pzed.ca/words/2008/01/22/i-should-just-know-this-stuff/</link>
		<comments>http://www.pzed.ca/words/2008/01/22/i-should-just-know-this-stuff/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 21:28:04 +0000</pubDate>
		<dc:creator>pzed</dc:creator>
				<category><![CDATA[libraries]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[web stuff]]></category>

		<guid isPermaLink="false">http://www.pzed.ca/words/archives/2008/i-should-just-know-this-stuff/</guid>
		<description><![CDATA[but it never hurts to review:

three-tier architectures: client(browser) &#8596; web server &#8596; database server
database applications are stateful, http is stateless
the browser is a thin client, but it is possible to pass some of the work to the browser; e.g. JavaScript can be used to validate data before sending to the web server

I have a tendency [...]]]></description>
			<content:encoded><![CDATA[<p>but it never hurts to review:</p>
<ul>
<li>three-tier architectures: client(browser) &harr; web server &harr; database server</li>
<li>database applications are stateful, http is stateless</li>
<li>the browser is a thin client, but it is possible to pass some of the work to the browser; e.g. JavaScript can be used to validate data before sending to the web server</li>
</ul>
<p>I have a tendency to skim discussion of strings, variables, math, increments, expressions, operators.&nbsp;.&nbsp;.&nbsp;. Can&#8217;t I just look that stuff up? But I may need to think about character encoding and data entry. On to the object-oriented stuff:</p>
<ul>
<li>an <em>object</em> is a container in which data and functions can be <em>bound</em></li>
<li>a <em>class</em> is an object (?) that can be used to create many similar objects (it doesn&#8217;t help that the book I&#8217;m using keeps using the term <em>package</em> to describe the example of a class that is used&dagger;)</li>
<li>a <em>method</em> is a function that belongs to a class (or package); a method can be called on an object that has been created by the class</li>
<li>each specific object created by the class is an <em>instance</em></li>
</ul>
<p>&dagger; &#8211; It reads like this: An object is created by a package. A method (or member function) is called on an object. A method is provided by a package. The package in question is a class (aren&#8217;t all packages &#8211; should I just forget they ever said &#8220;package&#8221;?). An object created by a class is an instance. Now I get an example that shows me how to create a user-defined class that counts. There&#8217;s nothing like learning by doing. Back to class:</p>
<ul>
<li>variables defined within a class are <em>member variables</em>; functions, <em>member functions</em>.</li>
<li>&#8220;The class definition defines how data and functionality are actually bound together&mdash;member variables and functions take their meaning from the class of which they&#8217;re a part.&#8221;</li>
<li>class definitions can be placed in <em>include</em> files, the benefits of which aren&#8217;t listed in my text, but I imagine must include:</li>
<ol>
<li>efficiency: the class needn&#8217;t be written out every time it&#8217;s needed, saving time and bandwidth</li>
<li>uniformity: by having only one copy of a class that could be used by multiple programmes, we ensure that the class always functions in the same way</li>
<li>security: the class remains on the server, and I&#8217;m guessing this might make things a little more secure in some way. Or not. I just can&#8217;t finish a list after only two items.</li>
</ol>
<li>a <em>constructor</em> is a method that is called when an object is created, and can be used to set up the initial state of the new object</li>
<li>a <em>destructor</em> is a method that is called when an object is destroyed</li>
<li>destructor functions are useful for housekeeping tasks like closing the connection to a DBMS or saving user preferences to a file</li>
</ul>
<p>PHP also has <em>private members variables</em>, but it&#8217;s very rare that these ever become law.</p>
<p>I think I&#8217;ll save inheritance for tomorrow.</p>
<p class="cited">Williams, Hugh E. and David Lane. <em>Web Database Applications with PHP and MySQL.</em> Sebastapol, CA: O&#8217;Reilly, 2004.
<p/><!--fb940a4ccef16ccf4f149ed7a76e9c98--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pzed.ca/words/2008/01/22/i-should-just-know-this-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
