The templates tag has no wiki summary.
12
votes
7answers
897 views
Is template “metaprogramming” in Java a good idea?
There is a source file in a rather large project with several functions that are extremely performance-sensitive (called millions of times per second). In fact, the previous maintainer decided to ...
3
votes
1answer
291 views
Use a template to get alternate behaviour?
Is this a bad practice?
const int sId(int const id);
// true/false it doesn't matter
template<bool i>
const int sId(int const id) {
return this->id = id;
}
const int MCard::sId(int ...
3
votes
5answers
151 views
Do input template languages exist?
When I have to create some textual representation of data, I can use a template language, so that my code does not have to worry about the structure of the output file - I can sometimes even write ...
0
votes
1answer
65 views
How should templates be named? [closed]
In D I can create templates like this:
template Foo(A) {
A add(A a, A b) { ... }
A multiply(A a, A b) { ... }
A concatenate(A a, A b) { ... }
}
What should a template be named ideally? ...
-2
votes
1answer
92 views
Develop a website using mustache.js and PHP [closed]
I'm thinking of building a website using mustache.js to render the website and having PHP as the backend. The PHP will then mainly contain queries to the database and some SESSION checkings.
...
1
vote
1answer
126 views
heading in right direction? C++ and class templates
I'm working on some inherited code in C++ and am trying to use 2 classes with templates as I need 2-types of each class to operate on floating point or integer data (double v uint64_t to be exact).
...
0
votes
1answer
60 views
How to make C++ template stack work with basic data types and compound variables?
Templates are nice for similar algorithms of different data types. Say I make a template stack of a basic data type...
Stack<int> stck(10);
stck.Push(5);
I'd pop it...
int x = stck.Pop();
...
3
votes
4answers
238 views
What are the perks and drawbacks of using html templates versus building the html in-code [closed]
As far as I can see there are two ways of building a html page: "inside" the language (I'll call it building for lack of a better name) or outside the language (using templates). Let me explain a bit ...
0
votes
0answers
23 views
db data to template: where to escape strings
I have an applications that queries a database, then renders a asciidoc template with data from the db, and converts the asciidoc to pdf.
Now in the data there are certain characters that need to be ...
-1
votes
1answer
40 views
Load all templates at startup?
I am developing a jQuery mobile app. In this app, i often use Mustache.js templates in separate html files. Actually, every template is needed by the user, but my app loads a template (via GET method) ...
6
votes
1answer
432 views
“C++ Templates: The Complete Guide” (c) 2002 — up to date with C++11?
The book C++ Templates: The Complete Guide, (c) 2002, looks very appealing to me, but as it's 12 years old, I'm concerned it may be out of date. There are some highly favorable Amazon reviews dated ...
1
vote
3answers
474 views
Arrays vs Objects in view template
I am wondering, in view templates, what would contribute to me choosing between using arrays or objects for getting things printed out in arrays
{{$user->zip_code}} vs {{$user['zip_code']}}
I'm ...
0
votes
1answer
1k views
What exactly is bootstrap admin-template and how it is supposed to be used
So this is my second ASP.NET MVC 4 project. It's decided that for this one we will use this template and it was said in a way that I felt really stupid for not knowing how exactly this template will ...
2
votes
1answer
158 views
Main method templating
Now that I've gotten into a dependency injection groove, I find main methods for different applications all look basically the same. This is similar to stuff you might find on the Guice documentation, ...
3
votes
3answers
327 views
Custom PHP Template Engine
I've been developing a custom PHP template engine to suit just my needs and also to get a little more practice with PHP.
What I did was to create a Template class that simply receives as constructor ...
-1
votes
2answers
810 views
Why is C++ preferred over C for commercial applications? [closed]
I program in C mostly. However, it is pretty obvious that many more commercial applications are done in C++.
As far as I can tell, C++ is a very complex language, with seemingly convoluted syntax and ...
2
votes
4answers
2k views
php templating with codeigniter
I am currently develop a website application in codeigniter, and I'd like to do something in PHP / CodeIgniter where I can make a common template for separate sections of the website. I was thinking ...
7
votes
2answers
468 views
How do I avoid writing lots of pass-through functions in a wrapper?
I have a class, which wraps another class of a common base type. Because the base type interface is quite large this involves writing a lot of pass-through functions. I am looking for a way to avoid ...
4
votes
1answer
1k views
Does doxygen support templates for the HTML output?
I've documented my code for doxygen, but I don't want the default HTML it gives. I know I can customize it by providing custom CSS, headers, footers, etc. (like GNOME does), and how I can add common ...
0
votes
1answer
264 views
Why does flask use Jinja2 and not xpath?
I'm just starting out with python and since I'm coming from a PHP background (thus have to adjust my mind to wrap around new concepts) one major question still stands without answer - why does Flask ...
3
votes
1answer
99 views
Custom templating in a web application
I want to understand the pros and cons in generating dynamic web application controls.
The idea is to generate all the controls dynamically based on the database procedure output and populate the ...
6
votes
3answers
1k views
How do you handle increasingly long compile times when working with templates?
I use Visual Studio 2012 and he have cases where we added templates parameters to a class "just" in order to introduce a "seam point" so that in unit-test we can replace those parts with mock objects.
...
0
votes
1answer
171 views
Why should I use a web framework's template language over python's templating options?
I'm coming from a python CGI background and was wanting to move into something more contemporary and think I have decided upon web.py as the framework I would like to use. In regards to templating, ...
5
votes
1answer
95 views
How can I port msvc++ code with non-dependent names in templates to Linux?
I can deal with porting platform dependent functions. I have a problem that the compilers I tried on Linux (clang and g++) do not accept the following code, while the msvc++ compiler does:
template ...
1
vote
2answers
137 views
Convert plain text to a pdf template
I have some articles (more than 200 pages) in plain text. It needs to be converted to an given PDF markup. I got some Photoshop files for the headers for every page and a list of requirements for the ...
0
votes
0answers
292 views
Heredoc or an external template file in my bash script - how it affects readibility/maintanance?
I realise that this question may be down to personal preference but I'm pretty new to bash/shell scripting so thought it'd be worth some research to see if there's some sort of standard/best practise ...
6
votes
3answers
444 views
Differences betwen HTML templating systems
I'm looking at backbone.js and noticed that it supports various templating systems (they specifically refer to Mustache.js, Haml-js, and Eco, but I understand it can support even more)(like Pure and ...
2
votes
1answer
172 views
What is a “template” in Perl?
I can find all sorts of weird information about templates in Perl, but nothing about what they actually are.
Are they generic types like in C++? Is it a class-like structure? Or maybe something ...
8
votes
8answers
1k views
Is STL implemented with OO?
There are several design patterns like Adaptor, Iterator implemented in STL.
Does that mean STL is implemented with OO concepts?
What is the relationship between OO and template parts of C++?
I ...
2
votes
4answers
3k views
How to structure template system using plain PHP?
I was reading this question over on stackoverflow:
http://stackoverflow.com/questions/104516/calling-php-functions-within-heredoc-strings
and the accepted answer says to do plain PHP templates like ...
1
vote
3answers
506 views
Next step after creating mock-up screens
I have created some mockup screens for my app in HTML/CSS. I have 4 screens in total.
They contain no client-side coding i.e. Javascript or jQuery.
The screens themselves are quite bland at the ...
9
votes
2answers
310 views
What is a user-friendly solution to editing email templates with replacement variables?
I'm working on a system where we rely a lot of "admins / managers" emailing users from the database. One of the key features is being able to email several people at the same time, with specific ...
0
votes
1answer
316 views
Building a template engine - starting point
We're building a Django-based project with a template/generator component. This component will be separate from the project as such and can be Django/Python, Node, Java or whatever works. The idea is ...
5
votes
5answers
630 views
Would “Efficient C++” book be irrelevant now due to compiler improvements?
I am planning on purchasing this book to learn more about C++ programming with regards to fast code. However, the book was published in 1999 and I am worried most of it may be irrelevant now due to ...
1
vote
1answer
262 views
How should the cppcms template hierarchy be used
I understand that the hierarchy, in cppcms for templates, goes skin (topmost, representing a namespace), then view (representing a class) and finally template (representing a function).
I want to ...
3
votes
1answer
151 views
What conventions or frameworks exist for MVVM in Perl?
We're using Catalyst to render lots of webforms in what will become a large application. I don't like the way all the form data is confusingly into a big hash in the Controller, before being passed to ...
1
vote
1answer
415 views
What are the benefits of using both Scalate and Jade?
I recently did a little "tool roundup": If I were to program a website in Scala and Coffeescript, what frameworks would I go for?
I came across this great presentation: ...
3
votes
6answers
354 views
If Instance is for Class, what's for Template?
I am not able to find the right technical term to mention child or instance of a template.
What's the right one, child or instance or something else I am not aware of?
Sorry for my unclear original ...
1
vote
3answers
519 views
Effective template system [closed]
I'm building a content management system, and need advice on which theming structure should I adopt. A few options (This is not a complete list):
Wordpress style:
the controller decides what ...
4
votes
1answer
1k views
implicit vs explicit interfaces
I think I understand the actual limitations of compile-time polymorphism and run-time polymorphism. But what are the conceptual differences between explicit interfaces (run-time polymorphism. ie ...
0
votes
1answer
632 views
What's the best practice for rendering a different GSP template based on the type of object in a collection?
Let's say I have a collection that is setup in my controller, named "things." In this collection is a heterogeneous assortment of objects. Let's say some are of type "Thing" and some others are of ...
14
votes
8answers
1k views
How to spread awareness for generic programming among team members?
I am staying in an environment, where people believe:
Java generics are the feature exclusively used for library writing
and not for the real coding.
C++ is an OO programming language; template is ...
7
votes
2answers
932 views
In C++, were SFINAE and metaprogramming intentional or just a byproduct of templates?
SFINAE and template metaprogramming can do wonderful things and many libraries also use them considerably.
Historically both of these "magic concepts" were intentionally introduced/supported in C++ ? ...
8
votes
9answers
391 views
Are there any resources on how to identify problems that could best be solved with templates?
I decided to improve my knowledge in template meta-programming. I know the syntax and rules and been playing with counteless examples from online resources.
I understand how powerful templates can be ...
3
votes
5answers
1k views
Template Functions and Function templates in C++
I came across a question which asked the difference between Function Templates and Template Functions in C++ and also Template Classes and Class Templates.
I was under the impression that Function ...
1
vote
1answer
321 views
The equivalent of a “Memorandum of Understanding” for programmers?
When one business acquires another, they use a Memorandum of Understanding, which is basically an agreement outlining the duties of each party, etc.
I am about to begin a massive web development ...
6
votes
2answers
598 views
Translating longer texts (view and email templates) with gettext
I'm developing a multilingual PHP web application, and I've got long(-ish) texts that I need to translate with gettext. These are email templates (usually short, but still several lines) and parts of ...
18
votes
5answers
1k views
Why C++ cannot adopt D's approach for its concept implementation?
As many of you guys know, concepts, C++'s approach for constraining possible types for a template argument has failed to be included in C++11.
I learned that the D programming language 2.0 has a ...
0
votes
1answer
137 views
C++ wrapper for “releasing” a singleton object
I have a class like this
template <typename T, typename Policy>
AutoObjectRelease {
public:
AutoObjectRelease(T& obj):obj_(obj){}
~AutoObjectRelease(){ ...
3
votes
3answers
542 views
Storing hierarchical template into a database
If this title is ambiguous, feel free to change it, I don't know how to put this in a one-liner.
Example:
Let's assume you have a html template which contains some custom tags, like <text_field ...