<?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>Kadjo</title>
	<atom:link href="http://www.kadjo.net/softdev/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.kadjo.net/softdev</link>
	<description>SoftDev Journal</description>
	<lastBuildDate>Tue, 29 Jun 2010 04:42:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Vtiger CRM backtracing code</title>
		<link>http://www.kadjo.net/softdev/?p=99</link>
		<comments>http://www.kadjo.net/softdev/?p=99#comments</comments>
		<pubDate>Tue, 29 Jun 2010 04:41:57 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.kadjo.net/softdev/?p=99</guid>
		<description><![CDATA[To backtrace the particular part in the vtiger script.. add the following code.

        $bt = debug_backtrace();
        $ut = array();
        foreach($bt as $t){
        $ut[] = array('file'=>$t['file'],'line'=>$t['line'],'function'=>$t['function']);
   [...]]]></description>
			<content:encoded><![CDATA[<p>To backtrace the particular part in the vtiger script.. add the following code.</p>
<pre>
        $bt = debug_backtrace();
        $ut = array();
        foreach($bt as $t){
        $ut[] = array('file'=>$t['file'],'line'=>$t['line'],'function'=>$t['function']);
        }
        var_export($ut);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kadjo.net/softdev/?feed=rss2&amp;p=99</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Short note of Javascript refresher</title>
		<link>http://www.kadjo.net/softdev/?p=93</link>
		<comments>http://www.kadjo.net/softdev/?p=93#comments</comments>
		<pubDate>Mon, 28 Sep 2009 04:41:05 +0000</pubDate>
		<dc:creator>pepesmith</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.kadjo.net/softdev/?p=93</guid>
		<description><![CDATA[In the program i made, which tabulates the latest 20 call in a minute, I&#8217;ve found some good resource for it.
My setup, perl-cgi script is the one that generates the list of calls. This script is just called via an Ajax function.
The main important part of that is  part that contains this setInterval.
I chose [...]]]></description>
			<content:encoded><![CDATA[<p>In the program i made, which tabulates the latest 20 call in a minute, I&#8217;ve found some good resource for it.<br />
My setup, perl-cgi script is the one that generates the list of calls. This script is just called via an Ajax function.</p>
<p>The main important part of that is  part that contains this <strong>setInterval</strong>.<br />
I chose setInterval since the &#8220;Call Accounting System&#8221; i made needs a refreshing every minute to update<br />
the user about the activity of PBX.</p>
<p>The code also requires to have an id &#8220;content&#8221; to have the content generated by &#8220;refresher.cgi&#8221; displayed.<br />
An example of usage will be.</p>
<p><strong>&lt;div id=&#8221;content&#8221;&gt;&amp;nbsp;&lt;/div&gt;</strong></p>
<p>and i put the code at the bottom of the html page.</p>
<p><strong>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;20records.js&#8221;&gt;&lt;/script&gt;</strong></p>
<p>Below is the content of the 20records.js file:</p>
<p><code>var xmlhttp;</p>
<p>function showList()<br />
{<br />
xmlhttp=GetXmlHttpObject();<br />
if (xmlhttp==null)<br />
  {<br />
  alert ("Browser does not support HTTP Request");<br />
  return;<br />
  }<br />
var url="refresher.cgi";<br />
url=url+"?sid="+Math.random();<br />
xmlhttp.onreadystatechange=stateChanged;<br />
xmlhttp.open("GET",url,true);<br />
xmlhttp.send(null);<br />
}</p>
<p>function stateChanged()<br />
{<br />
if (xmlhttp.readyState==4)<br />
{</p>
<p>document.getElementById('content').innerHTML = xmlhttp.responseText;<br />
}<br />
}</p>
<p>function GetXmlHttpObject()<br />
{<br />
if (window.XMLHttpRequest)<br />
  {<br />
  // code for IE7+, Firefox, Chrome, Opera, Safari<br />
  return new XMLHttpRequest();<br />
  }<br />
if (window.ActiveXObject)<br />
  {<br />
  // code for IE6, IE5<br />
  return new ActiveXObject("Microsoft.XMLHTTP");<br />
  }<br />
return null;<br />
}<br />
window.setInterval("showList();",60000)</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kadjo.net/softdev/?feed=rss2&amp;p=93</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A notes UTF8 in MySQL and PHP</title>
		<link>http://www.kadjo.net/softdev/?p=86</link>
		<comments>http://www.kadjo.net/softdev/?p=86#comments</comments>
		<pubDate>Mon, 11 May 2009 17:39:42 +0000</pubDate>
		<dc:creator>pepesmith</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.kadjo.net/softdev/?p=86</guid>
		<description><![CDATA[According to Wikipedia, the Congo Region has 3 countries, the 2 Congo countries and the Angola.
I was tasked to list the countries all over the world and that includes the two (2) countries of Congo called Republic of the Congo (Congo-Brazzaville) and the Democratic Republic of the Congo (Congo-Kinshasa).  
The addition of the dash [...]]]></description>
			<content:encoded><![CDATA[<p>According to Wikipedia, the Congo Region has 3 countries, the 2 Congo countries and the Angola.</p>
<p>I was tasked to list the countries all over the world and that includes the two (2) countries of Congo called Republic of the Congo (Congo-Brazzaville) and the Democratic Republic of the Congo (Congo-Kinshasa).  </p>
<p>The addition of the dash &#8211; thing on the country to identify that separate country rendered some special unknown characters in both IE and Firefox browser. So upon seeing the content of the combo-box that contains the list of the country, this 2 country was rendered then as Congo &lt;special character&gt; Kinshasa and Congo &lt;special character&gt; Brazzaville.  I thought that was just the result of the uploads via <strong>LOAD DATA INFILE</strong> command of Mysql yet when I browse the code via mysql client console, the dash stays there.  Later I realize that this UTF8 thing really made that difference. </p>
<p>Thus using the command :<br />
<code>mysql_query("SET NAMES 'utf8'");</code><br />
resolves that issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kadjo.net/softdev/?feed=rss2&amp;p=86</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes on PHP addslashes,mysql_escape and stripcslashes</title>
		<link>http://www.kadjo.net/softdev/?p=81</link>
		<comments>http://www.kadjo.net/softdev/?p=81#comments</comments>
		<pubDate>Mon, 20 Apr 2009 19:03:18 +0000</pubDate>
		<dc:creator>pepesmith</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.kadjo.net/softdev/?p=81</guid>
		<description><![CDATA[This is just a short note while I was coding/studying on PHP  a few minutes earlier for my site.
From the manual of PHP:
addslashes &#8211; Returns a string with backslashes before characters that need to be quoted in database queries etc. These characters are single quote (&#8217;), double quote (&#8221;), backslash (\) and NUL (the [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a short note while I was coding/studying on PHP  a few minutes earlier for my site.</p>
<p>From the manual of PHP:</p>
<p><strong>addslashes</strong> &#8211; Returns a string with backslashes before characters that need to be quoted in database queries etc. These characters are single quote (&#8217;), double quote (&#8221;), backslash (\) and NUL (the NULL byte). [1]</p>
<p><strong>mysql_real_escape_string</strong> — Escapes special characters in a string for use in a SQL statement [2]</p>
<p><strong>stripslashes</strong> — Un-quote string quoted with addslashes() [3]</p>
<p>The purpose of using mysql_real_escape_string is to prevent this sql injection attack thing on data that was then typed by the user. This <strong>mysql_real_escape_string</strong>  is somewhat functions like addslashes. When you browse or retrieve your data via mysql shell or any mysql query browser utility you will notice that there are additional characters that were added.  To remove that additional character,  the stripslashes function is needed and provided also by PHP. </p>
<p>Here is my sample code :</p>
<p><code>foreach ($dispute_message2 as $key => $value)<br />
{<br />
 $value[messages] = stripslashes($value[messages]);<br />
}</code></p>
<p>Note that is code is on a function and the field messages is the one that contains the extra-codes made by mysql_real_escape_string().  The issue then here is that when i tried to print the messages here from $dispute_message2 array, still i can see the extra-codes.</p>
<p>I&#8217;ve found later my answer on this  on the foreach explanation.<br />
&#8220;Unless the array is referenced, foreach operates on a copy of the specified array and not the array itself.&#8221;</p>
<p>Thus, I made some revisions on the code and here is the latest one.</p>
<p><code>foreach ($dispute_message2 as $key => $value)<br />
{<br />
 $dispute_messages2[$key][messages] = stripslashes($value[messages]);<br />
}</code></p>
<p> <img src='http://www.kadjo.net/softdev/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Adding this <strong>$dispute_messages2[$key]</strong> fixed my problem. </p>
<p>[1] http://www.php.net/manual/en/function.addslashes.php<br />
[2] http://www.php.net/manual/en/function.mysql-real-escape-string.php<br />
[3] http://www.php.net/manual/en/function.stripslashes.php</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kadjo.net/softdev/?feed=rss2&amp;p=81</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl script bad interpreter: Permission denied</title>
		<link>http://www.kadjo.net/softdev/?p=78</link>
		<comments>http://www.kadjo.net/softdev/?p=78#comments</comments>
		<pubDate>Fri, 10 Apr 2009 21:38:14 +0000</pubDate>
		<dc:creator>pepesmith</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.kadjo.net/softdev/?p=78</guid>
		<description><![CDATA[Something went wrong on my perl code which was working earlier before I made an upgrade from debian etch to lenny.
Here are the errors :
debian:/home/jojo/Desktop/pepesfile/drupal/mysite# ./index.cgi
bash: ./index.cgi: /usr/bin/perl: bad interpreter: Permission denied
On the apache log :
[error] [client 192.168.1.2] (13)Permission denied: exec of '/home/jojo/Desktop/pepesfile/drupal/mysite/index.cgi' failed
I&#8217;ve been tracing the error on it. I simply commanded the perl [...]]]></description>
			<content:encoded><![CDATA[<p>Something went wrong on my perl code which was working earlier before I made an upgrade from debian etch to lenny.<br />
Here are the errors :<br />
<code>debian:/home/jojo/Desktop/pepesfile/drupal/mysite# ./index.cgi<br />
bash: ./index.cgi: /usr/bin/perl: bad interpreter: Permission denied</code></p>
<p>On the apache log :<br />
<code>[error] [client 192.168.1.2] (13)Permission denied: exec of '/home/jojo/Desktop/pepesfile/drupal/mysite/index.cgi' failed</code></p>
<p>I&#8217;ve been tracing the error on it. I simply commanded the <code>perl index.cgi</code> on it but its fine. I suspect that there are ^M character which the DOS/Windows based text editor is giving on the first few lines of code but its fine when I try to view via <strong><a href="http://www.vim.org/">VIM</a>[1]</strong>.</p>
<p>And then I&#8217;ve tried to look at the way the folder mysite/drupal mounted on my <strong>/etc/fstab</strong><br />
Here is my entry:<br />
<code>UUID=38c8ec02-5ef7-49fd-8607-78e4b2fe78c7  /home/jojo/Desktop/pepesfile ext3 auto,rw,user  0    0 </code></p>
<p>I did add the exec  on the column <strong>auto,rw,user</strong> and remounted the partition but its still not working <img src='http://www.kadjo.net/softdev/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> .</p>
<p>Finally i&#8217;ve replaced that <strong>auto,rw,user,exec</strong> to <strong>defaults</strong>.</p>
<p>Ahh.. that solved my problem.</p>
<p>According to the fstab documentation <a href="http://www.tuxfiles.org/linuxhelp/fstab.html">here</a>[2], <strong>&#8220;defaults</strong> uses the default options that are rw, suid, dev, exec, auto, nouser, and async.&#8221;  I just need to type the other options and remove the nouser, but I&#8217;m glad fstab has this <strong>default</strong>. <img src='http://www.kadjo.net/softdev/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>[1] http://www.vim.org/<br />
[2] http://www.tuxfiles.org/linuxhelp/fstab.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kadjo.net/softdev/?feed=rss2&amp;p=78</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
