Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Sep 25, 2017 10:46 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: "Want someone to review your application?" I certainly do!
PostPosted: Fri May 10, 2013 4:32 pm 
Offline

Joined: Fri Sep 30, 2005 1:53 pm
Posts: 914
Location: Philadelphia, PA
I would very much appreciate feedback on a program I wrote called CodeHelper.

CodeHelper is a program I wrote to help people analyze or modify RB Projects they have written or are writing (or, for that matter, other people have written). At present it contains more than 100 tasks that it can perform, many of which are difficult or near-impossible to do otherwise. It does this by analyzing or modifying the RB Project by working with it as saved in XML format.

I would be very grateful if you looked at the program and shared with me even a sentence or two on what you like and/or don’t like, new features you would like to see added, other suggestions for improvement, bugs to re movet, or anything else.

I wrote it in Windows, so I am especially hoping to hear from Mac users as to how well CodeHelper works (or if it works at all, since I do not yet have a Mac and thus have not yet had opportunity to test it on the Mac).

Here's where to find an introduction::

http://traver.org/ch/ch105.htm

And here's where to find the program itself (so far essentially tested only on Windows).:

http://traver.org/ch/ch105.rbp

Barry Traver


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Fri May 10, 2013 4:58 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
Do you plan on supporting RBVCP format in the future? I realize that would require a completely different parsing system, but I'd prefer not to save as XML and back to RBVCP, as I can't be sure it'd transition in such a way that the VCS wouldn't whine at. ;)

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Fri May 10, 2013 6:15 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
I don't know about "this" version... but I have used previous versions of this program on my Mac

I have not looked at this version (yet). but truth be told I have only used one section..... The parts to look for unused variables, unused methods.... None of the rest were of added value.... But I will check this out over the weekend and let you know

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Sat May 11, 2013 12:08 am 
Offline

Joined: Fri Sep 30, 2005 1:53 pm
Posts: 914
Location: Philadelphia, PA
DaveS wrote:
I don't know about "this" version... but I have used previous versions of this program on my Mac.... I have not looked at this version (yet). but truth be told I have only used one section..... The parts to look for unused variables, unused methods.... None of the rest were of added value.... But I will check this out over the weekend and let you know.


Dave S.,

I hope that in addition to letting Jason know you will let me (and others) know as well, since I was the one who requested feedback and have freely given the program (including complete source code) to anyone interested.

Incidentally, I was glad to see that you liked my idea of writing a program emulating the BASICs of the 1970's and 1980's, even (as far as I know) you have chosen NOT to make your source code for that freely available. That is certainly your right, although over the years I have chosen otherwise regarding my own source code. It has been freely shared, "warts and all."

I did appreciate your note to Jason, who has the choice to look at CodeHelper (including source code) for himself or to let you look at them "over the weekend"
and let him know what to think of my program. Since I started this message thread and since you published your note publicly, however, I trust that you will not object to my sharing some comments on your comments.

First, I am glad to hear from you that in CodeHelper -- which contains more than 100 tasks it can perform, many of which are difficult or near-impossible to do otherwise -- you did find "one section" that you used, even though you thought that "None of the rest were of added value." If even one section was useful to you, I'm glad (and CodeHelper was my gift to the community; it did not cost you or anyone else anything).

Second, you say, "... truth be told I have only used one section..... The parts to look for unused variables, unused methods.... None of the rest were of added value..." (That one section, by the way, also checked variables and properties for duplicates and looked for unused properties.) Fair enough. But since most of CodeHelper's hundred routines accomplish things ordinarily difficult to do, would you not grant that other people (such as Jason?) may find sections useful to them that may not be of interest to you?

One thing to keep in mind is that since you have the source code, you do not have to use the routines "as is." You can adapt the code to your own purposes, (and you do not have to learn things the hard way as I did). CodeHelper is intended for programmers who have some ability to write and modify programs. Do you know of any other program (with source code freely provided) that does such a variety of tasks based on Real Software's XML format for RB Projects?

