Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 05 Jul 2015, 05:45
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
pConvert a Measurements Units converted (Mar 3, 2007)
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Thu 01 Mar 2007, 00:26    Post subject:  pConvert a Measurements Units converted (Mar 3, 2007)
Subject description: This is a full rewrite of tkConvert
 

I had some time to spare and decided to tackle cleaning up a couple of tcl/tk applicaitions included in Puppy that had a rather old look.

I've completelly rewriten the tkConvert utility to make it fully GTK compatible.

This utility lets you convert from almost any measurement unit to another. It includes around 1,000 conversions.

In the process I managed to reduce 2159 lines of code while adding functionality!!,
(Barry, that's 103K. I'm making good in my promisse to give back the space taken by gnocl) I could still reduce around 400 lines of code and in the process add about another 1,000 available conversions and provide an even cleaner interface and make the code even more readable. But for now I think this is good enough.

Here is the GTK version with an Aqua theme (Click to see full size)

Here is the cleaned up tk version (Click the thumbnail to see the full size image)


Dependencies
The GTK version requires Gnocl. If you have a version of Puppy prior to 2.14 you'll need to get it from here:
http://www.murga-linux.com/puppy/viewtopic.php?t=15639
pConvert-2.15-1.pet
Description  This is the GTK version. Install this package if you have Puppy 2.14 or newer
pet

 Download 
Filename  pConvert-2.15-1.pet 
Filesize  11.95 KB 
Downloaded  484 Time(s) 
tkConvert-2.15-1.pup
Description  This is the Tk version Install this package if you don't want to install gnocl
pup

 Download 
Filename  tkConvert-2.15-1.pup 
Filesize  23.12 KB 
Downloaded  449 Time(s) 

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to

Last edited by rarsa on Sat 03 Mar 2007, 15:35; edited 4 times in total
Back to top
View user's profile Send private message Visit poster's website 
WhoDo


Joined: 11 Jul 2006
Posts: 4441
Location: Lake Macquarie NSW Australia

PostPosted: Thu 01 Mar 2007, 01:04    Post subject: Re: TkConvert with a cleaned up UI  

rarsa wrote:
I refrained from converting them to gnocl until it is included in the LiveCD so they still have the tk look, just a little bit cleaner.

Just so you know, rarsa, I have added gnocl to both Alpha's of Puppy 2.15CE.

Cheers
Back to top
View user's profile Send private message 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Thu 01 Mar 2007, 10:37    Post subject: Re: TkConvert with a cleaned up UI  

rarsa wrote:
I refrained from converting them to gnocl until it is included in the LiveCD so they still have the tk look, just a little bit cleaner.
Clarification: I should have said: "I refrained from converting them directly to gnocl...

I wanted to release something that could be used and included right now. I will for sure convert them to GTK, wether it is gnocl or GINS.

I still cannot comment on GINS because I hadn't had time to play with it.

I've said before for a project like this I believe that ONE standard that is good enough is better than 10 different toolkits that are respectivelly "the best"

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7441
Location: Perth, Western Australia

PostPosted: Thu 01 Mar 2007, 21:45    Post subject:  

Rarsa,
how much work is involved in converting a Tcl/Tk app from Tk to Gnocl? What about some of the bigger guys, like Ical?
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Fri 02 Mar 2007, 01:22    Post subject:  

BarryK wrote:
how much work is involved in converting a Tcl/Tk app from Tk to Gnocl? What about some of the bigger guys, like Ical?
The couple I've done haven't been difficult at all, it is very straight forward.

The only problem may be when trying to implement Tk functionality that it is not available in gnocl. Tk is a huge toolkit. Gnocl follows the 80/20 rule providing the 20% Tk functionality that is used 80% of the time. There is a workaround for special functionality though. You can embed a Tk window in a Gnocl window.
Code:
wm state . withdrawn    ; # hide tk main window
set socket [gnocl::socket]
toplevel .embededTk -use [format "0x%x" [$socket getID]]
set trayWindow [gnocl::window -child $socket]


Another example is the remotedesktop client. It took In total effort hours maybe 4 hours for the remotedesktop client, and that was while learning Gnocl.

Gnocl syntax is more economical than Tk syntax so that helps.

Translating the tkConvert may take me 1/2 hour for the straight conversion. I want to cleanup the code though and that's where the extra time goes.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Fri 02 Mar 2007, 15:45    Post subject:  

BarryK wrote:
What about some of the bigger guys, like Ical?
Well, Ical is a compiled application so it would require a full language translation, not only a UI translation.

Do you have any applications in mind for translation. I have my own priority list but it is quite arbitrary.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Sat 03 Mar 2007, 15:33    Post subject:  

pConvert uploaded!

http://www.murga-linux.com/puppy/viewtopic.php?p=100866#100866

I've completelly rewriten the tkConvert utility to make it fully GTK compatible. I used Gnocl.

In the process I managed to reduce 2159 lines of code while adding functionality !!,

Barry, that's 103K. I'm making good in my promisse to give back the space taken by gnocl.

I could still reduce around 400 lines of code and in the process add about another 1,000 available conversions and provide an even cleaner interface and make the code even more readable. But for now I think this is good enough and going the extra mile would take me at least 8 hours.

Actually the real code is just 230 Lines of code (including spaces)

1000 lines that correspond to the conversions table. Here is where getting creative a lot of redundancy could be cut.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
disciple

