<?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: About Mark Nelson</title>
	<atom:link href="http://marknelson.us/about/feed/" rel="self" type="application/rss+xml" />
	<link>http://marknelson.us</link>
	<description>Programming, mostly.</description>
	<lastBuildDate>Mon, 30 Jan 2012 17:56:19 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Mark Nelson</title>
		<link>http://marknelson.us/about/comment-page-1/#comment-335418</link>
		<dc:creator>Mark Nelson</dc:creator>
		<pubDate>Fri, 29 Oct 2010 18:29:16 +0000</pubDate>
		<guid isPermaLink="false">#comment-335418</guid>
		<description>Nothing too tricky here. The GIF encoder is creating nine-bit codes. Unfortunately for the encoder, the files are aligned on eight-bit boundaries. So when the bits of the first code are written out, the lower eight bits are packed into the first byte, then the most significant bit goes into the LSB position of the next output byte. That&#039;s why you see a 1 with a pipe symbol on its left hand side - that is the nine-bit boundary.

The 028 is written out next. The lower seven bits are written into the upper seven bits of output byte two, then the upper two bits are written into the lower two bits of output byte 3.

Repeat for each output code.

- Mark</description>
		<content:encoded><![CDATA[<p>Nothing too tricky here. The GIF encoder is creating nine-bit codes. Unfortunately for the encoder, the files are aligned on eight-bit boundaries. So when the bits of the first code are written out, the lower eight bits are packed into the first byte, then the most significant bit goes into the LSB position of the next output byte. That&#8217;s why you see a 1 with a pipe symbol on its left hand side &#8211; that is the nine-bit boundary.</p>
<p>The 028 is written out next. The lower seven bits are written into the upper seven bits of output byte two, then the upper two bits are written into the lower two bits of output byte 3.</p>
<p>Repeat for each output code.</p>
<p>- Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Gaczi</title>
		<link>http://marknelson.us/about/comment-page-1/#comment-335400</link>
		<dc:creator>Peter Gaczi</dc:creator>
		<pubDate>Fri, 29 Oct 2010 15:18:05 +0000</pubDate>
		<guid isPermaLink="false">#comment-335400</guid>
		<description>[c]
Mark Nelson,

The WikiPedia article &quot;Graphics Interchange Format&quot; has
an example of code packing as follows 

9-bit   binary   Bytes         I was able to reproduce their
(hex)            (hex)         11 compressed data bytes by
        00000000  00           creating a GIF file that
100                            matches their example. 
       0101000&#124;1  51
028                            I understand how the 9-bit 
       111111&#124;00  FC           codes on the left are obtained,
0FF                            but how the hell do they get
       00011&#124;011  1B           from the 9-bit codes to the
103                            11 bytes?
       0010&#124;1000  28
102                            The diagram on the left looks
       011&#124;10000  70           there are 7 bits per code!
103
       10&#124;100000  A0           Where, for example, is the
106                            100000000 binary value for the
       1&#124;1000001  C1           first code?
107
        10000011  83           
        00000001  01
101
       0000000&#124;1  01           TIA, Peter Gaczi
[/c]</description>
		<content:encoded><![CDATA[<div class="igBar"><span id="lc-1"><a href="#" onclick="javascript:showPlainTxt('c-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C:</span>
<div id="c-1">
<div class="c">
<ol>
<li class="li1">
<div class="de1">Mark Nelson,</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">The WikiPedia article <span class="st0">"Graphics Interchange Format"</span> has</div>
</li>
<li class="li2">
<div class="de2">an example of code packing as follows </div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="nu0">9</span>-bit&nbsp; &nbsp;binary&nbsp; &nbsp;Bytes&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;I was able to reproduce their</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#40;</span>hex<span class="br0">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span>hex<span class="br0">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">11</span> compressed data bytes by</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">00000000</span>&nbsp; <span class="nu0">00</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;creating a GIF file that</div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">100</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; matches their example. </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">0101000</span>|<span class="nu0">1</span>&nbsp; <span class="nu0">51</span></div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">028</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; I understand how the <span class="nu0">9</span>-bit </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">111111</span>|<span class="nu0">00</span>&nbsp; FC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;codes on the left are obtained,</div>
</li>
<li class="li1">
<div class="de1">0FF&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; but how the hell <span class="kw1">do</span> they get</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">00011</span>|<span class="nu0">011</span>&nbsp; 1B&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;from the <span class="nu0">9</span>-bit codes to the</div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">103</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">11</span> bytes?</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">0010</span>|<span class="nu0">1000</span>&nbsp; <span class="nu0">28</span></div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">102</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; The diagram on the left looks</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">011</span>|<span class="nu0">10000</span>&nbsp; <span class="nu0">70</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;there are <span class="nu0">7</span> bits per code!</div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">103</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">10</span>|<span class="nu0">100000</span>&nbsp; A0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Where, <span class="kw1">for</span> example, is the</div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">106</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">100000000</span> binary value <span class="kw1">for</span> the</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">1</span>|<span class="nu0">1000001</span>&nbsp; C1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;first code?</div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">107</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">10000011</span>&nbsp; <span class="nu0">83</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">00000001</span>&nbsp; <span class="nu0">01</span></div>
</li>
<li class="li2">
<div class="de2"><span class="nu0">101</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">0000000</span>|<span class="nu0">1</span>&nbsp; <span class="nu0">01</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TIA, Peter Gaczi </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://marknelson.us/about/comment-page-1/#comment-326189</link>
		<dc:creator>John</dc:creator>
		<pubDate>Fri, 30 Apr 2010 19:07:04 +0000</pubDate>
		<guid isPermaLink="false">#comment-326189</guid>
		<description>Hi mark,

For the Data compression with BWT, can you explain to me the reasons why the BWT is implemented in this manner with the MTF?

why is it done this way rather than in any other way?
what are the advantages to it?

Kind regards</description>
		<content:encoded><![CDATA[<p>Hi mark,</p>
<p>For the Data compression with BWT, can you explain to me the reasons why the BWT is implemented in this manner with the MTF?</p>
<p>why is it done this way rather than in any other way?<br />
what are the advantages to it?</p>
<p>Kind regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://marknelson.us/about/comment-page-1/#comment-321270</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Tue, 12 Jan 2010 09:15:24 +0000</pubDate>
		<guid isPermaLink="false">#comment-321270</guid>
		<description>Carlos Eduardo Olivieri:

I wrote some code for your problem. While this may still be regarded as a brute force solution, it is somewhat more efficient than the most naive solutions as it does early pruning. Maybe you can get some ideas from it. A further idea could be to try to find a formula that can be used to determine if a valid string can be built from given frequencies.

[cpp]
#include 
#include 
#include 
using namespace std;

vector start;
vector curPerm;
map frequencies;
const int MAX_REPEAT = 2;

void process(){ //Do whatever, the current permutation is in curPerm
    vector::iterator it;
    for(it = curPerm.begin(); it!= curPerm.end(); it++)
        cout ::iterator it;
    for(it = frequencies.begin(); it != frequencies.end(); it++){
        if(it-&gt;second == 0) continue; //If no items of this type are free
        int curItem = it-&gt;first;
        
        it-&gt;second--; //Decrease the available frequency of this item
        curPerm.push_back(curItem);
        if(curItem == lastItem){
            if(runLength + 1 second++; //Revert the frequency as the item is not in use anymore
    }   
}

int main(int argc, char* argv[]){
    
    //Any starting permutation, e.g. 6667778 (even exceeding
    //the limit of allowed repeats)
    start.push_back(6); start.push_back(6); start.push_back(6);
    start.push_back(7); start.push_back(7); start.push_back(7);
    start.push_back(8);
    
    for(vector::iterator it = start.begin(); it != start.end(); it++)
        frequencies[*it]++;
    
    generator(-1, 0);
}
[/cpp]</description>
		<content:encoded><![CDATA[

<p>Carlos Eduardo Olivieri:</p>
<p>I wrote some code for your problem. While this may still be regarded as a brute force solution, it is somewhat more efficient than the most naive solutions as it does early pruning. Maybe you can get some ideas from it. A further idea could be to try to find a formula that can be used to determine if a valid string can be built from given frequencies.</p>
<div class="igBar"><span id="lcpp-2"><a href="#" onclick="javascript:showPlainTxt('cpp-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">C++:</span>
<div id="cpp-2">
<div class="cpp">
<ol>
<li class="li1">
<div class="de1"><span class="co2">#include </span></div>
</li>
<li class="li2">
<div class="de2"><span class="co2">#include </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co2">#include </span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw2">using</span> <span class="kw2">namespace</span> std;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">vector start;</div>
</li>
<li class="li1">
<div class="de1">vector curPerm;</div>
</li>
<li class="li2">
<div class="de2">map frequencies;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">const</span> <span class="kw4">int</span> MAX_REPEAT = <span class="nu0">2</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw4">void</span> process<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span> <span class="co1">//Do whatever, the current permutation is in curPerm</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; vector::<span class="me2">iterator</span> it;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span>it = curPerm.<span class="me1">begin</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; it!= curPerm.<span class="me1">end</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; it++<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">cout</span> ::<span class="me2">iterator</span> it;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span>it = frequencies.<span class="me1">begin</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; it != frequencies.<span class="me1">end</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; it++<span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>it-&gt;second == <span class="nu0">0</span><span class="br0">&#41;</span> <span class="kw1">continue</span>; <span class="co1">//If no items of this type are free</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> curItem = it-&gt;first;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; it-&gt;second--; <span class="co1">//Decrease the available frequency of this item</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; curPerm.<span class="me1">push_back</span><span class="br0">&#40;</span>curItem<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>curItem == lastItem<span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>runLength + <span class="nu0">1</span> second++; <span class="co1">//Revert the frequency as the item is not in use anymore</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span>&nbsp; &nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw4">int</span> main<span class="br0">&#40;</span><span class="kw4">int</span> argc, <span class="kw4">char</span>* argv<span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="co1">//Any starting permutation, e.g. 6667778 (even exceeding</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//the limit of allowed repeats)</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; start.<span class="me1">push_back</span><span class="br0">&#40;</span><span class="nu0">6</span><span class="br0">&#41;</span>; start.<span class="me1">push_back</span><span class="br0">&#40;</span><span class="nu0">6</span><span class="br0">&#41;</span>; start.<span class="me1">push_back</span><span class="br0">&#40;</span><span class="nu0">6</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; start.<span class="me1">push_back</span><span class="br0">&#40;</span><span class="nu0">7</span><span class="br0">&#41;</span>; start.<span class="me1">push_back</span><span class="br0">&#40;</span><span class="nu0">7</span><span class="br0">&#41;</span>; start.<span class="me1">push_back</span><span class="br0">&#40;</span><span class="nu0">7</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; start.<span class="me1">push_back</span><span class="br0">&#40;</span><span class="nu0">8</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span>vector::<span class="me2">iterator</span> it = start.<span class="me1">begin</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; it != start.<span class="me1">end</span><span class="br0">&#40;</span><span class="br0">&#41;</span>; it++<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; frequencies<span class="br0">&#91;</span>*it<span class="br0">&#93;</span>++;</div>
</li>
<li class="li2">
<div class="de2">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; generator<span class="br0">&#40;</span>-<span class="nu0">1</span>, <span class="nu0">0</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li2">
<div class="de2"><span class="br0">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ronald Garlit</title>
		<link>http://marknelson.us/about/comment-page-1/#comment-255923</link>
		<dc:creator>Ronald Garlit</dc:creator>
		<pubDate>Wed, 24 Dec 2008 06:44:34 +0000</pubDate>
		<guid isPermaLink="false">#comment-255923</guid>
		<description>Just a note to say Hi.  I don&#039;tknow if you remember me from the 80&#039;s.

Did a bunch of beta stuff for Don Killen in the old days on the C desktop side of things.  I was in medical electronics then.

Happy Holidays
Ron

You can delete this reply since it doesn&#039;t go with the article.  I didn&#039;t find your email on the site.

My info is:
-----------
Personal Email: ron.garlit@gmail.com

Business contact info:
Ronald Garlit
Lead Technical Architect &#124; Distributed Computing .NET TEC
Technologies, Strategy and Operations &#124; American Express Company
Ph: 856.848.7908 &#124; Email: Ronald.A.Garlit@aexp.com</description>
		<content:encoded><![CDATA[<p>Just a note to say Hi.  I don'tknow if you remember me from the 80's.</p>
<p>Did a bunch of beta stuff for Don Killen in the old days on the C desktop side of things.  I was in medical electronics then.</p>
<p>Happy Holidays<br />
Ron</p>
<p>You can delete this reply since it doesn't go with the article.  I didn't find your email on the site.</p>
<p>My info is:<br />
-----------<br />
Personal Email: <a href="mailto:ron.garlit@gmail.com">ron.garlit@gmail.com</a></p>
<p>Business contact info:<br />
Ronald Garlit<br />
Lead Technical Architect | Distributed Computing .NET TEC<br />
Technologies, Strategy and Operations | American Express Company<br />
Ph: 856.848.7908 | Email: <a href="mailto:Ronald.A.Garlit@aexp.com">Ronald.A.Garlit@aexp.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos Eduardo Olivieri</title>
		<link>http://marknelson.us/about/comment-page-1/#comment-253893</link>
		<dc:creator>Carlos Eduardo Olivieri</dc:creator>
		<pubDate>Thu, 18 Dec 2008 18:49:52 +0000</pubDate>
		<guid isPermaLink="false">#comment-253893</guid>
		<description>Anyway, thank you very much Mark.

In fact, brute force I also already think :), but I&#039;m trying to find another way, bacause the processing time has been a big problem to me. Hours, days running just one program over very small input dataset.

Regards.</description>
		<content:encoded><![CDATA[<p>Anyway, thank you very much Mark.</p>
<p>In fact, brute force I also already think :), but I'm trying to find another way, bacause the processing time has been a big problem to me. Hours, days running just one program over very small input dataset.</p>
<p>Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Nelson</title>
		<link>http://marknelson.us/about/comment-page-1/#comment-253861</link>
		<dc:creator>Mark Nelson</dc:creator>
		<pubDate>Thu, 18 Dec 2008 14:46:57 +0000</pubDate>
		<guid isPermaLink="false">#comment-253861</guid>
		<description>@Carlos:

I don&#039;t have an algorithm for your &quot;at most 2 repeats&quot; requirement, I don&#039;t think I&#039;ve ever run across it. Brute force is my only suggestion :-)</description>
		<content:encoded><![CDATA[<p>@Carlos:</p>
<p>I don't have an algorithm for your "at most 2 repeats" requirement, I don't think I've ever run across it. Brute force is my only suggestion :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos Eduardo Olivieri</title>
		<link>http://marknelson.us/about/comment-page-1/#comment-253812</link>
		<dc:creator>Carlos Eduardo Olivieri</dc:creator>
		<pubDate>Thu, 18 Dec 2008 10:57:54 +0000</pubDate>
		<guid isPermaLink="false">#comment-253812</guid>
		<description>Hi, Mark.

Nice to meet you.

I&#039;m Carlos Eduardo Olivieri. A brazilian student programmer since 12 years old (currently, I have 24). I started with BASIC (QBASIC), have passed through PASCAL (Turbo Pascal), C/C++, Assembly and some other things :). I have always been interested in algorithms, sort, cripto, binaries trees, data compression, memory operations, improve instruction set use, etc.

I read your publication about permutations in C++ with function of STL next_perm(), very interesting and useful, after that I wrote one class method to get the next permutation in Delphi that is the tool most used for me in present days. This function works on lexographic order, I got the algo idea in another site, but now I have with big problem. I&#039;m working with permutations with repetead elements in vector and there are lot of permutations that I don&#039;t need. For example, I have this first permutation for 7 elements in lexographic order:

6667778 (6 = 3 times consecutively, 7 = 3 times consecutively)

For my work I consider valid perm only those with at most 2 elements repeated consecutively, like that:

6676778 (6 = 2 times consecutively at most, 7 = 2 times consecutively at most)

Short, I need a function that return to me only permutations that have at most N consecutive repetitions, according parameter received.

Do you know if there is some kind of algorithm to do that already done?

I intend to write to you more times.

Wait for your contact and sorry for any mistakes in text, I still don&#039;t speak English very well.

Thank you so much,
Carlos</description>
		<content:encoded><![CDATA[<p>Hi, Mark.</p>
<p>Nice to meet you.</p>
<p>I'm Carlos Eduardo Olivieri. A brazilian student programmer since 12 years old (currently, I have 24). I started with BASIC (QBASIC), have passed through PASCAL (Turbo Pascal), C/C++, Assembly and some other things :). I have always been interested in algorithms, sort, cripto, binaries trees, data compression, memory operations, improve instruction set use, etc.</p>
<p>I read your publication about permutations in C++ with function of STL next_perm(), very interesting and useful, after that I wrote one class method to get the next permutation in Delphi that is the tool most used for me in present days. This function works on lexographic order, I got the algo idea in another site, but now I have with big problem. I'm working with permutations with repetead elements in vector and there are lot of permutations that I don't need. For example, I have this first permutation for 7 elements in lexographic order:</p>
<p>6667778 (6 = 3 times consecutively, 7 = 3 times consecutively)</p>
<p>For my work I consider valid perm only those with at most 2 elements repeated consecutively, like that:</p>
<p>6676778 (6 = 2 times consecutively at most, 7 = 2 times consecutively at most)</p>
<p>Short, I need a function that return to me only permutations that have at most N consecutive repetitions, according parameter received.</p>
<p>Do you know if there is some kind of algorithm to do that already done?</p>
<p>I intend to write to you more times.</p>
<p>Wait for your contact and sorry for any mistakes in text, I still don't speak English very well.</p>
<p>Thank you so much,<br />
Carlos</p>
]]></content:encoded>
	</item>
</channel>
</rss>

