<?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>PHP Magazine &#187; Misc</title>
	<atom:link href="http://www.phpmag.ru/category/catchall/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpmag.ru</link>
	<description>Suum cuique</description>
	<lastBuildDate>Tue, 01 Jun 2010 14:42:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Ubuntu 9.04 + PHP5 + GD2</title>
		<link>http://www.phpmag.ru/2009/09/12/ubuntu-9-04-php-5-gd-2/</link>
		<comments>http://www.phpmag.ru/2009/09/12/ubuntu-9-04-php-5-gd-2/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 10:00:49 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=904</guid>
		<description><![CDATA[It all started when I decided to optimize image slicing algorithm for a new feature on UMapper &#8211; and since GD is quite RAM-intensive, I needed to check actual memory consumption, and the obvious choice to do so was PHP&#8217;s memory_get_usage() function. However, it failed to produce accurate results &#8211; it seemed like images loaded [...]]]></description>
			<content:encoded><![CDATA[<p>It all started when I decided to optimize image slicing algorithm for a new feature on <a href="http://www.umapper.com">UMapper</a> &#8211; and since GD is quite RAM-intensive, I needed to check actual memory consumption, and the obvious choice to do so was PHP&#8217;s memory_get_usage() function. However, it failed to produce accurate results &#8211; it seemed like images loaded into memory weren&#8217;t accounted by the function (RAM was still used <img src='http://www.phpmag.ru/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).<br />
As it turned out, whoever prepared official php5-gd package, compiles against original GD, and not using PHP5 bundled version of the library. I actually wasn&#8217;t aware about the fork, but here is explanation from <a href="http://www.libgd.org/FAQ_PHP#How_do_I_get_gd_to_work_with_PHP.3F">GD Official Site</a>:</p>
<blockquote><p>
The PHP version of gd offers features similar to and sometimes in addition to those included in the latest version of gd found here as well as many bug fixes not present in the latest GD release. If you are working with PHP, using the built-in gd of PHP 4.3.0 or better is recommended.</p>
<p>We are working to merge the changes done in the PHP GD in the normal GD library.
</p></blockquote>
<p>Well, I was pretty sure that unexpected behavior was caused by using original GD library instead of bundled one. So I decided to remove php5-gd package, recompile php5 from sources, and install updated GD package &#8211; which is exactly what gets bundled with PHP5 on other distributions.</p>
<p>Google is my friend, so here is a walkthrough:</p>
<pre name="code" class="bash">
# Install build tools, debian helpers and fakeroot
apt-get install build-essential debhelper fakeroot
# Get PHP source (it should go into /usr/src)
cd /usr/src
apt-get source php5
# Install all packages required to build PHP5
apt-get build-dep php5

#Now what we need is to update compile options,
# so we need to edit debian/rules file:
cd php5-5.2.6.dfsg.1
vim debian/rules
# locate the line having "--with-gd=shared,/usr --enable-gd-native-ttf \"
# replace with "--with-gd=shared --enable-gd-native-ttf \"
# that's remove reference to /usr so that bundled library is used

# compile (drink some coffee, walk you dog, see the latest House episode)
dpkg-buildpackage -rfakeroot

# install the new php5-gd package
cd ..
dpkg -i php5-gd_5.2.6.dfsg.1-3ubuntu4.2_i386.deb

# finally restart apache
/etc/init.d/apache2 restart
</pre>
<p>That&#8217;s it &#8211; you should be able to see &#8220;bundled&#8221; near the GD version in the phpinfo() output. Well, that&#8217;s not the only gain &#8211; it solves problem with memory_get_usage() as well <img src='http://www.phpmag.ru/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now, once I had memory_get_usage() working correctly, back to optimization..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/09/12/ubuntu-9-04-php-5-gd-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Good Free XML Editor for Linux</title>
		<link>http://www.phpmag.ru/2009/07/16/good-free-xml-editor-for-linux/</link>
		<comments>http://www.phpmag.ru/2009/07/16/good-free-xml-editor-for-linux/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 20:08:52 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[в Меморииизззз]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=687</guid>
		<description><![CDATA[Today, I wanted to find some replacement for BluePrints XML Editor I used on WinXP. That was a general purpose, more specific was the fact that I needed XPath and XQuery supported. It turned out that Editix Lite (free version of commercial Editix) is just what I needed. If you are, like me, looking for [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I wanted to find some replacement for BluePrints XML Editor I used on WinXP. That was a general purpose, more specific was the fact that I needed XPath and XQuery supported. It turned out that <a href="http://free.editix.com/">Editix Lite</a> (free version of commercial Editix) is just what I needed. If you are, like me, looking for checking your XPath queries, this small and simple editor is definitely the tool you should try.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/07/16/good-free-xml-editor-for-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ender&#8217;s Game</title>
		<link>http://www.phpmag.ru/2009/06/20/enders-game/</link>
		<comments>http://www.phpmag.ru/2009/06/20/enders-game/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 22:23:33 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Book Reviews]]></category>
		<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=626</guid>
		<description><![CDATA[Have just finished reading Ender&#8217;s Game &#8211; one of the coolest sci-fi books I&#8217;ve ever read! Although written in 1985 &#8211; it&#8217;s still good and pleasant reading. It&#8217;s the first book by Orson Scott Card I&#8217;ve read, so I already picked all other titles in Ender Wiggin&#8217;s series. Anyone who has some spare time, should [...]]]></description>
			<content:encoded><![CDATA[<p>Have just finished reading <a href="http://www.amazon.com/Enders-Game-Orson-Scott-Card/dp/0765342294/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1245449650&amp;sr=8-1">Ender&#8217;s Game</a> &#8211; one of the coolest sci-fi books I&#8217;ve ever read! Although written in 1985 &#8211; it&#8217;s still good and pleasant reading. It&#8217;s the first book by Orson Scott Card I&#8217;ve read, so I already picked all other titles in Ender Wiggin&#8217;s series. Anyone who has some spare time, should give this book a try! Would see if the whole saga would be as good as the first book.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/06/20/enders-game/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UMapper GeoDart</title>
		<link>http://www.phpmag.ru/2009/05/07/umapper-geodart/</link>
		<comments>http://www.phpmag.ru/2009/05/07/umapper-geodart/#comments</comments>
		<pubDate>Thu, 07 May 2009 20:52:38 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Citations]]></category>
		<category><![CDATA[UMapper DevTimes]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[UMapper]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=594</guid>
		<description><![CDATA[Our Flash team has just announced GeoDart launch. If you wander what&#8217;s GeoDart &#8211; see for yourself (just pick one of user-created Geo games). Personally, I loved European Countries game (though I hope author adds the rest of the Europe to the stock).]]></description>
			<content:encoded><![CDATA[<p>Our Flash team has just announced GeoDart launch. If you wander what&#8217;s GeoDart &#8211; <a href="http://www.umapper.com/maps/explore/filter/geodart/">see for yourself</a> (just pick one of user-created Geo games). Personally, I loved <a href="http://www.umapper.com/maps/view/id/31144/">European Countries game</a> (though I hope author adds the rest of the Europe to the stock).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/05/07/umapper-geodart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL: how to drop multiple tables using single query</title>
		<link>http://www.phpmag.ru/2009/03/05/mysql-how-to-drop-multiple-tables-using-single-query/</link>
		<comments>http://www.phpmag.ru/2009/03/05/mysql-how-to-drop-multiple-tables-using-single-query/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 23:20:22 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=467</guid>
		<description><![CDATA[If you&#8217;ve ever installed some 3rd party software on you website (eg: phpbb forum), you certainly know that database tables, created during that process, generally have a convenient prefix in their names (default one for phpBB is phpbb_). This is done, I believe, to make sure that all of application&#8217;s tables get grouped together and [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever installed some 3rd party software on you website (eg: phpbb forum), you certainly know that database tables, created during that process, generally have a convenient prefix in their names (default one for phpBB is <em>phpbb_</em>). This is done, I believe, to make sure that all of application&#8217;s tables get grouped together and do not mix with your previously created ones. </p>
<p>There are situations when you&#8217;d want to remove such grouped tables, all of them at once &#8211; for example, when, several days ago, I obtained our latest <a href="http://www.umapper.com">UMapper</a> SQL-dump I, unfortunately, forgot to ignore forum tables, so they got into my localhost box. Today, I spotted those and wondered how can I quickly get rid of them. As I really like to work with MySQL via CLI, the question raised &#8211; how to remove multiple tables using single query.</p>
<p>At first, I tried to use LIKE clause the way it is used in SHOW TABLES:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">mysql<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SHOW</span> <span style="color: #993333; font-weight: bold;">TABLES</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">&quot;phpbb_%&quot;</span>; <span style="color: #808080; font-style: italic;">/* list all phpBB tables */</span>
mysql<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">DROP</span> <span style="color: #993333; font-weight: bold;">TABLES</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">&quot;phpbb_%&quot;</span>; <span style="color: #808080; font-style: italic;">/* DROP THEM? Quite a naive approach.. */</span></pre></div></div>

<p>Well, even before executing it I was 99% sure that this &#8220;method&#8221; wouldn&#8217;t work. Indeed, it didn&#8217;t <img src='http://www.phpmag.ru/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I certainly knew that you can drop several tables at once if you list all of them separated with commas:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">mysql<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">DROP</span> <span style="color: #993333; font-weight: bold;">TABLE</span> phpbb_zebra<span style="color: #66cc66;">,</span> phpbb_words; <span style="color: #808080; font-style: italic;">/* DROP several tables*/</span></pre></div></div>

<p>So, I decided that it would be good enough if I form a query which would generate yet another query that would drop all similarly prefixed tables. If it&#8217;s not already, it would be crystal clear what I mean in a minute.</p>
<p>To get list of tables complying to certain criteria one could use information_schema database. To get list of all <em>phpbb_</em> prefixed tables we can issue something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">mysql<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> GROUP_CONCAT<span style="color: #66cc66;">&#40;</span>TABLE_NAME<span style="color: #66cc66;">&#41;</span> 
           <span style="color: #993333; font-weight: bold;">FROM</span> information_schema<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">TABLES</span> 
           <span style="color: #993333; font-weight: bold;">WHERE</span> TABLE_SCHEMA <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;your_db_name&quot;</span> <span style="color: #993333; font-weight: bold;">AND</span> TABLE_NAME <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">&quot;phpbb_%&quot;</span>;</pre></div></div>

<p>Result (line-breaks added for readability):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">phpbb_acl_groups,phpbb_acl_options,phpbb_acl_roles,phpbb_acl_roles_data,
phpbb_acl_users,phpbb_attachments,phpbb_banlist,phpbb_bbcodes,phpbb_bookmarks,
SKIPPED
phpbb_search_results,phpbb_search_wordlist,phpbb_search_wordmatch,phpbb_sessions,
phpbb_sessions_keys,phpbb_sitelist,phpbb_smilies,phpbb_styles,phpbb_styles_imageset,</pre></div></div>

<p>Going from here, the only thing we need is to prepend the result with DROP TABLE string:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">mysql<span style="color: #66cc66;">&gt;</span> <span style="color: #993333; font-weight: bold;">SELECT</span> 
           CONCAT<span style="color: #66cc66;">&#40;</span>
                  <span style="color: #ff0000;">&quot;DROP TABLE &quot;</span><span style="color: #66cc66;">,</span>  
                   GROUP_CONCAT<span style="color: #66cc66;">&#40;</span>TABLE_NAME<span style="color: #66cc66;">&#41;</span>
           <span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> stmt 
           <span style="color: #993333; font-weight: bold;">FROM</span> information_schema<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">TABLES</span> 
           <span style="color: #993333; font-weight: bold;">WHERE</span> TABLE_SCHEMA <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;your_db_name&quot;</span> <span style="color: #993333; font-weight: bold;">AND</span> TABLE_NAME <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">&quot;phpbb_%&quot;</span>;</pre></div></div>

<p>Then, actually removing tables is a matter of copy-pasting the generated query. </p>
<p>That&#8217;s it! If you know a better way, please, share in comments!</p>
<p>P.S. It only occurred to me that I relied on two queries for doing the job, albeit second one was simply copy-pasted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/03/05/mysql-how-to-drop-multiple-tables-using-single-query/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>National Geographic started using UMapper</title>
		<link>http://www.phpmag.ru/2009/02/15/national-geographic-started-using-umapper/</link>
		<comments>http://www.phpmag.ru/2009/02/15/national-geographic-started-using-umapper/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 16:03:56 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=464</guid>
		<description><![CDATA[I am happy to announce that National Geographic Traveler portal is now relying solely on UMapper for their embedded mappings. That is really nice when application you work on gets broader attention. I hope it would stay this way. The first map NGT created is called the Best Romantic Weekends!]]></description>
			<content:encoded><![CDATA[<p>I am happy to announce that <a href="http://traveler.nationalgeographic.com/">National Geographic Traveler</a> portal is now relying solely on <a href="http://www.umapper.com">UMapper</a> for their embedded mappings. That is really nice when application you work on gets broader attention. I hope it would stay this way. The first map NGT created is called <a href="http://traveler.nationalgeographic.com/valentines-day/map/romantic-weekends-interactive">the Best Romantic Weekends</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/02/15/national-geographic-started-using-umapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL: tinyint(1) and tinyint(4), which one is bigger?</title>
		<link>http://www.phpmag.ru/2009/02/15/mysql-tinyint1-and-tinyint4-which-one-is-bigger/</link>
		<comments>http://www.phpmag.ru/2009/02/15/mysql-tinyint1-and-tinyint4-which-one-is-bigger/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 14:46:47 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=441</guid>
		<description><![CDATA[Answer is actually very simple, but several of my friends have missed the point of having size modifier in MySQL column type definitions, so I suppose it&#8217;s something non-obvious. Main confusion, I believe, has its roots in string data-type definitions: VARCHAR&#40;N&#41; CHAR&#40;N&#41; where N is the maximum number of characters you want to store into [...]]]></description>
			<content:encoded><![CDATA[<p>Answer is actually very simple, but several of my friends have missed the point of having size modifier in MySQL column type definitions, so I suppose it&#8217;s something non-obvious. Main confusion, I believe, has its roots in string data-type definitions:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">VARCHAR<span style="color: #66cc66;">&#40;</span>N<span style="color: #66cc66;">&#41;</span>
CHAR<span style="color: #66cc66;">&#40;</span>N<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>where N is the maximum number of characters you want to store into field, i.e. it is field&#8217;s length. And depending on your settings you might receive an error (in strict SQL mode) when you are inserting something that exceeds the pre-defined length. Even if you don&#8217;t receive error or warning, the field is limited to the length you set, and the exceeding part is truncated. So, VARCHAR(20) and VARCHAR(40)  are really different with respect to how big the stored value could be.</p>
<p>Now, let&#8217;s get back to numeric types. For numeric types length modifier is actually display width, which has nothing to do with what can be stored in field. Yes, that&#8217;s it &#8211; both TINYINT(1) and TINYINT(4) can store values in range -128..127 (or for unsigned values 0..255), and are absolutely identical datatypes, with one small twist (which concerns date retrieval &#8211; see below).</p>
<p>Here is explanation of what is meant by <em>display width</em>, taken directly from the <a href="http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html">source</a>:</p>
<blockquote><p>The display width does <strong>not</strong> constrain the range of values that can be stored in the column, nor the number of digits that are displayed for values having a width exceeding that specified for the column. For example, a column specified as SMALLINT(3) has the usual SMALLINT range of -32768 to 32767, and values outside the range allowed by three characters are displayed using more than three characters.</p></blockquote>
<p>So, if display width doesn&#8217;t constrain the range of values our numeric type can hold, why to use it at all? On MySQL forum, there was a post suggesting that by using the display width, we set mental reminder to ourselves on how big the field <em>should</em> be. Me personally, find this quite logical, this is some kind of mental tooltip which pops up when you review your schema.</p>
<p>Of course, there&#8217;s a more deliberate functionality for having display width. One obvious example would be ZEROFILL attribute, which when used in datatype definition guarantees that the value returned would always have pre-defined width, and default space padding is replaced with zeroes. For example, when column is defined as INT(5) ZEROFILL, and value to be retrieved is 4, MySQL would return it as 00004.</p>
<p>So, the bottom line: for <em>numeric</em> types, N in TYPE(N) has nothing to do with value range, and <em>refers</em> to display width.</p>
<p>Have a nice weekends!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/02/15/mysql-tinyint1-and-tinyint4-which-one-is-bigger/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>MySQL Client: how to enable auto-completion</title>
		<link>http://www.phpmag.ru/2009/01/28/mysql-how-to-enable-auto-completion/</link>
		<comments>http://www.phpmag.ru/2009/01/28/mysql-how-to-enable-auto-completion/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 02:05:15 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=362</guid>
		<description><![CDATA[MySQL command-line client has an option for table names/fields auto-complete. Moreover, it is enabled by default (at least it says so in manual, on my Slackware box it wasn&#8217;t). This feature is called auto-rehash &#8211; when typing names you simply can hit TAB to see all possible alternatives for auto-completion (if there&#8217;s exactly one alternative, [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL command-line client has an option for table names/fields auto-complete. Moreover, it is enabled by default (at least it says so in manual, on my Slackware box it wasn&#8217;t). This feature is called auto-rehash &#8211; when typing names you simply can hit TAB to see all possible alternatives for auto-completion (if there&#8217;s exactly one alternative, then auto-complete would occur without further intervention). Command-line folks would find this quite handy, indeed, if you are using CLI a lot, you just get used to hitting TAB key when in doubt.</p>
<p>So, if it&#8217;s not enabled in your client by default, you can enable this by issuing auto-rehash option when invoking the mysql client:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">mysql <span style="color: #CC0099;">-</span>uroot <span style="color: #CC0099;">-</span>p <span style="color: #CC0099;">--</span>auto<span style="color: #CC0099;">-</span>rehash</pre></div></div>

<p>Please note that you have to invoke <em><strong>use DBNAME</strong></em> at least once, since that&#8217;s the point when MySQL does hashing. Otherwise feature would refuse to do its work.</p>
<p>Of course, you can have auto-rehash (or no-auto-rehash for that matter) option in your ini file if you like:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #FF00FF;">&#91;</span>mysql<span style="color: #FF00FF;">&#93;</span>
auto<span style="color: #CC0099;">-</span>rehash</pre></div></div>

<p>Particular drawback of auto-rehashing is slower start up time of client, since data has to be read and hashed for this functionality to work. If that troubles you, I have a good news: you do not have to use <em>&#8211;auto-rehash</em> option on start up at all, and you can still get auto-completion, even if <em>&#8211;no-auto-rehash</em> option was used. It&#8217;s quite simple, just type one of</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">\<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #CC0099; font-weight: bold;">or</span>
REHASH</pre></div></div>

<p>in your MySQL client and rehash would occur, allowing you to utilize auto-complete. Personally, I prefer this alternative if my interactions with database are not so often, otherwise I still think that starting with &#8211;auto-rehash is easier, and speed penalty is not that big.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/01/28/mysql-how-to-enable-auto-completion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Простой способ получить инвайт на хабрахабр..</title>
		<link>http://www.phpmag.ru/2009/01/20/habrahabr-invites/</link>
		<comments>http://www.phpmag.ru/2009/01/20/habrahabr-invites/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 04:28:09 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Links]]></category>
		<category><![CDATA[инвайты]]></category>
		<category><![CDATA[хабра]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=319</guid>
		<description><![CDATA[Наконец-то появился нормальный способ получить инвайт на хабрахабр. Объяснялка &#8220;под катом&#8221;.. На просторах net&#8217;а мне много раз встречались посты/коментарии, где люди недоумевали как получить инвайт на Хабру. И если до этого процесс получения вождленного инвайта был достаточно непонятным, то с этого месяца ситуация в корне изменилась. Теперь, для того чтобы зарегиться на сайте, нужно просто [...]]]></description>
			<content:encoded><![CDATA[<p>Наконец-то появился нормальный способ получить инвайт на хабрахабр. Объяснялка &#8220;под катом&#8221;..</p>
<p><span id="more-319"></span>На просторах net&#8217;а мне много раз встречались посты/коментарии, где люди недоумевали как получить инвайт на <a href="http://habrahabr.ru">Хабру</a>. И если до этого процесс получения вождленного инвайта был достаточно непонятным, то с этого месяца ситуация в корне изменилась. Теперь, для того чтобы зарегиться на сайте, нужно просто сильно этого захотеть&#8230;и написать свою <em>оригинальную</em> статью на тему одного из хабратопиков. После чего сообщить хабраволонтеру о своем шедевре. Если хабраволонтер согласиться опубликовать ваш пост от своего аккаунта, и при условии что пост наберет 50+ голосов, топикстартеру будет передан инвайт, который он, в свою очередь, перешлет вам. Достаточно честно? Думаю, да.</p>
<p>П.С. <a href="http://habrahabr.ru/blogs/invites/49565/">список хабраволонтеров</a> на январь 2009</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/01/20/habrahabr-invites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Knol &#8211; reviewing new Google Service</title>
		<link>http://www.phpmag.ru/2009/01/18/knol-reviewing-new-google-service/</link>
		<comments>http://www.phpmag.ru/2009/01/18/knol-reviewing-new-google-service/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 23:47:39 +0000</pubDate>
		<dc:creator>Victor Farazdagi</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.phpmag.ru/?p=289</guid>
		<description><![CDATA[Сегодня забрел на http://knol.google.com/k/ сервис позволяющий делиться своими знаниями, записывая их в так называемые &#8220;нолы&#8221; (knols) &#8211; что-то вроде битов знаний Из объяснялки на самом сайте: A knol is an authoritative article about a specific topic. то бишь, &#8220;Нол&#8221; это авторитетная статья на определенную тему. Что это нам дает? По-мне, так это что-то вроде википедии, [...]]]></description>
			<content:encoded><![CDATA[<p>Сегодня забрел на <a href="http://knol.google.com/k/">http://knol.google.com/k/</a> сервис позволяющий делиться своими знаниями, записывая их в так называемые &#8220;нолы&#8221; (knols) &#8211; что-то вроде битов знаний <img src='http://www.phpmag.ru/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Из объяснялки на самом сайте:</p>
<p style="text-align: left;"><em><span>A knol is an authoritative article about a specific topic.</span></em></p>
<p><span>то бишь, </span></p>
<p><em><span>&#8220;Нол&#8221; это авторитетная статья на определенную тему.</span></em></p>
<p><span>Что это нам дает? По-мне, так это что-то вроде википедии, однако контроль над статьей остается за ее автором, а не за комьюнити. В целом, мне идея не очень понравилась. Сама идея-то &#8211; ничего, просто мне всегда не по себе когда какая-либо компания начинает заниматься всем и вся. Гугл сделал отличный поисковик, плюс еще 3-4 хороших сервиса, после чего &#8220;Остапа понесло&#8221; и они уже успели отметиться даже собственным <a href="http://www.google.com/chrome">браузером</a>. Кроме того, любителей делиться знаниями, приглашаю на <a href="http://www.wikipedia.org/">Wikipedia</a> &#8211; фактически каждый net-юзер ее использует, если не ежедневно то достаточно часто, написать о предмете, который знаешь хорошо &#8211; одна из возможностей поддержать проект.<br />
</span></p>
<p><span> В общем, стоит понаблюдать за развитием этого сервиса &#8211; особенно сейчас в пору кризиса, когда несколько других (нерентабельных) проектов были закрыты (точнее было объявленно об их закрытии, фактически пока все сервисы Гугл пашут).</span></p>
<p><span>Удачных выходных!<br />
</span></p>
<p><span><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpmag.ru/2009/01/18/knol-reviewing-new-google-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
