Recent

Author Topic: Code Librarian enhancements.  (Read 16831 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Code Librarian enhancements.
« Reply #15 on: September 20, 2014, 04:27:40 pm »
The Code Librarian has come a long way since you suggested it in a previous topics - Congratulations  :)

thank you I'm glad you find it useful.

I think what should be considered is having everything as plain text, both the tree structure and the files as well and working directly from a source code repository to make updates easy.

I'm sorry I'm a bit confused. The snippets are saved in plain text inside the library. The colors you see are a dynamic decision made at runtime by the synedit control the do not exist as information in the snippet it self.

Working form a source code repository? as individual snippets? or as a library file?

sorry for being dense at a time like this.


I was actually looking at the snapshots on the sourceforge website and it looks much different from what I tried the last time.

Do you have the repo displayed in the snapshots available?
Lazarus 3.0/FPC 3.2.2

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Code Librarian enhancements.
« Reply #16 on: September 20, 2014, 04:35:10 pm »
This
http://forum.lazarus.freepascal.org/index.php/topic,25876.msg157985.html#msg157985

Continues here:

A File > "Save" will be good
Edit > "Select all" for text.

Do the program DPI Aware itself for Windows.

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Code Librarian enhancements.
« Reply #17 on: September 20, 2014, 04:35:40 pm »
I now have the latest build from the link posted by @Taazz.

Oh :-)  It already ships with a library of snippets.  Whoops - I wouldn't have posted my first request if I'd been using the latest.

Right - I'm now testing the *correct* build - sorry for the confusion...
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Code Librarian enhancements.
« Reply #18 on: September 20, 2014, 04:46:39 pm »
I don't know if it's already added but these are Windows specific I made some time ago:
http://wiki.lazarus.freepascal.org/High_DPI
http://wiki.lazarus.freepascal.org/FileAssociation

Here you have both procedures / classes and the example code.
Oh wow my first official code donations thank you. I'll make sure that its the first in the library with the proper acknowledgement when the attributes are ready.  ;)

Others:
http://wiki.lazarus.freepascal.org/TCollection

Something cool can be, for the TCollection example, to put your own name to the classes inside, then copy and paste to Lazarus. Like a save-time tool.

I was thinking something along the lines of when you copy a text with build in parameters it will create a dialog asking their values the key being to be able to have multiple parameters in the snippet and all of them replaced with the values given by the user during copying the text in memory.

do you think something along those lines too? or you want something more/different?

Another thing: integrate this with Lazarus, and auto-update will be great.
Note it an expert (delphi lingo addin in lazarus) to added in lazarus. Shouldn't be that hard to do.

Edit: Zoom for the text (In the folder view and in the code view)

Note it. Can you explain to me why zooming is so important though? I'm a bit thick on the subject sorry.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Code Librarian enhancements.
« Reply #19 on: September 20, 2014, 04:56:30 pm »
Do you have the repo displayed in the snapshots available?

Yes the git repo in sf has the code that created those screenshots, here is a direct link to it https://sourceforge.net/p/codelibrarian/code/ci/master/tree/ although its in a bit of unstable state at the moment I pushed a few changes for the extra highlighters before they where ready 100% I would advice to either wait until I push out the latest stable version tonight or do not use the extra highlighters the first 6 on the drop down list are safe to use along with all the sql dialects, for the rest I"m not sure for their state the only thing I am sure is that the modula 3 highlighter was cut off of this release because it needed a lot more digging around before I could use it. So definetly it will not work.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Mike.Cornflake

  • Hero Member
  • *****
  • Posts: 1260
Re: Code Librarian enhancements.
« Reply #20 on: September 20, 2014, 05:13:06 pm »
Suggestions for code from this forum:

