<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://onaje.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title></title>
 <link>http://onaje.com/view/tutorials/feed</link>
 <description>Recent tutorial</description>
 <language>en</language>
<item>
 <title>Embedding movies into a webpage</title>
 <link>http://onaje.com/code/embedding-movies-webpage</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;What is embedded media?&lt;/p&gt;
&lt;p&gt;Webpages contain embedded media when they have audio, movies or animations that plays or display on the webpage rather than in a separate application. Animation, audio, video, or other media that is displayed within a Web page is known as embedded media. Embedding media in webpages deliver an integrated multimedia experience that appears seamless to the visitor.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://onaje.com/code/embedding-movies-webpage&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://onaje.com/code/embedding-movies-webpage#comments</comments>
 <pubDate>Wed, 30 Jul 2008 11:54:38 -0400</pubDate>
 <dc:creator>onaje</dc:creator>
 <guid isPermaLink="false">136 at http://onaje.com</guid>
</item>
<item>
 <title>Being part of a community of practise as a programmer</title>
 <link>http://onaje.com/content/being-part-community-practise-programmer</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;What is a Community of Practise?&lt;/p&gt;
&lt;p&gt;A community of practice (CoP) is an most often and informal, gathering where the participants come together to learn and support each other. Professional institutes may contain CoPs - mostly in the form special interest groups (SIGs). There can also be software user groups. &lt;/p&gt;
&lt;p&gt;Community of practise model&lt;br /&gt;
Purpose: Engage actors in communities that learn&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://onaje.com/content/being-part-community-practise-programmer&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://onaje.com/content/being-part-community-practise-programmer#comments</comments>
 <category domain="http://onaje.com/article/php">php</category>
 <pubDate>Mon, 18 Feb 2008 12:40:57 -0500</pubDate>
 <dc:creator>onaje</dc:creator>
 <guid isPermaLink="false">121 at http://onaje.com</guid>
</item>
<item>
 <title>Parsing RSS with Perl</title>
 <link>http://onaje.com/content/parsing-rss-perl</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;This is based on a script provided in the &#039;Add RSS feeds to your Web site with Perl XML::RSS&#039; from&lt;br /&gt;
