<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: New Ubuntuforums Staff</title>
	<atom:link href="http://moxiefoxtrot.com/2009/04/07/new-ubuntuforums-staff/feed/" rel="self" type="application/rss+xml" />
	<link>http://moxiefoxtrot.com/2009/04/07/new-ubuntuforums-staff/</link>
	<description>...a random blog about life and technology</description>
	<lastBuildDate>Thu, 29 Jul 2010 00:48:22 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: farzaneh</title>
		<link>http://moxiefoxtrot.com/2009/04/07/new-ubuntuforums-staff/comment-page-1/#comment-15388</link>
		<dc:creator>farzaneh</dc:creator>
		<pubDate>Mon, 13 Apr 2009 12:30:50 +0000</pubDate>
		<guid isPermaLink="false">http://moxiefoxtrot.com/?p=704#comment-15388</guid>
		<description>hello everybody,
i have a big problem, but i don&#039;t know how to resolve it.
please help me.
my problem is this  --&gt;
 i wrote a program in c++ that compiled with g++ about ring buffer  ,
my code is this :
/////////////
buffer::~buffer()
{
   if(Buffer!=NULL)
      free(Buffer); //free buffer that allocated
};


// allocate memory and fill buffer  with filltext that is input function
Uchar buffer::init(Word FillText)
{
   Lword i;
   if(Buffer==NULL)
   {
// 	   cout&lt;&lt;&quot;buf element :&quot;&lt;&lt;bufElem&lt;&lt;&quot;   sizeof : &quot;&lt;&lt;sizeof(int)&lt;&lt;endl;
	   Buffer=(Uchar *)calloc(bufElem,bufSize);//calloc() calls malloc() then initializes the data to all 0s.
	   //equal :p = malloc(m * n);	   memset(p, 0, m * n);
   }
   if(Buffer==NULL)   {
      return 0;
   }
   else{
	bufLen=(Lword)bufElem*bufSize;
	cout&lt;&lt;&quot;FillText :&quot;&lt;&lt;FillText&lt;&lt;endl;
	for(i=0 ;i&lt;bufLen;i+=2 ){
			Buffer[i]=FillText;
			cout&lt;&lt;&quot;Bufer[&quot;&lt;&lt;i&lt;&lt;&quot;]:&quot;&lt;&lt;(int)Buffer[i]&lt;0)
     {
		 bufSize=Size;
		 bufLen=(Lword)bufElem*bufSize;
      return 1;
     }
   else
     {
      return 0;
     }
};
// get lenght of buffer
Word buffer::getBufSize(void)
{
	return bufSize;
};

//set size of buffer for allocate memory
Uchar buffer::setBufElem(Word Elem)
{
   if(Elem&gt;0)
     {
		 bufElem=Elem;
		 bufLen=(Lword)bufElem*bufSize;
      return 1;
     }
   else
     {
      return 0;
     }
};
//get size of allocated buffer
Word buffer::getBufElem(void)
{
	return bufElem;
};
//set offset
Uchar buffer::setOffset(Word Pos)
{
	if(bufType==RINGBUF)
     {
		 if(abs(Pos)&lt;bufLen)
        {
	      Offset=Pos;
         return 1;
        }
      else
        {
	      Offset=0;
         return 0;
        }
     }
   else
     {
		 if(((Lword)readPtr+abs(Pos))bufLen)
      return 0;

   if(bufType==RINGBUF)  //if buff is ringbuffer
     {
		 readPtr+=Offset;
		 if(readPtr&gt;=bufLen)
			 readPtr-=bufLen;
      for(Ptr=0;Ptr=bufLen)
				 readPtr=0;
		   }
      Offset=0;
	  return (Size*Num);
	  }
	  else //if(bufType==SIMPLEBUF
   {
	   readPtr+=Offset;
	   if(readPtr&gt;=bufLen &#124;&#124; (readPtr+Size*Num)&gt;bufLen)
         return 0;
	   memcpy((Uchar *)Dest,(Uchar *)&amp;Buffer[readPtr],Size*Num);
   }
};

//method : buffwrite
//purpose: write Into buffer
//befor write into buffer  you must call setoffset
//Return Value: 0 upon failed, otherwise success.
Word buffer::bufWrite(Uchar *Src,Word Size,Word Num)
{
   Word Ptr=0,i=0;
   if(((Lword)Size*Num)&gt;bufLen)
      return 0;

   if(bufType==RINGBUF)
     {
		 writePtr+=Offset;
		 if(writePtr&gt;=bufLen)
			 writePtr-=bufLen;
      for(Ptr=0;Ptr=bufLen)
				 writePtr=0;
// 			 cout&lt;buffer[&quot;&lt;=bufLen &#124;&#124; (writePtr+Size*Num)&gt;bufLen)
         return 0;
	   memcpy((Uchar *)&amp;Buffer[writePtr],(Uchar *)Src,Size*Num);
   }
};
////////////
i used the void * value for pointer to buffer but g++ give error ,
i know that must be of gcc and in g++ give me error but i want to find a way to resolve this problem and define a value that get all of type value.
please help me .
thanks and best regards.</description>
		<content:encoded><![CDATA[<p>hello everybody,<br />
i have a big problem, but i don&#8217;t know how to resolve it.<br />
please help me.<br />
my problem is this  &#8211;&gt;<br />
 i wrote a program in c++ that compiled with g++ about ring buffer  ,<br />
my code is this :<br />
/////////////<br />
buffer::~buffer()<br />
{<br />
   if(Buffer!=NULL)<br />
      free(Buffer); //free buffer that allocated<br />
};</p>
<p>// allocate memory and fill buffer  with filltext that is input function<br />
Uchar buffer::init(Word FillText)<br />
{<br />
   Lword i;<br />
   if(Buffer==NULL)<br />
   {<br />
// 	   cout&lt;&lt;&#8221;buf element :&#8221;&lt;&lt;bufElem&lt;&lt;&#8221;   sizeof : &#8220;&lt;&lt;sizeof(int)&lt;&lt;endl;<br />
	   Buffer=(Uchar *)calloc(bufElem,bufSize);//calloc() calls malloc() then initializes the data to all 0s.<br />
	   //equal :p = malloc(m * n);	   memset(p, 0, m * n);<br />
   }<br />
   if(Buffer==NULL)   {<br />
      return 0;<br />
   }<br />
   else{<br />
	bufLen=(Lword)bufElem*bufSize;<br />
	cout&lt;&lt;&#8221;FillText :&#8221;&lt;&lt;FillText&lt;&lt;endl;<br />
	for(i=0 ;i&lt;bufLen;i+=2 ){<br />
			Buffer[i]=FillText;<br />
			cout&lt;&lt;&#8221;Bufer["&lt;&lt;i&lt;&lt;"]:&#8221;&lt;&lt;(int)Buffer[i]&lt;0)<br />
     {<br />
		 bufSize=Size;<br />
		 bufLen=(Lword)bufElem*bufSize;<br />
      return 1;<br />
     }<br />
   else<br />
     {<br />
      return 0;<br />
     }<br />
};<br />
// get lenght of buffer<br />
Word buffer::getBufSize(void)<br />
{<br />
	return bufSize;<br />
};</p>
<p>//set size of buffer for allocate memory<br />
Uchar buffer::setBufElem(Word Elem)<br />
{<br />
   if(Elem&gt;0)<br />
     {<br />
		 bufElem=Elem;<br />
		 bufLen=(Lword)bufElem*bufSize;<br />
      return 1;<br />
     }<br />
   else<br />
     {<br />
      return 0;<br />
     }<br />
};<br />
//get size of allocated buffer<br />
Word buffer::getBufElem(void)<br />
{<br />
	return bufElem;<br />
};<br />
//set offset<br />
Uchar buffer::setOffset(Word Pos)<br />
{<br />
	if(bufType==RINGBUF)<br />
     {<br />
		 if(abs(Pos)&lt;bufLen)<br />
        {<br />
	      Offset=Pos;<br />
         return 1;<br />
        }<br />
      else<br />
        {<br />
	      Offset=0;<br />
         return 0;<br />
        }<br />
     }<br />
   else<br />
     {<br />
		 if(((Lword)readPtr+abs(Pos))bufLen)<br />
      return 0;</p>
<p>   if(bufType==RINGBUF)  //if buff is ringbuffer<br />
     {<br />
		 readPtr+=Offset;<br />
		 if(readPtr&gt;=bufLen)<br />
			 readPtr-=bufLen;<br />
      for(Ptr=0;Ptr=bufLen)<br />
				 readPtr=0;<br />
		   }<br />
      Offset=0;<br />
	  return (Size*Num);<br />
	  }<br />
	  else //if(bufType==SIMPLEBUF<br />
   {<br />
	   readPtr+=Offset;<br />
	   if(readPtr&gt;=bufLen || (readPtr+Size*Num)&gt;bufLen)<br />
         return 0;<br />
	   memcpy((Uchar *)Dest,(Uchar *)&amp;Buffer[readPtr],Size*Num);<br />
   }<br />
};</p>
<p>//method : buffwrite<br />
//purpose: write Into buffer<br />
//befor write into buffer  you must call setoffset<br />
//Return Value: 0 upon failed, otherwise success.<br />
Word buffer::bufWrite(Uchar *Src,Word Size,Word Num)<br />
{<br />
   Word Ptr=0,i=0;<br />
   if(((Lword)Size*Num)&gt;bufLen)<br />
      return 0;</p>
<p>   if(bufType==RINGBUF)<br />
     {<br />
		 writePtr+=Offset;<br />
		 if(writePtr&gt;=bufLen)<br />
			 writePtr-=bufLen;<br />
      for(Ptr=0;Ptr=bufLen)<br />
				 writePtr=0;<br />
// 			 cout&lt;buffer["&lt;=bufLen || (writePtr+Size*Num)&gt;bufLen)<br />
         return 0;<br />
	   memcpy((Uchar *)&amp;Buffer[writePtr],(Uchar *)Src,Size*Num);<br />
   }<br />
};<br />
////////////<br />
i used the void * value for pointer to buffer but g++ give error ,<br />
i know that must be of gcc and in g++ give me error but i want to find a way to resolve this problem and define a value that get all of type value.<br />
please help me .<br />
thanks and best regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JenkinBr</title>
		<link>http://moxiefoxtrot.com/2009/04/07/new-ubuntuforums-staff/comment-page-1/#comment-15241</link>
		<dc:creator>JenkinBr</dc:creator>
		<pubDate>Wed, 08 Apr 2009 15:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://moxiefoxtrot.com/?p=704#comment-15241</guid>
		<description>I thought that I was noticing some changes in user name colors and positions lately...

Congrats to all who were promoted!</description>
		<content:encoded><![CDATA[<p>I thought that I was noticing some changes in user name colors and positions lately&#8230;</p>
<p>Congrats to all who were promoted!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ubuntu Forums News &#171; Joe Blog&#8217;s</title>
		<link>http://moxiefoxtrot.com/2009/04/07/new-ubuntuforums-staff/comment-page-1/#comment-15219</link>
		<dc:creator>Ubuntu Forums News &#171; Joe Blog&#8217;s</dc:creator>
		<pubDate>Tue, 07 Apr 2009 22:56:33 +0000</pubDate>
		<guid isPermaLink="false">http://moxiefoxtrot.com/?p=704#comment-15219</guid>
		<description>[...] know that ubuntu-geek has already posted about this (and probably jacob too - way to steal my [...]</description>
		<content:encoded><![CDATA[<p>[...] know that ubuntu-geek has already posted about this (and probably jacob too &#8211; way to steal my [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
