<?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>skipperkongen.dk</title>
	<atom:link href="http://skipperkongen.dk/feed/" rel="self" type="application/rss+xml" />
	<link>http://skipperkongen.dk</link>
	<description>Trying stuff with code</description>
	<lastBuildDate>Tue, 21 Feb 2012 21:37:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Pointers for GDAL and Python</title>
		<link>http://skipperkongen.dk/2012/02/21/pointers-for-gdal-and-python/</link>
		<comments>http://skipperkongen.dk/2012/02/21/pointers-for-gdal-and-python/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 21:32:15 +0000</pubDate>
		<dc:creator>kostas</dc:creator>
				<category><![CDATA[GIS]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://skipperkongen.dk/?p=1540</guid>
		<description><![CDATA[GDAL is not very well documented, and a complete Python API documentation site is not something I&#8217;ve found. So here are the best tutorials I&#8217;ve found so far for GDAL + Python. GDAL Python samples on osgeo.org http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/ Tutorial This tutorial is titled &#8220;Create beautiful hillshade maps from digital elevation models with GDAL and Mapnik&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>GDAL is not very well documented, and a complete Python API documentation site is not something I&#8217;ve found. So here are the best tutorials I&#8217;ve found so far for GDAL + Python.</p>
<h2>GDAL Python samples on osgeo.org</h2>
<p><a href="http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/">http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/</a></p>
<h2>Tutorial</h2>
<p>This tutorial is titled &#8220;Create beautiful hillshade maps from digital elevation models with GDAL and Mapnik&#8221; and is from 2011.</p>
<p><a href="http://www.mikejcorey.com/wordpress/2011/02/05/tutorial-create-beautiful-hillshade-maps-from-digital-elevation-models-with-gdal-and-mapnik/">http://www.mikejcorey.com/wordpress/2011/02/05/tutorial-create-beautiful-hillshade-maps-from-digital-elevation-models-with-gdal-and-mapnik/</a></p>
<p>This tutorial provides you with all the data you need to create a hill-shade image.</p>
<h2>Course</h2>
<p>This is the course material for a GIS course at Utah State University. The course was titled &#8220;Geoprocessing with Python using Open Source GIS&#8221;.</p>
<p><a href="http://www.gis.usu.edu/~chrisg/python/">http://www.gis.usu.edu/~chrisg/python/</a></p>
<p>This is a course homepage, and there is a <a href="http://www.gis.usu.edu/~chrisg/python/os_python_garrard_data.zip">zip-file</a> that contains data and samples.</p>
<h2>Another collection of GDAL tutorials</h2>
<p><a href="http://www.cartotalk.com/index.php?showtopic=5144">http://www.cartotalk.com/index.php?showtopic=5144</a></p>
]]></content:encoded>
			<wfw:commentRss>http://skipperkongen.dk/2012/02/21/pointers-for-gdal-and-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing data from a CSV file into a Postgres table</title>
		<link>http://skipperkongen.dk/2012/02/21/importing-data-from-a-csv-file-into-a-postgres-table/</link>
		<comments>http://skipperkongen.dk/2012/02/21/importing-data-from-a-csv-file-into-a-postgres-table/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 15:23:55 +0000</pubDate>
		<dc:creator>kostas</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[GIS]]></category>

		<guid isPermaLink="false">http://skipperkongen.dk/?p=1290</guid>
		<description><![CDATA[Simple CSV file import You have a CSV file called &#8220;data.csv&#8221;. It has a header line, and is delimited using &#8220;;&#8221;. You want to import it into Postgres and a table called &#8220;your_table&#8221;: Create the database table. Set column-types so the string fields in the CSV file, can be cast to values in columns. CREATE [...]]]></description>
			<content:encoded><![CDATA[<h2>Simple CSV file import</h2>
<p>You have a CSV file called &#8220;data.csv&#8221;. It has a header line, and is delimited using &#8220;;&#8221;. You want to import it into Postgres and a table called &#8220;your_table&#8221;:</p>
<p>Create the database table. Set column-types so the string fields in the CSV file, can be cast to values in columns.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> your_table
<span style="color: #66cc66;">&#40;</span>
  <span style="color: #808080; font-style: italic;">-- Your columns</span>
<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Execute COPY command:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">COPY your_table <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #ff0000;">'/path/to/csv/file/data.csv'</span> <span style="color: #993333; font-weight: bold;">WITH</span> DELIMITER <span style="color: #ff0000;">';'</span> CSV HEADER;</pre></div></div>

<h2>If the data is geospatial</h2>
<p>Another option is using ogr2ogr, which has a CSV driver. The COPY command could be faster.</p>
<p>If you have point data, check out this howto: <a href="http://www.spatialdbadvisor.com/postgis_tips_tricks/118/loading-point-data-from-a-csv-file-in-postgis">Loading Point Data from a CSV File into PostGIS</a></p>
]]></content:encoded>
			<wfw:commentRss>http://skipperkongen.dk/2012/02/21/importing-data-from-a-csv-file-into-a-postgres-table/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Low tech male/female voice detection system</title>
		<link>http://skipperkongen.dk/2012/02/19/low-tech-malefemale-voice-detection-system/</link>
		<comments>http://skipperkongen.dk/2012/02/19/low-tech-malefemale-voice-detection-system/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 12:46:59 +0000</pubDate>
		<dc:creator>kostas</dc:creator>
				<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://skipperkongen.dk/?p=1527</guid>
		<description><![CDATA[I was drinking a bootle of water, while listening to a group of people having a debate. As the water level sunk, I noticed something. In the beginning the bottle would resonate/vibrate when the people with higher pitch voices talked. When the bottle was nearly empty, it would resonate/vibrate (and more so) when people with [...]]]></description>
			<content:encoded><![CDATA[<p>I was drinking a bootle of water, while listening to a group of people having a debate. As the water level sunk, I noticed something. In the beginning the bottle would <a href="http://en.wikipedia.org/wiki/Standing_wave">resonate/vibrate</a> when the people with higher pitch voices talked. When the bottle was nearly empty, it would resonate/vibrate (and more so) when people with bassier voices talked.</p>
<p>Using bottles of water (with different waterlevels) and a vibration sensor on each, one could make a low tech thing that detects whether a male or female is speaking in the room. Why not use a microphone and a spectrum analyzer? Well, because you are McGyver and you&#8217;re caught in some prison, and mission dictates that you find out when the guy with the really bassy voice enters the room. You know, ad hoc spy stuff.</p>
<p>Here is a figure that illustrates the &#8220;Low Tech Male/Female Voice Detection System&#8221;:</p>
<p><img src="https://docs.google.com/drawings/pub?id=1KtSg7MWEC8WQsgvtzkMJxV_Hqnd9DNKbpaB2imP-Dec&amp;w=800&amp;h=600"></p>
]]></content:encoded>
			<wfw:commentRss>http://skipperkongen.dk/2012/02/19/low-tech-malefemale-voice-detection-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Really easy 3D graphics in LaTeX</title>
		<link>http://skipperkongen.dk/2012/02/08/really-easy-3d-graphics-in-latex/</link>
		<comments>http://skipperkongen.dk/2012/02/08/really-easy-3d-graphics-in-latex/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 18:19:04 +0000</pubDate>
		<dc:creator>kostas</dc:creator>
				<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://skipperkongen.dk/?p=1500</guid>
		<description><![CDATA[Note: The word &#8220;easy&#8221; is relative to the other solutions I found for doing 3D graphics in LaTeX. The following template is adapted from the annotated 3d box example. % Template for drawing with tikz 3D package \documentclass[]{article} \usepackage{tikz} \usetikzlibrary{3d} &#160; \begin{document} &#160; % Draw a 3D coordinate system &#160; \begin{center} \begin{tikzpicture}[x = {(1cm,0cm)}, y [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note</strong>: The word &#8220;easy&#8221; is relative to the other solutions I found for doing 3D graphics in LaTeX.</p>
<p>The following template is adapted from the <a href="http://www.texample.net/tikz/examples/annotated-3d-box/">annotated 3d box</a> example.</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #2C922C; font-style: italic;">% Template for drawing with tikz 3D package</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">documentclass</span><span style="color: #E02020; ">[</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">article</span><span style="color: #E02020; ">}</span>
<span style="color: #E02020; ">\</span><span style="color: #800000;">usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">tikz</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\usetikzlibrary</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">3d</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #2C922C; font-style: italic;">% Draw a 3D coordinate system</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">center</span></span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tikzpicture</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">x  = {<span style="color: #2020C0; font-weight: normal;">(1cm,0cm)</span><span style="color: #E02020; ">}</span>,
                    y  = <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">(0.4cm,0.6cm)</span><span style="color: #E02020; ">}</span>,
                    z  = <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">(0cm,1cm)</span><span style="color: #E02020; ">}</span>,
                    scale = 1,
                    color = <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">lightgray</span>}</span><span style="color: #E02020; ">]</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">scope</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">canvas is xy plane at z=0</span><span style="color: #E02020; ">]</span>
  <span style="color: #2C922C; font-style: italic;">% x-axis</span>
  <span style="color: #800000; font-weight: normal;">\draw</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">blue,-&gt;</span><span style="color: #E02020; ">]</span> (0,0) -- (5,0) node (x-axis) <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">right</span><span style="color: #E02020; ">]</span> <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #8020E0; font-weight: normal;">$x$</span></span><span style="color: #E02020; ">}</span>;
  <span style="color: #2C922C; font-style: italic;">% y-axis</span>
  <span style="color: #800000; font-weight: normal;">\draw</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">red,-&gt;</span><span style="color: #E02020; ">]</span> (0,0) -- (0,5) node (y-axis) <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">above</span><span style="color: #E02020; ">]</span> <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #8020E0; font-weight: normal;">$y$</span></span><span style="color: #E02020; ">}</span>;
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">scope</span></span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">scope</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">canvas is yz plane at x=0</span><span style="color: #E02020; ">]</span>
  <span style="color: #2C922C; font-style: italic;">% z-axis</span>
  <span style="color: #800000; font-weight: normal;">\draw</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">green,-&gt;</span><span style="color: #E02020; ">]</span> (0,0) -- (0,5) node (z-axis) <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">above</span><span style="color: #E02020; ">]</span> <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #8020E0; font-weight: normal;">$z$</span></span><span style="color: #E02020; ">}</span>;
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">scope</span></span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tikzpicture</span></span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">center</span></span><span style="color: #E02020; ">}</span>
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">document</span></span><span style="color: #E02020; ">}</span></pre></div></div>

<p>The code is almost self-explanatory, but here is the explanation. You can draw in either the xy plane (for z=something), the xz plane (for y=something) or the yz plane (for x=something). If all you want to do is draw in these planes, then the above template is a good place to start. It draws a coordinate system.</p>
<p>The x, y and z values in the following snippet, defines the directions of the x, y and z axis, when projected onto your computer screen. Play around with the values and see what happens if you don&#8217;t get it right away:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tikzpicture</span></span><span style="color: #E02020; ">}[</span>x  = <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">(1cm,0cm)</span><span style="color: #E02020; ">}</span>,
                    y  = <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">(0.4cm,0.6cm)</span><span style="color: #E02020; ">}</span>,
                    z  = <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">(0cm,1cm)</span><span style="color: #E02020; ">}</span>,</pre></div></div>

<p>You pick the plane you want to draw in. To draw in the yz plane where it intersects the x-axis at x=0, do the following:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">scope</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">canvas is yz plane at x=0</span><span style="color: #E02020; ">]</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://skipperkongen.dk/2012/02/08/really-easy-3d-graphics-in-latex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Are IEEE papers getting less citations because of the paywall?</title>
		<link>http://skipperkongen.dk/2012/01/23/are-ieee-papers-getting-less-citations-because-of-the-paywall/</link>
		<comments>http://skipperkongen.dk/2012/01/23/are-ieee-papers-getting-less-citations-because-of-the-paywall/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 14:27:01 +0000</pubDate>
		<dc:creator>kostas</dc:creator>
				<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://skipperkongen.dk/?p=1492</guid>
		<description><![CDATA[I&#8217;m in the process of doing research for my computer science ph.d. project. Like many others, I&#8217;m using Google Scholar to find interesting papers for my research. Some papers are available through ACM and some through IEEE. My university only has a subscription with ACM, not with IEEE, so it&#8217;s free (for me) to read [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the process of doing research for my computer science ph.d. project. Like many others, I&#8217;m using Google Scholar to find interesting papers for my research. Some papers are available through <em>ACM</em> and some through <em>IEEE</em>. </p>
<p><a href="http://skipperkongen.dk/wp-content/uploads/2012/01/ieeevsacm.jpg"><img src="http://skipperkongen.dk/wp-content/uploads/2012/01/ieeevsacm.jpg" alt="" title="ieeevsacm" width="571" height="73" class="alignleft size-full wp-image-1493" /></a></p>
<p>My university only has a subscription with ACM, not with IEEE, so it&#8217;s free (for me) to read an ACM paper, while I have to pay to read or even download a citation of an IEEE paper. When I asked the faculty why we don&#8217;t have an IEEE subscription, the answer was: Because it is really expensive. <em>So what kind of papers do you think I&#8217;m looking at the most?</em></p>
<p>This makes me think: Will there eventually be a strong skew in the kinds of paper I&#8217;ll end up citing? Many citations of ACM papers, none or few of IEEE papers? For now the answer is a definite yes. When I&#8217;m snowballing on a keyword, I now tend to close browser tabs with IEEE papers more often than ACM papers. </p>
<p>I have no doubts. This is a problem for science!</p>
]]></content:encoded>
			<wfw:commentRss>http://skipperkongen.dk/2012/01/23/are-ieee-papers-getting-less-citations-because-of-the-paywall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to load an ESRI Shapefile into a PostGIS DB</title>
		<link>http://skipperkongen.dk/2012/01/20/how-to-load-an-esri-shapefile-into-a-postgis-db/</link>
		<comments>http://skipperkongen.dk/2012/01/20/how-to-load-an-esri-shapefile-into-a-postgis-db/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 15:21:40 +0000</pubDate>
		<dc:creator>kostas</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[GIS]]></category>
		<category><![CDATA[Linux fu]]></category>

		<guid isPermaLink="false">http://skipperkongen.dk/?p=1485</guid>
		<description><![CDATA[Assuming a shapefile called myshapefile.shp, a table mytable in schema xyz, in a PostGIS enabled database called mydb on localhost. The table is owned by user dbuser who has password &#8220;secret&#8221;. Using shp2pgsql shp2pgsql myshapefile -I xyz.mytable &#62; statements.sql psql -d mydb -h localhost -U dbuser -f statements.sql This tip and many more can be [...]]]></description>
			<content:encoded><![CDATA[<p>Assuming a shapefile called <tt>myshapefile.shp</tt>, a table <tt>mytable</tt> in schema <tt>xyz</tt>, in a PostGIS enabled database called <tt>mydb</tt> on localhost. The table is owned by user <tt>dbuser</tt> who has password &#8220;secret&#8221;.</p>
<h2>Using shp2pgsql</h2>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">shp2pgsql myshapefile <span style="color: #660033;">-I</span> xyz.mytable <span style="color: #000000; font-weight: bold;">&gt;</span> statements.sql
psql <span style="color: #660033;">-d</span> mydb <span style="color: #660033;">-h</span> localhost <span style="color: #660033;">-U</span> dbuser <span style="color: #660033;">-f</span> statements.sql</pre></div></div>

<p>This tip and many more can be read in <a href="http://download.osgeo.org/osgeo/foss4g/2009/SPREP/1Wed/Parkside%20GO3/1500/MakingMapsFast.pdf">Making Maps Fast</a>.</p>
<h2>Using ogr2ogr</h2>
<p>This is even easier with ogr2ogr:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ogr2ogr <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;PostgreSQL&quot;</span> PG:<span style="color: #ff0000;">&quot;host=localhost user=dbuser dbname=mydb password=secret&quot;</span> <span style="color: #660033;">-lco</span> <span style="color: #007800;">SCHEMA</span>=xyz myshapefile.shp</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://skipperkongen.dk/2012/01/20/how-to-load-an-esri-shapefile-into-a-postgis-db/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto make 3D graphics in LaTeX with tikz</title>
		<link>http://skipperkongen.dk/2012/01/18/3d-graphics-in-latex-with-tikz/</link>
		<comments>http://skipperkongen.dk/2012/01/18/3d-graphics-in-latex-with-tikz/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 16:23:53 +0000</pubDate>
		<dc:creator>kostas</dc:creator>
				<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://skipperkongen.dk/?p=1455</guid>
		<description><![CDATA[tikZ and LaTeX PGF/TikZ is a tandem of languages for producing vector graphics from a geometric/algebraic description. You can use this language inside tex files, to programmatically draw nice 2D and 3D graphics. Another package which some people prefer for 3D is asymptote. Read the manual. Tutorials for tikZ For more information read one of [...]]]></description>
			<content:encoded><![CDATA[<h2>ti<i>k</i>Z and LaTeX</h2>
<p>PGF/TikZ is a tandem of languages for producing vector graphics from a geometric/algebraic description. You can use this language inside tex files, to programmatically draw nice 2D and 3D graphics. Another package which some people prefer for 3D is asymptote.</p>
<p>Read the <a href="http://paws.wcu.edu/tsfoguel/tikzpgfmanual.pdf">manual</a>.</p>
<h2>Tutorials for ti<em>k</em>Z</h2>
<p> For more information read one of the <a href="http://www.tug.org/pracjourn/2007-1/mertz/mertz.pdf">tutorials</a> and the <a href="http://www.texample.net/tikz/resources/">tikz resources page</a>, which includes helpful tools etc.</p>
<p>There are tutorial videos online like <a href="http://river-valley.tv/media/conferences/tug2009/0101-Andrew_Mertz/">this video</a>. There are also tutorials on youtube like the following, but this does not cover 3D graphics unfortunately:</p>
<p><iframe width="420" height="315" src="http://www.youtube.com/embed/BxBJfBgntBw" frameborder="0" allowfullscreen></iframe></p>
<p>To learn how to make 3D stuff, start by looking at the examples below. If you can make sense of it&#8230;</p>
<h2>ti<i>k</i>Z 3D examples</h2>
<p>Look at the <a href="http://www.texample.net/tikz/examples/tag/3d/">3D tikz example page</a> for more 3D examples.</p>
<table>
<tr>
<td><img src="http://www.texample.net/media/tikz/examples/thumbs/3d-cone.jpg" alt="Example" /></td>
<td>[<a href="http://www.texample.net/media/tikz/examples/TEX/3d-cone.tex">TEX</a>]</td>
</tr>
<tr>
<td><img src="http://www.texample.net/media/tikz/examples/thumbs/map-projections.jpg" alt="Exampel 2" /></td>
<td>[<a href="http://www.texample.net/media/tikz/examples/TEX/map-projections.tex">TEX</a>]</td>
</table>
]]></content:encoded>
			<wfw:commentRss>http://skipperkongen.dk/2012/01/18/3d-graphics-in-latex-with-tikz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Node.js on EC2 64-bit microinstance running Amazon Linux</title>
		<link>http://skipperkongen.dk/2012/01/10/installing-node-js-on-ec2-64-bit-microinstance-running-amazon-linux/</link>
		<comments>http://skipperkongen.dk/2012/01/10/installing-node-js-on-ec2-64-bit-microinstance-running-amazon-linux/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 16:17:06 +0000</pubDate>
		<dc:creator>kostas</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Distributed systems]]></category>
		<category><![CDATA[Linux fu]]></category>

		<guid isPermaLink="false">http://skipperkongen.dk/?p=1442</guid>
		<description><![CDATA[Download sourcecode Choose the appropriate sourcecode version by going to http://nodejs.org/#download. wget http://nodejs.org/dist/v0.6.7/node-v0.6.7.tar.gz # or use curl Install g++ I found that the g++ is needed to install node.js from sourcecode. Found a hint about installing g++ on Amazon Linux, which basically tells you to do this: sudo yum install gcc-c++.x86_64 Install openssl To get [...]]]></description>
			<content:encoded><![CDATA[<h2>Download sourcecode</h2>
<p>Choose the appropriate sourcecode version by going to <a href="http://nodejs.org/#download">http://nodejs.org/#download</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>nodejs.org<span style="color: #000000; font-weight: bold;">/</span>dist<span style="color: #000000; font-weight: bold;">/</span>v0.6.7<span style="color: #000000; font-weight: bold;">/</span>node-v0.6.7.tar.gz <span style="color: #666666; font-style: italic;"># or use curl</span></pre></div></div>

<h2>Install g++</h2>
<p>I found that the g++ is needed to install node.js from sourcecode. Found a hint about <a href="http://www.lizardslair.com/server-admin/g-plus-plus-on-amazon-instance">installing g++ on Amazon Linux</a>, which basically tells you to do this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> yum <span style="color: #c20cb9; font-weight: bold;">install</span> gcc-c++.x86_64</pre></div></div>

<h2>Install openssl</h2>
<p>To get ssl support, you need to install openssl-devel.x86_64 which is not installed by default (only binary version). Alternately you can install without ssl support with ./configure &#8211;without-ssl. (thanks to my colleague Elias Löfgren for helping out here)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> yum <span style="color: #c20cb9; font-weight: bold;">install</span> openssl-devel.x86_64</pre></div></div>

<h2>Install make</h2>
<p>(thanks Daniel for pointing this out)</p>
<pre>
sudo yum install -y make.x86_64
</pre>
<h2>Install Node.js</h2>
<p>Now you can configure, make, install:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>configure
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://skipperkongen.dk/2012/01/10/installing-node-js-on-ec2-64-bit-microinstance-running-amazon-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hello world plugin for Nagios in Python</title>
		<link>http://skipperkongen.dk/2011/12/06/hello-world-plugin-for-nagios-in-python/</link>
		<comments>http://skipperkongen.dk/2011/12/06/hello-world-plugin-for-nagios-in-python/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 13:22:18 +0000</pubDate>
		<dc:creator>kostas</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[System monitoring]]></category>

		<guid isPermaLink="false">http://skipperkongen.dk/?p=1406</guid>
		<description><![CDATA[Nagios looks at 1) return codes and 2) output to stdout. This is the hello world of Nagios plugins, written in Python: check_helloworld.py: #!/usr/bin/env python &#160; # optparse is Python 2.3 - 2.6, deprecated in 2.7 # For 2.7+ use http://docs.python.org/library/argparse.html#module-argparse from optparse import OptionParser &#160; # CONSTANTS FOR RETURN CODES UNDERSTOOD BY NAGIOS # [...]]]></description>
			<content:encoded><![CDATA[<p>Nagios looks at 1) return codes and 2) output to stdout. This is the hello world of Nagios plugins, written in Python:</p>
<p><tt>check_helloworld.py</tt>:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># optparse is Python 2.3 - 2.6, deprecated in 2.7</span>
<span style="color: #808080; font-style: italic;"># For 2.7+ use http://docs.python.org/library/argparse.html#module-argparse</span>
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">optparse</span> <span style="color: #ff7700;font-weight:bold;">import</span> OptionParser
&nbsp;
<span style="color: #808080; font-style: italic;"># CONSTANTS FOR RETURN CODES UNDERSTOOD BY NAGIOS</span>
<span style="color: #808080; font-style: italic;"># Exit statuses recognized by Nagios</span>
UNKNOWN = -<span style="color: #ff4500;">1</span>
OK = <span style="color: #ff4500;">0</span>
WARNING = <span style="color: #ff4500;">1</span>
CRITICAL = <span style="color: #ff4500;">2</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># TEMPLATE FOR READING PARAMETERS FROM COMMANDLINE</span>
<span style="color: #dc143c;">parser</span> = OptionParser<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #dc143c;">parser</span>.<span style="color: black;">add_option</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;-m&quot;</span>, <span style="color: #483d8b;">&quot;--message&quot;</span>, dest=<span style="color: #483d8b;">&quot;message&quot;</span>, 
   default=<span style="color: #483d8b;">'Hello world'</span>, <span style="color: #008000;">help</span>=<span style="color: #483d8b;">&quot;A message to print after OK - &quot;</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#40;</span>options, args<span style="color: black;">&#41;</span> = <span style="color: #dc143c;">parser</span>.<span style="color: black;">parse_args</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># RETURN OUTPUT TO NAGIOS</span>
<span style="color: #808080; font-style: italic;"># USING THE EXAMPLE -m PARAMETER PARSED FROM COMMANDLINE</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'OK - %s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>options.<span style="color: black;">message</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">raise</span> <span style="color: #008000;">SystemExit</span>, OK</pre></div></div>

<p>Define a command that uses this plugin:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">define <span style="color: #7a0874; font-weight: bold;">command</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    command_name    check_hello_world
    command_line    <span style="color: #007800;">$USER1</span>$<span style="color: #000000; font-weight: bold;">/</span>check_hello_world.py <span style="color: #660033;">-m</span> <span style="color: #ff0000;">'some message'</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>Check a host or service using the command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">define service <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    use         generic-service
    host_name           some-host
    service_description Check using the hello world plugin <span style="color: #7a0874; font-weight: bold;">&#40;</span>always returns OK<span style="color: #7a0874; font-weight: bold;">&#41;</span>
    check_command       check_hello_world
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://skipperkongen.dk/2011/12/06/hello-world-plugin-for-nagios-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Saving output from &#8216;text to speech&#8217; to a file on Mac OS X</title>
		<link>http://skipperkongen.dk/2011/12/04/saving-output-from-text-to-speech-to-file-on-mac-os-x/</link>
		<comments>http://skipperkongen.dk/2011/12/04/saving-output-from-text-to-speech-to-file-on-mac-os-x/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 12:02:01 +0000</pubDate>
		<dc:creator>kostas</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Linux fu]]></category>

		<guid isPermaLink="false">http://skipperkongen.dk/?p=1398</guid>
		<description><![CDATA[In terminal you can write something like: say 'hello world' Which will make your computer talk. To save the audio output to a file, use the -o option. A full example is: say -o hello.aiff -v 'Alex' 'Hello, my name is Alex' open hello.aiff This will say &#8216;Hello, my name is Alex&#8217;, in the voice [...]]]></description>
			<content:encoded><![CDATA[<p>In terminal you can write something like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">say <span style="color: #ff0000;">'hello world'</span></pre></div></div>

<p>Which will make your computer talk. To save the audio output to a file, use the <tt>-o</tt> option. A full example is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">say <span style="color: #660033;">-o</span> hello.aiff <span style="color: #660033;">-v</span> <span style="color: #ff0000;">'Alex'</span> <span style="color: #ff0000;">'Hello, my name is Alex'</span>
open hello.aiff</pre></div></div>

<p>This will say &#8216;Hello, my name is Alex&#8217;, in the voice of &#8216;Alex&#8217; (other voice-options are &#8216;Bruce&#8217;, &#8216;Fred, &#8216;Kathy&#8217;, &#8216;Vicki&#8217; and &#8216;Victoria&#8217;), and save the output to &#8216;hello.aiff&#8217;.</p>
<p>It seems there is no option for setting the speed (can be set in System preferences -> speech). See <tt>man say</tt> for all options. Interesting options include sending the output over the network.</p>
]]></content:encoded>
			<wfw:commentRss>http://skipperkongen.dk/2011/12/04/saving-output-from-text-to-speech-to-file-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