The operative word is variety. You can certainly use CodeHelper "as is" (that's the way I primarily use it), but you also have the freedom to build on CodeHelper to include special tasks that match up with your own purposes and interests.

Barry Traver


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Sat May 11, 2013 12:27 am 
Offline

Joined: Fri Sep 30, 2005 1:53 pm
Posts: 914
Location: Philadelphia, PA
Jason_Adams wrote:
Do you plan on supporting RBVCP format in the future? I realize that would require a completely different parsing system, but I'd prefer not to save as XML and back to RBVCP, as I can't be sure it'd transition in such a way that the VCS wouldn't whine at. ;)


Jason,

That's a good question. CodeHelper in its operation goes all the time between .rbp and .xml, and that has created NO problems. But it's possible (likely?) that Version Control format contains information not present in .XML or .RBP formats.

At this point my time has been spent on .SML and .RBP formats (I haven't even looked at .RBVCP format, although I've thought about it). But "I will check this out over the weekend and let you know" <grin>.

Have you yourself done any experimenting with this format? Perhaps you can tell me a bit more about what you would like to do, and I'll see what I can do....

Barry Traver


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Sat May 11, 2013 12:58 am 
Offline

Joined: Fri Sep 30, 2005 1:53 pm
Posts: 914
Location: Philadelphia, PA
There are lots of things in CodeHelper that I do NOT use regularly (although I use almost everything from time to time). Following are some examples of things CodeHelper can do that you may NOT have any interest in doing:

1. Add automatic comment to all "End If" lines.
Example: replace "End If" with "End If // If Total > 200"
2. Add automatic comment to all "Next" lines.
Example: replace "Next I" with "Next I // For I = 0 To UBound ( XMLLines )"
3. Add "boilerplate" material to beginning or end of all procedures
Example: Add the following: "Exception
MsgBox "An error occurred in Window1.EnableMenuItems."
4. Check to see whether any Variables and any Properties have been given the same name.
5. Check to see whether any Variables are DIMensioned but never actually used.
6. Check to see whether any Properties in a procedure are defined but never actually used.
7. Conform keywords to standard REALbasic format regarding case (e.g., "NEXT","next", "NExt" all become "Next").
8. Display source code on screen for entire project or for a particular procedure.
9. Display XML file on screen (including any modifications that have been made to the XML code).
10. Edit XML or extracted Source or search for string or whole word in XML or extracted Source.
11. Inset a space before and after mathematical operators ( + , - , , / , = , ^ , <> , >= , <= ), before or after parentheses symbols, and/or after commas.
12. Increase indentation of source code beyond the normal indentation (sometimes makes source code more readable).
13. Remove all blank lines from source code.
14. Save to disk extracted or edited source code displayed on the screen.
15. Save to disk (modified) XML file displayed on the screen (will run outside CodeHelper as a regular program).
16. Send to printer any list, source code, or XML file on the screen.
17. Add appropriate counter variable to "Next" line (e.g., "Next" becomes "Next LineNumber").
18. Double-space source code.
19. Display list of modifications made to XML code by CodeHelper.
20 Obfuscate (or unobfuscate) source code by switching control names.
21. Change a "name" (e.g., variable name) throughout the code (uses RegEx to change only "whole words").
22. Comment out content of all Functions and Subs but add MsgBox showing the name of that particular Method (can be useful if a program needs to be radically revised or a certain section extracted).
23. Change font to System and font size to 0 throughout the Project (similar to changing IDE without making any changes in source code)
24. Change XML and (extracted) Source from ReadOnly to editabe.

BUT you may find that you have an interest in at least some of the preceding or in some of the other tasks CodeHelper can do.

Barry Traver


Last edited by barrytraver on Sat May 11, 2013 1:46 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Sat May 11, 2013 1:38 pm 
Offline