My own:  (you've got similar in the existing snippets, but the code here is wider in scope than your "Extracting Version Build Information")
"Accessing build & compiler info in Source"
http://forum.lazarus.freepascal.org/index.php/topic,13957.msg73542.html#msg73542

Others: Natural String Comparison
http://forum.lazarus.freepascal.org/index.php/topic,24450.30.html

(I got a little lost towards the end as to which routine was better, but you were part of that conversation so I'm hoping you know the final result :))
Lazarus Trunk/FPC Trunk on Windows [7, 10]
  Have you tried searching this forum or the wiki?:   http://wiki.lazarus.freepascal.org/Alternative_Main_Page
  BOOKS! (Free and otherwise): http://wiki.lazarus.freepascal.org/Pascal_and_Lazarus_Books_and_Magazines

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Code Librarian enhancements.
« Reply #21 on: September 20, 2014, 07:29:22 pm »
<snip>

I think what should be considered is having everything as plain text, both the tree structure and the files as well and working directly from a source code repository to make updates easy.

I'm sorry I'm a bit confused. The snippets are saved in plain text inside the library. The colors you see are a dynamic decision made at runtime by the synedit control the do not exist as information in the snippet it self.

Working form a source code repository? as individual snippets? or as a library file?

sorry for being dense at a time like this.

When a person wants to make some updates, they just download it locally, make their changes or add new files, merge it with updates from the main repository, then push it back.

That will also make it easier for the wiki to be linked to the snippets, and have updates reflected on the wiki page immediately.

actually you can have as many libraries as you want which can be merged under a single one. This process is already in place so any one can start their own library and send it back to be merged in. I could extend after I add the author attributes on the snippets to allow one to export his/her snippets in an external library sending only them to be merged in.

Will this be acceptable or am I missing the big picture here? (will not the be the first time that I do mind you).

What I mean to say is rather than have the clb file, you have the snippets as individual files stored in a repo.

The tree is also a file in a repo, like XML, JSON or some other suitable text format, whose leaves link to the snippets (ie other files in the repo)

So updating becomes a matter of updating the tree file as well as the snippet file on disk and pushing it back to the main repo. It saves the owner of the file from having to check every submission themselves.
A few trusted invididuals with commit rights can help with that.

It also offers the possibility of viewing the files remotely using a browser with the appropriate URI as the data storage format does not require a specialized reader.

That will allow it to operate like http://snippets.delphidabbler.com/

Are you aware of
Lazarus 3.0/FPC 3.2.2

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Code Librarian enhancements.
« Reply #22 on: September 20, 2014, 08:13:51 pm »
I see what you are after, I can tell you from get go two things
1) I'm not going to regress back to a bunch of files for my snippets library, it makes no sense and I hate clatter ee a lot of small file that eat up disk space just because and

2) I like the idea of a svn/git integration where the snippets can be seen as single file per snippet while the tree can be seen as directories in the repo. There is libGIT2 with delphi bindings I can use to integrate GIT any one knows a good svn/cvs/hg library on the same spirit that I could use to add more systems later on?


As for the rest of the comments about authors trusted individuals who is going to have access to make changes or code donations it seems like the mark of the internet era, the snippet library is developed in the exact opposite direction any one can send snippets you as the user of the library decide which authors  you like follow and download and which ones to ignore I'm not going to dictate to anyone what he should like or need for his library.

I might place algorithms in place to avoid duplication of snippets and that is as far as I"m willing to go. Yes there is a need of an officially supported library but I'm not the person to decide what is official and what is not there is a team in place that has that authority I'm only looking to create the tools to make their life easier and ours a bit more interesting so rain check on this for now until at least I have a more concrete plan in front of me about synchronization and version checking.

I might not agree with your ideas but is always a pleasure to read them I always get something out of them, thank you.

Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: Code Librarian enhancements.
« Reply #23 on: September 20, 2014, 08:54:50 pm »
I see what you are after, I can tell you from get go two things
1) I'm not going to regress back to a bunch of files for my snippets library, it makes no sense and I hate clatter ee a lot of small file that eat up disk space just because and


You are not the only one with a serious problem of snippets and small files scattered all over the place. By bash scriplets drive me crazy and I am trying to store them all into a template driven database system.

2) I like the idea of a svn/git integration where the snippets can be seen as single file per snippet while the tree can be seen as directories in the repo. There is libGIT2 with delphi bindings I can use to integrate GIT any one knows a good svn/cvs/hg library on the same spirit that I could use to add more systems later on?


This is the main benefit, especially with a shared system as changes etc, and updates are automatically monitored.

As for the rest of the comments about authors trusted individuals who is going to have access to make changes or code donations it seems like the mark of the internet era, the snippet library is developed in the exact opposite direction any one can send snippets you as the user of the library decide which authors  you like follow and download and which ones to ignore I'm not going to dictate to anyone what he should like or need for his library.

I might place algorithms in place to avoid duplication of snippets and that is as far as I"m willing to go. Yes there is a need of an officially supported library but I'm not the person to decide what is official and what is not there is a team in place that has that authority I'm only looking to create the tools to make their life easier and ours a bit more interesting so rain check on this for now until at least I have a more concrete plan in front of me about synchronization and version checking.

I might not agree with your ideas but is always a pleasure to read them I always get something out of them, thank you.

As the developer of the software you are likely to have a set of snippets more interesting than most, in addition to those that others will submit or enhance.

A single individual or groups of collaborators can also have their own libraries and web portals for them. The benefit of a plain text system is that it can even have a search interface, be indexed by search engines etc.
You can imagine Lazarus one day been able to search a library for some code and automatically loading it into the IDE for possible usage or investigation.
Lazarus 3.0/FPC 3.2.2

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Code Librarian enhancements.
« Reply #24 on: September 20, 2014, 09:27:33 pm »
You are not the only one with a serious problem of snippets and small files scattered all over the place. By bash scriplets drive me crazy and I am trying to store them all into a template driven database system.
Then you know the pain don't you? :D.


