From kde-edu-devel Thu Apr 07 15:23:54 2011 From: LucaTringali Date: Thu, 07 Apr 2011 15:23:54 +0000 To: kde-edu-devel Subject: [kde-edu]: R: Re: Kartesio Message-Id: <12095972.2459211302189834178.JavaMail.defaultUser () defaultHost> X-MARC-Message: https://marc.info/?l=kde-edu-devel&m=130218988826962 After some work, I made the code of Kartesio follow KDE's coding guide lines: http://quickgit.kde.org/?p=scratch%2Flucatringali%2Fkartesio.git&a=summary I created a class called "Calculations" that contains all the functions that calculate the best fit curve, while the MainWindow class contains the functions that draw the user interface. I hope it's better now. I'm sorry about the bad coding style, but I'm not a programmer: just a chemist. Let me know what do you think about it... I'm using this program to find approximation curves for some experimental plot (calibration of Abbe's refractometer, for example). Luca Tringali ----Messaggio originale---- Da: tcanabrava@kde.org Data: 27/03/2011 16.26 A: , "LucaTringali" Ogg: Re: [kde-edu]: R: Re: Kartesio 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). the names of the member variables are wrong, if you follow the kde-coding guidelines. for instance, you have xmin = 0; xmax = 50; ymin = 0; ymax = 50; if you follow the kde-coding guidelines, they should be m_xmin = 0; m_xmax = 50; m_ymin = 0; m_ymax = 50; the m_ on front indicates that they are member-variables instead of method variables.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. so,1 - fix ObjectOriented Programming in your app. doing everything inside the main class is bad.2 - fix your code-standards to meet kde's ( http://techbase. kde.org/Policies/Kdelibs_Coding_Style ) 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. Tomazyou should also not use on_variable_signal() auto-connections, for a simple change in the ui can break your program. On Sun, Mar 27, 2011 at 12:12 PM, LucaTringali wrote: Well, it's just a little more complex: maxima does only the part of solving the function, but the algorithm for best fit is implemented into Kartesio, and can't be done with maxima commands. Plus, the interface of Kartesio has been designed for this particular use, while Cantor is fundamentally a paper for mathematical calculations. It could be a good idea to write a plugin for Cantor that works with Kartesio as a backend, but I should think about how this could be done. Luca Tringali >>----Messaggio originale---- >>Da: aspotashev@gmail.com >>Data: 27/03/2011 13.24 >>A: , "LucaTringali" >>Ogg: Re: [kde-edu]: Kartesio >> >>2011/3/27 LucaTringali : >>> Hello everybody, >>> I wrote a program that takes a series of points, a generic curve, and tries >>> to give a best fit. I called it Kartesio, it works using maxima to solve >>> functions and KDE libraries for the UI. >>> For example, if you give it (1;0) (2;3) (3;7) (4;8) (5;11) and the function >>> y=a*x+b, it will return y=3*x -3, and plot it to show differences between >>> the best fit curve and the original points. It can also export the results >>> into an svg image, a latex document (using pstricks). >>> Give it a look, and tell me what do you think: >>> http://quickgit.kde.org/?p=scratch%2Flucatringali%2Fkartesio.git&a=summary >>> Here's a screenshot: >>> https://docs.google.com/leaf? >id=0B6K8rmHlVyTFZTliYzIwMmEtODZlOS00NjhkLThiYjItNWM1YTIzMzBmNDc2&hl=en >>> Could it be included into kde-edu collection? What does it miss? >> >>As your application uses Maxima, the same thing can probably be done >>as a plugin for Cantor (http://edu.kde.org/applications/all/cantor/). >> >> >>-- >>Alexander Potashev >> > > _______________________________________________ kde-edu mailing list kde-edu@mail.kde.org https://mail.kde.org/mailman/listinfo/kde-edu _______________________________________________ kde-edu mailing list kde-edu@mail.kde.org https://mail.kde.org/mailman/listinfo/kde-edu