How do I index and make available reusable code? [closed] - code-reuse

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have many small files containing code fragments, pseudo-code algorithms, classes, templates, SQL-samples, etc., and I obviously cannot put all these into libraries. I need a practical method to index all of them, and to be able to make this index available to others.
What must such an index contain to
make searching easiest?
Are there any such repositories
available on the web? (So I can test
the techniques they use.)
Are there any applications already
written that implement this that I
can have a look at?
Possible duplicate: https://stackoverflow.com/q/90300/15161

If you're working with .NET / Visual Studio, you could look at adding them as code snippets
Code Keep is a pretty good online repo for CodeSnippets and has plugins for VS2008
What we've done at work is created a common account for the dev to use, so everyone submits to codekeep under a common login and then can retrieve everyone elses snippets.
Also it might be worth your while creating a developer wiki on your dev network. Somewhere that the old hands can leave documentation on your regularly used patterns & snippets and new team members can check for help. We use TRAC in house as an all in one WIKI / Issue Management / SVN Integration and it does the job nicely

Another similar result from searching StackOverflow: Best Application For Storing Code Snippets

You might want to try refactormycode.com or set up your own wiki for it. A wiki actually sounds like a good application here.

I find the only way to manage source code is in the source control repository. This includes templates and pseudo code algorithms.
How it's different from the rest of your code ?
I'm familiar with cvs that can be hosted for example here (setting up cvs server is not to complex task either) you can search the repository using cvsearch and browse it using cvs web client.
I'm not saying cvs is a best option just another one that fulfill all your need.
Code snippets is a not a good option, IMHO.

You can do a full-text index of your hard drive using a tool like Copernic, Windows Live Search, or Google Desktop. Then whenever you want a code snippet that does a specific thing, just search for the relevant keywords and there it goes.

Related

Most recommended framework to develop rich yet easy-deployable webapps [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
im getting into webapp's programmin Im very confused about lots of frameworks available, each one based in different languages. Ive found lots of them (and just test drive some of them) I have experience with Java, PHP, Javascript, CSS, HTML, Python (but never tried django), C/C++ languages
By now, the best I got with is Ruby On Rails. I don't have much knowledge of the ruby language but it does look pretty similar to python, i mean, it looks like an easy language. So, learning Ruby to use it with rails justifies it?
Ive found frameworks such as:
Spring (Java)
Django (Python)
GWT (Java)
Rails (Ruby)
These looks the more advanced and mature frameworks out there, so, what are your experience about developing webapps with different frameworks? What are the advantages/disadvantages of each one? (Or any other you would like to mention.) and good resources or books you'll recommend.
Ive read that java based ones are far more complicated and tedious, and Rails seems to be a nice middleground between complexity and effectiveness. Also GWT (Google Web Toolkit) seems nice to develop the UI as It gives you sets of widgets to use.
Im looking for a framework with rich user interfaces, to develop desktop-like apps for the web...
Any comments, ideas, suggestion would be appreciated!
Excuse my bad english! :)
Im looking for a framework with rich user interfaces, to develop
desktop-like apps for the web...
If that's the case GWT would be a good choice.
The rest of the frameworks you mention (and the majority of those labeled as "web frameworks") focus more on the backend, and don't provide many tools for the kind of frontend development you want. You need to combine them with other frontend frameworks to achieve that.
If you want to go for standard "server-side" java, I could recommend JSF with primefaces. It's a bit hard to get it first, but the community is wide and books/documentation are highly available. Primefaces as a rich set of widgets (take a look at the showcase) and it is very active.
Whatevver framework you will choose, I greatly suggest you to learn and use JQuery for your javascript needs. Personnaly jquery is now a must in all my web applications.
You will always find plugins and widgets ready to use based on jquery.
You should take a look at jquery-ui. It is a set of javascript widgets and utilities based on jquery.
Wish you good learning, and hope this will help :)

