<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>standard-template-library &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/standard-template-library/</link>
	<description>Feed of posts on WordPress.com tagged "standard-template-library"</description>
	<pubDate>Fri, 25 Dec 2009 18:43:22 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[An Introduction to JSP Standard Template Library (JSTL)]]></title>
<link>http://javaswdevelopers.wordpress.com/2009/12/25/an-introduction-to-jsp-standard-template-library-jstl/</link>
<pubDate>Fri, 25 Dec 2009 09:28:17 +0000</pubDate>
<dc:creator>dharmayu</dc:creator>
<guid>http://javaswdevelopers.wordpress.com/2009/12/25/an-introduction-to-jsp-standard-template-library-jstl/</guid>
<description><![CDATA[Introduction The JSP Standard Template Library (JSTL) is a very new component released by Sun for JS]]></description>
<content:encoded><![CDATA[Introduction The JSP Standard Template Library (JSTL) is a very new component released by Sun for JS]]></content:encoded>
</item>
<item>
<title><![CDATA[The Complete Reference C++ : 3rd Edition]]></title>
<link>http://ashishmalikit.wordpress.com/2009/12/04/the-complete-reference-c-3rd-edition/</link>
<pubDate>Fri, 04 Dec 2009 15:41:49 +0000</pubDate>
<dc:creator>ashishmalik10</dc:creator>
<guid>http://ashishmalikit.wordpress.com/2009/12/04/the-complete-reference-c-3rd-edition/</guid>
<description><![CDATA[The International Standard for C++ added many new libraries, keywords, and features to C++. Learn ab]]></description>
<content:encoded><![CDATA[The International Standard for C++ added many new libraries, keywords, and features to C++. Learn ab]]></content:encoded>
</item>
<item>
<title><![CDATA[[.doc] Standard Template Library]]></title>
<link>http://vigneaux.wordpress.com/2009/04/07/standard-template-library/</link>
<pubDate>Wed, 08 Apr 2009 03:47:43 +0000</pubDate>
<dc:creator>vigneaux</dc:creator>
<guid>http://vigneaux.wordpress.com/2009/04/07/standard-template-library/</guid>
<description><![CDATA[A continuacion una breve introduccion a la STL de C++ [Documento en Formato Word]]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>A continuacion una breve introduccion a la STL de C++</p>
<p><a title="STL" href="http://vigneaux.wordpress.com/files/2006/12/informe-standard-templates-library.doc" target="_blank">[Documento en Formato Word]</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[A C++ Stopwatch Class, Daylight Saving, and SpicyNodes]]></title>
<link>http://markovthoughtchain.wordpress.com/2009/01/17/a-c-stopwatch-class-daylight-saving-and-spicynodes/</link>
<pubDate>Sat, 17 Jan 2009 15:47:29 +0000</pubDate>
<dc:creator>markov1089</dc:creator>
<guid>http://markovthoughtchain.wordpress.com/2009/01/17/a-c-stopwatch-class-daylight-saving-and-spicynodes/</guid>
<description><![CDATA[CHAIN of actions. A component of my Master&#8217;s thesis will involve translating some MATLAB code ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><em>CHAIN</em> of actions.  A component of my Master&#8217;s thesis will involve translating some MATLAB code to C++.  The MATLAB code includes a check for whether an iterative process is taking too long, in which case it quits.  So, I wanted to download a simple C++ <font face="Courier">stopwatch</font> class implementation.  I Googled &#8220;stopwatch class&#8221; , and thought that <a href="http://www.codeproject.com/KB/vb/vbnetstopwatch.aspx">the Code Project&#8217;s <font face="Courier">stopwatch</font> implementation</a> seemed to fit the bill.  </p>
<p>Interestingly, <a href="http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/classCStopWatch.html">the National Center for Biotechnology Information has their own C++ <font face="Courier">stopwatch</font> class implementation</a>.  I would&#8217;ve used it since it was consistent with my bioinformatics theme, but unfortunately the NCBI <font face="Courier">stopwatch</font> seems to depend on another class called a <font face="Courier">SmartString</font>, which deterred me; I wanted something self-contained. (Not sure where <font face="Courier">SmartString</font> comes from.  Is that NCBI stuff?  Or is it in the Standard Template Library?) My problem was, suppose I went ahead and downloaded the class for a <font face="Courier">SmartString</font>. I might then be faced with yet another dependency, and have to download other stuff: a recursive <em>chain</em> of dependencies with an uncertain terminus.  (Maybe I could use a <font face="Courier">stopwatch</font>, and if it took too long to download all the recursive dependencies I could quit the process. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ) The Code Project&#8217;s <font face="Courier">stopwatch</font> implementation, on the other hand, seemed to be short, light-weight, and self-contained; this reduces the <em>variability</em> of whether I can get the code to work or not. Maybe I&#8217;ll check out the NCBI code later, but right now my main concern is translating MATLAB code to C++ ASAP.</p>
<p>As I&#8217;ve gotten older I&#8217;ve come to appreciate the wisdom of the <a href="http://en.wikipedia.org/wiki/KISS_principle"><em>K.I.S.S. Principle</em></a>.</p>
<p>So I proceeded to download the <a href="http://www.codeproject.com/">Code Project</a>&#8217;s <font face="Courier">stopwatch</font> class, and to do this I had to register.  And one of the questions upon registration was whether I was currently in Daylight Saving Time.  I wasn&#8217;t sure!  I mean, I know that we set the clock back in the fall, and then forward in the spring (&#8220;spring forward, fall back&#8221;), but I didn&#8217;t know which time of the year is considered to be in &#8220;daylight saving.&#8221;</p>
<p>So I Googled &#8220;daylight saving time&#8221; and found <a href="http://www.webexhibits.org/daylightsaving/nodes.html">this cool web page</a> (hope it works in your browser).  I browsed down through the &#8220;clouds&#8221; (nodes) <em>Choose your region&#8230;</em> &#8211;&#62; <em>North America</em> &#8211;&#62; <em>United States</em> and determined that I am currently in Standard Time, not Daylight Saving Time.<a href="http://www.webexhibits.org/daylightsaving/nodes.html">  Give it a try!</a></p>
<p>The underlying technology is called <a href="http://www.spicynodes.org/">SpicyNodes</a>.  It is very reminiscent of <a href="http://www.amazon.com/dp/0452273226/">mind-mapping</a> software, e.g. <a href="http://freemind.sourceforge.net/wiki/index.php/Main_Page">FreeMind</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to not invalidate an iterator used to iterate through an STL container while removing (or deleting) its elements.]]></title>
<link>http://lxcid.wordpress.com/2008/07/25/how-to-not-invalidate-an-iterator-used-to-iterate-through-an-stl-container-while-removing-or-deleting-its-elements/</link>
<pubDate>Fri, 25 Jul 2008 07:39:18 +0000</pubDate>
<dc:creator>lxcid</dc:creator>
<guid>http://lxcid.wordpress.com/2008/07/25/how-to-not-invalidate-an-iterator-used-to-iterate-through-an-stl-container-while-removing-or-deleting-its-elements/</guid>
<description><![CDATA[Many of us who use STL containers and their iterators may need to delete elements while iterating. A]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Many of us who use STL containers and their iterators may need to delete elements while iterating. An example case is:</p>
<blockquote><p>Delete the game objects that are dead.</p></blockquote>
<p>To fulfil the above case, you need to iterate through game objects, check their health and delete them if they are dead. The pseudocode would be:</p>
<pre>FOREACH game object in game object list
	IF game object's health is less than or equal to zero
		REMOVE game object from game object list
		DELETE game object</pre>
<p>Many of us will write the above pseudocode this way:</p>
<pre>std::vector&#60; GameObject * &#62; gameObjectList; ///&#60; Game object list

// Throw in some zombies.
gameObjectList.push_back( new GameObject("Zombie01") );
GameObject * zombie02 = new GameObject("Zombie02");
zombie02-&#62;kill(); // Kill the zombie02.
gameObjectList.push_back( zombie02 );
gameObjectList.push_back( new GameObject("Zombie03") );
gameObjectList.push_back( new GameObject("Zombie04") );

// Initialize the the iterator.
std::vector&#60; GameObject * &#62;::iterator iEnd = gameObjectList.end();
std::vector&#60; GameObject * &#62;::iterator i = gameObjectList.begin();

while ( i != iEnd )
{
	GameObject * gameObject = * i;
	if ( gameObject.isDead() )
	{
		gameObjectList.erase( i );
		delete gameObject;
	}
	i++;
}</pre>
<p>The above code seems perfectly fine but when executed you will notice that after deleting <strong>zombie02</strong>, the iterator will be invalidated and crash at <strong>i++</strong>. This is because <strong>i</strong> is a reference to the element previously storing <strong>zombie02</strong> which is now removed. The solution is to make <strong>i</strong> set to the next iterator after <strong>zombie02</strong> (which in this case is <strong>zombie03</strong>). STL containers <strong>erase</strong> function will return the next iterator after the one specified in its parameter. So the correct code would look like this now.</p>
<pre>while ( i != iEnd )
{
	GameObject * gameObject = * i;
	if ( gameObject.isDead() )
	{
		i = gameObjectList.erase( i );
		delete gameObject;
	}
	else
	{
		i++;
	}
}</pre>
<p>P.S. I may update this post with more solutions when I have the solution and time.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[STL + DLL = QPA!]]></title>
<link>http://moriturius.wordpress.com/2007/12/05/stl-dll-qpa/</link>
<pubDate>Wed, 05 Dec 2007 17:01:49 +0000</pubDate>
<dc:creator>moriturius</dc:creator>
<guid>http://moriturius.wordpress.com/2007/12/05/stl-dll-qpa/</guid>
<description><![CDATA[Do tej pory AGE było tylko biblioteką statyczną. Zechciałem więc żeby dało się skompilować jako DLL.]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Do tej pory AGE było tylko biblioteką statyczną. Zechciałem więc żeby dało się skompilować jako DLL. Dowiedziałem się co trzeba zrobić, wrzuciłem odpowiednie kawałki kodu tam gdzie trzeba. Kompilacja. Linkowanie. Wszystko poszło OK. Mam <em>age.dll</em> oraz <em>age.lib</em> więc zabieram się za test.</p>
<p>Tworzę sobie nowy projekcik piszę to co trzeba i uruchamiam. Działa! Pokazało mi się puste czarne okienko &#8211; i o to chodziło ^^ Problem pojawił się kiedy stworzyłem klasę dziedziczącą po <em>ageTask</em>. Nagle wyskoczył błąd i program się wywalił.</p>
<p>Skompilowałem sobie więc <em>age_d.dll</em> (debug) i spróbowałem raz jeszcze. Krótka randka z debuggerem i okazało się, że <em>std::string</em> ma jakieś problemy z alokowaniem pamięci. Poszperałem w necie, zapytałem na forum i moje przypuszczenia się potwierdziły: DLL i STL to nie jest dobre połączenie.</p>
<p>Udało mi się jednak znaleźć <a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;168958" target="_blank">stronę</a> na której jest sposób na obejście tego problemu. Okazuje się jednak, że możliwe jest to dla <em>std::string </em>oraz <em>std::vector</em> a co z potrzebnym mi <em>std::map? </em>Nic z tego!</p>
<p>Dlatego też postanowiłem napisać własną mini-bibliotekę zawierającą klasy<em>  list, string</em> oraz <em>map</em>. Klasę <em>string</em> właściwie już skończyłem. Interfejs ma prawie identyczny z <em>std::string. </em>Mówię prawie, bo dodałem do niej metodę <em>print( char *format, &#8230; )</em> dzięki której będzie można formatować wygodnie tekst oraz powycinałem te mniej potrzebne metody ^^.</p>
<p>Jeśli chodzi o <em>list</em> to interfejs będzie zupełnie inny niż ten z <em>std::list </em>lub <em>std::vector</em>. Powodem jest nie mniej nie więcej tylko to, że są po prostu brzydkie ^^.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
