<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Microsonic Development</title>
	
	<link>http://microsonic.org</link>
	<description />
	<lastBuildDate>Sat, 21 Aug 2010 16:11:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Microsonic" /><feedburner:info uri="microsonic" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>University of Illinois</title>
		<link>http://feedproxy.google.com/~r/Microsonic/~3/yCRM_cAZ-Do/</link>
		<comments>http://microsonic.org/2010/08/21/university-of-illinois/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 16:11:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://microsonic.org/?p=228</guid>
		<description><![CDATA[Hey everyone, I&#8217;m down here at the University of Illinois and everything seems great! It seems my schedule should start opening up again, so please continue to e-mail me with questions and ideas for new tutorials/articles! I will be hopefully be able to update more frequently now. Regards, Dennis M.]]></description>
			<content:encoded><![CDATA[<p>Hey everyone,</p>
<p>I&#8217;m down here at the University of Illinois and everything seems great! It seems my schedule should start opening up again, so please continue to e-mail me with questions and ideas for new tutorials/articles! I will be hopefully be able to update more frequently now.</p>
<p>Regards,<br />
Dennis M.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/V5v1QshbRjJps7Z4tLYIFYFq2bo/0/da"><img src="http://feedads.g.doubleclick.net/~a/V5v1QshbRjJps7Z4tLYIFYFq2bo/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/V5v1QshbRjJps7Z4tLYIFYFq2bo/1/da"><img src="http://feedads.g.doubleclick.net/~a/V5v1QshbRjJps7Z4tLYIFYFq2bo/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Microsonic/~4/yCRM_cAZ-Do" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://microsonic.org/2010/08/21/university-of-illinois/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://microsonic.org/2010/08/21/university-of-illinois/</feedburner:origLink></item>
		<item>
		<title>Check a Date Exists Within a Given Period</title>
		<link>http://feedproxy.google.com/~r/Microsonic/~3/2fmgzZ9U6cQ/</link>
		<comments>http://microsonic.org/2010/07/11/check-a-date-exists-within-a-given-period/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 01:55:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://microsonic.org/?p=225</guid>
		<description><![CDATA[So I recently was asked to solve a problem for someone trying to write a script to check if a birthday (presented in DATETIME M d, Y form) was present within a given period of days from the current date. Naturally, I feel inclined to give some assistance because I love working on these things. [...]]]></description>
			<content:encoded><![CDATA[<p>So I recently was asked to solve a problem for someone trying to write a script to check if a birthday (presented in DATETIME M d, Y form) was present within a given period of days from the current date. Naturally, I feel inclined to give some assistance because I love working on these things.</p>
<p>So, I am posting this because I found it interesting. I feel like this is a very useful code snippet for anyone looking how to do this. The code is fairly well-documented, so I am not going to go through and explain all the facets of the code. However, I will make special mention of the real challenge to this. You have to make sure to account for the coming year if the date is after December 21 in any given year. This is because the system won&#8217;t automatically rollover to the next year and as you approach January 1 of the coming year, no dates will match until January 1 is met. So you can take a look in the code to see how I personally accomplished this task although there are probably hundreds of other ways to tackle the issue.</p>
<blockquote><p><code>&lt;?php<br />
/**<br />
 * Birthday Script created by Dennis J. McWherter, Jr.<br />
 *<br />
 * (C) 2010 DENNIS J. MCWHERTER, JR. ALL RIGHTS RESERVED.<br />
 */<br />
class Node<br />
{<br />
	// For sake of keeping things similar to a usable environment<br />
	var $field_work_start = array();<br />
}</p>
<p>/**<br />
 * checkBirthday function<br />
 *<br />
 * The function will check a birth date<br />
 * and see if it is in the range of specified<br />
 * days.<br />
 *<br />
 * @param $birthday<br />
 *   Birth date parameter. Assumed to be in M d, Y form<br />
 * @param $days<br />
 *   The range of days to check where the birthday is<br />
 * @return int<br />
 *   0 if the birthday is _NOT_ within the proper range<br />
 *   1 if the birthday _IS_ within the proper range<br />
 */<br />
function checkBirthday($birthday,$days)<br />
{<br />
	// Parse out the year of the birthday<br />
	$pos      = strpos($birthday,",")+2; // Find the comma which separates the year<br />
	$today	  = strtotime(date("M, d")); // Check if day is &lt; Dec. 22. If not, we need to account for next year!</p>
<p>	// Check if the birthday is within the range and has not passed!<br />
	if($today &lt; strtotime("Dec 22")){<br />
		$birthday = substr_replace($birthday,date("Y"),$pos,4); // Replace the year with current year<br />
		if(strtotime($birthday) &lt;= strtotime("+".$days." days") &amp;&amp; strtotime($birthday) &gt;= time()){<br />
			return 1;<br />
		}<br />
	} else { // Less than 10 days left in our year.. check for January birthdays!<br />
		if(!strstr($birthday,"December")){<br />
			$birthday = substr_replace($birthday,date("Y")+1,$pos,4); // Replace the year with next year<br />
			$year = date("Y")+1;<br />
		} else { // Still December?<br />
			$birthday = substr_replace($birthday,date("Y"),$pos,4); // Replace the year with current year<br />
			$year = date("Y");<br />
		}<br />
		$day = (date("d")+10)-31; // 10 days from now is...</p>
<p>		if((strtotime($birthday) &lt;= strtotime("January ".$day.", ".$year)) &amp;&amp; strtotime($birthday) &gt;= strtotime("December 25, 2010")){<br />
			return 1;<br />
		}<br />
	}<br />
	return 0;<br />
}</p>
<p>$node[]  = new Node;</p>
<p>$node[0]-&gt;field_work_start[0]  = "January 1, 1970"; // First birthday is _NOT_ within range<br />
$node[1]-&gt;field_work_start[0] = "July 20, 1970"; // Second birthday _IS_ within range</p>
<p>for($i=0;$i&lt;count($node);$i++){<br />
	if(!checkBirthday($node[$i]-&gt;field_work_start[0],10)){<br />
		print $node[$i]-&gt;field_work_start[0]." is not within the 10 day range.&lt;br /&gt;&lt;br /&gt;";<br />
	} else {<br />
		print $node[$i]-&gt;field_work_start[0]." is within the 10 day range.&lt;br /&gt;&lt;br /&gt;";<br />
	}<br />
}</p>
<p>unset($node);</p>
<p>?&gt;</code></p></blockquote>
<p>Enjoy!</p>
<p>Regards,<br />
Dennis M.</p>
<p><a href='http://microsonic.org/wp-content/uploads/2010/07/Check_Date_Period.tar.gz'>Check_Date_Period.tar</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/mxxB4RytFof_tIoj03FtiJqjvIg/0/da"><img src="http://feedads.g.doubleclick.net/~a/mxxB4RytFof_tIoj03FtiJqjvIg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/mxxB4RytFof_tIoj03FtiJqjvIg/1/da"><img src="http://feedads.g.doubleclick.net/~a/mxxB4RytFof_tIoj03FtiJqjvIg/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Microsonic/~4/2fmgzZ9U6cQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://microsonic.org/2010/07/11/check-a-date-exists-within-a-given-period/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://microsonic.org/2010/07/11/check-a-date-exists-within-a-given-period/</feedburner:origLink></item>
		<item>
		<title>Overloading Classes</title>
		<link>http://feedproxy.google.com/~r/Microsonic/~3/iMTX-dyfc0k/</link>
		<comments>http://microsonic.org/2010/05/29/overloading-classes/#comments</comments>
		<pubDate>Sun, 30 May 2010 03:11:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[overload]]></category>
		<category><![CDATA[overloading]]></category>

		<guid isPermaLink="false">http://microsonic.org/?p=217</guid>
		<description><![CDATA[In OOP, it is a good practice to sometimes &#8220;overload&#8221; classes if you need to bring in information from the outside. For instance, if you want to include configuration variables in another class, you can &#8220;overload&#8221; that class with those variables. In this tutorial, I will explain how to do that in both PHP and [...]]]></description>
			<content:encoded><![CDATA[<p>In OOP, it is a good practice to sometimes &#8220;overload&#8221; classes if you need to bring in information from the outside. For instance, if you want to include configuration variables in another class, you can &#8220;overload&#8221; that class with those variables. In this tutorial, I will explain how to do that in both PHP and C++.</p>
<p>Please note, before continuing, that I assume you are an intermediate to advanced C++/PHP programmer. Therefore, I will not go into great detail about how variables are set, etc. because you should already know how that works. We will jump right into the code now for an example as it&#8217;s usually the best way to explain these tasks.</p>
<p><strong>PHP</strong></p>
<blockquote><p><code>&lt;?php<br />
/**<br />
 * Class overloading tutorial<br />
 * by Dennis J. McWherter, Jr.<br />
 *<br />
 * (C) 2010 DENNIS J. MCWHERTER JR. All Rights Reserved.<br />
 *<br />
 */</p>
<p>// Create our simple class<br />
class OverloadMe<br />
{<br />
	/**<br />
	 * We would like a global var for the whole class<br />
	 */<br />
	var $var1;</p>
<p>	/**<br />
	 * Constructor<br />
	 */<br />
	function __construct($name){<br />
		$this-&gt;var1 = $name;<br />
	}</p>
<p>	/**<br />
	 * Name function<br />
	 */<br />
	function name(){<br />
		return $this-&gt;var1;<br />
	}<br />
}</p>
<p>// Define the name variable<br />
$yourname = "Dennis";</p>
<p>// We overload the function when we initialize it<br />
$overload = new OverloadMe($yourname);</p>
<p>// Now let's get the output<br />
print "Your name is ".$overload-&gt;name();<br />
?&gt;</code></p></blockquote>
<p>Now, the procedure is very similar in C++, just classes work differently as you already know. I&#8217;ll give the C++ code now and explain it all at the end!</p>
<p><strong>C++</strong><br />
<em>src/main.cpp</em></p>
<blockquote><p><code>/**<br />
 * Class overloading tutorial<br />
 * by Dennis J. McWherter, Jr.<br />
 *<br />
 * (C) 2010 DENNIS J. MCWHERTER JR. All Rights Reserved.<br />
 *<br />
 */</p>
<p>#include &lt;string&gt;<br />
#include "overload.h"</p>
<p>int main(int argc,char* argv[])<br />
{<br />
	std::string name = "Dennis";<br />
	OverloadMe overload(name.c_str());<br />
	overload.name();<br />
	return 0; // exit<br />
}</code></p></blockquote>
<p><em>src/overload.h</em></p>
<blockquote><p>/**<br />
 * Class overloading tutorial<br />
 * by Dennis J. McWherter, Jr.<br />
 *<br />
 * (C) 2010 DENNIS J. MCWHERTER JR. All Rights Reserved.<br />
 *<br />
 */</p>
<p>#ifndef Overload_H<br />
#define Overload_H</p>
<p>// Class definition</p>
<p>class OverloadMe<br />
{<br />
public:<br />
	// Constructor<br />
	OverloadMe(const char* namevar);</p>
<p>	// Name function<br />
	void name();<br />
private:<br />
	// A global var for the class<br />
	const char* var1;<br />
};<br />
#endif
</p></blockquote>
<p><em>src/overload.cpp</em></p>
<blockquote><p><code>/**<br />
 * Class overloading tutorial<br />
 * by Dennis J. McWherter, Jr.<br />
 *<br />
 * (C) 2010 DENNIS J. MCWHERTER JR. All Rights Reserved.<br />
 *<br />
 */</p>
<p>// Make the class work<br />
#include &lt;iostream&gt;<br />
#include &lt;stdio.h&gt;<br />
#include "overload.h"</p>
<p>using namespace std;</p>
<p>OverloadMe::OverloadMe(const char* namevar)<br />
: var1(namevar)<br />
{<br />
}</p>
<p>void OverloadMe::name()<br />
{<br />
	cout&lt;&lt; "Your name is " &lt;&lt; var1 &lt;&lt; endl &lt;&lt; endl &lt;&lt; "Please hit enter to exit" &lt;&lt; endl;<br />
	getchar();<br />
	return;<br />
}</code></p></blockquote>
<p>Now, for Windows users using MSVC++, this code will compile with a simple copy/paste. For *nix and BSD users, I&#8217;ve included a Makefile within the ZIP package for you to use when compiling. Basically, the compiler must compile each item as an object first, then it must compile the objects into the program file rather than compiling the .exe&#8217;s directly.</p>
<p>Well, I hope this is of some use to someone. The examples are fairly simple, but should explain the concept easily. As we can see in the C++ example, we initialize the class to a variable, and simply overload that variable at the time of initialization.</p>
<p>Regards,<br />
Dennis M.</p>
<p><a href='http://microsonic.org/wp-content/uploads/2010/05/Overload_Tutorial.zip'>Overload_Tutorial</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/fHORGK_CJIIZkGoxc0VqOAxKnEU/0/da"><img src="http://feedads.g.doubleclick.net/~a/fHORGK_CJIIZkGoxc0VqOAxKnEU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/fHORGK_CJIIZkGoxc0VqOAxKnEU/1/da"><img src="http://feedads.g.doubleclick.net/~a/fHORGK_CJIIZkGoxc0VqOAxKnEU/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Microsonic/~4/iMTX-dyfc0k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://microsonic.org/2010/05/29/overloading-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://microsonic.org/2010/05/29/overloading-classes/</feedburner:origLink></item>
		<item>
		<title>Using Reference Operators in Functions</title>
		<link>http://feedproxy.google.com/~r/Microsonic/~3/j6a4yuP8n34/</link>
		<comments>http://microsonic.org/2010/04/04/using-reference-operators-in-functions/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 02:03:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C/C++]]></category>

		<guid isPermaLink="false">http://microsonic.org/?p=214</guid>
		<description><![CDATA[Happy Easter everyone! I felt today, being a day off, would be a good day to write something up. I&#8217;ve had a lot of inquiries lately about the use and functionality of reference operators (&#038;) in variables. Well, basically, in common word, they replace the original variable. Of course, as usual, I have written up [...]]]></description>
			<content:encoded><![CDATA[<p>Happy Easter everyone!</p>
<p>I felt today, being a day off, would be a good day to write something up. I&#8217;ve had a lot of inquiries lately about the use and functionality of reference operators (&#038;) in variables. Well, basically, in common word, they replace the original variable. Of course, as usual, I have written up a sample code for you all to use, but first I&#8217;d like to explain a little bit more about these operators.</p>
<p>When defining a function, you always specify the format of function arguments. Take void test(int arg1,char* arg2); for instance. You have defined your function type &#8220;void,&#8221; the name &#8220;test,&#8221; and the arguments &#8220;int arg1&#8243; and &#8220;char* arg2.&#8221; Now, the way these functions are defined, the function will proceed with the values inserted into the function and the function will only apply end values of these variables specifically to this function (unless type other than &#8220;void&#8221; is defined and you return an output; however, this output would still need to be defined in another function to transfer).</p>
<p>However, if you define a function such as: void test(int&#038; arg1,char&#038; arg2); it actually will append the variables that were used to make the input (thus the &#8220;reference&#8221;). So let&#8217;s take a look at some code, shall we?</p>
<blockquote><p><code>/**<br />
 * Reference Operator Tutorial<br />
 *<br />
 * Author: Dennis J. McWherter, Jr.<br />
 * (C) 2010 DENNIS J. MCWHERTER, JR.<br />
 *<br />
 */</p>
<p>#include &lt;iostream&gt;<br />
#include &lt;cstdlib&gt;</p>
<p>using namespace std;</p>
<p>void deconstruct(float&amp; x,float&amp; y)<br />
{<br />
	x/=y;<br />
	y*=x;<br />
	return;<br />
}</p>
<p>void reconstruct(float&amp; x,float&amp; y)<br />
{<br />
	const float z=x;<br />
	x*=y/x;<br />
	y/=z;<br />
	return;<br />
}</p>
<p>int main(int argc,char* argv[])<br />
{<br />
	// Define our main variables we'll be using<br />
	// Allow users to input!<br />
	float a,b;</p>
<p>	cout&lt;&lt; "Enter your first number: ";<br />
	scanf("%f",&amp;a);<br />
	cout&lt;&lt; "Enter your second number: ";<br />
	scanf("%f",&amp;b);<br />
	cout&lt;&lt; endl &lt;&lt; "Output:" &lt;&lt; endl &lt;&lt; endl;</p>
<p>	const float a1=a,b1=b; // Define what our originals were! Please note that this is very recursive<br />
				// and can be done much easier with a function returning a value<br />
				// But that would ruin the entire point of this demonstration! <img src='http://microsonic.org/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>	// Now we will do our actual functioning<br />
	deconstruct(a,b);<br />
	printf("%f / %f = %f\n",a1,b1,a);<br />
	printf("%f x %f = %f\n\n",b1,a,b);</p>
<p>	// Define our "z" variable for here as well<br />
	const float z=a,w=b;</p>
<p>	// Alright, take everything back to original form<br />
	reconstruct(a,b);<br />
	printf("%f / %f = %f\n",w,z,b);<br />
	printf("%f x %f = %f\n\n",(a1/a1),w,a);<br />
	return 0;<br />
}</code></p></blockquote>
<p>Now, as you can see, the variables are originally defined by user input. However, when taken to each function their values are changed (as can be seen by the printf values). That is what the purpose of a reference operator is. Now to reconstruct, we can use the same variables with opposite operations. The &#8220;const&#8221; defined in front of some variables protect them from being &#8220;referenced&#8221; (precursed with &#038;) so their values will not change after they are defined. And as you can see in the final printf statement, (a1/a1) = 1 which is essentially what happens in the final steps of reconstruct().</p>
<p>As I mentioned, it is very recursive to do it this way (it would be best to simply print an output), but then that would defeat the purpose of this post. Also, for those of you wondering why I used printf(); instead of cout: there is no particular reason. Printf(); in this case (and honestly in most) is simply cleaner and quicker. The thing to remember, however, about printf(); is each function type (in this case %f) has a specific variable type that it can output. %f allows us to print float variables. For a more detailed list, visit http://www.cplusplus.com/reference/clibrary/cstdio/scanf/</p>
<p>Below, you can download the script and a compiled *nix version.</p>
<p>Regards,<br />
Dennis M.</p>
<p><a href='http://microsonic.org/wp-content/uploads/2010/04/reference_operators.tar.gz'>Reference Operators Script</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/H7Wsy45Ba-_A7dw9FsAR3WK71p4/0/da"><img src="http://feedads.g.doubleclick.net/~a/H7Wsy45Ba-_A7dw9FsAR3WK71p4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/H7Wsy45Ba-_A7dw9FsAR3WK71p4/1/da"><img src="http://feedads.g.doubleclick.net/~a/H7Wsy45Ba-_A7dw9FsAR3WK71p4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Microsonic/~4/j6a4yuP8n34" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://microsonic.org/2010/04/04/using-reference-operators-in-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://microsonic.org/2010/04/04/using-reference-operators-in-functions/</feedburner:origLink></item>
		<item>
		<title>Multi-Argument Parsing</title>
		<link>http://feedproxy.google.com/~r/Microsonic/~3/8XANeSom8Ds/</link>
		<comments>http://microsonic.org/2010/03/15/multi-argument-parsing/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 06:52:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[argc]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[argv]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://microsonic.org/?p=205</guid>
		<description><![CDATA[Well, it has been some time since my last post since I have been (and still am) very busy, but I felt I needed to update! I wrote a quick script for you guys to help in any programming endeavors you may be having parsing your command line arguments in any command line program. This [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it has been some time since my last post since I have been (and still am) very busy, but I felt I needed to update! I wrote a quick script for you guys to help in any programming endeavors you may be having parsing your command line arguments in any command line program. This example merely shows how to simply print all the arguments given to a specified program, however, you can use this type of loop to do whatever you wish!</p>
<blockquote><p><code>/**<br />
 * Process Command Line Args<br />
 * Level: Easy<br />
 * Author: Dennis J. McWherter, Jr.<br />
 *<br />
 */</p>
<p>#include &lt;iostream&gt;</p>
<p>using namespace std; // I'll save myself some std::&lt;&gt; pain this time XD</p>
<p>void echo(char* str,int no)<br />
{<br />
	int x = strlen(str);<br />
	cout&lt;&lt; "Argument Number "&lt;&lt; no &lt;&lt; ": ";<br />
	for(int i=0;i&lt;x;i++){<br />
		cout&lt;&lt; str[i];<br />
	}<br />
	cout&lt;&lt; endl;<br />
}</p>
<p>int main(int argc,char* argv[])<br />
{<br />
	for(int i=1;i&lt;argc;i++){<br />
		echo(argv[i],i);<br />
	}<br />
	cout&lt;&lt; endl&lt;&lt; "Command line: "&lt;&lt; argv[0] &lt;&lt; endl;<br />
	return 0;<br />
}</code></p></blockquote>
<p>As you can see, the first function is a loop which is given a char* array (it loops through each array value to print out the full string) and an integer position. The int allows the script to know which argument number it is processing (not that it is imperative in this case). In the int main(); function, this void echo(); function is called in another for(); loop. This loop begins at array position 1 (the array starts at position 0, however, arguments begin at 1; 0 is the program/command line name). Therefore, for each argument listed the program loops until it reaches it has no further arguments to parse.</p>
<p>There is your quick lesson today in processing multiple arguments in the command line! This should help many of you looking for a quick and easy solution to do this! The example code is provided below for download.</p>
<p>Regards,<br />
Dennis M.</p>
<p><a href='http://microsonic.org/wp-content/uploads/2010/03/argument_parse.tar.gz'>Parse Multiple Arguments</a></p>

<p><a href="http://feedads.g.doubleclick.net/~a/x5tVck3wlwvYenp_iqcioha9tcI/0/da"><img src="http://feedads.g.doubleclick.net/~a/x5tVck3wlwvYenp_iqcioha9tcI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/x5tVck3wlwvYenp_iqcioha9tcI/1/da"><img src="http://feedads.g.doubleclick.net/~a/x5tVck3wlwvYenp_iqcioha9tcI/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Microsonic/~4/8XANeSom8Ds" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://microsonic.org/2010/03/15/multi-argument-parsing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://microsonic.org/2010/03/15/multi-argument-parsing/</feedburner:origLink></item>
		<item>
		<title>New Year – Lots of Work to be Done!</title>
		<link>http://feedproxy.google.com/~r/Microsonic/~3/5QJOQE5qyZ0/</link>
		<comments>http://microsonic.org/2010/01/21/new-year-lots-of-work-to-be-done/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 21:14:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://microsonic.org/?p=203</guid>
		<description><![CDATA[Hey everyone, The new year has brought a tremendous amount of work along with it and I want to thank all of you. I definitely prefer an abundance of work to a scarcity of work, and that is surely the situation I find myself in today. As soon as I finish these projects up, however, [...]]]></description>
			<content:encoded><![CDATA[<p>Hey everyone,</p>
<p>The new year has brought a tremendous amount of work along with it and I want to thank all of you. I definitely prefer an abundance of work to a scarcity of work, and that is surely the situation I find myself in today. As soon as I finish these projects up, however, I will be writing some new tutorials.</p>
<p>In the recent and current projects I&#8217;ve received I have encountered some tasks that I have found unusual and so took some time to figure out an efficient way to complete the task. Not that some of the things haven&#8217;t already been done, but since they are new to me I will try (being not far from the situation of the user seeking help since it was just days or weeks prior that I was in also in that situation) to explain them as thoroughly and simply as possible. </p>
<p>It seems the more familiar a topic becomes, the more difficult it is to relate to the issues of those just learning and that is why I try to write tutorials as soon as I have done something I find intriguing, but also familiarity (as you can see in the PHP/Salt tutorial) is not always a bad thing either because you can easily increase complexity and security. So more or less, it&#8217;s a give and take and I&#8217;m now beginning to ramble. </p>
<p>So in the meantime, hang tight, subscribe, and I will hopefully get these projects done quickly to write some more tutorials. Yes, I know I have been saying this for over a month, but the Holidays were very busy fortunately or unfortunately and work has to come first to tutorials since it&#8217;s a source of income as I&#8217;m sure it is for many of you (and so hopefully a bit easier to sympathize with my cause).</p>
<p>Regards,<br />
Dennis M.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/HjjHoOXA1DeXZxjoqHmukZHg4sA/0/da"><img src="http://feedads.g.doubleclick.net/~a/HjjHoOXA1DeXZxjoqHmukZHg4sA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HjjHoOXA1DeXZxjoqHmukZHg4sA/1/da"><img src="http://feedads.g.doubleclick.net/~a/HjjHoOXA1DeXZxjoqHmukZHg4sA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Microsonic/~4/5QJOQE5qyZ0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://microsonic.org/2010/01/21/new-year-lots-of-work-to-be-done/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://microsonic.org/2010/01/21/new-year-lots-of-work-to-be-done/</feedburner:origLink></item>
		<item>
		<title>Happy Holidays to All!</title>
		<link>http://feedproxy.google.com/~r/Microsonic/~3/jK26zad9ywA/</link>
		<comments>http://microsonic.org/2009/12/15/happy-holidays-to-all/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 18:44:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[christmas]]></category>
		<category><![CDATA[happy]]></category>
		<category><![CDATA[merry]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[year]]></category>

		<guid isPermaLink="false">http://microsonic.org/?p=201</guid>
		<description><![CDATA[I would just like to thank every user for coming to the site! Unfortunately, my posts have been slow in the past few months (due to many out of town visits as well as the Holidays). Also, Merry Christmas and a Happy New Year to everyone as well! I hope it&#8217;s a wonderful holiday season [...]]]></description>
			<content:encoded><![CDATA[<p>I would just like to thank every user for coming to the site! Unfortunately, my posts have been slow in the past few months (due to many out of town visits as well as the Holidays). Also, Merry Christmas and a Happy New Year to everyone as well! I hope it&#8217;s a wonderful holiday season for you and your family.</p>
<p>Regards,<br />
Dennis M.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/GM6wPnBXuUc9NDUhpsmr0VBqUgE/0/da"><img src="http://feedads.g.doubleclick.net/~a/GM6wPnBXuUc9NDUhpsmr0VBqUgE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/GM6wPnBXuUc9NDUhpsmr0VBqUgE/1/da"><img src="http://feedads.g.doubleclick.net/~a/GM6wPnBXuUc9NDUhpsmr0VBqUgE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Microsonic/~4/jK26zad9ywA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://microsonic.org/2009/12/15/happy-holidays-to-all/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://microsonic.org/2009/12/15/happy-holidays-to-all/</feedburner:origLink></item>
		<item>
		<title>Why Not All Traffic Is Good Traffic</title>
		<link>http://feedproxy.google.com/~r/Microsonic/~3/Z3yFa8pW6iQ/</link>
		<comments>http://microsonic.org/2009/11/15/why-not-all-traffic-is-good-traffic/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 00:32:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[traffic]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://microsonic.org/?p=199</guid>
		<description><![CDATA[Web traffic; it&#8217;s the &#8220;money-maker&#8221; for many webmasters. But is all traffic really a good thing? Well, this is a topic that isn&#8217;t quite &#8220;black and white&#8221; so to speak. Traffic can have many affects on a site, both positive and negative. Ultimately, good traffic is defined as frequent visitors, or a visitor who buys [...]]]></description>
			<content:encoded><![CDATA[<p>Web traffic; it&#8217;s the &#8220;money-maker&#8221; for many webmasters. But is all traffic really a good thing? Well, this is a topic that isn&#8217;t quite &#8220;black and white&#8221; so to speak. Traffic can have many affects on a site, both positive and negative. Ultimately, good traffic is defined as frequent visitors, or a visitor who buys your product (if you&#8217;re selling something). Bad traffic, on the other hand, consists of mostly anything else: spam, abusers, web-surfers, etc.</p>
<p>We will begin by discussing the positive effects of all traffic. Having good traffic, obviously, cannot hurt you. There is no way that comes to mind that I can think of in which good traffic will hurt your site; be it resale value or otherwise (thus its name, &#8220;good&#8221; traffic). If you&#8217;re getting tons of good traffic, your site is booming, and if you ever want to sell it, that raises it&#8217;s value!</p>
<p>Now, bad traffic can also have some (temporarily) &#8220;positive&#8221; effects. If you&#8217;re running a site which does not worry about visitor comments spam hits and robots shouldn&#8217;t be much of a problem for you. In fact, they may make your stats look great at first glance, and you may even be able to catch a gullible buyer and convincing him or her (by not saying anything more than to look at the visitor count) that the traffic is great! However, for those serious domainers, etc. they will check those stats down to the IP&#8217;s of the visits. When they track back all those IP&#8217;s to public proxies, and known spam bots they will throw the name back in your face and your sale will fall through.</p>
<p>So in the end, all traffic does not quite turn into good traffic. It is indeed a great factor for any sale of a site, but visitor turn around is what really matters. So when analyzing your own traffic, check as if you were buying your site up and take steps to minimize spam traffic!</p>
<p>Regards,<br />
Dennis M.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/loBeW6XgVtNmI5dFx0jhvjhC_vA/0/da"><img src="http://feedads.g.doubleclick.net/~a/loBeW6XgVtNmI5dFx0jhvjhC_vA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/loBeW6XgVtNmI5dFx0jhvjhC_vA/1/da"><img src="http://feedads.g.doubleclick.net/~a/loBeW6XgVtNmI5dFx0jhvjhC_vA/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Microsonic/~4/Z3yFa8pW6iQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://microsonic.org/2009/11/15/why-not-all-traffic-is-good-traffic/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://microsonic.org/2009/11/15/why-not-all-traffic-is-good-traffic/</feedburner:origLink></item>
		<item>
		<title>Thoughts or Comments: Re-opening the Hosting Branch</title>
		<link>http://feedproxy.google.com/~r/Microsonic/~3/a3_P9CIDTYI/</link>
		<comments>http://microsonic.org/2009/10/20/thoughts-or-comments-re-opening-the-hosting-branch/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 21:14:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[branch]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[microsonic]]></category>

		<guid isPermaLink="false">http://microsonic.org/?p=197</guid>
		<description><![CDATA[Hey everyone! As many of you may or may not know, Microsonic used to be a hosting company. From 2005-2008 I ran the site as &#8220;Microsonic Hosting.&#8221; In 2009, however, I decided to make it a more specialized place consisting of my thoughts and sharing my skills with others. Today, however, an idea ran across [...]]]></description>
			<content:encoded><![CDATA[<p>Hey everyone!</p>
<p>As many of you may or may not know, Microsonic used to be a hosting company. From 2005-2008 I ran the site as &#8220;Microsonic Hosting.&#8221; In 2009, however, I decided to make it a more specialized place consisting of my thoughts and sharing my skills with others. Today, however, an idea ran across my head: re-open the hosting branch. So in this topic, I&#8217;ll take you through my head a bit more.</p>
<p>Well, what does this entail? The mere thought makes one wonder what would happen to the current site. Well, it would remain the same. As I mentioned, it would be a &#8220;branch&#8221; of Microsonic Development. I actually run &#8220;Microsonic Development&#8221; as a freelance programming company, so I may even revamp this to being much more than simply a blog! A hosting company that is not run by C/O&#8217;s who know very little about what they&#8217;re selling, but rather a professional selling services to another professional. Keeping in mind the reason I closed up shop in the first place, however, is also very important.</p>
<p>Due to lack of business and trying to keep prices low, costs built up and I ended up taking a loss on the whole project unfortunately. Not that I am in it to solely make a profit, but just like for everyone else, finances are tight. But then again, in retrospect it is important to think about what caused the collapse. My lack of advertising was the ultimate beast that did it in in the first place. All clients I had were extremely happy and very upset when I announced the initial closing of the company, however, had more people known about the satisfaction perhaps more members would have joined.</p>
<p>So now, as I continue to ponder my own thoughts, what are you personal thoughts? Perhaps I should specialize? Rather than web hosting, perhaps I will provide shell or VPS hosting? Let me know what you think! Your thoughts are, as usual, very helpful for me as they inspire my decisions about how to proceed in certain actions and what kinds of articles to write!</p>
<p>Regards,<br />
Dennis M.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/Re-dQ85b_ON0OKwyv8W2zWzxVvY/0/da"><img src="http://feedads.g.doubleclick.net/~a/Re-dQ85b_ON0OKwyv8W2zWzxVvY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Re-dQ85b_ON0OKwyv8W2zWzxVvY/1/da"><img src="http://feedads.g.doubleclick.net/~a/Re-dQ85b_ON0OKwyv8W2zWzxVvY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Microsonic/~4/a3_P9CIDTYI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://microsonic.org/2009/10/20/thoughts-or-comments-re-opening-the-hosting-branch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://microsonic.org/2009/10/20/thoughts-or-comments-re-opening-the-hosting-branch/</feedburner:origLink></item>
		<item>
		<title>Server Maintenance: A Necessary Frustration</title>
		<link>http://feedproxy.google.com/~r/Microsonic/~3/dX5xrP5vI9c/</link>
		<comments>http://microsonic.org/2009/10/10/server-maintenance-a-necessary-frustration/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 14:36:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[frustration]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[necessary]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[updates]]></category>

		<guid isPermaLink="false">http://microsonic.org/?p=195</guid>
		<description><![CDATA[I&#8217;d like to begin this post with an apology to all my subscribers. It has been over a month since I&#8217;ve posted anything! This is because I have been involved in a very large project which I should hopefully be finishing very soon (yes, I&#8217;m still not finished with it). And without further adieu: Server [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to begin this post with an apology to all my subscribers. It has been over a month since I&#8217;ve posted anything! This is because I have been involved in a very large project which I should hopefully be finishing very soon (yes, I&#8217;m still not finished with it). And without further adieu: </p>
<p>Server Maintenance. It&#8217;s a love-hate relationship really. One never knows how long it&#8217;s truly going to take, so you generally lose a lot of precious uptime due to it. On the other hand, it keeps the system running strong and fast so it can keep up with other servers.</p>
<p>This server even has some scheduled maintenance coming up very soon (I believe Sunday October, 11 at 9:00am CST, but I could be wrong). But it&#8217;s not always a thing to get angry about. In the time it takes to update the server, most people won&#8217;t lose any clients.</p>
<p>Most companies or users try to find a time (analyzing statistics) where their traffic is the lowest. During this time is when they normally try to schedule maintenance if it&#8217;s possible. This already minimizes the amount of clients lost. Also, maintenance normally lasts an hour or so (but I&#8217;ve had experiences with up to 24) and then you come back to a much faster working network.</p>
<p>So overall, this server maintenance thing is really a blessing in disguise. Although you will get some immediate frustration that you cannot access your site, you will be able to come back to a quick server. Not only quick (by way of RAM), but many times a quicker internet speed as well (a connection update!).</p>
<p>Regards,<br />
Dennis M.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/HkDZcWtH3t6G2hkSVkaPB8F195c/0/da"><img src="http://feedads.g.doubleclick.net/~a/HkDZcWtH3t6G2hkSVkaPB8F195c/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HkDZcWtH3t6G2hkSVkaPB8F195c/1/da"><img src="http://feedads.g.doubleclick.net/~a/HkDZcWtH3t6G2hkSVkaPB8F195c/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/Microsonic/~4/dX5xrP5vI9c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://microsonic.org/2009/10/10/server-maintenance-a-necessary-frustration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://microsonic.org/2009/10/10/server-maintenance-a-necessary-frustration/</feedburner:origLink></item>
	</channel>
</rss>
