<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 19 Jun 2013 22:35:23 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Timothy Boronczyk: Composing Music with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19644</guid>
      <link>http://www.phpdeveloper.org/news/19644</link>
      <description><![CDATA[<p>
<i>Timothy Boronczyk</i> has a recent post to his site with an interesting thing to use PHP for - <a href="http://zaemis.blogspot.com/2013/05/composing-music-with-php.html">composing music</a>.
</p>
<blockquote>
I'm not an expert on probability theory, artificial intelligence and machine learning, and even my Music 201 class from years ago has been long forgotten. But if you'll indulge me for the next 10 minutes, I think you'll find that even just a little knowledge can yield impressive results if creatively woven together into an application. I'd like to share with you how PHP can be taught to compose music.
</blockquote>
<p>
He shows examples of some basic melodies generated by PHP (not the prettiest) and talks about how he "taught" PHP to get better at it. He transcribed other music into <a href="http://soundcalledmusic.com/scientific-pitch-notation/">Scientific Pitch Notation</a> and used a Markov process to create a "next note selection" method based on the notes around it. He includes the code for his "robot composer" class with its "train" and "compose" methods and and example of its usage.
</p>
Link: http://zaemis.blogspot.com/2013/05/composing-music-with-php.html]]></description>
      <pubDate>Wed, 29 May 2013 10:56:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Composing Messages in HTML for MIME Email with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10720</guid>
      <link>http://www.phpdeveloper.org/news/10720</link>
      <description><![CDATA[<p>
DevShed continues its look at sending MIME emails with PHP in <a href="http://www.devshed.com/c/a/PHP/Composing-Messages-in-HTML-for-MIME-Email-with-PHP/">the fourth part</a> of the series - a method for sending HTML in the message.
</p>
<blockquote>
In this article, I'm going to show you how to provide the MIME mailer class with the ability to send email messages in HTML format. This will greatly extend its functionality, so don't miss this tutorial.
</blockquote>
<p>
They start by <a href="http://www.devshed.com/c/a/PHP/Composing-Messages-in-HTML-for-MIME-Email-with-PHP/1/">reviewing</a> the class they've created so far, including an example of its use. From there they modify it slightly to make it easy to embed the HTML content into the email by adding the addHTML and buildHTMLPart methods.
</p>]]></description>
      <pubDate>Wed, 30 Jul 2008 14:34:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Tim Koschuetzki's Blog: Composing Methods: Substitute Algorithmn]]></title>
      <guid>http://www.phpdeveloper.org/news/8463</guid>
      <link>http://www.phpdeveloper.org/news/8463</link>
      <description><![CDATA[<p>
<i>Tim Koschuetzki</i> has another in his "Composing Methods" series posted today - <a href="http://php-coding-practices.com/refactoring/composing-methods/composing-methods-substitute-algorithmn/">this one</a> taking a look at something called the "substitute algorithm". It's a method of replacing content in a simpler way than using multiple ifs (as replaced by array functions).
</p>
<blockquote>
Programming is such a dynamic action that you often find yourself having to replace an algorithmn all together. It will be much easier to do if the current algorithmn is an easy one already. [...] Make sure you decompose your algorithmns as much as you can and use many small methods for it.
</blockquote>
<p>
His example replaces multiple if statements to search through an array with a simple in_array statement, returning the selected array index from there.
</p>]]></description>
      <pubDate>Thu, 16 Aug 2007 08:26:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Tim Koschuetzki's Blog: Composing Methods: Remove Assignments to Parameters]]></title>
      <guid>http://www.phpdeveloper.org/news/8193</guid>
      <link>http://www.phpdeveloper.org/news/8193</link>
      <description><![CDATA[<p>
In another part of his "Composing Methods" series, <i>Tim Koschuetzki</i> <a href="http://php-coding-practices.com/refactoring/composing-methods/composing-methods-remove-assignments-to-parameters/">posts about</a> removing assignments to parameters today - working with a temporary variable inside a method rather than the actual passed in value.
</p>
<blockquote>
When your code assigns to a parameter in a function/method, use a temporary variable instead. [...] It will make your code much more readable and prevents by-reference confusion and therefore big problems in the future.
</blockquote>
<p>
His example code uses the illustration of calling a price() method in a class to modify the inputVal value based on other inputted information. His suggestion is to not work with the actual inputVal value passed in (so as to avoid issues if it happens to be passed my reference later), but to work with a temporary variable - $result - inside the method.
</p>]]></description>
      <pubDate>Fri, 06 Jul 2007 10:21:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP-Coding-Practices.com: Composing Methods: Split Temporary Variable]]></title>
      <guid>http://www.phpdeveloper.org/news/8180</guid>
      <link>http://www.phpdeveloper.org/news/8180</link>
      <description><![CDATA[<p>
On the PHP-Coding-Practices.com blog, there's <a href="http://php-coding-practices.com/refactoring/composing-methods/composing-methods-split-temporary-variable/">a tutorial posted</a> from <i>Tim Koschuetzki</i> in his "Composing Methods" series looking at assigning temporary variables.
</p>
<blockquote>
When you have the same temporary variable assigned to more than once, split it up into two, unless it is a loop variable. [...] Temporary variables have various uses. They can be used as counters in loops, as collecting variables building up a result or as simple containers containing the result of a long-winded expression for easy reference.
</blockquote>
<p>
He <a href="http://php-coding-practices.com/refactoring/composing-methods/composing-methods-split-temporary-variable/">offers suggestions</a> of using temporary variables, including changing references of it after use and making a new temp variable following the second assignment of the first one. Some sample code is included to illustrate the points made.
</p>]]></description>
      <pubDate>Wed, 04 Jul 2007 11:26:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP-Coding-Practices.com: Composing Methods: Introduce Explaining Variable]]></title>
      <guid>http://www.phpdeveloper.org/news/8158</guid>
      <link>http://www.phpdeveloper.org/news/8158</link>
      <description><![CDATA[<p>
From the PHP-Coding_Practices.com site, <i>Tim Koschuetzki</i> has posted <a href="http://php-coding-practices.com/refactoring/composing-methods/composing-methods-introduce-explaining-variable/">an interesting suggestion</a> for developers working with long expressions to make thing simpler - substituting temporary variables for portions of the expression.
</p>
<blockquote>
Introduce Explaining Variable is particularly useful with long if-statements. You can take each condition, introduce an explaining variable and the conditional logic will read very well.
Another occasion is a long algorithm where each step in the calculation can be explained with a well-named temporary variable.
</blockquote>
<p>
The method is basically the following - declare the temporary variable with part of the expression, replace where needed in the expression, repeat for other parts of the expression. In his <a href="http://php-coding-practices.com/refactoring/composing-methods/composing-methods-introduce-explaining-variable/">example code</a>, he demonstrates its use, pulling out portions of an equation to calculate an item's price to make it much more readable. 
</p>]]></description>
      <pubDate>Mon, 02 Jul 2007 07:53:00 -0500</pubDate>
    </item>
  </channel>
</rss>
