<?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>openInWorld</title>
	<atom:link href="http://blog.openinworld.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.openinworld.com</link>
	<description>diaries from learning Squeak Smalltalk</description>
	<lastBuildDate>Mon, 21 May 2012 15:18:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Contributing to Pharo By Example</title>
		<link>http://blog.openinworld.com/2012/05/contributing-to-pbe/</link>
		<comments>http://blog.openinworld.com/2012/05/contributing-to-pbe/#comments</comments>
		<pubDate>Mon, 21 May 2012 15:18:57 +0000</pubDate>
		<dc:creator>Ben Coman</dc:creator>
				<category><![CDATA[Pharo]]></category>

		<guid isPermaLink="false">http://blog.openinworld.com/?p=181</guid>
		<description><![CDATA[Background When I was learning Pharo Smalltalk, I found the Pharo By Example book a great help.  It was well written and available at a good price ;). However as Pharo advances at great speed and the original authors are &#8230; <a href="http://blog.openinworld.com/2012/05/contributing-to-pbe/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2 style="text-align: left;">Background</h2>
<p style="text-align: left;">When I was learning Pharo Smalltalk, I found the Pharo By Example book a great help.  It was well written and available at a good price ;). However as Pharo advances at great speed and the original authors are busy documenting and implementing new and advanced features &#8211; this learning resource has become out of date with some of its examples.  So I thought I&#8217;d contribute back to help update it to the latest release.</p>
<p>For those that came in late, Smalltalk is a programming development environment that has been around since the 1970s.  Derived from the original Smalltalk-80,  Apple Computer released Squeak around 1996 as a platform for developing educational software.  In 2006 Squeak was released open source.  This was later forked to focus on business software development and released in 2009 as Pharo 1.0.  At this time the 2007 book Squeak By Example was updated and published as Pharo By Example.  Since then there have been several revisions of Pharo, with the most recent release in April 2012 of Pharo 1.4.</p>
<p style="text-align: left;">Pharo has a goal of refurbishing a lot of the inherited infrastructure, so it is uncertain how closely the book aligns with the current release.  Now I could just mark changes and submit for someone else to integrate these into the document, but that is really only half the job and creating work for someone else.  Since the LaTeX source of the PBE1 book has open access on github, I&#8217;ll decided I would have a crack editing the source direct &#8211; except I haven&#8217;t used LaTeX or <em>git</em> before.  So here I am documenting my setup for two reasons:  One is that some adept might point out improvements in my process; the other is to see if I can spark an interest in anyone else to come along for the ride.  Now lets see what I&#8217;m getting into&#8230;</p>
<h2 style="text-align: left;">Getting started</h2>
<p style="text-align: left;">The PBE1 book is written in LaTeX , the source of which is managed on <a href="https://github.com/SquareBracketAssociates/PharoByExample-english">github</a>.  This is my first experience with both LaTeX and git, so I&#8217;ll be happy to update this post with any hints from readers.  The <a href="https://github.com/SquareBracketAssociates/PharoByExample-english/blob/master/README.markdown">README</a> describes an overview of the contribution process.  What I document here is my particular circumstance of doing this with Windows 7 &#8211; as much for my own reference as trying to draw in an army of willing helpers.</p>
<p style="text-align: left;">The README specifies use of <a title="TeX Live" href="http://www.tug.org/texlive/">TeX Live</a>, for which I first used the Windows installer.  Serge Stinckwich suggested starting with <a href="http://help.github.com/">help.github.com</a> which I found useful create an account and install <em>Git For Windows</em> as instructed <a href="http://help.github.com/win-set-up-git/">here</a> &#8211; and also play with some tutorials.  However while I successfully cloned the PBE1 repository to my local machine, when I went to do my first build to reproduce the existing book prior to any changes, the lack of <em>make</em> on the Windows platform became problematic.</p>
<p style="text-align: left;">To get <em>make</em>, I ended up choosing <a href="http://cygwin.com/">Cygwin</a>.  However it seemed awkward to get the <em>make</em> from inside Cygwin to play well with TeX Live outside its root in Windows.  Since Git For Windows was only a text shell anyway, I chose to discard the Windows versions of git and TeX Live and use these both from inside Cygwin. So my Cygwin install (currently version 1.7.14-2) went like this:</p>
<ul>
<li>Logged in as admin user (since my daily use is under a <a href="http://blogs.msdn.com/b/aaron_margosis/archive/2004/06/17/157962.aspx">non-admin account</a>)</li>
<li>Download and run setup.exe</li>
<li>Install from Internet</li>
<li>All Users ; Root Directory=C:\Apps\Cygwin\root</li>
<li>Local Package Directory=C:\Apps\Cygwin\installer</li>
<li>Direct Connection &amp; Download Site &#8211; ftp://mirror.aarnet.edu.au</li>
<li>Selecting packages&#8230;
<ul>
<li style="text-align: left;">searched &#8220;make&#8221; and selected &#8220;Devel &gt; make&#8221;</li>
<li style="text-align: left;">searched for &#8220;git&#8221; and selected &#8220;Devel &gt; git,  git-completion&#8221; (I  did wonder about git-gui &amp; gitk but wasn&#8217;t sure about about the  operation of a gui from Cygwin and what dependencies would be loaded)</li>
<li style="text-align: left;">searched &#8220;texlive&#8221; and selected every &#8220;Publishing &gt; texlive&#8221; package that did not have a foreign language in it.  I did this by changing Publishing from &#8220;Default&#8221; to  &#8220;Install&#8221; then searching on &#8220;live-collection-do&#8221; and &#8220;live-collection-lan&#8221; and deselecting all but English packages.</li>
<li style="text-align: left;">searched &#8220;ssh&#8221; and selected &#8220;Net &gt; openssh&#8221;</li>
<li style="text-align: left;">search &#8220;vim&#8221; and selected &#8220;Editors &gt; vim&#8221; (since I know &#8216;vi&#8217; from long ago, but you might like something else if you browse the whole list of Editors &#8211; actually &#8216;lyx&#8217; looks interesting to try later so I selected that also)</li>
<li style="text-align: left;">searched &#8220;time&#8221; and selected &#8220;Utils &gt; time&#8221;</li>
</ul>
</li>
<li>Ticked &#8220;select required packages to resolve dependencies.&#8221;</li>
</ul>
<p style="text-align: left;">The install took quite a while (upwards of 20 minutes with most of that being TexLive) after which I switched back to my non-admin user.</p>
<h2 style="text-align: left;">Github setup and practice</h2>
<p style="text-align: left;">After running Start &gt; Programs &gt; Cygwin &gt; Cygwin Terminal, I followed the instructions for <a href="http://help.github.com/linux-set-up-git/">linux-set-up-git</a> jumping in at &#8220;Set Up SSH Keys.&#8221;  I then created directory <em>~/dev</em> and changed into it before doing all parts of <a href="http://help.github.com/create-a-repo/">Create a Repo for Hello-World</a>.  For this learning experience I unticked &#8220;Initialize this repository with a README&#8221;.  I followed up doing the <a href="http://help.github.com/fork-a-repo/">fork-a-repo</a> tutorial to test creating a fork of the &#8220;spoon-knife&#8221; project.</p>
<p style="text-align: left;">So now it was time to get my own local fork of PBE1 to work on.  <a href="http://blog.openinworld.com/wp-content/uploads/2012/05/branch1_4.png"><img style="float: right;" title="Branch for working on Pharo By Example 1.4 Update " src="http://blog.openinworld.com/wp-content/uploads/2012/05/branch1_4.png" alt="Branch for working on Pharo By Example 1.4 Update " width="196" height="169" /></a>Serge Stinckwich had already created a 1.4 branch seen on the right and <a href="https://github.com/SquareBracketAssociates/PharoByExample-english/network">here</a>.  This is where I first thought I needed to fork from, so I first selected the branch to 1.4 at (1) below and then created the fork from that by clicking at (2)&#8230;.</p>
<p style="text-align: left;"><a href="http://blog.openinworld.com/wp-content/uploads/2012/05/github_pbe_fork_branch.png"><img class="size-full wp-image-185" title="PBE Forking Branch" src="http://blog.openinworld.com/wp-content/uploads/2012/05/github_pbe_fork_branch.png" alt="PBE Forking Branch Image" width="813" height="269" /></a></p>
<p>&#8230;but actually it doesn&#8217;t seem to operate that way.  Doing the following clone ended up with my  repository having both <strong>master</strong> and <strong>1.4</strong> branches.</p>
<p>$ <strong>cd ~/dev</strong><br />$ <strong>git clone <a href="javascript:DeCryptX('hjuAhjuivc/dpn')">git [at] github [dot] com</a>:<em>bencoman</em>/PharoByExample-english.git</strong><br />(which downloads about 70MB)<br />$ <strong>cd PharoByExample-english</strong><br />$ <strong>git branch -a</strong><br />* master<br /> remotes/origin/HEAD -&gt; origin/master<br /> remotes/origin/master<br /> remotes/origin/pharo1.4</p>
<p>So it seems that I only select a particular branch for editing on my local machine.  After reading &#8216;man git-remote&#8217; and &#8216;man git-branch&#8217; from the Cygwin shell,  I continue with the tutorial&#8230;</p>
<p>$ <strong>git remote add upstream git://github.com/SquareBracketAssociates/PharoByExample-english.git</strong><br />$ <strong>git fetch upstream</strong><br />$ <strong>git branch -a</strong><br />* master<br /> remotes/origin/HEAD -&gt; origin/master<br /> remotes/origin/master<br /> remotes/origin/pharo1.4<br /> remotes/upstream/master<br /> remotes/upstream/pharo1.4</p>
<p>So at this point I&#8217;m not sure if I should checkout remotes/upstream/pharo1.4 or just pharo1.4, or create my own pharo1.4 branch.  However I try this, which you can see moves the current-marker from master to pharo1.4&#8230;<br />$ <strong>git branch pharo1.4</strong><br />$ <strong>git checkout pharo1.4</strong><br />Switched to branch &#8216;pharo1.4&#8242;<br />$ <strong>git branch -a</strong><br /> master<br />* pharo1.4<br /> remotes/origin/HEAD -&gt; origin/master<br /> remotes/origin/master<br /> remotes/origin/pharo1.4<br /> remotes/upstream/master<br /> remotes/upstream/pharo1.4</p>
<p>Now at this stage, the upstream/pharo1.4 changes have have not been merged into my pharo1.4.  For example, I know that Serge Stinckwich has updated worldMenu.png in the upstream/pharo 1.4 branch &#8211; but at the moment if I browse Windows Explorer to &#8220;C:\Apps\Cygwin\root\home\Ben\dev\PharoByExample-english\QuickTour\figures&#8221; I see worldMenu.png looks like &#8220;Old World Menu&#8221; below.</p>
<p><a href="http://blog.openinworld.com/wp-content/uploads/2012/05/WorldMenu-comparison.png"><img class="aligncenter size-full wp-image-188" title="WorldMenu comparison" src="http://blog.openinworld.com/wp-content/uploads/2012/05/WorldMenu-comparison.png" alt="" width="545" height="318" /></a></p>
<p>To get the New World Menu above, I executed the following line the reopen worldMenu.png from Windows Explorer.<br />$ <strong>git merge upstream/pharo1.4</strong><br />Removing QuickTour/figures/SqueakMap.png<br />Merge made by the &#8216;recursive&#8217; strategy.<br /> QuickTour/figures/SqueakMap.png                   |  Bin 23867 -&gt; 0 bytes<br /> QuickTour/figures/worldMenu.png                   |  Bin 36937 -&gt; 27729 bytes<br /> QuickTour/figures/yellowButtonMenuOnWorkspace.png |  Bin 36518 -&gt; 38602 bytes<br /> pbe1-examples.txt                                 |    2 +-<br /> 4 files changed, 1 insertions(+), 1 deletions(-)<br /> delete mode 100644 QuickTour/figures/SqueakMap.png</p>
<h2>Producing the book</h2>
<p>Before starting making any changes of my own and potentially break something in the build I thought should confirm I could produce the existing book.  This is actually its pretty damn simple.  I just tried the obvious and this worked&#8230;.<br />$ <strong>pwd</strong><br />~/dev/PharoByExample-english<br />$ <strong>make</strong><br />[lots of stuff]<br />Output written on PBE1.pdf (338 pages, 13825502 bytes).<br />Transcript written on PBE1.log.<br />real    0m45.536s</p>
<p>So now browsing Windows Explorer to&#8230;<br /><em> C:\Apps\Cygwin\root\home\Ben\dev\PharoByExample-english</em><br />and opening <em>PBE1.pdf</em> to page 6 shows the updated WorldMenu.</p>
<h2>Making a change, commitment, collaboration</h2>
<p><span style="color: #3366ff;">(Note this section will change slightly when hopefully my addition of file gitDummyPlay.txt is accepted into the upstream/pharo1.4.)</span></p>
<p>File gitDummyPlay.txt file in ~/dev/PharoByExample-english is proposed for new contributors to practice pushing changes back to github.  If it does not currently exist, do this&#8230;<br />$ <strong>touch githubDummyPlay.txt</strong><br />$ git add <strong>githubDummyPlay.txt<br /></strong>$ <strong>git commit -m &#8216;Added dummy file to experiement with while learning git&#8217;<br /></strong>$ <strong>git push</strong></p>
<p>Now edit the file ~/dev/PharoByExample-english/<strong>githubDummyPlay.txt.</strong> Compare this to the same file currently on github.com/{your username} under PharoByExample-english/tree/pharo1.4.   Now do the following and compare both again&#8230;<br />$ <strong>git commit -m &#8216;Test pushing changes to github&#8217;</strong><br />$ <strong>git push</strong></p>
<p>This produces the following network graph, which will disapper when the changes are merged into the mainline.<strong><br /></strong></p>
<p><a href="http://blog.openinworld.com/wp-content/uploads/2012/05/updatedNetworkGraph1.png"><img title="updatedNetworkGraph" src="http://blog.openinworld.com/wp-content/uploads/2012/05/updatedNetworkGraph1.png" alt="" width="249" height="291" /></a></p>
<p><span style="color: #3366ff;">Now the idea would be to issue a Pull Request to the upstream project, but I am waiting on some feedback. </span></p>
<p><span style="color: #ff0000;"><span style="color: #3366ff;">I wonder if it would be useful to take a git branch for each chapter.  This would be similar to one git usage of having a branch for each new feature &#8211; perhaps allow more independent updates by multiple editors.</span><br /></span></p>
<h2><span style="color: #ff0000;"><span style="color: #000000;">Conclusion</span></span></h2>
<p><span style="color: #ff0000;"><span style="color: #000000;">So you can see it is not too difficult to participate at the level of helping out with documentation.  Particularly if you are new to Pharo, you may pick up gaps in the doucmentation that are missed by others more familiar with it, so your input here can be valuable.  Now that I have this process reasonably sorted out in my mind, I just need to learn LaTeX better.<br /></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.openinworld.com/2012/05/contributing-to-pbe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 Pharo DBXTalk &#8211; &#8220;my hack&#8221;</title>
		<link>http://blog.openinworld.com/2011/12/windows-7-pharo-dbxtalk-my-hack/</link>
		<comments>http://blog.openinworld.com/2011/12/windows-7-pharo-dbxtalk-my-hack/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 13:32:22 +0000</pubDate>
		<dc:creator>Ben Coman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.openinworld.com/?p=164</guid>
		<description><![CDATA[Having just got ConfigurationOfODBC working from Pharo Smalltalk, I had some trouble determining exactly how to get at the individual data items.  So I thought I&#8217;d check out DBXTalk for comparison.  DBXTalk is a lot more comprehensive solution leaveraging OpenDBX &#8230; <a href="http://blog.openinworld.com/2011/12/windows-7-pharo-dbxtalk-my-hack/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Having just got <a href="http://blog.openinworld.com/2011/12/pharo-odbc-working-on-windows-7/">ConfigurationOfODBC working from Pharo Smalltalk</a>, I had some trouble determining exactly how to get at the individual data items.  So I thought I&#8217;d check out DBXTalk for comparison.  DBXTalk is a lot more comprehensive solution leaveraging OpenDBX which includes its own ODBC interface along with several other backends.  However all the ODBC connection examples I saw were for database servers with connection strings that were not of the &#8220;DSN&#8221; form that I think is required for Microsoft Access &#8211; so I ended up returning to ConfigurationOfODBC and resolving the issue above.</p>
<p>Yet I was most of the way through getting DBXTalk working, so I record my experience here for posterity.  It is the &#8220;hack&#8221; version since to resolve library dependencies I simply copied everything next to virtual machine executable.  I&#8217;ll look into resolving these more correctly later.  So I&#8230;</p>
<ol>
<li>Created a new folder Pharo-1.3-13315-cog2522-dbxtalk and into it:<br />
a. Extracted the 	&#8220;Contents&#8221; folder only from Pharo-1.3-13315-OneClick.zip<br />
b. Extracted all 	files from cogwin_r2522.zip<br />
c. Updated croquet.ini file with: ImageFile=Contents\Resources\pharo.image<br />
.</li>
<li>Ran croquet.exe and then:<br />
World Menu &gt; Monticello Browser.<br />
.</li>
<li>From the Monticello Browser opened:<a href="http://www.squeaksource.com/MetacelloRepository">
<p>http://www.squeaksource.com/MetacelloRepository</a></p>
<p>and loaded:<br />
ConfigurationOfOpenDBXDriver-GuillermoPolito.13<br />
.<br />
then from a Workspace executed:<br />
(ConfigurationOfOpenDBXDriver project version: 	#&#8217;stable&#8217;) load.<br />
.</li>
<li>From a Workspace found the required OpenDBX library to be 1.4.4 by executing:<br />
OpenDBX currentOpenDBXVersion<br />
.</li>
<li>Extracted all nine files from <a href="http://linuxnetworks.de/opendbx/download/opendbx-1.4.4_win32.zip">http://linuxnetworks.de/opendbx/download/opendbx-1.4.4_win32.zip</a> into folder Pharo-1.3-13315-cog2522-dbxtalk<br />
.</li>
<li>From a DBXTalk developer I asked which version of PostgreSQL to try, and the prompt response came back as 8.3. I installed the current version at this time (postgresql-8.3.17-1-windows.exe) choosing all the defaults.<br />
.</li>
<li>Now possibly step 3 is made redundant by the following, but this post is a record of what I actually did.<br />
.<br />
In Monticello Browser I opened 	repository:<br />
<a href="http://www.squeaksource.com/DBXTalk">http://www.squeaksource.com/DBXTalk</a><br />
.<br />
then loaded:<br />
ConfigurationOfGlorpDBX-GuillermoPolito.70<br />
.<br />
then in a Workspace I executed:<br />
(ConfigurationOfGlorpDBX project version: #&#8217;stable&#8217;) load.<br />
.<br />
which 	left the following message in Transcript&nbsp;</p>
<table border="1">
<tbody>
<tr>
<td>IMPORTANT FOR GLORP AND OpenDBXDriver DRIVER<br />
In order to run sucessfully Glorp tests you should need to change the database connection settings used by them. To do this, change the following methods:<br />
-GlorpDatabaseLoginResource&gt;&gt;defaultPostgreSQLInternetLogin<br />
-GlorpDatabaseLoginResource&gt;&gt;defaultPostgreSQLLocalLogin<br />
-GlorpDatabaseLoginResource&gt;&gt;defaultPostgreSQLLoginForGlorpStore&nbsp;</p>
<p>After doing this all Glorps tests must be green.</p>
<p>Evaluated -&gt; GlorpOpenDBXDriver &gt;&gt; postLoadGlorpDriverDBXTalkPharo</p>
<p>&#8230;finished 2.4</td>
</tr>
</tbody>
</table>
<p>Looking at GlorpDatabaseLoginResource&gt;&gt;defaultPostgreSQLLocalLogin shows:</p>
<table border="1">
<tbody>
<tr>
<td>defaultPostgreSQLLocalLogin<br />
&#8220;To set the default database login to PostgreSQL, execute the following statement.&#8221;<br />
&#8220;self defaultPostgreSQLLocalLogin.&#8221;&nbsp;</p>
<p>^DefaultLogin := (Login new)<br />
database: PostgreSQLPlatform new;<br />
username: &#8216;sodbxtest&#8217;;<br />
password: &#8216;sodbxtest&#8217;;<br />
connectString: &#8217;127.0.0.1:5432_sodbxtest&#8217;.</td>
</tr>
</tbody>
</table>
<p>Now rather than changing these connection settings, for a first attempt I thought it might go easier the other way making the database match the tests, so&#8230;</li>
<li>From the Windows Start Menu ran pgAdminIII.<br />
.</li>
<li>From pgAdminIII created a new user 	sodbxtest:<br />
Servers &gt; 	PostgreSQL 8.3 (localhost:5432) &gt;Login Roles &gt; New Login Role.<br />
with the widest privileges possible.<br />
.</li>
<li>From pgAdminIII created database sodbxtest:<br />
Servers &gt; 	PostgreSQL 8.3 (localhost:5432) &gt; Databases &gt;&gt; New 	Database<br />
Name=sodbxtest<br />
Owner=sodbxtest<br />
Privileges=ALL, 	Role Public<br />
.</li>
<li>Then for later comparison I checked that the number of tables in this new database is zero: Servers &gt; 	PostgreSQL 8.3 (localhost:5432) &gt; Databases &gt; sodbxtest &gt; schemas &gt; public &gt; Tables<br />
.</li>
<li>Now &#8220;the hack&#8221; (since I was in a rush and would have needed to log out and back in as Admin to adjust the search paths.)<br />
.<br />
In Pharo I ran some Glorp Tests and got an error &#8220;could not find libpq.dll.&#8221;  After finding this file in folder <em>PostgresSQL/8.3/libs</em>, rather than properly resolving the lookup, the quick fix was copying everything from that folder next to the virtual machine in folder <em>Pharo-1.3-13315-cog2522-dbxtalk</em>.  A subsequent error &#8220;could not find ssleay32.dll&#8221; was fixed similarly by copying the contents of folder <em>PostgresSQL/8.3/bin</em> next to the virtual machine.<br />
.</li>
<li>Then in Pharo from World Menu &gt; Test Runner all 823 tests for GlorpTests-Models, GlorpTests-Database &amp; GlorpTest are successful.<br />
.<br />
In addition, if I recheck the number of tables noted in Step 14 and find there are now 75 tables &#8211; full of data.<br />
.<br />
Excluded from this are GlorpTests-DatabaseTypes, GlorpTests-Extras, GlorpOpenDBXDriverTests since they seem to cycle through testing databases  that I don&#8217;t have installed &#8211; in particular OCI.dll for Oracle.</li>
</ol>
<p>One small annoyance is that once a &#8220;missing OCI.dll&#8221; error  occurs, it continues to occur even when the previously successful tests  are rerun.  This remains until reset by: GlorpDatabaseLoginResource  defaultPostgreSQLLocalLogin.</p>
<p>So this is a good result and I&#8217;ll be glad to further DBXTalk later on.  However for now, for my current requirements (a one-time  one-way import from an mdb file into Pharo) I think that ConfigurationOfODBC is more suitable.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.openinworld.com/2011/12/windows-7-pharo-dbxtalk-my-hack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pharo 1.3 ODBC working on Windows 7</title>
		<link>http://blog.openinworld.com/2011/12/pharo-odbc-working-on-windows-7/</link>
		<comments>http://blog.openinworld.com/2011/12/pharo-odbc-working-on-windows-7/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 16:49:04 +0000</pubDate>
		<dc:creator>Ben Coman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ODBC]]></category>
		<category><![CDATA[Pharo]]></category>
		<category><![CDATA[Smalltalk]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://blog.openinworld.com/?p=155</guid>
		<description><![CDATA[Wow. Eight months since my last post.  It is now apparent the impact over that time of my 60-70 hour work week onsite at a mine expansion. This post summarises the result of discussion on the pharo-project mailling list where &#8230; <a href="http://blog.openinworld.com/2011/12/pharo-odbc-working-on-windows-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wow. Eight months since my last post.  It is now apparent the impact over that time of my 60-70 hour work week onsite at a mine expansion.</p>
<p>This post summarises the result of discussion on the pharo-project mailling list where I sought assistance getting ODBC working on Pharo 1.3.  Credit goes to <a href="http://http//marianopeck.wordpress.com/">Mariano Peck</a> and <a href="http://http//www.mirandabanda.org/cogblog/about-cog/">Eliot Mirranda</a> for assistance troubleshooting, providing a slightly older configuration that worked, and then the latest VM build.  I am happy to report that ODBC appears to be working with the Pharo 1.3 image on MS Windows 7 using CogVM version 2522.</p>
<p>The purpose of this is that I have a UML design an application has stored in a Microsoft Access database.  I want to use Pharo to implement that design directly into Smalltalk classes since I could not find a common export/import format.  ConfigurationOfODBC looked promising so I followed instructions at  <a href="http://www.pharocasts.com/2010/12/access-database-through-odbc.html">http://www.pharocasts.com/2010/12/access-database-through-odbc.html</a>, except that rather than using SQLLite I started with a blank Microsoft Access database.  This worked well on Pharo 1.2.1 but not out of the box Pharo 1.3.</p>
<p>Here is the method to get ODBC working and tested with Pharo 1.3.</p>
<p>1. With this  <a href="http://blog.openinworld.com/wp-content/uploads/2011/12/TestMDB.mdb">TestMDB.mdb</a> in a local folder, set up the ODBC data source using<br />
Start &gt; Control Panel &gt; Administrative Tools &gt; Data Sources (ODBC)</p>
<div id="attachment_157" class="wp-caption alignnone" style="width: 481px"><a href="http://blog.openinworld.com/wp-content/uploads/2011/12/ODBC-Data-Source-Administrator.png"></a><a href="http://blog.openinworld.com/wp-content/uploads/2011/12/ODBC-Data-Source-Administrator1.png"><img class="alignnone size-full wp-image-161" title="ODBC Data Source Administrator" src="http://blog.openinworld.com/wp-content/uploads/2011/12/ODBC-Data-Source-Administrator1.png" alt="" width="471" height="390" /></a><p class="wp-caption-text">ODBC Data Source Administrator</p></div>
<p>Clicked &lt;Add&#8230;&gt; and choose the Microsoft Access Driver</p>
<p><a href="http://blog.openinworld.com/wp-content/uploads/2011/12/CreateNewDataSource.png"><img class="alignnone size-full wp-image-160" title="CreateNewDataSource" src="http://blog.openinworld.com/wp-content/uploads/2011/12/CreateNewDataSource.png" alt="" width="478" height="358" /></a></p>
<p>and &lt;Select&#8230;&gt; the TestMDB.mdb file configured as Data Source Name &#8220;TestMDB&#8221;</p>
<p><a href="http://blog.openinworld.com/wp-content/uploads/2011/12/ODBC-Microsoft-Access-Setup.png"><img class="size-full wp-image-158" title="ODBC Microsoft Access Setup" src="http://blog.openinworld.com/wp-content/uploads/2011/12/ODBC-Microsoft-Access-Setup.png" alt="ODBC Microsoft Access Setup" width="481" height="320" /></a></p>
<div class="mceTemp">
<dl id="attachment_158" class="wp-caption alignnone" style="width: 491px;">
<dd class="wp-caption-dd">ODBC Microsoft Access Setup</dd>
</dl>
</div>
<p>which gives&#8230;</p>
<p><a href="http://blog.openinworld.com/wp-content/uploads/2011/12/ODBC-Data-Source-Administrator2.png"><img class="alignnone size-full wp-image-162" title="ODBC Data Source Administrator2" src="http://blog.openinworld.com/wp-content/uploads/2011/12/ODBC-Data-Source-Administrator2.png" alt="" width="471" height="390" /></a></p>
<p>2. Unzip <a href="http://gforge.inria.fr/frs/download.php/29274/Pharo-1.3-13315-OneClick.zip">Pharo-1.3-13315-OneClick.zip</a> and then delete all files from<br />
folder &#8220;Pharo-1.3-13315-OneClick.app&#8221;, leaving just the Contents folder.</p>
<p>3. Extract the files from <a href="http://www.mirandabanda.org/files/Cog/VM/VM.r2522/cogwin.zip">VM.r2522/cogwin.zip</a> into folder &#8220;Pharo-1.3-13315-OneClick.app&#8221;</p>
<p>4. Copy the &#8220;ImageFile=Contents\Resources\pharo.image&#8221; line from the old <strong><em>pharo.ini</em></strong> into <strong><em>Croquet.ini</em></strong> and then run<strong> <em>Croquet.exe</em></strong>.</p>
<p>5. Load the ODBC package from within Pharo.  I had some trouble accessing Squeaksource, but I found success using a mirror (you might skip the first two lines&#8230;)</p>
<p style="padding-left: 30px;"><span style="font-family: arial,helvetica,sans-serif;">Gofer new url: &#8216;http://dsal.cl/squeaksource/MonticelloRedirect&#8217;; package: &#8216;MontiRedirect&#8217;; load.</span></p>
<p style="padding-left: 30px;"><span style="font-family: arial,helvetica,sans-serif;">MRManager redirectFrom: &#8216;http://www.squeaksource.com/&#8217; to: &#8216;http://dsal.cl/squeaksource/&#8217;.</span></p>
<p style="padding-left: 30px;"><span style="font-family: arial,helvetica,sans-serif;">Gofer new</span><br />
<span style="font-family: arial,helvetica,sans-serif;"> squeaksource: &#8216;ODBC&#8217;;</span><br />
<span style="font-family: arial,helvetica,sans-serif;"> package: &#8216;ConfigurationOfODBC&#8217;; load.</span><br />
<span style="font-family: arial,helvetica,sans-serif;"> (Smalltalk at: #ConfigurationOfODBC) load.</span></p>
<p>6. And then finally, the successful test of ODBC&#8230;</p>
<p style="padding-left: 30px;"><span style="font-family: arial,helvetica,sans-serif;">connection := ODBCConnection dsn: &#8216;TestMDB&#8217; user: &#8221; password: &#8221;.</span><br />
<span style="font-family: arial,helvetica,sans-serif;"> table := (connection query: &#8216;select * from user;&#8217;) execute asTable.</span><br />
<span style="font-family: arial,helvetica,sans-serif;"> connection close.<br />
table inspect.</span></p>
<div id="attachment_167" class="wp-caption alignnone" style="width: 355px"><a href="http://blog.openinworld.com/wp-content/uploads/2011/12/ODBCResultTable-Inspector-1.png"><img class="size-full wp-image-167" title="Inspector on ODBCResultTable" src="http://blog.openinworld.com/wp-content/uploads/2011/12/ODBCResultTable-Inspector-1.png" alt="Inspector on ODBCResultTable" width="345" height="220" /></a><p class="wp-caption-text">Inspector on ODBCResultTable</p></div>
<p>Thats all.  Now time to explore that UML design&#8230;.</p>
<p>Here are some links to the full discussion and a backup cache of the files</p>
<ul>
<li><a href="http://thread.gmane.org/gmane.comp.lang.smalltalk.pharo.devel/56184">http://thread.gmane.org/gmane.comp.lang.smalltalk.pharo.devel/56184</a></li>
<li><a href="http://files.openinworld.com/Pharo/Pharo-1.3-13315-OneClick.zip">http://files.openinworld.com/Pharo/Pharo-1.3-13315-OneClick.zip</a></li>
<li><a href="http://files.openinworld.com/Pharo/cogwin_r2522.zip">http://files.openinworld.com/Pharo/cogwin_r2522.zip</a></li>
</ul>
<p>Update 24 Dec 2011&#8230;</p>
<p>7. Just recording an example for the next part of actually processing the database. Following on from the previous step&#8230;</p>
<p style="padding-left: 30px;">( row := table first ) inspect.<br />
( name := row at: #name ) inspect.<br />
( age := row at: #age ) inspect.<br />
( allNames := table collect: [:each | each at: #name] ) inspect.</p>
<p>To go with the above example I have also uploaded a new file <a href="http://files.openInWorld.com/Pharo/TestMDB - 2011-12-24.zip">TestMDB &#8211; 2011-12-24.zip</a> with a few additional rows of data.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.openinworld.com/2011/12/pharo-odbc-working-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>mouse buttons and menus</title>
		<link>http://blog.openinworld.com/2011/04/mouse-buttons-and-menus/</link>
		<comments>http://blog.openinworld.com/2011/04/mouse-buttons-and-menus/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 15:08:29 +0000</pubDate>
		<dc:creator>Ben Coman</dc:creator>
				<category><![CDATA[System]]></category>

		<guid isPermaLink="false">http://blog.openinworld.com/?p=134</guid>
		<description><![CDATA[My mouse is a Logitech Wireless Nano Mouse M305.  The default function of the mousewheel (button 3) is Zoom.  To be most useful for Smalltalk, the mousewheel function needed to be configured as Middle Button.  For Windows 7 this was &#8230; <a href="http://blog.openinworld.com/2011/04/mouse-buttons-and-menus/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My mouse is a Logitech Wireless Nano Mouse M305.  The default function of the mousewheel (button 3) is <em>Zoom</em>.  To be most useful for Smalltalk, the mousewheel function needed to be configured as <em>Middle Button</em>.  For Windows 7 this was done via<br />
<em>[Start &gt; Control Panel &gt; Mouse &gt; SetPoint Settings]</em> as pictured below.<span id="more-134"></span></p>
<div id="attachment_137" class="wp-caption aligncenter" style="width: 646px"><a href="http://blog.openinworld.com/wp-content/uploads/2011/04/wireless-mouse-M305-1001.png"><img class="size-full wp-image-137 " title="wireless-mouse-M305-100" src="http://blog.openinworld.com/wp-content/uploads/2011/04/wireless-mouse-M305-1002.png" alt="Logitech Wireless Mouse M305 Middle Button Setting" width="636" height="347" /></a><p class="wp-caption-text">Logitech Wireless Mouse M305 Middle Button Setting</p></div>
<p><a href="http://blog.openinworld.com/wp-content/uploads/2011/04/system-menu-mouse-mapping-75.png"><img class="alignright size-full wp-image-138" title="system-menu-mouse-mapping-75" src="http://blog.openinworld.com/wp-content/uploads/2011/04/system-menu-mouse-mapping-75.png" alt="system menu mouse mapping" width="308" height="138" /></a><br />
That done, there are still a few configuration options in Squeak that affect operation.  In particular <em>[ &lt;F2&gt; System Menu &gt; Mouse Mapping ]</em> affects how  particular direct manipulation actions are invoked.</p>
<p>By way of a specific example, Table 1 shows images of the possible actions and menus for a RectangleMorph, which are:</p>
<ol>
<li> Select &#8211; This picks up the morph from the World and gives it to HandMorph, which then moves it around the screen</li>
<li> Meta &#8211; This brings up the halos around the object</li>
<li> Menu 1 &#8211; I&#8217;d really like to be able to be more distinct in   distinguishing between these  menus besides &#8220;Next to its name is a small thumbnail of its morph .&#8221; Does it have a better designation?</li>
<li> Menu 2 &#8211; Similar to Menu 1, is there a proper designation of this menu?  I can only concisely describe it as &#8220;Next to its name there is no thumbnail of its morph.&#8221;</li>
<li>Halos &gt; Menu &#8211; Just included for comparison (in Table 3) to try and work out the definition of Menus 1 &amp; 2.  This is inconclusive since its menu items are somewhat split between Menus 1 &amp; 2.Table 1 &#8211; Direct Manipulation Mouse Actions</li>
</ol>
<table style="border: 2px solid #000000;" border="2">
<caption>Table 1 &#8211; RectangleMorph actions &amp; menus </caption>
<tbody>
<tr>
<td>1. Select&nbsp;</p>
<p><img title="default-left-click" src="../wp-content/uploads/2011/04/default-left-click.png" alt="" width="76" height="66" /></td>
<td>2. Meta<br />
<img title="default-right-click" src="../wp-content/uploads/2011/04/default-right-click.png" alt="" width="85" height="92" /></td>
<td>3. Menu 1<br />
<img title="default-wheel-click-75" src="../wp-content/uploads/2011/04/default-wheel-click-75.png" alt="" width="145" height="244" /></td>
<td>4. Menu 2<br />
<img title="default-ctrl-wheel-click-75" src="../wp-content/uploads/2011/04/default-ctrl-wheel-click-75.png" alt="" width="147" height="317" /></td>
</tr>
<tr>
<td></td>
<td></td>
<td>5. Halos &gt; Menu<br />
<img title="halos-menu-75" src="../wp-content/uploads/2011/04/halos-menu-75.png" alt="" width="166" height="324" /></td>
<td>6. Halos &gt; Debug<br />
<img title="halos-debug-menu-75" src="../wp-content/uploads/2011/04/halos-debug-menu-75.png" alt="" width="176" height="233" /></td>
</tr>
</tbody>
</table>
<p>The effect of the different Mouse Mappings is shown in Table 2, which tabulates the effect of the <em>Ctrl </em>&amp; <em>Alt </em>keypress modifiers on mouse button clicks.  The three Mouse Mappings (<span style="color: #0000ff;">Default</span> /  <span style="color: #008000;">3 Button</span> / <span style="color: #ff6600;">1 Button</span>) are shown together.  This shows a few things:</p>
<ol>
<li>The left mouse button remains the same regardless of the mapping</li>
<li>For both mappings of three buttons, the button assigned to Halos is always Halos.  Halos are unaffected by any <em>Ctrl </em>or <em>Alt </em>keypress modifier.</li>
<li>For both mappings of three buttons, the button assigned to Menu is always Menu. Menus are affected by the <em>Ctrl </em>keypress, which changes from<br />
Menu 1 to Menu 2.</li>
<li>The 1-button mapping continues to work with both mappings of three buttons,  and so is a lowest common denominator that might be considered for tutorials.</li>
<li>With a two-button mouse and Default mapping it is likely that Menu 2 is missed, requiring both Ctrl &amp; Alt keys to be held together.</li>
<li>With a two-button mouse and 3-button mapping, the Alt key can be ignored. The Ctrl key changes Select and Menu 1 respectively to Halo and Menu 2.</li>
</ol>
<table style="border-color: #000000; border-width: 2px;" border="2" align="center">
<caption>Table 2 Mouse Mapping Matrix</caption>
<tbody>
<tr>
<td align="center"><span style="color: #0000ff;">Default</span><br />
<span style="color: #008000;">3 Button </span><br />
<span style="color: #ff6600;">1 Button</span></td>
<td align="center">Left<br />
Mouse<br />
Click</td>
<td align="center">Mouse<br />
Wheel<br />
Click</td>
<td align="center">Right<br />
Mouse<br />
Click</td>
</tr>
<tr>
<td align="center">No Key</td>
<td align="center"><span style="color: #0000ff;">Select</span><br />
<span style="color: #ff6600;"> </span><span style="color: #008000;">Select<br />
</span><span style="color: #ff6600;">Select</span></td>
<td align="center"><span style="color: #0000ff;">Menu 1</span><br />
<span style="color: #ff6600;"> </span><span style="color: #008000;">Halos<br />
<span style="color: #ff6600;">Select</span><br />
</span></td>
<td align="center"><span style="color: #0000ff;">Halos</span><br />
<span style="color: #008000;">Menu 1<br />
<span style="color: #ff6600;">Select</span><br />
</span></td>
</tr>
<tr>
<td align="center">Alt Key</td>
<td align="center"><span style="color: #0000ff;">Menu 1</span><br />
<span style="color: #008000;">Menu 1</span><br />
<span style="color: #ff6600;">Menu 1</span></td>
<td align="center"><span style="color: #0000ff;">Menu 1</span><br />
<span style="color: #008000;">Halos</span><br />
<span style="color: #ff6600;">Menu 1</span></td>
<td align="center"><span style="color: #0000ff;">Halos</span><br />
<span style="color: #008000;">Menu 1</span><br />
<span style="color: #ff6600;">Menu 1</span></td>
</tr>
<tr>
<td align="center">Ctrl Key</td>
<td align="center"><span style="color: #0000ff;">Halos</span><br />
<span style="color: #008000;">Halos<br />
<span style="color: #ff6600;">Halos</span><br />
</span></td>
<td align="center"><span style="color: #0000ff;">Menu 2</span><br />
<span style="color: #008000;">Halos<br />
</span><span style="color: #ff6600;">Halos</span></td>
<td align="center"><span style="color: #0000ff;">Halos</span><br />
<span style="color: #008000;">Menu 2<br />
</span><span style="color: #ff6600;">Halos</span></td>
</tr>
<tr>
<td align="center">Ctrl &amp; Alt Keys</td>
<td align="center"><span style="color: #0000ff;">Menu 2</span><br />
<span style="color: #008000;">Menu 2<br />
<span style="color: #ff6600;">Menu 2</span></span></td>
<td align="center"><span style="color: #0000ff;">Menu 2</span><br />
<span style="color: #ff6600;"> </span><span style="color: #008000;">Halos<br />
</span><span style="color: #ff6600;">Menu 2</span></td>
<td align="center"><span style="color: #0000ff;">Halos</span><br />
<span style="color: #008000;">Menu 2<br />
</span><span style="color: #ff6600;">Menu 2</span></td>
</tr>
</tbody>
</table>
<p>Based on this, I&#8217;ll configure the Mouse Mapping as &#8220;3-Button.&#8221;  I&#8217;m not sure how the balance between the usage of halos and menus will pan out, but as a default I&#8217;ll prefer to have my menus on the same button as the rest of the operating system.  This may come up for review as my usage of the system evolve.</p>
<p>Finally, just for clarity, I compare how items from the various menus overlap.  As a Squeak newbie, there are some small inconsistencies that impede that comfortable feeling we associate with familiarity. This comparison helps build that feeling of familiarity.</p>
<ol>
<li>For the same functionality, one menu says &#8220;Select&#8221;<br />
and another says &#8220;Add Halo&#8221;</li>
<li>For the same functionality, one menu says &#8220;Send to Back&#8221;<br />
and another says &#8220;Go Behind&#8221;<br />
<em> </em></li>
<li><em>[ Halos &gt; debug menu &gt; control menu ]</em> brings up exactly Menu 2.  Perhaps &#8220;control menu&#8221; might be a reasonable name for Menu 2, though I&#8217;m not sure.</li>
</ol>
<table border="0">
<caption>Table 3 &#8211; Comparison of Menus</caption>
<tbody>
<tr>
<td align="center">Item</td>
<td align="center">Menu 1</td>
<td align="center">Menu 2</td>
<td align="center">Halos &gt; Menu</td>
</tr>
<tr>
<td align="center">inspect</td>
<td align="center">1</td>
<td align="center">1</td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">provide clipping</td>
<td align="center">1</td>
<td align="center">1</td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">layout</td>
<td align="center">1</td>
<td align="center">1</td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">send to back /<br />
go behind</td>
<td align="center">1</td>
<td align="center">1</td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">bring to front</td>
<td align="center">1</td>
<td align="center"></td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">resist being deleted</td>
<td align="center">1</td>
<td align="center"></td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">resist being picked up</td>
<td align="center">1</td>
<td align="center"></td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">be locked</td>
<td align="center">1</td>
<td align="center"></td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">direction handles</td>
<td align="center">1</td>
<td align="center"></td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">accept drops</td>
<td align="center">1</td>
<td align="center"></td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">round corners</td>
<td align="center">1</td>
<td align="center"></td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">export</td>
<td align="center">1</td>
<td align="center"></td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">select /<br />
add halo</td>
<td align="center">1</td>
<td align="center">1</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">copy to paste buffer</td>
<td align="center">1</td>
<td align="center">1</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">grab</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">copy to paste buffer</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">collapse</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">delete</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">duplicate</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">resize</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">fill style</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">drop shadow</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">copy text</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">copy postscript</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">print postscript to file</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">fill style</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">debug</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">adhere to edge</td>
<td align="center">1</td>
<td align="center"></td>
<td align="center"></td>
</tr>
<tr>
<td align="center">connect to</td>
<td align="center">1</td>
<td align="center"></td>
<td align="center"></td>
</tr>
<tr>
<td align="center">grab</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">collapse</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">delete</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">save morph in file</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">attach to resource</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">show actions</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">explore</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">browse hierarchy</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">make own subclass</td>
<td align="center"></td>
<td align="center">1</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">border style</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">make a sibling</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">property sheet</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">set color</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">viewer</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">hand me a tile</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">2</td>
</tr>
<tr>
<td align="center">siblings</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">stacks and cards</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">1</td>
</tr>
<tr>
<td align="center">extras</td>
<td align="center"></td>
<td align="center"></td>
<td align="center">1</td>
</tr>
</tbody>
</table>
<p>Now to be controversial.  Coming newly into this, the whole red button, blue button, yellow button thing is a PITA.  My wild speculation is&#8230; that back at the birth of Smalltalk the guys at Xerox were essentially exploring the creation the modern GUI.  They either did not have sufficient terminology, or did not want lock down the terminology too early. Neuro Linguistic Programming tells us that words constrain thinking, so that was probably a good decision at the time.  However thirty years on, the GUI paradigm and the concepts of Select, Context Menu and Meta are well established.  So why not now use these? &#8230;and be a little bit more palatable to the rest of society.</p>
<p>The designations of Select, Menu and Meta are in fact referenced at the <a href="http://wiki.squeak.org/squeak/897" target="_blank">Squeak Wiki FAQ: Mouse Buttons</a> and would maintain the &#8220;arbitrary&#8221; nature of &#8220;coloured&#8221; buttons discussed at <a href="http://wiki.squeak.org/squeak/2331" target="_blank">Andrew P. Black on mouse button colors and the command key</a>.</p>
<p>However everything historical is based around the coloured buttons, so I will probably just have to &#8220;get used to it.&#8221;  Here it is for quick reference until it soaks in&#8230;</p>
<pre>        "red"                   -&gt; select
        "yellow"                -&gt; menu
        "blue"                  -&gt; meta operation</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.openinworld.com/2011/04/mouse-buttons-and-menus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>performance testing spreadsheet</title>
		<link>http://blog.openinworld.com/2011/04/performance-testing-spreadsheet/</link>
		<comments>http://blog.openinworld.com/2011/04/performance-testing-spreadsheet/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 17:07:21 +0000</pubDate>
		<dc:creator>Ben Coman</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.openinworld.com/?p=130</guid>
		<description><![CDATA[For anyone anyone so inclined to replicate the results, or update the results for subsequent releases of the Smalltalk systems, the linked spreadsheet Squeak Graphics Framework Performance Testing.ODF was used to generate the graphs in these articles: http://blog.openinworld.com/2011/03/morphic-performance/ http://blog.openinworld.com/2011/03/morphic-flavour-performance/ You &#8230; <a href="http://blog.openinworld.com/2011/04/performance-testing-spreadsheet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For anyone anyone so inclined to replicate the results, or update the results for subsequent releases of the Smalltalk systems, the linked spreadsheet <a href="http://blog.openinworld.com/wp-content/uploads/2011/04/Squeak-Graphics-Framework-Performance-Testing.ods">Squeak Graphics Framework Performance Testing.ODF</a> was used to generate the graphs in these articles:</p>
<ul>
<li><a href="http://blog.openinworld.com/2011/03/morphic-performance/ ">http://blog.openinworld.com/2011/03/morphic-performance/ </a></li>
<li><a href="http://blog.openinworld.com/2011/03/morphic-flavour-performance/">http://blog.openinworld.com/2011/03/morphic-flavour-performance/</a></li>
</ul>
<p>You are able to attach graphs to your comments in those articles.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.openinworld.com/2011/04/performance-testing-spreadsheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>workspace referencing to existing morphs</title>
		<link>http://blog.openinworld.com/2011/04/workspace-referencing-to-existing-morphs/</link>
		<comments>http://blog.openinworld.com/2011/04/workspace-referencing-to-existing-morphs/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 15:02:02 +0000</pubDate>
		<dc:creator>Ben Coman</dc:creator>
				<category><![CDATA[Debugging]]></category>

		<guid isPermaLink="false">http://blog.openinworld.com/?p=116</guid>
		<description><![CDATA[Flipping through Andy Burnett&#8217;s blog Learning Smalltalk he discusses in Getting a handle on objects from the Flaps how to get programmatic reference to morphs that have been created by direct manipulation &#8211; for example by being dragged on-screen from &#8230; <a href="http://blog.openinworld.com/2011/04/workspace-referencing-to-existing-morphs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Flipping through Andy Burnett&#8217;s blog <a href="http://learningsmalltalk.blogspot.com" target="_blank">Learning Smalltalk</a> he discusses in <a href="http://learningsmalltalk.blogspot.com/2008/02/getting-handle-on-objects-from-flaps.html">Getting a handle on objects from the Flaps</a> how to get programmatic reference to morphs that have been created by direct manipulation &#8211; for example by being dragged on-screen from the tool flaps.  The &#8220;textual reference to dropped morph in  Workspaces&#8221; looked like an interesting feature that would likely to be quite useful in the future &#8211; so best to find out how it works right now&#8230;<span id="more-116"></span></p>
<p><a href="http://blog.openinworld.com/wp-content/uploads/2011/04/world-flaps-menus-2-60.png"><img class="alignright size-full wp-image-123" title="world-flaps-menus-2-60" src="http://blog.openinworld.com/wp-content/uploads/2011/04/world-flaps-menus-2-60.png" alt="world-flaps-menus" width="207" height="341" /></a>Although I had seen these flaps while previously playing around with Squeak 4.2, <em>[Projects &gt; New Project &gt; New MorphicProject]</em> now did not show any.  The flaps needed to be enabled through <em>[World menu &gt; flaps &gt; show shared flaps]</em>.</p>
<p>I then created a workspace <em>[World &gt; Workspace]</em> and an object in the world <em>[Objects flap &gt; Categories &gt; Graphics &gt; Curve &gt; drag onto world ]</em>.</p>
<p>First the default behaviour was tested by dragging <em>Curve</em> over the <em>Workspace</em>.  As expected it did nothing.   <em>Curve</em> was dragged away from <em>Workspace</em>.</p>
<p>&nbsp;</p>
<p><a href="http://blog.openinworld.com/wp-content/uploads/2011/04/workspace-halos-plus-alt-menus-70.png"><img class="alignleft size-full wp-image-126" title="workspace-halos-plus-alt-menus-70" src="http://blog.openinworld.com/wp-content/uploads/2011/04/workspace-halos-plus-alt-menus-70.png" alt="workspace halos plus alternative menus" width="339" height="298" /></a>It was not clear from Andy&#8217;s article where the functionality was configured.  The first tried was &#8220;1&#8243; <em><br />
[Halos &gt; Menu &gt; accept drops]</em>. However when Curve was dropped onto<em> Workspace</em>, no text appeared.</p>
<p>Instead <em>Curve </em>became stuck to <em>Workspace</em> such that dragging <em>Curve </em>also dragged <em>Workspace </em>with it.   <em>Curve</em> had to be removed from <em>Workspace </em>using <em>[Curve &gt; Halos &gt; Pick Up]</em>.  Then <em>[Halos &gt; Menu &gt; accept drops]</em> was disabled.</p>
<p>Further exploration found another related menu, marked &#8220;2&#8243; above. This did have the required menu option.  After enabling<em> [create textual references to dropped morphs]</em>, <em>Curve </em>was dropped onto <em>Workspace</em>.  This now created the text &#8220;curve2970&#8243; in <em>Workspace</em>.  Then <em>[curve2970 &gt; inspect it]</em> displayed an identical inspector to that displayed for <em>[original graphic object &gt; Halos &gt; Debug &gt; Inspect It]</em>.</p>
<p>That is way cool.  Are there any other programming environments that can do that out of the box?</p>
<p>I then found some additional info, which I&#8217;ll leave for further reading&#8230;<br />
<a href="http://wiki.squeak.org/squeak/2149" target="_self">Squeak Wiki FAQ: How do I access a Morph from a Workspace?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.openinworld.com/2011/04/workspace-referencing-to-existing-morphs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>morphic flavour performance</title>
		<link>http://blog.openinworld.com/2011/03/morphic-flavour-performance/</link>
		<comments>http://blog.openinworld.com/2011/03/morphic-flavour-performance/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 16:05:50 +0000</pubDate>
		<dc:creator>Ben Coman</dc:creator>
				<category><![CDATA[Morphic]]></category>
		<category><![CDATA[Cog]]></category>
		<category><![CDATA[Cuis]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Pharo]]></category>
		<category><![CDATA[Squeak]]></category>

		<guid isPermaLink="false">http://blog.openinworld.com/?p=71</guid>
		<description><![CDATA[Previously in morphic performance I benchmarked different actions in Squeak Smalltalk for creating, hiding, showing and deleting morphs in Squeak. On [squeak-dev] Herbert Konig wrote: &#8220;Juan Vuletich has done a great job at simplifying cleaning and speeding up his version &#8230; <a href="http://blog.openinworld.com/2011/03/morphic-flavour-performance/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Previously in <a href="http://blog.openinworld.com/2011/03/morphic-performance/" target="_blank">morphic performance</a> I benchmarked different actions in Squeak Smalltalk for creating, hiding, showing and deleting morphs in Squeak.</p>
<p style="padding-left: 30px;">On [squeak-dev] Herbert Konig wrote: &#8220;<em>Juan Vuletich has done a great job at simplifying cleaning and speeding up his version of Morphic in Cuis</em>.&#8221;</p>
<p>So lets check that out.  We should compare some other flavours of Smalltalk.  The code used to generated the graph data is the same  &#8220;V1&#8243; code as used for <a href="../../2011/03/morphic-performance/" target="_blank">morphic performance</a>. The software versions tested here are:</p>
<ul>
<li><a href="http://gforge.inria.fr/frs/download.php/28015/Pharo-1.1.1-OneClick.zip">Pharo-1.1.1-OneClick</a></li>
<li><a href="http://gforge.inria.fr/frs/download.php/27524/Pharo-1.1.1-OneClickCogVM.zip">Pharo-1.1.1-OneClickCogVM</a></li>
<li><a href="http://www.jvuletich.org/Cuis/Cuis3.0All-in-One.app.zip">Cuis 3.0 All-in-One.app</a></li>
<li><a href="http://ftp.squeak.org/4.2/Squeak-4.2-All-in-One.zip">Squeak 4.2 All-in-One.app<br />
</a><span id="more-71"></span></li>
</ul>
<div id="attachment_85" class="wp-caption aligncenter" style="width: 947px"><a href="http://blog.openinworld.com//wp-content/uploads/2011/03/more-performance-flavours.png"><img class="size-full wp-image-85  " title="more-performance-flavours" src="http://blog.openinworld.com//wp-content/uploads/2011/03/more-performance-flavours.png" alt="More Performance Graph - Inter Flavour Testing" width="937" height="711" /></a><p class="wp-caption-text">Figure 1 - Interflavour Morphic Performance Testing - &quot;v1&quot; code (note x-scale is 10% of Figure 2)</p></div>
<p>Some interesting points are:</p>
<ul>
<li>Cuis is the fastest for creating, hiding and showing morphs.  For deleting morphs Cuis is no faster than non-cog Pharo/Squeak, following the same exponential curve.</li>
<li>Pharo-CogVM is by far the fastest at deleting morphs, near the fastest at creating morphs, but much slower at hiding and showing morphs.</li>
<li>Non-CogVM Squeak and Pharo are very similar throughout the four graphs, with Pharo being slightly faster.   Both increase exponentially for creating &amp; deleting morphs.  I&#8217;m not sure what to make of the smoother Pharo curves.</li>
</ul>
<p>An update will follow to include the effect of Juan Vuletich&#8217;s <em>&#8220;addAllMorphs&#8221;</em> performance tweak of the original code.</p>
<p><span style="text-decoration: underline;"><em><strong>Update 31 March 2011</strong></em></span><br />
I updated the original <a href="http://blog.openinworld.com/2011/03/morphic-performance/" target="_blank">morphic performance</a> article with Juan Vuletich&#8217;s  <em><span style="color: #ff0000;">addAllMorphs</span></em> performance tweak.  It will be interesting to see how that compares across flavours of Squeak.</p>
<p>In addition, for some flavours of Squeak the previous code didn&#8217;t display any morphs at all.  It seemed that the tightness of the creation/deletion loops might have optimised away the actual drawing of the morphs.  I don&#8217;t expect that is how applications would operate so the results would be skewed.  More fair I think is to force a redraw between each of the four tests, where I&#8217;ve added <span style="color: #99cc00;">doOneCycle <span style="color: #444444;">below.  What do you think?</span></span><strong> </strong></p>
<pre style="padding-left: 30px;"><span style="color: #000000;"> </span><span style="color: #000000;">rand := Random new.</span>
<span style="color: #000000;">creating :=
[</span><span style="color: #000000;">    m := EllipseMorph  new.</span>
<span style="color: #ff0000;">      ellipses add: m.</span>
<span style="color: #000000;">      m color: Color random.</span>
<span style="color: #000000;">      m position: ActiveWorld extent * ((rand next)@(rand next))</span>
<span style="color: #000000;">].</span>
<span style="color: #000000;">deleting := [ World <span style="color: #ff0000;">removeAllMorphsIn: ellipses</span>. ].</span>
<span style="color: #000000;">hiding := [ <span style="color: #ff0000;">ellipses </span>do: [ :item | item hide ]].</span>
<span style="color: #000000;">showing := [ <span style="color: #ff0000;">ellipses </span>do: [ :item | item show ]]. </span>

<span style="color: #000000;">Transcript show: 'Morphic Performance Test Code v3.0 - ##FLAVOUR## '; cr.
</span><span style="color: #000000;">Transcript show: 'amount, createTime, hideTime, showTime, deleteTime'; cr.</span>
<span style="color: #000000;">#( 1 10  100 200 300 400 500 600 700 800 900 1000 2000</span>
<span style="color: #000000;">3000 4000 5000 6000 7000 8000 9000 10000  30000 100000)</span><span style="color: #000000;"> do:
[ :amount |</span><span style="color: #000000;">
        <span style="color: #ff0000;"> ellipses := OrderedCollection new. </span></span>
<span style="color: #000000;">         createTime :=
         [         amount timesRepeat: creating. </span>
<span style="color: #ff0000;">                   World addAllMorphs: ellipses. </span>
<span style="color: #99cc00;">                   ActiveWorld doOneCycle.</span>
<span style="color: #000000;">         ] timeToRun</span><span style="color: #000000;"> </span><span style="color: #000000;">. </span>
<span style="color: #000000;">    hideTime := [ hiding value</span><span style="color: #000000;">. <span style="color: #99cc00;">ActiveWorld doOneCycle.</span></span><span style="color: #000000;"> ] timeToRun</span><span style="color: #000000;"> </span><span style="color: #000000;">.</span>
<span style="color: #000000;">    showTime := [ showing value</span><span style="color: #000000;">. <span style="color: #99cc00;">ActiveWorld doOneCycle.</span></span><span style="color: #000000;"> ] timeToRun</span><span style="color: #000000;">.</span>
<span style="color: #000000;">    deleteTime := [ deleting value. <span style="color: #99cc00;">ActiveWorld doOneCycle.</span> ] timeToRun.</span>
<span style="color: #000000;">    Transcript show:</span> <span style="color: #000000;">amount</span><span style="color: #000000;"> </span><span style="color: #000000;">asString,          ', ', </span><span style="color: #000000;">
                    createTime </span><span style="color: #000000;">asString,    ', ', </span><span style="color: #000000;">
                    hideTime </span><span style="color: #000000;">asString,        ', ', </span><span style="color: #000000;">
                    showTime </span><span style="color: #000000;">asString,       ', ', </span>
         <span style="color: #000000;">deleteTime </span><span style="color: #000000;">asString; </span><span style="color: #000000;">    cr.
]</span></pre>
<p><span style="text-decoration: underline;"><em><strong> </strong></em></span></p>
<div id="attachment_98" class="wp-caption aligncenter" style="width: 969px"><a href="http://blog.openinworld.com//wp-content/uploads/2011/03/more-performance-addAllMorphs-c1.png"><img class="size-full wp-image-98 " title="more-performance-addAllMorphs-c" src="http://blog.openinworld.com//wp-content/uploads/2011/03/more-performance-addAllMorphs-c1.png" alt="Interflavour Morphic Performance Testing With addAllMorphs Code &quot;v3&quot;" width="959" height="755" /></a><p class="wp-caption-text">Figure 2 - Interflavour Morphic Performance Testing - &quot;v3&quot; code with addAllMorphs </p></div>
<p>It is intriguing how very straight the lines are now in Figure 2 compared to Figure 1.  Somehow I feel like something must be wrong.  Anyhow, thanks to Juan&#8217;s suggestions, as well as being ten times faster, the graph shape is now linear rather than exponential - a much better prospect for system scaling.</p>
<p>Also interesting is how similar the flavours of Squeak are now.   For up to 30,000 morphs the createTime is identical for all four flavours.  After that performance does diverge, with Cog being fastest, Squeak &amp; Cuis together in the middle and Pharo the slowest at about half the speed of the Cog.</p>
<p>Strangely, Cog has a hideTime four times slower than the other three.   For showTime, both versions of Pharo (Std &amp; Cog) are together twice as fast as Cuis and Squeak.</p>
<p>Test platform was Windows 7 Professional 32-bit Intel Core2Duo P8700 2.53Ghz 3GB RAM with graphics from Mobile Intel 4 Series Express Chipset.</p>
<p>I am interested in your observations.  Can you replicate these results?<br />
(graphs can be attached to comments)</p>
<div id="_mcePaste" class="mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 0px; left: -10000px;">﻿</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.openinworld.com/2011/03/morphic-flavour-performance/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>wordpress shared hosting performance</title>
		<link>http://blog.openinworld.com/2011/03/wordpress-shared-hosting-performance/</link>
		<comments>http://blog.openinworld.com/2011/03/wordpress-shared-hosting-performance/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 15:30:06 +0000</pubDate>
		<dc:creator>Ben Coman</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Caching]]></category>
		<category><![CDATA[DreamHost]]></category>
		<category><![CDATA[FastCGI]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[ProcWatch]]></category>
		<category><![CDATA[Shared Hosting]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.openinworld.com/?p=64</guid>
		<description><![CDATA[It&#8217;s the second week of running WordPress, so I&#8217;ve been trialing a few plugins&#8230;  Suddenly, about half the time I do anything I get &#8220;Apologies, but the page you requested could not be found.&#8221; The page loads fine the second &#8230; <a href="http://blog.openinworld.com/2011/03/wordpress-shared-hosting-performance/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s the second week of running WordPress, so I&#8217;ve been trialing a few plugins&#8230;  Suddenly, about half the time I do anything I get <strong><em>&#8220;Apologies, but the page you requested could not be found.&#8221; </em></strong> The page loads fine the second time with a simple page refresh.  The site is brand new, so there shouldn&#8217;t be any traffic.  So what gives?<span id="more-64"></span>Getting on-chat with DreamHost support (which itself is a great service)&#8230; five minutes later they had tracked down that my WordPress was exceeding the user RAM limit on their shared-hosting.  The system process watcher ProcWatch was killing off the connection.  Here is the log message supplied by DreamHost:</p>
<pre style="padding-left: 30px;"><span style="background-color: #ffffff;"><em>2011-03-10 03:55:15 procwatch2 INFO: Process(pid=1755, name='php5.cgi',
uid=xxxxx(10537396), tty=None, cpu=2.0, rss=42516.0, vsize=148964.0):
<span style="background-color: #ffff00;">kill for total RAM</span></em></span></pre>
<p>And one of many messages from file: <em>logs/http/error.log</em>:</p>
<pre style="padding-left: 30px;">[Thu Mar 10 04:01:59 2011] [error] [client 124.169.187.59]
<span style="background-color: #ffff00;">Premature end of script headers</span>: symposium_bar_functions.php,
referer: http://blog.openinworld.com/2011/03/morphic-performance-testing
</pre>
<p>Keeping the system balanced for all tusers is fair &#8211; but how does that affect me directly?  Am I able to work with this?  WordPress appears to put a relatively heavy strain on server memory.  I did not anticipate it the memory limit could be exceeded so easily, but I guess that is the reality of shared hosting.</p>
<p>DreamHost refrains from specifying what the RAM limit is.   Perhaps its dynamic, or a marketing issue, or it changes with time.  I&#8217;ve seen speculation elsewhere of it being 100MB, 120MB &amp; 200MB in posts from 2006, 2010 &amp; 2007.  From a shell with the `top` command I monitored my live processes.  <a href="http://www.freshblurbs.com/how-profile-memory-linux">How to Profile Memory in Linux</a> describes the columns below.  Specifically we are interested in the resident memory.  Three WordPress php5.cgi listeners are shown, each idling comfortably  around 45MB.  That might peg the RAM limit somewhere between 150MB to  200MB.</p>
<p><a rel="attachment wp-att-66" href="http://blog.openinworld.com/2011/03/wordpress-shared-hosting-performance/top1-with-14-plugins/"><img class="aligncenter size-full wp-image-66" title="top1 with 14 plugins" longdesc="`top` command at the time that 14 plugins were installed" src="http://blog.openinworld.com//wp-content/uploads/2011/03/top1-with-14-plugins.png" alt="`top` command at the time that 14 plugins were installed" width="639" height="209" /></a></p>
<p>Interestingly, comparing this to the `top` snapshots at <a href="http://wiki.dreamhost.com/WordPress_Optimization">DreamHost WordPress Optimization</a> I note the RES memory there is around 7.5MB versus my 35MB.  While part of this may be be due to general software  bloat between versions, I suspect it may mostly be from RAM usage doubling between 32-bit  and 64-bit operating systems.  Hopefully the RAM Limit was doubled  accordingly to compensate.</p>
<p>So what to do? The simple suggestion from DreamHost was to &#8220;<em>disable all your WordPress plugins.</em>&#8220;  That seemed a bit extreme, but will at least help to understand  the issue.  Before anything else, I went looking for a WordPress plugin to show plug-in memory usage. I installed <strong>TPC! Memory Usage (TPCMU), </strong>which immediately started firing the following email at me several times a second.  Note that the 32MB is a user defined soft limit.</p>
<pre>WordPress memory usage exceeded 32 MB
WordPress peak memory usage: 34.85 MB
Number of database queries: 36</pre>
<p>I then removed every plugin except TPCMU , and `top` then reported RAM usage 10MB better per listener &#8211; at around 35MB each.  TPCMU reported WordPress peak memory usage as 22.4MB.  <strong><br />
</strong></p>
<div id="attachment_67" class="wp-caption aligncenter" style="width: 651px"><a rel="attachment wp-att-67" href="http://blog.openinworld.com/2011/03/wordpress-shared-hosting-performance/top2-with-0-plugins/"><img class="size-full wp-image-67" title="top2 with 0 plugins" src="http://blog.openinworld.com//wp-content/uploads/2011/03/top2-with-0-plugins.png" alt="top2 with 0 plugins" width="641" height="33" /></a><p class="wp-caption-text">top2 with 0 plugins</p></div>
<p>To observe  the effect of reinstating each plugin, I tracked the Memory Usage displayed in the footer of the Admin &gt; Plugins &gt; Active Plugins page.  The results are tabulated below.  Marked in red are the plugins I ultimately removed, judging that functionality gain not worth the pain of required RAM.  I believe that remaining plugins are a reasonable balance of functionality versus memory usage  &#8211; particularly since two thirds of that is aimed at performance and security, with an overall benefit to other users of the server.<strong><br />
</strong></p>
<table border="0">
<tbody>
<tr>
<td><strong>PLUGIN</strong></td>
<td style="text-align: center;"><strong>KEEP (MB)</strong><strong><br />
</strong></td>
<td style="text-align: center;"><strong><span style="color: #ff0000;">REMOVE (MB)</span><br />
</strong></td>
</tr>
<tr>
<td style="text-align: left;"><span style="text-decoration: underline;"><strong>Performance</strong></span></td>
<td style="text-align: center;"></td>
<td></td>
</tr>
<tr>
<td style="text-align: left; padding-left: 30px;">TPC! Memory Usage</td>
<td style="text-align: center;"></td>
<td></td>
</tr>
<tr>
<td style="padding-left: 30px;">WP Super Cache</td>
<td style="text-align: center;">2.3</td>
<td></td>
</tr>
<tr>
<td><span style="text-decoration: underline;"><strong>Security</strong></span></td>
<td style="text-align: center;"></td>
<td></td>
</tr>
<tr>
<td style="padding-left: 30px;">Akismet</td>
<td style="text-align: center;">0.4</td>
<td style="text-align: center;"></td>
</tr>
<tr>
<td style="text-align: left; padding-left: 30px;">NoSpamNX</td>
<td style="text-align: center;">0.2</td>
<td></td>
</tr>
<tr>
<td style="padding-left: 30px;">CryptX</td>
<td style="text-align: center;">0.3</td>
<td></td>
</tr>
<tr>
<td style="padding-left: 30px;">Exploit Scanner</td>
<td style="text-align: center;">0.6</td>
<td></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">SI Captacha Anti-Spam</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">0.5</span></td>
</tr>
<tr>
<td><span style="text-decoration: underline;"><strong>Publishing</strong></span></td>
<td style="text-align: center;"></td>
<td></td>
</tr>
<tr>
<td style="padding-left: 30px;">After the Deadline</td>
<td style="text-align: center;">0.2</td>
<td style="text-align: center;"></td>
</tr>
<tr>
<td style="padding-left: 30px;">TinyMCE Advanced</td>
<td style="text-align: center;">0.1</td>
<td style="text-align: center;"></td>
</tr>
<tr>
<td style="padding-left: 30px;">Postie</td>
<td style="text-align: center;">0.8</td>
<td></td>
</tr>
<tr>
<td><span style="text-decoration: underline;"><strong>User Experience</strong></span></td>
<td style="text-align: center;"></td>
<td></td>
</tr>
<tr>
<td style="padding-left: 30px;">Sidebar Login</td>
<td style="text-align: center;">0.2</td>
<td></td>
</tr>
<tr>
<td style="padding-left: 30px;">Email Login</td>
<td style="text-align: center;">0.1</td>
<td></td>
</tr>
<tr>
<td style="padding-left: 30px;">Login Logo</td>
<td style="text-align: center;">0.05</td>
<td style="text-align: center;"></td>
</tr>
<tr>
<td style="padding-left: 30px;">Subscribe To Comments Reloaded</td>
<td style="text-align: center;">0.3</td>
<td style="text-align: center;"></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">Breadcrumb NavXT</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">1.0</span></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">WP Super Mailer</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">0.5</span></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">Drop-zone</span><span style="text-decoration: underline;"><strong> </strong></span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">0.6</span></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">Subscribe2</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">1.8</span></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">WP-Symposium system</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">2.4</span></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">WP Forum Server</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">1.6</span></td>
</tr>
<tr>
<td><span style="text-decoration: underline;"><strong>Admin</strong></span></td>
<td style="text-align: center;"></td>
<td></td>
</tr>
<tr>
<td style="padding-left: 30px;">Open Web Analytics</td>
<td style="text-align: center;">0.06</td>
<td style="text-align: center;"></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">WordPress Database Backup</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">0.6</span></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">Role Scoper</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">3.7</span></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">Broken Link Checker</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">3.8</span></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">Extended Comment Options</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">0.3</span></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">WP Stats</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">0.4</span></td>
</tr>
<tr>
<td style="padding-left: 30px;"><span style="color: #ff0000;">WP Stats Dashboard</span></td>
<td style="text-align: center;"></td>
<td style="text-align: center;"><span style="color: #ff0000;">1.8</span></td>
</tr>
<tr style="height: 5px;">
<td style="padding-left: 30px;"><strong><span style="color: #ff0000;"><span style="color: #000000;">TOTAL</span></span></strong></td>
<td style="text-align: center;"><strong>5.6</strong></td>
<td style="text-align: center;"><strong><span style="color: #ff0000;">19.0</span></strong></td>
</tr>
</tbody>
</table>
<p>TPCMU now reported 28.5MB and `top` showed php.cgi at 41MB.</p>
<p>I saw several tips suggesting that rather than just deactivating plugins, deleting them saves more space. I had 42 <em>Inactive </em>plug-ins, including those just deactivated and others I had tried and not liked.  Deleting all of them only reduced the TPCMU report down 0.1MB to 28.4MB &#8211; not much really.</p>
<p>DreamHost has some community information available.  <a href="http://wiki.dreamhost.com/Wordpress_performance">DreamHost WordPress_Performance</a> discusses page load speed. It recommends a few caching plugins and the use of FastCGI.  Faster processing reduces overall memory usage somewhat due to there being less concurrent php.cgi processes.</p>
<p><a href="http://wiki.dreamhost.com/WordPress_Optimization">DreamHost WordPress Optimization</a> discusses four site configurations in relation to memory usage.  It also recommends caching.  However it recommends NoFastCGI saying:</p>
<p style="padding-left: 30px;"><em>[Cache + NoFastCGI] has great performance while having the lowest overall resource  hit on the server. It should always be using the least amount of memory  and CPU time that it possibly can [...] whereas in a FastCGI configuration the number configured to spawn  would remain open whether or not any requests were coming in.</em></p>
<p>When idle, FastCGI processes sit around continuing to consume memory.  Hence the cumulative memory usage over time would be greater than NoFastCGI.  That could be considered a greater load on the server.   However FastCGI provides a more steady and predictable load, which is more desirable for tuning that one that fluctuates.  FastCGI should handle peak loads more gracefully.  NoFastCGI has a fairly important proviso&#8230;</p>
<p style="padding-left: 30px;"><em>The only time </em><em>[Cache + NoFastCGI]</em><em> might be less  efficient is if a large number of un-cached pages are accessed  simultaneously as a number of php5.cgi processes would spawn to handle  those.</em></p>
<p>&#8230;in which case ProcWatch would assumedly start killing off random connections for exceeding the user RAM limit. For a high traffic site (wishful thinking!) FastCGI should handle each cache-miss faster, thus requiring less overall RAM with less chance of connections being killed.  Ideally, the number of spawned FastCGI processes could be limited to avoid a &#8220;Kill For RAM&#8221; scenario.  However I haven&#8217;t been able to determine how to limit the number of FastCGI processes spawned.</p>
<p>I might have to keep an eye on FastCGI though, since this  <a href="http://return-true.com/2010/05/wordpress-php-cgi-vs-php-fcgi/">WordPress: PHP CGI vs PHP FCGI</a> post  points to some issues with FastCGI &#8211; that I have not experienced that so far.</p>
<p>In conclusion, Dreamhost offer shared hosting that is unlimited in many of its (advertised) parameters.  However overall service capability is limited by the tightest constraint &#8211; which in this case is RAM &#8211; the one they don&#8217;t advertise (and neither does any other shaed host I&#8217;ve seen.)  To work within this limit and resolve the &#8220;kill for total RAM&#8221; issue, I have:</p>
<ul>
<li>investigated the memory usage of WordPress plugins</li>
<li>reduced the number WordPress plug-ins</li>
<li>activated an application-aware cache &#8220;Supercache&#8221;</li>
<li>continued to use FastCGI (which is the DreamHost default)</li>
</ul>
<p>In the end, these are only simple things &#8211; but I&#8217;ve learnt a lot along the way.  I was considering further action with some of the methods from the <a href="http://www.prelovac.com/vladimir/wordpress-optimization-guide">WordPress Optimization Bible</a>, but my error.log file has been clear for a few days, so I&#8217;ll leave those for later.</p>
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 478px; width: 1px; height: 1px; overflow: hidden;">beleive</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.openinworld.com/2011/03/wordpress-shared-hosting-performance/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>morphic performance</title>
		<link>http://blog.openinworld.com/2011/03/morphic-performance/</link>
		<comments>http://blog.openinworld.com/2011/03/morphic-performance/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 15:26:54 +0000</pubDate>
		<dc:creator>Ben Coman</dc:creator>
				<category><![CDATA[Morphic]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Squeak]]></category>

		<guid isPermaLink="false">http://blog.openinworld.com/?p=6</guid>
		<description><![CDATA[For my postgrad dissertation I&#8217;ve decided to program an engineering design tool.  I&#8217;d like to focus more on the application domain rather than the programming minutiae.  Based purely on gut feel from a long-held but unproven belief, I&#8217;ve selected Smalltalk &#8230; <a href="http://blog.openinworld.com/2011/03/morphic-performance/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For my postgrad dissertation I&#8217;ve decided to program an engineering design tool.  I&#8217;d like to focus more on the application domain rather than the programming minutiae.  Based purely on gut feel from a long-held but unproven belief, I&#8217;ve selected <a href="http://en.wikipedia.org/wiki/Smalltalk" target="_blank">Smalltalk </a>as the development platform.  Specifically I&#8217;ve selected <a href="http://www.squeak.org/" target="_blank">Squeak</a> with its Morphic graphics system, which seems to have a lot of useful &#8220;direct manipulation&#8221; functionality.  Now some validation of this choice would be useful and one place to start is performance testing.  <span id="more-6"></span></p>
<p>Herbert Konig on [squeak-dev] suggested:</p>
<address style="padding-left: 30px;">&#8230;as soon as possible calculate how many Morphs you want to be on the screen and respond to events (like changing a wire number). Then just crate that number of Morphs at random positions. !!! Be sure to use a throw away image !!!. Years ago I tried with 30000 points (EllipseMorphs) and a few thousand lines (PolygonMorphs) which rendered the image unresponsive. Computers and VM&#8217;s became faster but I assume there are still limits.</address>
<p> </p>
<p>So based on part of a sample electrical connection diagram&#8230;</p>
<div id="attachment_12" class="wp-caption aligncenter" style="width: 402px"><img class="size-full wp-image-12  " title="Sample Terminal Strip" src="http://blog.openinworld.com//wp-content/uploads/2011/03/Sample-Terminal-Strip.png" alt="" width="392" height="496" /><p class="wp-caption-text">Sample Terminal Strip</p></div>
<p>&#8230;my back of envelope calculation for the number of morphs is:<br />
1000 ==  2 x terminal strips x 100 terminals x 5 columns (core,ferrule,term,link,core)<br />
2400 == 2 x 100 terminals x 4 wires x 3 line segments (two wires per terminal per side)<br />
400 == wire cores identifiers<br />
20 == 20 x 1 cable label per each 20 core cable<br />
500 == miscellaneous border and drawing title info<br />
==&gt; ~4500.  Double it for safety ==&gt; ~10,000 morphs.  This is for an individual drawing.  For an industrial plant the number of drawings numbers in the thousands.</p>
<p>I developed the following code to show the performance of EllipseMorphs creation. I&#8217;ve used variables to contain blocks of code to make the main loop more concise.</p>
<pre>"Morphic Performance Testing v1"
rand := Random new.
creating := [
    m := EllipseMorph  new.
    m color: Color random.
    m position: ActiveWorld extent * ((rand next)@(rand next)).
    m openInWorld.
    m goBehind.
    "ActiveWorld doOneCycle."   ].
deleting := [ EllipseMorph allInstances do: [ :item | item delete ]].
hiding := [ EllipseMorph allInstances do: [ :item | item hide ]].
showing := [ EllipseMorph allInstances do: [ :item | item show ]].

#( 1 10  100 200 300 400 500 600 700 800 900 1000 2000
 3000 4000 5000 6000 7000 8000 9000 10000  )
do: [ :amount |
    createTime := [ amount timesRepeat: creating ] timeToRun.
    hideTime := [ hiding value ] timeToRun.
    showTime := [ showing value ] timeToRun.
    deleteTime := [ deleting value ] timeToRun.
    Transcript show:
       'amount=',       amount asString,
       ' createTime=',  createTime asString,
       ' hideTime=',    hideTime asString,
       ' showTime=',    showTime asString,
       ' deleteTime=',  deleteTime asString;  cr]</pre>
<div id="attachment_83" class="wp-caption aligncenter" style="width: 756px"><img class="size-full wp-image-83 " title="Morphic Performance Evaluation" src="http://blog.openinworld.com//wp-content/uploads/2011/03/MorphicPerfTest01B.png" alt="Morphic Performance Evaluation Graph" width="746" height="507" /><p class="wp-caption-text">Morphic Performance Evaluation &quot;v1&quot; code</p></div>
<p>These times were using vanilla <em><strong>Squeak 4.2 All-in-One.app</strong></em>.  Two morph creation times were considered.  A fresh image was unzipped for each run.</p>
<p>The first creation time <strong>createTime(gui lockup) </strong>was the result of the code executed exactly as above.  The creation of so many morphs did indeed lock up the GUI while the code was executing.  However after that the interactivity returned to normal. Any ellipse could be picked up and moved around with no perceptible delay.  (This of course required the delete block to be commented out so morphs remained to interact with.)</p>
<p>Up to a certain delay, that initial GUI lock up might be considered standard operation for a file load.  Interestingly, the <strong>deleteTime(gui lockup) </strong>for the morphs takes longer than creating them.  I am speculating that has something to do with required garbage collection.</p>
<p>It can be seen that <strong>hideTime </strong>and <strong>showTime </strong>are much faster than create and delete. An alternative to &#8220;loading&#8221; a file might be for the morphs to exist permanently in the image a hidden onscreen and just toggle their visibility.   I wonder about keeping a standard set of morphs onscreen and swapping out the underlying object model per drawing.  I&#8217;ll have to learn a bit more to decide how that might be best achieved.</p>
<p>The temporary gui lockup seemed due to the event processing loop not running.  This is common for long running calculations in a single threaded application.  The standard solution is to periodically invoke event processing from within the calculation.  Rummaging through the system code I found my way to &#8220;ActiveWorld doOneCycle.&#8221;  You can see this line commented out in the code above.  By uncommenting that line, interactivity during morph creation was absolutely perfect during morph creation! Not a hint of gui lockup!  However the trade-off was greatly increased overall <strong>createTime(doOneCycle)</strong>.  The original <strong>deleteTime(gui lockup)</strong> was no different from<strong> deleteTime(doOneCycle)</strong>, so only the first is shown.</p>
<p>Perhaps using doOneCycle that way is a bit naïve &#8211; I&#8217;m open to suggestions.  Some off the cuff alternatives are:</p>
<ol>
<li>Balance morph creation into batches.</li>
<li>See if Morphic can track the overall interactivity during any instance creation.</li>
<li>See if Morphic event checking can be timer interrupt driven.</li>
<li>Run the morph creation in another thread using &#8216;fork.&#8217; I had tried that however and the experience was a bit weird.</li>
</ol>
<p><span style="text-decoration: underline;"><em><strong>Update 18 March 2011</strong></em></span><br />
On [squeak-dev] Juan Vuletich wrote:  <em> </em></p>
<p style="padding-left: 30px;"><em>That code is good for benchmarking, but not for a real app. These minor tweaks allow opening a lot (really a lot) of morphs under one second.</em></p>
<pre style="padding-left: 30px;"><span style="color: #000000;">"Morphic Performance Testing v2"</span>
<span style="color: #000000;">rand := Random new.</span>
<span style="color: #000000;">creating :=
[</span><span style="color: #000000;">    m := EllipseMorph  new.</span>
  <span style="color: #ff0000;">ellipses add: m.</span>
<span style="color: #000000;">     m color: Color random.</span>
<span style="color: #000000;">     m position: ActiveWorld extent * ((rand next)@(rand next))</span>
<span style="color: #000000;">].</span>
<span style="color: #000000;">deleting := [ World removeAllMorphsIn: ellipses].</span>
<span style="color: #000000;">hiding := [</span> <span style="color: #ff0000;">ellipses </span><span style="color: #000000;">do: [ :item | item hide ] ].</span>
<span style="color: #000000;">showing := [</span> <span style="color: #ff0000;">ellipses </span><span style="color: #000000;">do: [ :item | item show ] ]. </span>

<span style="color: #000000;">Transcript show: 'Morphic Performance Test Code v3.0 - ##FLAVOUR## '; cr.
</span><span style="color: #000000;">Transcript show: 'amount, createTime, hideTime, showTime, deleteTime'; cr.</span>
<span style="color: #000000;">#( 1 10  100 200 300 400 500 600 700 800 900 1000 2000</span>
<span style="color: #000000;">3000 4000 5000 6000 7000 8000 9000 10000  30000 100000)</span>
<span style="color: #000000;">do: [ :amount |</span>
<span style="color: #ff0000;">         ellipses := OrderedCollection new. </span>
<span style="color: #000000;">         createTime := [ amount timesRepeat: creating. </span>
<span style="color: #ff0000;">                   World addAllMorphs: ellipses. </span>
<span style="color: #000000;">         ] timeToRun. </span>
    <span style="color: #000000;">hideTime := [ hiding value ] timeToRun.</span>
<span style="color: #000000;">    showTime := [ showing value ] timeToRun.</span>
<span style="color: #000000;">    deleteTime := [ deleting value ] timeToRun.</span>
<span style="color: #000000;">    Transcript show:</span> <span style="color: #000000;">amount</span><span style="color: #000000;"> </span><span style="color: #000000;">asString,          ', ', </span><span style="color: #000000;">
                     createTime </span><span style="color: #000000;">asString,    ', ', </span><span style="color: #000000;">
                     hideTime </span><span style="color: #000000;">asString,        ', ', </span><span style="color: #000000;">
                     showTime </span><span style="color: #000000;">asString,       ', ', </span>
          <span style="color: #000000;">deleteTime </span><span style="color: #000000;">asString; </span><span style="color: #000000;">    cr.</span><span style="color: #000000;">
]</span></pre>
<p> </p>
<div id="attachment_84" class="wp-caption aligncenter" style="width: 733px"><img class="size-full wp-image-84 " title="Morphic Performance Testing" src="http://blog.openinworld.com//wp-content/uploads/2011/03/MorphicPerfTest02B.png" alt="Morphic Performance Testing Graph" width="723" height="508" /><p class="wp-caption-text">Morphic Performance Testing &quot;v2&quot; Code</p></div>
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 3411px; width: 1px; height: 1px; overflow: hidden;">
<pre class="western">"Morphic Performance Testing v1"ss</pre>
</div>
<p>In fact, those tweaks enable dealing with an order of magnitude more morphs (thx Juan.)  The creation time for 10,000 morphs went from 10 seconds to 0.9 seconds.  Alternatively in 10 seconds, 90,000 more morphs can be created.  This is reflected in the updated graph below as <strong>createTime(addAllMorphs)</strong>.  Deletion of morphs is a massive two orders of magnitude faster, as seen by <strong>deleteTime(addAllMorphs)</strong>.  Can you see more?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.openinworld.com/2011/03/morphic-performance/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.030 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-22 00:22:40 -->