Joined: Fri Sep 30, 2005 1:53 pm
Posts: 914
Location: Philadelphia, PA
Dave S.,

I re-read your post of Friday, May 10, and it certainly appears that I seriously mis-read it. I don't know why I took it as intended for Jason rather than for me, but regardless of the intended recipient, my response was inappropriate. Thus I apologize for what I said.and I hope that our friendship may be restored.

Perhaps I acted over-defensively in response to the general lack of interest in "CodeHelper" after I had spent years on it as my gift to the community. What I posted was NOT intended to be a "bashing" of you, but at the very least it was a failure in communication on my part if it seemed to be intended that way.

So I'm sorry for reacting in the way I did. Even if I misunderstood what you posted, my response was improper, going beyond what it should have been (or would have been, if I had taken more time to think through the situation).

Barry Traver


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Sat May 11, 2013 7:10 pm 
Offline

Joined: Wed Feb 16, 2011 1:59 pm
Posts: 74
Location: Arizona, USA
Two kudos for you Barry, one for a very cool application (it is rather cool); and a second one for owning up to your response. That second one is actually huge, you don't see that at all anymore.

_________________
Windows XP SP3
RS 2012r2


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Mon May 13, 2013 3:03 am 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Had a few crashes while testing... moved a few functions to threads while testing (larger projects lockup the ide)...but it's definitely a good application :-)

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Mon May 13, 2013 6:57 am 
Offline

Joined: Fri Sep 30, 2005 1:53 pm
Posts: 914
Location: Philadelphia, PA
Matthew,

Thanks for the comments. They are much appreciated, especially your comment that "it's definitely a good application :-)" <grin>.

If you have any questions at all (the docs are rather sparse), please don't hesitate to email or phone me (my email address and phone number are in the docs).

By the way, if you could tell me a bit more about your "moving a few functions to threads while testing" to avoid crashes or locking up the IDE, that could help me improve the program. (No pressure on that, however. I hesitate to take up more of your time after you are one of the few people who have provided feedback.)

CodeHelper -- like Topsy -- "just grew," over a period of several years. More and more got added, and there are lots of places where there are unnecessary duplications of code, wasting memory. I'd get an idea of a new feature to add and I would add it, without necessarily doing it in the most efficient way and often without adding appropriate documentation. I'm now working on rectifying those deficiencies. (Again, if you have ANY questions, please don't hesitate to ask; I'll do my best to answer them.)

Barry Traver


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Tue May 28, 2013 2:49 pm 
Offline
User avatar

Joined: Thu Jul 27, 2006 6:31 pm
Posts: 1698
Location: Monterey, CA
The download link posted original is returning a 404, so I can't test it personally.

But something I've often wished Real Studio could do is to make it easy to strip out or comment out blocks of code in the search results.

Specific examples;
* Find every instance of ".UseOldRenderer" and remove that whole line of code
* Find every instance of "#pramga" and remove that whole line of code


You get the idea.

_________________
ImagePlay Effects Library (40+ image effects in one open source module. No plugins, no dependencies, no restrictions.)
http://imageplay.sourceforge.net/


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Wed May 29, 2013 2:52 am 
Offline

Joined: Fri Sep 30, 2005 1:53 pm
Posts: 914
Location: Philadelphia, PA
tomis wrote:
The download link posted original is returning a 404, so I can't test it personally.

Oops! I uploaded a later version of the program and removed the earlier version, but my change in filename meant that my earlier link no longer worked <sigh>. Sorry!

The best way to get the latest working links for CodeHelper is to go to http://traver.org/ch/ and use the filename menu at that location. If using Firefox or Safari, right-click (NOT left-click) on the file you want to download and choose "Save Link As" (or its equivalent).

Here's the latest version of the docs (left-click should be all right for the .htm file):

http://traver.org/ch/ch105.rtf or http://traver.org/ch/ch105.htm

