3 ms·
I'm currently working on a little project that has a new spin on Pastebin. I'm playing with a Bayesian classifier (or attempting and learning a lot) to auto-det
by jwdunne 14y ago
I'm currently working on a little project that has a new spin on Pastebin. I'm playing with a Bayesian classifier (or attempting and learning a lot) to auto-detect the language and appropriately set the syntax highlighting automatically without a dropdown and a reload. The paste will also be saved automatically so there isn't a page load for anything.
I'm still hacking away and haven't got very far whilst I'm getting my head around the classifier. One other problem I've noticed is keeping track of ownership. One solution I have in mind is that there is no ownership: when it's modified it generates a new link to share with. It might be good for very simple code collaboration - I've tried doing this with Pastebin over Facebook chat and this should make the process a whole lot smoother.
I also need to think about how training will work. I envisioned it so that the user can train it i.e if it guesses wrong, the user would correct it by selecting the proper language and the program will learn for the future. I'd be putting a lot of faith in potential future users but I'm not expecting it to be big or anything, maybe just something me and my friends can share and work on code friction-free (some don't have GitHub/BitBucket/etc accounts, one doesn't like CAPTCHAs at all).
I'm currently going off 100% self-education here too so I'm having to get to grips with some other maths stuff like some symbols (such as | means conditional probability and _not_ to be confused logical OR), so if the project falls flat on its face at least I learned something from it :)
- michael_fine 14y agoWhy not just make it a branching model? Whenever a new user edits a paste it creates a branch off that paste. It allows seamless sharing, without links. Kinda like this: http://srctree.net/ http://srctree.net/
- jwdunne 14y agoOh wow, that's the perfect thing and achieves what I need and more. I didn't even think about being able to see the history of a piece of code. Thanks for showing me this. Much appreciated.
- icebraining 14y agoInstead of having users train the software, why not download and feed it a corpus of open source software? Writing a script that clones random Github/Bitbucket/Google Code projects and feeds the code to the trainer (using the file extension to get the language) should be easy enough.
- jwdunne 14y agoThat is a good idea. Might even be able to just get away with not displaying a language name or anything so if it's off a little bit, it won't matter much. For example, there'll be much less worry if some C# gets mistaken for Java in rare instances - I'm guessing in those instances the differences won't matter. Thanks for your input :)
- dougbarrett 14y agoThere's a jQuery plugin that actually does this very well. I'm using it on http://programmingnotepad.com/ http://programmingnotepad.com/ and it's a pretty flawless execution.