<?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>SciTools Blog &#187; Tips</title>
	<atom:link href="http://scitools.com/blog/category/tips/feed" rel="self" type="application/rss+xml" />
	<link>http://scitools.com/blog</link>
	<description>Maintain your Software</description>
	<lastBuildDate>Mon, 30 Jan 2012 19:15:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>C++ Template and Overload Support (Beta)</title>
		<link>http://scitools.com/blog/2011/10/c-template-and-overload-support-beta.html</link>
		<comments>http://scitools.com/blog/2011/10/c-template-and-overload-support-beta.html#comments</comments>
		<pubDate>Wed, 12 Oct 2011 16:14:08 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[overload]]></category>
		<category><![CDATA[Parse]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2011/10/c-template-and-overload-support-beta.html</guid>
		<description><![CDATA[
Many users have asked us in the past if Understand could have better support for Templates and Overloaded functions. We are excited to announce that this is now a reality. Our engineers have worked hard to add a completely new C++ parser to Understand, which is available for Beta testing in build 586.
Our current C++ [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.scitools.com/blog/wp-content/uploads/2011/10/screenshot.15.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="screenshot.15" border="0" alt="screenshot.15" align="right" src="http://www.scitools.com/blog/wp-content/uploads/2011/10/screenshot.15_thumb.jpg" width="295" height="291" /></a></p>
<p>Many users have asked us in the past if Understand could have better support for Templates and Overloaded functions. We are excited to announce that this is now a reality. Our engineers have worked hard to add a completely new C++ parser to Understand, which is available for Beta testing in build 586.</p>
<p>Our current C++ parser was written with the goal of being able to use fuzzy logic to handle incomplete, non-compiling code gracefully and as accurately as possible. It does a great job at that and will continue to be an important part of our toolset. Unfortunately that same feature caused severe difficulties in parsing templates and recognizing overloaded functions.&#160; The new parser is more strict than the old parser and requires a more accurate project definition. If you plan on using it, please follow the instructions from this post to ensure your project is as correct as possible:&#160; <a href="http://scitools.com/blog/2011/09/improving-project-accuracy-cc.html">Improving Project Accuracy (C/C++)</a></p>
<p>To access the new parser, just check the new checkbox on the Languages screen when creating a new project or in the Project Configuration dialog.</p>
<p>We welcome and appreciate your feedback and comments on this new parser &#8211; please send it to us at <a href="mailto:support@scitools.com">support@scitools.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2011/10/c-template-and-overload-support-beta.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Key Binding Options</title>
		<link>http://scitools.com/blog/2011/10/new-key-binding-options.html</link>
		<comments>http://scitools.com/blog/2011/10/new-key-binding-options.html#comments</comments>
		<pubDate>Wed, 12 Oct 2011 15:30:28 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[keybinding]]></category>
		<category><![CDATA[options]]></category>
		<category><![CDATA[settings]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2011/10/new-key-binding-options.html</guid>
		<description><![CDATA[We&#8217;ve made a few changes to how keyboard shortcuts are managed with build 586. 
Key Bindings can still be accessed via Tools-&#62;Options-&#62;Key Bindings&#160; but this page now lets you search for key binding, either by name or by the actual keystrokes. This page also has all of the key bindings in one place for easy [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve made a few changes to how keyboard shortcuts are managed with build 586. </p>
<p>Key Bindings can still be accessed via Tools-&gt;Options-&gt;Key Bindings&#160; but this page now lets you search for key binding, either by name or by the actual keystrokes. This page also has all of the key bindings in one place for easy browsing. The other change was to add a separate page for each Component(Category) of key bindings in the navigation pane.</p>
<p>While these are relatively small changes, we hope they will make life easier for those who rely heavily on keyboard navigation.</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2011/10/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="keybindings" border="0" alt="keybindings" src="http://www.scitools.com/blog/wp-content/uploads/2011/10/image_thumb.png" width="604" height="432" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2011/10/new-key-binding-options.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improving Project Accuracy (C/C++)</title>
		<link>http://scitools.com/blog/2011/09/improving-project-accuracy-cc.html</link>
		<comments>http://scitools.com/blog/2011/09/improving-project-accuracy-cc.html#comments</comments>
		<pubDate>Fri, 16 Sep 2011 16:24:16 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.6]]></category>
		<category><![CDATA[accuracy]]></category>
		<category><![CDATA[Parse]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2011/09/improving-project-accuracy-cc.html</guid>
		<description><![CDATA[Usually just identifying the root of your source tree and saying &#34;Analyze&#34; will provide you with a accurate, useful Understand project. Sometimes, however, you need a more accurate representation of your project. Maybe you have large swaths of inactive code that should be enabled, maybe there are grayed out (unresolved) entities that do exist in [...]]]></description>
			<content:encoded><![CDATA[<p>Usually just identifying the root of your source tree and saying &quot;Analyze&quot; will provide you with a accurate, useful Understand project. Sometimes, however, you need a more accurate representation of your project. Maybe you have large swaths of inactive code that should be enabled, maybe there are grayed out (unresolved) entities that do exist in the source code, or maybe the metrics don&#8217;t seem to line up. In cases like this, you will want to use some of the advanced C++ options to fine tune the parse. Here are some things that will improve the parse accuracy.</p>
<p>  <span id="more-863"></span><br />
<h1>Set the Compiler<img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://www.scitools.com/blog/wp-content/uploads/2011/09/image.png" width="316" height="103" /></h1>
<p>Under Project-&gt;Configure Project -&gt; C++ Options there is a section that allows you to set your compiler and the location of your Compilers include files. Setting these two options to the correct settings will provide the default pragmas and macros as well as include files that your project needs. In many cases just performing this one step will be all you need to do to get the accuracy you are after.</p>
<h1>Set Include Paths</h1>
<p>Your project probably depends on header files from other places, both system header files, like time.h, and those to your own team&#8217;s libraries.&#160; The easiest way to identify these header files is to expand the parse log while Understand is parsing, and hit the &quot;Include Paths&quot; button. This will open the <a href="http://scitools.com/blog/2011/04/parse-improvement-tool.html">Parse Improvement Tool</a> that lets you search for and quickly find missing include paths. These include paths can also be specified in Project-&gt;Configure Project -&gt; C++ -&gt; Includes.</p>
<p>Found include files are not added to the project unless you specify the option to do so. Instead Understand will parse those files and record the Macro definitions, types, include paths, and other data that pertains to your projects source files. So when you view information on a class that is used in your project, but defined elsewhere, Understand can now answer questions about it.<img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.scitools.com/blog/wp-content/uploads/2011/09/image1.png" width="465" height="212" /></p>
<h1>Set Macros</h1>
<p>While in the parse log, you can also add definitions for undefined macros which will completely change how the code is analyzed. You can define macros at the project level, folder level, or just for a particular file. The <a href="http://scitools.com/blog/2011/08/macro-definitions-improved.html">new tool for specifying macros</a> makes it very easy to identify how often and where a macro is used. That will let you know which ones are most critical to define for an accurate parse. The macros can also be defined in the Project-&gt;Configure Project -&gt; C++ -&gt; Macros page.</p>
<p><a href="http://scitools.com/blog/2011/08/macro-definitions-improved.html"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image2[1]" border="0" alt="image2[1]" src="http://www.scitools.com/blog/wp-content/uploads/2011/09/image21.png" width="300" height="294" /></a></p>
<h1>Set File Types</h1>
<p>If you have non standard file extensions, you will want to set them under Project-&gt;Configure Project-&gt;File Types screen. That will ensure that they get parsed correctly. Also, if your project is pure C, you may want to change the appropriate extensions to parse with C instead of C++. This can lead to a more accurate parse for C files.</p>
<h1>Disable the Include Cache</h1>
<p>Project-&gt;Configure Project-&gt;C++ Options has an option to &quot;Use the Include Cache&quot;. This significantly speeds up parsing by caching the values of a file the first time it is looked at. In reality though, every time a file is parse by the compiler its contents can change dynamically based off the context it was included in. Disabling the include cache by unchecking the box will make the parse time slower, but will lead to a more accurate parse.</p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2011/09/improving-project-accuracy-cc.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Class Dependencies Report</title>
		<link>http://scitools.com/blog/2011/09/class-dependencies-report.html</link>
		<comments>http://scitools.com/blog/2011/09/class-dependencies-report.html#comments</comments>
		<pubDate>Wed, 14 Sep 2011 18:01:00 +0000</pubDate>
		<dc:creator>heidi</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2011/09/class-dependencies-report.html</guid>
		<description><![CDATA[After printing the Class Dependencies Report (Reports-&#62;Dependency-&#62;Class Dependencies), we see some headers, with relating numbers that might be confusing as to what exactly they mean. The Dependency Browser can be very useful in seeing the actual dependencies and what they relate to, so I am going to use the Java sample project (getopt) that comes [...]]]></description>
			<content:encoded><![CDATA[<p>After printing the Class Dependencies Report (Reports-&gt;Dependency-&gt;Class Dependencies), we see some headers, with relating numbers that might be confusing as to what exactly they mean. The Dependency Browser can be very useful in seeing the actual dependencies and what they relate to, so I am going to use the Java sample project (getopt) that comes with Understand, the csv file, and the Dependency Browser, to explain the dependencies shown.&#160; <br />The Dependency Browser shows the Class: GetoptDemo on the left side, and it depends on Getopt and LongOpt (shown on the right of the Dependency Browser, and also in the &#8216;To Class&#8217; column of the csv file).&#160; In Getopt there are 13 References, and LongOpt there are 12 References.&#160; Both of which are shown in the References column and on the right side of the Dependency Browser. </p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2011/09/dependenciesReferences.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="dependenciesReferences" border="0" alt="dependenciesReferences" src="http://www.scitools.com/blog/wp-content/uploads/2011/09/dependenciesReferences_thumb.jpg" width="700" height="299" /></a></p>
<p>    <span id="more-859"></span>
<p>The &#8216;To Entities&#8217; column shows the specific entities that depend on GetoptDemo.&#160; So, expanding the tree on the right side of the Dependency Browser shows the 8 entities that GetoptDemo depends on in Getopt, and the 6 entities that GetoptDemo depends on in LongOpt.</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2011/09/dependenciesFromEntities.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="dependenciesFromEntities" border="0" alt="dependenciesFromEntities" src="http://www.scitools.com/blog/wp-content/uploads/2011/09/dependenciesFromEntities_thumb.jpg" width="704" height="418" /></a></p>
<p>The From Entities is the number of entities in GetoptDemo that have dependencies.&#160; By going to the method GetoptDemo on the left side of the Dependency Browser, and expanding the dependencies on that method in the right side of the Browser, we see that there is 1 dependency in Getopt, and 1 dependency in LongOpt. </p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2011/09/dependencesEntities1.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="dependencesEntities1" border="0" alt="dependencesEntities1" src="http://www.scitools.com/blog/wp-content/uploads/2011/09/dependencesEntities1_thumb.jpg" width="700" height="248" /></a>     <br />Now, continue to look at the &#8216;From Entities&#8217; on the left side of the Dependency Browser by looking at Variable: g, expand the tree on the right and see that it depends on Getopt.&#160; Which brings the number of From Entities for Getopt from 1 to 2.</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2011/09/dependencesEntities2.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="dependencesEntities2" border="0" alt="dependencesEntities2" src="http://www.scitools.com/blog/wp-content/uploads/2011/09/dependencesEntities2_thumb.jpg" width="708" height="242" /></a>     <br />Finally, look at the last entity for GetoptDemo on the left, &#8216;Variable: longopts&#8217;, expand the tree on the right and see that it Depends on LongOpt, which brings the number of From Entities from 1 to 2 for LongOpt.</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2011/09/dependencesEntities3.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="dependencesEntities3" border="0" alt="dependencesEntities3" src="http://www.scitools.com/blog/wp-content/uploads/2011/09/dependencesEntities3_thumb.jpg" width="715" height="244" /></a>     <br />Hopefully this sample clarifies the Class Dependencies csv report.</p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2011/09/class-dependencies-report.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrate Understand with your build system</title>
		<link>http://scitools.com/blog/2011/07/integrate-understand-with-your-build-system.html</link>
		<comments>http://scitools.com/blog/2011/07/integrate-understand-with-your-build-system.html#comments</comments>
		<pubDate>Wed, 20 Jul 2011 19:34:53 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.6]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[metrics]]></category>
		<category><![CDATA[reports]]></category>
		<category><![CDATA[und]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2011/07/integrate-understand-with-your-build-system.html</guid>
		<description><![CDATA[Many teams want to quickly generate Understand’s HTML reports and metrics as part of their regular build process. The new version of the command line tool ‘und’ provides a lot of options for doing exactly this. In this case, I am going to create an Understand project from the latest version of my source code, [...]]]></description>
			<content:encoded><![CDATA[<p>Many teams want to quickly generate <em>Understand’s</em> HTML reports and metrics as part of their regular build process. The <a href="http://scitools.com/blog/2011/06/re-written-command-line-tool-und.html">new version</a> of the command line tool ‘und’ provides a lot of options for doing exactly this. In this case, I am going to create an Understand project from the latest version of my source code, and generate the html reports and metrics for that version of the code. Since the new version of und has several different modes, I will show how this would be done in each mode.<img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="screenshot.14" border="0" alt="screenshot.14" src="http://www.scitools.com/blog/wp-content/uploads/2011/07/screenshot.14.jpg" width="562" height="89" /></p>
<p> <span id="more-823"></span>
</p>
<h1>Interactive Mode</h1>
<p>Interactive mode is not want you want to use for automating a process, but is useful for testing commands and quick tasks. Running through these commands in interactive mode is a good test to make sure everything is configured the way you want.</p>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tbody>
<tr>
<td valign="top"><strong><u>Command</u></strong></td>
<td valign="top"><strong><u>What it does</u></strong></td>
</tr>
<tr>
<td valign="top"><em>und</em></td>
<td valign="top">Opens und in interactive mode</td>
</tr>
<tr>
<td valign="top"><em><nobr>create –languages C++ c:\project.udb</nobr></em></td>
<td valign="top">Create and open a new C++ project</td>
</tr>
<tr>
<td valign="top"><em><nobr>add c:\path\to\src</nobr></em></td>
<td valign="top">Add the specified directory of source to the project</td>
</tr>
<tr>
<td valign="top"><em>analyze</em></td>
<td valign="top">Analyze the project</td>
</tr>
<tr>
<td valign="top"><em><nobr>settings –reportOutputDirectory c:\htmlDir</nobr></em></td>
<td valign="top">Set the path for the HTML reports</td>
</tr>
<tr>
<td valign="top"><em>report</em></td>
<td valign="top">Generate the HTML reports</td>
</tr>
<tr>
<td valign="top"><em><nobr>settings –metrics all</nobr></em></td>
<td valign="top">Specify to generate all metrics </td>
</tr>
<tr>
<td valign="top"><em><nobr>settings –metricsOutputFile c:\metrics.csv</nobr></em></td>
<td valign="top">Set the path for the metrics csv file</td>
</tr>
<tr>
<td valign="top"><em>metrics</em></td>
<td valign="top">generate the metrics csv file</td>
</tr>
<tr>
<td valign="top"><em>quit</em></td>
<td valign="top">exit interactive mode</td>
</tr>
</tbody>
</table>
<p>If you need to customize these commands more, <em>und help</em> and <em>und help &lt;command&gt;</em> provide thorough documentation. Or feel free to contact us at <a href="mailto:support@scitools.com">support@scitools.com</a></p>
<h1>Batch Mode</h1>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="screenshot.17" border="0" alt="screenshot.17" align="right" src="http://www.scitools.com/blog/wp-content/uploads/2011/07/screenshot.17.jpg" width="230" height="98" /> Once you have identified the commands you want to run using interactive mode,&#160; place those exact commands in a text file. No need to include the first <em>und</em> command and the <em>quit</em> command, those are handled automatically.</p>
<p>Then all you have to do is run:</p>
<p><strong>und myCommands.txt</strong></p>
<p>and all the commands in the file will be processed in order. In previous versions of und the project database was opened and closed between each command, when many commands were run on large projects, this could cause significant slowdown. In the new version of und the database stays opened in Interactive and Batch Mode leading to much quicker results.</p>
<h1>Line Mode</h1>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2011/07/screenshot.11.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="screenshot.11" border="0" alt="screenshot.11" align="right" src="http://www.scitools.com/blog/wp-content/uploads/2011/07/screenshot.11_thumb.jpg" width="325" height="51" /></a> Single line mode lets you run each command directly in the shell. The Understand database is opened and closed for each command and needs to be specified on each line. It can be specified with the –db parameter, or included as the last parameter. So doing the same thing in Single Line Mode would look like:</p>
<p>&gt;und create -languages C++ c:\project.udb    <br />&gt;und add c:\path\to\src c:\project.udb     <br />&gt;und analyze c:\project.udb     <br />&gt;und settings -reportOutputDirectory c:\htmlDir c:\project.udb     <br />&gt;und report c:\project.udb     <br />&gt;und settings -metrics all c:\project.udb     <br />&gt;und settings -metricsOutputFile c:\metrics.csv c:\project.udb     <br />&gt;und metrics c:\project.udb</p>
<p>Again, this method is a little slower since it opens the database each command, but depending on your build process, it may be easier to implement.</p>
<h1>Single Line Mode</h1>
<p>The same commands can all be run on the same line if desired, which will only open the database once and will be faster, although harder to read. The commands will run in the order entered.</p>
<p>&gt;und -db c:\project.udb create -languages C++ add c:\path\to\src analyze settings -reportOutputDirectory c:\htmlDir report settings -metrics all settings -metricsOutputFile c:\metrics.csv metrics</p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2011/07/integrate-understand-with-your-build-system.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Open Code Files with Understand</title>
		<link>http://scitools.com/blog/2010/08/open-code-files-with-understand.html</link>
		<comments>http://scitools.com/blog/2010/08/open-code-files-with-understand.html#comments</comments>
		<pubDate>Tue, 10 Aug 2010 17:27:50 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.5]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[file association]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2010/08/open-code-files-with-understand.html</guid>
		<description><![CDATA[As of build 523, the .udb extension on Windows is associated with Understand and when a .udb file is double clicked it will open the Understand Project. Some users have asked for similar functionality with code files. In the past if you setup Understand to open a code file, by default it would open a [...]]]></description>
			<content:encoded><![CDATA[<p>As of build 523, the .udb extension on Windows is associated with Understand and when a .udb file is double clicked it will open the Understand Project. Some users have asked for similar functionality with code files. In the past if you setup Understand to open a code file, by default it would open a new instance of Understand. As of build 525 it will open up in the existing instance of Understand instead of a new one. Keep reading for instructions on registering Understand to open code files.</p>
<p> <span id="more-714"></span>
<p>These instructions may vary slightly depending on your version of Windows, but in general the concept is the same.&#160; I will register .cpp files for this example. When I’m done, whenever I double click on a C++ file, it will open in Understand by default.</p>
<p>First find a .cpp file in explorer, right click on it and select <strong>Open with –&gt; Choose default Program</strong></p>
<p>&#160;<a href="http://www.scitools.com/blog/wp-content/uploads/2010/08/screenshot.20.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="screenshot.20" border="0" alt="screenshot.20" src="http://www.scitools.com/blog/wp-content/uploads/2010/08/screenshot.20_thumb.jpg" width="388" height="135" /></a></p>
<p>Click the Browse Button and navigate to the Understand executable, select it and click “Open”, by default it is at C:\Program Files\SciTools\bin\pc-win32\understand.exe</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2010/08/screenshot.21.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="screenshot.21" border="0" alt="screenshot.21" src="http://www.scitools.com/blog/wp-content/uploads/2010/08/screenshot.21_thumb.jpg" width="395" height="248" /></a> </p>
<p>Understand will now show up in the list of programs available to open this file. Select Understand and make sure the checkbox is checked that says: “Always use the selected program to open this kind of file”. Then click ok</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2010/08/screenshot.22.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="screenshot.22" border="0" alt="screenshot.22" src="http://www.scitools.com/blog/wp-content/uploads/2010/08/screenshot.22_thumb.jpg" width="385" height="317" /></a> </p>
</p>
</p>
<p>That’s it. Now Understand will handle those files everytime.</p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2010/08/open-code-files-with-understand.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Share Your Project</title>
		<link>http://scitools.com/blog/2010/06/share-your-project.html</link>
		<comments>http://scitools.com/blog/2010/06/share-your-project.html#comments</comments>
		<pubDate>Fri, 11 Jun 2010 21:36:00 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Quick-Tip]]></category>
		<category><![CDATA[Understand 2.5]]></category>
		<category><![CDATA[portablity]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2010/06/share-your-project.html</guid>
		<description><![CDATA[Use the Project Portability button (Project-&#62;Configure Project-&#62;Files) to make your project sharable/portable.
More details
]]></description>
			<content:encoded><![CDATA[<p>Use the Project Portability button (Project-&gt;Configure Project-&gt;Files) to make your project sharable/portable.</p>
<p><a href="http://scitools.com/blog/2008/04/understand-20-making-your-projects-portable.html">More details</a></p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2010/06/share-your-project.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UML Class Diagram</title>
		<link>http://scitools.com/blog/2010/06/uml-class-diagram.html</link>
		<comments>http://scitools.com/blog/2010/06/uml-class-diagram.html#comments</comments>
		<pubDate>Tue, 08 Jun 2010 21:26:00 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Quick-Tip]]></category>
		<category><![CDATA[Understand 2.5]]></category>
		<category><![CDATA[diagram]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[uml]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2010/06/uml-class-diagram.html</guid>
		<description><![CDATA[We’ve developed a UML Class Diagram for Understand. You can grab it from the plugins page. Update: This diagram is now shipped with Understand and is available in the Graphs menu.

]]></description>
			<content:encoded><![CDATA[<p>We’ve developed a UML Class Diagram for Understand. <strike>You can grab it from the </strike><a href="http://www.scitools.com/plugins/plugins.php"><strike>plugins page</strike></a><strike>.</strike> Update: This diagram is now shipped with Understand and is available in the Graphs menu.</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2010/06/image.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="image" border="0" alt="image" src="http://www.scitools.com/blog/wp-content/uploads/2010/06/image_thumb.png" width="268" height="407" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2010/06/uml-class-diagram.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Edit Companion File with Ctrl + Apostrophe</title>
		<link>http://scitools.com/blog/2010/06/edit-companion-file-with-ctrl-apostrophe.html</link>
		<comments>http://scitools.com/blog/2010/06/edit-companion-file-with-ctrl-apostrophe.html#comments</comments>
		<pubDate>Thu, 03 Jun 2010 21:01:28 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Quick-Tip]]></category>
		<category><![CDATA[Understand 2.5]]></category>
		<category><![CDATA[keybinding]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2010/06/edit-companion-file-with-ctrl-apostrophe.html</guid>
		<description><![CDATA[As of build 516 If you are editing a code file you can quickly switch to the corresponding header file and back again with Ctrl+&#8217; (apostrophe).
]]></description>
			<content:encoded><![CDATA[<p>As of build 516 If you are editing a code file you can quickly switch to the corresponding header file and back again with Ctrl+&#8217; (apostrophe).</p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2010/06/edit-companion-file-with-ctrl-apostrophe.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Refactoring</title>
		<link>http://scitools.com/blog/2010/04/code-refactoring.html</link>
		<comments>http://scitools.com/blog/2010/04/code-refactoring.html#comments</comments>
		<pubDate>Tue, 06 Apr 2010 04:10:28 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.5]]></category>
		<category><![CDATA[addons]]></category>
		<category><![CDATA[astyle]]></category>
		<category><![CDATA[complexity]]></category>
		<category><![CDATA[cyclomatic]]></category>
		<category><![CDATA[mccabe]]></category>
		<category><![CDATA[metics]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/?p=642</guid>
		<description><![CDATA[Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior. Its heart is a series of small behavior preserving transformations. Each transformation (called a &#8216;refactoring&#8217;) does little, but a sequence of transformations can produce a significant restructuring. Since each refactoring is small, it&#8217;s less [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Refactoring is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior. Its heart is a series of small behavior preserving transformations. Each transformation (called a &#8216;refactoring&#8217;) does little, but a sequence of transformations can produce a significant restructuring. Since each refactoring is small, it&#8217;s less likely to go wrong. The system is also kept fully working after each small refactoring, reducing the chances that a system can get seriously broken during the restructuring.  &#8212; Martin Fowler  <a title="http://www.refactoring.com/" href="http://www.refactoring.com/">http://www.refactoring.com/</a></p></blockquote>
<p>In other words, refactoring is making your code cleaner, safer, and easier to use. Understand can be a very powerful tool in your re-factoring arsenal. Here are a few ways you can use Understand in your refactoring process.</p>
<p><span id="more-642"></span></p>
<h3>Quickly Identify References</h3>
<p>In the long <a href="http://www.refactoring.com/catalog/index.html" target="_blank">list of refactorings</a>, many of the suggested refactorings involve replacing one data type with another. In many cases that can involve changing the calls to that data type as well. Understand can instantly show you everywhere that that entity is used, called, referenced, modified or typed. Just right click on the entity, select View Information, and expand the references section.</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2010/04/image.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.scitools.com/blog/wp-content/uploads/2010/04/image_thumb.png" border="0" alt="image" width="284" height="205" /></a></p>
<h3>Identify Complex Functions</h3>
<p>Many overly-complex functions can be refactored into smaller, more maintainable units. Knowing the McCabe <a href="http://en.wikipedia.org/wiki/Cyclomatic_complexity" target="_blank">Cyclomatic complexity</a> can help you quickly identify functions and methods that are overly complicated and may be good candidates for refactoring. You can quickly find the complexity of every function in an Understand project by selecting Metrics –&gt; Export Metrics. If you’re just looking for a quick list of complex functions, this plugin will show you the most complex functions in your project.</p>
<p>Download it from our <a href="http://www.scitools.com/plugins/plugins.php" target="_blank">Plugin page</a> and you’ll see a list of the most complex functions in your project.</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2010/04/image1.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.scitools.com/blog/wp-content/uploads/2010/04/image_thumb1.png" border="0" alt="image" width="343" height="264" /></a></p>
<h3>Reformat your code</h3>
<p>If you have ugly code, you can beautify it quickly with the the tip reported in this entry:</p>
<p><a href="http://scitools.com/blog/2008/11/tip-beautify-your-code.html" target="_blank">Tip &#8211; Beautify your code</a></p>
<p>With one button press, turn a file that looks like this:</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2010/04/image2.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.scitools.com/blog/wp-content/uploads/2010/04/image_thumb2.png" border="0" alt="image" width="644" height="73" /></a></p>
<p>into this:</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2010/04/image3.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.scitools.com/blog/wp-content/uploads/2010/04/image_thumb3.png" border="0" alt="image" width="644" height="226" /></a></p>
<h3>Rename Entities</h3>
<p>Sometimes renaming an entity can go a long way towards making the code readable, perhaps a missed name class or method.</p>
<p>Download <a href="http://scitools.com/blog/wp-content/uploads/2010/04/rename.zip" target="_blank">rename.zip</a> for a user tool to quickly rename entities in Understand – it goes through the references and replaces each instance of the class or object with the new name.</p>
<p>Save the .pl script to your hard drive, and then in Understand under <em>Tools | User Tools| Configure</em> select Import to load the .ini file. Change the path to the location of the .pl file. Then to use it, right click on any entity in Understand and select User Tools | Replace. You&#8217;ll be prompted for the new text, and then all references to that entity will be renamed. You&#8217;ll want to reparse the changed files after each rename so that the database stays up to date (Ctrl+R by default).</p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2010/04/image4.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.scitools.com/blog/wp-content/uploads/2010/04/image_thumb4.png" border="0" alt="image" width="499" height="114" /></a></p>
<h3>Follow Dependencies</h3>
<table border="0" cellspacing="0" cellpadding="2" width="600">
<tbody>
<tr>
<td width="300" valign="top">Understand’s new Dependency features can help you to quickly get a handle on what parts of the code are dependant on other parts of the code, letting you define what logical lines to divide your code into.<br />
<a href="http://www.scitools.com/features/dependencyBrowser.php">Dependency Browser</a><br />
<a href="http://www.scitools.com/features/dependenciesGraphs.php">Dependency Graphs</a><br />
<a href="http://www.scitools.com/features/exportDependencies.php">Exporting Dependencies</a></td>
<td width="39" valign="top"><a href="http://www.scitools.com/blog/wp-content/uploads/2010/04/image5.png"><img style="display: inline; border-width: 0px;" title="image" src="http://www.scitools.com/blog/wp-content/uploads/2010/04/image_thumb5.png" border="0" alt="image" width="255" height="275" /></a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2010/04/code-refactoring.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Line and Statement Counting Metrics</title>
		<link>http://scitools.com/blog/2010/03/line-and-statement-counting-metrics.html</link>
		<comments>http://scitools.com/blog/2010/03/line-and-statement-counting-metrics.html#comments</comments>
		<pubDate>Mon, 22 Mar 2010 15:11:44 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.5]]></category>
		<category><![CDATA[code count]]></category>
		<category><![CDATA[countlinecode]]></category>
		<category><![CDATA[loc]]></category>
		<category><![CDATA[metrics]]></category>
		<category><![CDATA[sloc]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2010/03/line-and-statement-counting-metrics.html</guid>
		<description><![CDATA[Understand has many different metrics, including a large number that focus on counting the number of statements and lines of code, including Lines of Code (LOC or SLOC), Lines with Comments (CLOC), empty lines (BLOC), Number of Statements, Number of Executable Statements, etc.
The short C/C++ example below shows how each line and statement contribute to [...]]]></description>
			<content:encoded><![CDATA[<p><em>Understand</em> has many different <a href="http://www.scitools.com/documents/metrics.php" target="_blank">metrics</a>, including a large number that focus on counting the number of statements and lines of code, including Lines of Code (LOC or SLOC), Lines with Comments (CLOC), empty lines (BLOC), Number of Statements, Number of Executable Statements, etc.</p>
<p>The short C/C++ example below shows how each line and statement contribute to these metrics in <em>Understand</em>. You can <a href="https://spreadsheets.google.com/ccc?key=0AtU7sTc8vnbbdGtkc3dFRzVNYUtpNjdSU1Q5T0N1MkE&amp;hl=en" target="_blank">view the larger version here</a>.</p>
<p>&#160;</p>
<p><iframe height="500" src="http://spreadsheets.google.com/pub?key=tkdswEG5MaKi67RST9OCu2A&amp;single=true&amp;gid=0&amp;output=html&amp;widget=true" frameborder="0" width="600"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2010/03/line-and-statement-counting-metrics.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>2.5 Upgrade Free if Maintenance Current</title>
		<link>http://scitools.com/blog/2010/03/2-5-upgrade-free-if-maintenance-current.html</link>
		<comments>http://scitools.com/blog/2010/03/2-5-upgrade-free-if-maintenance-current.html#comments</comments>
		<pubDate>Mon, 15 Mar 2010 17:15:51 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.5]]></category>
		<category><![CDATA[licensing]]></category>
		<category><![CDATA[pricing]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/2010/03/2-5-upgrade-free-if-maintenance-current.html</guid>
		<description><![CDATA[
We have made a lot of changes to the licensing in Understand 2.5. How does this affect you?

These changes require a new license key. 
All Understand features are now available to all users 

As always, as long as your maintenance is up-to-date, there is no cost for the new version of Understand, we just need [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://scitools.com/blog/wp-content/uploads/2010/03/image1.png" target="_blank"><img style="border-right-width: 0px; margin: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="right" src="http://scitools.com/blog/wp-content/uploads/2010/03/image_thumb1.png" width="194" height="244" /></a>
<p>We have made a lot of changes to the licensing in <em>Understand 2.5.</em> How does this affect you?</p>
<ol>
<li>These changes require a new license key. </li>
<li>All Understand features are now available to all users </li>
</ol>
<p>As always, as long as your maintenance is up-to-date, there is no cost for the new version of <em>Understand</em>, we just need to generate a new license for you. The dialog that pops up when you start <em>Understand</em> has three options for getting that new license, whichever you choose, we will get the license to you quickly and without any hassle.</p>
<p>What if your maintenance is not current? You can still use any of these options, and we will get you a quote for getting back up-to-date. Also, the 2.5 install does not overwrite your previous version, so you can continue to use Understand 2.0 with your previous license.</p>
<p> <span id="more-632"></span>
<p>We have a philosophy here that licensing should never get in the way of engineers using our tools. Over time this philosophy has resulted in many different experiments as we have tried to simplify licensing and added different ways for people to access <em>Understand</em>. As we prepared to release Understand 2.5 we realized there were now 36 different license types. As you might imagine that resulted in some very messy code, this feature is only available for these 16 license types, etc.</p>
<p>It was getting hard to maintain and we were seeing more and more licensing related issues. We decided to make a clean break, and created a new license that supports all features, thus bypassing the complicated licensing logic and we hope providing the best possible experience to our customers.</p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2010/03/2-5-upgrade-free-if-maintenance-current.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>GDB and Understand</title>
		<link>http://scitools.com/blog/2008/12/gdb-and-understand.html</link>
		<comments>http://scitools.com/blog/2008/12/gdb-and-understand.html#comments</comments>
		<pubDate>Tue, 30 Dec 2008 18:11:10 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.0]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/http:/scitools.com/blog/archives/2008/12/gdb-and-understand.html</guid>
		<description><![CDATA[About 1/2 our engineers program on Linux. A couple use the Mac. And the rest use Windows. 
On Linux and the Mac it is quite common to have command line GDB session in use for debugging and to need to&#160;inspect or walk&#160;a call stack from the &#8220;where&#8221; command.&#160; It is a bit of a pain [...]]]></description>
			<content:encoded><![CDATA[<p>About 1/2 our engineers program on Linux. A couple use the Mac. And the rest use Windows. </p>
<p>On Linux and the Mac it is quite common to have command line GDB session in use for debugging and to need to&nbsp;inspect or walk&nbsp;a call stack from the &ldquo;where&rdquo; command.&nbsp; It is a bit of a pain to have these separated from <em>Understand</em>. And we may (if we can figure out the Windows side) add debugging support directly into <em>Understand</em>, but until here is a tip that makes working with GDB a bit easier.</p>
<p>With B465 you paste any text into a command result window (get one&nbsp;by choosing &ldquo;Options-&gt;Run a command&rdquo;).&nbsp; Once pasted, we analyze it for file, line and entity names and it becomes clickable for <em>Understand</em> events and menus. </p>
<p>Here is a GDB call stack pasted in:</p>
<p><span style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"><?xml:namespace prefix ="" v ns ="" "urn:schemas-microsoft-com:vml" /><v:shapetype id="_x0000_t75" stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600">&nbsp;<a href="http://scitools.com/blog/wp-content/uploads/mt-old/gdb_.png"><img alt="Gdb_" src="http://scitools.com/blog/wp-content/uploads/mt-old/gdb__thumb.jpg" border="0" /></a><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><?xml:namespace prefix ="" o ns ="" "urn:schemas-microsoft-com:office:office" /><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype></span></p>
<p>Files and lines are identified so I can visit them in <em>Understand</em>, or right click and get information and graphs.</p>
<p>Also, with B465 we have made file detection much smarter. It will recognize short, relative and full path names and associate line numbers with them in any fashion a compiler or other tool can think to spit them out.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2008/12/gdb-and-understand.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Yes! Searching in Graphs</title>
		<link>http://scitools.com/blog/2008/12/yes-searching-in-graphs.html</link>
		<comments>http://scitools.com/blog/2008/12/yes-searching-in-graphs.html#comments</comments>
		<pubDate>Tue, 30 Dec 2008 17:58:27 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.0]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/http:/scitools.com/blog/archives/2008/12/yes-searching-in-graphs.html</guid>
		<description><![CDATA[Searching in graphs has been on my Understand wish list since we first added graphs &#8211; 10 years ago!
So I&#8217;m quite happy to report that Understand 2.0 Build 466 has searching in graphs. To search in a graph just hit the binocular button and enter in the search text. It is incremental. As you type, [...]]]></description>
			<content:encoded><![CDATA[<p>Searching in graphs has been on my <em>Understand</em> wish list since we first added graphs &ndash; 10 years ago!</p>
<p>So I&rsquo;m quite happy to report that <em>Understand 2.0 Build 466</em> has searching in graphs. To search in a graph just hit the binocular button and enter in the search text. It is incremental. As you type, it matches. Hit return to move to the next, or use the green arrows. The graph will center to the next match. Searches will find on node labels and edge labels (if the graph has them).</p>
<p>Here I search a large call tree for &ldquo;inflate&rdquo;:</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/31_202008_2D12_2D30_2013.51.jpg"><img alt="31 2008-12-30 13.51" src="http://scitools.com/blog/wp-content/uploads/mt-old/31_202008_2D12_2D30_2013.51_thumb.jpg" border="0" /></a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2008/12/yes-searching-in-graphs.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip &#8211; Beautify your code</title>
		<link>http://scitools.com/blog/2008/11/tip-beautify-your-code.html</link>
		<comments>http://scitools.com/blog/2008/11/tip-beautify-your-code.html#comments</comments>
		<pubDate>Thu, 06 Nov 2008 20:49:32 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.0]]></category>
		<category><![CDATA[astyle]]></category>
		<category><![CDATA[beautify]]></category>
		<category><![CDATA[user tools]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/http:/scitools.com/blog/archives/2008/11/tip-beautify-your-code.html</guid>
		<description><![CDATA[Your code is beautiful, formatted to your liking and spaced just how you want it, but sometimes you have to work with other people’s code – yuck! If only there was something that would make it look like your code, instead of spaghetti. Artistic Style, or astyle as it is also known, is a great [...]]]></description>
			<content:encoded><![CDATA[<p>Your code is beautiful, formatted to your liking and spaced just how you want it, but sometimes you have to work with other people’s code – yuck! If only there was something that would make it look like your code, instead of spaghetti. <a href="http://astyle.sourceforge.net/" target="_blank">Artistic Style</a>, or astyle as it is also known, is a great open source application that does exactly that.</p>
<p>So you can quickly turn this:</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_26.png"><img style="display: inline; border-width: 0px;" title="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_thumb_12.png" border="0" alt="image" width="748" height="84" /></a></p>
<p>Into this:</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_28.png"><img style="display: inline; border-width: 0px;" title="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_thumb_13.png" border="0" alt="image" width="604" height="212" /></a></p>
<p>We plan on implementing astyle into the editor at some point in the future, but I’m not so patient, and I decided to use our plugin mechanism to do it now, and will show you how.</p>
<p><span id="more-376"></span></p>
<p>There are two ways to run astyle from inside Understand, as an Interactive Report plugin, or as a custom user tool. Either way, first you’ll need to install or build astyle you can <a href="http://sourceforge.net/project/showfiles.php?group_id=2319l" target="_blank">download it from here</a>.</p>
<h3>Interactive Report</h3>
<p>The Interactive report integrates directly with the file context menu in Understand. Download the plugin <a href="http://www.scitools.com/plugins/plugins/IReport/astyle.upl" target="_blank">from here</a>(right click and save as). To install it, just move the file to SciTools\conf\plugin\User\IReport\ and restart Understand.<br />
To run the plugin, right click on a File, select Interactive Reports and Beautify</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_2.png"><img style="display: inline; border-width: 0px;" title="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_thumb.png" border="0" alt="image" width="260" height="83" /></a></p>
<p>At which point you’ll be presented with the options window:</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_4.png"><img style="display: inline; border-width: 0px;" title="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_thumb_1.png" border="0" alt="image" width="288" height="211" /></a></p>
<p>The first field is pretty straight forward, just navigate to where the astyle executable is installed.</p>
<p>The rest of the dialog may seem overwhelming, but the tricky part is figuring out what your “style” is. Astyle has 5 predefined styles, and chances are that one of them will be pretty close to what you like.</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_6.png"><img style="display: inline; border-width: 0px;" title="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_thumb_2.png" border="0" alt="image" width="323" height="51" /></a></p>
<p>Astyle’s <a href="http://astyle.sourceforge.net/astyle.html" target="_blank">documentation</a> goes into more detail about each of these styles, but here is a rough overview:</p>
<table border="1" cellspacing="0" cellpadding="0" width="699">
<tbody>
<tr>
<td width="233" align="center" valign="top"><strong>ANSI</strong></td>
<td width="233" align="center" valign="top"><strong>GNU</strong></td>
<td width="233" align="center" valign="top"><strong>KR</strong></td>
</tr>
<tr>
<td width="233" valign="top">ANSI style formatting and indenting. Brackets are broken, indentation is 4 spaces. Namespaces, classes, and switches are NOT indented.</td>
<td width="233" valign="top">GNU style formatting and indenting. Brackets are broken, blocks are indented, and indentation is 2 spaces. Namespaces, classes, and switches are NOT indented.</td>
<td width="233" valign="top">Kernighan &amp; Ritchie style formatting and indenting. Brackets are attached, indentation is 4 spaces. Namespaces, classes, and switches are NOT indented.</td>
</tr>
<tr>
<td width="233" valign="top">
<pre>namespace foospace
{
int Foo()
{
if (isBar)
{
bar();
return 1;
}
else
return 0;
}
}</pre>
</td>
<td width="233" valign="top">
<pre>namespace foospace
{
int Foo()
{
if (isBar)
{
bar();
return 1;
}
else
return 0;
}
}</pre>
</td>
<td width="233" valign="top">
<pre>namespace foospace {
int Foo() {
if (isBar) {
bar();
return 1;
} else
return 0;
}
}</pre>
</td>
</tr>
</tbody>
</table>
<table border="1" cellspacing="0" cellpadding="0" width="466">
<tbody>
<tr>
<td width="233" align="center" valign="top"><strong>Linux</strong></td>
<td width="233" align="center" valign="top"><strong>Java</strong></td>
</tr>
<tr>
<td width="233" valign="top">Linux style formatting and indenting. All brackets are Linux style, indentation is 8 spaces. Namespaces, classes, and switches are NOT indented.</td>
<td width="233" valign="top">Java style formatting and indenting. Brackets are attached, indentation is 4 spaces. Switches are NOT indented.</td>
</tr>
<tr>
<td width="233" valign="top">
<pre>namespace foospace
{
int Foo()
{
if (isBar) {
bar();
return 1;
} else
return 0;
}
}</pre>
</td>
<td width="233" valign="top">
<pre>class foospace {
int Foo() {
if (isBar) {
bar();
return 1;
} else
return 0;
}
}</pre>
</td>
</tr>
</tbody>
</table>
<p>If one of these appeals to you as is, just select it from the “Predefined Style” section. If you want to modify one, select it and the other options in the dialog will allow you to override the default settings for a style. For more details about what the command does, select “Display the help text” in the Action section:</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_8.png"><img style="display: inline; border-width: 0px;" title="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_thumb_3.png" border="0" alt="image" width="162" height="103" /></a></p>
<p>When you are ready to run it, you can either preview the changes in a separate window, or apply them directly to the source code. Of course I would suggest previewing the changes until you figure out exactly what your style is. Note that if your project uses relative paths or named roots, only the preview will work right now since the file naming is different, but you can still copy and paste <img src='http://scitools.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>User Tool</h3>
<p>If you already know what astyle command line options you want to use, you can setup a user tool  to quickly transform a file. Again, this only works for projects with absolute paths.</p>
<p>So here are the command line options I want to use with astyle:</p>
<p>astyle &#8211;style=ansi -t -B -w</p>
<p>To implement these as a user tool, I select Tools | User Tools | Configure</p>
<p>Then I create a new tool. I name it and provide the path to the astyle executable. Then I provide the parameters. The lipstick icon is optional <img src='http://scitools.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.scitools.com/blog/wp-content/uploads/2010/04/screenshot.43.png"><img style="display: inline; border-width: 0px;" title="screenshot.43" src="http://www.scitools.com/blog/wp-content/uploads/2010/04/screenshot.43_thumb.png" border="0" alt="screenshot.43" width="343" height="241" /></a></p>
<p>I also decided to bind this to a keyboard shortcut (Ctrl Shift B). You can set the keyboard shortcuts in Tool | Options | Key Bindings.</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_18.png"><img style="display: inline; border-width: 0px;" title="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipBeautifyyourcode_D95D/image_thumb_8.png" border="0" alt="image" width="535" height="97" /></a></p>
<p>Now if I run into an ugly file, I can just hit Ctrl Shift B, and bam, pretty code!</p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2008/11/tip-beautify-your-code.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Tip &#8211; Understand the CountPath Metric</title>
		<link>http://scitools.com/blog/2008/10/tip-understand-the-countpath-metric.html</link>
		<comments>http://scitools.com/blog/2008/10/tip-understand-the-countpath-metric.html#comments</comments>
		<pubDate>Tue, 21 Oct 2008 17:43:28 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.0]]></category>
		<category><![CDATA[metrics countpath]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/http:/scitools.com/blog/archives/2008/10/tip-understand-the-countpath-metric.html</guid>
		<description><![CDATA[The CountPath metric counts the number of unique paths though a body of code.
]]></description>
			<content:encoded><![CDATA[<p>So imagine you’re reviewing metrics for a small function:</p>
<blockquote><p>&#160; 61 lines of code, pretty small, keeping functionality nice and modular. Good.</p>
<p>&#160; Cyclomatic complexity of 30. Highly complex, but within the acceptable range. Good.</p>
<p>&#160; CountPath metric 536,870,912. What is this? 536 Million paths in 61 lines of code, that can’t be right, can it?!?</p>
</blockquote>
<p><span id="more-373"></span></p>
<p>The CountPath metric counts the number of unique paths though a body of code. It’s pretty common to have a huge count path metric, even in a small body of code. </p>
<p>In this example, I pull up the code and it looks like this:</p>
<blockquote><p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipUnderstandtheCountPathMetric_C0FB/image_6.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="139" alt="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipUnderstandtheCountPathMetric_C0FB/image_thumb_2.png" width="465" border="0" /></a> </p>
</blockquote>
<p>29 IF statements in a row. That’s all, logically quite simple code:</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipUnderstandtheCountPathMetric_C0FB/image_8.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="236" alt="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipUnderstandtheCountPathMetric_C0FB/image_thumb_3.png" width="244" border="0" /></a> </p>
<p>But the fun thing about IF statements, is every one doubles the number of potential paths in your code(2<sup>n</sup>) – and as we all remember from our algebra days, exponential growth happens very fast. </p>
<p>So 2 IF statements makes 4 paths. 2<sup>3</sup> is 8 paths. let me demonstrate:</p>
</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipUnderstandtheCountPathMetric_C0FB/image_10.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="236" alt="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/TipUnderstandtheCountPathMetric_C0FB/image_thumb_4.png" width="244" border="0" /></a> </p>
<p>So for the 3 IF statements here, n=3 and 2<sup>n</sup>= 8 possible paths:</p>
<p>ACE    <br />ACF     <br />ADE     <br />ADF     <br />BCE     <br />BCF     <br />BDE     <br />BDF</p>
</tbody>
</table>
<p>And any guesses what 2<sup>29</sup> is? Yep, 29 IF statements make 536,870,912 paths. Because this metric can grow so large, we do truncate it at 1 Trillion, actually 999,999,999. If we see that many paths, we give up and stop counting. I don’t envy the QA team if they have to test every possible permutation of this, but at least you can believe <em>Understand</em> when it tells you that there are that many paths <img src='http://scitools.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2008/10/tip-understand-the-countpath-metric.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip &#8211; Automated Metrics</title>
		<link>http://scitools.com/blog/2008/10/tip-automated-metrics.html</link>
		<comments>http://scitools.com/blog/2008/10/tip-automated-metrics.html#comments</comments>
		<pubDate>Mon, 13 Oct 2008 15:22:00 +0000</pubDate>
		<dc:creator>KevinG</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.0]]></category>
		<category><![CDATA[metrics scheduler task]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/http:/scitools.com/blog/archives/2008/10/tip-automated-metrics.html</guid>
		<description><![CDATA[There are two quick ways to automate metric reports in Understand 2.0, as a scheduled activity and via the command line.
]]></description>
			<content:encoded><![CDATA[<p>Several people have asked me lately about automating metrics with Understand 2.0. There are two quick ways to automate metrics, as a scheduled activity and via the command line:</p>
<p><span id="more-372"></span></p>
<h3>Scheduled Activity</h3>
<p>The quickest way to automatically get metrics is as a scheduled activity. For example I could setup Understand so that every Friday night it reparses my project and generates the current metrics. I can set it up to save the metrics as a comma delimited file and/or as an html report. This is all configured from Tools | Scheduled Activities.</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/AutomaticMetrics_990B/image_2.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="215" alt="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/AutomaticMetrics_990B/image_thumb.png" width="244" border="0" /></a> </p>
<h3>Command Line</h3>
<p>Another way to automate the metrics is using the command line tool <font color="#0000ff">und</font>. For a list of the commands available from <strong><font color="#0000ff">und</font></strong>, simply run <strong>und –help</strong>. For more advanced help on a specific command, run <strong>und –help command.</strong> For example <strong>run –help rescan</strong> will show the advanced help for the rescan command.</p>
<p>It most cases the first thing you’ll want to do is update your project by rescanning and analyzing. This can be done with:</p>
<p><strong>und –db c:\project\pixie.udb –rescan &#8211; analyzeAll</strong></p>
<p><font color="#0000ff">Und</font> lets you dynamically specify the parameters for the metrics exports. Simply look at the commands that start –metrics_* for additional options.</p>
<p>For example <font color="#0000ff">metrics_sel</font> lets you specify which metrics you want to report on, so if you just wanted the cyclomatic complexity and the lines of code, first you would need to clear the current metrics and then you would set the option as:</p>
<p><strong>und –db c:\project\pixie.udb –metrics_sel none AvgCyclomatic CountLineCode</strong></p>
<p>Then to actually generate the metrics file, use the –<font color="#0000ff">metrics</font> command, you can specify the filename for the csv export, or if none is specified it will default to the last used filed location. You can see the available metrics at <a title="http://scitools.com/documents/metrics.php" href="http://scitools.com/documents/metrics.php">http://scitools.com/documents/metrics.php</a></p>
<p><strong>und –db c:\project\pixie.udb –metrics “c:\temp\Pixie Metrics\metrics.csv”</strong></p>
<p>You can set the parameters and generate the metrics with the same command, so:</p>
<p><strong>und –db c:\project\pixie.udb –metrics_sel none AvgCyclomatic CountLineCode –metrics &quot;c:\temp\Pixie Metrics\metrics 10-13-2008.csv&quot;</strong></p>
<p>You now have a comma delimited text file that you can open in your favorite spreadsheet editor, or parse however you want:</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/AutomaticMetrics_990B/image_6.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="82" alt="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/AutomaticMetrics_990B/image_thumb_2.png" width="338" border="0" /></a> </p>
<p><strong></strong></p>
<p>If you would rather see your metrics as an html report, use the <font color="#0000ff">–metrics_htmlReport</font> command instead of the <font color="#0000ff">–metrics</font> command:</p>
<p><strong>und –db c:\project\pixie.udb –metrics_htmlReport current –dir &quot;c:\temp\Pixie Metrics\html metrics 10-13-2008&quot;</strong></p>
<p>The html reports let you browse by architecture, so you can look at the metrics by filesystem, staff, or whatever architectures you have setup:</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/AutomaticMetrics_990B/image_8.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="151" alt="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/AutomaticMetrics_990B/image_thumb_3.png" width="244" border="0" /></a> <a href="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/AutomaticMetrics_990B/image_10.png"><img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="144" alt="image" src="http://scitools.com/blog/wp-content/uploads/mt-old/WindowsLiveWriter/AutomaticMetrics_990B/image_thumb_4.png" width="271" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2008/10/tip-automated-metrics.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip &#8211; Finding unused functions in a specific class</title>
		<link>http://scitools.com/blog/2008/09/tip-finding-unused-functions-in-a-specific-class.html</link>
		<comments>http://scitools.com/blog/2008/09/tip-finding-unused-functions-in-a-specific-class.html#comments</comments>
		<pubDate>Tue, 30 Sep 2008 20:42:11 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.0]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/http:/scitools.com/blog/archives/2008/09/tip-finding-unused-functions-in-a-specific-class.html</guid>
		<description><![CDATA[I was walking down to the kitchen to get my afternoon cookie and I met another of our engineers. He asked &#8220;hey, how would I use Understand to clean up a class of functions that are no longer used?&#8221;. I thought for a bit and said &#8220;piece of cake&#8221;. 
In&#160;short&#8230;. use the entity filter window [...]]]></description>
			<content:encoded><![CDATA[<p>I was walking down to the kitchen to get my afternoon cookie and I met another of our engineers. He asked &ldquo;hey, how would I use Understand to clean up a class of functions that are no longer used?&rdquo;. I thought for a bit and said &ldquo;piece of cake&rdquo;. </p>
<p>In&nbsp;short&hellip;. use the entity filter window to filter on &ldquo;unused functions&rdquo;, turn&nbsp;entity-&gt;long names on, then&nbsp;type in the name of the class. Done.&nbsp; </p>
<p>Here are the steps&hellip;.&nbsp; First select the &ldquo;Unused Functions&rdquo; filter in the Entity Filter window:</p>
<p><img alt="2008-09-30 16.36" src="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D30_2016.36.jpg" border="0" /></p>
<p><span id="more-371"></span><br />
<br />Now, turn on Full Entity Names by clicking on the dimple <img alt="07 2008-09-30 16.37" src="http://scitools.com/blog/wp-content/uploads/mt-old/07_202008_2D09_2D30_2016.37.jpg" border="0" />to the right of the Show: field:</p>
<p><img alt="10 2008-09-30 16.38" src="http://scitools.com/blog/wp-content/uploads/mt-old/10_202008_2D09_2D30_2016.38.jpg" border="0" /></p>
<p>The names now have :: in their full name if they are from a class:</p>
<p><img alt="2008-09-30 16.39" src="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D30_2016.39.jpg" border="0" /></p>
<p>I&rsquo;m looking to see if class GameBoard has any unused functions, I type &ldquo;GameBoar&rdquo; into the Filter: and find the methods of GameBoard that are not called anywhere in this project:</p>
<p><img alt="2008-09-30 16.40" src="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D30_2016.40.jpg" border="0" /></p>
<p>&nbsp;</p>
<p><img src="http://scitools.com/blog/smile5.gif" />&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2008/09/tip-finding-unused-functions-in-a-specific-class.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understand 2.0 New Feature: Editor Macros</title>
		<link>http://scitools.com/blog/2008/09/understand-20-new-feature-editor-macros.html</link>
		<comments>http://scitools.com/blog/2008/09/understand-20-new-feature-editor-macros.html#comments</comments>
		<pubDate>Thu, 18 Sep 2008 20:34:13 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.0]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/http:/scitools.com/blog/archives/2008/09/understand-20-new-feature-editor-macros.html</guid>
		<description><![CDATA[We are busy internationalizing important messages in Understand 2.0 so that they can be translated into Japanese. This involves a lot of changes that are identical. For instance, all translatable strings have to be turned into functions that go through a translation function &#8220;tr()&#8221; that will table lookup the string to the corresponding Japanese translation.
So [...]]]></description>
			<content:encoded><![CDATA[<p>We are busy internationalizing important messages in <em>Understand 2.0</em> so that they can be translated into Japanese. This involves a lot of changes that are identical. For instance, all translatable strings have to be turned into functions that go through a translation function &ldquo;tr()&rdquo; that will table lookup the string to the corresponding Japanese translation.</p>
<p>So take for instance this section of code:</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: courier"><span style="FONT-WEIGHT: bold; COLOR: #000080">procedure</span>&nbsp;Buffer_Demo&nbsp;<span style="FONT-WEIGHT: bold; COLOR: #000080">is</span><br />&nbsp;&nbsp;&nbsp;EOL&nbsp;&nbsp;<span style="FONT-WEIGHT: bold">:</span>&nbsp;Character&nbsp;<span style="FONT-WEIGHT: bold; COLOR: #000080">renames</span>&nbsp;ASCII<span style="FONT-WEIGHT: bold">.</span>LF<span style="FONT-WEIGHT: bold">;</span><br />&nbsp;&nbsp;&nbsp;Text&nbsp;<span style="FONT-WEIGHT: bold">:</span>&nbsp;<span style="FONT-WEIGHT: bold; COLOR: #000080">constant</span>&nbsp;String<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: bold">:=</span>&nbsp;<span style="COLOR: #cc0000">&#8220;Four&nbsp;score&nbsp;and&nbsp;seven&nbsp;years&nbsp;ago&nbsp;our&nbsp;fathers&nbsp;brought&nbsp;forth,&#8221;</span>&nbsp;<span style="FONT-WEIGHT: bold">&amp;</span>&nbsp;EOL&nbsp;<span style="FONT-WEIGHT: bold">&amp;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="COLOR: #cc0000">&#8220;upon&nbsp;this&nbsp;continent,&nbsp;a&nbsp;new&nbsp;nation,&nbsp;conceived&nbsp;in&nbsp;liberty,&#8221;</span>&nbsp;<span style="FONT-WEIGHT: bold">&amp;</span>&nbsp;EOL&nbsp;<span style="FONT-WEIGHT: bold">&amp;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="COLOR: #cc0000">&#8220;and&nbsp;dedicated&nbsp;to&nbsp;the&nbsp;proposition&nbsp;that&nbsp;`all&nbsp;men&nbsp;are&nbsp;created&nbsp;equal&#8217;.&#8221;</span><span style="FONT-WEIGHT: bold">;</span></p>
<p>I&rsquo;ve got to make it look like this:</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: courier"><span style="FONT-WEIGHT: bold; COLOR: #000080">procedure</span>&nbsp;Buffer_Demo&nbsp;<span style="FONT-WEIGHT: bold; COLOR: #000080">is</span><br />&nbsp;&nbsp;&nbsp;EOL&nbsp;&nbsp;<span style="FONT-WEIGHT: bold">:</span>&nbsp;Character&nbsp;<span style="FONT-WEIGHT: bold; COLOR: #000080">renames</span>&nbsp;ASCII<span style="FONT-WEIGHT: bold">.</span>LF<span style="FONT-WEIGHT: bold">;</span><br />&nbsp;&nbsp;&nbsp;Text&nbsp;<span style="FONT-WEIGHT: bold">:</span>&nbsp;<span style="FONT-WEIGHT: bold; COLOR: #000080">constant</span>&nbsp;String<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="FONT-WEIGHT: bold">:=</span>&nbsp;tr<span style="FONT-WEIGHT: bold">(</span><span style="COLOR: #cc0000">&#8220;Four&nbsp;score&nbsp;and&nbsp;seven&nbsp;years&nbsp;ago&nbsp;our&nbsp;fathers&nbsp;brought&nbsp;forth,&#8221;</span><span style="FONT-WEIGHT: bold">)</span>&nbsp;<span style="FONT-WEIGHT: bold">&amp;</span>&nbsp;EOL&nbsp;<span style="FONT-WEIGHT: bold">&amp;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tr<span style="FONT-WEIGHT: bold">(</span><span style="COLOR: #cc0000">&#8220;upon&nbsp;this&nbsp;continent,&nbsp;a&nbsp;new&nbsp;nation,&nbsp;conceived&nbsp;in&nbsp;liberty,&#8221;</span><span style="FONT-WEIGHT: bold">)</span>&nbsp;<span style="FONT-WEIGHT: bold">&amp;</span>&nbsp;EOL&nbsp;<span style="FONT-WEIGHT: bold">&amp;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tr<span style="FONT-WEIGHT: bold">(</span><span style="COLOR: #cc0000">&#8220;and&nbsp;dedicated&nbsp;to&nbsp;the&nbsp;proposition&nbsp;that&nbsp;`all&nbsp;men&nbsp;are&nbsp;created&nbsp;equal&#8217;.&#8221;</span><span style="FONT-WEIGHT: bold">);</span></p>
<p>Fortunately, Understand 2.0 can record editor macros that make repeated tasks easy and possibly fun.</p>
<p>Here is how&hellip;</p>
<p><span id="more-367"></span></p>
<p><strong>Ctrl-Alt-M</strong> toggles recording on / off. This is also available from the Tools-&gt; menu.<br /><strong>Ctrl-M</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; plays the recorded macro.&nbsp; Also available from the Tools-&gt; menu.</p>
<p>I start recording: </p>
<p><strong>Ctrl-Alt-M</strong></p>
<p>The first thing I do is use the editors fast find to find the &ldquo;.&nbsp; I do this with:</p>
<p><strong>ctrl-f &ldquo;&nbsp; ESC&nbsp; &lt;-</strong></p>
<p>Or, in English&hellip; Control-F, double quotation mark, Escape, left arrow.This places me to the left of a &ldquo;</p>
<p>I then add my function text:</p>
<p><strong>tr(</strong></p>
<p>Now I need to find my closing quotation mark:</p>
<p><strong>Ctrl-F &ldquo;&nbsp; Ctrl-F&nbsp; ESC -&gt;</strong></p>
<p>Or, in English&hellip; Control&ndash;F, double quotation mark, Control-F, Escape, Right Arrow. This places me to the right of the closing quotation.&nbsp; </p>
<p>I then close out the function and stop recording:</p>
<p><strong>) CTRL-ALT-M</strong></p>
<p>Now anytime I hit &ldquo;Ctrl-M&rdquo; it will find a left quotation mark and put tr() around the string.</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: courier"><strong>Note:</strong> For a simple one like this I could probably also use Search-&gt;Find and Replace.</p>
<p style="FONT-SIZE: 10pt; FONT-FAMILY: courier"><img src="http://scitools.com/blog/smile5.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2008/09/understand-20-new-feature-editor-macros.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understand 2.0: Favorites</title>
		<link>http://scitools.com/blog/2008/09/understand-20-favorites.html</link>
		<comments>http://scitools.com/blog/2008/09/understand-20-favorites.html#comments</comments>
		<pubDate>Thu, 18 Sep 2008 18:12:55 +0000</pubDate>
		<dc:creator>ken</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Understand 2.0]]></category>

		<guid isPermaLink="false">http://scitools.com/blog/http:/scitools.com/blog/archives/2008/09/understand-20-favorites.html</guid>
		<description><![CDATA[Understand 2.0 Favorites lets you organize locations (file/line#) or entities (e.g function foo, file foo.cpp) into a named folders.
Favorites can be &#8220;project favorites&#8221;, where they are only applicable to the .udb file open when you made them, or &#8220;all project favorites&#8221;, which are available no matter what project you have loaded.&#160; The &#8220;All Projects&#8221; variety [...]]]></description>
			<content:encoded><![CDATA[<p><em>Understand 2.0</em> Favorites lets you organize locations (file/line#) or entities (e.g function foo, file foo.cpp) into a named folders.</p>
<p>Favorites can be &ldquo;project favorites&rdquo;, where they are only applicable to the .udb file open when you made them, or &ldquo;all project favorites&rdquo;, which are available no matter what project you have loaded.&nbsp; The &ldquo;All Projects&rdquo; variety is useful to me since I have dozens of projects of largely the same source that I use for different testing/evaluation purposes.</p>
<p>Favorites are shown in the &ldquo;Favorites&rdquo; window, which you can show by clicking on the <img alt="2008-09-18 13.55" src="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D18_2013.55.jpg" border="0" />&nbsp;toolbar (or by Windows-&gt;Favorites).</p>
<p>I have my favorites organized into three folders:</p>
<p><img alt="2008-09-18 13.56" src="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D18_2013.56.jpg" border="0" /></p>
<p>I give a lot of web and in-person demos of <em>Understand, &ldquo;</em>Good Demos&rdquo; is where I store classes, functions, and files that help me simply explain the kinds of things <em>Understand </em>does. For instance, here I have classes and functions and a &ldquo;butterfly&rdquo; view with the [x] Sync box checked. In a demo, I can just click on the favorite and see the graph update auto-magically.</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D18_2014.04.jpg"><img alt="2008-09-18 14.04" src="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D18_2014.04_thumb.jpg" border="0" /></a></p>
<p>&ldquo;Interfaces&rdquo; provides a handy spot to stash a quick way to see the API&rsquo;s we often work against here. For instance, the &ldquo;Understand database API (udb)&rdquo; or &ldquo;Change API&rdquo;.&nbsp; If I need to know the UDB API details, I just click on it and up comes the source:</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D18_2014.07.jpg"><img alt="2008-09-18 14.07" src="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D18_2014.07_thumb.jpg" border="0" /></a></p>
<p>&ldquo;ToDo&rdquo; stores places I want to take a peek at again later. Often this is when I find a spot, or a user reports a spot, where a&nbsp; crash or bug can be replicated.&nbsp; It is empty now, but let&rsquo;s pretend I want to come back and look at a spot here in the UDB interface.</p>
<p>First I just click in the editor where I want to remember. Then pull down the Favorites toolbar menu:</p>
<p><img alt="2008-09-18 14.09" src="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D18_2014.09.jpg" border="0" /></p>
<p>It asks me to place the favorite, and I specify &ldquo;All Projects&rdquo; and put it inside &ldquo;ToDo&rdquo;:</p>
<p><a href="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D18_2014.10.jpg"><img alt="2008-09-18 14.10" src="http://scitools.com/blog/wp-content/uploads/mt-old/2008_2D09_2D18_2014.10_thumb.jpg" border="0" /></a></p>
<p>It is now in my Favorites and I can visit it just by double clicking on it:</p>
<p><img alt="14 2008-09-18 14.11" src="http://scitools.com/blog/wp-content/uploads/mt-old/14_202008_2D09_2D18_2014.11.jpg" border="0" /></p>
<p><img src="http://scitools.com/blog/smile5.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://scitools.com/blog/2008/09/understand-20-favorites.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