Which framework for a web portal accessing a couchDB? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'll soon have to develop a web portal accessing a couchDB. Of course, I have done some research already, however I'm not sure if my ideas will work out.
I will have an existent couchDB. There will probably only be one user available which gets read-access via the GET-method. The web portal will have to filter and display data for different users from that couchDB, so I'll need some kind of extra user-management.
So far I have only basic knowledge about web frameworks and technologies, however I am quite experienced in Java. So from my research so far, I was seriously thinking about using Grails, ExtJS or both. However, will I be able to easily access the couchDB from within those frameworks? I've found some concerning info about necessary patches for ExtJS that are not in active development anymore.
I did have a very brief look at couchApps, however I'm not sure if those are sufficient enough (especially because of the user-management layer, I will only have this one couchDB user for accessing the DB). Also I found Django, however I'm not at all familiar with Python yet. :/
I'd be very thankful if someone could help me out a little in finding a suitable framework.
Thanks so far!
I would suggest that you go with whatever you know the best. It sounds like you're going to have to ramp up quickly, so learning a whole new language is near impossible. A new framework would be difficult.
Any language that can encode/decode JSON and has good a good HTTP can speak to CouchDB without a problem. If you're most familiar with Java then you're in good hands: Jackson is a very popular JSON library and there are plenty of good HTTP libraries. Ektorp is the most popular Java library for CouchDB.
Or you could skip the entire middle tier. Write a JS application in the browser that makes calls directly to CouchDB. Have your web server provide the access management: only certain users can access pieces of the CouchDB API, limit the HTTP writing verbs, etc. One popular way of doing this is to direct all GETs to CouchDB and direct all PUT/POST/DELETE communication to the business layer.
But like I said, since this sounds like a work project I would do whatever is most comfortable for you.
Cheers.

