Announcement

Collapse
No announcement yet.

Intellisense - Discussion

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Intellisense - Discussion

    I posted source code for an Intellisense implementation. This post is for followup discussion, starting with this quote from Stanley.
    I think you’d find a “Trie” interesting for your project.
    Stanley - I'll watch for the post you mentioned, and take a look. With only a few thousand entries to search, I don't think the simple binary search routine speeds are a factor - because human typing speed is so slow by comparison.

    But I haven't tested the speeds of the Intellisense procedures to know how much time it actually takes, or which procedures take the most time. I'll do that as I get the time and see if the results warrant considering an alternative. Visually, the code I posted seems to keep up with my fingers.

    The syntax highlighting routine is a definite speed barrier - especially noticeable when cutting/pasting blocks of text or moving to a new snippet. Have you looked at that code and is your method applicable in any way (other than just the search for keywords in a lookup table)? A large 100X+ improvement in syntax highlighting speed would well be worth the coding effort. I seem to recall more recent posts on syntax highlighting but I haven't tested them for speed. I'm pretty much using the original Borje code.

    And to your point about the complexities of a RichEdit control - yes, it can be a pain to work with. Getting clean, crisp and expected responses to user inputs is an ongoing concern of mine. There's a lot of interaction between code, some not-quite-documented 'features', and less than detailled documentation. But, it's the one control that provides formatting capabilities.

    I'm still looking at switching to a different edit control - a more recent version of EDM32 and Scintilla are on the list - but just haven't found the time to look into it.

  • #2
    A hash index table will be quicker and is very easy to implement.

    Comment


    • #3
      Hi Chris,

      I assume you're referring to the search portion of the code, not the syntax highlighting?

      Comment


      • #4
        Originally posted by Gary Beene View Post
        I assume you're referring to the search portion of the code, not the syntax highlighting?
        I meant when you are looking up a keyword.

        Comment


        • #5
          Chris;
          Actually; the Trie is as fast, or faster than a hash.
          (3 times faster on my computer)
          plus - always in Key order
          plus - prefix lookup
          plus - always a perfectly balanced binary tree
          The prefix lookup is faster than any other structure in computer science.

          sorry to keep hyping on the Trie, but once I finally understood how it works;
          I realized it's just about the fastest string search the is.

          Gary;
          It would only help lookup speed, not window drawing.

          Once I looked at your code a little more I realized it's mapped to your search methods.

          I'm still going to post an updated Trie source.

          WARNING!!! here comes crazy idea

          the reason I was really interested in your code;
          I had this idea a long time ago:
          - code source stored in database instead of file
          - you just edit one function, sub or method at a time
          - compile: source writen to file from database and compile
          I wrote an editor that did this, but only using a TextBox.
          Left of the edit box where all procedures in file, just click to edit.
          I had it so that it saved the last edit position and highlighted text, even a month latter.

          The complete idea was to store the source on a server, so that several people could be working on the same file from wherever, at the same time by write locking the procedure they where working on.

          A person, anywhere in the world, could do a test compile by writing the sources out to their PC and compiling.

          I finally decided I wasn't knowledgeable enough in enough areas to pull it off.
          stanthemanstan~gmail
          Dead Theory Walking
          Range Trie Tree
          HLib ~ Free Data Container Lib ~ Arrays, Lists, Stacks, Queues, Deques, Trees, Hashes

          Comment


          • #6
            Stan, I know the trie is faster but the hash is easier to code. I last (and first) used a trie over twenty years ago! Horowitz & Sahni's "Fundamentals of Data Structures" springs to mind. Or was it Knuth's book.

            Regarding your crazy idea, how did you see the implementation of the central repositary?

            Comment


            • #7
              FWIW
              © IntelliSense. All rights reserved.
              http://intellisensesoftware.com/?src=overture
              Rod
              In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

              Comment


              • #8
                Originally posted by Stanley Durham View Post
                WARNING!!! here comes crazy idea
                Nothing crazy about that idea... unless I am crazy too Some years ago I implemented the idea on my local computer using another language, just local no server, worked pretty good too.

                I sometimes think about redoing it in PowerBASIC...
                Regards,
                Marc

                Comment


                • #9
                  Stanley,

                  I've been reading your comments ...
                  - code source stored in database instead of file
                  - you just edit one function, sub or method at a time
                  - compile: source writen to file from database and compile
                  Over the years, with my other code librarian (gbCodeLbib) and now with gbSnippets, folks have suggested the database approach. There's a lot to say for that approach.

                  I keep coming back to text data - easy to create, easy to edit, and doesn't require the original app to recover from disasters.

                  I've also thought of perhaps using both approaches ... giving the user the choice of data storage methods - along with any benefits either might offer. Getting the primary code to be transparent to the source would be a trick, but having some portions of the code dedicated as required to the specifics of the source wouldn't be such a bad thing. Then, if I liked the need approach I could fade one out over several revisions.

                  I ran a test this afternoon and in the syntax highlighting loop, the search code to find keywords (Array Scan in this case) was no more than 5% of the total syntax highlighting loop. So my search for speed won't be focussed on the search features.

                  I've not spent much time looking at Borje's code - to see if there are any obvious speed solutions. A 10X speed boost is needed. One option I've seen discussed is highlighting only exposed lines of code. Beyond that I've seen little discussion on this in the forums.

                  I've also seen some code at the CodeProject site, but haven't given it much attention - yet.
                  Last edited by Gary Beene; 3 Nov 2009, 06:57 PM.

                  Comment


                  • #10
                    Gary, you might want to ask Paul Squires (PlanetSquires.com ?) about syntax highlighting. I recall (at least I think I do) him discussing it regarding JellyFish Pro on his Forum.

                    ===================================================
                    "Dogma is the sacrifice of wisdom to consistency."
                    Lewis Perelman
                    ===================================================
                    It's a pretty day. I hope you enjoy it.

                    Gösta

                    JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
                    LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

                    Comment


                    • #11
                      Chris
                      Regarding your crazy idea, how did you see the implementation of the central repositary?
                      the rough idea;
                      server is central repositary
                      production code compiled by whoever had responsibility
                      anyone working on project could compile locally for testing

                      my idea was more for community projects than a commercial application.
                      that would take a lot more consideration.

                      also, on a database, easy to do a timestamp backup of every procedure before editing

                      I was using SQLite.
                      table = source file
                      record = procedure

                      one nice thing about it - code already broken down to procedures
                      I had a slide-out window on the right that was like the class browser on NET
                      just click to insert function call

                      also had a favorites combo, so you could jump back and forth between procedures in different source files (tables)

                      one problem is what to do with compiler directives.
                      I saved text above and below first and last procedure in special records,
                      but that doesn't cover everything.
                      had to keep PBForms stuff with correct procedures.

                      also had it so you could edit the whole file if you wanted.

                      this was before classes and interfaces
                      Last edited by Stanley Durham; 4 Nov 2009, 06:17 AM.
                      stanthemanstan~gmail
                      Dead Theory Walking
                      Range Trie Tree
                      HLib ~ Free Data Container Lib ~ Arrays, Lists, Stacks, Queues, Deques, Trees, Hashes

                      Comment


                      • #12
                        Originally posted by Chris Holbrook View Post
                        [...] Or was it Knuth's book.
                        Me? I've never wrote a book!

                        Just kidding, I know you referred to Donald Knuth's "The Art Of Computer Programming".

                        Comment


                        • #13
                          © IntelliSense. All rights reserved.
                          No, that's not correct.

                          Posters own the copyright on their work. PowerBASIC Inc owns a copyright on the collection. Intellisense owns nothing here.

                          OTOH, Intellisense is the name of a company, and they would no doubt contest any claims of trademark you might want to make on the word.

                          US Patent and Trademark Office Home: http://www.uspto.gov/

                          US Copyright Office Home : http://lcweb.loc.gov/copyright/


                          MCM
                          Michael Mattias
                          Tal Systems (retired)
                          Port Washington WI USA
                          [email protected]
                          http://www.talsystems.com

                          Comment


                          • #14
                            Microsoft claims the trademark on the word Intellisense.



                            I knew of the company by the same name and wondered how they/Microsoft dealt with one another on the topic.

                            I guess I should dream up my own name for the feature set when I put it into gbSnippets.

                            Comment


                            • #15
                              >Microsoft claims the trademark on the word Intellisense

                              you know, I was wondering why the Intellisense (Corp) home page did NOT list "Intellisense" as one of its trademarks... they list about 15 others there, but NOT "Intellisense"

                              Now I know why, I guess.

                              Well, Mike's Rule for this is simply, "Their lawyer is bigger than my lawyer" so I don't even think about using a Microsoft anything.

                              MCM
                              Michael Mattias
                              Tal Systems (retired)
                              Port Washington WI USA
                              [email protected]
                              http://www.talsystems.com

                              Comment


                              • #16
                                I only posted that as an awareness kind of thing, since it is becoming very commonplace to use that word instead of the phrase 'word completion'.

                                Wordsense, wordfinish, worditor(WORD edITOR) are suggestions though none were requested.
                                Rod
                                In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                                Comment


                                • #17
                                  Stan,

                                  I had put my mind to the same problem and came out with a design which might be described as "dll hell" where individual developers worked on dlls against a versioned main program, the dlls being amalgamated when versions were built for testing and release. This would constrain developers somewhat - or "enforce standards" - depends how you look at it!

                                  Putting the code in a database is pretty much what version control systems do anyway. Developing SQL-based tools for managing the repository has to be the best way.

                                  What would be your first choice for a collaborative project?

                                  Comment


                                  • #18
                                    Originally posted by Chris Holbrook View Post
                                    What would be your first choice for a collaborative project?
                                    My choice would be to port PBWin to Unix, or better yet to an OpSys that would run on Cellphones (IPhone or ATT or ...). Of course that's an easy suggestion for me to make as all that would be way over my head. A project for Assembly guys.

                                    ===================================
                                    "In theory, there is no difference
                                    between theory and practice.
                                    But, in practice, there is."
                                    Jan L.A. van de Snepscheut
                                    ===================================
                                    It's a pretty day. I hope you enjoy it.

                                    Gösta

                                    JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
                                    LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

                                    Comment


                                    • #19

                                      Comment


                                      • #20
                                        Eros Olmi
                                        standing ovation!
                                        stanthemanstan~gmail
                                        Dead Theory Walking
                                        Range Trie Tree
                                        HLib ~ Free Data Container Lib ~ Arrays, Lists, Stacks, Queues, Deques, Trees, Hashes

                                        Comment

                                        Working...
                                        X