tag:blogger.com,1999:blog-334380452024-03-13T23:43:45.219-07:00Matrex BlogBlog about Matrex and RowscopeAndrea Ferrandihttp://www.blogger.com/profile/12127633773772041446noreply@blogger.comBlogger95125tag:blogger.com,1999:blog-33438045.post-77340830832227670652012-01-14T03:59:00.001-08:002012-01-14T04:17:13.277-08:00Matrex 2.2 out<span><span style="font-size: 100%;">Finally relaeased Matrex 2.2.</span></span><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><br /></div><div><div><span>Matrex 2.2 adds 42 new functions in the standard package:</span></div><div><span><br /></span></div><div><span>sys.date.removetime</span></div><div><span>sys.date.subtract</span></div><div><span>sys.db.update</span></div><div><span>sys.standard.minmax.max</span></div><div><span>sys.standard.minmax.min</span></div><div><span>sys.standard.minmax.nthmax</span></div><div><span>sys.standard.minmax.nthmin</span></div><div><span>sys.standard.test.iseven</span></div><div><span>sys.standard.test.isodd</span></div><div><span>sys.standard.trigonometric.acosh</span></div><div><span>sys.standard.trigonometric.asinh</span></div><div><span>sys.standard.trigonometric.atanh</span></div><div><span>sys.standard.changebase</span></div><div><span>sys.standard.closesteven</span></div><div><span>sys.standard.closestodd</span></div><div><span>sys.standard.constant</span></div><div><span>sys.standard.constantas</span></div><div><span>sys.standard.factorial2</span></div><div><span>sys.standard.gcd</span></div><div><span>sys.standard.lcm</span></div><div><span>sys.standard.logbase</span></div><div><span>sys.string.chars.charstocodes</span></div><div><span>sys.string.chars.charstostring</span></div><div><span>sys.string.chars.codestochars</span></div><div><span>sys.string.chars.codestostring</span></div><div><span>sys.string.chars.stringtochars</span></div><div><span>sys.string.chars.stringtocodes</span></div><div><span>sys.string.regex.find</span></div><div><span>sys.string.regex.replace</span></div><div><span>sys.string.test.isboolean</span></div><div><span>sys.string.test.isdate</span></div><div><span>sys.string.test.isinteger</span></div><div><span>sys.string.test.isnumeric</span></div><div><span>sys.string.equalsignorecase</span></div><div><span>sys.string.find</span></div><div><span>sys.string.len</span></div><div><span>sys.string.repeat</span></div><div><span>sys.string.replace</span></div><div><span>sys.string.trimleft</span></div><div><span>sys.string.trimright</span></div><div><span>sys.string.uppercasefirst</span></div><div><span>sys.util.convertunit</span></div><div><span><br /></span></div><div><span>of them, very important are:</span></div><div><span><br /></span></div><div><span><b>sys.db.update </b> </span></div><div><span><br /></span></div><div><span>This is used to insert, update or delete data in a database.</span></div><div><span>It allows the classical database operation </span><span style="text-align: -webkit-auto; "><i>update row if it exists, otherwise insert a new one</i> , very useful when you want to store data from a spreadsheet.</span></div><div><span><br /></span></div><div><span><br /></span></div><div><span><b>sys.util.convertunit</b></span></div><div><span><br /></span></div><div><span>This used to convert data from </span><span style="text-align: -webkit-auto; ">a measurement unit to another.</span></div><div><span style="text-align: -webkit-auto; ">For example convert from watt to horsepower, liter to pint...</span></div><div style="text-align: -webkit-auto;"><br /></div><div style="text-align: -webkit-auto;">You can find more information in the <a href="http://matrex.sourceforge.net/templates.html">function templates list</a>.</div><div style="text-align: -webkit-auto;"><br /></div><div style="text-align: -webkit-auto;"><br /></div><div><span>Internally, Matrex uses now <a href="http://joda-time.sourceforge.net/">JodaTime</a> to handle dates. This allowed to write the </span><span style="text-align: -webkit-auto; "><b>sys.date.</b></span><span style="text-align: -webkit-auto; "><b>subtract</b> function, which is used to do dates subtraction.</span></div><div><span><br /></span></div><div><span>Matrex 2.2 needs Java 6 (jre 1.6) to run.</span></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; ">Here is the <a href="http://sourceforge.net/projects/matrex/files/Matrex/">download link</a>.</div></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; "><br /></div><div style="font-family: Georgia, serif; font-size: 100%; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; ">Thanks to Braxton for the MacOSX version.</div>Andrea Ferrandihttp://www.blogger.com/profile/12127633773772041446noreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-62573929082870159642011-08-22T13:09:00.000-07:002011-08-22T13:25:52.282-07:00New version of Matrex<div>I'm working on a new version of Matrex (2.2).</div><div>The purpose of this version is to <b>add functions</b> (formulas).</div><div>Matrex has already <a href="http://matrex.sourceforge.net/templates.html">all functions</a> needed for most users, but with this version I will add functions for specific niches (e.g. financial), functions that are secondary but needed (e.g. fact, log10) and more functions to access the databases.</div><div>Now I am preparing a list of all the new functions, as soon as I'm finished I will start the coding. As usual, help is welcome.</div><div>
<br /></div>Andrea Ferrandihttp://www.blogger.com/profile/12127633773772041446noreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-15853617913745401652011-06-08T13:58:00.000-07:002011-06-08T14:22:44.155-07:00Rowscope 1.1I updated <a href="http://rowscope.sourceforge.net">Rowscope</a>, that reaches version 1.1.<br /><br /><a href="http://3.bp.blogspot.com/-UPWn1pp3kpI/Te_jibEAiVI/AAAAAAAAACM/t_6_NEAIafw/s1600/rowscope.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 263px;" src="http://3.bp.blogspot.com/-UPWn1pp3kpI/Te_jibEAiVI/AAAAAAAAACM/t_6_NEAIafw/s400/rowscope.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5615957440873924946" /></a><br /><br />Rowscope fixes some problems of the previous version:<div><ol><li>It adds the <b>line numbers</b> column, which shows the line numbers of the displayed rows in the file.</li><li>It has a <b>more compact GUI</b> (the top menu has been moved on the right, the log is now displayed in a combo box). In this way it looks much better in Windows.</li><li>The buttons that are related to a single row (expand up/down, open a new tab from that row) are displayed <b>on the selected row</b>; no more need to move the mouse to expand a row.</li></ol>It also can use the <b><a href="http://gee.cs.oswego.edu/dl/papers/fj.pdf">fork-join framework</a></b> (Scala 2.9) to search text in the rows, making use of multiple cores. This can improve the performances, depending by the number of cores and their use.<br /><div><br /></div>Rowscope got also a better icon (the previous one was too simple and flat), code has been simplified and, when possible, tested.</div><div><br /></div><div><br /></div>Andrea Ferrandihttp://www.blogger.com/profile/12127633773772041446noreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-41640443905968937072011-04-09T02:18:00.000-07:002011-04-09T02:19:31.704-07:00Linux Magazine speaks about MatrexThe <a href="http://www.linux-magazine.com/w3/issue/125/092-094_projects.pdf">link</a>Andrea Ferrandihttp://www.blogger.com/profile/12127633773772041446noreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-10627936305658020992010-12-22T01:21:00.000-08:002010-12-22T02:03:38.491-08:00Matrex 2.1 released<div style="text-align: left;"><b>Matrex 2.1</b> has been released yesterday.</div><div><br /></div><div><a href="http://matrexblog.blogspot.com/2010/04/matrex-20-released.html">Version 2.0</a> was revolutionary because it introduced the concept of client/server; version 2.1 is more an evolution because its purpose is to help the user having <b>full control</b> on projects and on the system.</div><div><br /></div><div>In detail, these are the big changes:</div><div style="text-align: center;"><br /></div><div><ol><li>The <b>grid/tables</b> have now a<a href="http://matrexblog.blogspot.com/2010/08/swt-table-row-header.html"> real row header</a>, making easier to work with them and giving them a more professional look.</li><li>The <b>script editor</b>, which was very simple, has become a small but <a href="http://matrexblog.blogspot.com/2010/10/new-script-editor.html">complete IDE</a> to write and test scripts. With it the user can write its own functions and can test them before he uses them in his projects.</li><li>For someone that uses Matrex for the first time it is very important to find out immediately how it works. To make it possible, Matrex has now a <b>help button</b> in every window. Here is an example:<br /><br /></li></ol></div><div><img src="http://3.bp.blogspot.com/_YTA4McFPGSk/TRHKnOCfugI/AAAAAAAAABg/i8CUHfGI8do/s400/mx.JPG" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 179px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5553442590656805378" /></div><div>The other changes are less visible, but still important:</div><div style="text-align: center;"><br /></div><div><ol><li>Before 2.1 the user could change all the function templates, included the ones that come with the system. Now he can <b>only change templates written by users</b>.</li><li>Fixed permission problems in the installation under Windows, allowing to install under the <i>Program Files</i> directory.</li></ol></div><div>Thanks to Braxton for building the Matrex setup </div><div>file for MacOSX. Here is a screenshot of Matrex under MacOSX:</div><div><br /></div><div><img src="http://1.bp.blogspot.com/_YTA4McFPGSk/TRHL6ifjRvI/AAAAAAAAABo/tkGjqEZXrY0/s400/Screen%2Bshot%2B2010-12-18%2Bat%2B10.53.13%2BAM.png" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 250px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5553444022076524274" /></div><div>In the next version I will try to change the grid row header buttons under MacOSX to make them rectangular.</div><div style="text-align: center;"><br /></div><div style="text-align: left;">Matrex 2.1 is downloadable from <a href="http://sourceforge.net/projects/matrex/files/Matrex/2.1/">here</a>.</div><div style="text-align: left;"><br /></div><div><br /></div>Andrea Ferrandihttp://www.blogger.com/profile/12127633773772041446noreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-28445386078674870122010-10-24T08:18:00.000-07:002010-10-30T08:31:15.076-07:00The new script editorMatrex has always allowed to use a <b>script</b> language (Jython, Groovy, JRuby...) to <a href="http://matrex.sourceforge.net/doc/functioncoding.pdf">write the code</a> of the <a href="http://matrex.sourceforge.net/help/Concepts.html#function">functions</a>.<br />But until now the support was limited to the following functionalities:<div><ul><li>A button in the function <a href="http://matrex.sourceforge.net/help/TemplateEditor.html">template editor</a> to associate a script to a function template.</li><li>A simple editor to write the script.</li></ul>From <b>version 2.1</b>, Matrex will have a small <b>IDE</b> to write scripts:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_YTA4McFPGSk/TMwfR7w-clI/AAAAAAAAABU/SIJrWp-LD2E/s1600/editscript.jpeg"></a><div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_YTA4McFPGSk/TMwfR7w-clI/AAAAAAAAABU/SIJrWp-LD2E/s1600/editscript.jpeg"><img style="text-align: left;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; cursor: pointer; width: 400px; height: 370px; " src="http://4.bp.blogspot.com/_YTA4McFPGSk/TMwfR7w-clI/AAAAAAAAABU/SIJrWp-LD2E/s400/editscript.jpeg" border="0" alt="" id="BLOGGER_PHOTO_ID_5533832435092845138" /></a></div><br />The <a href="http://en.wikipedia.org/wiki/Integrated_development_environment">IDE</a> has:</div><div><ul><li>An editor with a simple but effective <b><a href="http://en.wikipedia.org/wiki/Syntax_highlighting">syntax highlighting</a></b>. For each script language defines its specific highlighting rules.</li><li>A <b>graphical test environment</b> that allows to set up input <a href="http://matrex.sourceforge.net/help/Concepts.html#matrix">matrices</a> and <a href="http://matrex.sourceforge.net/help/Concepts.html#parameters">parameters</a>, with their content, and output matrices of the script. Once the matrices are set, the script can be <b>executed</b> and the result of the script can be checked in the output matrices.</li></ul><div>In this way it is possible to edit the script and test it before it gets use as a Matrex function.</div></div>Andrea Ferrandihttp://www.blogger.com/profile/12127633773772041446noreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-12205634613039958632010-09-04T09:13:00.000-07:002010-09-04T09:53:16.871-07:00Matrex 2.1: statusI am working on version 2.1 of Matrex .<div>The work on <a href="http://matrexblog.blogspot.com/2010/04/matrex-20-released.html">version 2.0</a> has been completely dedicated to the conversion of Matrex from a pure standalone to a <b>standalone + client/server</b> architecture, so I had to postpone some improvements to the GUI and the implementation of new functions.</div><div>Now I can finally work to implement these changes. </div><div>The planned changes for version 2.1 are the following:</div><div><ul><li>Conversion of all the grid/tables (editors/viewers) so that they use the new <a href="http://matrexblog.blogspot.com/2010/08/swt-table-row-header.html"><b>table row header</b></a>, which has shown to work without glitches and to be extremely efficient, even with large matrices and <a href="http://matrexblog.blogspot.com/2006/08/virtual-tables.html">virtual tables</a>. <i>Already implemented</i>.</li><li>New <b>Help</b> button in every window/dialog. <i>Already implemented</i>.</li><li>Conversion of the script editor to a simple <b>script IDE</b>, which allows to <b>test</b> the function scripts before they are added to the system, and has simple <b>syntax coloring</b>. <i>Working on it</i>.</li><li>Add several <b>new functions</b>. I think Matrex has already all the functions needed by most of the people, but I think more specialized functions are need, so that every kind of user has what he needs. <i>Will start soon</i>.</li></ul></div><div>This is the plan, but probably some more feature will be added to version 2.1. See the <a href="http://sourceforge.net/apps/trac/matrex/report/1">active tickets</a>.</div><div>You can have a snapshot of version 2.1 from the <a href="http://sourceforge.net/scm/?type=svn&group_id=133398">subversion repository</a>, which should always contain a working version.</div><div>If you want to help, you are <a href="http://sourceforge.net/project/memberlist.php?group_id=133398">welcome to join the project</a>.</div><div><br /></div>Andrea Ferrandihttp://www.blogger.com/profile/12127633773772041446noreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-57762389876123501392010-08-03T02:57:00.000-07:002010-08-04T02:47:18.722-07:00SWT Table: row header<div style="text-align: left;">I always used the <a href="http://www.eclipse.org/swt/widgets/">SWT Table</a> as grid component for my project <a href="http://matrex.sourceforge.net/">Matrex</a>.</div><div>The problem of this grid component is that <a href="http://matrexblog.blogspot.com/2006/09/swt-table-vertical-header_115927127189610449.html">it does not have a row header</a>; and this is a real problem for an application like Matrex, that is an alternative to spreadsheet applications.</div><div>There are<a href="http://stackoverflow.com/questions/115766/a-more-advanced-table-spreadsheet-swt-implementation"> alternatives</a> to the SWT Table that have a row header, but even if some of them are very good I personally prefer to use the original SWT Table.</div><div>So I tried the fixed <a href="http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet234.java">first column horizontal scroll remaining columns</a> SWT snippet, where the row header consists in <b>a second SWT Table</b> with only one column, syncronized with the main table.</div><div>This solution works fine in Windows, but has the following disadvantages:</div><div><ul><li>In Gnome/Linux scrolling the table up and down the <b>first row can be partially hidden</b> by the column header. This is not handled by the snippet, therefore from time to time the row header appears not synchronized with the table.</li><li>The cells of the row header table are <b>normal cells</b>, not header cells (3D gray-button look). This can be <a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet126.java?view=co">fixed</a>, but it looks like for a table of 10000 rows you need to create 10000 buttons!</li></ul><div>So I have found a different solution, which uses a separate control for the row header, like in the snippet.</div></div><div>The row header control is a panel containing a vertical set of buttons, one for each <b>visible</b> row of the table.</div><div>You can see the panel on the left in the following picture (which is based on the SWT snippet <a href="http://dev.eclipse.org/viewcvs/index.cgi/~checkout~/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet38.java">create a table (columns, headers, lines)</a>) :</div><div><br /></div><img src="http://3.bp.blogspot.com/_UV8bHZTOgQE/TFiKgL1U1uI/AAAAAAAAAKk/LnmOfV2NHqM/s400/screenshot_045.png" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 168px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5501299230369961698" /><div><br /></div><div>In the picture, each button shows the index of the related row.</div><div>When the user <b>scrolls</b> the table vertically, the buttons texts change accordingly.</div><div>If part of the row is <b>partially hidden</b> by the column header, like in the picture, the related button is also partially hidden. </div><div>If the <b>horizontal scrollbar</b> appears, the row header changes its size accordingly.</div><div>In synthesis, the row header is <b>always synchronized</b> with the table.</div><div><br /></div><div>You can see a demo of the row header in this <a href="http://www.screentoaster.com/watch/stUEtVREJARFtXQFVbWFJdXlVQ/swt_table_row_header">video</a>.</div><div><br /></div><div>The <b>table row header</b> is just a <a href="http://matrex.svn.sourceforge.net/viewvc/matrex/trunk/matrex/matrex/gui/util/TableRowHeader.java?revision=453&view=markup">single class</a>, that can be tested using <a href="http://matrex.svn.sourceforge.net/viewvc/matrex/trunk/matrex/matrex/gui/util/TestTableRowHeader.java?revision=453&view=markup">this test class</a>.</div><div><br /></div><div>The only complicated part of the class is the function <b>getOffset</b>, which solves the problem of the "partially hidden first row", returning the part of the first row that is hidden.</div><div>It uses the SWT Table function table.getItem([point]), which returns the row at the given point.</div><div>With this function it can know where is the limit between the first and second row, and therefore when the first row finishes. Knowing the height of each row (table.getItemHeigh), it calculates which part of the row is hidden.</div><div><br /></div><div>I tested it with Windows and Linux (Ubuntu) and it<b> works fine</b>. It could be nice if someone can test it on MacOSX. There should be no problem, since it uses only documented functions in a standard way.</div><div>I will use it on all tables of the <a href="http://matrex.sourceforge.net/">Matrex</a> project.</div><div><br /></div><div><br /></div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-84439581160838413162010-07-30T07:47:00.000-07:002010-07-31T02:41:53.194-07:00Rowscope: view large files<div style="text-align: center;"><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_UV8bHZTOgQE/TFPu2n9ImQI/AAAAAAAAAKc/N0rzKeSOyME/s1600/rowscope.png"></a>I had a problem in the office: I had a server application that was generating a<b> large log file</b> every day (between 100 Megabytes and 1 Gigabytes) and, if something went wrong with the application, viewing this log file was very difficult.<div>I tried several file viewers, but <b>none of them worked</b> well for me. Some of them did not show the entire row, some of them did not show all rows, some of them was slow when searching.</div><div>So, I went back to use notepad, which worked generally very well, but used too many resources and when the file was over the 300/400 Megabytes it was using the whole CPU and memory of the server.</div><div><br /></div><div>So I have decided to write a file viewer and to write it in <a href="http://www.scala-lang.org/">Scala</a>, also because I wanted to try this language. The new file viewer, called <a href="http://rowscope.sourceforge.net/">Rowscope</a>, had to be <b>lightweight</b> and <b>fast</b>.</div><div>For this purpose, I used a <b>trick</b>. Instead of viewing the file and then search strings in it, the user must <b>first enter the search string</b>, then when he opens the file what he sees are <b>the rows resulting from the search</b>.</div><div>Then he can look <b>what's around</b> one or more of the found rows.</div><div><br /></div><div>In this way, if the search string is good enough, the viewer <b>shows only a few rows</b> and therefore uses a limited amount of memory. Clearly it reads all rows, but if they don't match the search string they are <b>discarded immediately</b> and then garbage collected.</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "><img src="http://4.bp.blogspot.com/_UV8bHZTOgQE/TFPu2n9ImQI/AAAAAAAAAKc/N0rzKeSOyME/s400/rowscope.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5500002192155252994" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 263px; " /></span></div><div><br /></div><div>To avoid that the GUI blocks Rowscope uses multiple threads in a pipe (<a href="http://www.scala-lang.org/node/242">Scala actors</a>) to do the real work, and the rows are passed to the <b>GUI thread only when they need to be displayed</b>.</div><div>With the correct <b>settings</b> for each actor (how many rows to read from the file before they get sent to the other actors, how many rows to send from one actor to the other in one shot), the application uses the correct amount of CPU and memory and remains reactive to the user input.</div><div><br /></div><div>I was a little scared when I started to use it at work. Yes, theoretically it should work, but will I use it just because I wrote it or because it really works?</div><div>I can say that now I use it without even thinking I am doing it, like all the other tools I use in my daily job. The <b>first search then view</b> approach works. </div><div>If I don't know what to search I start it with an empty search string, just to have an idea of what the file contains. Rowscope shows only the first 1000 lines of the file. From this I find a good search string and I start to work.</div><div><br /></div><div>I'm preparing a new version of Rowscope. If you miss some feature or have some good idea, please let me know.</div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-3324449739327796042010-04-20T11:52:00.000-07:002010-04-20T12:25:00.187-07:00Matrex 2.0 released<div style="text-align: left;">Finally the version 2.0 of Matrex has been released.</div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "><span><span></span></span></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "><span><span></span></span><span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "><img src="http://4.bp.blogspot.com/_UV8bHZTOgQE/S83_YNnkyBI/AAAAAAAAAKU/f2IbH-qAZTk/s400/clientserver.jpeg" border="0" alt="" id="BLOGGER_PHOTO_ID_5462302714507872274" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 317px; " /></span></span></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "><span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; "><br /></span></span></div><div><br /></div><div>The big change is the new optional <a href="http://matrex.sourceforge.net/details_clientserver.html">client/server architecture</a> that allows several users to work together on a project or for a user to delegate the calculations to a server (in the picture we see 3 Matrex Desktops sharing a project on a server run in the same PC).</div><div>We already told everything about this feature in the previous articles in this blog (read for example the <a href="http://matrexblog.blogspot.com/2009/09/matrex-20-is-not-just-specification.html">article</a> showing the steps to follow to connect to a server).</div><div><br /></div><div>But we have other changes that are really useful.</div><div><br /></div><div>First of all, <b>Matrex does not need a batch file</b> to start anymore. Just double-click on the <b>matrex_start.jar</b> file and Matrex starts (if java is configured correctly). </div><div>This also removes the shell/command line that was always starting together with the GUI, making the application look unprofessional.</div><div><br /></div><div>Second, Matrex gets installed on MacOSX as an<b> application bundle</b> (packaged by Braxton), that's why its name is terminating with .app.dmg.</div><div>Unfortunately the application bundle can only be installed on MacOSX 64 bits. </div><div><br /></div><div><span class="Apple-style-span" style="font-family:georgia, times, 'times new roman', serif;"><span class="Apple-style-span" style="font-family:Georgia, serif;"><div>For the 32 bits version of MacOSX (Java 5) you will need to install the generic version, then, using a shell, go to the top Matrex directory, run:</div><div><br /></div><div>java -XstartOnFirstThread -jar Java/matrex_start.jar</div><div><br /></div><div>and follow the instructions to install the GUI library (check also the F.A.Q. about this).</div><div><br /></div></span></span></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-86222163752445477792010-04-14T10:32:00.000-07:002010-04-14T10:40:01.955-07:00Screencast: connect to serverI was not able to publish Matrex 2.0 until now, because the test took more time than I thought initially and because Braxton and me are trying to make it installable on MacOSX using an application bundle.<div>Hopefully in a few day the new version will be published.<br /><div>Anyway, I made a screencast, published on ScreenToaster, on how to connect Matrex to a server on the same PC:</div></div><div><br /><object id="stUEtVREJARFtYQV9aXlJQVFBd" width="425" height="344" type="application/x-shockwave-flash" data="http://www.screentoaster.com/swf/STPlayer.swf" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0"><param name="movie" value="http://www.screentoaster.com/swf/STPlayer.swf"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><param name="flashvars" value="video=stUEtVREJARFtYQV9aXlJQVFBd"></object><div style="width: 425px; text-align: right;"><a href="http://www.screentoaster.com/">Screencasts and videos online</a></div><br /></div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-36052720898972112082010-03-03T12:40:00.000-08:002010-03-03T13:25:34.456-08:00Matrex 2.0 Beta releasedA beta of the <a href="http://matrexblog.blogspot.com/2009/09/matrex-20-is-not-just-specification.html">client/server version</a> of Matrex, 2.0, has been released.<div>The plan is to release the final version in a pair of weeks, so please test it!</div><div>To test the client/server connection:</div><div><ul><li><b>Install</b> <a href="https://sourceforge.net/projects/matrex/files/">Matrex 2.0 beta</a>.</li><li>Follow the instructions contained in the <a href="http://matrex.sourceforge.net/doc/server.pdf">server document</a> (which is included in the installed documents) to install the <b>Matrex Server</b> and start it.</li><li>Start <b>Matrex Desktop</b> and connect to the server following the <i>Remote Projects </i>section of the help content (press Ctrl-F1 in the Matrex Desktop).</li><li>Create a project on the server or copy a local project to the server, as described in the help content, and <b>play with it</b>.</li></ul><div>If something is not clear, please <a href="http://matrex.sourceforge.net/bugs.shtml">contact me</a>.</div><div>If you find bugs please report them in the <a href="https://sourceforge.net/tracker/?group_id=133398">trackers</a>.</div></div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-51759803744256262912010-01-03T13:17:00.000-08:002010-01-03T14:09:30.565-08:00Matrex 2.0: project integrity in a multi-user systemNow it is a long time the alpha version of Matrex 2.0 was published, but a beta is still not available. The reason is that the task to make the core objects (project, matrix, function...) thread safe is complex.<div>Until now Matrex was a <b>single-user</b> system. That does not guarantee against <b>concurrency problems</b>, but makes certainly things easier than on a <b>multi-user</b> system, like Matrex 2.0. In Matrex 2.0 a function or chart or presentation can potentially be changed by multiple users in the same time, which can lead to unpredictable results.</div><div>To avoid this, the work I'm doing now is to make the <b>project object</b> not only a repository of its items (matrices, functions...) but to give it the <b>responsibility</b> of its own integrity, and to this, the complete responsibility of adding, updating and deleting items. </div><div><br /></div><div>In Matrex 2.0 the chart editor, for example, is not able to update a chart object directly. It <b>tells the project how to change</b> the chart object, and the project changes it, after it checked that the change is possible and does not break its own <b>integrity</b>: charts are dependent by matrices and it could be possible that the change involves adding a matrix to it that during the chart editing gets deleted by a different user; in this case the project <b>rejects</b> the update, the chart does not get change and the editor gets an error.</div><div>The project's methods are <b>guarded</b>, so that it is impossible to do incompatible changes in the same time. For example it is not possible to delete a matrix in the same time a chart is updated.</div><div><br /></div><div>In other words the project in Matrex 2.0 looks a lot like an SQL server with transactions. The SQL server makes sure two SQL updates cannot take place on the same rows of a table in the same time and an SQL update (or a group of them) can be integrally rejected (rollback) if something goes wrong, leaving the database as it was.</div><div><div><br /></div><div><div>A side effect of these changes is that, since everything is done through the project, the items become more or less <b>read-only</b> for the editors and the rest of the GUI, simplifying the system.</div><div><br /></div><div>In terms of <b>performance</b> these changes should be in-influent. What is important for the system performance are not the items editing, but the matrices calculations that derive from it, which are much more complex and CPU consuming.</div><div><br /></div></div><div>I'm now in the middle of the work of changing project, items, editors to make them work in this way. As soon as I am finished I will publish a beta.</div><div><br /></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-65812935890166294172009-10-27T06:37:00.000-07:002009-10-29T14:20:55.742-07:00CSV files again<div style="text-align: center;"><br /></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_UV8bHZTOgQE/SuoFAfiLTyI/AAAAAAAAAJo/dbSU0x8r_ec/s1600-h/csvimport.png"></a>The <a href="http://matrexblog.blogspot.com/2009/10/matrex-20-alpha.html">alpha release</a> of Matrex 2.0 solves the problem I reported about <a href="http://matrexblog.blogspot.com/2009/10/large-csv-files.html">importing large CSV files</a>.<div><br /><div>Already in the previous versions Matrex used a<a href="http://matrexblog.blogspot.com/2006/08/virtual-tables.html"> virtual table</a> to show the imported CSV files; this means the table (grid) loads from the memory <b>only the rows</b> that it needs to display.</div><div>The next step was simple: in version 2.0 <b>the file is not even loaded in memory</b>; only the rows that are displayed are actually loaded from the file.</div><div>In this way the memory used to import the CSV file decreased dramatically compared to the previous versions of Matrex.</div><div>To avoid performance losses with this new version, Matrex keeps a <b>cache</b> of 2000 rows from the file (the 2000 rows around the last row loaded from the file); in this way scrolling the table up and down is still fluid.</div><div>The following picture shows the 3 levels of the CSV file import: file, memory cache, table.</div><div><br /></div><div><br /></div><div><span class="Apple-style-span" style="color: rgb(0, 0, 238); -webkit-text-decorations-in-effect: underline; "><img src="http://1.bp.blogspot.com/_UV8bHZTOgQE/SuoFAfiLTyI/AAAAAAAAAJo/dbSU0x8r_ec/s320/csvimport.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5398132609379946274" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 286px; " /></span></div><div><br /></div><div><br /></div><div>If the table is scrolled a lot up and down it can still be that many rows are loaded in memory, and released immediately after; to avoid memory losses because of this, Matrex calls directly the <b>garbage collector</b> every 50000 rows loaded.</div><div>In this way it was possible to import data from the 22 MBytes CSV file for which the memory problem was reported, running Matrex without any special memory option.</div><div><br /></div><div>This fix will be part of version 2.0, but I also <b>back-ported it to version 1.3.8</b>, which will be published in a few days.</div><div><br /></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-40702330280061192172009-10-14T21:33:00.000-07:002009-10-22T13:55:10.580-07:00Matrex 2.0 alphaI published an <b>alpha</b> (unstable) version of the new <a href="http://matrexblog.blogspot.com/2009/07/working-on-clientserver.html">Matrex 2.0</a>, which adds the possibility to use Matrex as a <b>client/server</b> system.<div>You can download it from <a href="http://matrex.sourceforge.net/matrex_2_0_alpha_generic.jar">here</a>.</div><div>To test it as a client/server system:</div><div><ul><li><a href="http://matrex.sourceforge.net/quickstart.shtml">Install</a> this version of Matrex. It is a <a href="http://matrex.sourceforge.net/faq.shtml">generic</a> version, so remember that when you start it the first time it will download the graphical library SWT. Only the second time you start it it will really start.</li><li>Install the Matrex Server. The setup file is in the Matrex directory, called <b>matrex_server_2_0.jar</b>.</li><li>Execute <b><a href="http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/rmiregistry.html">rmiregistry</a></b>. It is the RMI registry server (Matrex Desktop and Server use RMI to communicate). It is part of the Java Runtime Environment (JRE).</li><li>In the Matrex Server directory, execute <b>matrex_server.bat</b> (Windows) or <b>matrex_server.sh</b> (Linux, MacOSX...) to start the server. Check that there are no errors.</li><li>In the Matrex directory start Matrex.</li><li>Follow <a href="http://matrexblog.blogspot.com/2009/09/matrex-20-is-not-just-specification.html">this</a> to let Matrex open a server project.</li></ul><div>You can login as guest (password guest).</div><div>If you want to login as a different user, you need to change the <b>config/accounts.xml</b> file in the Matrex Server directory, adding an account element with the userid and password, always setting the encrypted attribute to false.</div><div><div><br /></div><div>To become final release, Matrex 2.0 needs the following changes:</div><div><ul><li>Fix potential issues when a single project in one server is opened <b>concurrently</b> by several users.</li><li>Some operations, like adding functions or functions expression (<a href="http://matrex.sourceforge.net/help/ExpressionParser.html">expression parser</a>) cause the addition or update of several items in the project. Therefore these operations must be done atomically, possibly using some kind of <b>transaction</b>.</li><li>Check that the <b>resources</b> allocated to a client in the server are cleaned up correctly when the client disconnects.</li></ul><div>If you find problems with this alpha version, please add a comment to this article.</div></div></div></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-78280372232764873842009-10-05T12:05:00.000-07:002009-10-09T13:27:01.779-07:00Large CSV filesA <a href="http://sourceforge.net/tracker/?func=detail&aid=2854282&group_id=133398&atid=727065">bug</a> submitted the last month was showing that Matrex needs a lot of memory when i<a href="http://matrex.sourceforge.net/help/ImportDialog.html">mporting large CSV files</a>.<div>The CSV file mentioned in the bug has a size of <b>22 MBytes</b>. </div><div>The file contains around 200000 lines. Each line has 14 fields and is around 100 characters long.</div><div><br /></div><div>To import this file the memory used by the Matrex process increases of <b>300 MBytes</b>.</div><div>The CSV file is large but it does not justify so much RAM to handle it.</div><div><br /></div><div>I checked the code that imports CSV files in Matrex; nothing is wrong.</div><div>Matrex uses the <a href="http://sourceforge.net/projects/javacsv/">Java CSV library</a> to read CSV files, which works fine.</div><div><br /></div><div>The file is loaeded in memory row after row. </div><div>I checked how much memory is used for each loaded row. This is not easy in Java, since nothing similar to a <b>sizeof</b> function exists in the standard libraries. But I have found the <a href="http://code.google.com/p/javabi-sizeof/">Javabi library</a>, which is able to measure the amount of memory used in total by a java object.</div><div>Each row with its <b>fields</b> is handled as an array of <b>strings</b>, which uses around 800 bytes, <b>8 times the original row's size</b>.</div><div>This is because:</div><div><ul><li>Java strings use <a href="http://leepoint.net/notes-java/data/basic_types/characters/unicode.html">Unicode</a>, which means that they use 2 bytes for each character</li><li>Strings use <a href="http://www.javamex.com/tutorials/memory/string_memory_usage.shtml">additional memory</a> for their fields and their fields alignments</li></ul><div>800 bytes * 200000 rows = ~160 MBytes.</div><div><br /></div><div>As far as I understood the rest of the memory used to import the file is allocated to the intermediate strings that the CSV reader uses to read the file, and that remain allocated until the garbage collector frees them.</div><div><br /></div><div>There are some solutions that could be applied to reduce the memory use:</div><div><ol><li><b>Avoid loading all rows of the CSV file in memory</b>: in other words, make the import editor extract the displayed lines directly from the file, and let it extract the lines only when they are actually displayed.<br />I'm not sure about the effectiveness of this solution, because in general the user wants to import to a matrix an entire column of the file. Therefore the file, sooner or later, has to be read entirely.<br />Another problem with this solution is that the Java CSV library, as far as I understood, does not allow to count the number of rows without reading them and does not allow to jump between rows without reading all the intermediate rows.<br /><br /></li><li><b>Read less fields:</b> immediately at the start of the import process give the possibility to the user to discard some fields, so that they are not loaded in the import dialog.<br />This can work, but I am not sure that it can dramatically reduce the amount of memory used to load the file.<br /><br /></li><li><b>Optimize the reading process so that it uses less memory</b>: this means to look for an alternative to the Java CSV library that uses less memory to read the files (for example using <a href="http://www.ermalaev.spb.ru/javase/6/docs/api/java/lang/CharSequence.html">CharSequence</a> objects that use less memory). There are alternative libraries, for example <a href="http://opencsv.sourceforge.net/">opencsv</a> and the <a href="http://ostermiller.org/utils/CSV.html">Ostermiller utilities</a>. They need to be tested and see if they are better than the Java CSV library to reduce the used memory.</li></ol><div>I will try to apply these solutions and explain, in one of the next articles, what has been done.</div></div></div><div> </div><div><br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-91625018545678711772009-09-17T12:25:00.000-07:002009-09-17T13:20:16.436-07:00Matrex 2.0 is not just a specification anymoreAfter more than two months of work I was able in these days to let Matrex open a project in a Matrex server.<br />This is how it works:<br /><br />In Matrex click on the menu <span style="font-weight: bold;">File->Connect</span>. The following dialog appears:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_UV8bHZTOgQE/SrKR2p9YbQI/AAAAAAAAAIQ/Tphl4W4VE30/s1600-h/connect.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 161px;" src="http://3.bp.blogspot.com/_UV8bHZTOgQE/SrKR2p9YbQI/AAAAAAAAAIQ/Tphl4W4VE30/s320/connect.jpeg" alt="" id="BLOGGER_PHOTO_ID_5382524872823434498" border="0" /></a><br />In this case the server is on my PC, the same one in which I run Matrex, so I write localhost as server address.<br />Clicking on <span style="font-weight: bold;">Names</span>, the <span style="font-weight: bold;">Matrex Server</span> combo box is populated with the list of available servers in the PC with the given address.<br />In my case there is only one server, default.<br />I press OK. The <span style="font-weight: bold;">login dialog</span> appears:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_UV8bHZTOgQE/SrKTCJXWk7I/AAAAAAAAAIY/KqTVm9IJbWs/s1600-h/login.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 228px; height: 242px;" src="http://3.bp.blogspot.com/_UV8bHZTOgQE/SrKTCJXWk7I/AAAAAAAAAIY/KqTVm9IJbWs/s320/login.jpeg" alt="" id="BLOGGER_PHOTO_ID_5382526169744053170" border="0" /></a><br /><span style="font-weight: bold;">Guest</span> is the default user, with password guest. It is the user that is available by default in the server, if it has not been configured.<br />I write user id and password and press OK.<br />The <span style="font-weight: bold;">remote machine tab</span> for the localhost server appears, beside the local machine:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_UV8bHZTOgQE/SrKWY6pmaBI/AAAAAAAAAIg/6OndGKUqa8k/s1600-h/remotemachine.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 256px; height: 121px;" src="http://2.bp.blogspot.com/_UV8bHZTOgQE/SrKWY6pmaBI/AAAAAAAAAIg/6OndGKUqa8k/s320/remotemachine.jpeg" alt="" id="BLOGGER_PHOTO_ID_5382529859465930770" border="0" /></a><br />In the machine menu I click on Open Project. The <span style="font-weight: bold;">Open Remote Project</span> dialog appears:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_UV8bHZTOgQE/SrKW0HYKWVI/AAAAAAAAAIo/pE1auynuZew/s1600-h/openremoteproject.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 246px; height: 320px;" src="http://3.bp.blogspot.com/_UV8bHZTOgQE/SrKW0HYKWVI/AAAAAAAAAIo/pE1auynuZew/s320/openremoteproject.jpeg" alt="" id="BLOGGER_PHOTO_ID_5382530326738917714" border="0" /></a><br />Differently from the local projects there is only the possibility to choose in a <span style="font-weight: bold;">list of projects</span>. In facts on the server side the projects are all under the same directory, <span style="font-style: italic;">projects</span>.<br />I select the example project <span style="font-style: italic;">popcolorado</span> and the project opens:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_UV8bHZTOgQE/SrKXiXf16YI/AAAAAAAAAIw/FmsQqi5lwao/s1600-h/remoteproject.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 268px; height: 320px;" src="http://3.bp.blogspot.com/_UV8bHZTOgQE/SrKXiXf16YI/AAAAAAAAAIw/FmsQqi5lwao/s320/remoteproject.jpeg" alt="" id="BLOGGER_PHOTO_ID_5382531121340082562" border="0" /></a><br /><br />By now I checked that it is possible to open matrix and functions viewers and editors.<br />In the next days I will check all the project's functionalities.<br />As usual, the sources for the last version of Matrex are under the Matrex subversion <a href="http://sourceforge.net/scm/?type=svn&group_id=133398">repository</a>.<br /><br />As soon as I have a version that is tested enough, I'll publish it as a pre-alpha.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-77111937363458972312009-08-24T21:30:00.000-07:002009-08-24T21:51:10.881-07:00Matrex 1.3.7I released version 1.3.7, which fixes the bug reported as a comment to <a href="http://matrexblog.blogspot.com/2009/06/matrex-136.html">the Matrex 1.3.6 blog entry</a>, and that I entered in the <a href="http://sourceforge.net/tracker/?func=detail&aid=2832236&group_id=133398&atid=727065">Matrex bug tracker</a>:<br /><br /><blockquote style="color: rgb(0, 0, 102);">Matrex seems to forget the Project settings (threading, etc.) after a restart;</blockquote><br />This was caused by Matrex not being able to overwrite the project file.<br />The files are the following (in alphabetic order):<br /><br /><a href="http://sourceforge.net/projects/matrex/files/Matrex/1.3.7/matrex_1_3_7_generic.jar/download">matrex_1_3_7_generic.jar</a> for any platform<br /><a href="http://sourceforge.net/projects/matrex/files/Matrex/1.3.7/matrex_1_3_7_linux_gtk.jar/download">matrex_1_3_7_linux_gtk.jar</a> for Linux<br /><a href="http://sourceforge.net/projects/matrex/files/Matrex/1.3.7/matrex_1_3_7_macosx_32.jar/download">matrex_1_3_7_macosx_32.jar</a> for MacOSX with 32 bits Java (Java 5)<br /><a href="http://sourceforge.net/projects/matrex/files/Matrex/1.3.7/matrex_1_3_7_macosx_64.jar/download">matrex_1_3_7_macosx_64.jar</a> for MacOSX with 64 bits Java (Java 6)<br /><a href="http://sourceforge.net/projects/matrex/files/Matrex/1.3.7/matrex_1_3_7_win32.jar/download">matrex_1_3_7_win32.jar</a> for Windows<br /><br />The bug has also been fixed in the code of the next release, <a href="http://matrexblog.blogspot.com/2009/07/working-on-clientserver.html">2.0</a>.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-32948023995310257452009-08-08T04:40:00.001-07:002009-08-16T12:54:16.921-07:00Client/Server: technical viewAs told in the previous <a href="http://matrexblog.blogspot.com/2009/07/working-on-clientserver.html">article,</a> I'm changing Matrex from a pure <span style="font-weight: bold;">standalone</span> desktop application to an application that allows to work standalone or in a <span style="font-weight: bold;">client/server</span> architecture.<br />To support the client/server architecture I use the <a href="http://en.wikipedia.org/wiki/Java_remote_method_invocation">RMI protocol</a>.<br /><br />This means that the <span style="font-weight: bold;">calculation engine</span>, the one that calculates the functions and therefore generates the content of matrices, presentations, charts, will be both in the desktop application and in the server.<br />For this reason, the GUI has to use <span style="font-weight: bold;">in the same way</span> the objects involved in the calculation (projects, matrices, functions...) , whether they are on the client side or on the server side.<br />To do this, the original calculation objects (projects, matrices functions,...) are wrapped in two different new categories of objects: <span style="font-weight: bold;">Local</span> (client) and <span style="font-weight: bold;">Server</span>:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_UV8bHZTOgQE/SohbGBaAfSI/AAAAAAAAAII/9uHXyBLE5vc/s1600-h/clientserver.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 266px; height: 320px;" src="http://3.bp.blogspot.com/_UV8bHZTOgQE/SohbGBaAfSI/AAAAAAAAAII/9uHXyBLE5vc/s320/clientserver.png" alt="" id="BLOGGER_PHOTO_ID_5370642714654178594" border="0" /></a><br /><br />Both the wrappers, share the same remote interface (which extends the RMI's Remote interface).<br /><br />The reasons I use wrappers instead of the original objectts is because all the methods of a RMI business object must throw the <span style="font-weight: bold;">RemoteException</span> exception.<br />RemoteException is needed to understand when the server is down or there are problems of connection, so I would never do without it.<br />On the other side, it becomes <span style="font-weight: bold;">annoying</span> to catch it every time some code calls a method of a business object, so I want to do it only when it is strictly needed.<br />So I use the wrappers only in the GUI, where it is needed. Instead the calculation engine uses the original objects.<br /><br />Now, why Local and Server wrappers? Why not use only Server wrappers, both on the server and on the client side?<br />There are several reasons:<br /><ul><li>Server machines and projects have <span style="font-weight: bold;">slight different interfaces</span> when they are on the client and on the server side, mainly because projects on the server side can only be saved in a specific directory, projects on the client side can be saved in any directory of the disk.</li><li>The server wrappers extends the <span style="font-weight: bold;">UnicastRemoteObject</span>, local wrappers don't. I don't really understand completely how the Java compiler and RMI compiler handle these objects, so I cannot be sure that they don't have some effects on the application's performance. If these <span style="font-weight: bold;">performance effects</span> are needed with the server business objects, I don't want them on the local objects.</li></ul>And why I did not use the original classes instead of the Local wrappers? Because I needed a special wrapper for the Matrix class when it is used in the GUI, and only when used in the GUI, called <span style="font-weight: bold;">SafeMatrix</span>, which makes the Matrix methods thread safe.<br />But this means that all the other calculation classes need to have parameters of type SafeMatrix when called by the GUI, and instead use parameters of type Matrix when called by the calculation engine. And this means that I need special wrappers that use SafeMatrex parameters, the <span style="font-weight: bold;">Local</span> wrappers.<br /><br /><br />So, now I'm working on it. I will take some time, because in the GUI all the references to the original objects must be changed to the new remote interfaces.<br />Which means:<br /><ul><li>remote exceptions to handle.</li><li>utility functions to convert the original classes to the wrappers.<br /></li><li>some code duplication.</li><li>many wrappers to write, expecially for the charts, for which there is one class for each chart type.</li></ul>Also, I expect to reduce the number of methods in the calculation classes to reduce the number of remote calls.<br /><br />When I have something that more or less works I'll publish it as an <span style="font-weight: bold;">alpha version</span>.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-9536320187220123832009-07-22T10:38:00.000-07:002009-07-22T13:11:17.342-07:00Working on client/serverI started to work on the <span style="font-weight: bold;">client/server</span> version of Matrex, the 2.0.<br /><br />This version, as explained in the <a href="http://matrex.sourceforge.net/doc/clientserver.pdf">specification</a>, will give the possibility to use Matrex in two ways:<br /><ul><li><span style="font-weight: bold;">standalone</span>, as today<br /></li><li><span style="font-weight: bold;">connected</span> to one or more Matrex servers.</li></ul>When Matrex opens a project in a server, all calculations for that project are done in the server: Matrex acts only as a graphical interface.<br />One would open a project in a server:<br /><ul><li>to use the <span style="font-weight: bold;">CPU</span> of the PC running the server instead of the one of his own PC.</li><li>to <span style="font-weight: bold;">share</span> the project with other people. In fact two or more Matrex clients can work on the same project in the same server in the same time, without problems.<br /></li></ul>Matrex has been written from the start to become one day a client/server system, so the <span style="font-weight: bold;">GUI</span> will not change so much: not much more than a new menu to connect to a server (I will publish some pictures as soon as I have a stable version).<br /><br />The protocol used is <a href="http://en.wikipedia.org/wiki/Java_remote_method_invocation">RMI</a>, but I will keep the possibility to use different protocols in the future. It could be nice to have a version (based on REST?) that can work on the internet through the firewalls.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-23139666206976578802009-06-30T00:06:00.000-07:002009-06-30T01:09:07.117-07:00Matrex 1.3.6A few days ago the Eclipse Foundation published version 3.5 of <a href="http://www.eclipse.org/swt/">SWT</a>.<br />I was waiting for this because it means that <span style="font-weight: bold;">Mac users</span> can finally use Matrex with bot Java 5 and Java 6, and with better graphics, because the new version is based on <a href="http://developer.apple.com/cocoa/">Cocoa</a>.<br />So, as soon as this new version has become available, I have published the new version of Matrex, <span style="font-weight: bold;">1.3.6</span>.<br />Together with the new SWT, 1.3.6 comes the following changes:<br /><ul><li>There was still some <span style="font-weight: bold;">incompatibilities with Java 5</span>, so it was not possible to run Matrex 1.3.5 with Java 5. This problem was hitting mainly the Mac users, that could not use Java 6 because SWT was not working with it. Now I made sure this problem will not show up again.</li><li>From Matrex 1.3.5 maximizing the main window means <span style="font-weight: bold;">maximizing only vertically</span>, leaving the horizontal size of the window the same. In Windows it could happen that maximizing the main window it disappeared from the screen. In Linux from time to time the main window was becoming insensible to the mouse after the maximization. These problems got fixed.</li><li>Matrex is able now to read <span style="font-weight: bold;">script templates</span> from the script classpath defined in the Files Locations dialog. In this way also the script languages plugins (groovy, jruby...) can be installed outside the Matrex directory.</li><li>Minor bug fixing.</li></ul>Now the versions are the follwing:<br /><br /><ul><li><a href="http://sourceforge.net/project/downloading.php?group_id=133398&filename=matrex_1_3_6_win32.jar&a=86889384">matrex_1_3_6_win32.jar</a> for Windows 32 bits.</li><li><a href="http://sourceforge.net/project/downloading.php?group_id=133398&filename=matrex_1_3_6_linux_gtk.jar&a=41335614">matrex_1_3_6_linux_gtk.jar</a> for Linux 32 bits.</li><li><a href="http://sourceforge.net/project/downloading.php?group_id=133398&filename=matrex_1_3_6_macosx_32.jar&a=94824644">matrex_1_3_6_macosx_32.jar</a> for MacOSX 32 bits (Java 5).</li><li><a href="http://sourceforge.net/project/downloading.php?group_id=133398&filename=matrex_1_3_6_macosx_64.jar&a=42511396">matrex_1_3_6_macosx_64.jar</a> for MacOSX 64 bits (Java 6).</li><li><a href="http://sourceforge.net/project/downloading.php?group_id=133398&filename=matrex_1_3_6_generic.jar&a=20387807">matrex_1_3_6_generic.jar</a> for all the other architectures, included Windows 64 and Linux 64 (SWT is installed the first time Matrex is started).<br /></li></ul>The choice between 32 and 64 bits depends by the Java runtime interpreter used.Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-33438045.post-14200615189740347822009-05-25T14:24:00.001-07:002009-05-25T14:32:56.220-07:00About MacOSXIf you are not able to install Matrex 1.3.5 on <span style="font-weight: bold;">MacOSX</span>, please check the <a href="http://matrexblog.blogspot.com/2009/02/matrex-on-macosx.html">article</a> about this topic.<br />You can download a more recent beta version of the SWT library for Cocoa <a href="http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/S-3.5M6-200903130100/swt-3.5M6-carbon-macosx.zip">here</a>.<br />As soon as <a href="http://wiki.eclipse.org/Galileo">Eclipse 3.5 Galileo</a> will be released, I will update the setup files to use the new SWT library, which will probably solve the problem.<a id="publishButton" class="cssButton" href="javascript:void(0)" target="" onclick="if (this.className.indexOf("ubtn-disabled") == -1) {var e = document['stuffform'].publish;(e.length) ? e[0].click() : e.click(); if (window.event) window.event.cancelBubble = true; return false;}"><div class="cssButtonOuter"><div class="cssButtonMiddle"><div class="cssButtonInner"><br /></div></div></div></a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-46912339190047880912009-05-23T10:33:00.000-07:002009-05-23T11:33:58.121-07:00Matrex 1.3.5 has been releasedMatrex 1.3.5 has finally been released.<br /><br />It should have been called 1.4 for the new features it contains, but when the coding started it was called 1.3.5 and so it remained.<br />As the notes that come in the setup file report, these are the new features:<br /><br />GUI:<br /><ul><li><a href="http://matrexblog.blogspot.com/2009/03/project-diagram.html">Project diagram</a>.</li><li>Plugins dialog has been evolved to a more general <span style="font-weight: bold;">locations dialog</span>:<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_UV8bHZTOgQE/Shg-KQ5daqI/AAAAAAAAAHg/qwbTzSGCzlg/s1600-h/fileslocations_dialog.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 278px;" src="http://1.bp.blogspot.com/_UV8bHZTOgQE/Shg-KQ5daqI/AAAAAAAAAHg/qwbTzSGCzlg/s320/fileslocations_dialog.jpeg" alt="" id="BLOGGER_PHOTO_ID_5339085704303307426" border="0" /></a>In this way it is possible to add plugins to Matrex without installing anything in its directory.<br /><br /></li></ul><ul><li>If a <span style="font-weight: bold;">toolbar</span> becomes too small to contain all buttons, it displays a menu containing the missing buttons:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_UV8bHZTOgQE/Shg-vh2dIcI/AAAAAAAAAHo/iD6qFpM_xcM/s1600-h/toolbarwithmenu.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 246px; height: 320px;" src="http://2.bp.blogspot.com/_UV8bHZTOgQE/Shg-vh2dIcI/AAAAAAAAAHo/iD6qFpM_xcM/s320/toolbarwithmenu.jpeg" alt="" id="BLOGGER_PHOTO_ID_5339086344509268418" border="0" /></a><br /><br /></li><li><span style="font-weight: bold;">Progress bar</span> that shows loading of the single items of a project:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_UV8bHZTOgQE/Shg_Cx40EkI/AAAAAAAAAHw/04InrVgdEYk/s1600-h/progressbar.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 73px;" src="http://2.bp.blogspot.com/_UV8bHZTOgQE/Shg_Cx40EkI/AAAAAAAAAHw/04InrVgdEYk/s320/progressbar.jpeg" alt="" id="BLOGGER_PHOTO_ID_5339086675231642178" border="0" /></a><br /></li><li>The <span style="font-weight: bold;">matrix editor</span> has a toolbar, to make the GUI uniform in the whole application:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_UV8bHZTOgQE/Shg_jceTBJI/AAAAAAAAAH4/8EkO-Bigd3Q/s1600-h/editmatrix.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 212px;" src="http://3.bp.blogspot.com/_UV8bHZTOgQE/Shg_jceTBJI/AAAAAAAAAH4/8EkO-Bigd3Q/s320/editmatrix.jpeg" alt="" id="BLOGGER_PHOTO_ID_5339087236418962578" border="0" /></a></li></ul><br /><span style="font-size:130%;">Internal:</span><br /><ul><li><a href="http://matrexblog.blogspot.com/2009/03/matrex-easier-to-package.html">Configuration files</a> containing the location of the other Matrex files (see locations dialogs). With this Matrex becomes easy to <span style="font-weight: bold;">package</span> for specific operating systems.</li><li>Able to read/write <span style="font-weight: bold;">tab separated files</span> (together with the CSV files).<br /></li></ul><br /><span style="font-size:130%;">Test:</span><br /><ul><li>More <span style="font-weight: bold;">unit testing</span> (> 280 tests). The idea is to have a set of tests to fire to check the project before each release.</li><li>GUI unit testing of an editor (Function Editor) with <a href="http://www.eclipse.org/swtbot/">SWTBot</a>.</li><li>Used <a href="http://findbugs.sourceforge.net/">Findbugs</a> annotations.<br /></li></ul><br />Several bugs have been fixed.<br /><br />You can download it <a href="http://sourceforge.net/project/showfiles.php?group_id=133398&package_id=146508">here</a>.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-59823264859945677292009-05-07T11:27:00.000-07:002009-05-07T11:40:09.029-07:00Matrex 1.3.5 almost ready.Last tests for the version 1.3.5 of Matrex, which will be probably released in the last half of May.<br />The changes are many, but surely the most important are:<br /><ul><li><a href="http://matrexblog.blogspot.com/2009/03/matrex-easier-to-package.html">Flexible configuration files</a>, which allow Matrex to be installed in packages or setup files.<br /></li><li>The <a href="http://matrexblog.blogspot.com/2009/03/project-diagram.html">project diagram</a></li></ul>together with many bug fixes.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-33438045.post-54198251812362288482009-03-30T12:39:00.000-07:002009-04-10T12:02:37.599-07:00Project diagramMatrex version 1.3.5 will have the possibility to show the project in form of a diagram.<br />Here is the diagram for the example project <span style="font-style: italic;">projection</span>, that is included in the Matrex setup:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_UV8bHZTOgQE/SdEmKmVaF0I/AAAAAAAAAHY/rt4fsHvB9Hs/s1600-h/diagram.jpeg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 191px;" src="http://4.bp.blogspot.com/_UV8bHZTOgQE/SdEmKmVaF0I/AAAAAAAAAHY/rt4fsHvB9Hs/s320/diagram.jpeg" alt="" id="BLOGGER_PHOTO_ID_5319074598432151362" border="0" /></a><br />It shows all <span style="font-weight: bold;">items</span> of the projects (but timers) and their <span style="font-weight: bold;">connections</span>.<br />Each item is labeled with its <span style="font-weight: bold;">type</span> (matrix, function...), each connection is displayed as an <span style="font-weight: bold;">arrow</span>.<br /><br />Compared to the <a href="http://matrex.sourceforge.net/help/MainWindow.html#Trees">item trees</a> and to the <a href="http://matrex.sourceforge.net/help/InformationView.html">information views</a>, the project diagram has the advantage that It gives a <span style="font-weight: bold;">global overview</span> of the project. In one single window it is possible to see all items of the project.<br /><br />The meaning of the arrows is the following:<br /><ul><li>An arrow from a matrix to a function means that the matrix is input of the function</li><li>An arrow from a function to a matrix means that the matrix is output (result) of the function</li><li>An arrow from a matrix to a presentation or chart means that the matrix is used in the presentation or chart.</li></ul>Since a project can contain many items and therefore many connections among them items, the project diagram can become <span style="font-weight: bold;">complex</span>.<br />To make it easier to understand it, it is possible to:<br /><ul><li>Click on an <span style="font-weight: bold;">item</span>: the item becomes <span style="color: rgb(51, 204, 0); font-weight: bold;">green</span> and all the connected items and their arrows become <span style="color: rgb(51, 51, 255); font-weight: bold;">blue</span> (in) and <span style="color: rgb(255, 0, 0); font-weight: bold;">red</span> (out).</li><li>Click on one of the items <span style="font-weight: bold;">type</span> on the tool bar: all the items of that type become <span style="color: rgb(51, 204, 0); font-weight: bold;">green</span>.<br /></li></ul>In the tool bar there is also a button to <span style="font-weight: bold;">print</span> the diagram.Unknownnoreply@blogger.com0