<?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>Samad's Blog &#187; Coding</title>
	<atom:link href="http://blog.samad64.com/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.samad64.com</link>
	<description>Yes.. I blog. Get over it.</description>
	<lastBuildDate>Tue, 13 Jul 2010 20:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Maven Problem (Id can not be null)</title>
		<link>http://blog.samad64.com/2010/07/13/maven-problem-id-can-not-be-null/</link>
		<comments>http://blog.samad64.com/2010/07/13/maven-problem-id-can-not-be-null/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 20:08:01 +0000</pubDate>
		<dc:creator>Samad</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://blog.samad64.com/?p=91</guid>
		<description><![CDATA[Working with Maven I came across a very weird issue. I attempted to build a new project, and received a Fatal Error: ID Can Not Be Null. Basically a Java.Lang.NullPointerException. I work in a corporate environment so I had an idea of which parent POM was having issues, but it didn&#8217;t quite click in my [...]]]></description>
			<content:encoded><![CDATA[<p>Working with Maven I came across a very weird issue. I attempted to build a new project, and received a Fatal Error: ID Can Not Be Null. Basically a Java.Lang.NullPointerException. I work in a corporate environment so I had an idea of which parent POM was having issues, but it didn&#8217;t quite click in my mind until about 5 minutes ago. After researching the net for the past few hours, I finally had my AHA! moment and decided to try it out. The solution to this problem is as follows:</p>
<p>Inside the POM.XML file for the project you are currently working with, you should have something like the following:</p>
<div id="_mcePaste">&lt;parent&gt;</div>
<div id="_mcePaste">&lt;groupId&gt;com.mycompany.or.something&lt;/groupId&gt;</div>
<div id="_mcePaste">&lt;artifactId&gt;parent&lt;/artifactId&gt;</div>
<div id="_mcePaste">&lt;version&gt;1.0&lt;/version&gt;</div>
<div id="_mcePaste">&lt;relativePath&gt;../../parent/&lt;/relativePath&gt;</div>
<div id="_mcePaste">&lt;/parent&gt;</div>
<div></div>
<div>The groupId tag is very important, as in my case this is where the problem existed. I navigated to the local maven repo (~.m2/repositories) and through the directories til I came to the following dir:</div>
<div></div>
<div>~m2/repositories/com/mycompany/or/something/parent/1.0/</div>
<div></div>
<div>Inside this directory was a parent pom file. I opened it up in Notepad++ and looked through the tags. Sure enough, the repositories tag did not contain an ID element. I simply added one in ( &lt;id /&gt; ) and voila, problem solved.</div>
<div>Hope this helps someone in the future, because it had me banging my head against everything I could possibly find &#8211; from walls to staplers to windows (oh my!)</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.samad64.com/2010/07/13/maven-problem-id-can-not-be-null/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix Lucas Fork Program</title>
		<link>http://blog.samad64.com/2008/04/05/unix-lucas-fork-program/</link>
		<comments>http://blog.samad64.com/2008/04/05/unix-lucas-fork-program/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 18:05:43 +0000</pubDate>
		<dc:creator>Samad</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://blog.samad64.com/2008/04/05/unix-lucas-fork-program/</guid>
		<description><![CDATA[I wrote this program for a class a few semesters ago. It is a Lucas Number calculator that uses forks/pipes (a requirement of the project). Works great, hopefully it will help someone out there! It is also available for download below. /* Lucas Fork &#038; Pipe*/ #include &#60;stdio.h&#62; #include &#60;time.h&#62; // to print the time [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote this program for a class a few semesters ago. It is a Lucas Number calculator that uses forks/pipes (a requirement of the project). Works great, hopefully it will help someone out there! It is also available for download below.</p>
<p><code><br />
/*  Lucas Fork &#038; Pipe*/<br />
#include &lt;stdio.h&gt;<br />
#include &lt;time.h&gt; // to print the time</p>
<p>float    fib(int); // fibonacci function, recursive<br />
int    fork(void);<br />
void   sleep(unsigned);</p>
<p>int main(void)<br />
{<br />
   int n; // input variable<br />
   int i; // for the loop<br />
   int start = time(NULL); // get the time the process started<br />
        char buf[100]; /* store the characters read */</p>
<p>   // pipe needs an integer array of size 2<br />
		int fd[2];<br />
		printf("Create the pipe\n\n");<br />
		pipe(fd); /* fd[0] read; fd[1] write */</p>
<p>	printf("Enter a number: ");<br />
	if (scanf("%d", &#038;n) != 1) { // check to make sure there is input<br />
		printf("Input error.\n");<br />
		return 1;<br />
	}<br />
		printf("Create the child process using fork\n");<br />
   if (fork() == 0) {    // child process<br />
		close(fd[1]); /* close write end */<br />
		printf("child is running...\n");<br />
        printf("about to read from the pipe\n");<br />
		n = read( fd[0], buf, 100); /* child reads from pipe */<br />
		printf("after reading from the pipe\n");<br />
        printf("the value of n is: %d\n",n);<br />
        printf("the value in the buffer is: %s\n\n", buf);<br />
      for (i = 0; i <= n; ++i) {<br />
         printf("fib(%2d) = %d\n", i, fib(i));<br />
		 sleep(1);<br />
		}<br />
	}<br />
   else    {            // parent process<br />
		close(fd[0]); /* close read end - not needed for this example */<br />
		printf("parent is running...\n");<br />
        printf("about to write to the pipe\n");<br />
        write( fd[1], "Writing to pipe\n", n); /* parent writes to pipe */<br />
        printf("after writing to the pipe\n\n");<br />
	 for (i = 0; i < n; ++i) {<br />
         sleep(1);<br />
         printf("Calculating...elapsed time = %d\n", time(NULL) - start);<br />
      }<br />
	}<br />
   return 0; // exits program<br />
}</p>
<p>float fib(int n) // fibonacci function, recursive<br />
{<br />
   if (n <= 1)<br />
      return n;<br />
   else<br />
      return (fib(n - 1) + fib(n - 2));<br />
}<br />
</code></p>
<p><a title="Lucas Fork Source File (zipped)" href="http://blog.samad64.com/wp-content/uploads/2008/04/lucas-fork.zip">Lucas Fork Source File (zipped)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.samad64.com/2008/04/05/unix-lucas-fork-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
