<?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>Libpf</title>
	<atom:link href="http://wp.libpf.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://wp.libpf.com</link>
	<description>Straight from the lab !</description>
	<lastBuildDate>Fri, 18 May 2012 07:25:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Analyzing and manipulating settings.xml of LIBPF OPC</title>
		<link>http://wp.libpf.com/?p=615</link>
		<comments>http://wp.libpf.com/?p=615#comments</comments>
		<pubDate>Fri, 18 May 2012 07:25:16 +0000</pubDate>
		<dc:creator>paolog</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wp.libpf.com/?p=615</guid>
		<description><![CDATA[LIBPF OPC is the LIBPF module that adds plant control system connectivity via the Classic OPC interface (OPC DA). The module is configured using the LIBPF OPC Configurator, but the underlying configuration data are stored in an XML file called settings.xml. &#8230; <a href="http://wp.libpf.com/?p=615">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="On-line Connectivity solution based on LIBPF " href="http://www.libpf.com/products/libpf-opc">LIBPF OPC</a> is the LIBPF module that adds <strong>plant control system </strong>connectivity via the Classic OPC interface (OPC DA). The module is configured using the <a title="LOC on gitorious" href="https://gitorious.org/libpf-opc-configurator/loc" target="_blank">LIBPF OPC Configurator</a>, but the underlying configuration data are stored in an XML file called<strong> settings.xml</strong>.</p>
<p>To troubleshoot, sometimes you need to inspect the settings.xml file, and to do that you can use a few good tools.</p>
<p>The first thing you might want to do is looking at which groups are defined. To do that, I use the standard UNIX utilities <strong>grep</strong> and <strong>sed</strong>. These are available from any UNIX shell, but also on Windows if you installed Git for Windows (just open the Git bash shell). The command to list the defined groups is:</p>
<pre>grep '&lt;group' settings.xml | sed 's/.* id="\([^"]*\)" .*$/\1/g'</pre>
<p>If you want to detect duplicates, you can pipe the output of the sed command to <strong>sort</strong>:</p>
<pre>grep '&lt;group' settings.xml | sed 's/.* id="\([^"]*\)" .*$/\1/g' | sort</pre>
<p>But for more complex analyses, grep and sed soon hit their limits. The good news is that we can exploit the structure of XML, and use some more XML-specific tool, such as one for running XQuery queries in <a title="Nokia Qt downloads" href="http://qt.nokia.com/downloads" target="_blank">Nokia Qt SDK</a>, called<strong> xmlpatterns</strong>.</p>
<p>If you create a XQuery file called <strong>groups_id.xq</strong> with this code:</p>
<pre>&lt;groups&gt;
  {doc("settings.xml")//group[@id=$id]}
&lt;/groups&gt;</pre>
<p>then this command will filter your settings.xml and print only the group with id equal to R14AR4:</p>
<pre>xmlpatterns -param id="R14AR4" group_id.xq</pre>
<p>This other XQuery &#8220;program&#8221; (save as <strong>input_tag.xq</strong>) will print all input variables linked to a specific LIBPF variable, defined within groups that are <strong>enabled</strong>:</p>
<pre>&lt;inputs&gt;
  {doc("settings.xml")//group[@enabled="true"]/input[TAG=$tag]}
&lt;/inputs&gt;</pre>
<p>One example of use for the input_tag XQuery is finding the input variables linked to the LIBPF variable <strong>S01.Tphase.mdot</strong>:</p>
<pre>xmlpatterns -param tag="S01.Tphase.mdot" input_tag.xq</pre>
<p>You can find more hints on XQuery <a title="XQuery" href="http://doc.trolltech.com/main-snapshot/xmlprocessing.html" target="_blank">here</a>.</p>
<img src="/wp-content/plugins/pixelstats/trackingpixel.php?post_id=615&amp;ts=1337510979" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://wp.libpf.com/?feed=rss2&#038;p=615</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Step-by-step guide: adding new files to a LIBPF project</title>
		<link>http://wp.libpf.com/?p=601</link>
		<comments>http://wp.libpf.com/?p=601#comments</comments>
		<pubDate>Tue, 15 May 2012 06:13:07 +0000</pubDate>
		<dc:creator>paolog</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wp.libpf.com/?p=601</guid>
		<description><![CDATA[Reference documentation is great, but often boring to read and not helpful to solve specific problems that arise in day-to-day use. To tackle these, a step-by-step guide can be helpful. Here is one such step-by-step guide for adding a new &#8230; <a href="http://wp.libpf.com/?p=601">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Reference documentation is great, but often boring to read and not helpful to solve specific problems that arise in day-to-day use. To tackle these, a step-by-step guide can be helpful.</p>
<p>Here is one such step-by-step guide for <strong>adding a new header/source file pair to LIBPF</strong>. This applies to the standard Microsoft Visual Studio 2008 project file (kernel.vcproj) shipped with the LIBPF SDK.</p>
<ul>
<li>Add the header file to the project, selecting the command Add → New element from the context menu (RMB click) on the <strong>Header files</strong> folder of the project:<a href="http://wp.libpf.com/files/2012/05/demo1.png"><img class="aligncenter size-full wp-image-607" src="http://wp.libpf.com/files/2012/05/demo1.png" alt="" width="530" height="413" /></a></li>
<li>make sure you select Header file (.h), change the name, and make sure you put it in the <strong>include</strong> path (so that the compiler will find it):<a href="http://wp.libpf.com/files/2012/05/demo2.png"><img class="aligncenter size-full wp-image-610" src="http://wp.libpf.com/files/2012/05/demo2.png" alt="" width="802" height="562" /></a></li>
<li>In the new, empty header file, copy-paste the standard skeleton for a LIBPF header file:
<pre>/** @file newfile.h
@brief Contains .....
@author (C) Copyright 2012 .....
*/

#ifndef LIBPF_NEWFILE_H
#define LIBPF_NEWFILE_H

// SYSTEM INCLUDES

// PROJECT INCLUDES

// LOCAL INCLUDES

// FORWARD REFERENCES

// code ....

#endif // LIBPF_NEWFILE_H</pre>
</li>
<li>Do a search and replace on the file to change the file name from <strong>newfile</strong> to whatever your file name is;</li>
<li>Do a search and replace on the file to change the <strong>header guard</strong> from LIBPF_NEWFILE_H to LIBPF_YOURFILENAME_H;</li>
<li>Add the source file to the project, selecting the command Add → New element from the context menu (RMB click) on the <strong>Source files</strong> folder of the project:<a href="http://wp.libpf.com/files/2012/05/demo4.png"><img class="aligncenter size-full wp-image-609" src="http://wp.libpf.com/files/2012/05/demo4.png" alt="" width="511" height="491" /></a></li>
<li>make sure you select C++ file (.cpp), change the name, and make sure you put in the <strong>src</strong> path where source files belong:<a href="http://wp.libpf.com/files/2012/05/demo5.png"><img class="aligncenter size-full wp-image-611" src="http://wp.libpf.com/files/2012/05/demo5.png" alt="" width="803" height="547" /></a></li>
<li>Copy-paste the standard skeleton for a LIBPF source file:
<pre>/** @file newfile.cc
@brief Contains .....

@author (C) Copyright 2012 .....
*/

// SYSTEM INCLUDES

// PROJECT INCLUDES

// LOCAL INCLUDES
#include "newfile.h"

// FORWARD REFERENCES

// code ....</pre>
</li>
<li>Finally, do a search and replace on the file to change the file name from <strong>newfile</strong> to whatever your file name is.</li>
</ul>
<img src="/wp-content/plugins/pixelstats/trackingpixel.php?post_id=601&amp;ts=1337510979" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://wp.libpf.com/?feed=rss2&#038;p=601</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>@#!%&amp;$ Windows environment variable sometimes change case</title>
		<link>http://wp.libpf.com/?p=590</link>
		<comments>http://wp.libpf.com/?p=590#comments</comments>
		<pubDate>Mon, 16 Apr 2012 17:45:42 +0000</pubDate>
		<dc:creator>paolog</dc:creator>
				<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://wp.libpf.com/?p=590</guid>
		<description><![CDATA[We had this puzzling behavior of a compilation step failing on all our Windows buildslaves, when the same compilation would succeed when performed interactively. After long searching and meditating, we found out. The issue was that Windows environment variable change &#8230; <a href="http://wp.libpf.com/?p=590">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We had this puzzling behavior of a compilation step failing on all our Windows buildslaves, when the same compilation would succeed when performed interactively. After <strong>long</strong> searching and meditating, we found out. The issue was that Windows environment variable change case when the user is logged in interactively or as the user impersonating a service.<strong> @#!%&amp;$</strong> !!!!</p>
<p>For example, the interactive user sees:</p>
<pre>CommonProgramFiles=C:\Program Files\Common Files</pre>
<p>but the service sees:</p>
<pre>COMMONPROGRAMFILES=C:\Program Files\Common Files</pre>
<p>This behavior is consistent across Windows XP, Windows 7 and Windows 8 Consumer Preview. The behavior is likely to have no effects in most cases, since in Windows pretty much everything case-insensitive &#8230; but, but there are exceptions to this rule, for example the<a title="Registry Redirector in 64 bit Windows" href="http://msdn.microsoft.com/en-us/library/aa384232%28v=vs.85%29.aspx" target="_blank"> Registry Redirector </a><strong>is</strong> case sensitive. And (what hit us) bjam <strong>is</strong> case-sensitive when <a title="Accessing environment variables " href="http://www.boost.org/doc/display_build.php/boost-build/boost-build/doc/html/bbv2/faq/envar.html" target="_blank">accessing the operating system environment</a> variables with the os.environ command, as <a title="bjam os.environ calls are CASE SENSITIVE" href="http://lists.boost.org/boost-users/2010/09/62909.php" target="_blank">some users</a> already found out.</p>
<p>Since the buildslaves run as a service impersonated by a non-privileged user <a title="Buildbot on Windows - Installation Instructions." href="http://trac.buildbot.net/wiki/RunningBuildbotOnWindows" target="_blank">as usual on Windows</a>, so bjam was unable to find the required headers.</p>
<p>The solution was to add this code to out Jamroot.jam:</p>
<pre>local commonProgramFiles = [ os.environ "CommonProgramFiles(x86)" ] ;
commonProgramFiles ?= [ os.environ "CommonProgramFiles" ] ;
commonProgramFiles ?= [ os.environ "COMMONPROGRAMFILES(X86)" ] ;
commonProgramFiles ?= [ os.environ "COMMONPROGRAMFILES" ] ;</pre>
<img src="/wp-content/plugins/pixelstats/trackingpixel.php?post_id=590&amp;ts=1337510979" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://wp.libpf.com/?feed=rss2&#038;p=590</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing UI with UI scripting: getting hooq to work</title>
		<link>http://wp.libpf.com/?p=567</link>
		<comments>http://wp.libpf.com/?p=567#comments</comments>
		<pubDate>Tue, 03 Apr 2012 14:16:29 +0000</pubDate>
		<dc:creator>paolog</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://wp.libpf.com/?p=567</guid>
		<description><![CDATA[We do need to test User Interfaces (UI) developed with Nokia Qt using UI scripting. There is squish of course and other commercial products but we also like to give a try to open source alternatives if available. One is &#8230; <a href="http://wp.libpf.com/?p=567">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We do need to test User Interfaces (UI) developed with Nokia Qt using UI scripting. There is <a title="Squish for Qt" href="http://www.froglogic.com/squish/gui-testing/editions/qt.php" target="_blank">squish</a> of course and other commercial products but we also like to give a try to open source alternatives if available. One is described in <a title="Qt4 GUI Testing with Hooq" href="http://www.fredemmott.co.uk/blog/2010/01/18/Qt4%20GUI%20Testing%20with%20Hooq" target="_blank">this 2-years old blog post</a> by the author (from which this post heavily borrows), source code is available <a title="hooq: recording and playing back user input on Qt4 applications" href="http://gitorious.org/hooq/" target="_blank">here</a>.</p>
<p>We tested that in Debian wheezy; install some additional packages:</p>
<pre>sudo apt-get install libqt4-dbg libqtscript4-qtbindings</pre>
<p>Then clone the git repo:</p>
<pre>git clone git://gitorious.org/hooq/hooq.git</pre>
<p>enter it, apply <a title="hooq patch" href="/files/2012/03/0001-patch-GdbInjector-add-a-couple-of-asserts.patch">the patch</a> which includes the fix mentioned <a title="Automatic Qt gui testing with Hooq – getting it to compile and work" href="http://madsdyd.wordpress.com/2011/10/19/automatic-qt-gui-testing-with-hooq-getting-it-to-compile-and-work/" target="_blank">here</a> and <a title="making hooq work with pyQt and Qt4.7" href="http://shiqiyang.com/blog/?p=195" target="_blank">here</a>, then qmake and make:</p>
<pre>cd hooq
wget http://wp.libpf.com/files/2012/03/0001-patch-GdbInjector-add-a-couple-of-asserts.patch
git apply 0001-patch-GdbInjector-add-a-couple-of-asserts.patch
qmake hooq.pro
make</pre>
<p>We have tried it out with <a title="LIBPF UI - Open source User Interface for LIBPF" href="http://www.libpf.com/products/libpf-ui">UIPF, the User Interface for Process Flowsheeting</a>.</p>
<p>To run, it start hooq/hooq. The user interface appears:</p>
<p><a href="http://wp.libpf.com/files/2012/04/frame_0010.png"><img class="aligncenter size-large wp-image-575" src="http://wp.libpf.com/files/2012/04/frame_0010-1024x593.png" alt="" width="640" height="370" /></a>For organizing your tests, Hooq uses the concept of a &#8216;test set&#8217; &#8211; this can be one per application, tests for different areas of the same application, or whatever you choose. Select File -&gt; New test set to create one, fill in the stuff including full path to your debug-mode application:</p>
<p><a href="http://wp.libpf.com/files/2012/04/frame_0001.png"><img class="aligncenter size-large wp-image-576" src="http://wp.libpf.com/files/2012/04/frame_0001-1024x593.png" alt="" width="640" height="370" /></a>Now you can type the description for the first test case in the textbox at the bottom and click the &#8220;Record&#8221; button to open up your application and perform the required actions:</p>
<p><a href="http://wp.libpf.com/files/2012/04/frame_0002.png"><img class="aligncenter size-large wp-image-577" src="http://wp.libpf.com/files/2012/04/frame_0002-1024x593.png" alt="" width="640" height="370" /></a>We end recording by closing the application. At the end of the recording session, the test set contains our first test entry, with run and edit buttons:</p>
<p><a href="http://wp.libpf.com/files/2012/04/frame_0003.png"><img class="aligncenter size-large wp-image-579" src="http://wp.libpf.com/files/2012/04/frame_0003-1024x593.png" alt="" width="640" height="370" /></a>Running the test now is of little use because it will execute till the end at max speed, possibly missing any asynchronous event and closing the application before we can actually test anything. The idea is that the script obtained by recording should be edited, adding verifications, diagnostic etc. &#8211; for the test scripts Hooq uses <a title="QtScript" href="http://en.wikipedia.org/wiki/QtScript" target="_blank">QtScript</a>, a scripting language based on ECMAScript i.e. JavaScript + a few Qt-specific extensions. By clicking on the edit button you&#8217;ll get a script editor with nice synthax highlighting:</p>
<p><a href="http://wp.libpf.com/files/2012/04/frame_0004.png"><img class="aligncenter size-large wp-image-580" src="http://wp.libpf.com/files/2012/04/frame_0004-1024x593.png" alt="" width="640" height="370" /></a>If you then click in the margin on the line 17, there&#8217;ll then be a breakpoint marker on that line:</p>
<p><a href="http://wp.libpf.com/files/2012/04/frame_0005.png"><img class="aligncenter size-large wp-image-581" src="http://wp.libpf.com/files/2012/04/frame_0005-1024x593.png" alt="" width="640" height="370" /></a>If you then click the run button in the toolbar, the script will stop running at that line; at this point, if you click &#8216;pick property&#8217; in the toolbar, a pop-up &#8220;Click on a widget to retrieve its porperties&#8221; appears, the cursor becomes a cross and you can then click on any widget in the application being tested, to get a list of its Q_PROPERTYs; for example for the message box in the lower part of UIPF we get:</p>
<p><a href="http://wp.libpf.com/files/2012/04/frame_0007.png"><img class="aligncenter size-large wp-image-582" src="http://wp.libpf.com/files/2012/04/frame_0007-1024x593.png" alt="" width="640" height="370" /></a>For example, scroll down to &#8220;plainText&#8221;, and click fectch. This this will insert the JavaScript code required to fetch the variable from the live application during tests:</p>
<pre>objectFromPath("WindowMain-0::QSplitter-1::QTextEdit-1").property("plainText")</pre>
<p>This requires you to do something with this value. If on the other hand you click &#8220;compare&#8221;, it will automagically insert a check into the JavaScript code in the editor:</p>
<pre>compare(objectFromPath("WindowMain-0::QSplitter-1::QTextEdit-1").property("plainText"), "* ****************** LIBPF 01.00.0868 [2012/02/26 16:09:12] ******************\n* All rights reserved; do not distribute without permission.\n* Paolo Greppi (C) Copyright 2004-2012 Paolo Greppi libpf.com\n* ****************** Jasper 00.01.0192 [2012/03/08 10:03:37] *****************\n* (C) Copyright 2010-2012 Paolo Greppi, Daniele Bernocco Universita' di Genova\nmain * Define components\nmain * Clean up persistent storage database\nmain * Program exits correctly");</pre>
<p>To make sure the variable actually has that value at that point, I also insert a wait statement before:</p>
<pre>msleep(1000)
compare(objectFromPath("WindowMain-0::QSplitter-1::QTextEdit-1").property("plainText"), "* ****************** LIBPF 01.00.0868 [2012/02/26 16:09:12] ******************\n* All rights reserved; do not distribute without permission.\n* Paolo Greppi (C) Copyright 2004-2012 Paolo Greppi libpf.com\n* ****************** Jasper 00.01.0192 [2012/03/08 10:03:37] *****************\n* (C) Copyright 2010-2012 Paolo Greppi, Daniele Bernocco Universita' di Genova\nmain * Define components\nmain * Clean up persistent storage database\nmain * Program exits correctly");</pre>
<p>Now remove the breakpoint, and run it a few times; it should repeat your input and quit each time, without an error; however, if you change the reference string in the compare statement to something else, then click run, the test will produce an error:</p>
<p><a href="http://wp.libpf.com/files/2012/04/frame_0009.png"><img class="aligncenter size-large wp-image-584" src="http://wp.libpf.com/files/2012/04/frame_0009-1024x593.png" alt="" width="640" height="370" /></a></p>
<p>This is more useful when the test hasn&#8217;t changed, but when the application itself has (i.e. a regression). Hooq also has a &#8220;Run All&#8221; feature, to run all the tests in a set unattended, and show a summary at the end.</p>
<p>To turn this tool in an effective automated UI test tool, the following is required:</p>
<ul>
<li>fix a few rough spots</li>
<li>add a CLI command to run selected tests without any access to a display (hidden UI) for running in daemon mode</li>
<li>add XML output similar to boost::test</li>
<li>get some help from a JavaScript guru and prepare a few example scripts with wait-on-event conditions (i.e. wait for table to be populated from remote database, wait for disk operation to complete&#8230;), identifying controls etc.</li>
</ul>
<p>&nbsp;</p>
<img src="/wp-content/plugins/pixelstats/trackingpixel.php?post_id=567&amp;ts=1337510979" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://wp.libpf.com/?feed=rss2&#038;p=567</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The RRSB particle size distribution</title>
		<link>http://wp.libpf.com/?p=555</link>
		<comments>http://wp.libpf.com/?p=555#comments</comments>
		<pubDate>Tue, 03 Apr 2012 09:20:00 +0000</pubDate>
		<dc:creator>paolog</dc:creator>
				<category><![CDATA[Chemeng]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wp.libpf.com/?p=555</guid>
		<description><![CDATA[In the concrete and coal processing industries the RRSB (Rosin, Rammler, Sperling und Bennett) equation for interpolating PSD (Particle Size Distribution) curves is quite popular. The RRSB distribution is: D=1-exp(-(d/d&#8217;)^n) and has this appearance: The name RRSB is used in &#8230; <a href="http://wp.libpf.com/?p=555">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In the concrete and coal processing industries the RRSB (Rosin, Rammler, Sperling und Bennett) equation for interpolating PSD (Particle Size Distribution) curves is quite popular. The RRSB distribution is:</p>
<p>D=1-exp(-(d/d&#8217;)^n)</p>
<p>and has this appearance:</p>
<p style="text-align: center"><a href="http://wp.libpf.com/files/2012/03/weibull.png"><img class="aligncenter  wp-image-561" src="http://wp.libpf.com/files/2012/03/weibull.png" alt="" width="564" height="372" /></a></p>
<p>The name RRSB is used in the tecnical norm <a title="DIN 66145:1976-04" href="http://www.beuth.de/de/norm/din-66145/768345?SearchID=395886726" target="_blank">DIN 66145</a> , &#8220;<em>Darstellung von Korn-(Teilchen-)größenverteilungen &#8211; RRSB-Netz</em>&#8221; (&#8220;<em>Graphical representation of particle size distributions; RRSB-grid</em>&#8220;) which presents a curious grid:</p>
<p style="text-align: center"><a href="http://wp.libpf.com/files/2012/03/RRSB-e1333218971819.png"><img class="aligncenter size-full wp-image-557" src="http://wp.libpf.com/files/2012/03/RRSB-e1333218971819.png" alt="" width="800" height="523" /></a></p>
<p>The grid is based on log vs. log-log scales and is such that if the experimental measurements from a <a title="Sieve analysis on wikipedia" href="http://en.wikipedia.org/wiki/Sieve_analysis" target="_blank">sieve analysis</a> are drawn on it, and a linear interpolation is used, the resulting curve has the form of the RRSB equation above.</p>
<p>Indeed that can be rewritten:</p>
<p>ln(1-D)= -(d/d&#8217;)^n</p>
<p>now calling Y=ln(1-D) it becomes:</p>
<p>Y= -(d/d&#8217;)^n</p>
<p>that&#8217;s why it appears like a straight line on the log vs. log-log plot (y = x^n curves are straight lines on a log vs. log plot).</p>
<p>At first sight it is easy to oversee the fact that the y axis is on a log-log scale rather than just a log-scale. If you look at low D values (right axis in the figure above, it looks like a plain log-scale (because for D small ln(1-D) is almost the same as D). But the distance between the decades increases at values of D approaching 1, which hints at its log-log nature.</p>
<p>In non-German-speaking parts of the world and outside of the concrete and coal processing industries, the RRSB curve is more widely known as Weibull distribution. In Microsoft Excel for example you have the function:</p>
<pre>WEIBULL(X;Alfa;Beta;Cumulative)</pre>
<p>where:</p>
<ul>
<li>X is the diameter</li>
<li>Alfa is the form factor and is the same as n in the expression above</li>
<li>Beta is the scale factor and is the same as d&#8217; above</li>
<li>Cumulative can be set to FALSE to obtain the differential probability distribution curve, which is the same as the PSD in particle jargon.</li>
</ul>
<p>The RRBS i.e. Weibull PSD has been attributed some physical meaning for powders resulting from crushing or grinding processes. It is also used for crystallizates though.</p>
<img src="/wp-content/plugins/pixelstats/trackingpixel.php?post_id=555&amp;ts=1337510979" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://wp.libpf.com/?feed=rss2&#038;p=555</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>buildbot vs git</title>
		<link>http://wp.libpf.com/?p=549</link>
		<comments>http://wp.libpf.com/?p=549#comments</comments>
		<pubDate>Mon, 02 Apr 2012 09:26:48 +0000</pubDate>
		<dc:creator>paolog</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wp.libpf.com/?p=549</guid>
		<description><![CDATA[If you are pulling code from a git Distributed Version Control System, then there is a known bug in older versions of buildbot, which can hit you if your git version is newer than 1.7.7. This was fixed in the &#8230; <a href="http://wp.libpf.com/?p=549">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are pulling code from a git Distributed Version Control System, then there is <a title="Git 1.7.7: Recent change causes buildbot to always fail to fetch from git" href="http://trac.buildbot.net/ticket/2127" target="_blank">a known bug in older versions of buildbot</a>, which can hit you if your git version is newer than 1.7.7.</p>
<p>This was fixed in the latest versions of buildbot (0.8.6), but that does not help if one of your testing machines (one of the buildslaves) has an unsupported combination of buildbot / git. Here is how to fix that in Debian 7.0 (Wheezy) and in Apple Mac OSX 10.7 (Lion) with Macports.</p>
<h3>Debian 7.0 (Wheezy)</h3>
<p>You need to pin the git package to a version supported by the current buildbot, as follows:</p>
<pre>apt.get purge git
cd /etc/apt/preferences.d
cat &gt; git-pinning
Package: git
Pin: version 1:1.7.2.5-3
Pin-Priority: 1001
apt-get install git</pre>
<h3>Apple Mac OSX 10.7 (Lion) with macports</h3>
<p>You need to apply the required patch from <a title="Link to patch" href="http://trac.buildbot.net/attachment/ticket/2127/buildbot_ticket_2127.patch" target="_blank">here</a> to buildbot:</p>
<pre>cd /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/buildslave/commands
sudo vi git.py
...</pre>
<p>Now force compile the modified code as root (the user impersonating buildbot will not have the privileges required to write in this directory) :</p>
<pre>sudo /opt/local/bin/python2.7
&lt;enter password&gt;
import git
^D</pre>
<p>Finally stop / restart the buildbot slave to pick up the updated code</p>
<pre>cd ~/buildbot_home
buildslave stop .
buildslave start .</pre>
<img src="/wp-content/plugins/pixelstats/trackingpixel.php?post_id=549&amp;ts=1337510979" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://wp.libpf.com/?feed=rss2&#038;p=549</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UIPF compiles under Qt 5</title>
		<link>http://wp.libpf.com/?p=541</link>
		<comments>http://wp.libpf.com/?p=541#comments</comments>
		<pubDate>Mon, 26 Mar 2012 09:24:36 +0000</pubDate>
		<dc:creator>paolog</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://wp.libpf.com/?p=541</guid>
		<description><![CDATA[The User Interface for Process Flowsheeting (UIPF) compiles under the almost-alpha Qt 5 (tested under Debian sid): just build Qt 5 from Git, then apply the tips. Highlights: Change the uipf.pro file adding this (we don&#8217;t use QtDeclarative): greaterThan(QT_MAJOR_VERSION, 4) &#8230; <a href="http://wp.libpf.com/?p=541">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The User Interface for Process Flowsheeting (<a title="LIBPF UI - Open source User Interface for LIBPF " href="http://www.libpf.com/products/libpf-ui">UIPF</a>) compiles under the almost-alpha Qt 5 (tested under Debian sid): just <a title="Building Qt 5 from Git" href="http://qt-project.org/wiki/Building_Qt_5_from_Git" target="_blank">build Qt 5 from Git</a>, then apply the <a title="Transition from Qt 4.x to Qt5" href="http://wiki.qt-project.org/Transition_from_Qt_4.x_to_Qt5" target="_blank">tips</a>.</p>
<p>Highlights:</p>
<ol>
<li>Change the uipf.pro file adding this (we don&#8217;t use QtDeclarative):
<pre>greaterThan(QT_MAJOR_VERSION, 4) {
  QT += widgets
}</pre>
</li>
<li>Fixing #includes with the provided fixqt4headers.pl Perl script resulted in compilation failures under Qt 4 since the QtWidgets header does not exist; trick:
<pre>#if (QT_VERSION &lt; 0x050000)
  #include &lt;QtGui&gt;
#else
  #include &lt;QtWidgets&gt;
#endif</pre>
<p>Note: The best practice would be to get rid of the Qt* headers and just include the really required classes; chase them before you start with:</p>
<pre>grep 'include &lt;Qt' src/*cc include/*h</pre>
</li>
<li>One specific issue with UIPF was using the Q_WS_XX macros to conditionally compile for Windows (QT_WS_WIN), OSX (QT_WS_MAC) and Linux (QT_WS_X11);  these do not exist anymore (everything is Q_WS_QPA after the Lighthouse merge)  so one needs to switch on the Q_OS_XX macros:  QT_OS_WIN for Windows, QT_OS_MAC for OSX and QT_OS_LINUX for Linux, see <a title="Getting rid of Q_WS_XX in Qt 5 code" href="http://www.mail-archive.com/qt5-feedback@qt.nokia.com/msg01638.html" target="_blank">this post</a>. The solution was:
<pre>sed -i 's/Q_WS_X11/Q_OS_LINUX/g' *cc
sed -i 's/Q_WS/Q_OS/g' *cc</pre>
</li>
</ol>
<p>Mandatory screenshot (the fonts look ugly because it did not pick up the Oxygen theme for some reason):</p>
<p><a href="http://wp.libpf.com/files/2012/03/uipf_qt5.png"><img class="aligncenter size-full wp-image-544" src="http://wp.libpf.com/files/2012/03/uipf_qt5.png" alt="" width="804" height="531" /></a></p>
<img src="/wp-content/plugins/pixelstats/trackingpixel.php?post_id=541&amp;ts=1337510979" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://wp.libpf.com/?feed=rss2&#038;p=541</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Howto build openssl on Windows</title>
		<link>http://wp.libpf.com/?p=535</link>
		<comments>http://wp.libpf.com/?p=535#comments</comments>
		<pubDate>Mon, 19 Mar 2012 11:11:57 +0000</pubDate>
		<dc:creator>paolog</dc:creator>
				<category><![CDATA[C]]></category>
		<category><![CDATA[Howtos]]></category>

		<guid isPermaLink="false">http://wp.libpf.com/?p=535</guid>
		<description><![CDATA[This howto is for building the latest version of openssl (1.0.1) on the latest version of the Microsoft Windows Desktop operating system (Windows 7 64 bit) using the latest Microsoft compiler (Visual Studio 2011 beta), targeting the 32 bit architecture. &#8230; <a href="http://wp.libpf.com/?p=535">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This howto is for building the <strong>latest</strong> version of openssl (1.0.1) on the <strong>latest</strong> version of the Microsoft Windows Desktop operating system (Windows 7 64 bit) using the <strong>latest</strong> Microsoft compiler (Visual Studio 2011 beta), targeting the 32 bit architecture.</p>
<ol>
<li><a title="Open SSL download area" href="http://openssl.org/source/" target="_blank">Get OpenSSL 1.0.1</a></li>
<li><a title="Git for Windows download area" href="http://code.google.com/p/msysgit/downloads/list" target="_blank">Get the latest package of git for windows</a> (this includes perl which we need)</li>
<li>Open the Visual Studio 2011 Developer Command Prompt</li>
<li>Launch sh from git-msys (look for the your correct command by inspecting the Git bash link):
<pre>C:\Windows\SysWOW64\cmd.exe /c ""C:\Program Files (x86)\Git\bin\sh.exe" --login -i"</pre>
</li>
<li>Move to the folder where you have extracted the openssl source archive
<pre>cd
cd Desktop/openssl-1.0.1/</pre>
</li>
<li>Run autoconfig and prepare make files; ignore the prefix; the sample below only builds suffort for a few ciphers: aes md5 rc4 rsa sha mac md2
<pre>perl Configure VC-WIN32 -DOPENSSL_NO_HW no-asm no-static-engine no-bf no-cast no-des no-dh no-dsa no-mdc2 no-rc2 no-rc5 no-capieng --prefix=c:/some/openssl/dir</pre>
</li>
<li>Create a shell script to emulate the ms/do_ms.bat batch file:
<pre>cat &gt; ms/do_ms.sh
perl util/mkfiles.pl &gt;MINFO
perl util/mk1mf.pl no-asm VC-WIN32 &gt; ms/nt.mak
perl util/mk1mf.pl dll no-asm VC-WIN32 &gt; ms/ntdll.mak
perl util/mkdef.pl 32 libeay &gt; ms/libeay32.def
perl util/mkdef.pl 32 ssleay &gt; ms/ssleay32.def
^D</pre>
</li>
<li>Launch the shell script you just created
<pre>ms/do_ms.sh</pre>
</li>
<li>Build the static and dynamic libraries:
<pre>nmake -f ms/nt.mak</pre>
</li>
<li>At the end of the process copy the include files openssl-1.0.1/inc32/openssl as openssl to your preferred include path, then copy the static library out32/libeay32.lib to your preferred library path.</li>
</ol>
<img src="/wp-content/plugins/pixelstats/trackingpixel.php?post_id=535&amp;ts=1337510979" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://wp.libpf.com/?feed=rss2&#038;p=535</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sieve tray flooding correlation</title>
		<link>http://wp.libpf.com/?p=524</link>
		<comments>http://wp.libpf.com/?p=524#comments</comments>
		<pubDate>Mon, 05 Mar 2012 12:54:00 +0000</pubDate>
		<dc:creator>paolog</dc:creator>
				<category><![CDATA[Chemeng]]></category>

		<guid isPermaLink="false">http://wp.libpf.com/?p=524</guid>
		<description><![CDATA[The correlation of Fair, J. R., “How to Predict Sieve Tray Entrainment and Flooding” Petro/chem. Engr., 33 (10), pp. 45–62 (1961) also cited in Perry, Chemical Engineers Handbook 7th ed. page 14-27  can be used to predict the flooding limit &#8230; <a href="http://wp.libpf.com/?p=524">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The correlation of Fair, J. R., “How to Predict Sieve Tray Entrainment and Flooding” Petro/chem. Engr., 33 (10), pp. 45–62 (1961) also cited in Perry, Chemical Engineers Handbook 7th ed. page 14-27  can be used to predict <strong>the flooding limit in sieve trays</strong>.</p>
<p>The correlation is presented in the form of a plot, which makes its application in a computer system unpractical:</p>
<p><a href="http://wp.libpf.com/files/2012/02/Fair1961_perry.jpg"><img class="aligncenter size-full wp-image-527" src="http://wp.libpf.com/files/2012/02/Fair1961_perry.jpg" alt="" width="500" height="285" /></a>In Perry cit. an analytical expression for these curves is quoted from Lygeros and Magoulas, Hydrocarbon Proc. 65(12), 43 (1986), but the fit is not accurate; also the derivative of the capacity parameter w.r.t. the flow parameter, which in the plot is positive at low values of the latter, when computed with the analytical expression is negative.</p>
<p>The Fair plot can be digitized using the excellent utility <a title="ScanIt: a program that facilitates extracting data from scientific graphs" href="http://www.amsterchem.com/scanit.html" target="_blank">ScanIt</a>. The resulting digitized plot can be fitted using <a title="Gnuplot, a graphing utility" href="http://www.gnuplot.info/" target="_blank">gnuplot</a> to this expression:</p>
<pre>h(x,y) = (((a1*y+a2)*log(x) + (b1*y+b2))*log(x) + (c1*y+c2))*log(x) + (d1*y+d2)</pre>
<p>which returns the capacity parameter (m/s) if it is supplied x, the flow parameter (adimensional) and y, the tray spacing (mm). Log is the natural logarithm.</p>
<p>The numerical values for the coefficients are:</p>
<table>
<tbody>
<tr>
<td>a1</td>
<td>1.10748e-06</td>
</tr>
<tr>
<td>a2</td>
<td>0.00045284</td>
</tr>
<tr>
<td>b1</td>
<td>4.04865e-06</td>
</tr>
<tr>
<td>b2</td>
<td>0.000799395</td>
</tr>
<tr>
<td>c1</td>
<td>-3.09381e-05</td>
</tr>
<tr>
<td>c2</td>
<td>-0.00625024</td>
</tr>
<tr>
<td>d1</td>
<td>3.00232e-05</td>
</tr>
<tr>
<td>d2</td>
<td>0.0140453</td>
</tr>
</tbody>
</table>
<p>The expression is smooth and reproduces the original plot both qualitatively and quantitatively:</p>
<p style="text-align: center"><a href="http://wp.libpf.com/files/2012/02/Fair1961_gnuplot.png"><img class=" wp-image-525 aligncenter" src="http://wp.libpf.com/files/2012/02/Fair1961_gnuplot.png" alt="" width="994" height="539" /></a></p>
<p>The deviation in term of graph abscissa are on average 2.9% on all the sampled points (384). The curve at tray spacing = 600 mm has a marger error (7.1%); if that curve is excluded, the average error on the remaining 330 sample points is 2.2%.</p>
<img src="/wp-content/plugins/pixelstats/trackingpixel.php?post_id=524&amp;ts=1337510979" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://wp.libpf.com/?feed=rss2&#038;p=524</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The open area for triangular pitch perforated sheets</title>
		<link>http://wp.libpf.com/?p=514</link>
		<comments>http://wp.libpf.com/?p=514#comments</comments>
		<pubDate>Mon, 27 Feb 2012 10:54:03 +0000</pubDate>
		<dc:creator>paolog</dc:creator>
				<category><![CDATA[Chemeng]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wp.libpf.com/?p=514</guid>
		<description><![CDATA[For heat exchanger tube plates and for sieve trays in columns, the triangular pitch arrangement is common. You can find ready-to-use formulas on the web to calculate the open area of a perforated sheets, such as this one on the &#8230; <a href="http://wp.libpf.com/?p=514">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For heat exchanger <strong>tube plates</strong> and for <strong>sieve trays</strong> in columns, the triangular pitch arrangement is common. You can find ready-to-use formulas on the web to calculate the <strong>open area</strong> of a perforated sheets, such as this one on the website of <a title="RMIG" href="http://www.rmig.com/en" target="_blank">RMIG</a>:<br />
<img class="aligncenter" src="http://www.rmig.com/files/design/gfx/calculation/type_1.gif" alt="" width="380" height="74" /><br />
But since <a title="Read Books? Why? Use internet!" href="?p=508">we do not trust Google&#8217;s I&#8217;m Feeling Lucky suggestions out-of-the-box</a>, and additionally using R for a diameter is disturbing, here is the derivation (using lowercase <strong>d</strong> for the hole diameter and <strong>p</strong> for the pitch, as it should be):</p>
<p><a href="http://wp.libpf.com/files/2012/02/triangular_pitch3.png"><img class="alignnone size-full wp-image-521" src="http://wp.libpf.com/files/2012/02/triangular_pitch3.png" alt="" width="333" height="411" /></a></p>
<p><a href="http://wp.libpf.com/files/2012/02/triangular_pitch1.png"><img class="size-full wp-image-517 alignnone" src="http://wp.libpf.com/files/2012/02/triangular_pitch1.png" alt="" width="382" height="60" /></a> = d^2*π/8</p>
<p><a href="http://wp.libpf.com/files/2012/02/triangular_pitch2.png"><img class="size-full wp-image-518 alignnone" src="http://wp.libpf.com/files/2012/02/triangular_pitch2.png" alt="" width="227" height="278" /></a> = (d^2*π/8) / (p^2*sqrt(3)/2) = d^2/p^2 * (π/2/sqrt(3)).</p>
<p>The constant π/2/sqrt(3) = 0.906899682119 so Q.E.D.</p>
<img src="/wp-content/plugins/pixelstats/trackingpixel.php?post_id=514&amp;ts=1337510979" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://wp.libpf.com/?feed=rss2&#038;p=514</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

