Tagged Questions
The templates tag is used in multiple contexts: generic programming (especially C++), and data/document generation using template engines.
0
votes
0answers
5 views
Custom tags in my xml_block
I would like add youtube video in my "xml_bloc" here my code
[CustomTagSettings]
AvailableCustomTags[]=youtube
IsInline[youtube]=true
The news tags "youtube is visible in my back office. Here the ...
0
votes
0answers
4 views
How to change bug template invoked from test excution
I am using MTM 2010 and I need to change the bug template that is populated from the Test Result form or from the test case execution (I believe that both uses the same template).
Important to note ...
0
votes
0answers
5 views
What are the parameters for the Mediawiki template {{Special:RecentChanges}}
For the Mediawiki template {{Special:RecentChanges}}, I know you can control the number of pages shown. If you wanted to show only the last 10 pages, the code would look like this:
...
0
votes
0answers
8 views
shell isolated Item and Project Template
first of all, sorry for my english.
I create a Project template and item template for using in shell isolated, but I can't make that appears in Shell Isolated Application, when I go to ...
0
votes
3answers
37 views
Creating a template class object using a template constructor
I'm having trouble creating a class object from a template class in which I need the constructor to also be a template and accept a parameter when the object is created. However, when I attempt to ...
1
vote
1answer
35 views
C++ typetraits on class method: partial specialization if parameter is enum
My platform is Windows with Visual Studio Express 2012.
I have a templated method as follows
struct A
{
template<class T> void blub(T value);
};
I want to have several specializations ...
0
votes
0answers
11 views
Last entry in a loop in smarty
I have a problem with google code remarketing. I want to put a comma (indicated in the code)
<script type="text/javascript">
var google_tag_params = {ldelim}
ecomm_prodid: '{$item.code}',
...
0
votes
5answers
36 views
Using template in c++ - Returning values from method
I wanna a method that receives a generic type, and a generic type (that's defined in run time). In the example there's if I'm using a string type, It needs to return the first param lenght (in ...
0
votes
1answer
9 views
Slim templates on Ruby on Rails, what are best practices
I have trouble understanding basic Slim syntax.
First question, how to do you enter new line (line break)?
Second request, could you please rewrite the following snippet, I suspect I didn't do it ...
0
votes
0answers
10 views
Sencha Touch Lists: Adding Static Header/Footer Items
I have a nested list working great in my project and now want to style it. I want it so whenever the user clicks a parent item to display the contents, it will list the parent's display field followed ...
1
vote
2answers
41 views
Circular dependency in template class
I have a circular dependency simplified to the following:
// Bar.h
struct Bar {};
// Base.h
#include "Foo.h"
struct Bar;
struct Base {
void func(std::shared_ptr<Foo<Bar>> foobar); // ...
3
votes
2answers
39 views
c++ : syntax for is_member_function_pointer in a template declaration
I have a template with a declaration similar to this:
template <typename Arg0, typename... Args>
class blah {};
I have two versions of the template, and I want to use one when Arg0 is a ...
0
votes
2answers
51 views
Using Template in C++
I'm trying to do a generic method in a class, now, I have something like:
#include "stdafx.h"
#include <sstream>
#include <iostream>
#include <conio.h>
using namespace std;
class ...
1
vote
1answer
40 views
c++ : how does std::bind() 'know' whether the template args refer to a static function or member function?
Using bind() I can do both of these:
void f(int a) { }
class C {
public:
void f (int a) { }
};
int main()
{
auto f1 = std::bind (f,3);
f1();
C myC;
auto f2 = std::bind ...
2
votes
2answers
34 views
How to refer to typedef defined in template class
I'm new to C++ templates and I'm heavily struggling with some compiler complaints. I'm defining a class-scope type in a template class and want to refer to this type from somewhere else. I tried ...
2
votes
2answers
109 views
Extract just the argument type list from decltype(someFunction)
I have a variadic template that represents a list of parameters for a function, eg:
void myFunc (int,int,std::string) { }
template<typename... Args> class MyTemplateClass { };
...
...
0
votes
1answer
12 views
Magento: Previewing template / theme?
I'm a web designer creating a new theme for a client's existing site, I don't have full access to the server so I'm not able to create a staging site for the purpose of testing a theme...
Is there a ...
3
votes
2answers
66 views
Avoiding explicit functor template type
I'm playing with functors. I'm using the standard example below:
class C {
public:
template <typename Func>
void foo(Func fun)
{
fun();
}
};
struct S {
void ...
0
votes
0answers
12 views
How to make a complete page with links and images in css
I would like to make a template in css of a complete page, together with links and images, so that I can just change the nav bar of the template once only, and have it change on every page. I have ...
0
votes
2answers
46 views
How init pointer to data of templated ancestor
Just a sample code:
template <class T> class TempBase
{
protected:
string m_str;
};
template <class T> class Temp: public TempBase<T>
{
public:
void method()
{
string
...
-1
votes
0answers
13 views
Dynamic CSS changeable from website`s CMS
The situation:
I have a website with a single template (css,images,HTML,js).
Also have and a CMS connected to the website.
My customer wants to dynamically change everything from the website's ...
1
vote
2answers
30 views
Replacing the design of a Lotus Notes template with that of a database (or making the database a template)
Short version:
In Lotus Notes, is it possible to replace the design of a template with the design of a regular database? I tried to make the database a template, so it would show up in the Replace ...
0
votes
1answer
15 views
Not found SetResourceReference in new Groupbox I'm creating in code behind
I want to set a reference to a Template in a groupbox I'm creating in the code behind.In a example I found, they mostly use SetResourceReference method. However, I see that this method doesn't seem to ...
0
votes
0answers
8 views
How to set a child association template using acts_as_api gem in Rails
I'm working on a project that deals with Users and Events. An user can create one or more events. Besides, several users can attend to one or more events. My problem comes with this many-to-many ...
-1
votes
1answer
53 views
Implementing a linked list using c++ [on hold]
I'm just started learning C++ and as exercise I'm implementing a linked list the OOP way.
So far I have these classes:
template<class T>
class List
{
public:
//Class ...
0
votes
2answers
55 views
Play Framework Scala Template
I've worked around with Play Framework for a while but I'm almost new to Scala Templates
. For me as a C-familiar language developer sometimes it looks a bit strange
I was wondering if someone ...
2
votes
1answer
18 views
Multi Project / Solution Templates for Visual Studio 2012 with VSIX Installer and Nuget Packages
I would like to have a multi-project template that will create sub projects, and will install the nuget dependencies as well as have a vsix installer that will install this template.
Problems with ...
0
votes
0answers
35 views
Need design proposal for getting the type of a derived class
I want to implement a framework for analyzing different representations (CChannel) (with different approaches) of the same original representation (CTrainingData).
Due to the fact, that each ...
0
votes
1answer
32 views
Tokenizing a String for Multiple Types
I had gotten used to working with a function, in C++, that parses a string/buffer, delimited by a specific character, and would assign one of these tokens to a value passed in by reference, and ...
12
votes
2answers
121 views
Template specialization with type conversion
I have found this piece of bogus code (contrived example below):
template <int I, typename T>
struct foo
{
static int bar()
{
return 1;
}
};
template <std::size_t Index, ...
0
votes
2answers
44 views
Instantiate C++ templated class with arg, *and* as array
I have a C++ templated class whose constructor has a default argument.
Can it be instantiated with a nondefault arg, and as an array? (If not, why not?)
Either one works, but not both at once (in ...
4
votes
1answer
72 views
C++ templated cast operator - conversion from to non-scalar type requested
I am trying to understand how the cast operator works with templates.
Consider the following code:
#include <iostream>
using namespace std;
struct S {
int v;
};
class A {
public:
...
1
vote
1answer
23 views
check for boolean false in mustache.js
According to this question, checking for false in a json object that you pass to mustache template is done like this:
{{^like}}
it is false
{{/like}}
{{#like}}
it is true
{{/like}}
assuming ...
0
votes
2answers
50 views
variadic template parameter argument
I've a little problem in my code.
I try to create a function with variadic parameter, but when I compile it, it fail, and i really don't see why.
So if anyone could help me ...
here is my function:
...
0
votes
1answer
73 views
Is it possible to force a new template instantiation?
I want to have something like the following (psuedo-C++) class. The basic idea is any new value will be initialized to the last set value.
StickyData.hpp
template<typename T>
class StickyData ...
1
vote
1answer
35 views
Create transpose matrix function based on template C++
I am trying to create my first template using this amazing guide, but I run into the trouble for which I do not know how to handle multiple nested arguments:
The original function I created was ...
4
votes
2answers
68 views
constexpr with std::array - “Non-type template argument is not a constant expression” [duplicate]
I'm trying to implement the following:
#include <array>
#include <cstdint>
class Class2
{
};
class Class1
{
public:
static constexpr uint8_t GetMax() { return 5; }
static ...
0
votes
1answer
37 views
C++ : create custom function dispatcher from variadic template
I have some functions that read various types from serialized data, eg:
class DataDeserializer
{
int getInt();
std::string getString();
MyClass getMyClass();
}
I then have various ...
1
vote
1answer
38 views
How to specialize a templated member-function into a templated class in C++?
With regards to this question: How to create specialization for a single method in a templated class in C++? ...
I have this class:
template <typename T>
class MyCLass {
public:
template ...
0
votes
0answers
9 views
Equivalent of Underscore.js _.template in jQuery or Microsoft Ajax
Am just new to the underscore.js. Wanted to know the _.template function of underscore.js has similar concept or exists in JQuery and Microsoft Ajax library also.Pls help.
4
votes
2answers
60 views
How to specialize a C++ templated-class function basing on a type-dependent type?
I have a C++ templated class
// Definition
template <typename T>
class MyCLass {
public:
typedef typename T::S MyS; // <-- This is a dependent type from the template one
MyS ...
2
votes
1answer
52 views
Template class specialization for template class and other types
I have problem with my project, here is some test code, in project it looks same. Some of classes are plain but one of them is template class with 2 different types (class B) for example int and ...
3
votes
2answers
31 views
Better management of Javascript and html template files: Edit as many files, but use as one file
Background
Have a project that includes over 100 Javascript and HTML template files. Using a script loader (yepnope) that loads the files directly from our development environment so that during the ...
0
votes
0answers
35 views
+50
Designing a dynamic template
I am designing a laboratory system for an alloy steel company, in this system we have
some type of tests(e.g Analysis Test, Impact Test, ...) must be apply on each product in production line, I used ...
1
vote
1answer
30 views
How to proccess code in template
i have a problem, i want to proccess with first element in foreach loop in template as PHP code example:
Pls help me in template Meteor. Thank you so much
0
votes
2answers
23 views
Html5 template in Aptana Studio 3 lost, what happened to it?
I'm helping an org update its website. I had created a project in Aptana Studio 3 and at first I focused on cleaning up their folders, which were a mess. I went to make a new html file and I chose an ...
2
votes
2answers
106 views
C++11 - Way to detect the operator new[]
I'm trying to make something like this work:
struct holder {
std::function<void()> destroyer;
template<typename T>
holder(T) = delete;
template<typename T>
...
0
votes
0answers
11 views
Cygwin gcc compiler problems with template instantiation using GAlib
all, I am using Cygwin gcc 4.8.1 with Netbeans 7.3.1 on Win 7 pro x64. I tried to build the GAlib project but encounter the template instantiation issues:
g++ -g -Wall -I.. -c ex17.C
...
0
votes
0answers
28 views
HTML::Template, pass html element as variable
Is it possible to pass a html element as tmp_var with html::template?
For example:
use HTML::Template;
$template = HTML::Template->new(filename => 'index.html');
...
1
vote
2answers
23 views
including handlebars templates within a django generated page
I am using django to serve a page that includes a handlebars template. Mixing server and client side templating creates some ambiguity. If I have a template
<script id="my-script" ...