<?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>Phine Solutions &#187; programming in general</title>
	<atom:link href="http://www.phinesolutions.com/topics/programming-in-general/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phinesolutions.com</link>
	<description>A web log for web work</description>
	<lastBuildDate>Wed, 30 Jun 2010 16:23:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SMF to IPB conversion</title>
		<link>http://www.phinesolutions.com/smf-to-ipb-conversion.html</link>
		<comments>http://www.phinesolutions.com/smf-to-ipb-conversion.html#comments</comments>
		<pubDate>Mon, 18 Jan 2010 15:04:45 +0000</pubDate>
		<dc:creator>1.618</dc:creator>
				<category><![CDATA[programming in general]]></category>

		<guid isPermaLink="false">http://www.phinesolutions.com/?p=337</guid>
		<description><![CDATA[I just converted a SMF board (1.1.7) to IPB and there is some issues that I ran into that is worth to be shared.
If you have installed IPB you probably understand how the converter works. It&#8217;s a separate &#8220;app&#8221; that needs to be installed and the there is document to address how to use it. [...]]]></description>
			<content:encoded><![CDATA[<p>I just converted a SMF board (1.1.7) to IPB and there is some issues that I ran into that is worth to be shared.</p>
<p>If you have installed IPB you probably understand how the converter works. It&#8217;s a separate &#8220;app&#8221; that needs to be installed and the there is document to address how to use it. Basically on the admin converter page you are presented with several steps that need to be preformed, each one of them is specifically for converting some kind of data, such as &#8220;members&#8221;, &#8220;forums&#8221; etc. The problem I had was in the forum conversion step.</p>
<p>My original SMF board had a pretty simple forum structure: one main category, and a bunch of forums under it. It&#8217;s a pretty good mapping to IPB. However the converter refused to convert the sub forums, and only took the single top category in. Naturally not much information about this behavior can be found online because of the small user community of IPB, so I opened the converter code and took a peek.</p>
<p>Here is the problem I found:</p>
<p>Starting on line 608, in admin/applications_addon/ips/convert/modules_admin/board/smf_legacy.php file, is the code which loops through the existing forums and puts them into the new IPB database. The problem, as you can see in the code below, is that a &#8220;$loop&#8221; variable is built using the database result (fetched in the first while loop) but is never used later on. A few lines below, a second &#8220;fetch&#8221; is done in the second while loop to get the records. And based on my test, the second while loop never retrieves anything back.</p>
<blockquote><p>$i = 1;<br />
while ( $row = ipsRegistry::DB(&#8217;hb&#8217;)-&gt;fetch() )<br />
{<br />
$records[] = $row;<br />
}<br />
$loop = $records;<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
// Loop<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
while ( $row = ipsRegistry::DB(&#8217;hb&#8217;)-&gt;fetch($this-&gt;lib-&gt;queryRes) )</p></blockquote>
<p>I&#8217;m not sure the fact that the second while loop returning empty is the correct behavior of database API, or simply just a bug. But regardless of the reason, the first while loop to build the variable seems to be redundant and mostly likely was for the debugging purpose in the first place.</p>
<p>Once the cause was identified the issue was easy to fix. Just replace the second while loop with this:</p>
<blockquote><p>foreach ($loop as $row)</p></blockquote>
<p>Which basically use the previously built &#8220;$loop&#8221; variable for the cycle. And the SMP forums should be happily converted by IPB.</p>
<p>Keep in mind a lot can go wrong when converting boards between different software, especially from the one that has a lot of customizations. Hopefully this post provides some insight on troubleshooting the script.</p>
<p>The above issue is for IP.Board 3.0.5 only.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phinesolutions.com/smf-to-ipb-conversion.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why my Akismet external client is so slow</title>
		<link>http://www.phinesolutions.com/why-my-akismet-external-client-is-so-slow.html</link>
		<comments>http://www.phinesolutions.com/why-my-akismet-external-client-is-so-slow.html#comments</comments>
		<pubDate>Sun, 19 Oct 2008 14:39:12 +0000</pubDate>
		<dc:creator>1.618</dc:creator>
				<category><![CDATA[programming in general]]></category>

		<guid isPermaLink="false">http://www.phinesolutions.com/?p=174</guid>
		<description><![CDATA[Akismet is a great comment spam catching service provided by wordpress.com. I use an external PHP client to test the comment or contact form spam in my sites and it had been working great. Only recently, I noticed that sometimes I receive several same message from the contact form from the same user. Originally I [...]]]></description>
			<content:encoded><![CDATA[<p>Akismet is a great comment spam catching service provided by wordpress.com. I use an external PHP client to test the comment or contact form spam in my sites and it had been working great. Only recently, I noticed that sometimes I receive several same message from the contact form from the same user. Originally I thought it must have been some &#8220;annoying&#8221; users who sent multiple identical messages to get noticed, but when the number of cases increased, it became an issue to invest.</p>
<p>After some tryouts myself it turned out the submission of a contact form was painfully slow. The users must had been refreshing the page in frustration of the slow response. And the cause was the Akismet client, which took about 40-60 seconds to return. Naturally I checked the web to see if this had been an issue to this other people. Although the information was sparse, there are a couple of solutions, and both works.</p>
<p><strong>1. Upgrde the Akismet client</strong></p>
<p>I use <a href="http://www.achingbrain.net/stuff/php/akismet">PHP5 Akismet client by Alex</a>, and sure enough there is a new version (0.4) that addresses this issue. A more <a href="http://www.achingbrain.net/stuff/php/akismet">detailed test by Jan De Poorter can be found here</a>. So by changing HTTP version back to 1.0 fixed the issue.</p>
<p><strong>2. Modify the HTTP request</strong></p>
<p>But why the newer and better HTTP 1.1 had problem? One of the big improvement in HTTP/1.1 is the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html">capability to handle the persistent connection</a>. In a nutshell, a client can keep the TCP connection open in HTTP/1.1 and use the same connection for the subsequent requests to save the resource by not opening new connection each time. Sounds promising right? However, this makes the client to be responsible to close the connection since the server would not have any idea when it&#8217;s done. If a client does not wish to handle it, it must specify &#8220;Connection: close&#8221; in the http header and tells the server that this request SHOULD NOT be considered persistent after the current request/response is complete.</p>
<p>If you use PHP5 Akismet client and want to stick with HTTP/1.1, you can add this in the http_post function:</p>
<blockquote><p>$http_request .= &#8220;Connection: Close\r\n&#8221;;</p></blockquote>
<p>Which will also fix the performance problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phinesolutions.com/why-my-akismet-external-client-is-so-slow.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon AWS web service</title>
		<link>http://www.phinesolutions.com/amazon-aws-web-service.html</link>
		<comments>http://www.phinesolutions.com/amazon-aws-web-service.html#comments</comments>
		<pubDate>Mon, 02 Jun 2008 18:08:31 +0000</pubDate>
		<dc:creator>1.618</dc:creator>
				<category><![CDATA[programming in general]]></category>

		<guid isPermaLink="false">http://www.phinesolutions.com/?p=141</guid>
		<description><![CDATA[Amazon&#8217;s AWS webservice has been around for a while now and recently I implemented one of my web site to use the Simple Storage Service (A3). The idea is to utilize the storage space in Amazon&#8217;s computing cloud to ease the actual loads on my own web server. In this case, I store the user [...]]]></description>
			<content:encoded><![CDATA[<p>Amazon&#8217;s AWS webservice has been around for a while now and recently I implemented one of my web site to use the Simple Storage Service (A3). The idea is to utilize the storage space in Amazon&#8217;s computing cloud to ease the actual loads on my own web server. In this case, I store the user uploaded images into Amazon A3 storage as backup; and when the images are loaded on a page, they are pulled directly from Amazon A3. By using A3 the web site uses the distributed computing/storage resources and save the bandwidth.</p>
<p>Some of the good reasons to use A3:</p>
<ul>
<li>The service is cheap. We are talking about GBs on the pennies here.</li>
<li>The service is quite reliable. I know earlier this year when A3 went down and a bunch of sites that were built using A3 as part of core infrastructure went down with it. But overall the down time is very rare. And A3 load time has also been pretty fast based on my experience.</li>
<li>Easy development. The A3 development community is a great place to find resources. For example, this <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1448&amp;categoryID=47">standalone S3 php class</a> pretty much has everything you need to start using the A3 storage.</li>
</ul>
<p>Although we have a lot of good reasons to use AWS, I still wouldn&#8217;t embed too much of it into the infrastructure. The A3 storage in my case is used as a backup source and the actual data can be retrieved from local server by simply flipping a property value in the configuration file. The data update is also initialized by the scheduled cron jobs instead of building into the code. The benefit of this is that A3 is never something that my site has to reply on to stay up. And A3&#8217;s performance will not heavily influence the web site&#8217;s performance.</p>
<p>I have to say AWS is a brilliant idea and the fact that it came out from an online retail site makes it even more interesting. Here is a brief interview on Jeff Bezos who talked about Amazon&#8217;s cloud computing service during the D6 conference in May 2008.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="255" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="id" value="showplayer" /><param name="quality" value="best" /><param name="src" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&amp;feedurl=http%3A%2F%2Fearth2tech%2Eblip%2Etv%2Frss&amp;file=http%3A%2F%2Fblip%2Etv%2Frss%2Fflash%2F954261%3Freferrer%3Dblip%2Etv%26source%3D1&amp;showplayerpath=http%3A%2F%2Fblip%2Etv%2Fscripts%2Fflash%2Fshowplayer%2Eswf" /><embed id="showplayer" type="application/x-shockwave-flash" width="400" height="255" src="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&amp;feedurl=http%3A%2F%2Fearth2tech%2Eblip%2Etv%2Frss&amp;file=http%3A%2F%2Fblip%2Etv%2Frss%2Fflash%2F954261%3Freferrer%3Dblip%2Etv%26source%3D1&amp;showplayerpath=http%3A%2F%2Fblip%2Etv%2Fscripts%2Fflash%2Fshowplayer%2Eswf" quality="best"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phinesolutions.com/amazon-aws-web-service.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use cygwin on winxp, be careful about using xwidow/xterm</title>
		<link>http://www.phinesolutions.com/use-cygwin-on-winxp-be-careful-about-using-xwidowxterm.html</link>
		<comments>http://www.phinesolutions.com/use-cygwin-on-winxp-be-careful-about-using-xwidowxterm.html#comments</comments>
		<pubDate>Mon, 26 Mar 2007 03:08:13 +0000</pubDate>
		<dc:creator>1.618</dc:creator>
				<category><![CDATA[programming in general]]></category>

		<guid isPermaLink="false">http://www.phinesolutions.com/use-cygwin-on-winxp-be-careful-about-using-xwidowxterm.html</guid>
		<description><![CDATA[Normally I use eclipse for as the development IDE for my web projects. But sometimes I also enjoy using just VI (or Vim) and consoles for coding. The biggest difference from using a GUI IDE is that I would do a lot of typing and not much file looking up from a GUI directory tree. [...]]]></description>
			<content:encoded><![CDATA[<p>Normally I use <a href="http://eclipse.org">eclipse</a> for as the development IDE for my web projects. But sometimes I also enjoy using just VI (or Vim) and consoles for coding. The biggest difference from using a GUI IDE is that I would do a lot of typing and not much file looking up from a GUI directory tree. This is especially helpful If I know my files and I can find it by simply typing some commands on the console screen, versus go to the file navigation tree (usually in a small font) in a IDE, scroll up and down and try to locate a file.</p>
<p>Since I use winxp, <a href="http://cygwin.com">Cygwin</a> becomes the tool to get some Unix like consoles and commands.</p>
<p>With the base installation I get a simple command prompt. It looks just like a windows cmd prompt so it is a functional tool but doesn&#8217;t satisfy my Unix style crave. Luckily I have a couple of other options.</p>
<p><strong>Run Cygwin-X</strong></p>
<p>It is an X window system on a windows machine. Basically I can run an X server in windows OS and run other X tools and toys such as xterm and xclock. xterm is the main thing I was looking for since it comes with all the bells and whistles and I can customize the fonts and colors to the way I like.</p>
<p>The installation is pretty simple. Using the Cygwin setup program and simply choose the X11 package and you should be good to go</p>
<p>But I didn&#8217;t run into the &#8220;file permission&#8221; problem until I actually start heavily using it.Â  The problem starts with the new files I created in xterm. My web apps (in php) could not read them because &#8220;the permission was denied&#8221;. Using chmod command seemed to fixed the problem. But soon I has CVS issue for some reason all the CVS folders becomes invisible to windows and Tortoise the CVS client started to complain.</p>
<p>After researching on the web and not being able to find anything that can get me out of this easily so I decided to give it up. Can&#8217;t afford losing my time since there are other alternatives.</p>
<p>Falling back to Eclipse is not painful. It is still a good IDE. However,Â  Cygwin has another nice bach console tool called rxvt.exe and the good thing about it is not needing a X server.</p>
<p style="font-weight: bold">My rxvt.exe batch file (rcvt.bat):</p>
<p>@echo off<br />
c:\cygwin\bin\rxvt.exe -sl 500 -fn &#8216;Courier New-16&#8242; -sr -title &#8220;My bash&#8221; -e c:\cygwin\bin\bash.exe &#8211;login -i</p>
<p>This will give me a nice bash console with a nice font and so far I am pretty happy with it. I guess it needs a little time to find out if it also gives me file permission problems.</p>
<p>If you had the similar experience and know how to fix this, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phinesolutions.com/use-cygwin-on-winxp-be-careful-about-using-xwidowxterm.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Tech days in Atlanta</title>
		<link>http://www.phinesolutions.com/sun-tech-days-atlanta.html</link>
		<comments>http://www.phinesolutions.com/sun-tech-days-atlanta.html#comments</comments>
		<pubDate>Sun, 21 Jan 2007 16:48:28 +0000</pubDate>
		<dc:creator>1.618</dc:creator>
				<category><![CDATA[programming in general]]></category>

		<guid isPermaLink="false">http://www.phinesolutions.com/sun-tech-days-atlanta.html</guid>
		<description><![CDATA[Last week I attended the Sun Tech Days in Atlanta. The event lasted for 3 days but I only went to the one day developer&#39;s session.
As I am a Java developer in the corporate world I&#39;d like to keep updated with the newest Java Technology. Since Sun is the inventor of Java, Sun Tech Days [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I attended the <a href="http://developers.sun.com/events/techdays/">Sun Tech Days</a> in Atlanta. The event lasted for 3 days but I only went to the one day developer&#39;s session.</p>
<p>As I am a Java developer in the corporate world I&#39;d like to keep updated with the newest Java Technology. Since Sun is the inventor of Java, Sun Tech Days should be a good event to go to and it turned out to be a very informative and interesting event. </p>
<p>Here are some highlights I gathered from the event:</p>
<p><u><strong>Open Source</strong></u></p>
<p>Sun is opening the source of its operating system and Java.&nbsp;</p>
<p><u><strong>NetBeans</strong></u></p>
<p>Sun is definitely pushing its NetBeans IDE to the developer&#39;s desktop. During the event, the speakers from Sun demonstrated how easy it is to use NetBeans to create Java apps with Ajax and other plug ins. I am not sure if I will switch from Eclipse to NetBeans, but definitely want to give it try.</p>
<p><u><strong>Web 2.0 &amp; Ajax</strong></u></p>
<p>These are two probably most repeated words in the speaker sessions. An interesting development is that Java 6 also includes a script engine so a Java program can include scripting language like Javascript or Ruby. I am not sure if PHP is on the future list. I guess since JVM itself is a platform it is natural to adopt scripting language, one of the fast growing development tools, into JVM.</p>
<p>In my opinion &quot;Web 2.0&quot; is really a natural path for the improvement of the web technology and the community concept is nothing new since the &quot;web&quot; literally represents a community. Ajax is a probably the single word to resonate the Javascript technology. It is good to know that Sun is keeping the pace with the latest technology trend.</p>
<p><u><strong>Jame Gosling</strong></u></p>
<p>There was a Q&amp;A session with Jame Gosling, the inventor of the Java programming language. He really knew what he was talking about. </p>
<p><u><strong>Things I will definitely check out</strong></u></p>
<p><a href="https://ajax.dev.java.net/">Project jMaki</a> &#8211; jMaki is an Ajax framework that provides a lightweight model for  creating JavaScript centric Ajax-enabled web applications using Java, PHP, and Phobos. </p>
<p>Mr. Sang Shin was one of the speakers on web 2.0 framework and Ajax technology. There are some great info on <a href="http://javapassion.com">his website</a>.</p>
<p><u><strong>Free Sun Tech bag!&nbsp;</strong></u></p>
<p>&nbsp;<img src="http://www.phinesolutions.com/wp-content/uploads/dscn1585.JPG" border="0" alt="dscn1585.JPG" title="dscn1585.JPG" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phinesolutions.com/sun-tech-days-atlanta.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
