templates

HTML EMail Template

Anybody knows where I can find nice HTML Templates to send email reports? Edit : Moved here http://doctype.com/html-email-template ...

Callback in C++, template member? (2)

The following callback class is a generic wrapper to "callable things". I really like its API, which has no templates and is very clean, but under the hood there is some dynamic allocation which I was not able to avoid. Is there any way to get rid of the new and delete in the code below while maintaining the semantics and API of the cal...

Django template user request question

Hey, I have a model Book which can be added to user's Favorites. So I defined 2 classes: class Book(models.Model): name = models.CharField(max_length = 40) class UserFavorite(models.Model): book = models.ForeignKey(Book) user = models.ForeignKey(User) Now I'd like to show on the main page popular books with an icon eith...

Template Polymorphism not Working?

I'm building a small template hierarchy and try to make use of class polymorphism. Here's some example code (which does not compile) to demonstrate it: template<typename T> struct A {}; template<typename T> struct B { B (A<B> *) {} }; struct C : public B<int> { C(A<C> *p) : B<int>(p) {} // error }; int main() { A<C> ac; ...

Template Monster API - ID Based Information (PHP)

Good Evening, I'm currently working with the Template Monster API and I've ran into a quick question. I've managed to get all of the categories to list their available templates and then assign the links to step1.php?templateid=11331. Once the user arrives on step1.php, I'm able to get the ID number from the URL and pass it to the Te...

How do I modify the set method signature that Eclipse auto generates?

My current project has the coding convention that instance variables are never referred to with the this. prefix and that parameters should never hide instance variables. This results in setters that look like: public void setFoo(final Foo aFoo) { foo = aFoo; } Unfortunately eclipse won't generate that for me by default. I've found...

Mix of template and struct

I have a template class defined as follow : template <class T1, class T2> class MyClass { }; In this class, I need a struct that contains one member of type T1. How can I do that ? I tried the following, but it didn't work : template <class T1, class T2> class MyClass { typedef struct { T1 templateMember; // rest...

Recommend a source for ASP.NET templates?

I am going to build a basic small business site for myself and would like to get a head start with a quality ASP.NET template and don't mind purchasing one. Can you recommend a reputable site I might check out for this? Many thanks. ...

JSP tricks to make templating easier?

At work I've been tasked with turning a bunch of HTML files into a simple JSP project. It's really all static, no serverside logic to program. I should mention I'm completely new to Java. JSP files seem to make it easy to work with common includes and variables, much like PHP, but I'd like to know a simple way to get something like templ...

3 columns to align correctly with divs.

Hows it going. Im just started to learn a bit about joomla and Im trying to get my divs to align vertically when making a template. The problem is that the right div is way down the bottom of the page on the right hand side and the center div is aligned at least 1 character height below the left div which is the only one correctly align...

Function template specialization with reference to pointer.

I have a template function: template<typename T> void foo(const T& value) { bar(value); x = -1; } I want to specialize it for a set of types: template<> void foo<char>(const char& value) { bar(value); x = 0; } template<> void foo<unsigned char>(const unsigned char& value) { bar(value); x = 1; } It works ok. When I compile this: te...

Difference between code generated using a template function and a normal function

I have a vector containing large number of elements. Now I want to write a small function which counts the number of even or odd elements in the vector. Since performance is a major concern I don't want to put an if statement inside the loop. So I wrote two small functions like: long long countOdd(const std::vector<int>& v) { long l...

How should I compare a c++ metaprogram with an C code ? (runtime )

Hi there , I have ported a C program to a C++ Template Meta program .Now i want to compare the runtime . Since there is almost no runtime in the C++ program , how should i compare these 2 programs. Can i compare C runtime with C++ compile time ? or is it just not comparable ? ...

g++ "is not a type" error

Writing a templated function, I declared: template <typename T> T invertible(T const& container, T::size_type startIndex, T::size_type endIndex); Compiling with g++ 4.0.1 I got the error: error: 'T::size_type' is not a type ...

How to generate complex Makefiles, e.g. from a template

Makefiles are really really useful. But, the syntax is somewhat complex and limited. For a project, I need to create targets 1 to n, and would really like to write something like this: all : target1 ... target100 target%d : target%d.pre ./script.py %d I would like to have make capture the variable (%d) and then use it throughout ...

How do I create an XML template in Perl?

The XML file I need to create is like <file> <state>$state</state> <timestamp>$time</timestamp> <location>$location</location> .... </file> I don't want to use several print to create the needed XML file, what I'm expecting is to have a template, which defines both the structure and format of the XML. Then w...

Java print barcode labels

Cans someone point in the write direction for printing barcode labels using Java? I can use the barbecue library (http://barbecue.sourceforge.net/) to generate them bar codes as images, but I need a way to put the image (and human readable caption) into an Avery document template for printing. ...

How do I implement no-op macro (or template) in C++?

How do I implement no-op macro in C++? #include <iostream> #ifdef NOOP #define conditional_noop(x) what goes here? #else #define conditional_noop(x) std::cout << (x) #endif int main() { conditional_noop(123); } I want this to do nothing when NOOP is defined and print "123", when NOOP is...

Presentation template framework with pre-built login/session handling?

Just fishing for ideas here. Do any of the major template presentation frameworks (such as Smarty, Django) have prebuilt login/security handling? I want to save time on the security handling because it will consume a lot of time to worry about that. I want to build a site from ground up but I dont really want to go so far as starting ...

Whats the best way to create templates using php?

I have a class that gathers templates and displays the final output after connecting all the templates. class Template{ $private $output = ''; public function Load_Template($template, $data = null){ ob_start(); include($template); $this->output .= ob_get_clean(); } public function Display($add_footer = true){ echo $th...