<?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>Linux, Open Source and Web 2.0 &#187; Web Development</title>
	<atom:link href="http://articles.itecsoftware.com/category/web-development/feed" rel="self" type="application/rss+xml" />
	<link>http://articles.itecsoftware.com</link>
	<description>Itec Software</description>
	<lastBuildDate>Mon, 06 Sep 2010 18:29:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using Regular Expression In PHP &#8211; The Basics</title>
		<link>http://articles.itecsoftware.com/web-development/using-regular-expression-in-php-the-basics</link>
		<comments>http://articles.itecsoftware.com/web-development/using-regular-expression-in-php-the-basics#comments</comments>
		<pubDate>Wed, 25 Aug 2010 20:03:56 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[pcre]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[posix]]></category>
		<category><![CDATA[regular expression]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=495</guid>
		<description><![CDATA[Regular expressions are a powerful tool for finding, examining and/or modifying text. Regular expressions themselves are, with a general pattern notation almost like a mini programming language, allowing you to define and parse text. They enable you to search for patterns within a string, extracting matches flexible and precise. However, you should note that because [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/0596520689?ie=UTF8&#038;tag=cudandsnu-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0596520689" target="_new"><img class="alignleft size-full wp-image-531" title="regular-expressions-cookbook" src="http://articles.itecsoftware.com/wp-content/uploads/2010/08/regular-expressions-cookbook.jpg" alt="regular expressions cookbook" width="122" height="160" /></a>Regular expressions are a powerful tool for finding, examining and/or modifying text. Regular expressions themselves are, with a general pattern notation almost like a mini programming language, allowing you to define and parse text. They enable you to search for patterns within a string, extracting matches flexible and precise. However, you should note that because regular expressions are more powerful, they also suffer from added overhead and are slower than the more basic string functions. You should make careful consideration and only use regular expressions if you have a particular need.</p>
<p>PHP supports two different types of regular expressions: POSIX-extended and Perl-Compatible Regular Expressions (PCRE). The PCRE functions are more commonly used, are more powerful than the POSIX ones and faster as well</p>
<p>In a regular expression, most characters match only themselves. For instance, if you search for the regular expression &#8220;foo&#8221; in the string &#8220;only a fool does not use regular expressions&#8221; you get a match because &#8220;foo&#8221; occurs in that string. Some characters have a special meaning. For instance, the dollar sign ($) is used to match strings that end with the given pattern. Similarly, a caret (^) character at the beginning of a regular expression indicates that it must match the beginning of the string. Characters that match themselves are called literals while characters that have special meanings are called metacharacters.<span id="more-495"></span></p>
<p>The dot (.) metacharacter matches any single character except newline (\). Hence, the pattern h.t matches hat, hothit, hut and h7t. The vertical pipe (|) metacharacter is used for alternatives in a regular expression. It behaves much like a logical OR operator and you should use it if you want to construct a pattern that matches more than one set of characters. For instance, the pattern Monday|Tuesday|Wednesday matches strings that contain &#8220;Monday&#8221; or &#8220;Tuesday&#8221; or &#8220;Wednesday&#8221;. Parentheses are used to group sequences. For example, (fri|satur)day matches &#8220;friday&#8221; or &#8220;saturday&#8221;. Using parentheses to group characters for alternation is called grouping.</p>
<p>If we want to match a literal metacharacter in a pattern, we have to escape it with a backslash.</p>
<p>To specify a set of acceptable characters in a pattern, we can either build a character class ourself, or use a predefined one. A character class lets us represent a bunch of characters as a single item. We can build our own character class by enclosing the acceptable characters in square brackets. A character class matches any one of the characters in the class. For example a character class [abc] matches a, b or c. To define a range of characters, we just add the first and last characters separated by hyphen. For example, to match all alphanumeric characters: [a-zA-Z0-9]. We can also create a negated character class, which matches any character that is not in the class. To create a negated character class, we start the character class with ^: [^0-9].</p>
<p>Metacharacters +, *, ?, and {} affect the number of times a pattern should be matched. + means &#8220;Match one or more of the preceding expression&#8221;, * means &#8220;Match zero or more of the preceding expression&#8221;, and ? means &#8220;Match zero or one of the preceding expression&#8221;. Curly braces {} are be used differently. With a single integer, {n} means &#8220;match exactly n occurrences of the preceding expression&#8221;, with one integer and a comma, {n,} means &#8220;match n or more occurrences of the preceding expression&#8221;, and with two comma-separated integers {n,m} means &#8220;match the previous character if it occurs at least n times, but no more than m times&#8221;.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/using-regular-expression-in-php-the-basics/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install And Use CouchDB With JSON And Map-Reduce</title>
		<link>http://articles.itecsoftware.com/web-development/install-and-use-couchdb-with-json-and-map-reduce</link>
		<comments>http://articles.itecsoftware.com/web-development/install-and-use-couchdb-with-json-and-map-reduce#comments</comments>
		<pubDate>Sat, 14 Aug 2010 19:34:38 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cassandra]]></category>
		<category><![CDATA[CouchDB]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[ICU]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[map-reduce]]></category>
		<category><![CDATA[spidermonkey]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=511</guid>
		<description><![CDATA[CouchDB is another offspring from the open-source, NoSQL, non-relational databases and is maintained under the Apache Foundation. It differs itself form the likes of MongoDB or Cassandra in that CouchDB is storing data in so called &#8220;documents&#8221; that are in JSON format, which can be hashes, lists, nested arrays and of course scalar values. This [...]]]></description>
			<content:encoded><![CDATA[<p>CouchDB is another offspring from the open-source, NoSQL, non-relational databases and is maintained under the Apache Foundation. It differs itself form the likes of MongoDB or Cassandra in that CouchDB is storing data in so called &#8220;documents&#8221; that are in JSON format, which can be hashes, lists, nested arrays and of course scalar values. This added complexity results in more powerful features, mainly to have a db that is not just a single key/value pair, but it comes at a price of speed reduction.</p>
<p>CouchDB can be a little bit of a pain to install, because it needs a few pre-requisites and they in turn have a few of their own quirks. This outline should help you get CouchDB with all it&#8217;s necessities installed. We&#8217;ve used MacOS, but you can substitute your OS where applicable.</p>
<p>The CouchDB source code and installer packages are downloadable <a title="Download CouchDB" href="http://www.apache.org/dyn/closer.cgi?path=/couchdb/0.11.2/apache-couchdb-0.11.2.tar.gz" target="_blank">here</a>. As of this writing, version <a href="http://www.apache.org/dyn/closer.cgi?path=/couchdb/0.11.2/apache-couchdb-0.11.2.tar.gz" target="_blank">0.11.2</a> is the latest stable version, with 1.0.1 just around the corner. You will also need <a href="http://ftp.mozilla.org/pub/mozilla.org/js/" target="_blank">Spider Monkey</a>, Mozilla&#8217;s C implementation of JavaScript.</p>
<h3>Installing SpiderMonkey</h3>
<p>Once downloaded, extract the tarball and move into the sources folder:</p>
<p><span style="color: #008000;">tar -xzvf js-1.8.0-rc1.tar.gz</span></p>
<p><span style="color: #008000;">cd js/src</span></p>
<p><span id="more-511"></span>If you&#8217;re installing SpiderMonkey on a Mac, there is a small hack to the jsprf.c file. Adding the following two lines (in orange below) after line 60 should resolve the build issue:</p>
<p>60: #define VARARGS_ASSIGN(foo, bar)        VA_COPY(foo,bar)<br />
<span style="color: #ff6600;">61: #elif defined(va_copy)<br />
62: #define VARARGS_ASSIGN(foo, bar)</span><br />
63: #elif defined(HAVE_VA_LIST_AS_ARRAY)</p>
<p>Now we should have no issue running make:</p>
<p><span style="color: #008000;"> make BUILD_OPT=1 -f Makefile.ref</span></p>
<p><span style="color: #008000;">sudo sh</span></p>
<p><span style="color: #008000;"> sudo make BUILD_OPT=1 JS_DIST=/usr/local -f Makefile.ref export</span></p>
<h3>Installing ICU</h3>
<p>ICU is a library for International Components for Unicode and CouchDB relies on it. Let&#8217;s download it from icu-project.org <a href="http://download.icu-project.org/files/icu4c/4.4.1/icu4c-4_4_1-src.tgz" target="_blank">here</a>. Once downloaded, extract the package and move into the sources folder and change some permissions before building the code:</p>
<p><span style="color: #008000;">tar -xzvf icu4c-4_4_1-src.tgz</span></p>
<p><span style="color: #008000;">cd icu/source</span></p>
<p><span style="color: #008000;">chmod +x runConfigureICU configure install-sh</span></p>
<p><span style="color: #008000;">./runConfigreICU -h <span style="color: #000000;">(select the suffix for your OS and and supply it as argument to runConfigureICU, eg: ./runConfigureICU MacOS) </span></span></p>
<p><span style="color: #008000;">make</span></p>
<p><span style="color: #008000;">sudo make install</span></p>
<h3>Installing Erlang</h3>
<p>Erlang is the language used to build CouchDB, and you&#8217;ll have to install it if it&#8217;s not yet present. Download Erlang <a href="http://www.erlang.org/download/otp_src_R14A.tar.gz" target="_self">version 14A</a> (latest as of this writing) from erlang.org <a href="http://www.erlang.org/download/otp_src_R14A.tar.gz" target="_blank">here</a> or use wget or curl as in the steps below.<br />
<span style="color: #008000;">cd /tmp</span><br />
<span style="color: #008000;">wget http://www.erlang.org/download/otp_src_R14A.tar.gz</span><br />
<span style="color: #008000;">tar -xzvf otp_src_R14A.tar.gz</span><br />
<span style="color: #008000;">cd otp_src_R14A</span><br />
<span style="color: #008000;">./configure &#8211;enable-hipe &#8211;enable-smp-support &#8211;enable-threads <span style="color: #000000;">(</span>&#8211;enable-darvin-universal <span style="color: #000000;">for Mac)</span></span><br />
<span style="color: #008000;">make</span><br />
<span style="color: #008000;">sudo make install</span></p>
<h3>Installing CouchDB</h3>
<p>Now finally we&#8217;re ready to install CouchDB.</p>
<p><span style="color: #008000;">cd /tmp</span></p>
<p><span style="color: #008000;">wget http://www.apache.org/dyn/closer.cgi?path=/couchdb/0.11.2/apache-couchdb-0.11.2.tar.gz</span></p>
<p><span style="color: #008000;">tar -xzvf apache</span></p>
<p><span style="color: #008000;">cd apache-couchdb-0.11.2</span></p>
<p><span style="color: #008000;">./configure</span></p>
<p><span style="color: #008000;">make</span></p>
<p><span style="color: #008000;">sudo make install</span></p>
<p><span style="color: #008000;">sudo couchdb start</span></p>
<h3>Testing our CouchDB installation</h3>
<p>Besides the countless client libraries written in almost any language, we can simply use Telnet to create a database and do some basic data manipulation to test our installation.</p>
<p><span style="color: #008000;">telnet localhost 5984</span></p>
<p>If there are no errors and you get a response like below, you&#8217;re all set.</p>
<p><span style="color: #008000;"> Trying 127.0.0.1&#8230;<br />
Connected to localhost.<br />
Escape character is &#8216;^]&#8217;.</span></p>
<p>A good introduction to CouchDB&#8217;s commands can be found <a href="http://wiki.apache.org/couchdb/CouchIn15Minutes" target="_blank">here</a>.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/install-and-use-couchdb-with-json-and-map-reduce/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable Gzip Compression In Apache And Optimize Page Load</title>
		<link>http://articles.itecsoftware.com/web-development/enable-gzip-compression-in-apache-and-optimize-page-load</link>
		<comments>http://articles.itecsoftware.com/web-development/enable-gzip-compression-in-apache-and-optimize-page-load#comments</comments>
		<pubDate>Thu, 12 Aug 2010 17:31:09 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[DEFLATE]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[headers]]></category>
		<category><![CDATA[mod_deflate]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=471</guid>
		<description><![CDATA[HTML, CSS and Javascript compression is a simple and effective way to save bandwidth and speed up page load on your site. It&#8217;s often overlooked and yet simple to implement, just enable Gzip compression for the right document types and enhance your site&#8217;s user experience. In Apache, we achieve this by enabling content encoding. When [...]]]></description>
			<content:encoded><![CDATA[<p>HTML, CSS and Javascript compression is a simple and effective way to save bandwidth and speed up page load on your site. It&#8217;s often overlooked and yet simple to implement, just enable Gzip compression for the right document types and enhance your site&#8217;s user experience.</p>
<p>In Apache, we achieve this by enabling content encoding. When a user requests a file like http://www.msn.com/index.html, the browser communicates to a web server, and the conversation goes a something like this:</p>
<p>1. Browser: GET me /index.html<br />
2. Server: Found indes.html, it&#8217;s 187KB! Response code is 200 (200 OK) , requested file is coming<br />
3. Browser: 187KB, loading</p>
<p>The actual headers and protocols sent between the two are much more formal (monitor them with HTTPFox, Live HTTP Headers or others if you like.</p>
<p>Now, everything worked just fine in our little scenario, the browser got it&#8217;s requested file (index.html) of 187KB in size and probably also loaded include files such as javascript, css and a bunch of images. Especially on lower speed Internet connections, it took a few seconds for the page to load all files.</p>
<p>That&#8217;s where compression comes in. Html, javascript and css are plain text and are ideal candidates for compression, while images and videos usually underwent some compression algorithm when saved as jpg, png, avi or flv. Compressing those files would provide very little to no improvement in file size and add processing overhead to the web server. So we want to ensure we exclude those.<span id="more-471"></span></p>
<p>1. Browser: GET me /index.html, compressed if available<br />
2. Server: Found index.html, it&#8217;s 35KB, compressed! Response code is 200 (200 OK) , requested file is coming<br />
3. Browser: got index.html, extracting and loading</p>
<p>How do the browser and server know whether to send a file compressed or not?  The agreement has two parts:</p>
<div>
<p>1. The browser sends a header during the request, telling the server it accepts compressed content (Accept-Encoding: gzip, deflate)<br />
2. The server sends a response if the content is actually compressed: Content-Encoding: gzip</p>
<p>If the server doesn’t reply with the content-encoding response header, it means the file is not compressed. The “Accept-Encoding” header is just a best effort request, meaning the server can respond either way.</p>
<h3>Setting up the web server to enable page compression</h3>
<p>To enable html, css and javascript compression in Apache, we add the output filter &#8220;Deflate&#8221; to the apache config, or .htaccess file. The latter is only recommended if you&#8217;re on a shared hosting plan and don&#8217;t have access to the config files. Here we declare several different formats, also called MIME types, to be delivered compressed if requested:</p>
<p>&lt;Directory &#8220;/your-server-root&#8221;&gt;<br />
AddOutputFilterByType DEFLATE text/html<br />
AddOutputFilterByType DEFLATE text/plain<br />
AddOutputFilterByType DEFLATE text/html<br />
AddOutputFilterByType DEFLATE text/xml<br />
AddOutputFilterByType DEFLATE text/css<br />
AddOutputFilterByType DEFLATE application/xml<br />
AddOutputFilterByType DEFLATE application/xhtml+xml<br />
AddOutputFilterByType DEFLATE application/rss+xml<br />
AddOutputFilterByType DEFLATE application/javascript<br />
AddOutputFilterByType DEFLATE application/x-javascript<br />
&lt;/Directory&gt;</p>
<p>We encourage you to read more about <a href="http://httpd.apache.org/docs/2.0/mod/mod_deflate.html" target="_blank">mod_deflate</a>. There is also a another option next to &#8220;mod_deflate&#8221;, the external &#8220;mod_gzip&#8221; module and can be found <a href="http://sourceforge.net/projects/mod-gzip/" target="_blank">here</a>. Note that:</p>
<p>- mod_deflate is easier to set up and is standard.<br />
- mod_gzip seems more powerful and you can pre-compress content.</p>
<p>In either case, Apache checks for the “Accept-encoding” header and returns either the compressed or regular version of the file. Some older browsers however may have issues and there are special directives we can add to handle them like such:</p>
<p>BrowserMatch ^Mozilla/4 gzip-only-text/html<br />
BrowserMatch ^Mozilla/4\.0[678] no-gzip<br />
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html</p>
<p>Once we’ve configured our server, let&#8217;s verify that we’re actually serving up compressed content.</p>
<p>- Online: Use the online gzip test to check whether your page is compressed.<br />
- In your browser: Use Firebug and inspect the header for &#8220;Content-Encoding&#8221;<br />
- View the headers: Use HTTPFox or Live HTTP Headers to examine the response headers.</p>
<p>Some issues to watch out for when enabling compression:</p>
<p>- Older browsers still can have trouble with compressed content (they say they can accept it, but really they can’t). If your site absolutely must work with Netscape 1.0 on Windows 95, you may not want to use HTTP Compression. Apache mod_deflate has some rules to avoid compression for older browsers.<br />
- Already-compressed content: Most images, music and videos are already compressed. Don’t waste time compressing them again. In fact, you probably only need to compress the “big 3″ (HTML, CSS and Javascript).<br />
- CPU-load: Compressing content on-the-fly uses CPU time and saves bandwidth. Usually this is a great tradeoff given the speed of compression. There are ways to pre-compress static content and send over the compressed versions. This requires more configuration; even if it’s not possible, compressing output may still be a net win. Using CPU cycles for a faster user experience is well worth it, given the short attention spans on the web.</p>
</div>
<table>
<tbody></tbody>
</table>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/enable-gzip-compression-in-apache-and-optimize-page-load/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redis High Speed Storage Or Cache System</title>
		<link>http://articles.itecsoftware.com/web-development/redis-high-speed-storage-or-cache-system</link>
		<comments>http://articles.itecsoftware.com/web-development/redis-high-speed-storage-or-cache-system#comments</comments>
		<pubDate>Wed, 11 Aug 2010 18:05:14 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Useful Stuff]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CouchDB]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Redis]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=498</guid>
		<description><![CDATA[NoSQL databases are the hype, with MongoBD and CouchDB on the forefront, while Memcache has found a place in many high load web applications during the past few years. Each of these applications has their own, very specific characteristic. MongoDB finds its usage where single key-value pairs are not sufficient, but adds a slight overhead [...]]]></description>
			<content:encoded><![CDATA[<p>NoSQL databases are the hype, with <a href="http://www.mongodb.org/" target="_blank">MongoBD</a> and <a href="http://couchdb.apache.org/" target="_self">CouchDB</a> on the forefront, while Memcache has found a place in many high load web applications during the past few years. Each of these applications has their own, very specific characteristic. MongoDB finds its usage where single key-value pairs are not sufficient, but adds a slight overhead and complexity with its hash table like multi field storage architecture. CouchDB is an ideal candidate where single key-value pair storage engine is sufficient.</p>
<p>And there is Redis, the new kid on the block. Redis is a high speed storage or cache system, much like <a href="http://memcached.org/" target="_blank">Memcache</a> on steroids. Redis writes data into memory, which makes it really fast. And in contrast to Memcache, it writes data periodically to disk depending on the amount of data that has changed. Redis is been said to be able to handle in excess of 10&#8217;000 reads/writes per second!<span id="more-498"></span></p>
<p>In contrast to Memcache, Redis has its own client language. The basic &#8220;set&#8221; and &#8220;get&#8221; are pretty much standard, but we can increment values, set lists and sets and easily handle key replacements and checks for existing values.</p>
<p>As of this writing, <a href="http://code.google.com/p/redis/downloads/detail?name=redis-2.0.0-rc4.tar.gz&amp;can=2&amp;q=" target="_blank">version 2</a> is in Release Candidate 4. For production environments, you&#8217;re highly encouraged to use the stable <a href="http://code.google.com/p/redis/downloads/detail?name=redis-1.2.6.tar.gz&amp;can=2&amp;q=" target="_blank">version 1.2.6</a>. To install Redis, download the desired version, untar and switch to the Redis directory. There is no configure script, we just call make, then copy &#8220;redis_server&#8221; and &#8220;redis-cli&#8221; to your desired location (eg. /usr/local/bin) and copy redis.conf to /etc/. Let&#8217;s start it up! Although I downloaded version 2 RC 4, the server shows version 1.3.17:</p>
<p><span style="color: #008000;">redis-server</span><br />
<span style="color: #008000;">[3926] 11 Aug 10:42:33 * Server started, Redis version 1.3.17</span><br />
<span style="color: #008000;">[3926] 11 Aug 10:42:33 * The server is now ready to accept connections on port 6379</span><br />
<span style="color: #008000;">[3926] 11 Aug 10:42:33 &#8211; 0 clients connected (0 slaves), 1074272 bytes in use</span><br />
<span style="color: #008000;">[3926] 11 Aug 10:42:33 * Server started, Redis version 1.3.17</span><br />
<span style="color: #008000;">[3926] 11 Aug 10:42:33 * The server is now ready to accept connections on port 6379</span><br />
<span style="color: #008000;">[3926] 11 Aug 10:42:33 &#8211; 0 clients connected (0 slaves), 1074272 bytes in use</span></p>
<p>We can now use Telnet to connect on port 6379 or use the Command Line Interface that comes with Redis (redis-cli) and issue some commands:<br />
<span style="color: #008000;"><br />
redis&gt; get firstName<br />
(nil)<br />
redis&gt; set firstName Peter<br />
OK<br />
redis&gt; get firstName<br />
&#8220;Peter&#8221;<br />
redis&gt; setnx firstName Peters<br />
(integer) 0<br />
redis&gt; get firstName<br />
&#8220;Peter&#8221;<br />
redis&gt; setnx firstNames Peters<br />
(integer) 1<br />
redis&gt; get firstNames<br />
&#8220;Peters&#8221;<br />
redis&gt;<br />
</span><br />
Complete command reference can be found <a href="http://code.google.com/p/redis/wiki/CommandReference" target="_blank">here</a> and it&#8217;s highly encouraged that you play around with them and get familiar with the CLI commands. It is really amazing what Redis provides in terms of powerful memory storage solution coupled with such an easy setup and usage. One thing is for sure, we&#8217;re hooked.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/redis-high-speed-storage-or-cache-system/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7 Tips To Improve Web Page Load Time</title>
		<link>http://articles.itecsoftware.com/web-development/7-tips-to-improve-web-page-load-time</link>
		<comments>http://articles.itecsoftware.com/web-development/7-tips-to-improve-web-page-load-time#comments</comments>
		<pubDate>Sat, 10 Jul 2010 16:39:50 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[minify]]></category>
		<category><![CDATA[redirect]]></category>
		<category><![CDATA[sprite]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=464</guid>
		<description><![CDATA[With the increasing focus on Google&#8217;s Site Speed Algorithm, the following are 7 tips to improve web page load time, proven techniques well known websites use to boost their site speed. 1. Enable Gzip Compression While compressing pages adds just a tad to your web server&#8217;s overhead, it will reduce bandwidth and transmission time and [...]]]></description>
			<content:encoded><![CDATA[<p>With the increasing focus on Google&#8217;s Site Speed Algorithm, the following are 7 tips to improve web page load time, proven techniques well known websites use to boost their site speed.</p>
<h3>1. Enable Gzip Compression</h3>
<p>While compressing pages adds just a tad to your web server&#8217;s overhead, it will reduce bandwidth and transmission time and make pages appear to load faster for your users. Gzip is a open source compression algorithm that can be used to compress the content of your website before your the web server sends data to a client browser. You can learn how to <a href="http://httpd.apache.org/docs/2.0/mod/mod_deflate.html" target="_blank">enable Gzip in Apache here</a>.</p>
<h3>2. Minify Javascript/CSS</h3>
<p>Minify is the process (and software) of removing unnecessary formatting characters and white space from javascript code. The result is smaller files, faster transmission and quicker page loads. You can learn all about <a href="http://en.wikipedia.org/wiki/Minification_(programming)" target="_blank">minify javascript here</a>.<span id="more-464"></span></p>
<h3>3. Use A Content Distribution Network (CDN)</h3>
<p>A CDN is a system of interconnected servers around the glove, that distribute content and assets around among them to reduce the distance between a server and a client&#8217;s browser. They are commonly used by large media web sites, such as Youtube and Break. You can find a <a href="http://en.wikipedia.org/wiki/Content_delivery_network#Free_CDNs" target="_blank">list of free CDNs here</a>.</p>
<h3>4. Optimize Images</h3>
<p>Take advantage of image compression and reduce the size of photos and graphics on you site dramatically. Never use a raw bitmap (.bmp) on your site, instead save photos as JPEG and graphics as PNG. Smaller images tend to be ok with a smaller quality setting, while large photos should be high to enjoy.</p>
<h3>5. Use External Hosts Javascript And CSS</h3>
<p>The Http protocol sets a limit as to how many concurrent files can be downloaded from a given host. This is currently set to two, which means the browser will have to wait for one to finish before getting the next file. While this isn&#8217;t true of all file types, it is a good enough reason to host applicable files on alternative subdomains. Hosting your Javascript and CSS files on a different subdomain increases the amount of files the browser can download simultaneously.</p>
<h3>6. Avoid Using Redirects</h3>
<p>While redirects can be very useful, it&#8217;s important to remember that implementing them forces your web server to do slightly more work per applicable request. Always avoid redirect strings (301 -&gt; 301 -&gt; 200 or even worse 301 -&gt; 302 -&gt; 200) and use these tools only when no other alternatives are available.</p>
<h3>7. Use Fewer Files</h3>
<p>Of the most simple and quick way to improve load time is to combine files into one. Remember the limit of downloads discussed in item 5 above? Try combining Javascript and CSS files, and make use of CSS sprites. It&#8217;s a method of combining several images in one file and use CSS for positioning. You can read how popular websites <a href="http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/" target="_blank">using sprites here</a>.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/7-tips-to-improve-web-page-load-time/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install PHP 5.2 on Ubuntu 10.04 Lucid Lynx</title>
		<link>http://articles.itecsoftware.com/web-development/install-php-5-2-on-ubuntu-10-04-lucid-lynx</link>
		<comments>http://articles.itecsoftware.com/web-development/install-php-5-2-on-ubuntu-10-04-lucid-lynx#comments</comments>
		<pubDate>Wed, 30 Jun 2010 15:37:38 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Lucid Lynx]]></category>
		<category><![CDATA[php 5.2]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=423</guid>
		<description><![CDATA[There are many reasons why we want to install PHP 5.2 on Ubuntu 10.04 Lucid Lynx, the most prominent is that many web packages are not compatible yet with PHP 5.3. Drupal 6 being a prime example. But there is no automated method out of the box, and there are now several scripts floating around [...]]]></description>
			<content:encoded><![CDATA[<p>There are many reasons why we want to install PHP 5.2 on Ubuntu 10.04 Lucid Lynx, the most prominent is that many web packages are not compatible yet with PHP 5.3. Drupal 6 being a prime example.</p>
<p>But there is no automated method out of the box, and there are now several scripts floating around the Internet that may work or just partially work. A major concern is the ability to update, easily switch to PHP 5.3 when the application is ready and also easily add / remove extensions.</p>
<p>With these considerations in mind, this is the best way to install PHP 5.2 on Ubuntu 10.04 Lucid Lynx:</p>
<p>We will install PHP 5.2 using apt-get and install from <a title="PHP 5.2 repository" href="https://edge.launchpad.net/~txwikinger/+archive/php5.2" target="_blank">Ralp Janke&#8217;s repository</a>.<span id="more-423"></span></p>
<ul>
<li style="margin-bottom:10px">Let&#8217;s install Phyton software properties, as it makes adding the repo much easier: <br /><span style="color: #008000;padding-left:20px;"><em>sudo apt-get install python</em>-<em>software</em>-<em>properties</em></span></li>
<li style="margin-bottom:10px">Add the repository and install the GPG security verification key: <br /><span style="color: #008000;padding-left:20px;"><em>add-apt-repository ppa:txwikinger/php5.2</em></span></li>
<li style="margin-bottom:10px">Now we need to create a file called /etc/apt/preferences.d/php that locks the PHP version.<br />&nbsp;&nbsp;&nbsp;This way they  remain at 5.2 and don&#8217;t get upgraded to 5.3 whenever you run apt-get to upgrade: <br /><span style="color: #008000;padding-left:20px;"><em>sudo vim /etc/apt/preferences.d/php</em></span> then copy / paste the lines at the end of this article, save and quit vim.</li>
<li style="margin-bottom:10px">Finally we do an update and the proper packages are pulled from the repositories: <br /><span style="color: #008000;padding-left:20px;"><em>sudo apt-get update</em></span></li>
</ul>
<p>If you want to verify what version you&#8217;re running, simply place a file into the root of your web server with this line &#8220;&lt;?php phpinfo(); ?&gt;&#8221;, save it as phpinfo.php and call it in your browser.</p>
<div style="margin-top: 30px;">
<p>Copy and paste these lines into /etc/apt/preferences.d/php:</p>
<p>Package: libapache2-mod-php5<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: libapache2-mod-php5filter<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php-pear<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-cgi<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-cli<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-common<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-curl<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-dbg<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-dev<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-gd<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-gmp<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-ldap<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-mhash<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-mysql<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-odbc<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-pgsql<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-pspell<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-recode<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-snmp<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-sqlite<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-sybase<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-tidy<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-xmlrpc<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
<p>Package: php5-xsl<br />
Pin: version 5.2.10*<br />
Pin-Priority: 991</p>
</div>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/install-php-5-2-on-ubuntu-10-04-lucid-lynx/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Best New Chrome Extensions For Developers</title>
		<link>http://articles.itecsoftware.com/web-development/best-new-chrome-extensions-for-developers</link>
		<comments>http://articles.itecsoftware.com/web-development/best-new-chrome-extensions-for-developers#comments</comments>
		<pubDate>Sat, 19 Jun 2010 17:36:11 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[extension]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=385</guid>
		<description><![CDATA[With increasing popularity in Google&#8217;s Chrome browser, so increases the demand for extensions. This is especially true for Developers, as we are used to such a nice variety of high quality tools in Firefox. And the more tools are available on one browser, the more that browser is used in developing web sites, resulting in [...]]]></description>
			<content:encoded><![CDATA[<p>With increasing popularity in Google&#8217;s Chrome browser, so increases the demand for extensions. This is especially true for Developers, as we are used to such a nice variety of high quality tools in Firefox. And the more tools are available on one browser, the more that browser is used in developing web sites, resulting in higher quality web experience for end users on that platform. Btw., did you know that <a href="http://www.macstories.net/news/google-chrome-surpasses-safari-in-us-browser-market/">Google  Chrome surpasses Safari in US browser market</a> (macstories.net)? The following are arguably the best new Chrome extensions for developers.</p>
<h3>6. BuiltWith Technology Profiler</h3>
<p><a title="BuiltWith Technology Profiler" href="https://chrome.google.com/extensions/detail/dapjbgnjinbpoindlpdmhochffioedbn" target="_blank"></a><a href="http://articles.itecsoftware.com/wp-content/uploads/2010/06/built-with-extension1.png"><img class="alignleft size-thumbnail wp-image-402" style="margin-right: 15px; margin-left: 5px;" title="built-with-extension" src="http://articles.itecsoftware.com/wp-content/uploads/2010/06/built-with-extension1-150x150.png" alt="BuiltWith Extension" width="150" height="150" /></a>BuiltWith is a web site profiler tool, that returns all the technologies it can find on a particular page. BuiltWith extension helps developers, researchers and designers find out what technologies web pages are using and in turn help them to decide what technologies to implement. BuiltWith currently tracks widgets (snap preview), analytics (Google, Nielsen), frameworks (.NET, Java), publishing (WordPress, Blogger), advertising (DoubleClick, AdSense), CDNs (Amazon S3, Limelight), standards (XHTML,RSS), hosting software (Apache, IIS, CentOS, Debian).</p>
<p style="clear: both;">
<h3>5. Session Manager</h3>
<p id="cx-desc-text"><a href="http://articles.itecsoftware.com/wp-content/uploads/2010/06/session-manager-extension.png"><img class="alignleft size-thumbnail wp-image-403" style="margin-right: 15px; margin-left: 5px;" title="session-manager-extension" src="http://articles.itecsoftware.com/wp-content/uploads/2010/06/session-manager-extension-150x150.png" alt="Session Manager Extension" width="150" height="150" /></a>With Session Manager you can quickly save your current browser state and reload it whenever necessary. You can manage multiple sessions, rename or remove them from the session library. Each session remembers the state of the browser at its creation time, i.e the opened tabs and windows. Once a session is opened, the browser is restored to its state.</p>
<p style="clear: both;">
<p><span id="more-385"></span></p>
<h3>4. CSSViewer</h3>
<p id="cx-desc-text"><a href="http://articles.itecsoftware.com/wp-content/uploads/2010/06/css-viewer-extension.png"><img class="alignleft size-thumbnail wp-image-405" style="margin-right: 15px; margin-left: 5px;" title="css-viewer-extension" src="http://articles.itecsoftware.com/wp-content/uploads/2010/06/css-viewer-extension-150x150.png" alt="CSS Viewer Extension" width="150" height="150" /></a><a title="CSS Viewer Extension" href="https://chrome.google.com/extensions/detail/ggfgijbpiheegefliciemofobhmofgce" target="_blank">CSS Viewer</a> shows the css parameters of any element in a web page, to  enable/disable it simply click the toolbar icon. It&#8217;s a simple CSS property viewer for designers and web developers based on the firefox add on.</p>
<p style="clear: both;">
<p><script type="text/javascript">// <![CDATA[
   google_ad_client = "pub-5075229468189091"; google_ad_slot = "5319549306"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script></p>
<h3>3.Chrome SEO</h3>
<p id="cx-desc-text"><a href="http://articles.itecsoftware.com/wp-content/uploads/2010/06/chrome-seo-extension.png"><img class="alignleft size-thumbnail wp-image-409" style="margin-right: 15px; margin-left: 5px;" title="chrome-seo-extension" src="http://articles.itecsoftware.com/wp-content/uploads/2010/06/chrome-seo-extension-150x150.png" alt="Chrome SEO Extension" width="150" height="150" /></a>The Google <a title="Chrome SEO Extension" href="https://chrome.google.com/extensions/detail/oangcciaeihlfmhppegpdceadpfaoclj" target="_blank">Chrome SEO</a> Extension provides an overview to Search Engine Optimization Tools which can help with Competitive Analysis, Keyword Research, Back-link Checks, PageRank analysis and other valuable SEO tasks.</p>
<p style="clear: both;">
<h3>2. Web Developer</h3>
<p id="cx-desc-text"><a href="http://articles.itecsoftware.com/wp-content/uploads/2010/06/web-developer-extension.png"><img class="alignleft size-thumbnail wp-image-410" style="margin-right: 15px; margin-left: 5px;" title="web-developer-extension" src="http://articles.itecsoftware.com/wp-content/uploads/2010/06/web-developer-extension-150x150.png" alt="Web Developer Extension" width="150" height="150" /></a>The <a title="Web Developer Extension" href="https://chrome.google.com/extensions/detail/bfbameneiokkgbdmiekhjnmfkcnldhhm" target="_blank">Web Developer</a> extension adds a toolbar button to the browser with various web developer tools. This is the official port of the popular Web Developer extension for Firefox written by the same person.</p>
<p style="clear: both;">
<h3>1. Firebug Lite for Google Chrome</h3>
<p><a title="Firebug Lite for Chrome" href="https://chrome.google.com/extensions/detail/bmagokdooijbeehmkpknfglimnifench" target="_blank"></a><a href="http://articles.itecsoftware.com/wp-content/uploads/2010/06/firebug-lite-extension.png"><img class="alignleft size-thumbnail wp-image-411" style="margin-right: 15px; margin-left: 5px;" title="firebug-lite-extension" src="http://articles.itecsoftware.com/wp-content/uploads/2010/06/firebug-lite-extension-150x150.png" alt="Firebug Lite Extension" width="150" height="150" /></a>Firebug Lite, as the name implies is the sibling of the famous version we used for so long now in Firefox. It provides the rich visual representation in HTML elements, DOM elements, and Box Model shading. It provides also some cool features like inspecting HTML elements with your mouse, DOM inspection, JavaScript debugging and live editing CSS properties.</p>
<p style="clear: both;">

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/best-new-chrome-extensions-for-developers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Memcached Using Telnet Commands</title>
		<link>http://articles.itecsoftware.com/web-development/testing-memcached-using-telnet-commands</link>
		<comments>http://articles.itecsoftware.com/web-development/testing-memcached-using-telnet-commands#comments</comments>
		<pubDate>Tue, 08 Jun 2010 19:21:51 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[memcache]]></category>
		<category><![CDATA[memcached]]></category>
		<category><![CDATA[telnet]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=388</guid>
		<description><![CDATA[Troubleshooting memcached is not so transparent as some other technologies, but testing memcached using telnet commands can give us quite some insight on what&#8217;s happening under the hood. Following is a short list of useful commands to inspect a running memcached instance. How to find the IP address and port to connect: ps aux &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>Troubleshooting memcached is not so transparent as some other technologies, but testing memcached using telnet commands can give us quite some insight on what&#8217;s happening under the hood.</p>
<p>Following is a short list of useful commands to  inspect a running <a href="http://www.danga.com/memcached/">memcached</a> instance.</p>
<h4><span style="text-decoration: underline;">How to find the IP address and port to connect:</span></h4>
<p><span style="color: #008000;">ps aux | grep memcached</span> will give us the process running memcached, with listening ip address and port. If this command does not yield any results, you likely not running the daemon and need to start it up first.</p>
<h4><span style="text-decoration: underline;">We can now connect using this info:</span></h4>
<p><span style="color: #008000;">telnet 127.0.0.1 11211</span> (replace your IP address and port)</p>
<h4><span style="text-decoration: underline;">Supported Commands:</span></h4>
<p>The following is a list of the most important memcached commands. For a more complete list of supported commands, check out the <a href="http://code.google.com/p/memcached/wiki/NewCommands">memcached wiki</a> document.<span id="more-388"></span></p>
<table style="margin: 10px 0 20px 10px;">
<tbody style="border: 1px gray solid;">
<tr>
<th style="text-align: left;" width="100">Command</th>
<th style="text-align: left;">Description</th>
<th style="text-align: left;">Example</th>
</tr>
<tr>
<td>get</td>
<td>Reads a value</td>
<td>get mykey</td>
</tr>
<tr>
<td>set</td>
<td>Set a key unconditionally</td>
<td>set mykey 0 60 5</td>
</tr>
<tr>
<td>add</td>
<td>Add a new key</td>
<td>add newkey 0 60 5</td>
</tr>
<tr>
<td>replace</td>
<td>Overwrite existing key</td>
<td>replace key 0 60 5</td>
</tr>
<tr>
<td>append</td>
<td>Append data to existing key</td>
<td>append key 0 60 15</td>
</tr>
<tr>
<td>prepend</td>
<td>Prepend data to existing key</td>
<td>prepend key 0 60 15</td>
</tr>
<tr>
<td>incr</td>
<td>Increments numerical key value by given number</td>
<td>incr mykey 2</td>
</tr>
<tr>
<td>decr</td>
<td>Decrements numerical key value by given number</td>
<td>decr mykey 5</td>
</tr>
<tr>
<td>delete</td>
<td>Deletes an existing key</td>
<td>delete mykey</td>
</tr>
<tr>
<td rowspan="2">flush_all</td>
<td>Invalidate specific items immediately</td>
<td>flush_all</td>
</tr>
<tr>
<td>Invalidate all items in n seconds</td>
<td>flush_all 900</td>
</tr>
<tr>
<td rowspan="7">stats</td>
<td>Prints general statistics</td>
<td>stats</td>
</tr>
<tr>
<td>Prints memory statistics</td>
<td>stats slabs</td>
</tr>
<tr>
<td>Prints memory statistics</td>
<td>stats malloc</td>
</tr>
<tr>
<td>Print higher level allocation statistics</td>
<td>stats items</td>
</tr>
<tr>
<td></td>
<td>stats detail</td>
</tr>
<tr>
<td></td>
<td>stats sizes</td>
</tr>
<tr>
<td>Resets statistics</td>
<td>stats reset</td>
</tr>
<tr>
<td>version</td>
<td>Prints server version.</td>
<td>version</td>
</tr>
<tr>
<td>verbosity</td>
<td>Increases log level</td>
<td>verbosity</td>
</tr>
<tr>
<td>quit</td>
<td>Terminate telnet session</td>
<td>qui</td>
</tr>
</tbody>
</table>
<p><script type="text/javascript">// <![CDATA[
 google_ad_client = "pub-5075229468189091"; google_ad_slot = "5319549306"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script></p>
<h4><span style="text-decoration: underline;">Traffic Statistics:</span></h4>
<p><span style="color: #008000;">stats</span> will give you general info on version, traffic, hits/misses, connections and more.</p>
<p>Example Output:</p>
<pre>STAT pid 14868
STAT uptime 175931
STAT time 1220540125
STAT version 1.2.2
STAT pointer_size 32
STAT rusage_user 620.299700
STAT rusage_system 1545.703017
STAT curr_items 228
STAT total_items 779
STAT bytes 15525
STAT curr_connections 92
STAT total_connections 1740
STAT connection_structures 165
STAT cmd_get 7411
STAT cmd_set 28445156
STAT get_hits 5183
STAT get_misses 2228
STAT evictions 0
STAT bytes_read 2112768087
STAT bytes_written 1000038245
STAT limit_maxbytes 52428800
STAT threads 1
END
</pre>
<h4><span style="text-decoration: underline;">Memory Statistics:</span></h4>
<p><span style="color: #008000;">stats slabs</span> gives you detailed memory statistics</p>
<p>Example Output:</p>
<pre>STAT 1:chunk_size 80
STAT 1:chunks_per_page 13107
STAT 1:total_pages 1
STAT 1:total_chunks 13107
STAT 1:used_chunks 13106
STAT 1:free_chunks 1
STAT 1:free_chunks_end 12886
STAT 2:chunk_size 100
STAT 2:chunks_per_page 10485
STAT 2:total_pages 1
STAT 2:total_chunks 10485
STAT 2:used_chunks 10484
STAT 2:free_chunks 1
STAT 2:free_chunks_end 10477
[...]
STAT active_slabs 3
STAT total_malloced 3145436
END
</pre>
<h4><span style="text-decoration: underline;">Items Statistics:</span></h4>
<p><span style="color: #008000;">stats items</span> lets you know the item count and their age.</p>
<p>Example Output:</p>
<pre>stats items
STAT items:1:number 220
STAT items:1:age 83095
STAT items:2:number 7
STAT items:2:age 1405
[...]
END
</pre>
<p>Using Telnet to get details about memcache is a nice way of looking under the hood or a running production system, where outputting variables in PHP or ASP .NET is not feasible. Zero values in hit/misses indicate that memcache in not used for some reason, connection errors may hint to a networking or permission issue. And with too many evictions you may need to increase the allocated amount of memory.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/testing-memcached-using-telnet-commands/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to find duplicate rows in a MySQL database table</title>
		<link>http://articles.itecsoftware.com/web-development/how-to-find-duplicate-rows-in-a-mysql-database-table</link>
		<comments>http://articles.itecsoftware.com/web-development/how-to-find-duplicate-rows-in-a-mysql-database-table#comments</comments>
		<pubDate>Thu, 22 Apr 2010 23:19:28 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[duplicate rows]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=364</guid>
		<description><![CDATA[I&#8217;ve been asked the question &#8220;How can I return duplicate rows only from a MySQL db table&#8221; so many times already, that I&#8217;ve decided to post it here in a short article. It is not something intuitive or readily available (at least it seems), but the solution is short and very simple. While this query: [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been asked the question &#8220;How can I return duplicate rows only from a MySQL db table&#8221; so many times already, that I&#8217;ve decided to post it here in a short article.</p>
<p>It is not something intuitive or readily available (at least it seems), but the solution is short and very simple.</p>
<p>While this query:</p>
<pre><span style="color: #008000;">SELECT DISTINCT column1
FROM table1</span></pre>
<p>gives us all records without the duplicates, this one returns only the duplicate ones:</p>
<pre>
<pre><span style="color: #008000;">SELECT DISTINCT column1
FROM table1
GROUP BY column1
HAVING COUNT(column1) &gt; 1</span></pre>
</pre>
<p>And by increasing the having count, you can retrieve records with multiple occurrences.</p>
<pre></pre>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/how-to-find-duplicate-rows-in-a-mysql-database-table/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Track And Parse Twitter Messages Stream</title>
		<link>http://articles.itecsoftware.com/web-development/track-and-parse-twitter-messages-stream</link>
		<comments>http://articles.itecsoftware.com/web-development/track-and-parse-twitter-messages-stream#comments</comments>
		<pubDate>Mon, 29 Mar 2010 18:37:57 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[parse twitter feed]]></category>
		<category><![CDATA[tweet]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://articles.itecsoftware.com/?p=362</guid>
		<description><![CDATA[Ever wanted to listen, track and parse tweets from a Twitter stream from an individual user? It&#8217;s quite an easy task, if you know the right URL&#8217;s to parse. Curl is a great little tool to get sources from almost any web resource and Curl has roots in Linux command like and PHP, just to [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to listen, track and parse tweets from a Twitter stream from an individual user? It&#8217;s quite an easy task, if you know the right URL&#8217;s to parse. Curl is a great little tool to get sources from almost any web resource and Curl has roots in Linux command like and PHP, just to name a couple.</p>
<p>Let&#8217;s look at how this would work by pulling CNN&#8217;s breaking news feed as JSON:</p>
<p><span style="color: #008000;">curl http://twitter.com/status/user_timeline/cnnbrk.json</span></p>
<p>or XML:</p>
<p><span style="color: #008000;">curl http://twitter.com/status/user_timeline/cnnbrk.xml</span></p>
<p>That will give you the last 20 tweets in either JSON or XML format.</p>
<p>An even more interesting option is to get messages where you have been mentioned. It&#8217;s a bit more complicated, as we need to supply login credentials, but no rocket science either:</p>
<p><span style="color: #008000;">curl -u &#8220;username:password&#8221; http://www.twitter.com/statuses/mentions.json</span> (or .xml if you prefer)</p>
<p>That&#8217;ll give you the last few tweets mentioning the user supplied with the curl command. Now all you got to figure out is how to parse the messages and plug them into your application.</p>

<div style="font-size:0px;height:0px;line-height:0px;margin:0;padding:0;clear:both"></div>]]></content:encoded>
			<wfw:commentRss>http://articles.itecsoftware.com/web-development/track-and-parse-twitter-messages-stream/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)

Served from: articles.itecsoftware.com @ 2010-09-07 21:04:30 -->