Search Results

Search found 2491 results on 100 pages for 'snippet'.

Page 1/100 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • C++ snippet support in visual studio?

    - by Jeremy Bell
    I'm writing code in native C++ (not C++/CLR). I know that there is no built-in support for C++ with regards to the snippet manager and snipper picker interfaces, however I found a utility called "snippy" which supposedly can generate C++ snippets. Here is a c++ snippet that the program generated: <?xml version="1.0" encoding="utf-8"?> <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> <Title>MySnippet</Title> <Shortcut>MySnippet</Shortcut> <Description>Just a test snippet</Description> <Author>Me</Author> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal Editable="true"> <ID>literal1</ID> <ToolTip>just a placeholder</ToolTip> <Default> </Default> <Function> </Function> </Literal> </Declarations> <Code Language="cpp"><![CDATA[cout << "$literal1$" << std::endl;]]></Code> </Snippet> </CodeSnippet> </CodeSnippets> If there is support in visual C++, even in a limited capacity, for C++ snippets, how do I add them to my environment, and what are the limitations? All I need is support for basic expansion snippets that I can invoke by typing a shortcut and hitting tab, and which supports basic literals that I can tab through (basically, if it supports the above snippet, I'm good). If this can't be done, are there any free add-ons or extensions to visual studio that support snippets for C++? I'm using both visual studio 2010 and 2008, but I mostly write code in 2010 right now.

    Read the article

  • Insert a snippet from a Visual Studio macro

    - by Kyralessa
    I have a situation where I want to run a Visual Studio macro that has the user type something in an InputBox, then inserts a snippet and includes that text somewhere in it. Unfortunately, I can't figure out how to insert the snippet from macro code. It seems like it'd be something like DTE.ExecuteCommand("Edit.InvokeSnippetFromShortcut") or DTE.ExecuteCommand("Edit.InvokeSnippetFromShortcut", "theSnippetName") but those don't work. Any ideas?

    Read the article

  • Help me understand the code snippet in c#

    - by Benny
    I am reading this blog: Pipes and filters pattern I am confused by this code snippet: public class Pipeline<T> { private readonly List<IOperation<T>> operations = new List<IOperation<T>>(); public Pipeline<T> Register(IOperation<T> operation) { operations.Add(operation); return this; } public void Execute() { IEnumerable<T> current = new List<T>(); foreach (IOperation<T> operation in operations) { current = operation.Execute(current); } IEnumerator<T> enumerator = current.GetEnumerator(); while (enumerator.MoveNext()); } } what is the purpose of this statement: while (enumerator.MoveNext());? seems this code is a noop.

    Read the article

  • What is your most useful C/C++ snippet?

    - by maddizzyro
    Hello all, It seems that every project has an "util" module with various code snippets used throughout other files and which don't fit any particular pattern. I want to improve my "util" library, so please post here the most useful class / function / macro that you use in all your C/C++ projects. Please keep the entries small (under 100 lines) and give only one example per post. Thank you.

    Read the article

  • Using a SQL Prompt snippet with template parameters

    - by SQLDev
    As part of my product management role I regularly attend trade shows and man the Red Gate booth in the vendor exhibition hall. Amongst other things this involves giving product demos to customers. Our latest demo involves SQL Source Control and SQL Test in a continuous integration environment. In order to demonstrate quite how easy it is to set up our tools from scratch we start the demo by creating an entirely new database to link to source control, using an individual database name for each conference attendee. In SQL Server Management Studio this can be done either by selecting New Database from the Object Explorer or by executing “CREATE DATABASE DemoDB_John” in a query window. We recently extended the demo to include SQL Test. This uses an open source SQL Server unit testing framework called tSQLt (www.tsqlt.org), which has a CLR object that requires EXTERNAL_ACCESS to be set as follows: ALTER DATABASE DemoDB_John SET TRUSTWORTHY ON This isn’t hard to do, but if you’re giving demo after demo, this two-step process soon becomes tedious. This is where SQL Prompt snippets come into their own. I can create a snippet named create_demo_db for this following: CREATE DATABASE DemoDB_John GO USE DemoDB_John GO ALTER DATABASE DemoDB_John SET TRUSTWORTHY ON Now I just have to type the first few characters of the snippet name, select the snippet from SQL Prompt’s candidate list, and execute the code. Simple! The problem is that this can only work once due to the hard-coded database name. Luckily I can leverage a nice feature in SQL Server Management Studio called Template Parameters. If I modify my snippet to be: CREATE DATABASE <DBName,, DemoDB_> GO USE <DBName,, DemoDB_> GO ALTER DATABASE <DBName,, DemoDB_> SET TRUSTWORTHY ON Once I’ve invoked the snippet, I can press Ctrl-Shift-M, which calls up the Specify Values for Template Parameters dialog, where I can type in my database name just once. Now you can click OK and run the query. Easy. Ideally I’d like for SQL Prompt to auto-invoke the Template Parameter dialog for all snippets where it detects the angled bracket syntax, but typing in the keyboard shortcut is a small price to pay for the time savings.

    Read the article

  • Alternatives for the Snippet Compiler

    - by Marko Apfel
    It seems that the Snippet Compiler is not maintained anymore. So I need an alternative – also for getting syntax highlighting for code in publications. Preferable with the possibility to conserve this highlighting by copying selections to clipboard. Snippet Compiler does not allows this for selections – only by exporting the whole file content to clipboard with HTML- or RTF-formatting (File > Export > HTML to clipboard respectively RTF to clipboard). Today I switched to LINQPad. This application offers constructing LINQ-statements as well as compiling arbitrary code snippets. But there are some other alternatives too: CS-Script - The C# Script Engine CS-Script is a CLR (Common Language Runtime) based scripting system which uses ECMA-compliant C# as a programming language. CS-Script currently targets Microsoft implementation of CLR (.NET 2.0/3.0/3.5. sharpsnippetcompiler C# Snippet Compiler is a tiny IDE to create, debug and run your C# programs CsharpRepl C# interactive shell that is part of Mono's C# compiler. An interactive shell is usually referred to as a read eval print loop or repl. The C# interactive shell is built on top of the Mono.CSharp library, a library that provides a C# compiler service that can be used to evaluate expressions and statements on the flight. What I miss is an alternative with syntax highlighting like in my Visual Studio: Instead of:

    Read the article

  • Windows Live Writer Code Snippet Plugin

    - by schnieds
    I love Windows Live Writer as a blogging application and use it pretty much exclusively for writing my blog posts. The only downside is that I have found it difficult to get code snippets formatted correctly in my posts. Luckily a friend of mine, Tyson Swing, turned me on to a great code snippet plugin for Windows Live writer.[Read More]Aaron Schniederhttp://www.churchofficeonline.com

    Read the article

  • schema.org 'reviewRating' tag not recognized by google snippet testing tool

    - by saravanak
    I'm trying to add more structural information to my webpages by using the microdata format suggested in www.schema.org. The procedure seems straight forward but I'm having issues validating my results in the Google Rich Snippets Testing Tool. Check out this review page, here I'm using the 'reviewRating' property item to specify rating values for that particular review. I followed the same format as defined in schema.org/Rating but this markup fails validation in Google's rich snippet testing tool with the following error info. Item Type: http://schema.org/rating reviewrating = 5 ratingvalue = 5 Warning: Property "reviewrating" was not found.

    Read the article

  • VS 2010: Can't insert snippet using shortcut - incompatibility with resharper 5???

    - by mark smith
    Hi there, i recently installed some snippets that come with a framework i am using. And sure enought i checked via Tools > Code Snippet Manager and they are installed under "My Code Snippets". If i do insert Snipper (right click in code window) or CTRL K + CTRL X then i can search within all available snippets.... But i do believe its possible to just type the shortcut key (in this case it is mvvmlocatorproperty) and pressing tab inserts the snippet BUT when i type the shortcut key it is not recognizing anything... What am i doing wrong?? This is not an incompatibility with resharper 5? - which i have installed Any ideas really appreciated

    Read the article

  • Rich snippet for Google Custom Search - Schema.org

    - by Joesoc
    I am trying to extract the book URL from a link using microdata. The format is specified in schema.org. Here is my html. <div class="col-sm-4 col-md-3" itemscope itemtype="http://schema.org/Book"> <div class="thumbnail"> <img src="{{ book.thumbnailurl }}" itemprop="thumbnailUrl" style="width: 100px;height: 200px;"> <div class="caption"> <h4><span itemprop="name">{{ book.name }}</span> - <span itemprop="author">{{ book.author }}</span></h4> <p><span itemprop="about"> {{ book.about }}</span></p> <p> <a href="{{ book.url }}" itemprop="url" onclick="trackOutboundLink(‘{{ book.name }}’);"> <button type="button" class="btn btn-default btn-md"> <span class="glyphicon glyphicon-book"></span>Read </button> </a> </p> </div> </div> </div> When I use google snippet testing tool the JSON API returns book as a html link. However when I make the call in javascript the value of url is text("Read"). What am i missing ?

    Read the article

  • VS 2010 snippet manager and quickCode

    - by Michael Freidgeim
    During the last few years I've used QuickCode and it was very helpful. VS 2010 has  Code Snippets Manager that MS finally made quite convenient to use, so I will use it in a future.   I will need to convert my QuickCode commands to VS snippets. I am sure I will miss Alt-Q hotkey for some time.

    Read the article

  • dpkg snippet isn't working for me when fixing / installing dockbar

    - by user3924
    I'm trying to use this code from webupd8 to fix the problem I have. It seems it didn't work. sudo dpkg -i --force-overwrite /var/cache/apt/archives/smplayer_0.6.9+svn3595-1ppa1~maverick1_i386.deb Here is the output from my attempt to install dockbar : $ sudo dpkg -i --force-all var/apt/cache/archives/dockmanager_0.1.0~bzr80-0ubuntu1~10.10~dockers1_i386.deb dpkg: error processing var/apt/cache/archives/dockmanager_0.1.0~bzr80-0ubuntu1~10.10~dockers1_i386.deb (--install): cannot access archive: No such file or directory Errors were encountered while processing: var/apt/cache/archives/dockmanager_0.1.0~bzr80-0ubuntu1~10.10~dockers1_i386.deb Is there any way around this?

    Read the article

  • Multiple CodeSnippet in an XML .snippet file

    - by Frinavale
    I'm attempting to supplement the help features for my code by providing other developers with code snippets. These produce skeletons of code which demonstrate how to use/call my classes or methods. I've created a .snippet file and have placed it in the "%Visual Studio Folder%\Code Snippets\Visual Basic\My Snippets" folder. I've used the Code Snippets Manager and ensured that it included this folder so that I can access the snippets. Everything works well when I have 1 CodeSnippet tag within the root CodeSnippets tag.... When I add more than one CodeSnippet tag to the file (each with their own title, and their own code example) I'm experiencing something strange. The first CodeSnippet I've added contains code for adding something to my system, the second contains code for editing something in my system, and the third deleting something from the system. When I use the code snippet by right clicking and selecting "Insert Code Snippet", only the first code snippet in the file shows up as an option. When I select it, the code in the first CodeSnippet is inserted....but so is the code within the other CodeSnippet tags. Do you have to have a separate XML .snippet file for each code snippet you want to make available? After reading through MSDN about creating Code Snippets I was under the impression that this could all be done within one file. It seems that I'm not understanding something very basic here and would love to find the answer but apparently Code Snippets are under used so finding the answer has proven to be a little trickier than I first thought it would be. Thanks, -Frinny

    Read the article

  • Tools for code snippet execution

    - by nzpcmad
    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. I'm not asking about the best code snippets or a snippet editor or where to store snippets! For C#, I use Snippet Compiler. For Java, I use Eclipse Scrapbook. For LINQ, I use LINQPad. Any suggestions for other (better?) tools? e.g. is there one for Java that doesn't involve firing up Eclipse? What about C?

    Read the article

  • Problem writing a snippet containing Emacs Lisp code

    - by user388346
    Hi all, I've been trying to make use of a cool feature of YASnippet: write snippets containing embedded Emacs Lisp code. There is a snippet for rst-mode that surrounds the entered text with "=" that is as long as the text such as in ==== Text ==== Based on this snippet, I decided to slightly modify it (with Elisp) so that it comments out these three lines depending on the major mode you are in (I thought that such a snippet would be useful to organize the source code). So I wrote this: ${1:`(insert comment-start)`} ${2:$(make-string (string-width text) ?\-)} $1 ${2:Text} $1 ${2:$(make-string (string-width text) ?\-)} $0 This code works relatively well except for one problem: the indentation of these three lines gets mixed up, depending on the major mode I'm in (e.g., in emacs-lisp-mode, the second and the third lines move more to the right than the first line). I think the source of the problem might have something to do with what comes after the string ${1: on the first line. If I add a character, I have no problem (i.e., all three lines are correctly aligned at the end of the snippet expansion). If I add a single space after this string, the misalignment problem still continues though. So my question is: do you know of any way of rewriting this snippet so that this misalignment does not arise? Do you know what's the source of this behaviour? Cheers,

    Read the article

  • Creating a new Guid inside a code snippet using c#

    - by Rob
    I want to make an intellisense code snippet using Ctl K + Ctl X that actually executes code when it runs... for example, I would like to do the following: <![CDATA[string.Format("{MM/dd/yyyy}", System.DateTime.Now);]]> But rather than giving me that string value, I want the date in the format specified. Another example of what I want is to create a new Guid but truncate to the first octet, so I would want to use a create a new Guid using System.Guid.NewGuid(); to give me {798400D6-7CEC-41f9-B6AA-116B926802FE} for example but I want the value: 798400D6 from the code snippet. I'm open to not using an Intellisense Code Snippet.. I just thought that would be easy.

    Read the article

  • Is there a browser extension which can copy a webpage snippet/clip/scnapshot to clipboard

    - by Yuriy Kulikov
    I have to save links to web pages into a google drive document. What I want is to copy simple webpage snippet, similar to the one this G+ extension button does, to clipboard. One picture and page title as a link. I was looking for many days now and I still couldn't find anything which does the same thing. In the end the thing I came up with is to hit the G+ button and copy contents of the popup. I am wondering if anybody knows how can this be done right? Thanks in advance, BR, Yuriy

    Read the article

  • snippet generation in php

    - by daniel
    Hi, I have a long chunk of text that came back from a search query. I'd like to display a snippet of the text, not the entire thing, and highlight the search query within the snippet. I realize that decided what part of the text to slice can be complicated, and I was hoping for any ideas on how do to this? Thanks!

    Read the article

  • C++ code snippet for a new baby greeting card

    - by uvts_cvs
    A friend of mine sent me this code snippet to celebrate his new baby birth: void new_baby_name() { father_surname++; } The snippet is from his point of view, he is the father and the new baby get the surname from him. I answered with this: class father_name {}; class mother_name {}; class new_baby_name: public father_name, public mother_name {}; but I am not fully satisfied of my answer...

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >