<?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>kdelchev.com</title>
	<atom:link href="http://kdelchev.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kdelchev.com</link>
	<description>web developer</description>
	<lastBuildDate>Thu, 09 May 2013 18:10:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Ruby NET::HTTP requests library cheatsheet</title>
		<link>http://kdelchev.com/2013/05/ruby-nethttp-requests-library-cheatsheet/</link>
		<comments>http://kdelchev.com/2013/05/ruby-nethttp-requests-library-cheatsheet/#comments</comments>
		<pubDate>Thu, 09 May 2013 18:10:06 +0000</pubDate>
		<dc:creator>kode</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[http]]></category>

		<guid isPermaLink="false">http://kdelchev.com/?p=194</guid>
		<description><![CDATA[Nice cheat sheet resource of Ruby HTTP requests is published on rubyinside.com. Since the comments are disabled I decided to add one note here: When using uri = URI.parse("http://google.com/") it is good practice to encode the url with URI.encode("http://google.com", "[]")<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://kdelchev.com/2013/05/ruby-nethttp-requests-library-cheatsheet/">Read more &#8250;</a></div><!-- end of .read-more -->]]></description>
				<content:encoded><![CDATA[<p>Nice cheat sheet resource of Ruby HTTP requests is published on <a title="RubyInside" href="http://www.rubyinside.com/nethttp-cheat-sheet-2940.html" target="_blank">rubyinside.com</a>. Since the comments are disabled I decided to add one note here:</p>
<p>When using</p>
<pre>uri = URI.parse("http://google.com/")</pre>
<p>it is good practice to encode the url with</p>
<pre>URI.encode("http://google.com", "[]")</pre>
<p>The second argument is optional and could be regex or string. In case of string the symbols are escaped. Check the <a title="Ruby 1.9.3 URI.escape" href="http://www.ruby-doc.org/stdlib-2.0/libdoc/uri/rdoc/URI/Escape.html#method-i-encode" target="_blank">docs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kdelchev.com/2013/05/ruby-nethttp-requests-library-cheatsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tools for cleaning your CSS files</title>
		<link>http://kdelchev.com/2013/04/tools-cleaning-css-files/</link>
		<comments>http://kdelchev.com/2013/04/tools-cleaning-css-files/#comments</comments>
		<pubDate>Tue, 16 Apr 2013 19:17:22 +0000</pubDate>
		<dc:creator>kode</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[cleanup]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://kdelchev.com/?p=190</guid>
		<description><![CDATA[Few useful tools for analyzing unused CSS and cleaning it. I will sure forget later, so I am adding the links in order to have them: https://github.com/zmoazeni/csscss https://github.com/geuis/helium-css http://www.cleancss.com/ http://www.makeuseof.com/dir/csssuperscrub-make-css-cleaner/]]></description>
				<content:encoded><![CDATA[<p>Few useful tools for analyzing unused <a href="http://kdelchev.com/category/css/" title="CSS posts">CSS</a> and cleaning it. I will sure forget later, so I am adding the links in order to have them:</p>
<p><a title="csscss" href="https://github.com/zmoazeni/csscss" target="_blank">https://github.com/zmoazeni/csscss</a></p>
<p><a title="Helium CSS" href="https://github.com/geuis/helium-css" target="_blank">https://github.com/geuis/helium-css</a></p>
<p><a title="Cleancss" href="http://www.cleancss.com/" target="_blank">http://www.cleancss.com/</a></p>
<p><a title="Css super scrub" href="http://www.makeuseof.com/dir/csssuperscrub-make-css-cleaner/" target="_blank">http://www.makeuseof.com/dir/csssuperscrub-make-css-cleaner/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kdelchev.com/2013/04/tools-cleaning-css-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrade Postgres minor version on Ubuntu</title>
		<link>http://kdelchev.com/2013/04/upgrade-postgres-minor-version-ubuntu/</link>
		<comments>http://kdelchev.com/2013/04/upgrade-postgres-minor-version-ubuntu/#comments</comments>
		<pubDate>Mon, 08 Apr 2013 19:52:40 +0000</pubDate>
		<dc:creator>kode</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Postgres]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://kdelchev.com/?p=188</guid>
		<description><![CDATA[I am not a DBA, but recently I have to upgrade Postrges minor version with a security update. This is not either a tutorial or some best practice, but some small snippet of the command you will need, before doing<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://kdelchev.com/2013/04/upgrade-postgres-minor-version-ubuntu/">Read more &#8250;</a></div><!-- end of .read-more -->]]></description>
				<content:encoded><![CDATA[<p>I am not a DBA, but recently I have to upgrade Postrges minor version with a security update. This is not either a tutorial or some best practice, but some small snippet of the command you will need, before doing the upgrade. Always check the documentation, command arguments and be sure that a previously made backup will restore the database. If you are not experienced with <a href="http://kdelchev.com/category/linux/" title="Linux posts">Linux</a>, make sure that you have easy way to restore the system too.</p>
<p>First check the current version of postgres. I used</p>
<pre>apt-show-versions</pre>
<p>which is not installed by default on Ubuntu 12.04. You can add it with</p>
<pre>sudo apt-get install apt-show-versions</pre>
<p>Then run</p>
<pre>sudo apt-show-versions | grep postgresql</pre>
<p>to see the actual version of the package and if there is newer binary. make sure you execute</p>
<pre>sudo apt-get update</pre>
<p>to ensure you have an updated packages list.</p>
<p>Upgrading from Postgres 9.2.3 to 9.2.4 took about 10 minutes. The process stops and starts the DB daemon  automatically.</p>
]]></content:encoded>
			<wfw:commentRss>http://kdelchev.com/2013/04/upgrade-postgres-minor-version-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Railroady to generate UML diagrams for your project&#8217;s controllers and models</title>
		<link>http://kdelchev.com/2013/03/railroady-generate-uml-diagrams-project-controllers-models/</link>
		<comments>http://kdelchev.com/2013/03/railroady-generate-uml-diagrams-project-controllers-models/#comments</comments>
		<pubDate>Tue, 19 Mar 2013 23:08:37 +0000</pubDate>
		<dc:creator>kode</dc:creator>
				<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[uml]]></category>

		<guid isPermaLink="false">http://kdelchev.com/?p=185</guid>
		<description><![CDATA[Introduction Railroady is a Railroad fork, a Ruby On Rails diagram generator for models and controllers. If you are using Rails 2.3.x with Ruby 1.8.7 checkout Railroad gem. Otherwise use Railroady with Rails 3.x. Both gems are using graphviz open<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://kdelchev.com/2013/03/railroady-generate-uml-diagrams-project-controllers-models/">Read more &#8250;</a></div><!-- end of .read-more -->]]></description>
				<content:encoded><![CDATA[<p><strong>Introduction</strong><br />
<a title="Railroady" href="https://github.com/preston/railroady" target="_blank">Railroady</a> is a Railroad fork, a Ruby On Rails diagram generator for models and controllers. If you are using Rails 2.3.x with Ruby 1.8.7 checkout <a title="Railroad diagrams generator" href="http://railroad.rubyforge.org/" target="_blank">Railroad gem</a>. Otherwise use <a title="Railroady" href="https://github.com/preston/railroady" target="_blank">Railroady</a> with Rails 3.x.</p>
<p>Both gems are using <a title="graphviz tools" href="http://www.graphviz.org/" target="_blank">graphviz</a> open source tools for painting diagrams and convert them in PNG or SVG format. There is one more useful open source tool for editing svg formats <a title="Inkscape svg editor" href="http://inkscape.org/" target="_blank">Inkscape</a> (open source illustrator).</p>
<p><strong>Some snippets</strong><br />
I tried Railroady and it is pretty straightforward to use it. There are two options to add it &#8211; either in your Gemfile</p>
<pre>group :development do
  gem 'railroady'
end</pre>
<p>or install it as separate gem with</p>
<pre>gem install railroady</pre>
<p>Adding it as a gem has one plus &#8211; it adds rake tasks to your project, which is easier to use.</p>
<p>Here are some snippets to generate models and controllers UML diagrams in dot format</p>
<pre>railroady -o models.dot -M
railroady -o controllers.dot -C</pre>
<p>Converting the dot files to PNG</p>
<pre>dot -Tpng models.dot &gt; models.png
neato -Tpng controllers.dot &gt; controllers.png</pre>
<p>Or in svg files format</p>
<pre>dot -Tsvg models.dot &gt; models.svg
neato -Tscg controllers.dot &gt; controllers.svg</pre>
<p>Note the graphviz tools bin directory should be in your environment path. Check the <a title="Railroady" href="https://github.com/preston/railroady" target="_blank">repo</a> for more examples and additional documentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://kdelchev.com/2013/03/railroady-generate-uml-diagrams-project-controllers-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connecting Matlab to Postgres database</title>
		<link>http://kdelchev.com/2013/03/connecting-matlab-postgres-database/</link>
		<comments>http://kdelchev.com/2013/03/connecting-matlab-postgres-database/#comments</comments>
		<pubDate>Fri, 15 Mar 2013 17:50:45 +0000</pubDate>
		<dc:creator>kode</dc:creator>
				<category><![CDATA[Postgres]]></category>
		<category><![CDATA[Matlab]]></category>

		<guid isPermaLink="false">http://kdelchev.com/?p=184</guid>
		<description><![CDATA[Assumptions My primary focus is not on Matlab, but I used it for a while in the Uni. I have to support connecting Matlab installed on Windows machine with Postgres 9.2 database. I used the Matlab command window, so this<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://kdelchev.com/2013/03/connecting-matlab-postgres-database/">Read more &#8250;</a></div><!-- end of .read-more -->]]></description>
				<content:encoded><![CDATA[<p><strong>Assumptions</strong><br />
My primary focus is not on Matlab, but I used it for a while in the Uni. I have to support connecting Matlab installed on Windows machine with Postgres 9.2 database. I used the Matlab command window, so this have to be straightforward to do on you environment, assuming the database driver do not differ much in other environments.</p>
<p><strong>Connection configuration</strong><br />
Connecting Matlab to Postgres requires to have JDBC driver, which you can download from <a title="JDBC Driver" href="http://jdbc.postgresql.org/download.html" target="_blank">here</a>. Select current version or choose one appropriate for you OS from the Supported versions table. Put the jar file somewhere in your drive. I put mine at &#8220;C:\Program Files\MATLAB\R2011b\java\jar\postgresql-9.2-1002.jdbc4.jar&#8221; (1). Open Matlab command window and type</p>
<pre>edit classpath.txt</pre>
<p>Add the full path (quoted above) at the end of the file. In my case I added &#8220;$matlabroot/java/jar/postgresql-9.2-1002.jdbc4.jar&#8221; (2). Then close and start Matlab and verify the driver is loaded with typing in command window</p>
<pre>javaclasspath</pre>
<p>You should see the added driver path (1) above. Matlab supports connecting with and without SSL. Here are example strings to use in either cases:</p>
<pre>JDBC Driver: org.postgresql.Driver
Database URL:jdbc:postgresql://localhost:5432/database_name

JDBC Driver: org.postgresql.Driver
Database URL: jdbc:postgresql:servername:database_name:ssl=true&amp;sslfactory=org.postgresql.ssl.NonValidatingFactory&amp;</pre>
<p><strong>Querying connection</strong><br />
Connection string should look like</p>
<pre>conn = database(database_name, database_user, user_password, 'Vendor', 'PostGreSQL');</pre>
<p>Here is example to query &#8220;database_table&#8221; and show the data for the first row:</p>
<pre>conn = database('database_name', 'database_user', 'user_password', 'org.postgresql.Driver', 'jdbc:postgresql://123.123.123:5432/database_name')
curs = exec(conn, ['SELECT * FROM "database_table";']);
row = fetch(curs, 1);
row.Data</pre>
<p>Used arguments are self explaining and should be straightforward to follow.</p>
]]></content:encoded>
			<wfw:commentRss>http://kdelchev.com/2013/03/connecting-matlab-postgres-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cannot load such file &#8212; mkmf</title>
		<link>http://kdelchev.com/2013/03/annot-load-file-mkmf/</link>
		<comments>http://kdelchev.com/2013/03/annot-load-file-mkmf/#comments</comments>
		<pubDate>Tue, 05 Mar 2013 21:38:07 +0000</pubDate>
		<dc:creator>kode</dc:creator>
				<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[bcrypt-ruby]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[gem]]></category>

		<guid isPermaLink="false">http://kdelchev.com/?p=182</guid>
		<description><![CDATA[Installing bcrypt-ruby give this error: Installing bcrypt-ruby (3.0.1) Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.     /usr/bin/ruby1.9.1 extconf.rb /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- mkmf (LoadError)     from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'     from extconf.rb:36:in `&#60;main&#62;' This has a dependency<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://kdelchev.com/2013/03/annot-load-file-mkmf/">Read more &#8250;</a></div><!-- end of .read-more -->]]></description>
				<content:encoded><![CDATA[<p>Installing bcrypt-ruby give this error:</p>
<pre>Installing bcrypt-ruby (3.0.1) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby1.9.1 extconf.rb 
/usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- mkmf (LoadError)
    from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
    from extconf.rb:36:in `&lt;main&gt;'</pre>
<p>This has a dependency with the dev package, which one can install with</p>
<pre>sudo gem install ruby1.9.1-dev</pre>
<p>Here is a list of all packages needed when installing rvm.</p>
<pre>sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://kdelchev.com/2013/03/annot-load-file-mkmf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invalid date format in gemspecs</title>
		<link>http://kdelchev.com/2013/03/invalid-date-format-gemspecs/</link>
		<comments>http://kdelchev.com/2013/03/invalid-date-format-gemspecs/#comments</comments>
		<pubDate>Mon, 04 Mar 2013 21:22:14 +0000</pubDate>
		<dc:creator>kode</dc:creator>
				<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[invalid date format]]></category>
		<category><![CDATA[rubygems]]></category>

		<guid isPermaLink="false">http://kdelchev.com/?p=181</guid>
		<description><![CDATA[Spotted several lines with invalid date format when installing a gem invalid date format in specification: "2011-08-25 00:00:00.000000000Z" While one can go through the gems specs and fix the format, one can just install rubygems-update sudo gem install rubygems-update Then<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://kdelchev.com/2013/03/invalid-date-format-gemspecs/">Read more &#8250;</a></div><!-- end of .read-more -->]]></description>
				<content:encoded><![CDATA[<p>Spotted several lines with invalid date format when installing a gem</p>
<pre>invalid date format in specification: "2011-08-25 00:00:00.000000000Z"</pre>
<p>While one can go through the gems specs and fix the format, one can just install rubygems-update</p>
<pre>sudo gem install rubygems-update</pre>
<p>Then run that command and should be good to go.</p>
<pre>sudo update_rubygems</pre>
]]></content:encoded>
			<wfw:commentRss>http://kdelchev.com/2013/03/invalid-date-format-gemspecs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error installing json and Failed to build gem native extension &#8211; Windows specific</title>
		<link>http://kdelchev.com/2013/02/error-installing-json-failed-build-gem-native-extension-windows-specific/</link>
		<comments>http://kdelchev.com/2013/02/error-installing-json-failed-build-gem-native-extension-windows-specific/#comments</comments>
		<pubDate>Tue, 19 Feb 2013 09:36:32 +0000</pubDate>
		<dc:creator>kode</dc:creator>
				<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[Bundler]]></category>
		<category><![CDATA[json gem]]></category>

		<guid isPermaLink="false">http://kdelchev.com/?p=178</guid>
		<description><![CDATA[After updating Windows bundle install and gem install json gives the following error ERROR: Error installing json. ERROR: Failed to build gem native extension. Found solution here. In my case it happen after Windows update and &#8220;Scenario B&#8221; worked for<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://kdelchev.com/2013/02/error-installing-json-failed-build-gem-native-extension-windows-specific/">Read more &#8250;</a></div><!-- end of .read-more -->]]></description>
				<content:encoded><![CDATA[<p>After updating Windows <strong>bundle install</strong> and <strong>gem install json</strong> gives the following error</p>
<pre>ERROR: Error installing json.
ERROR: Failed to build gem native extension.</pre>
<p>Found solution <a title="Ruby Installer troubleshooting guide" href="https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-gems_fails_comspec_autorun" target="_blank">here</a>. In my case it happen after Windows update and &#8220;Scenario B&#8221; worked for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://kdelchev.com/2013/02/error-installing-json-failed-build-gem-native-extension-windows-specific/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convert column to geometry in Postgres</title>
		<link>http://kdelchev.com/2013/02/convert-column-geometry-postgres/</link>
		<comments>http://kdelchev.com/2013/02/convert-column-geometry-postgres/#comments</comments>
		<pubDate>Thu, 07 Feb 2013 15:48:44 +0000</pubDate>
		<dc:creator>kode</dc:creator>
				<category><![CDATA[Postgres]]></category>
		<category><![CDATA[convert column]]></category>

		<guid isPermaLink="false">http://kdelchev.com/?p=176</guid>
		<description><![CDATA[I noticed a column in Postgres which is varchar, but has geo information and should be geometry. Here are short steps to do in order to convert the data in geometry instead of varchar. 1. Rename the column to the_geom_1<span class="ellipsis">&#8230;</span><div class="read-more"><a href="http://kdelchev.com/2013/02/convert-column-geometry-postgres/">Read more &#8250;</a></div><!-- end of .read-more -->]]></description>
				<content:encoded><![CDATA[<p>I noticed a column in Postgres which is varchar, but has geo information and should be geometry. Here are short steps to do in order to convert the data in geometry instead of varchar.</p>
<p>1. Rename the column to the_geom_1</p>
<p>2. Then add geometry column</p>
<pre>SELECT AddGeometryColumn('table_name', 'the_geom', 4326, 'POINT', 2)</pre>
<p>3. Move the data from the varchar column to the geometry column</p>
<pre>UPDATE table_name SET the_geom = 'SRID=4326;' || ST_AsText(ST_GeomFromEWKT(the_geom_1))</pre>
]]></content:encoded>
			<wfw:commentRss>http://kdelchev.com/2013/02/convert-column-geometry-postgres/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sync Total Commander pane navigation</title>
		<link>http://kdelchev.com/2012/12/sync-total-commander-pane-navigation/</link>
		<comments>http://kdelchev.com/2012/12/sync-total-commander-pane-navigation/#comments</comments>
		<pubDate>Mon, 17 Dec 2012 21:54:01 +0000</pubDate>
		<dc:creator>kode</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[folder sync]]></category>
		<category><![CDATA[Total Commander]]></category>

		<guid isPermaLink="false">http://kdelchev.com/?p=171</guid>
		<description><![CDATA[A quick shortcut command for synchronizing Total Commander panes navigation. Copy / paste it in the command line to turn on / off. cm_SyncChangeDir]]></description>
				<content:encoded><![CDATA[<p>A quick shortcut command for synchronizing Total Commander panes navigation. Copy / paste it in the command line to turn on / off.</p>
<pre>cm_SyncChangeDir</pre>
]]></content:encoded>
			<wfw:commentRss>http://kdelchev.com/2012/12/sync-total-commander-pane-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
