<p style="margin: 0px; padding: 0px;">Ok, I'm gonna work making the code following the KDE coding style.</p><p style="margin: 0px; padding: 0px;"><br></p><p style="margin: 0px; padding: 0px;">Luca Tringali</p><p style="margin: 0px; padding: 0px;"><br></p>
<blockquote>
----Messaggio originale----<br>
Da: tcanabrava@kde.org<br>
Data: 27/03/2011 16.26<br>
A: <kde-edu@kde.org>, "LucaTringali"<TRINGALINVENT@libero.it><br>
Ogg: Re: [kde-edu]: R: Re: Kartesio<br>
<br>
I took a look at the code, and I think it could be better designed, ie, all code is on mainwindow.cpp, but inside the mainwindow you have a parser, a plotter, you are also using non-english names for variables (texto, for instance). <div>
<br></div><div>the names of the member variables are wrong, if you follow the kde-coding guidelines. </div><div>for instance, you have</div><div><br></div><div><div> xmin = 0;</div><div> xmax = 50;</div><div> ymin = 0;</div>
<div> ymax = 50;</div><div><br></div><div>if you follow the kde-coding guidelines, they should be</div><div><br></div><div><div> m_xmin = 0;</div><div> m_xmax = 50;</div><div>
m_ymin = 0;</div><div> m_ymax = 50;</div></div><div><br></div>the m_ on front indicates that they are member-variables instead of method variables.</div>
<div>also, you are doing a *lot* of string operations on your code, you should consider using QByteArray for that instead of QString list as QByteArray is much faster on those.</div><div><br></div><div>so,</div><div>1 - fix ObjectOriented Programming in your app. doing everything inside the main class is bad.</div>
<div>2 - fix your code-standards to meet kde's ( <a href="http://techbase.kde.org/Policies/Kdelibs_Coding_Style" mce_href="http://techbase.kde.org/Policies/Kdelibs_Coding_Style">http://techbase.kde.org/Policies/Kdelibs_Coding_Style</a> )</div><div><br></div><div>as for a new program for that, I don't know if it's good. for instance, it looks like it could be done on KmPlot instead of a new app just for that.</div>
<div><br></div><div>Tomaz</div><div>you should also not use on_variable_signal() auto-connections, for a simple change in the ui can break your program.<br>
<div class="gmail_quote">On Sun, Mar 27, 2011 at 12:12 PM, LucaTringali <span dir="ltr"><<a href="mailto:TRINGALINVENT@libero.it" mce_href="mailto:TRINGALINVENT@libero.it">TRINGALINVENT@libero.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" mce_style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Well, it's just a little more complex: maxima does only the part of solving<br>
the<br>
function, but the algorithm for best fit is implemented into Kartesio, and<br>
can't be done with maxima commands. Plus, the interface of Kartesio has been<br>
designed for this particular use, while Cantor is fundamentally a paper for<br>
mathematical calculations. It could be a good idea to write a plugin for<br>
Cantor<br>
that works with Kartesio as a backend, but I should think about how this<br>
could<br>
be done.<br>
<br>
Luca Tringali<br>
<br>
>>----Messaggio originale----<br>
>>Da: <a href="mailto:aspotashev@gmail.com" mce_href="mailto:aspotashev@gmail.com">aspotashev@gmail.com</a><br>
>>Data: 27/03/2011 13.24<br>
>>A: <<a href="mailto:kde-edu@kde.org" mce_href="mailto:kde-edu@kde.org">kde-edu@kde.org</a>>, "LucaTringali"<<a href="mailto:TRINGALINVENT@libero.it" mce_href="mailto:TRINGALINVENT@libero.it">TRINGALINVENT@libero.it</a>><br>
>>Ogg: Re: [kde-edu]: Kartesio<br>
>><br>
>>2011/3/27 LucaTringali <<a href="mailto:TRINGALINVENT@libero.it" mce_href="mailto:TRINGALINVENT@libero.it">TRINGALINVENT@libero.it</a>>:<br>
>>> Hello everybody,<br>
>>> I wrote a program that takes a series of points, a generic curve, and<br>
tries<br>
>>> to give a best fit. I called it Kartesio, it works using maxima to solve<br>
>>> functions and KDE libraries for the UI.<br>
>>> For example, if you give it (1;0) (2;3) (3;7) (4;8) (5;11) and the<br>
function<br>
>>> y=a*x+b, it will return y=3*x -3, and plot it to show differences between<br>
>>> the best fit curve and the original points. It can also export the results<br>
>>> into an svg image, a latex document (using pstricks).<br>
>>> Give it a look, and tell me what do you think:<br>
>>> <a href="http://quickgit.kde.org/?p=scratch%2Flucatringali%2Fkartesio.git&a=summary" mce_href="http://quickgit.kde.org/?p=scratch%2Flucatringali%2Fkartesio.git&a=summary" target="_blank">http://quickgit.kde.org/?p=scratch%2Flucatringali%2Fkartesio.git&a=summary</a><br>
>>> Here's a screenshot:<br>
>>> <a href="https://docs.google.com/leaf" mce_href="https://docs.google.com/leaf" target="_blank">https://docs.google.com/leaf</a>?<br>
>id=0B6K8rmHlVyTFZTliYzIwMmEtODZlOS00NjhkLThiYjItNWM1YTIzMzBmNDc2&hl=en<br>
>>> Could it be included into kde-edu collection? What does it miss?<br>
>><br>
>>As your application uses Maxima, the same thing can probably be done<br>
>>as a plugin for Cantor (<a href="http://edu.kde.org/applications/all/cantor/" mce_href="http://edu.kde.org/applications/all/cantor/" target="_blank">http://edu.kde.org/applications/all/cantor/</a>).<br>
>><br>
>><br>
>>--<br>
>>Alexander Potashev<br>
>><br>
><br>
><br>
<br>
<br>
_______________________________________________<br>
kde-edu mailing list<br>
<a href="mailto:kde-edu@mail.kde.org" mce_href="mailto:kde-edu@mail.kde.org">kde-edu@mail.kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/kde-edu" mce_href="https://mail.kde.org/mailman/listinfo/kde-edu" target="_blank">https://mail.kde.org/mailman/listinfo/kde-edu</a><br>
</blockquote></div><br></div>
<br>
</blockquote><p><br></p>