Joined: 20 May 2006
Posts: 6529
Location: Auckland, New Zealand

PostPosted: Tue 26 Jun 2007, 06:26    Post subject:  

If anybody else ever feels like rewriting it for whatever reason, they may want to think about whether the interface can be improved. Check out the freeware windows convert program at http://joshmadison.com/software/convert/ (there is a screenshot). Personally I find the interface much more efficient.
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5574
Location: Gatineau (Qc), Canada

PostPosted: Thu 05 Mar 2015, 19:15    Post subject:  

Hello, all.

This is a voice from the past... This is musher0's great-grandfather talking
to you!!! Yes, to YOU !!!

Joking aside, I was about to create a new thread for modern unit
converters when I found this old one in big-pup's list on Smokey01.com.
So... why not revive it?

A useful program is a useful program is a useful program.

Given that our current gMeasures is limited to temperature conversions...
Have you noticed? The top part of gMeasures does not work. I mean:
nothing works in gMeasures except the temperature conversions...

My dog team and I decided to dog-sleigh a care package to the Puppy
community: Smile

please find attached a pet archive of tkConvert -- since no modern Puppy
can unpack a pup archive anymore !

With illustrations as well, of both programs rarsa has presented above.
The only difference between them -- to the user's eye -- is their "coat".

For pConvert, as rarsa mentioned above, you'll need a valid tcl-tk
language installed (tcl-tk is now at version 8.6 or thereabouts) plus the
gnocl gtk-tcl bridge library. A new "pet format" archive of gnocl is now
here.

As far as I can tell, both these little programs outperform gMeasures.

(With apologies to whoever the maintainer of gMeasures now is... But
I'm really tempted to not present any apology...

That current Puppies have no working unit converter application is a real
shame. Another shame is that none of our current developers caught the
fault before I did. "No further comment", as politicians say... Or I'll
really become impolite...)

Forget the last paragraph and enjoy your new working unit converter app!

musher0

~~~~~~~~~~~~~~
PS If you don't like tcl-tk programs, I've just uploaded on this board a
python solution called gonvert. BFN.
pConvert_at _work_2015-03-05.jpg
 Description   
 Filesize   25.1 KB
 Viewed   68 Time(s)

pConvert_at _work_2015-03-05.jpg

Old_but_still_serviceable_tkConvert_2015-03-05.jpg
 Description   
 Filesize   32.19 KB
 Viewed   105 Time(s)

Old_but_still_serviceable_tkConvert_2015-03-05.jpg

tkConvert-2.15-1.pet
Description 
pet

 Download 
Filename  tkConvert-2.15-1.pet 
Filesize  22.03 KB 
Downloaded  57 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Thu 05 Mar 2015, 22:25; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7441
Location: Perth, Western Australia

PostPosted: Thu 05 Mar 2015, 20:45    Post subject:  

musher0 wrote:
Given that our current gMeasures is limited to temperature conversions...
Have you noticed? The top part of gMeasures does not work. I mean:
nothing works in gMeasures except the temperature conversions...


I use gmeasures every now and again, and the top part works fine.

Yep, still works, trying it now in Quirky 7.0.1.

There is another one created recently, that was offered to me for possible inclusion in Quirky.
Haven't had my morning cup of coffee yet, can't remember it's name or author.

Anyway, here is the source of gmeasures, as used in Quirky:

http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/gmeasures-0.7.tar.bz2

_________________
http://bkhome.org/news/
Back to top
View user's profile Send private message Visit poster's website 
don570


Joined: 10 Mar 2010
Posts: 3782
Location: Ontario

PostPosted: Thu 05 Mar 2015, 21:06    Post subject:  

BarryK wrote:
There is another one created recently, that was offered to me for possible inclusion in Quirky.
Haven't had my morning cup of coffee yet, can't remember it's name or author.


I made Puppy units to convert the common units.
I made it specifically for students since I added a lot of
useful math info.

It only needs gtkdialog 0.8.3 and is very small.

http://murga-linux.com/puppy/viewtopic.php?t=92152

__________________________________
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 5574
Location: Gatineau (Qc), Canada

PostPosted: Thu 05 Mar 2015, 22:23    Post subject:  

@BK
I won't argue with you, if you say it works on your system, then it works
on your system. However, I am not lying either, and gMeasures is not
working in my slacko-6.0b neither in PPrecise 5.4.3.

Please bear in mind, Sir, that I do not have your experience in diagnosing
and solving application problems. Since I cannot "negotiate" those
problems directly yet, I "shop around" to find other viable solutions.

It stands to logic that I wouldn't have spent more than a day searching the
web for replacements to gMeasures and another half day preparing and
updating these pets if gMeasures had worked. I don't invent these
problems, I only try to solve them because I believe in Puppy. If I
didn't, I'd simply wipe my partition clean and load, say, Porteus? Smile

@don570
I believe that you've done a good job of presenting a maximum of unit
conversions. However, your interface is not intuitive: having to go back to
a lower right-hand button that keeps changing function all the time is not
the handiest thing, and it's confusing, IMO.

So I lost patience with your work and looked for something else. Sorry
for speaking my mind so frankly.

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 5574
Location: Gatineau (Qc), Canada

PostPosted: Fri 06 Mar 2015, 03:24    Post subject:  

How much more proof do we need?

BFN.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1005s ][ Queries: 13 (0.0071s) ][ GZIP on ]