[/url]And here's the latest version of the program (remember to right-click!):

http://traver.org/ch/ch120.rbp or http://traver.org/ch/ch120.xml

tomis wrote:
But something I've often wished Real Studio could do is to make it easy to strip out or comment out blocks of code in the search results.
Specific examples;
* Find every instance of ".UseOldRenderer" and remove that whole line of code
* Find every instance of "#pramga" and remove that whole line of code
You get the idea.

It's super-easy to remove a line of code that meets certain requirements (such as the two examples you gave). Removing a larger block is more complicated. I'll try to post by tomorrow morning how to handle the whole line (the code is short enough to include in a thread message), but I'll need more information from you on how you want to define the larger block. (If you want to phone me this evening, my number is in the docs.)

Barry Traver


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Wed May 29, 2013 6:47 am 
Offline
User avatar

Joined: Mon Apr 02, 2007 2:08 am
Posts: 1225
Location: San Francisco, CA, USA
tomis wrote:
But something I've often wished Real Studio could do is to make it easy to strip out or comment out blocks of code in the search results.

Specific examples;
* Find every instance of ".UseOldRenderer" and remove that whole line of code
* Find every instance of "#pramga" and remove that whole line of code


RS can do that, but you have to open the Find All window (Edit->Find->Find All). From there you can do project-wide search using regular expressions like:
^\#pragma\s.*$
^.*\.?UseOldRenderer+.*$


Search results are opened in the normal search results tab, so you can replace each match from there.

_________________
Boredom Software


Top
 Profile  
Reply with quote  
 Post subject: Re: "Want someone to review your application?" I certainly
PostPosted: Thu May 30, 2013 4:15 am 
Offline

Joined: Fri Sep 30, 2005 1:53 pm
Posts: 914
Location: Philadelphia, PA
I haven't checked the following code, but it should work:

// DIMension needed variables
DIm XMLBuffer, XMLLine As String
DIm XMLLines(-1) As String
Dim Pos1, Pos2, XMLLineNumber As Integer
Dim XMLType As New FileType
XMLType.Name = "XML files"
XMLType.Extensions = ".xml"
Dim FileStreamA as TextInputStream
Dim FileStreamB As TextOutputStream
Dim File1, File2 As FolderItem

// Load XML file from disk
File1 = GetOpenFolderItem( XMLType )
If File1 <> Nil Then
FileStreamA = TextInputStream.Open ( File1 )
XMLBuffer = FileStreamA.ReadAll
FileStreamA.Close
Else
Exit
End If

// Divide XML file into XML lines
XMLLines = Split (XMLBuffer, EndOfLine )

// Look at source lines and change #pramga source lines to blank source lines
For XMLLineNumber = 0 To Ubound ( XMLLInes )
XMLLine = XMLLInes ( XMLLineNumber )
Pos1 = InStr ( XMLLine, "<SourceLine>" )
If Pos1 <> 0 Then
Pos2 = InStr ( XMLLine, "#pramga")
If Pos2 <> 0 Then
XMLLines (XMLLineNumber) = "<SourceLine></Sourceline>"
End If
End If
Next XMLLineNumber

// Combine XML lines into XML file
XMLBuffer = Join ( XMLLines, EndOfLine )

// Save XML file to disk
File2 = GetSaveFolderItem( XMLType, "" )
If File2 <> Nil Then
FileStreamB = TextOutputStream.Create ( File2)
FileStreamB.Write XMLBuffer
FileStreamB.Close
Else
Exit
End if

The preceding simply changes source lines containing "#pramga" to blank source lines. You can also actually fairly easily remove the lines (reducing the number of total source lines). If you'd rather do that, let me know.

There are lots of approaches that can be made. For example, if you make it a practice to divide your code into sections of one or more lines (with a blank line between sections), you can easily change the code above so that it removes entire sections that contain a certain combination of characters.

Barry Traver


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 5 hours


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group