Sign in to follow this  
Followers 0
Protocol

isnippet

88 posts in this topic

iSnippet (ic0de's code snippet manager)

After i saw kuny release a lot of text files containing snippets from ic0de and other forums i thought why don't we create an application to manage snippets (ive said this before to deadly) but never actually gotten around to doing it. Ive got next two days off work so if anyone is interested in working on such application please let me know. I've not worked with databases in years so will be rusty. We need to choose a database system to use or create our own system in order to manage all the snippets, i know delphi dabbler does something like this but i think that version is bloated and overkill. I was thinking of a small and simple application that can highlight code, manage snippets, back-up, merge and export snippets meaning we could share snippets/databases around the forum with each other, and it wouldn't just have to be limited to delphi, we could then expand it to other language as changes would only need to be on code highlighting really.

feedback?

Share this post


Link to post
Share on other sites

I would prefer to do iSnippet on subdomain (if availible) snippet.ic0de.org and store snippets in mysql db.

Share this post


Link to post
Share on other sites

i was thinking of a local app, you could have on a usb pen drive for example and access your own snippets where ever you go with inet access or not :P

Share this post


Link to post
Share on other sites

I was thinking of something like this using Scintilla as editorbase and sqlite as db.

Syntaxhighlight should be easy for different languages, with config files for different languages.

Maybe encrypt the db, so if it gets lost nobody else is able to read it.

@dn5 there are so many pastebin sides on the net, i would prefere to carry my snippets around with me on my usbstick.

Share this post


Link to post
Share on other sites

sotpot they are two subject areas where i have little knowledge and must bring myself up to speed, if you have experience please do share it by post up code examples in the forum as im sure it would help everyone including myself, reason for portable and local database is to carry around with me as im often jumping from machine to machine using a portable hard drive as my work environment, and home server as the backup. Hence why im always looking for nice small app to help me with my day to day activities. Searching in a snippet and by snippet name is a must as i find myself using some snippet more then others. IntToStr for example.

Share this post


Link to post
Share on other sites

Well, there are but still It would be good for youserlf to try doing something new. How ever you want, I'm in with you, even if I don't have anything up to my mind.

Share this post


Link to post
Share on other sites

Its not the code highlighting its the storing of the snippets which would be the crucial part, you could either store em as a single file (database) or have them stored in a directory as txt files and the app just loops through and lists them. the database idea would be better, if anyone wants to start or explain how to set up sqlite to start such task :P

Share this post


Link to post
Share on other sites

been reading up on xml seems to the way to do, as its designed to store data rather then display it, will keep things small when distributing no need for dlls or such to make the engine run like with many database solutions,

Share this post


Link to post
Share on other sites

What about doing an application that works with typed files . The snippets can be stored in the form of the typed file and can be displayed and arranged using listview ..

Share this post


Link to post
Share on other sites

Nice idea protocol, Actually why dont we have a iC0de tool section where the iC0de members release tools and applications under the iC0de name, I know steve had a few tools he made back in HH maybe he could update them and release it under the ic0de banner? I know it's kinda re-inventing the wheel when it comes to PE tools ect.. but it would be pretty cool to have a collection of iC0de tools available.

Share this post


Link to post
Share on other sites

once we get a collection of tools together then i dont see why not. no one's ever pm'd me or the like to have support on the board, was going to do a set or useful tools to release near xmas under ic0de + the other goodies ive got to release at xmas or new year as well hehe but thats for nearer the time,

tools i was thinking about were

isnippet,

inote (tray note manager rather then all stickys over the desktop)

itray (tray any app to the tray under its own icon or under one icon (stacked))

ilock (screen locker like pressing ctrl alt del but when you dont have permissons to do so, so like at uni or work)

just gotta get the time with work to get started, started on isnippet reading/researching xml and going to write my own small unit in the next few days.

Edited by Protocol

Share this post


Link to post
Share on other sites

I never released anything under ic0de name, but I always leave credits ic0de at first line. Good luck with projects Proto, I'm here :)

Share this post


Link to post
Share on other sites

been working on this application for a few days now, got the main interface set up alright just having issues with myself about the data being stored originally was going to use xml. but after research if you had a lot of snippets, all these snippets would be loaded into memory causing a lot of wasted resources. will have to research databases really and random access only way i think this is going to work unless anyone else has any ideas or contributions.

Share this post


Link to post
Share on other sites

have multiple xml databases? this would reduce the amount of data loaded at one time, maybe split the xml files up into category's. I think it would be pretty cool to include an option to connect to an online sql database which people can use. not a hard coded fixed sql database but something the user could input host, username, password, db-name... this way "groups" could have access to the same same snippets and add to if needed. if thats too big job then the ability to import other local xml databases would be good.

Share this post


Link to post
Share on other sites

unled2si.png

currently what i have trying to keep it slim and minimal mainly for a usb app. the option to do advanced logging into an online database could be done further down the line.

my very first original idea was to have a file (txt) for each snippet, then i decided against it as its just the same as using windows file manager to look for a snippet, so went on the track of a database xml was next but then ive found most xml parse load the whole file in to memory which is a no if you got a few large snippets, so need an new approach. reason i want a portable database is so it can be used on any machine without having to download it, you can however download a friends database if you wish to merge with yours for example but before i get to there need to get the back end database system sorted first.

Share this post


Link to post
Share on other sites

back-end isnt up to scratch yet, need to get it working before i can release it lol.

Share this post


Link to post
Share on other sites

Hey Protocol, Any progress with this project? I was looking through some of my USB HD's today and I notice I have huge coolection of assorted Delphi sources I have downloaded off the net or created myself and thought it would be a good idea at some point in time to sort the crap out and keep the good sources for refference and later usage. Why dont you upload it to snv server and post the link and maybe others can contribute to the creation of it? I know I would try and something towards it if it was posted.

Share this post


Link to post
Share on other sites

Its just the interface atm, havent had time with work and other things to really look into databases, i downloaded sqlite but havent had chance to play with. If you want the interface i can post that i spose.

Share this post


Link to post
Share on other sites

vn0D9.png

just downloaded sqlite from sourceforge and found a nice wrapper for delphi. I've just put together the above data model and was wondering if anyone with more experience with databases would look it over to see if im heading in the right direction.

@Departure if you want to work with me on this hit me up on msn or something?

CREATE TABLE tbl_categories (Category_ID integer primary key,
Category_Parent_ID integer,
Category_Name string);

CREATE TABLE tbl_snippet (Snippet_ID integer Primary Key, 
Snippet_Parent_ID integer,
LanguageSyntax integer,
Description string,
Code string,
Foreign Key (Snippet_Parent_ID ) REFERENCES tbl_categories(Category_ID));

I think these are translated correctly from my above diagram. haven't tested/executed the sql on a database yet still getting to grips with it. but could do with input from others.

Edited by Protocol

Share this post


Link to post
Share on other sites

I wish I had some database experience with delphi, I have always wanted to learn more about it but never taken the time besides from some small test codes following the codegearguru tutorials.

Yeah I will input as much as I can but my knowledge on database subject is very limited when dealing with sql stuff in Delphi. I will read up on subject and try and find a few examples to learn from, I will also download the sqlite and play with that.

Share this post


Link to post
Share on other sites

thats what i been doing, downloaded sqlite which im impressed with 400kb for a full database system that can be embedded or used as a dll, its stripped down sql (lean) so a few youtube videos and your rolling, thats how i got to where i am lol, just need time to test stuff really off for two weeks now :(

Share this post


Link to post
Share on other sites

trying to workout how to store a tree (like a treeview) in a sql database as this is the only real problem i have the rest of the sqlite is quite straight forward, insert(adding)/select(getting)/ delete (removing) i think my tbl design is ok, but just lack time to do it, as work has picked up atm and im on a 2month course 48hours a week with homework worse then school lol.

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0