&lt;a href=&quot;http://articles.techrepublic.com.com/5100-6228_11-5487340.html&quot; title=&quot;http://articles.techrepublic.com.com/5100-6228_11-5487340.html&quot;&gt;http://articles.techrepublic.com.com/5100-6228_11-5487340.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In the original script, it was assumed that the rss news feed would be located on your server. To get&lt;br /&gt;
around this limitation, use LWP to get the contents of a remote file, save it to a file on your server&lt;br /&gt;
then parse the file. &lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;br /&gt;
#!/usr/bin/perl -w&lt;br /&gt;
#use strict;&lt;/p&gt;
&lt;p&gt;use XML::RSS;&lt;br /&gt;
use LWP::Simple;&lt;br /&gt;
#use Data::Dumper;&lt;/p&gt;
&lt;p&gt;my $r = new XML::RSS;&lt;/p&gt;
&lt;p&gt;$r-&amp;gt;parse( get &#039;http://onaje.com/rss.xml&#039; );&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://onaje.com/content/parsing-rss-perl&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <category domain="http://onaje.com/article/perl">perl</category>
 <category domain="http://onaje.com/article/rss">rss</category>
 <pubDate>Tue, 21 Aug 2007 20:45:59 -0400</pubDate>
 <dc:creator>onaje</dc:creator>
 <guid isPermaLink="false">113 at http://onaje.com</guid>
</item>
<item>
 <title>fetchcontenturl.phps</title>
 <link>http://onaje.com/code/fetchcontenturl.phps</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;&amp;lt;?php&lt;/p&gt;
&lt;p&gt;// submit query to search engine&lt;br /&gt;
$url_contents = &quot;http://www.google.com/search?q=&quot;.urlencode($_POST[&#039;query&#039;]);&lt;/p&gt;
&lt;p&gt;$query_file_content = file_get_contents($url_contents, &quot;r&quot;) or die(&quot;cannot open url&quot;);&lt;/p&gt;
&lt;p&gt;// save results to a local file&lt;br /&gt;
// depending on how your server is configured you may need to give queryfiles folder 777 permission&lt;br /&gt;
// could aslo use another file mode to create file i.e. w+&lt;br /&gt;
$file = fopen(&#039;queryfiles/&#039;.$_POST[&#039;filename&#039;], &#039;w+&#039;);&lt;/p&gt;
&lt;p&gt;fwrite ($file, $query_file_content);&lt;/p&gt;
&lt;p&gt;fclose($file);&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://onaje.com/code/fetchcontenturl.phps&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://onaje.com/code/fetchcontenturl.phps#comments</comments>
 <pubDate>Tue, 27 Feb 2007 23:08:29 -0500</pubDate>
 <dc:creator>onaje</dc:creator>
 <guid isPermaLink="false">102 at http://onaje.com</guid>
</item>
<item>
 <title>filecsv.phps</title>
 <link>http://onaje.com/code/filecsv.phps</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$fp &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;fopen&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;csvfile.txt&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;r&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;while(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$line &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;fgetcsv&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fp&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;1024&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;,&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)){&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;pre&amp;gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;print_r&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$line&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;/pre&amp;gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;/*&lt;br /&gt;foreach($line as $value){&lt;br /&gt;echo &quot;$value&amp;lt;br&amp;gt;&quot;;&lt;br /&gt;}&lt;br /&gt;echo &quot;&amp;lt;hr&amp;gt;&quot;;&lt;br /&gt;*/&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
</description>
 <comments>http://onaje.com/code/filecsv.phps#comments</comments>
 <pubDate>Tue, 27 Feb 2007 23:07:04 -0500</pubDate>
 <dc:creator>onaje</dc:creator>
 <guid isPermaLink="false">101 at http://onaje.com</guid>
</item>
<item>
 <title>hrefextractor.phps</title>
 <link>http://onaje.com/code/hrefextractor.phps</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;&amp;lt;?php&lt;/p&gt;
&lt;p&gt;// regular expression &amp;lt;\s*a\s+[^&amp;gt;]*href\s*=\s*[\&quot;&#039;]?([^\&quot;&#039; &amp;gt;]+)[\&quot;&#039; &amp;gt;]&lt;/p&gt;
&lt;p&gt;$href_regex =&quot;&amp;lt;&quot;;            // 1 start of the tag&lt;br /&gt;
$href_regex .=&quot;\s*&quot;;         // 2 zero or more whitespace&lt;br /&gt;
$href_regex .=&quot;a&quot;;           // 3 the a of the &lt;a&gt; tag itself&lt;br /&gt;
$href_regex .=&quot;\s+&quot;;         // 4 one or more whitespace&lt;br /&gt;
$href_regex .=&quot;[^&amp;gt;]*&quot;;       // 5 zero or more of any character that is _not_ the end of the tag&lt;br /&gt;
$href_regex .=&quot;href&quot;;        // 6 the href bit of the tag&lt;br /&gt;
$href_regex .=&quot;\s*&quot;;         // 7 zero or more whitespace&lt;br /&gt;
$href_regex .=&quot;=&quot;;           // 8 the = of the tag&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://onaje.com/code/hrefextractor.phps&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://onaje.com/code/hrefextractor.phps#comments</comments>
 <pubDate>Tue, 27 Feb 2007 23:01:50 -0500</pubDate>
 <dc:creator>onaje</dc:creator>
 <guid isPermaLink="false">100 at http://onaje.com</guid>
</item>
<item>
 <title>download.phps</title>
 <link>http://onaje.com/code/download.phps</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;&amp;lt;?php&lt;br /&gt;
// downloading a file use &lt;a href=&quot;http://somewhere.com/download.php/?filename=name&quot; title=&quot;http://somewhere.com/download.php/?filename=name&quot;&gt;http://somewhere.com/download.php/?filename=name&lt;/a&gt; of file&lt;/p&gt;
&lt;p&gt;$filename = $_GET[&#039;filename&#039;];&lt;/p&gt;
&lt;p&gt;if(!$filename){ echo &quot;ERROR: No filename specified. Please try again.&quot;; }&lt;br /&gt;
else {&lt;/p&gt;
&lt;p&gt;// fix for IE catching or PHP bug issue&lt;br /&gt;
header(&quot;Pragma: public&quot;);&lt;br /&gt;
header(&quot;Expires: 0&quot;); // set expiration time&lt;br /&gt;
header(&quot;Cache-Control: must-revalidate, post-check=0, pre-check=0&quot;);&lt;br /&gt;
// browser must download file from server instead of cache&lt;/p&gt;
&lt;p&gt;// force download dialog&lt;br /&gt;
header(&quot;Content-Type: application/force-download&quot;);&lt;br /&gt;
header(&quot;Content-Type: application/octet-stream&quot;);&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://onaje.com/code/download.phps&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://onaje.com/code/download.phps#comments</comments>
 <pubDate>Tue, 27 Feb 2007 22:45:52 -0500</pubDate>
 <dc:creator>onaje</dc:creator>
 <guid isPermaLink="false">99 at http://onaje.com</guid>
</item>
<item>
 <title>quiz.phps</title>
 <link>http://onaje.com/code/quiz.phps</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;&lt;code&gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$let=array(&lt;br /&gt;
&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;,&quot;f&quot;,&quot;g&quot;,&quot;h&quot;,&quot;i&quot;,&lt;br /&gt;
&quot;j&quot;,&quot;k&quot;,&quot;l&quot;,&quot;m&quot;,&quot;n&quot;,&quot;o&quot;,&quot;p&quot;,&quot;q&quot;,&quot;r&quot;,&lt;br /&gt;
&quot;s&quot;,&quot;t&quot;,&quot;u&quot;,&quot;v&quot;,&quot;w&quot;,&quot;x&quot;,&quot;y&quot;,&quot;z&quot;&lt;br /&gt;
);&lt;/p&gt;
&lt;p&gt;//Set a counter to 1&lt;br /&gt;
$count = 1; &lt;/p&gt;
&lt;p&gt;$psco=100;&lt;/p&gt;
&lt;p&gt;/* Deduction for each wrong answer. May be the perfect score divided by the  number of questions&lt;br /&gt;
i.e. 100/10=10. If you &quot;weight&quot; wrong answers, it could be higher.  */&lt;/p&gt;
&lt;p&gt;$wrans=10;&lt;/p&gt;
&lt;p&gt;/* Deduction for each un answered. Usually the perfect score divided by the number of questions. */&lt;/p&gt;
&lt;p&gt;$noans=15;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://onaje.com/code/quiz.phps&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://onaje.com/code/quiz.phps#comments</comments>
 <pubDate>Tue, 27 Feb 2007 22:44:01 -0500</pubDate>
 <dc:creator>onaje</dc:creator>
 <guid isPermaLink="false">98 at http://onaje.com</guid>
</item>
<item>
 <title>mguestbk.phps</title>
 <link>http://onaje.com/code/mguestbk.phps</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;&lt;code&gt;&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;mysql_connect&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;localhost&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;user&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;password&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) OR die (&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Connection Error to Server&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_select_db&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;database&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) OR die(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Connection Error to Database&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$action&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;submit&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;INSERT INTO guests SET message=&#039;$message&#039;, guest=&#039;$guest&#039;, date=NOW()&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// Now select all the data, and print it one by one.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT * FROM guests&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;while(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_fetch_array&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;))&lt;br /&gt;print &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;writer&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot; : &quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;message&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot; on &quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;date&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;].&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;hr align=left width=100&amp;gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&quot;&amp;gt;&lt;br /&gt;
Name:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://onaje.com/code/mguestbk.phps&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://onaje.com/code/mguestbk.phps#comments</comments>
 <pubDate>Tue, 27 Feb 2007 22:42:14 -0500</pubDate>
 <dc:creator>onaje</dc:creator>
 <guid isPermaLink="false">97 at http://onaje.com</guid>
</item>
<item>
 <title>mysqlresult.phps</title>
 <link>http://onaje.com/code/mysqlresult.phps</link>
 <description>&lt;!--paging_filter--&gt;&lt;p&gt;&lt;code&gt;&lt;/p&gt;
&lt;p&gt;List &lt;/p&gt;
&lt;p&gt;&amp;lt;?php&lt;br /&gt;
  include(&quot;database connection file here&quot;);&lt;/p&gt;
&lt;p&gt;$result = mysql_query(&quot;SELECT ID, Name, Description FROM Categories where id=1&quot;);&lt;br /&gt;
$cid=mysql_result($result,0,&quot;id&quot;);&lt;br /&gt;
$cname=mysql_result($result,0,&quot;name&quot;);&lt;br /&gt;
$desc=mysql_result($result,0,&quot;description&quot;);&lt;br /&gt;
echo &quot;$cid $cname: $desc&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://onaje.com/code/mysqlresult.phps&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://onaje.com/code/mysqlresult.phps#comments</comments>
 <pubDate>Tue, 27 Feb 2007 22:40:20 -0500</pubDate>
 <dc:creator>onaje</dc:creator>
 <guid isPermaLink="false">96 at http://onaje.com</guid>
</item>
</channel>
</rss>
