<?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>Alessio Sclocco</title>
	<atom:link href="http://alessio.sclocco.eu/feed/" rel="self" type="application/rss+xml" />
	<link>http://alessio.sclocco.eu</link>
	<description>who I am and what I&#039;m doing</description>
	<lastBuildDate>Thu, 08 Mar 2012 18:46:01 +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>Radio Astronomy Beam Forming on Many-Core Architectures</title>
		<link>http://alessio.sclocco.eu/radio-astronomy-beam-forming-on-many-core-architectures/</link>
		<comments>http://alessio.sclocco.eu/radio-astronomy-beam-forming-on-many-core-architectures/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 14:16:42 +0000</pubDate>
		<dc:creator>Alessio Sclocco</dc:creator>
				<category><![CDATA[Documents]]></category>
		<category><![CDATA[beam forming]]></category>
		<category><![CDATA[IPDPS 2012]]></category>
		<category><![CDATA[Paper]]></category>
		<category><![CDATA[Radio astronomy]]></category>

		<guid isPermaLink="false">http://alessio.sclocco.eu/?p=246</guid>
		<description><![CDATA[I am really glad to be able to publish this paper. We wrote it during the Summer of 2011 and it will be presented the 24th of May 2012 in Shangai at the International Parallel and Distributed Processing Symposium (IPDPS). It is based on the job I did for my master&#8217;s degree thesis. In a [...]]]></description>
			<content:encoded><![CDATA[<p>I am really glad to be able to publish this paper.<br />
We wrote it during the Summer of 2011 and it will be presented the 24th of May 2012 in Shangai at the International Parallel and Distributed Processing Symposium (IPDPS). It is based on the job I did for my master&#8217;s degree thesis. In a while we will publish also the source code :)</p>
<p><a title="Radio Astronomy Beam Forming on Many-Core Architectures" href="http://alessio.sclocco.eu/wp-content/uploads/Sclocco_IPDPS_2012.pdf">Radio Astronomy Beam Forming on Many-Core Architectures</a><br />
Accepted for publication in <em>26th IEEE International Parallel &amp; Distributed Processing Symposium (IPDPS) May 21-25, 2012, Shanghai, China.</em><br />
<small>© IEEE, 2012. Personal use of this material is permitted. However, permission to reprint/republish this material for advertising or promotional purposes or for creating new collective works for resale or redistribution to servers or lists, or to reuse any copyrighted component of this work in other works must be obtained from the IEEE.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://alessio.sclocco.eu/radio-astronomy-beam-forming-on-many-core-architectures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>30 years of computer science in Amsterdam</title>
		<link>http://alessio.sclocco.eu/30-years-of-computer-science-in-amsterdam/</link>
		<comments>http://alessio.sclocco.eu/30-years-of-computer-science-in-amsterdam/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 17:59:55 +0000</pubDate>
		<dc:creator>Alessio Sclocco</dc:creator>
				<category><![CDATA[Reflections]]></category>
		<category><![CDATA[Radio astronomy]]></category>
		<category><![CDATA[VU Amsterdam]]></category>

		<guid isPermaLink="false">http://alessio.sclocco.eu/?p=241</guid>
		<description><![CDATA[Friday the 2nd of December 2011, the computer science departments of the VU and the UvA celebrated the 30th anniversary of the teaching of computer science in Amsterdam. On the right you can see the poster my group realized for the event. Kind of an hint about what we (that means also me) are working [...]]]></description>
			<content:encoded><![CDATA[<div class="mceTemp">
<dl class="wp-caption alignright" style="width: 235px;">
<dt class="wp-caption-dt"><a href="http://alessio.sclocco.eu/wp-content/uploads/2011/12/exascale_telescopes.jpg"><img class="size-medium wp-image-242" title="Exascale Software Telescopes" src="http://alessio.sclocco.eu/wp-content/uploads/2011/12/exascale_telescopes-225x300.jpg" alt="Exascale Software Telescopes" width="225" height="300" /></a></dt>
</dl>
</div>
<p>Friday the 2nd of December 2011, the computer science departments of the VU and the UvA celebrated the 30th anniversary of the teaching of computer science in Amsterdam.</p>
<p>On the right you can see the poster my group realized for the event. Kind of an hint about what we (that means also me) are working on :)<br />
Sorry for the quality of the image but the light was quite bad for taking pictures with a mobile phone there.</p>
<p>I find this research topic really interesting, and it allows me to combine my interest in computer science with the general passion for science. Anyway, I hope to be able to post part of our work at some point, i.e. when we will have some paper ready. All the source code of my work is licensed under the GPL so it also will be available at some point in the future (I am being vague, I know, but it has to reach a certain maturity before being published).</p>
]]></content:encoded>
			<wfw:commentRss>http://alessio.sclocco.eu/30-years-of-computer-science-in-amsterdam/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Radio astronomy beam forming on GPUs</title>
		<link>http://alessio.sclocco.eu/radio-astronomy-beam-forming-on-gpus/</link>
		<comments>http://alessio.sclocco.eu/radio-astronomy-beam-forming-on-gpus/#comments</comments>
		<pubDate>Tue, 24 May 2011 19:27:52 +0000</pubDate>
		<dc:creator>Alessio Sclocco</dc:creator>
				<category><![CDATA[Documents]]></category>
		<category><![CDATA[beam forming]]></category>
		<category><![CDATA[CUDA]]></category>
		<category><![CDATA[MSc]]></category>
		<category><![CDATA[OpenCL]]></category>
		<category><![CDATA[Radio astronomy]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[VU Amsterdam]]></category>

		<guid isPermaLink="false">http://alessio.sclocco.eu/?p=237</guid>
		<description><![CDATA[I am finally publishing my master&#8217;s degree thesis, whose title is &#8220;Radio astronomy beam forming on GPUs&#8220;, on this website. The thesis describes all the work I did on the LOFAR beam former and is one of the starting points of the work I am currently doing at the VU (more on this in the [...]]]></description>
			<content:encoded><![CDATA[<p>I am finally publishing my master&#8217;s degree thesis, whose title is &#8220;<strong>Radio astronomy beam forming on GPUs</strong>&#8220;, on this website. The thesis describes all the work I did on the LOFAR beam former and is one of the starting points of the work I am currently doing at the VU (more on this in the future).</p>
<p>The thesis can be <a title="Radio astronomy beam forming on GPUs" href="http://alessio.sclocco.eu/wp-content/uploads/MScThesis.pdf">downloaded here in pdf format</a>. I want to thank my supervisors for the great work they did helping me in this project. All the mistakes and errors are, of course, mine.</p>
]]></content:encoded>
			<wfw:commentRss>http://alessio.sclocco.eu/radio-astronomy-beam-forming-on-gpus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSc project presentation</title>
		<link>http://alessio.sclocco.eu/msc-project-presentation/</link>
		<comments>http://alessio.sclocco.eu/msc-project-presentation/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 15:14:18 +0000</pubDate>
		<dc:creator>Alessio Sclocco</dc:creator>
				<category><![CDATA[Documents]]></category>
		<category><![CDATA[beam forming]]></category>
		<category><![CDATA[GPGPU]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[MSc]]></category>
		<category><![CDATA[Radio astronomy]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[VU Amsterdam]]></category>

		<guid isPermaLink="false">http://alessio.sclocco.eu/?p=228</guid>
		<description><![CDATA[The title of my master project, and my thesis, is &#8220;Radio astronomy beam forming on GPUs&#8220;. I presented the results in a public session at the VU Amsterdam the 13th of December, just few days ago, and it is time now to share the slides of the presentation here also. Radio astronomy beam forming on [...]]]></description>
			<content:encoded><![CDATA[<p>The title of my master project, and my thesis, is &#8220;<strong>Radio astronomy beam forming on GPUs</strong>&#8220;. I presented the results in a public session at the VU Amsterdam the 13th of December, just few days ago, and it is time now to share the slides of the presentation here also.</p>
<p><a title="Radio astronomy beam forming on GPUs" href="http://alessio.sclocco.eu/wp-content/uploads/MasterPresentation.pdf">Radio astronomy beam forming on GPUs (presentation)</a> (pdf).</p>
<p>In few months the final version of the thesis, and hopefully also the whole source code.</p>
]]></content:encoded>
			<wfw:commentRss>http://alessio.sclocco.eu/msc-project-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenCL memset</title>
		<link>http://alessio.sclocco.eu/opencl-memset/</link>
		<comments>http://alessio.sclocco.eu/opencl-memset/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 17:39:39 +0000</pubDate>
		<dc:creator>Alessio Sclocco</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[CUDA]]></category>
		<category><![CDATA[memset]]></category>
		<category><![CDATA[OpenCL]]></category>

		<guid isPermaLink="false">http://alessio.sclocco.eu/?p=224</guid>
		<description><![CDATA[In September I was porting to OpenCL a version of the radioastronomy beam forming algorithm I realized in CUDA for my master project. The algorithm needs to clean the memory after some iterations, and with CUDA I was using the memset function to do it. Unluckily, OpenCL does not provide a function like memset, so [...]]]></description>
			<content:encoded><![CDATA[<p>In September I was porting to OpenCL a version of the radioastronomy beam forming algorithm I realized in CUDA for my master project. The algorithm needs to clean the memory after some iterations, and with CUDA I was using the <em>memset</em> function to do it. Unluckily, OpenCL does not provide a function like <em>memset</em>, so I had to write a kernel to accomplish the task.</p>
<p>Now, it is clear that writing a kernel like this is one of the easiest tasks ever :), and is a one-liner BTW, but as always I&#8217;d like to share the code with the Internet, cause it&#8217;s always useful to find some example code on-line, especially when you are in a hurry.</p>
<pre class="brush: cpp; title: ; notranslate">
__kernel void memSet(float value, __global float *mem) {
    mem[get_global_id(0)] = value;
}
</pre>
<p>As can be seen, the memory to clean was an array of float values, but changing it to work with other data types is trivial.</p>
]]></content:encoded>
			<wfw:commentRss>http://alessio.sclocco.eu/opencl-memset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Random Utilities version 1.0.0</title>
		<link>http://alessio.sclocco.eu/my-random-utilities-version-1-0-0/</link>
		<comments>http://alessio.sclocco.eu/my-random-utilities-version-1-0-0/#comments</comments>
		<pubDate>Sun, 07 Nov 2010 15:18:07 +0000</pubDate>
		<dc:creator>Alessio Sclocco</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Cpp]]></category>
		<category><![CDATA[MRUtils]]></category>

		<guid isPermaLink="false">http://alessio.sclocco.eu/?p=220</guid>
		<description><![CDATA[Hi everyone. In the past few days I spent some time, while working on my last exams and my master project, putting together the C++ utilities that I wrote and published on this website in the past. The goal is just to have a library with these utilities that I can use when I need [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone.</p>
<p>In the past few days I spent some time, while working on my last exams and my master project, putting together the C++ utilities that I wrote and published on this website in the past. The goal is just to have a library with these utilities that I can use when I need it, without having to take pieces from here and there every time I need.</p>
<p>So I put together the <a href="http://alessio.sclocco.eu/argumentlist-0-2-1/">ArgumentList</a>, the <a href="http://alessio.sclocco.eu/replace-a-substring-with-another-string/">string replacement</a> and another couple of small functions in a single package, adding a pair of self defined exceptions. Of course this is not the best code in the world, is just a &#8220;not really organized&#8221; library of random stuffs, that I put online just because I like to share and think, still, that source code is something nice and that should be read :)</p>
<p>The library can be <a href="http://alessio.sclocco.eu/wp-content/uploads/MRUtils-1.0.0.tar.bz2">downloaded here</a>, it is so small and simple that I don&#8217;t think explanations are necessary, anyway comment here if you want to talk about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://alessio.sclocco.eu/my-random-utilities-version-1-0-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replace a substring with another string</title>
		<link>http://alessio.sclocco.eu/replace-a-substring-with-another-string/</link>
		<comments>http://alessio.sclocco.eu/replace-a-substring-with-another-string/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 16:20:58 +0000</pubDate>
		<dc:creator>Alessio Sclocco</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Cpp]]></category>

		<guid isPermaLink="false">http://alessio.sclocco.eu/?p=215</guid>
		<description><![CDATA[Few days ago, working on an automatic code generator for my master project, I had to read a string representing the structure of the code and containing some placeholders. I had then to replace these placeholders with some other generated code. Given the fact that the C++ std library doesn&#8217;t seem to contain something to [...]]]></description>
			<content:encoded><![CDATA[<p>Few days ago, working on an automatic code generator for my master project, I had to read a string representing the structure of the code and containing some placeholders. I had then to replace these placeholders with some other generated code.</p>
<p>Given the fact that the C++ std library doesn&#8217;t seem to contain something to do what I needed, I wrote these few lines of code to solve my problem:</p>
<p>﻿﻿</p>
<pre class="brush: cpp; title: ; notranslate">
std::string *replace(std::string src, std::string placeholder, std::string value) {
	std::string *toRet = new std::string();
	size_t pos = 0;
	size_t oldPos = 0;

	while ( (pos = src.find(placeholder, pos)) &lt; std::string::npos ) {
		toRet-&gt;append(src.substr(oldPos, pos - oldPos));
		toRet-&gt;append(value);
		pos += placeholder.length();
		oldPos = pos;
	}
	toRet-&gt;append(src.substr(oldPos));

	return toRet;
}
</pre>
<p>The code is really simple and it uses only standard C++, the only dependence being the string library. The complexity of the code is linear in the length of the source string.</p>
]]></content:encoded>
			<wfw:commentRss>http://alessio.sclocco.eu/replace-a-substring-with-another-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evaluate a sequence</title>
		<link>http://alessio.sclocco.eu/evaluate-a-sequence/</link>
		<comments>http://alessio.sclocco.eu/evaluate-a-sequence/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 20:24:05 +0000</pubDate>
		<dc:creator>Alessio Sclocco</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Cpp]]></category>

		<guid isPermaLink="false">http://alessio.sclocco.eu/?p=204</guid>
		<description><![CDATA[Hello everyone. While working on some other things, like my MSc thesis, I saw a simple problem on a form to apply for a job, and I wanted to solve it. The problem is quite simple, but I enjoyed it and wanted to share my solution with the whole Internet; moreover the main reason I [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone.</p>
<p>While working on some other things, like my MSc thesis, I saw a simple problem on a form to apply for a job, and I wanted to solve it. The problem is quite simple, but I enjoyed it and wanted to share my solution with the whole Internet; moreover the main reason I thought about modifying my <a title="ArgumentList 0.2.1" href="http://alessio.sclocco.eu/argumentlist-0-2-1/">ArgumentList class</a> derives from this problem :)</p>
<p><strong>The problem</strong></p>
<p>Given a sequence of digits in some order, print all the expressions obtainable inserting a + (plus), &#8211; (minus), * (multiplication) or nothing, that evaluate to a given number. The solution should be written in C++ using the std library.</p>
<p><strong>My solution</strong></p>
<p>The solution is straightforward and is composed by two steps: generating all the possible expressions and then evaluate them.<br />
To generate all the possible expressions what I did is the following. I used a pair to represent an expression: the pair is formed by an integer, representing the element after which the operators can be inserted, and a string, representing the expression to operate on. The first pair is just (<em>0</em>,<em> sequence</em>), where <em>sequence</em> is the one provided as input.<br />
Now it is possible to use a queue to iteratively get a pair, evaluate the expression in it, and then generate the new expressions  and put them into the queue to get successively evaluated.<br />
The code is the following:</p>
<pre class="brush: cpp; title: ; notranslate">
while ( !queue.empty() ) {
		pair&lt; unsigned int, string &gt; *toEvaluate = queue.back();

		if ( evaluate(target, toEvaluate-&gt;second) ) {
			found.insert(toEvaluate-&gt;second);
		}

		if ( toEvaluate-&gt;first &lt; (toEvaluate-&gt;second).length() - 1 ) {
			queue.push_front(new pair&lt; unsigned int, string &gt;(toEvaluate-&gt;first + 1, toEvaluate-&gt;second));
			for ( unsigned int i(0); i &lt; NR_OPERATORS; i++ ) {
				queue.push_front(new pair&lt; unsigned int, string&gt;(toEvaluate-&gt;first + 2, (toEvaluate-&gt;second).substr(0, toEvaluate-&gt;first + 1) + operators[i] + (toEvaluate-&gt;second).substr(toEvaluate-&gt;first + 1)));
			}
		}

		queue.pop_back();
	}
</pre>
<p>The evaluation is quite simple too. When an expression has to be evaluated is first parsed and divided into two components: the operands and the operators. After that each operator is applied to its operands (starting with the multiplication in our case) and a total is computed. If it matches with the goal number the boolean value <em>true</em> is returned.</p>
<p>The code is the following:</p>
<pre class="brush: cpp; title: ; notranslate">
bool evaluate(int target, string &amp;item) {

	vector&lt; int &gt; operands;
	vector&lt; char &gt; operators;
	unsigned int i(0);

	while ( i &lt; item.length() ) {
		unsigned int counter(i);
		while ( counter &lt; item.length() &amp;&amp; isdigit(item.at(counter)) ) {
			counter++;
		}
		operands.push_back(atoi((item.substr(i, counter - i)).c_str()));
		if ( counter &lt; item.length() ) {
			operators.push_back(item.at(counter));
		}
		i = counter + 1;
	}

	// Performs the multiplies first
	for ( unsigned int op(0); op &lt; operators.size(); op++ ) {
		if ( operators[op] == '*' ) {
			operands[op] *= operands[op + 1];
			operands[op + 1] = 1;
		}
	}

	int total(operands[0]);
	unsigned int opCounter(0);
	for ( unsigned int i(1); i &lt; operands.size(); i++ ) {
		switch( operators[opCounter++] ) {
			case '+':
				total += operands[i];
				break;
			case '-':
				total -= operands[i];
				break;
			case '*':
				total *= operands[i];
				break;
		}
	}

	if ( total == target ) {
		return true;
	}

	return false;
}
</pre>
<p><strong>Notes</strong></p>
<p>The original problem was less general and asked just to print all the expressions evaluating the number 3141 given the sequence 987654321, I generalized it for the sake of fun.<br />
The complete code, with a Makefile, is <a title="mendeleyTest" href="http://alessio.sclocco.eu/wp-content/uploads/mendeleyTest.tar.bz2">available here</a>. It needs to have my <a title="ArgumentList 0.2.1" href="http://alessio.sclocco.eu/argumentlist-0-2-1/">ArgumentList</a> installed to work.</p>
<p><strong>Post scriptum</strong></p>
<p>The answer of the original question are the expressions <strong>&#8220;﻿﻿9*8*7*6+54+3*21</strong>&#8221; and &#8220;<strong>987-6+5*432*1</strong>&#8221; :)</p>
]]></content:encoded>
			<wfw:commentRss>http://alessio.sclocco.eu/evaluate-a-sequence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArgumentList 0.2.1</title>
		<link>http://alessio.sclocco.eu/argumentlist-0-2-1/</link>
		<comments>http://alessio.sclocco.eu/argumentlist-0-2-1/#comments</comments>
		<pubDate>Fri, 28 May 2010 20:20:00 +0000</pubDate>
		<dc:creator>Alessio Sclocco</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Cpp]]></category>

		<guid isPermaLink="false">http://alessio.sclocco.eu/?p=197</guid>
		<description><![CDATA[Hello everyone, this is just a minor update of the ArgumentList class. Two are the differences between this one and the previous version: CMake will now produce also the &#8220;install&#8221; directive for Make The getSwitchArgument() method, instead of returning a zero in case of failure, will throw a std::exception So it will be safe, from [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone, this is just a minor update of the <em>ArgumentList</em> class.</p>
<p>Two are the differences between this one and the previous version:</p>
<ol>
<li> CMake will now produce also the &#8220;<em>install</em>&#8221; directive for Make</li>
<li>The <em>getSwitchArgument()</em> method, instead of returning a zero in case of failure, will throw a <em>std::exception</em></li>
</ol>
<p>So it will be safe, from now on, to call the <em>getSwitchArgument</em> method inside a try/catch block, like in the following example:</p>
<pre class="brush: cpp; title: ; notranslate">
﻿int i(0);
float f(0.0);
try {
    i = args.getSwitchArgument&lt; int &gt;(&quot;-i&quot;);
    f = args.getSwitchArgument&lt; float &gt;(&quot;-f&quot;);
}
catch (std::exception) {
    std::cerr &lt;&lt; &quot;Ops :)&quot; &lt;&lt; std::endl;
}
</pre>
<p><a title="ArgumentList 0.2.1" href="http://alessio.sclocco.eu/wp-content/uploads/ArgumentList-0.2.1.tar.bz2">The new version or ArgumentList can be downloaded from this link</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alessio.sclocco.eu/argumentlist-0-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArgumentList 0.2</title>
		<link>http://alessio.sclocco.eu/argumentlist-0-2/</link>
		<comments>http://alessio.sclocco.eu/argumentlist-0-2/#comments</comments>
		<pubDate>Sun, 16 May 2010 21:01:20 +0000</pubDate>
		<dc:creator>Alessio Sclocco</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Cpp]]></category>

		<guid isPermaLink="false">http://alessio.sclocco.eu/?p=189</guid>
		<description><![CDATA[In version 0.1 of my ArgumentList there was an annoying problem, that is if we want to extract a parameter from command line that wasn&#8217;t a string, we had to write a converter by ourselves. To solve this issue I modified  the getSwitchArgument() method in order to accept a type as a template parameter. I [...]]]></description>
			<content:encoded><![CDATA[<p>In <a title="ArgumentList 0.1" href="http://alessio.sclocco.eu/argumentlist-01/">version 0.1</a> of my ArgumentList there was an annoying problem, that is if we want to extract a parameter from command line that wasn&#8217;t a string, we had to write a converter by ourselves.<br />
To solve this issue I modified  the <em>getSwitchArgument()</em> method in order to accept a type as a template parameter. I hope this modification can simplify the use of the class.</p>
<p>So now, if we suppose to have something like that in our command line:</p>
<p><em>some-executable -i 10 -f 0.004</em></p>
<p>what we have to write in our code, in order to get the numerical values &#8220;10&#8243; and &#8220;0.004&#8243; is the following:</p>
<pre class="brush: cpp; title: ; notranslate">
﻿int i(0);
float f(0.0);
i = args.getSwitchArgument&lt; int &gt;(&quot;-i&quot;);
f = args.getSwitchArgument&lt; float &gt;(&quot;-f&quot;);
</pre>
<p>So right now, to have a string argument like before, it is necessary to pass the <em>string</em> parameter to the template, like in the following example:</p>
<pre class="brush: cpp; title: ; notranslate">
string tempString;
tempString = args.getSwitchArgument&lt; std::string &gt;(&quot;-s&quot;);
</pre>
<p>An example is presented in the test directory included with the package. <a title="CMake" href="http://www.cmake.org">CMake</a> is needed to build the package.</p>
<p><a title="ArgumentList 0.2" href="http://alessio.sclocco.eu/wp-content/uploads/ArgumentList-0.2.tar.bz2">ArgumentList 0.2 can be downloaded here.</a></p>
<p>﻿﻿</p>
]]></content:encoded>
			<wfw:commentRss>http://alessio.sclocco.eu/argumentlist-0-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

