templates

Is there a template language for PHP that's almost similar to the Django template language?

Is there a template language for PHP that's almost similar to the Django template language? ...

Overridden function pointer problem at template base class C++

hi, I implemented a template base class for observer pattern, template<class T> class ActionListener { public: ActionListener(void); virtual ~ActionListener(void); void registerListener(T* listener); void unregisterListener(T* listener); template<typename Signal> void emit(Signal signal); templa...

Sharepoint Site Collection "Send To" functionality not fully passed in template

I have a Sharepoint Site Collection and I've created a site which I want to be the template for all sites created within this collection. In the site template, I have added "Send To" functionality that will allow the user to send the documents to a Master site. This all works fine, but when I create another site using the template, the...

Iterate C++ list<derived> as base class

What I want to do is this: class Ba { } class Da : public Ba {} class Db : public Ba {} class Bb // abstract base class that must not be a template. { void Process() { list<Ba*>::iterator pos; // I known the derived class will also derive // from list<Dx*> where Dx derives from Ba for(pos = this-...

Standard Library Containers with additional optional template parameters?

Having read the claim multiple times in articles - I want to add this question to Stackoverflow, and ask the community - is the following code portable? template<template<typename T, typename Alloc> class C> void f() { /* some code goes here ... */ } int main() { f<std::vector>(); } Is the implementation that supplies std::vector...

Define a symbol in another namespace

Here is my problem: in a header I define a structure template type_to_string, which aims at defining a string corresponding to a given type argument: namespace foo { template <typename T> struct type_to_string { static const char * value; }; } template <typename T> const char * foo::type_to_string<T>::value = "...

.net Email Template engine...

I'm looking to create emails, mainly HTML, based on templates - I'd really like to do something like: Set up my template, as an HTML (or similar) file Include tags, that are then replaced with specific data (kind of like mail-merge....) I've seen this: http://www.bitethebullet.co.uk/EmailTemplateFramework/tabid/58/Default.aspx From...

Groovy: Variable Substitution in dynamic Strings

Hi all, I'm currently facing a variable substitution related problem in groovy. While this is quite trivial: Map map = [s1:"Hello", s2:"World"] println "${map.s1} ${map.s2}!" // "Hello World!" As this works, I'm pretty sure that something like this should work as well: Map map = [s1:"Hello", s2:"World"] def dynamic = loadStringFromF...

Debugging C++ template class in VS 2008

Hello, I'm learning C++ and using VS C++ 2008 Express. I have a simple project with 2 code files. One is for my Class and the other is "_tmain()". My class file is using: template <typename T> code. The program seems to run fine, but I can't step into my class file code in c++ view. I have to look at the assembly code. I can step in...

Generics question

I have a generic class public class Decoder<SIGNAL> where SIGNAL : signalType, new() signalType is a abstract class. How do I declare a dynamic field to store it? The following code will throw a compile error saying that Decoder must be a non abstract type generic. public class DecoderParent { private Decoder<signalType> decode...

Typedef a template class without specifying the template parameters

I'm trying to typedef either an unordered_map or std::map depending whether there are TR1 libraries available. But I don't want to specify the template parameters. From what i've read so far, typedef'ing templates without arguments is not possible until official c++0x standard is available. So does anyone know an elegant workaround for t...

How to prevent Coldfusion from injecting cfform.js into the head section?

An HTML template is passed to Coldfusion. The head tag of the template has additional attribute: <head profile="http://abc.com"&gt; The issue is that when generating the output based on this template Coldfusion injects its scripts inside the head tag: <head <script type="text/javascript" src="/CFIDE/scripts/cfform.js"></script> <scri...

Expression Engine Template Exporting

I have a project that was developed into a Expression Engine template. I used the Core version of EE to develop this template on my local machine. Now I need to export this template/weblog so it can be loaded onto the production server so the client can begin using EE to update their site. The issue I am running into is how to export th...

.net 2005 gridview

Hi, I'm trying to add a lookup type column to a gridview. The column will be used as a picklist of values for the user to, well, pick a value from. Sounds fairly straight forward but the problem is I want the picklist column to be a distinct list from a table that is not in the datasource of the gridview. If I join the picklist table int...

How to subclass a templated base class?

I have the following data structures: struct fastEngine { ... } struct slowEngine { ... } template<typename T> class Car { T engine; vector<T> backupEngines; virtual void drive() = 0; } class FastCar : public Car<fastEngine> { virtual void drive() { // use the values of "engine" in some way } } class SlowCar : p...

segmentation fault while inserting into priority queue

My definition of priority queue is: template<typename Node, typename Cmp = std::less<Node> > struct deref_compare : std::binary_function<Node*,Node*,bool> { deref_compare(Cmp const& cmp = Cmp()) : cmp(cmp) {} bool operator()(Node* a, Node* b) const { return (a->getfValue()> b->getfValue()); } private: Cmp c...

How to provide a explicit specialization to only one method in a C++ template class?

I have a template class that looks something like this: template<class T> class C { void A(); void B(); // Other stuff }; template<class T> void C<T>::A() { /* something */ } template<class T> void C<T>::B() { /* something */ } What I want is to provide an explicit specialization for only A while retaining the default fo...

Thoughts on creating a view selector in php

Hey all, I'm looking to create a nice way to separate view and controller in php. What I'd like to happen is people would go to: localhost/index.php?view=signup and they would see the whole page with a signup box.. and NOT a login box. I'm wondering if anyone has made this before.. I'm specifically looking for a elegant way of lettin...

Strange VC++ compile error, C2244

Take a look at this peice of code: template <typename K,typename T> Pointer<typename Collection<T>::Iterator> BinaryTree<K,T>::GetBeginning() const { return new BinaryTreeIterator(this,BinaryTreeIterator::Position::atBeginning); } When I try to compile it using VSTS 2008, I get: error C2244: 'BinaryTree<K,T>::GetBeginning' : unab...

Custom Word Bibliography Source Template

Having looked through the Word help and online resources about customising bibliographies in Microsoft Word, and finding several posts on customising the 'style' and XSL transformation 'layout' of bibliography source templates, I am sure, given the dynamic functionality provided in this area that it must be possible to create custom sour...