<?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>Evil Quark Labs</title>
	<atom:link href="http://evilquark.com/labs/feed/" rel="self" type="application/rss+xml" />
	<link>http://evilquark.com/labs</link>
	<description>Random Technological Ravings...</description>
	<lastBuildDate>Wed, 04 Jan 2012 23:10:35 +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>Paths and Compiling in an HPC Context</title>
		<link>http://evilquark.com/labs/2012/01/paths-and-compiling-in-an-hpc-context/</link>
		<comments>http://evilquark.com/labs/2012/01/paths-and-compiling-in-an-hpc-context/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 20:25:32 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Compilers]]></category>
		<category><![CDATA[HPC]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://evilquark.com/labs/?p=69</guid>
		<description><![CDATA[This is a biased account of the preparation required for compiling parallel codes on the cluster (supercomputer) that I use on a daily basis.  I had to figure a lot of stuff out myself, and hopefully this rough guide will &#8230; <a href="http://evilquark.com/labs/2012/01/paths-and-compiling-in-an-hpc-context/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a biased account of the preparation required for compiling parallel codes on the cluster (supercomputer) that I use on a daily basis.  I had to figure a lot of stuff out myself, and hopefully this rough guide will help me again in the future.  Perhaps some random internet denizen might find some useful information here as well.</p>
<p>Right off the bat, we need to find out which compilers are currently installed, and where they are located.  This is relatively straightforward using the &#8220;which&#8221; command. First the Intel Fortran and C compilers:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>me<span style="color: #000000; font-weight: bold;">@</span>machine ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">which</span> ifort
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>intel<span style="color: #000000; font-weight: bold;">/</span>composerxe-2011.3.174<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>intel64<span style="color: #000000; font-weight: bold;">/</span>ifort
<span style="color: #7a0874; font-weight: bold;">&#91;</span>me<span style="color: #000000; font-weight: bold;">@</span>machine ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">which</span> icc
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>intel<span style="color: #000000; font-weight: bold;">/</span>composerxe-2011.3.174<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>intel64<span style="color: #000000; font-weight: bold;">/</span>icc</pre></div></div>

<p>as well as the GNU Fortran and c:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>me<span style="color: #000000; font-weight: bold;">@</span>machine ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">which</span> gfortran
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gfortran
<span style="color: #7a0874; font-weight: bold;">&#91;</span>me<span style="color: #000000; font-weight: bold;">@</span>machine ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">which</span> <span style="color: #c20cb9; font-weight: bold;">gcc</span>
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">gcc</span></pre></div></div>

<p>This doesn&#8217;t REALLY tell you if these compilers are installed or not, only whether or not the paths to them are in your $PATH variable.  Whenever you type a command, Linux checks to see if that command is in any of the paths in your $PATH.  If it is not, then you will receive an error.  To see what paths are currently in your $PATH variable, a simple echo command will suffice:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>me<span style="color: #000000; font-weight: bold;">@</span>machine ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$PATH</span></pre></div></div>

<p>If you suspect that the desired compilers are indeed installed, but not in your path, start looking in the  /opt/&lt;vendor&gt; directories for the correct paths.  It&#8217;s highly unlikely that gcc and gfortran will not be installed (and furthermore, not be in your path), but just in case, they usually live in /usr/bin</p>
<p>Another method for finding the paths to compilers is to use the &#8220;locate&#8221; command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>me<span style="color: #000000; font-weight: bold;">@</span>machine ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">locate</span> ifort</pre></div></div>

<p>This will bring up a list of paths that contain the phrase &#8220;ifort&#8221;. This can be very useful, especially in conjunction with the &#8220;grep&#8221; command.</p>
<p>Once you have located the paths to the compilers, you can add them to your $PATH variable with the following command in BASH  (for other shells, see Google):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>me<span style="color: #000000; font-weight: bold;">@</span>machine ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>kyle<span style="color: #000000; font-weight: bold;">/</span>tau-<span style="color: #000000;">2.21</span><span style="color: #000000; font-weight: bold;">/</span>x86_64<span style="color: #000000; font-weight: bold;">/</span>bin</pre></div></div>

<p>Echo-ing your $PATH variable should now reveal that the path has been added.  A good idea is to add that line to one of your login files (.bashrc), so that it executes automatically each and every time you log into the machine.</p>
<p>Of course, one of the primary reasons for running codes on a cluster, is to take advantage of parallelism, and this means compiling parallel programs. We want to make sure that our &#8220;MPI Compilers&#8221; are accessible as well:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>me<span style="color: #000000; font-weight: bold;">@</span>machine geo_benchmark<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">which</span> mpif77
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>openmpi<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mpif77
<span style="color: #7a0874; font-weight: bold;">&#91;</span>me<span style="color: #000000; font-weight: bold;">@</span>machine geo_benchmark<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">which</span> mpif90
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>openmpi<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mpif90
<span style="color: #7a0874; font-weight: bold;">&#91;</span>me<span style="color: #000000; font-weight: bold;">@</span>machine geo_benchmark<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">which</span> mpicc
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>openmpi<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mpicc
<span style="color: #7a0874; font-weight: bold;">&#91;</span>me<span style="color: #000000; font-weight: bold;">@</span>machine geo_benchmark<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">which</span> mpiCC
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>openmpi<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mpiCC</pre></div></div>

<p>So far, so good. Notice that these are the &#8220;openmpi&#8221; versions of these compilers. It&#8217;s entirely possible that other versions exist as well (MPICH, MPICH2, MPICH-GM, MVAPICH, MVAPICH2).  If you require (or want to switch to) one of these versions, start looking in the /usr/local/ directories to see if they are available.  The &#8220;locate&#8221; command is helpful here as well.</p>
<p>We may also need Intel&#8217;s Math Kernel Library (MKL). It is usually installed in paths similar to Intel&#8217;s compilers.  The following are example include and library directories, respectively, for MKL:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>intel<span style="color: #000000; font-weight: bold;">/</span>composerxe-2011.3.174<span style="color: #000000; font-weight: bold;">/</span>mkl<span style="color: #000000; font-weight: bold;">/</span>include
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>intel<span style="color: #000000; font-weight: bold;">/</span>composerxe-2011.3.174<span style="color: #000000; font-weight: bold;">/</span>mkl<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>intel64</pre></div></div>

<p>Once you have all of the paths sorted out, figuring out the actual compile line, especially with MKL, can be a nightmare.  Luckily there is a web app to help, the <a href="http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/">Intel® Math Kernel Library Link Line Advisor</a>.  Check it out.</p>
<p>Finally, with all of this information, you can create a Makefile.  Here&#8217;s a stripped down example to help get you started:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">FCC = mpif90
CC  = icc
INCDIR = <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>intel<span style="color: #000000; font-weight: bold;">/</span>composerxe-2011.3.174<span style="color: #000000; font-weight: bold;">/</span>mkl<span style="color: #000000; font-weight: bold;">/</span>include
LIBDIR = <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>intel<span style="color: #000000; font-weight: bold;">/</span>composerxe-2011.3.174<span style="color: #000000; font-weight: bold;">/</span>mkl<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>intel64
LLAPACK = <span style="color: #660033;">-L</span><span style="color: #800000;">${LIBDIR}</span>  -lmkl_intel_lp64 -lmkl_sequential -lmkl_core
LFLAGS =  <span style="color: #660033;">-lm</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span>LLAPACK<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-I</span><span style="color: #800000;">${INCDIR}</span>
OBJ = program.o
program.e: $<span style="color: #7a0874; font-weight: bold;">&#40;</span>OBJ<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        $<span style="color: #7a0874; font-weight: bold;">&#40;</span>FCC<span style="color: #7a0874; font-weight: bold;">&#41;</span>  $<span style="color: #7a0874; font-weight: bold;">&#40;</span>OBJ<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-o</span> program.e  $<span style="color: #7a0874; font-weight: bold;">&#40;</span>LFLAGS<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
program.o: program.f
        $<span style="color: #7a0874; font-weight: bold;">&#40;</span>FCC<span style="color: #7a0874; font-weight: bold;">&#41;</span>   <span style="color: #660033;">-c</span> program.f
clean:
        <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">*</span>.o program.e</pre></div></div>

<p>If all has gone well,  you now have a Makefile with all of the appropriate paths.  If you cannot find all of the correct paths, or straight up suspect that certain software has not been installed, you may want to contact your system administrator.  Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://evilquark.com/labs/2012/01/paths-and-compiling-in-an-hpc-context/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USB Dead Drops</title>
		<link>http://evilquark.com/labs/2011/12/usb-dead-drops/</link>
		<comments>http://evilquark.com/labs/2011/12/usb-dead-drops/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 17:41:24 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[information]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://evilquark.com/labs/?p=55</guid>
		<description><![CDATA[&#8230; aka digital geo-caching? Lately, there has been all manner of news about some draconian legislation on the verge of being passed in Washington pertaining to Internet regulation.  It&#8217;s ironic that a governing body, which in theory should be elected &#8230; <a href="http://evilquark.com/labs/2011/12/usb-dead-drops/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>&#8230; aka digital geo-caching?</p>
<p>Lately, there has been all manner of news about some draconian legislation on the verge of being passed in Washington pertaining to Internet regulation.  It&#8217;s ironic that a governing body, which in theory should be elected by the people, only manages to pass, in a timely manner, legislation that benefits corporations.  The passing of bills that actually benefit humans, well that of course, has to be debated unto a standstill that ultimately accomplishes nothing.  Makes you wonder who REALLY determines who our &#8220;elected&#8221; officials shall be.</p>
<p>Anyways, with the Internet constantly under attack, people have been looking for alternatives for sharing information.  One such method is the use of USB Dead Drops, which is an anonymous, offline, peer-to-peer file sharing network.  It was initially conceptualized by  Aram Bartholl, a Germany based artist, who implemented the idea in New York City in October 2011.  The idea is to permanently attach a USB drive to an urban fixture, most commonly using concrete.  The following pictures show some finished products:</p>

<a href='http://evilquark.com/labs/2011/12/usb-dead-drops/dd3/' title='dd3'><img width="150" height="150" src="http://evilquark.com/labs/wp-content/uploads/2011/12/dd3-150x150.jpg" class="attachment-thumbnail" alt="dd3" title="dd3" /></a>
<a href='http://evilquark.com/labs/2011/12/usb-dead-drops/dd1/' title='dd1'><img width="150" height="150" src="http://evilquark.com/labs/wp-content/uploads/2011/12/dd1-150x150.jpg" class="attachment-thumbnail" alt="dd1" title="dd1" /></a>
<a href='http://evilquark.com/labs/2011/12/usb-dead-drops/dd2/' title='dd2'><img width="150" height="150" src="http://evilquark.com/labs/wp-content/uploads/2011/12/dd2-150x150.jpg" class="attachment-thumbnail" alt="dd2" title="dd2" /></a>

<p>This way, people can exchange their favorite files completely anonymously.  Pretty interesting idea, and it got me thinking&#8230;</p>
<p>Back in my rave days finding the venue would often involve going to some shady location, called the &#8220;map point&#8221; in order to get the directions to the party.  This was an attempt to stay one step ahead of the authorities, and decrease the risk of the event getting shut down.  Today, everyone carries computers around with them, and therefore USB Dead Drops could potentially be the new &#8220;map points&#8221;.</p>
<p>While the initial concept calls for offline Dead Drops, some cool stuff could certainly be done with wired versions.  For example, suppose a hypothetical musician in Sweden has a handful of devout followers in Los Angeles.  One of these fans could set up an internet connected dead drop on to which the artist puts new music (from Sweden, across the Internet).  No, it may not be as convenient as downloading a track from a webpage, but it has an esoteric, cloak-and-dagger, feel to it and I think the right crowd would be receptive to the idea.</p>
<p>I think there are even commercial applications as well.  Imagine a restaurant that has a dead drop out front, containing a &#8220;digital business card&#8221; with menu/hours/review information available for download.  An apartment complex could share information about available units to potential customers.</p>
<p>More information, including a database and world map of preexisting USB dead drops can be found at <a href="http://www.deaddrops.com">deadrops.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://evilquark.com/labs/2011/12/usb-dead-drops/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Little History &amp; Pointers in C Programming</title>
		<link>http://evilquark.com/labs/2011/12/a-little-history-pointers-in-c-programming/</link>
		<comments>http://evilquark.com/labs/2011/12/a-little-history-pointers-in-c-programming/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 16:13:59 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[fortran]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://evilquark.com/labs/?p=25</guid>
		<description><![CDATA[My background in programming goes way back.  When other kids were out skateboarding or playing with G.I. Joes, my friends and I were at home writing games in qbasic on a 386 running MS-DOS.  Since those days, both in and &#8230; <a href="http://evilquark.com/labs/2011/12/a-little-history-pointers-in-c-programming/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My background in programming goes way back.  When other kids were out skateboarding or playing with G.I. Joes, my friends and I were at home writing games in qbasic on a 386 running MS-DOS.  Since those days, both in and out of school, I&#8217;ve had the pleasure of writing code in Pascal, Visual Basic, C/C++ and, for the longest run as an undergraduate and graduate student of physics, Fortran.</p>
<p>People often laugh when I tell them I&#8217;m a Fortran programmer, mostly because they think it a dead language.  A few friends of mine are/were Computer Science majors and I always ask them if Fortran is offered in the curriculum.  The answer is either a resounding &#8216;NO&#8217; or something along the lines of &#8216;yes&#8217; in the form of a backwater elective on super-computing that <em>might </em>touch on the subject.  Regardless, the conversation always ends with me explaining that the language is indeed alive and well, especially in the fields of computational science.</p>
<p>C and Fortran certainly represent the lion&#8217;s share when it comes to languages used to write code for super-computing.  Right now I&#8217;ve been tasked with creating an identical benchmark in both Fortran and C to see how the languages perform on our cluster.  I suspect they will perform about evenly, with my personal bias rooting for the former.  Since, it&#8217;s currently my strongest language, I wrote the benchmark first in Fortran.  Now completed, I&#8217;ve moved onto the C version, which is proving to be a nice refresher of a language that I was once much more proficient in.</p>
<p>&#8230; and of course, for about the fifth time in my life, I find myself trying to wrap my brain around the concept of pointers.  I often struggled with them when I was younger, and did not understand why anyone would want to use them.  Now, three degrees later, and with a ton of code under my belt, it finally makes sense &#8212; and now I wonder why I was so caught up on them back in the day.</p>
<p>Anyways, enough history.  Here&#8217;s my (very) brief pointer summary, in just a few lines of code:</p>
<p>To declare a pointer variable which stores not a value, but the address of a value:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> <span style="color: #339933;">*</span>ptr<span style="color: #339933;">;</span></pre></div></div>

<p>To store the address of a variable into a pointer variable:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">ptr <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>var<span style="color: #339933;">;</span></pre></div></div>

<p>To store a value in an address pointed to by a pointer variable:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">*</span>ptr <span style="color: #339933;">=</span> <span style="color: #0000dd;">10</span><span style="color: #339933;">;</span></pre></div></div>

<p>&#8230; and remember: by definition, the name of any array is a pointer!</p>
]]></content:encoded>
			<wfw:commentRss>http://evilquark.com/labs/2011/12/a-little-history-pointers-in-c-programming/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Working Out a Few Details</title>
		<link>http://evilquark.com/labs/2011/12/hello-world/</link>
		<comments>http://evilquark.com/labs/2011/12/hello-world/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 18:51:20 +0000</pubDate>
		<dc:creator>Kyle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fortran]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://evilquark.com/labs/?p=1</guid>
		<description><![CDATA[Here, at the dusk of 2011, Evil Quark Labs returns in yet another Dr. Who-esque incarnation. This maiden post exists only to confirm that programming language syntax highlighting is indeed operational. If anyone is interested, the plugin that allowed such &#8230; <a href="http://evilquark.com/labs/2011/12/hello-world/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here, at the dusk of 2011, Evil Quark Labs returns in yet another Dr. Who-esque incarnation. This maiden post exists only to confirm that programming language syntax highlighting is indeed operational. If anyone is interested, the plugin that allowed such formatting is called <a title="wp-syntax" href="http://wordpress.org/extend/plugins/wp-syntax/">wp-syntax</a> and is based on <a title="GeSHi" href="http://qbnz.com/highlighter/">GeSHi</a>.</p>
<p>The program itself is a test I wrote to familiarize myself with writing binary files in FORTRAN.</p>

<div class="wp_syntax"><div class="code"><pre class="fortran" style="font-family:monospace;">     <span style="color: #b1b100;">program</span> BinaryWriter
&nbsp;
      <span style="color: #000066;">implicit</span> <span style="color: #000066;">none</span>
&nbsp;
      <span style="color: #000066;">integer</span> sizeofint
      <span style="color: #000066;">integer</span> <span style="color: #339933;">::</span> <span style="color: #202020;">ii</span>, jj, num
      <span style="color: #000066;">integer</span> <span style="color: #339933;">::</span> <span style="color: #202020;">mat</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">5</span>,<span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span>
      <span style="color: #000066;">parameter</span> <span style="color: #009900;">&#40;</span>sizeofint<span style="color: #339933;">=</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span>
&nbsp;
      num <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span>
<span style="color: #666666; font-style: italic;">CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC</span>
<span style="color: #666666; font-style: italic;">C</span>
<span style="color: #666666; font-style: italic;">C     Currently set up for direct (random) access.</span>
<span style="color: #666666; font-style: italic;">C     Divides dest. file into records of size recl.</span>
<span style="color: #666666; font-style: italic;">C     For direct access must specify which record</span>
<span style="color: #666666; font-style: italic;">C      for each write statement.</span>
<span style="color: #666666; font-style: italic;">C</span>
<span style="color: #666666; font-style: italic;">CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC</span>
      open<span style="color: #009900;">&#40;</span><span style="color: #b1b100;">unit</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">10</span>,
     <span style="color: #339933;">+</span>     <span style="color: #b1b100;">file</span><span style="color: #339933;">=</span><span style="color: #ff0000;">'bin_mat.bin'</span>,
     <span style="color: #339933;">+</span>     <span style="color: #b1b100;">access</span><span style="color: #339933;">=</span><span style="color: #ff0000;">'direct'</span>,
     <span style="color: #339933;">+</span>     <span style="color: #b1b100;">form</span><span style="color: #339933;">=</span><span style="color: #ff0000;">'UNFORMATTED'</span>,
     <span style="color: #339933;">+</span>     <span style="color: #b1b100;">recl</span><span style="color: #339933;">=</span>num<span style="color: #339933;">*</span>num<span style="color: #339933;">*</span>sizeofint<span style="color: #009900;">&#41;</span>
&nbsp;
      <span style="color: #b1b100;">do</span> ii <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span>, num
       <span style="color: #b1b100;">do</span> jj <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span>, num
         mat<span style="color: #009900;">&#40;</span>ii,jj<span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> ii<span style="color: #339933;">+</span>jj
       <span style="color: #b1b100;">enddo</span>
      <span style="color: #b1b100;">enddo</span>
&nbsp;
      write<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span>,rec<span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> mat
&nbsp;
      close<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span>
      <span style="color: #b1b100;">end</span> <span style="color: #b1b100;">program</span> BinaryWriter</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://evilquark.com/labs/2011/12/hello-world/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

