Click here to Skip to main content
15,890,506 members
Everything / Templates

Templates

templates

Great Reads

by Bruno van Dooren
How concepts can be used in template programming for partial specialization
by Kunal Chowdhury «IN»
Customized Scrolling in Silverlight using Expression Blend
by Vincent Maverick Durano
The new version of ApiBoilerPlate has recently been released. In this post, we will take a look at the new features added to the template.
by Anton Chibisov
This tutorial showcases how to implement C++ delegates which are capable of being bound to methods and functions having arbitrary signature, i.e., any number and type of parameters and return value.

Latest Articles

by Bruno van Dooren
Ways to enforce an interface contract on static methods, similar to what you would expect from static virtual methods if they'd exist in C++
by Bruno van Dooren
How concepts can be used in template programming for partial specialization
by Bruno van Dooren
This article describes a way to hash data using the latest Win32 API and C++
by honey the codewitch
Make your projects far more powerful with some foundational code templating techniques

All Articles

Sort by Updated

Templates 

5 Jan 2015 by .Net Jim
Appeal to Silverlight senior coders out there. I am a .Net developer with a few years of ASP.Net and a year or so Web Forms, and 6 months of Silverlight and WPF.I have a datagrid on a tab in silverlight that must total itself based on check columns selected. Columns are annual budget...
14 Dec 2016 by 8421441333
I am planning to develop new MVC site which is fully responsive I Needbest Template for my site with all basic functionalities like Forgot password menu render Accordingly User Role custom authorization according to user role etc.Please Help.What I have tried:I have google so much i...
13 May 2012 by 915086731
I get some compiling errors about template instantiation , but I can't find where the syntax errors happens. Can some help me?template class SingleList;template class SingleListNode{private: friend class SingleList; SingleListNode()...
25 May 2012 by 915086731
To my gcc , just modify the following statement friend ostream& operator(ostream& os,SingleListNode& sln)to friend ostream& operator& sln)
13 Feb 2013 by __UFNHGGI_H__
template class MyTempl1{public: void F1() { const char* typname = typeid(T).name() + 6; printf("%s\n", typname); }};class Cl1 : public MyTempl1{};:D
6 Feb 2014 by Abbas K
Hi,I have created the project template for my MVC projects.And also I have created the wizard for these templates. Now I have used the project templates names are MVC3Razor,MVC4Razor,MVC5Razor, MVC3Aspx,MVC4Aspx, MVC5Aspx. Right now I have used 6 templates for my MVCprojects. Now I...
31 Aug 2011 by Abhinav S
AFAIK, there is no control that does this for you.So you will need to build something of your own.This article[^] might give you some ideas though.
28 Jul 2013 by Abrar Fahad
Please Help me To create customized a gridview with template from this data which is given below and the WPF xml view is given below just under the code.public partial class MainWindow : Window { List Employeedatalist = new List(); ...
18 Dec 2012 by Adam R Harris
Or you could you know ... pay for it and by extension pay the web designer that actually designed it. Either that or use it as inspiration and open up photoshop yourself and create it.Those designers work hard, just like us developers, and i think you will be hard pressed to find someone on...
13 Apr 2012 by Aescleal
It sounds like it would work, however without seeing the code I can't tell for sure. As you're a VC++ user perhaps download mingw (gcc for windows) and give it a whirl. If something compiles on VC++2005 or later and gcc 3.3 or later I'm usually happy it's standard code.Just to satisfy my...
14 May 2012 by Aescleal
The zeroth thing to do with template problems...Grab the latest compiler you can.The first thing to do with any template instantiation problems...Get rid of the template. Now I know this sounds weird but if you replace hard-code everywhere the compiler might give you an idea of...
17 May 2012 by Aescleal
The first thing to try when a template doesn't work is to get rid of it - manually instantiate the thing with the class(es) you want to use and see what happens. A handy hint for developing templates is always start with a non-template class then parameterise the things that you want to vary one...
21 Nov 2014 by Aescleal
As it says in the error message, where's your default constructor for parent?If the compiler doesn't see an explicit reference to a base class constructor in the derived class initialiser list it'll try and generate a call to the base class default constructor.To avoid this you need...
14 Aug 2019 by Afzaal Ahmad Zeeshan
To this date there is no search engine created to find the templates being used, and most templates developers don't leave out the information about the template, only their contact information so that you pay them to get a template. From the content, it looks like this website is to book a...
10 Mar 2015 by Agent47newbie
Hello, I am new to printers & reports in .Net. My queries might seem childish. Thank you in advance for your patience.Requirement:Using windows forms application(c#)1.Print line items to an already available invoice sheet template(custom page size)2.Print reports in A4 size...
15 Dec 2019 by Ahmed Bouchefra
How to send Ajax requests in Django 2 and Python 3.7 to add CRUD operations in your application and manipulate your Django models and database without having to refresh your web pages each time
15 Dec 2019 by Ahmed Bouchefra
A Django 2 CRUD example application using generic class based views using the latest Python 3.7 version
15 Jan 2020 by Ahmed Bouchefra
In this tutorial, we’ll see by example how to create a CRUD application from scratch and step by step. We’ll see how to configure a MySQL database, enable the admin interface, and create the django views.
16 Jan 2013 by Ajay Vijayvargiya
Covering the nitty-gritties of C++ templates.
16 Apr 2011 by Albert Holguin
don't forget that correlation depends on the current state of the input data and a number of frames of old data (depending on correlation size), with recorded data, you have the present, past, and future data all available. in real-time you only have present data, make sure you have enough old...
24 Sep 2013 by Albert Holguin
Getting the error:error C2027: use of undefined type 'T'While including a template header with the following definition://** Maximum value in a vector **//template T max(vector& input,int* index_of_maximum = NULL){ vector::iterator i = input.begin(); T...
24 Sep 2013 by Albert Holguin
There's a macro definition in windef.h that's name max() that resulted in this problem. The code is fine, just need a different name that won't conflict with any MS defined macros.
2 Sep 2011 by Alexander Bessonov
A simple high-level IPC library with ability to use native C++ interfaces.
13 Sep 2013 by ali rez
well, i was following one of the tutorials in this site, and was developing my own template, now, the problem is, for part of the script, i need to check more than one parameter, so naturally i tried this ---> $if$($a$==1 || $b$==1)
18 Oct 2014 by Andreas Gieriet
Try leaving away the address-of operator while instantiating the function and pass the data in the template by reference.CheersAndi
2 Apr 2021 by Andreas Gieriet
g++ tells error: need ‘typename’ before ‘T::abc’ because ‘T’ is a dependent scope typedef T::abc local_type; You might want to turn the time back and compile with the matching C++ standard setting on your compiler. E.g. for g++, there is a...
7 Apr 2012 by AndreFratelli
Hello everyone,I have the following hierarchy:std::map ->assoc_map ->_tActionMap_tActionMap maps actions (Action) with moods (Mood). The problem is: Mood has an intensity value which is mandatory, so there is no default constructor, and I don't want one.Now, templates only...
3 Jun 2014 by Ankesh Dave
This article explains the basic usage of MVC Template System
13 Apr 2015 by Anton Chibisov
This tutorial showcases how to implement C++ delegates which are capable of being bound to methods and functions having arbitrary signature, i.e., any number and type of parameters and return value.
1 Dec 2014 by Arkadeep De
first of all take look on the structure of the admin panel...differentiate the header menu and content. copy the resources(images, css, js) in your solutions explorer.if you took master page then put the header side menu and footer in the master page and in the content put the content...
27 Dec 2010 by Ashish Kaila
Declaratively and visually create custom windows in WPF
12 Oct 2013 by ASP.NET Community
Template MethodThe Template Method is know as a behavioral pattern which lets subclasses implement behaviour that can vary. In the example below we
19 Sep 2011 by barneyman
I'd be more inclined to just use an STL container - vector or similar
12 Nov 2010 by basementman
1) make your CXXXtoolbar member a public member in mainfrm.h2) include mainfrm.h in your view class cpp3) use code like this below to access your toolbar:CMainFrame *pFrame = (CMainFrame *)GetApp()->m_pMainWnd;if (pFrame) pFrame->m_wndToolBar.DoSomeFunction();
1 Feb 2011 by basementman
For optimal performance, use char[xx] variables and pointers and avoid making many copies of the strings. Concat in place, and split with pointers or array of pointers, nulling out the split characters in place.
5 Nov 2022 by BernardIE5317
Greetings Kind Regards The routines below do not compile w/ error messages shown. I am mostly interested in the first routine assert_Search_results The error refers to a template parameter being shadowed. I do not know what that means. I seek...
2 Oct 2014 by biicode
This posts tries to introduce template metaprogramming to the average C++ programmer, showing how it works, what can do, and finally leading with its problems trying to make it easier than in the old days of C++98, thanks to C++11 and C++14 language improvements.
13 Oct 2012 by blackhattrick
Hi,I made a template class for a linked list. List.h has the class definition and List.cpp has all the function members for inserting a node, deleting them, etc.When I compile my project (VS2010) I got the linker error "LNK1120 unresolved externals"I found that due compiler issues,...
13 Aug 2023 by Brennon Nevels
My friend and I are building a text-based game. But the problem so far is I cannot figure out how to resolve this problem. The goal was to make two functions. One to print a vector and another to find a specific element within. #include...
2 Feb 2023 by Bruno van Dooren
Ways to enforce an interface contract on static methods, similar to what you would expect from static virtual methods if they'd exist in C++
26 Aug 2022 by Bruno van Dooren
This article describes a way to hash data using the latest Win32 API and C++
8 Sep 2022 by Bruno van Dooren
How concepts can be used in template programming for partial specialization
3 May 2016 by Cansisti
I want to create a class that stores undefined number of variables of any type (or their pointers actually).What I have tried:// ThEz.hppusing namespace std;class ThEz{ private: map mx_; public: void add( string name, void * ag ); ...
21 May 2016 by Cansisti
Something like this:template class Foo {};The class is going to load binary file and cast it onto given structure.I found template compiling. Is this proper way?What I have tried:The code above, and searching google as well. Everywhere struct type...
25 Sep 2013 by Captain Price
Back in the days when C was widely used than C++, how was the data structures handled ? I mean when creating data structures in C++, we usually get the use of templates, which is a huge advantage for the programmer. With C++ you can implement a linked list (or some other data structure) once and...
12 Oct 2013 by Captain Price
It compiles because it is a feature in C++. T& is an lvalue reference and T&& is an rvalue reference.T a;T& l_ref_to_a = a; // an lvalue referenceT&& r_ref_to_a = a; // an rvalue reference"An rvalue reference to A is created with the syntax A&&. To distinguish it from the...
3 Nov 2015 by Carlos Calzadilla
What is my style missing that I am unable to support DisplayMemberPath correctly? My object is showing as just the namespace and not the display value that it binds to. When I comment out my entire style for combobox & comboboxitem the binding works as intended but I lost the visual the app...
23 May 2011 by Charles Keepax
I am slightly confused by these lines:templateAs far as I am aware this is not valid C++, it could be part of new C++0x stuff as I haven't had time to review that in detail yet. But anyway you shouldn't require to use any new features to solve this problem so I...
22 Nov 2012 by CHill60
An almost identical question appears with some answers here http://www.telerik.com/community/forums/aspnet-ajax/grid/textbox-in-radgrid-textchanged.aspx[^]Probably the best response was to look up the help information...
16 Nov 2018 by CHill60
Try posting your question in the correct forum ... https://help.zoho.com/portal/community/zoho-sites[^] or better yet, try the FAQs - https://help.zoho.com/portal/kb/articles/can-i-import-my-own-templates-14-5-2018[^]
3 Jan 2013 by chris_on_web
I want to set a background image and repeat only vertical on y.my code is
10 Aug 2011 by Christian Graus
Yes. You should google for templates that are compatible with the blog you're using. Or you can pay some designers to create more for you.A website template is a template for a given system, without knowing what you're using, I don't see how you can hope for more specific advice.
18 Feb 2011 by Christopher R Davis
11 Mar 2022 by Claudiu Ene
I got the next template: template struct List { struct node { T key; node* prev; node* next; }; node* first = nullptr; node* last = nullptr; // functions }; Using an outside function I need to compare 2 Lists, but the...
17 Jan 2016 by cmbay
I am creating a WPF Custom Control Template and I would like one of the GeometryDrawing Brushs to use the Background Brush of the control's container. For example if I put this control on a Window I would like this particular Brush to use the Window's Background Brush. Like wise if the control...
12 Feb 2013 by Code-o-mat
Hey.I generally see two ways of doing what you wish (there might be more of course):1. Use Run-Time Type Information[^], see the link for more details. You could try using the type_info[^] class' name() method.2. Have a -potentially virtual- function in your classes that can return a...
3 Aug 2014 by Codes DeCodes
I am about to start a new project where in I am thinking to develop asp.net website from scratch.. However, I had heard of the templates available so we do not need to work hard on creating asp.net websites from 0 level. I am about to develop a asp.net website to automate working pattern of...
10 Jun 2011 by CPallini
Why don't you use, like us common mortal, a static variable? e.g.void doit(){ static bool already_done= false; if (already_done) cout
14 May 2012 by CPallini
Try to add the following two lines (deferred declarations):template class SingleListNode;template ostream& operator& out);template class SingleListNode{
25 Nov 2013 by CPallini
Simply stated, you cannot. C++ programming language provides no reflection facilities. However you might implement your own mechanism (for instance, MS did it with IDispatch).
29 Jan 2015 by CPallini
Yes, it looks you are on the right track. However, you know, constructors should have the same name of the class.
3 May 2016 by CPallini
Actually your code compiles with g++ (I am using version 5.2.1). It gives 'undefined reference' for the th1.add call, but that's correct, since you never defined it.
2 Sep 2021 by CPallini
Try #include #include using namespace std; template void passarray(vector & myvec, T value) { myvec.push_back(value); } template void givevalue(vector & v){} template
11 Mar 2022 by CPallini
typename does the trick, try //.. typename List::node* currentL1 = L1.first; typename List::node* currentL2 = L2.first; // ..
4 Apr 2012 by cpquest
Hi all,I am in need of dropbutton some thing like this as below. i tried with ToggleButton but its not as like this so any one can share you template that you have done before as like this. (this can be found in Windows 7 explorer ). Image Link
8 Apr 2012 by cpquest
Hi,i found the soution my self. please follow the below link.http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/ab48d819-a8c4-45a7-acb3-b82ab94b19e6[^]
3 Jan 2013 by CrankNet
I'm Beginner in PHP & I want to build Wordpress Templates.Please Can Someone Guided me & show me How I can Start my Work,For Example: What I need to learn & Which Software I Will use for Design or Coding my templates?Please Help me & Thanks for all !
20 Mar 2017 by csrss
Hi there. I am trying to check for a template type if it is a pointer, basically my goal is to create a container class, which will know how to compare objects irrespectively if the object is pointer or not. I want a class to dynamically select comparing method. My current code is below, but it...
18 Oct 2014 by CubbiMew
Since data is an out-parameter (you're trying to populate it within genRand and make the result available in the caller, right?), you need to take it by reference:templatevoid genRand(T& data, int size){ ...genRand(smallVector, smallSize);genRand(smallArray,...
24 Jan 2014 by Cuccurullo.Alex
Hi everyone, I am trying to create a CustomUser control, because I need a base template for all userControls in my App (I'm trying to make a Single-Window-Application) with a sort of Window-in-Window, where the userControls are sort of windows in the MainWindow.xaml.To make it I tried to...
24 Jan 2014 by Cuccurullo.Alex
I solved this on my own by creating the template in the constructor of my control.. It was not easy but I did it..Here the code I wrote.this.DataContext = this; var template = new ControlTemplate(); var mainGrid = new...
7 Feb 2014 by CzimerA
Hello Everyone!I have a problem with an old project, that they want me to compile in Visual Studio. This application was working in QtCreator with gcc compiler, but while in VS10 with Qt implementation it has some compile errors. The linker doesn't find the methods in the dll. This is a...
13 Oct 2012 by Dave Kerr
For layouts such as this, I would strongly recommend using the Grid 960 system:http://960.gs/[^]This will let you create three columns in a fixed width container - you can also create the header and footer with this layout system.This is a very good approach - it is commonly used so...
14 Dec 2016 by Dave Kreskowiak
Only YOU doing the research into any templates is going to answer your own question. You're the one with all the requirements. There's a ton of templates out there and only YOU know all of your requirements, likes, and dislikes. Only YOU are going to be able to say which one is "the best".
30 Mar 2016 by DaveAuld
Look into the Jade Templating engine and the required syntax
29 Oct 2012 by David Corne
A class to represent valid/invalid data and using the mutable keyword
12 Jul 2013 by David O'Neil
VS 2012 gives an 'error C2248: ... cannot access protected member declared in class...' in the following minimal code stripped from a complete project. VS 2008 has no problems with it, and executes as expected.The line right before the issue calls the protected member in question, and no...
3 Nov 2014 by David Serrano Martínez
You have not lifted your finger off the mouse button yet when the calculation is served.
2 Mar 2013 by David Serrano Martínez
Suppose I have the following toy class:class my_class{ // A, B and C types defined elsewhere... typedef std::shared_ptr a_ptr_type; typedef std::shared_ptr b_ptr_type; typedef std::shared_ptr c_ptr_type; a_ptr_type a_ptr_; b_ptr_type b_ptr_; c_ptr_type...
7 Aug 2016 by David_Wimbley
The way to attach an installer to your windows service is the following steps1) In new project setup, select Windows -> Windows Service project template2) Select/double click on Service1.cs3) Right click on the Design window that opened from step 2, and select "Add Installer"4) You...
6 Sep 2016 by David_Wimbley
Ok so if i understand your issue correctly. On this articleNarendra Modi Speaks Against Pakistan at G20 Summit | Shailesh Tripathi[^]You want the text India's Foreign Policy against Pakistan.To appear a bit larger.So to achieve that, you'll take this code blockIndia's...
11 Apr 2013 by debil123
Sorry if my English or my coding conventions are bad.std::list is the STL list.I am trying to make a library that will use std::list::iterator and std::list::reverse_iterator seamlessly to the user according to his choice.First, I wouldn't like to implement all std::list::iterator...
9 Apr 2024 by Deepam Singh
I want to create an advanced CMS site; features would be drag-and-drop, creating pages from templates, and editing pages. I have no idea how this would be done in PHP. Could anyone guide me on how this would be done? Is it possible to create in...
20 Jun 2021 by dimitronic ph
I am trying to write a library using expression templates, and I need to find a way to assign the expression in an variable without evaluating it (which is what I've found in every resource, eg Wikipedia ). Also, since I want to do this for...
4 Oct 2011 by Doc Lobster
Establishing a strong binding between enumerations and arrays
7 Jul 2011 by Doc Lobster
Be sure that your array has the right size - without using size_of!
21 Aug 2016 by ducdohuunguyen
I know of two ways to deal with friend function of a template class.The first way is make the friend function inline:header file A.h#ifndef A_H#define A_H#includeusing namespace std;template class A{ friend ostream& operator
29 Jan 2015 by dudicus1414
My assignment is to create a class that implements a safe resizable array, which can contain data of any single type.Use templates so that the data stored in the arrays can be of any typeProvide a "default" (no parameter constructor that sets the array to some reasonable default initial...
28 Jun 2012 by email2gtc
I am creating an application to recognize books by its spine. What I want to do is take picture of a book spine and match it with a database of books.I was hoping to use pattern matching and template matching for this. First i was hoping to search book by template matching using templats of...
1 Feb 2011 by Emilio Garavaglia
It depends on which operations you do most often on the string.One problem can be the way std::string is implemented: just try another STL implementation, like stlport[^]They use reference counted string, thus removing lot of buffer copy.Another can be the fact you do frequent...
3 Jun 2018 by Eng Kerollos Adel
New JavaScript library, this library makes display of HTML page from template and JavaScript object or object from API or from file easy with filter
2 Jun 2013 by eng.amir.ebrahimi
heyAre therer any tools to completely download a website template ? I'm not talking about "save as .." option at all ...I want css and images and ... on different folders , ready to use in visual studio ... ;)
16 Jun 2013 by eng.amir.ebrahimi
Hey palsI'm working with artisteer to make a template...and I have a problem I could'nt solve till now...I want to have a menu item with sub menus , sub menus are linked to other pages , but the main menu entry is not linked to any pages...I cant make main menu not being a link and...
26 Jun 2013 by eng.amir.ebrahimi
HiI copied and pasted an .html page to an .aspx file in visual studio . I added id and runat server to a link button , added a form tag with runat server attribute and added this code at the first of my code : %@ Page Language="C#" AutoEventWireup="true" CodeBehind="HostDomain.aspx.cs"...
1 Feb 2011 by Espen Harlinn
If you are doing text processing/parsing - you could consider usingGNU Bison[^]and flex[^]Remeber that you can use flex on its own, and it is reasonably fast :)Apart from that, I think you will find that nothing beats using pointers, and possibly reading files using ReadFile with...
9 Sep 2012 by Espen Harlinn
Have a look at ASP.NET Themes and Skins[^]Companies like DevExpress provide a range of pleasing themes[^] for use with their libraries and asp.net.Best regardsEspen Harlinn
18 Oct 2020 by Espen Harlinn
An introduction to C++ 20 concepts
2 May 2012 by Eugene Polyhaev
Fully functional groovy template scriptlets inside a docx document
10 Jun 2014 by Evgeny Zavalkovsky
SW Message Bus represents message flow abstraction mechanism in a complex, multithreaded SW system.