<?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"
	>

<channel>
	<title>devPlant</title>
	<atom:link href="http://devplant.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://devplant.net</link>
	<description>Plant for developers or developement plant</description>
	<pubDate>Tue, 02 Sep 2008 07:55:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Where are you going, MySQL?</title>
		<link>http://devplant.net/2008/09/01/where-are-you-going-mysql/</link>
		<comments>http://devplant.net/2008/09/01/where-are-you-going-mysql/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 10:36:47 +0000</pubDate>
		<dc:creator>leafnode</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Webdev]]></category>

		<category><![CDATA[database]]></category>

		<category><![CDATA[drizzle]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[postgresql]]></category>

		<category><![CDATA[rdbms]]></category>

		<guid isPermaLink="false">http://devplant.net/?p=12</guid>
		<description><![CDATA[Recently Brian Aker announced that he will develop RDBMS trimmed especially to use with web-apps. It will be named Drizzle.
Features of Drizzle
What will be changed in Drizzle in comparison to MySQL? First of all, whole architecture will be changed. Drizzle will be not monolithic chunk of software like its predecessor, but it will be based [...]]]></description>
			<content:encoded><![CDATA[<p>Recently <a href="http://krow.livejournal.com/602409.html">Brian Aker announced</a> that he will develop <a href="http://en.wikipedia.org/wiki/RDBMS">RDBMS</a> trimmed especially to use with web-apps. It will be named Drizzle.</p>
<h2>Features of Drizzle</h2>
<p>What will be changed in Drizzle in comparison to MySQL? First of all, whole architecture will be changed. Drizzle will be not monolithic chunk of software like its predecessor, but it will be based on <a href="http://en.wikipedia.org/wiki/Microkernel">microkernel</a> idea. Most features will be moved from core to optional modules. Those features, like triggers, views, or even query cache, are standard for modern database servers, but are very rarely used in webapps (which is very strange for me, but I&#8217;ll come back to this later). One of these modules will be <a href="http://en.wikipedia.org/wiki/InnoDB">InnoDB</a> engine (owned by Oracle, double licensed), which would make upgrading to newest version of that engine easier. UTF-8 will be standard. Generally - looks nice.</p>
<p>On the other hand, Windows users will be sad, because probably (but not for sure), Drizzle will be available only for Linux and MacOS X. Maybe it&#8217;s not such a big deal, because most of production servers are working under non-windows OS&#8217;, but for development it would be nice to have a possibility to test-install this RDBMS on Windows.</p>
<p>Some highlights from features list:</p>
<ul>
<li> Based on MySQL 6.0 source tree</li>
<li> No shipped libraries</li>
<li> POSIX compliance</li>
<li> Micro kernel design</li>
<li> Pluggable Architecture for views, stored procedures, UDFs, storage engines etc.</li>
<li> Sharding across multiple nodes</li>
<li> Intelligent proxy</li>
<li> Multi CPU/Multi Core</li>
<li> Optimized field types</li>
<li> Efficient memory usage</li>
<li> No internal ACL, use LDAP/PAM</li>
<li> No database data formatting</li>
<li> Cleaned up make system</li>
<li> InnoDB default storage engine</li>
<li> Windows compatibility removed</li>
</ul>
<h2>Is it good?</h2>
<p>When I first got into web programming, PHP was used mainly for guest books and simple visitor counters - as an extension of good old perl CGI&#8217;s. And even for those puny applications SQL databases were used - most commonly MySQL. It annoyed me, as I thought that installing RDBMS for that sole reason was a terrible overkill. On the other hand, using files was quite cumbersome, as a programmer had to take care of file locking (and still from time to time data tended to disappear). That time, something like &#8220;raw data files with concurrency&#8221; would be great. But times have changed, and web sites are something more than a set of HTML files with CGI-like gizmos. Now everyone can use a CMS system to create web page without any knowledge of Internet voodoo. Every CMS is backed by a database server, but I haven&#8217;t seen a CMS system that uses database for something more than a data storage - no triggers, views, stored procedures - nothing. I could understand if it was because of support for many different RDMBS&#8217;, but usually even if software supports e.g. MySQL and PostgreSQL, the second one is broken/unusable/modules use MySQL non-standard methods.</p>
<p>And here comes Drizzle. RDBMS with basic SQL support (but it&#8217;s not any standardized SQL dialect), with optional advanced features like views (views support is &#8216;advanced feature&#8217;&#8230; <em>o tempora, o mores&#8230;</em>) For webapps - great solution, if only it&#8217;d become a standard (because of not standardized SQL syntax).</p>
<p>But what about &#8220;big&#8221; MySQL? I&#8217;ve never considered it as a tool for more complex projects. Websites - maybe, if software does not provide proper support for PostgreSQL. PostgreSQL is my choice for hobby projects (and those without big funding), Oracle for other.</p>
<p>MySQL was never percieved as a free replacement for expensive databases (except for people not knowing what they are talking about), so what would be MySQL&#8217;s &#8220;biotope&#8221; with poor opinion from large traffic applications programmers and Drizzle taking its place as a choice for webapps?</p>
<p>I know that my opinions on MySQL may be controversial, but they are based on my personal experience, and please don&#8217;t argue with that :)</p>
<ul>
<li><a href="http://drizzle.wikia.com/wiki/Drizzle_Wiki">Drizzle website</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://devplant.net/2008/09/01/where-are-you-going-mysql/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MSI Wind - here it comes!</title>
		<link>http://devplant.net/2008/07/28/msi-wind-here-it-comes/</link>
		<comments>http://devplant.net/2008/07/28/msi-wind-here-it-comes/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 12:39:17 +0000</pubDate>
		<dc:creator>leafnode</dc:creator>
		
		<category><![CDATA[Hardware]]></category>

		<category><![CDATA[msi wind]]></category>

		<category><![CDATA[notebook]]></category>

		<category><![CDATA[sub-notebook]]></category>

		<category><![CDATA[umpc]]></category>

		<category><![CDATA[wind]]></category>

		<guid isPermaLink="false">http://devplant.net/?p=13</guid>
		<description><![CDATA[Intro
I&#8217;ve &#8220;always&#8221; wanted to have a very small notebook, to use it as a replacement for a PDA, but with more traditional keyboard and possibility to run normal applications. It was difficult, because until few months ago small notebooks were very expensive. The only affordable ones were 3 years old x-series ThinkPads, but it was [...]]]></description>
			<content:encoded><![CDATA[<h2>Intro</h2>
<p>I&#8217;ve &#8220;always&#8221; wanted to have a very small notebook, to use it as a replacement for a PDA, but with more traditional keyboard and possibility to run normal applications. It was difficult, because until few months ago small notebooks were very expensive. The only affordable ones were 3 years old x-series ThinkPads, but it was hard to find a decent battery for it. But in 2007 Asus announced its plans to release cheap, small notebooks named <strong>Eee PC</strong> (Eee stands for <em>Easy to learn, Easy to work, Easy to play</em>). First version, with 7&#8243; screen, used 900 MHz Celeron-M processor, which was not that well suited for this job, as it ate quite a lot of &#8220;juice&#8221; from battery. Year later, 9&#8243; screen 900 series came to the public, 900 still having Celeron processor, and, later, 901, having the new Intel child - Atom. Atom was specifically designed for this purpose - ultra-mobile computers, with not so great performance, but with low energy consumption.</p>
<p>But Asus&#8217; competition did not sleep. First HP, then other companies prepared their own cheap notebooks. <a href="http://h40059.www4.hp.com/hp2133/">HP MiniNote 2133</a> looked great, but included poor Via processor. MSI announced <a href="http://www.msimobile.com/nblist.aspx?series=U">their UMPC</a> to be released in July 2008, but had problems with their battery factory burning down, so they had to reschedule a bit - instead of the beginning, Wind was released in the end of that month, and only with 3-cell battery, 80GB HDD and Windows XP operating system, with other configuration options coming in august. <a href="http://www.acer.com/aspireone/">Acer Aspire One</a>, on the other hand, started with lo-fi version - 512 MB RAM (half of that installed in Wind), 8GB SSD &#8220;hard disk&#8221; and Linpus Linux. More manufacturers announced their plans to release such notebooks, <a href="http://www.engadget.com/2008/06/05/more-details-on-dells-summer-bound-netbook/">including Dell</a>.</p>
<p>I had to choose something. First criterion was availability. I live in Poland, and the problem is that distributors ignore our market. For instance, first versions of Eee PC are still not officially available here. Of course, I could take advantage of private importers, or even friends abroad, but I would do this only as a last resort. Last week, when I was still deliberating &#8220;what to buy&#8221;, I could choose from old Eee&#8217;s (701 etc), Eee PC 900, MSI Wind (official distributor, yay!), or ask friend to buy and send me Acer Aspire One. I&#8217;ve decided that I want large HDD, as I wanted to use Windows and 8GB is not enough, so Acer was not an option. Eee PC 900&#8217;s processor was energy-consuming, so I&#8217;ve decided to go for a notebook with Intel&#8217;s Atom, and 901 was unavailable even on Polish internet auctions. 901 had advantage of being smaller that Wind, but I&#8217;ve compared sizes on paper and Wind was only 2.5 cm wider, negligibly deeper, and a bit thinner, so size wasn&#8217;t a key feature in this comparison. Other thing was that I couldn&#8217;t wait too long - I have a moving planned soon, so it was possible that in a month I&#8217;d be without any spare money. And then, I went on and bought MSI Wind. I&#8217;ve ordered one from MSI&#8217;s official distributor, with doubled RAM (without any price increase, compared to the price Wind was being sold from other retailers).</p>
<h2>Unboxing</h2>
<p><a href="http://devplant.net/wp-content/uploads/2008/07/img_2134.jpg" rel="lightbox"><img class="alignright size-thumbnail wp-image-14" title="MSI Wind: Brown box" src="http://devplant.net/wp-content/uploads/2008/07/img_2134-150x150.jpg" alt="Brown box with blue box inside" width="150" height="150" /></a>MSI Wind is shipped in a brown box, which includes blue box containing notebook (or netbook, as some people call that kind of UMPCs), and a carrying case (leather from a plastic cow). <a href="http://devplant.net/wp-content/uploads/2008/07/img_2139.jpg" rel="lightbox"><img class="alignleft size-thumbnail wp-image-15" title="MSI Wind: Unboxed" src="http://devplant.net/wp-content/uploads/2008/07/img_2139-150x150.jpg" alt="Contents of the Wind box." width="150" height="150" /></a>Inside the blue box there was the computer itself, battery, charger, two CDs (recovery and drivers), and a couple of leaflets (mostly covering guarantees). Charger and battery are protected by bubble bags, and Wind, having separate containter in the box, was wrapped in a normal plastic bag, but with an anti-scratch foil on its cover and a foam between a screen and a keyboard.</p>
<p>Overall, contents of the box is well-protected, and from the technical point of view, the box containts everything one may need, but I think MSI should work a bit more on the manuals part, especially the &#8220;Quick start guide&#8221;. Now it is only sockets and buttons description, without any hints for the begginers &#8220;what to do first&#8221;.</p>
<p>My first impression - &#8220;it&#8217;s so tiny!&#8221;. It is really impressive that it&#8217;s fully-featured PC computer. As an ultra-mobile device I think it shouldn&#8217;t be glossy on the cover, as it&#8217;s the first surface to take scratches, but when it become unappealing, I can always put a custom sticker on it (or maybe I&#8217;ll do it before it becomes ugly).</p>
<p><a href="http://devplant.net/wp-content/uploads/2008/07/img_2142.jpg" rel="lightbox"><img class="alignright size-thumbnail wp-image-16" title="MSI Wind: overlook" src="http://devplant.net/wp-content/uploads/2008/07/img_2142-150x150.jpg" alt="Overlook on Wind\'s keyboard and screen" width="150" height="150" /></a>First patting on the keyboard - the buttons work nice, most keys are big, only some special characters being smaller. Touchpad could be bigger, and mouse buttons definitely should be divided - now it&#8217;s one bar with two microswitches beneath.</p>
<h2>First run</h2>
<p>After power-on, Wind starts to configure pre-installed Microsoft Windows XP Home. It takes some time, so the manufacturer advice is not to rely on battery and use wall charger. WiFi is disabled by default, so during Windows&#8217; configuration it couldn&#8217;t find an Internet connection (and I forgot to turn WiFi on). When installer has finished, Wind is fully ready to work, without any other actions neccessary.</p>
<p>The screen is incredibly sharp and vivid. I&#8217;m really happy that it&#8217;s perfectly matte, because I couldn&#8217;t stand working and cleaning a glossy one. 1024&#215;600 resolution is enough for me - I still have to try developing/coding/sysadmining on it. Also, Wind has D-Sub output connector, so it&#8217;s possible to use an external display - it&#8217;s a great possibility, for example to watch DivX&#8217;s on plasma screens with D-Sub-DVI-HDMI connector, or beaming slides using projector.</p>
<p>I&#8217;ve written a bit of text on Wind, and I have to say that it is very comfortable. Only mistakes I made for the first few minutes were writing dot instead of comma, because those keys are significantly smaller than the others. I had also problems to get used to the position of &#8220;Fn&#8221; key (it&#8217;s in the corner of the keyboard, next to ctrl), as in my regular-size notebook I have ctrl in the corner, and Fn next to it.</p>
<p>Touchpad is OK for mobile purposes, but having a bit of free desk space, I recommend using some kind of external mouse - but it&#8217;s a general rule, not specific to Wind.</p>
<h2>On-board</h2>
<p>Wind&#8217;s equipment is generally what I&#8217;d need when being mobile. It could use a 3G modem, but for now, I couldn&#8217;t find any UMPC with one, so I&#8217;ve decided not to think about it - I can always buy a USB modem.</p>
<p>As I mentioned above, I wanted a HDD, not SSD, mainly because of the capacity. Also, SSD&#8217;s superb power efficiency, it appeared, is a myth, so only advantage of flash disks is a mechanical safety, as it contains no moving parts. Mechanical, because I had many problems with borked pendrives, and I don&#8217;t consider it very save way of keeping substantial data.</p>
<p><a href="http://devplant.net/wp-content/uploads/2008/07/disk-manager.png" rel="lightbox"><img class="alignleft size-thumbnail wp-image-19" title="MSI Wind: Disk manager" src="http://devplant.net/wp-content/uploads/2008/07/disk-manager-150x150.png" alt="" width="150" height="150" /></a>HDD in Wind is divided in 3 partitions (look left - it&#8217;s a Polish version of XP, but I think everyone can understand importand parts). First is Windows Recovery partition, second contains installed Windows, and third is initially free.</p>
<p>In the case of network connectivity, Wind has WiFi and Bluetooth wireless cards. It had no problems to detect and connect to networks at my home and workplace. Still I haven&#8217;t tested BT connection. It&#8217;s funny that not all UMPCs has BT - I&#8217;d consider it basic equipement for an ultra-mobile device without integrated 3G modem.</p>
<p><a href="http://devplant.net/wp-content/uploads/2008/07/dsc00042.jpg" rel="lightbox"><img class="alignright size-thumbnail wp-image-20" title="MSI Wind: Webcam" src="http://devplant.net/wp-content/uploads/2008/07/dsc00042-150x150.jpg" alt="Working webcam in MSI Wind" width="150" height="150" /></a>As almost all devices have a webcam, also Wind has it. And I have to say, for a web conferencing it&#8217;s quite nice. It has to be enabled by a keystroke, and after that, it&#8217;s accessible from &#8220;My computer&#8221;. When in use, orange LED near cam glows. I&#8217;ve bought a webcam some time ago, and after playing with it for a while, I hid it in a closet - I don&#8217;t have a use for it as I don&#8217;t do video conferencing, but if I had to - I have a possibility.</p>
<p>Wind has a built-in SD card reader, but for now I had no opportunity to test it, as my DSLR has CF and cell phone has M2.</p>
<h2>Mobility</h2>
<p><a href="http://devplant.net/wp-content/uploads/2008/07/dsc00036.jpg" rel="lightbox"><img class="alignleft size-thumbnail wp-image-17" title="MSI Wind: side view" src="http://devplant.net/wp-content/uploads/2008/07/dsc00036-150x150.jpg" alt="One hand driving with Wind" width="150" height="150" /></a>Wind&#8217;s design is quite sleek. It&#8217;s fitting great in a standard backpack, and it&#8217;s easy to grip it with one hand. According to manufacturer, it&#8217;s weight with 3-cell battery is barely over 1Kg (about 1200g - I don&#8217;t have any way to measure it myself), so I don&#8217;t feel it in my backpack at all.</p>
<p><a href="http://devplant.net/wp-content/uploads/2008/07/dsc00029.jpg" rel="lightbox"><img class="alignright size-thumbnail wp-image-21" title="MSI Wind: Size comparison" src="http://devplant.net/wp-content/uploads/2008/07/dsc00029-150x150.jpg" alt="From top: 15\" width="150" height="150" /></a>I&#8217;ve prepared some size comparison. In the picture on the left you can see, from the bottom up, notebooks 15&#8243;, 14&#8243;, 12&#8243; and Wind on top.</p>
<p>Battery is a difficult subject with any mobile device. For now I didn&#8217;t do any real-life tests, but Windows, with power-saving on and wireless connections off, tells me I have 2:35h of battery life left. With WiFi on - 2:29h. Of course it depends on processor load, because even without power-saving, Atom steps down to 800MHz (from a nominal 1.6 GHz) when more power is not needed. <a href="http://devplant.net/wp-content/uploads/2008/07/cpu-z.png" rel="lightbox"><img class="alignright size-thumbnail wp-image-18" title="MSI Wind: Processor idle and under load" src="http://devplant.net/wp-content/uploads/2008/07/cpu-z-150x150.png" alt="" width="150" height="150" /></a>Lookat the screenshot to the right - it shows CPU frequency when idle (left) and when Firefox is starting (right).</p>
<p>But even when working in power-saving mode, when processor is locked to 800 MHz, system runs quite smoothly. I haven&#8217;t experienced any unpleasant waiting. I haven&#8217;t, though, run any very &#8220;heavy&#8221; software, like Eclipse, but I understand that Wind is not a workstation, so it would be stupid to criticise it for not being as efficient as one.</p>
<h2>To sum up</h2>
<p>For now, I&#8217;m very happy with my new toy. Soon I will test it &#8220;in action&#8221;, because I&#8217;m going for my time off.</p>
<p>If I have something more to say after a month or so, I&#8217;ll post it here.</p>
]]></content:encoded>
			<wfw:commentRss>http://devplant.net/2008/07/28/msi-wind-here-it-comes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Private FTP server</title>
		<link>http://devplant.net/2008/07/24/private-ftp-server/</link>
		<comments>http://devplant.net/2008/07/24/private-ftp-server/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 19:07:06 +0000</pubDate>
		<dc:creator>leafnode</dc:creator>
		
		<category><![CDATA[Server administration]]></category>

		<category><![CDATA[ftp]]></category>

		<category><![CDATA[openvpn]]></category>

		<category><![CDATA[proftpd]]></category>

		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://devplant.net/?p=11</guid>
		<description><![CDATA[I wanted to share few files from my home server computer, so I&#8217;ve decided to run FTP server on that box. I&#8217;ve chosen not to use SFTP/SCP because I don&#8217;t like the way progress reporting is handled - progress bars are updated only after quite large chunk of data are transferred, otherwise dialogs are frozen. [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to share few files from my home server computer, so I&#8217;ve decided to run FTP server on that box. I&#8217;ve chosen not to use SFTP/SCP because I don&#8217;t like the way progress reporting is handled - progress bars are updated only after quite large chunk of data are transferred, otherwise dialogs are frozen. FTP is quite robust, and there is plenty of client software. I myself use built-in FTP feature of <a href="http://www.ghisler.com/">Total Commander</a>.</p>
<p>There were few aspects I had to take care of. First of all, security. FTP itself doesn&#8217;t provide any encryption, even during login phase. There are some possibilities, like FTPS - which is basically FTP over SSL, but I&#8217;ve already had <a href="http://en.wikipedia.org/wiki/Virtual_private_network">VPN</a> (<a href="http://openvpn.net/">OpenVPN</a> specifically), so I didn&#8217;t have to worry about it. Having VPN solved also an other problem, but I&#8217;ll come back to this later. If you don&#8217;t have/need any VPN, you can configure FTP daemon to use encryption. I encourage using any kind of encryption. Otherwise your account passwords would be transmitted through the network in plain text.</p>
<p>Next thing was software and its configuration. I had some experience with <a href="http://www.proftpd.org/">ProFTPd</a> daemon, and it has opinion of being very versatile and safe, so it was an obvious choice. Then I had to choose from two configuration options. First is stand-alone server, when FTP daemon works all the time on its own, handling connections, staying in memory. This option is more natural when FTP load is larger, when connections are incoming quite often. In that scenario, it is better for daemon to stay in memory all the time, so there is no overhead for daemon starting.</p>
<p>Second form is working via &#8220;super-daemon&#8221; <a href="http://en.wikipedia.org/wiki/Inetd">inetd</a>, which starts FTP daemon only when a connection is incoming. It is good configuration for sites, where clients are connecting from time to time, and there is no need to keep the daemon in memory all the time. This would be naturally proper solution in my case, but I had some negative experiences with it. Specifically, my server, working on poor hardware (p2-266), was hammered to death by a brute-force attack. Inetd was forking FTP software for each connection, and this took all available memory (which is quite low &#8220;normally&#8221;), swap, and so on.</p>
<p>I chose stand-alone configuration, mainly for its flexibility.</p>
<p>I wanted to be sure that no one unwanted would &#8220;steal&#8221; any resources. In my system configuration it was quite easy. All I had to do was to bind FTP daemon only to VPN interface (10.69.120.10/24 in my case). To do this, I had to put these lines into proftpd.conf:</p>
<pre>DefaultAddress 10.69.120.10
SocketBindTight on</pre>
<p>If I used inetd, I could limit FTP service to VPN only by engaging hosts.allow and hosts.deny files. I could put:</p>
<pre>proftpd: ALL</pre>
<p>to /etc/hosts.deny and:</p>
<pre>proftpd: 10.69.120.</pre>
<p>to /etc/hosts.allow (don&#8217;t forget the dot). This could do the trick, but still inetd would be engaged in handling an incoming connection. To lock connection on lower lever, I could do it using firewall. Having INPUT rule with default ACCEPT (check it with iptables -t filter -L command  - the output should be something like Chain INPUT (policy ACCEPT)), I could do:</p>
<pre>$ iptables -t filter -A INPUT -s 10.69.120.0/24 -p tcp --dport 21 -j ACCEPT</pre>
<pre>$ iptables -t filter -A INPUT -s 0.0.0.0/0 -p tcp --dport 21 -j DROP</pre>
<p>Having it with default to DROP or REJECT, the first command would suffice, but also data port has to be open (20).</p>
<p>If you don&#8217;t have VPN, you can limit incomming connections to IP addresses you are using, i. e. your home IP address. To do this, replace IP subnet specification from iptables command with your address, for example 192.168.0.155/32. You can of course add whole subnet, or even replace &#8220;-s some_ip&#8221; with &#8220;-i interface&#8221; to allow connections by some network interface, like your internal network controller.</p>
<p>Generally, that&#8217;s it. I have a secure FTP server, I don&#8217;t have to worry about my password being sniffed, resources being eaten, and I can freely download my data over the VPN.</p>
]]></content:encoded>
			<wfw:commentRss>http://devplant.net/2008/07/24/private-ftp-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Defending PHP (or not)</title>
		<link>http://devplant.net/2008/01/25/defending-php-or-not/</link>
		<comments>http://devplant.net/2008/01/25/defending-php-or-not/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 10:25:22 +0000</pubDate>
		<dc:creator>leafnode</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Webdev]]></category>

		<category><![CDATA[criticism]]></category>

		<category><![CDATA[defense]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://devplant.net/2008/01/25/defending-php-or-not/</guid>
		<description><![CDATA[Today I&#8217;ve read article &#8220;Defending PHP&#8221; by Jim R. Wilson. He begins saying Ugh.  I am so tired of defending PHP. And I&#8217;m saying &#8220;I am so tired of people defending PHP&#8221;. Why? First of all, if everything is OK, the language defends itself, and if lot of people complain about it, maybe really [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve read article &#8220;<a href="http://jimbojw.com/wiki/index.php?title=Defending_PHP">Defending PHP</a>&#8221; by Jim R. Wilson. He begins saying <em>Ugh.  I am so tired of defending PHP</em>. And I&#8217;m saying &#8220;I am so tired of people defending PHP&#8221;. Why? First of all, if everything is OK, the language defends itself, and if lot of people complain about it, maybe really something <strong>is</strong> wrong with PHP?</p>
<p>I&#8217;ve been working with PHP since 1999, so I think it&#8217;s quite a bit.  I&#8217;ve done personal, small and really big projects with it. And what I can say, is that PHP suck in general, but it&#8217;s great to develop quick and ugly code. It&#8217;s not my personally favorite language, but I&#8217;m still using it, and I even run few community projects in Poland (I&#8217;m leader of Polish PHP Manual translation, PHP FAQ etc). I don&#8217;t like it, but it&#8217;s useful in some part of programming ecosystem.</p>
<p>I&#8217;ve said ugly - projects written in PHP won&#8217;t be pretty, and if they are - it wasn&#8217;t worth of it. Why? Because applying advanced (well, advanced for average PHP programmer) techniques like design patterns is an overkill for most of PHP projects - it&#8217;s like <a href="http://www.phppatterns.com/docs/design/hello_world_in_patterns">using design patterns for Hello World</a>. For small to middle projects there&#8217;s no need for custom-made OOP, apart from common libraries. Building web sites is generally linear problem: parse input data, load template, load data from database, put data into template, display template - it&#8217;s how 99% of page code looks like, so there&#8217;s no place for impressive OOP (exception are utility libraries). I&#8217;m intentionally skipping wonders like PHP-GTK, because I&#8217;ve seen few projects trying to use it and I&#8217;ve seen how they were abandoned (maybe something changed recently about PHP-GTK stability and API consistency, but I haven&#8217;t heard about it).</p>
<p>I&#8217;m not against PHP, OOP, and OOP in PHP. All of these have to be used with proper consideration, and criticism and defense of it has to be spoken with proper understanding of context PHP works in. Also, people criticizing any feature have to forget about personal preferences, or even experiences. Why is that? For instance, Jim Wilson in his article says that &#8220;PHP doesn&#8217;t have namespaces&#8221; is an irrelevant complaint and solution for this would be using classes as wrappers for functions. It&#8217;s obvious sign of lack of experience with bigger projects, where namespaces can save a lot of trouble with <strong>class</strong> conflicts.  Wilson also states some PHP features (like existance of  eval) as advantages, whereas most of the experienced programmers regard this as threat and suggest avoiding it if possible. I&#8217;m not saying that eval is a sign of PHP sucking, but treating this as an advantage is improper.</p>
<p>People have to remember that some things have two sides, like built-in features of PHP. Yes, it&#8217;s great that PHP supports many databases, can generate images and tie your necktie, but you have to pay a price for including that many extensions. Memory usage and interpreter complexity are the obvious ones, but there are more. First thing that struck me was very annoying inconsistency in API of similar extensions. Different naming conventions and different order of parameters to name just few. PHP interpreter developers seem like they don&#8217;t have idea for leading a big project, or they don&#8217;t have one vision of rules, or they don&#8217;t know how to enforce them. Now it&#8217;s too late for some changes, as it&#8217;d make terrible fuss among PHP programmers, just like it was with register_globals some time ago</p>
<p>Argument between dynamic and static typing in most articles is presented like the matter of preference - &#8220;dynamic typing is good because it&#8217;s easy and I like it&#8221; or &#8220;static typing is good because it&#8217;s easier to find error and I like it&#8221;. I won&#8217;t express my preference. I&#8217;ll only say that dynamic typing should be implemented with great cautiousness, and should be followed by education of novice programmers. Weak typing implementation in PHP promotes errors like <tt>1 == &#8220;1foo&#8221;</tt>, what is obvious to experienced developers, but difficult to understand to beginners, which are most of PHP programmers.</p>
<p>Done with criticizing, now praising. As I&#8217;ve said before, PHP is great for rapid development, and probably it is the main factor why people are choosing it. It&#8217;s easy to learn, it&#8217;s easy to code, there are many really advanced applications (both commercial and free), community is helpful etc.</p>
<p>Question is, do you really want to stick with quick and ugly solutions? I&#8217;m not saying that it&#8217;s wrong. If it suits your needs - why not? Problem is when your application is growing - both in the matter of users and modules. Scalability usually is not the main design feature in the beginning and developers end up with rewriting whole application after some time.</p>
<p>To summarize: PHP is good tool, but only if you <strong>know</strong> and <strong>accept</strong> its faults and disadvantages, and you <strong>know</strong> where it could be applicable. Arguments like &#8220;someone has used PHP in space shuttle&#8221; are not real arguments - because something exists does not mean that it&#8217;s good and it works properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://devplant.net/2008/01/25/defending-php-or-not/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Syntax coloring</title>
		<link>http://devplant.net/2007/08/27/syntax-coloring/</link>
		<comments>http://devplant.net/2007/08/27/syntax-coloring/#comments</comments>
		<pubDate>Mon, 27 Aug 2007 09:03:11 +0000</pubDate>
		<dc:creator>leafnode</dc:creator>
		
		<category><![CDATA[Applications]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[GeSHi]]></category>

		<category><![CDATA[highlighing]]></category>

		<category><![CDATA[source-code]]></category>

		<category><![CDATA[Text::VimColor]]></category>

		<category><![CDATA[ViM]]></category>

		<guid isPermaLink="false">http://devplant.net/2007/08/27/syntax-coloring/</guid>
		<description><![CDATA[Everyone knows that &#8220;higher level management&#8221; like to look at colorful things, especially on PowerPoint presentations, and source codes are most boring things you can include in documentation. How to help it? You can colorize your codes.
There are many software packages that can &#8220;beautify&#8221; sources. Most of them have one limitation, which can ruin whole [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone knows that &#8220;higher level management&#8221; like to look at colorful things, especially on PowerPoint presentations, and source codes are most boring things you can include in documentation. How to help it? You can colorize your codes.</p>
<p>There are many software packages that can &#8220;beautify&#8221; sources. Most of them have one limitation, which can ruin whole experience: small amount of supported programming languages.</p>
<p>One of the most known syntax highlighting libraries is <a href="http://qbnz.com/highlighter/">GeSHi</a> written in PHP. Its name stands for Generic Syntax Highlighter, what is quite accurate, because it colors over 70 programming languages and variants. But it&#8217;s only library, so you&#8217;d have to look for some its application, or write few (probably below 10) lines of code that would best suit your needs (stdin highlighting, single file highlighting, batch highlighting etc.)</p>
<p>Trac, very versatile project management system (soon to be described here), uses <a href="http://pygments.org/">pygments</a> for syntax highlighting. Pygments, providing support for not too many file formats (not too many, but coloring those most important), has one key feature: exporting output to RTF format.</p>
<p>If you are *NIX user, you can use <a href="http://www.gnu.org/software/src-highlite/source-highlight.html">GNU Source-highlight</a> - stand-alone application that &#8220;knows&#8221; about 80 languages. It can produce output in many different formats, most notably (X)HTML, DocBook and LaTeX.</p>
<p>But 70-80 programming languages is still not enough with ever growing number of dialects and file formats. Here comes solution for all problems of humanity: ViM. ViM has incredible (and still growing) amount of syntax specification files. Now it&#8217;s over 400 (!) supported file types. It is very helpful, especially if you&#8217;re working with some exotic template systems or you&#8217;d like to colorize configuration files for Apache.</p>
<p>But it&#8217;s ViM - how to make some file output? There is a library written at first in Perl, but later translated to other programming languages. This library, Text::VimColor, can be found in <a href="http://search.cpan.org/~geoffr/Text-VimColor-0.11/lib/Text/VimColor.pm">CPAN archives</a>. In package there&#8217;s also command-line tool, so you don&#8217;t need to write anything to start using this library. There are many applications of this library, for example, <a href="http://dev.wp-plugins.org/wiki/vimcolor">syntax highlighting plugin for WordPress</a>.</p>
<p>I you would like to code something own but don&#8217;t like Perl, there is also <a href="http://moinmoin.wikiwikiweb.de/OliverGraf/VimColor">VimColor library for Python</a>. Probably if you look around, there will be translation of this library for most mainstream programming language.</p>
<h2>Links</h2>
<ul>
<li><a href="http://qbnz.com/highlighter/" title="GeSHi">GeSHi</a></li>
<li><a href="http://www.gnu.org/software/src-highlite/source-highlight.html">GNU Source-highlight</a></li>
<li><a href="http://pygments.org/">pygments</a></li>
<li><a href="http://search.cpan.org/~geoffr/Text-VimColor-0.11/lib/Text/VimColor.pm">Text::VimColor</a></li>
<li><a href="http://moinmoin.wikiwikiweb.de/OliverGraf/VimColor">VimColor for Python</a></li>
<li><a href="http://dev.wp-plugins.org/wiki/vimcolor">VimColor WordPress Plugin</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://devplant.net/2007/08/27/syntax-coloring/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rounded corners</title>
		<link>http://devplant.net/2007/07/02/rounded-corners/</link>
		<comments>http://devplant.net/2007/07/02/rounded-corners/#comments</comments>
		<pubDate>Mon, 02 Jul 2007 09:08:35 +0000</pubDate>
		<dc:creator>leafnode</dc:creator>
		
		<category><![CDATA[Webdev]]></category>

		<guid isPermaLink="false">http://devplant.net/2007/07/02/rounded-corners/</guid>
		<description><![CDATA[Recently bashing through source code of some CMS, I&#8217;ve found interesting JavaScript library. It appeared that it is also delivered separately. Its purpose is to create nice-looking rounded corners - here you can see design created only using this software. Nifty Corners Cube, because that&#8217;s how it&#8217;s called, is combination of JavaScript and CSS.

Nifty Corners [...]]]></description>
			<content:encoded><![CDATA[<p>Recently bashing through source code of some CMS, I&#8217;ve found interesting JavaScript library. It appeared that it is also delivered separately. Its purpose is to create nice-looking rounded corners - <a href="http://www.html.it/articoli/niftycube/nifty12.html">here</a> you can see design created only using this software. Nifty Corners Cube, because that&#8217;s how it&#8217;s called, is combination of JavaScript and CSS.</p>
<ul>
<li><a href="http://www.html.it/articoli/niftycube/index.html">Nifty Corners Cube home page</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://devplant.net/2007/07/02/rounded-corners/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Annoying Eclipse</title>
		<link>http://devplant.net/2007/05/21/annoying-eclipse/</link>
		<comments>http://devplant.net/2007/05/21/annoying-eclipse/#comments</comments>
		<pubDate>Mon, 21 May 2007 10:52:06 +0000</pubDate>
		<dc:creator>leafnode</dc:creator>
		
		<category><![CDATA[Eclipse]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://devplant.net/2007/05/21/annoying-eclipse/</guid>
		<description><![CDATA[Auto-closing brackets and strings in Eclipse is very useful, but it works fine only for typing new code. When editing, it&#8217;s really annoying when you want to enclose some existing string with apostrophes and Eclipse engine enters two marks instead of one.
Great thing about Eclipse is that it&#8217;s very configurable. Also search option in preferences [...]]]></description>
			<content:encoded><![CDATA[<p>Auto-closing brackets and strings in <a href="http://eclipse.org/" title="Eclipse homepage">Eclipse</a> is very useful, but it works fine only for typing new code. When editing, it&#8217;s really annoying when you want to enclose some existing string with apostrophes and Eclipse engine enters two marks instead of one.</p>
<p>Great thing about Eclipse is that it&#8217;s very configurable. Also search option in preferences dialog is helpful. With these two features, it&#8217;s easy to find option to disable code completion for braces and apostrophes. Choose <tt>Preferences</tt> from <tt>Window</tt> menu, then with tree navigate to <tt>Java-&gt;Editor-&gt;Typing</tt> and untick options in <tt>Auto-close</tt> panel. That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://devplant.net/2007/05/21/annoying-eclipse/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hard beginnings</title>
		<link>http://devplant.net/2007/05/17/hello-world/</link>
		<comments>http://devplant.net/2007/05/17/hello-world/#comments</comments>
		<pubDate>Thu, 17 May 2007 10:12:36 +0000</pubDate>
		<dc:creator>leafnode</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Time passes by. For a programmer, each year means a lot of projects, especially projects which are never published. I&#8217;ve gathered some of mine and decided to show them. Each project has its own trac manager, so finally I&#8217;ll be able to collect feedback for them. As I have many small programs and applications, I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>Time passes by. For a programmer, each year means a lot of projects, especially projects which are never published. I&#8217;ve gathered some of mine and decided to show them. Each project has its own trac manager, so finally I&#8217;ll be able to collect feedback for them. As I have many small programs and applications, I&#8217;ll upload them gradually.</p>
<p>Apart from projects, this site will include my tech-blog. Sometimes, trying to solve some problem, I can&#8217;t google any answer. If I mange to cope with it, I&#8217;ll post solution here, so if anyone would encounter same difficulties as mine, it&#8217;d be easier for them :-)</p>
<p>I hope someone will find my projects and blog useful :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://devplant.net/2007/05/17/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