This is the main benefit, especially with a shared system as changes etc, and updates are automatically monitored.

you mean that I do not have to write any code to intergrate my app with the CVS? yeah I don't like what I'm loosing in the process.


As the developer of the software you are likely to have a set of snippets more interesting than most, in addition to those that others will submit or enhance.

A single individual or groups of collaborators can also have their own libraries and web portals for them.

yeah its still the opossite of what I'm aiming I like indivinduals to share what ever they like to share thats it if some one fills like to open a new public library then I welcome them if they do a better job than me grate means I can do less for more.

The benefit of a plain text system is that it can even have a search interface, be indexed by search engines etc.
You can imagine Lazarus one day been able to search a library for some code and automatically loading it into the IDE for possible usage or investigation.

Lets just leave that to the CVS in use for the internet search, for the library search though I am evaluating a small scale solution based on the fp text search library for now and it will eventually get included in the application. I have no concrete plans yet for that either but if I"m going to build a public library where every one is going to be able to add snippets and every one to check them out as they see fit then why not merge their serch indexies and one search could yield results from multiple public libraries at the same time, everyone will be given the choice to share their search indexies and with whom when they setup their public library (and client?). Yet again more power to the end user instead of wasting his own disk space he will be using everyone's snippets for his own benefit and download only the ones he needs.

Now back to the drawing board. I need to materialize this public library concept and sharing the indexes and all that, some day in the future I'll be back here asking stupid questions for internet or some other topic.

In the mean time let me hear some more ideas what else you have in mind what you really need or simple wish for.

thanks guys for the support so far.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

yamer

  • Jr. Member
  • **
  • Posts: 87
Re: Code Librarian enhancements.
« Reply #25 on: September 21, 2014, 10:34:19 am »
Hi,

I wanted to try Code Librabian but I didn't succed. I run a pure 64 bit linux and there is no 64 bit binary package available on CodeLibrarian sourgeforge. No problem, I decide to download the source and build a 64 bit version myself. Saddly I can't find any source archive... So I decided to download the source with git. This works well. But when I open the CodeLibrarian.lpi in lazarus I got a message saying that the package evsControls is missing. Where can I find evsControls ?

I think you should publish an archive with sources of CodeLibrarian and all the required third party components. Or even better, 64 bits linux package. I know it's a pain to generate binary packages for all systems in the world so for me a simple all-in-one easy to build source archive would be perfect.

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Code Librarian enhancements.
« Reply #26 on: September 21, 2014, 12:00:14 pm »
I don't know if C.L. already does this...

Some code snippets will have a  minimum Laz/FPC version requirement.   Some will also have dependencies on particular units/components.  Some will be OS-specific or interface-specific.

Are they tagged in this way?
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Code Librarian enhancements.
« Reply #27 on: September 21, 2014, 05:21:11 pm »
I don't know if C.L. already does this...

Some code snippets will have a  minimum Laz/FPC version requirement.   Some will also have dependencies on particular units/components.  Some will be OS-specific or interface-specific.

Are they tagged in this way?

No they are not taged in any way. Nice one, So I think something like
1) OS (win, linux, MacOS, rasbpi, ......) : dynamic ee the end user can add his own but can not touch the defaults.
2) Lazarus Version :static value you need to do an update to get new values in there.
3) external libraries I think it would be best to put them as comments inside the code.

Something I missed?
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Code Librarian enhancements.
« Reply #28 on: September 21, 2014, 05:40:00 pm »
Non-user chiming in:
- Widgetset (e.g. Win32 or GTK2 or Qt or FPGUI on Windows are possible, likewise Qt/GTK2/... on *nix, etc)?
- Perhaps populate the list of external libs in your data structure instead of relying on comments? Probably a few cover most eventualities (zeos, synapse, indy, dcpcrypt,...) and as long as you're not using plain text but fields of some sort...?!?! You could always use the very useful "other" category :)

See my post on the other thread on svn/git/hg integration...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Code Librarian enhancements.
« Reply #29 on: September 21, 2014, 06:35:58 pm »
Non-user chiming in:
- Widgetset (e.g. Win32 or GTK2 or Qt or FPGUI on Windows are possible, likewise Qt/GTK2/... on *nix, etc)?
- Perhaps populate the list of external libs in your data structure instead of relying on comments? Probably a few cover most eventualities (zeos, synapse, indy, dcpcrypt,...) and as long as you're not using plain text but fields of some sort...?!?! You could always use the very useful "other" category :)

See my post on the other thread on svn/git/hg integration...

You are right Widgetset should be included.
The external libraries hmmmm. I fill that I'm going to regret adding this. Its a lernaean hydra situation, every library comes with its own dependencies and so on and so forth...... it is going to be a hell to maintain.

Thanks for the pointer about the svn thread I would have missed your comments.

Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018