Online SDK / IDE for Open-Source Projects [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Is there any online, editable, code base that can also compile the code?
This is more of an "I wish" than a question, since I've tried to find one with no success. It seems to me that there are a number of open-source, very popular systems which could be integrated for a great benefit to the open-source community.
An online collaborative tool, basically a wiki. Needs to have some versioning.
An IDE/SDK type tool - at a minimum just a syntax checker and compiler
If these two are combined, you would have an open source project that anyone contribute to. The way I see it working is like this:
Every wiki page is a single class
To update a class you must pass a syntax check, including not breaking any other classes that depend on this class
There are two kinds of users - administrators and contributors (who can be anonymous).
Administrators have to approve updates to classes before they can be included in a compile-able release. They also rate the changes that they "approve", which is a sort-of ranking system for the contributors. If security is a concern, you could say that every approved change is randomly assigned to another admin for approval, and if that person detects malicious code then the first approver is now suspect and may be removed from being an admin.
Contributors can download any approved release, and can optionally download a version that includes all of their own revisions that have not been approved yet. This is normally for their own testing, but maybe they just want to change a behavior, even if no one else likes that change.
Any class (that meets certain requirements) can be marked as a "root" class, which means it can be compiled with its dependencies.
The advantages with this system seem huge to me!
Participation with almost no effort. The work of joining an open-source project is normally at a minimum an hour or more. That is in addition to initially downloading and installing a compatible SDK tool.
Learning about open-source with much reduced effort. I see many more people joining in with a friendly, wikipedia style site that they can just browse through as a way of learning the code base
Better code base (refactoring) All those people who tweak wikipedia will be free to tweak source code too. Cleaner code will in turn be easier to read and maintain.
Easy customization If I want to add a feature to my favorite open-source software, I can just make a change and download the compiled version. No need to
This could be a build process for web servers. Plug this into updating a web-site, and it can replace your current build server. When a version is approved, it just deploys the update (presumably on a schedule so it is during low-usage hours)
I see a few down-sides, the same as those that already exist in wiki sites and open-source projects, somewhat amplified. But I think these all have somewhat standard
Public/anonymous contributions could be bad or malicious
Blocking "spam" contributions
Bandwidth of downloads (all those executable files)
CPU to compile all the versions
Does any such thing exists? If not, how feasible would it be for a team to put this together? Are there any other major problems that could kill this idea?
This idea just occurred to me one day, and I can't find it. I'm putting this "out there" partially to "establish prior art". This idea is free to be taken and used, just not free to be patented :p.
Perhaps you're looking for Cloud9 IDE?
From their website:
Cloud9 IDE is an online development environment for Javascript and Node.js applications as well as HTML, CSS, PHP, Java, Ruby and 23 other languages... Teams can collaborate on projects and run them within the browser. When you're finished, deploy it—and you're done!

MVC site search functionality [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
i need a simple site search functionality for my mvc app. some of the pages are static and some dynamic (like news articles that are entered in cms). I would like the search to handle both. is this product any good? http://www.sitesearchasp.net any other?
#stephbu - Thank you for the mention.
If you choose to use arachnode.net, you have the choice of either Lucene.NET or SQL Full-text Indexing.
There are some 'head-scratchers' with Lucene.NET, especially when establishing concurrent read/write/search scenarios, but as a static reflection of content it works very well.
If you want something that is free, and turn-key, try Solr(.Net) or Microsoft Search Server.
http://www.microsoft.com/enterprisesearch/en/us/search-server-express.aspx (this was free last I looked at it...)
Thanks!
Mike
Resist buying anything if you can - there are many free .NET based search engines out there. Favourite of choice would be Lucene.net, decent tutorial here:
Lucene Tutorial
It's fairly simple to setup, you control what data is indexed through the Lucene API. There are open-source spidering extensions like Arachnode out there if you need crawling. Its mighty powerful for indexing catalogues etc.
Guess it depends how important search is for your business relative to the cost of owning a search engine. Buying one will probably give you turn-key functionality, but no doubt will run to the same cost of integration if you want more advanced features.
You could also consider using Solr, which is a search engine Web service that sits on top of Lucene, and provides extra features such as hit-highlighting and faceted searching. .NET integration is available through the SolrNet library. Both Solr and SolrNet are free.
By using SolrNet you can easily index your database content. I use NHibernate for database access, and SolrNet also has NHibernate integration, so documents get automatically re-indexed when the content changes. You could easily set up a similar arrangement for your database access method of choice.
For the static pages, you could either submit the HTML programmatically or use a Web crawler (see this question for some suggestions). I haven't needed to do this, so I can't make any recommendations on which tool to use.

General Development Notes [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
During a typical day programming, I implement functions in a way that I would like to remember. For instance, say I tuned a DB insert function that, when I come across the situation again, I want to find what I did to resuse.
I need a place to keep the solution(what I did), and I need to find it somehow, which may be months or a year later. Using a mind map sort of idea, I was thinking about a personal wiki, but then I heard the stackoverflow podcast mention using this site for such a reason. Does anybody else keep track of slick things they've done so that they may find it sometime in the future. If so, what did you use, and in general, how do you use it?
i like to personal blog idea and using the stack for it. i'll try the idea of posting at the stack and then answering it myself, with the benefit of other people potentially giving their opinion.
As long a the stack will be around for a while :)
Jeff Atwood recommends using Stack Overflow for this kind of thing. Post a question (your problem) and then post an answer (the solution you found). This lets you share the information with the world, and maybe get some valuable feedback or better solutions.
(Wow, I got downvoted for repeating what Jeff Atwood said. I won't do that again, I promise.)
I use neomem all the time. I write notes to myself. Then I can later search for it.
You may find these questions useful
Where do you store your code snippets?
Tracking useful information
What is you preferred site for code snippets?
I use a personal Wiki, my del.icio.us bookmarks and my own blog for that. Usually my blog: When I learn something that I know I might stumble on again I write a short post in my blog.
I use WikiDPad or Wiki-On-A-Stick. It works not only for code snippets but also to take notes, record typical problems you get and how to solve them and documentation. Take my word for it, it makes your job a LOT more easier if you have proper notes... and add the power of interlinking to it and you have a killer resource. I have very bad memory and taking notes has improved my performance by an order of magnitude. It also saves you from having to ask someone the same question twice or thrice. Also, if anyone asks the same question, you can just helpfully point them to the wiki and they can read it and add to it if they need to.
The technical term for what you are thinking of is "code snippets", and googling for that will find you many programs designed to store them for a variety of platforms, including entirely web-based ones such as this one.
I set up dekiwiki on a server at work that my coworkers and I use for company specifics stuff but also for general programming tips that arise as well.
A simple wiki, may be useful. SeeTiki Wiki
I always put it on my blog. Not only am I able to get back to it later, there is also a chance that it can help someone else as well.
It's oldschool, but I keep notes in a notebook. Makes remembering solutions (or the problems that caused them) a bit easier. Usually I make 1-2 pages of notes a day.
The digital equivalent of this would be keeping a private blog or journal. Easy enough to add a search program to help you find stuff.
Worthwhile things that my boss might be interested in, like bugs and user calls all get entered into bug tracking software where it is more formally handled.
I use the excellent Trac project management system for my personal projects, and I use it's wiki as a brainstorming and note-taking tool. And, because it also hooks into the Subversion repository and the bug tracking system, I can link from my notes right to a particular section of code or a bug report.
I keep my personal projects on assembla. Wiki, Issue Tracking, Source Control... very useful.
Check to see if your editor has some kind of annotations feature. Ideally you could link a particular location in code with a small note, and store it in a centralized place. If it doesn't, that kind of plugin wouldn't be too hard to build, your biggest hurdle is going to be how to link the piece of code to a file (due to the volatile nature of code) and even that one isn't insurmountable.

Resources