code-snippets

Easy way to share / discuss / collaborate on code snippets?

Some of my coworkers happen to live on other continents, and every once in a while we need to have a quick chat over some code snippet. E-mail is too slow, code reviews are clumsy, as for Yahoo Messenger... this says it all: My question is: what is a fast and easy way to share some small piece of code, possibly allowing real-time high...

A good Code snippet tool or plugin for Word documents?

Does anyone know of a good tool or plugin that enables Microsoft Word or OpenOffice Writer to add code snippets to a document in a clean manner? I'm not sure if such a plug-in even exists, so redirecting me to any other tool that can help me would be appreciated. ...

Code Snippet Storage on the Mac & local

I'm looking around for a local code snippet storage solution for my Mac. I've run into a for-pay solution called "code collector", but I'm being cheap. Sure, I could hack up a nest of scripts based around "grep", or maybe build a funky database solution, but I'd like someone else to take the work of said solutions. ;) ...

Sharing Visual Studio Code Snippets amongst a team of developers

Has anyone come up with a good way to share a set of Visual Studio Code Snippets (actual .snippet files that Visual studio uses) amongst a team of developers automatically? It would be great for other developers on my team to benefit from shortcuts I've created for myself, and vice versa. ...

Storing code snippets in eclipse

I'm a recent semi-convert to Eclipse after 20 years of using vi and gvim. One of the things I miss about gvim is that I could cut a bunch of different snippets of code into named buffers, and paste them at will when doing something like repeating a common idiom. For instance I'd have it so "ap would paste DatabaseHandle handle = null;...

Can source code examples be kept in a SQL database while retaining all formatting? If so...

Can source code examples be kept in a SQL database while retaining all formatting (tabs, newlines, etc.)? If so what data type would be used? ...

What license should I use for code snippets released on my blog?

How should I license the code snippets used in my blog posts so that people feel free to use it without painful restrictions? My (very limited) understanding of copyright tells me that without any defined license that everything is protected as copyrighted which would have severe limitations on other's use. There's a good discussion ab...

Tools for code snippet execution

By "code snippet execution", I mean the ability to write a few lines of code, run and test it without having to fire up an IDE and create a dummy project. It's incredibly useful for helping people with a small code sample without creating a project, compiling everything cleanly, sending them the code snippet and deleting the project. ...

Where do you get the best in-depth information for C# programming?

Where do you get the best in-depth information for C# programming? I'm looking for tutorials, examples, blogs, specialized forums etc. dedicated to c#. ...

What are the best software and templates for a programming blog?

I have a programming blog that was implemented using the default theme of Movable Type. To that, I have added myself a syntax highlighting plugin for adding code snippets. It's not the best thing in the world, but it served its purpose for a long time. Problem is my administrative interface's editor is no longer working so I think it's ...

How to avoid "!= null" statements in Java?

I work with java all day long. The most used idiom (code snippet) I'm programing in java, is to test if an object != null before I use it, to avoid a NullPointerException of course. But the code looks very ugly and becomes unreadable. Is there a good alternative to avoid this code snippet? Update: Pan, I was not clear with my question...

Repository of Code Snippets

I'm just getting started with C# and often find myself going back to other projects and reusing some snippet of code in a new project. Is there a good tool out there with which on can store all the little pieces of code they reuse again and again AND integrates with Visual Studio Express?? ...

Visual Studio code snippet for method?

In Visual C# 2008 Express I can type e.g. for{TAB}{TAB} and a code snippet pops in. Are there built-in code snippets for private/public/etc. methods as well? ...

How do you store your personal snippets database in order to use it everywhere (work, etc)?

I've read the several discussions about storing code snippets but I did't find the info that I'm looking for, so let's define it: At home, I have several side projects, most of them quite small, one large, and numerous little examples that demonstrate a specific language feature (for example, some template trick in C++). Since I think ...

How to convert imperial units of length into metric?

Here I am faced with an issue that I believe(or at least hope) was solved 1 million times already. What I got as the input is a string that represents a length of an object in imperial units. It can go like this: $length = "3' 2 1/2\""; or like this: $length = "1/2\""; or in fact in any other way we normally would write it. In ef...

Is there a service which will let me create a snippet of a webpage

I am looking for a way to get the essence or the most important aspect of a webpage? If I provide a URL, is there any external service which can accomplish this? I am not looking for snap.com like service as it provides a snapshot. I might be willing to even implement such a system on my own. For beginning I do not want to put excessive...

What is special about HashSet<T> in .NET 3.5?

Here's an interesting puzzle. I downloaded Snippet Compiler to try some stuff out, and wanted to write the following code: using System; using System.Collections.Generic; public class MyClass { public static void RunSnippet() { HashSet<int> h = new HashSet<int>(); } } But the above code doesn't compile. I get: "...

Change default XML comment snippet in Visual Studio

When I hit /// in Visual Studio, is it possible to change the resulting snippet from this: /// <summary> /// /// </summary> to this?: /// <summary></summary> ...

Komodo Edit: How to do some of these basic Macro and Snippet operations?

I am wondering how to do (or where to find documentation) on these basic macro and snippet operations in Komodo Edit. 1) FILE/IO: write a string to a temporary file from within a komodo javascript macro 2) FILE/IO: read the content of a text file into a string within a komodo javascript macro 3) INCLUDES: cross-reference local javascr...

Allowing code snippets in form input while preventing XSS and SQL injection attacks

How can one allow code snippets to be entered into an editor (as stackoverflow does) like FCKeditor or any other editor while preventing XSS, SQL injection, and related attacks. ...