templates

Where is the wiki formatted text converted to html?

I need to find the main function in MediaWiki where wiki text is converted to html. Does someone know where that is? ...

What C++ templates issue is going on with this error?

Running gcc v3.4.6 on the Botan v1.8.8 I get the following compile time error building my application after successfully building Botan and running its self test: ../../src/Botan-1.8.8/build/include/botan/secmem.h: In member function `Botan::MemoryVector<T>& Botan::MemoryVector<T>::operator=(const Botan::MemoryRegion<T>&)': ../../src/Bo...

c++ template: 'is not derived from type'

I do not understand why this code is not valid: #include <vector> template <typename T> class A{ public: A() { v.clear(); } std::vector<A<T> *>::const_iterator begin(){ return v.begin(); } private: std::vector<A<T> *> v; }; When compiling it with gcc, it get the following error: test.cpp:8: error: type 's...

Mako templates inline if statement

I have a template variable, c.is_friend, that I would like to use to determine whether or not a class is applied. For example: if c.is_friend is True <a href="#" class="friend">link</a> if c.is_friend is False <a href="#">link</a> Is there some way to do this inline, like: <a href="#" ${if c.is_friend is True}class="friend"{/if}>li...

Constant template parameter class manages to link externally

I have a class foo with an enum template parameter and for some reason it links to two versions of the ctor in the cpp file. enum Enum { bar, baz }; template <Enum version = bar> class foo { public: foo(); }; // CPP File #include "foo.hpp" foo<bar>::foo() { cout << "bar"; } foo<baz>::foo() { cout << "baz"; } I'm using...

Template type deduction with a non-copyable class

Suppose I have an autolocker class which looks something like this: template <T> class autolocker { public: autolocker(T *l) : lock(l) { lock->lock(); } ~autolocker() { lock->unlock(); } private: autolocker(const autolocker&); autolocker& operator=(const autolocker&); private: T *lock; }; O...

how to enable a method in tamplate of google-app-engine..

the mothed is : def printa(x): return x the reponse is : self.response.out.write(template.render(path, {'printa':printa})) the html is : {{ printa 'sss'}} i want to show 'sss' in my page , so how to do this , thanks updated i create a templatetags folder, and 2 py file: templatetags |--------__init__.py |---...

how to make my method running on the template of google-app-engine..

the model is : class someModel(db.Model): name = db.StringProperty() def name_is_sss(self): return self.name=='sss' the view is : a=someModel() a.name='sss' path = os.path.join(os.path.dirname(__file__), os.path.join('templates', 'blog/a.html')) self.response.out.write(template.render(path, {'a':a})) ...

How can I insert a rendered form from a form application in a Django template from another application?

hi, I'm doing a form application (similar to django-contact-form) and would like to be able to insert the rendered form in a Django template of another application. What's the best way to do that? Should I create a template for the form (with for example only {{ form.as_p)? If so how can I insert it in another template? Thanks Jul ...

Can I have a page in my Ruby on Rails app that doesn't use my application.html.erb template?

I'm using application.html.erb in the views/layouts folder of my Ruby on Rails web app as a template. But there's one page in which I don't want the template to be used. Is this possible? ...

Dynamically register constructor methods in an AbstractFactory at compile time using C++ templates

When implementing a MessageFactory class to instatiate Message objects I used something like: class MessageFactory { public: static Message *create(int type) { switch(type) { case PING_MSG: return new PingMessage(); case PONG_MSG: return new PongMessage(); .... } }...

Fill container with template parameters

I want to fill the template parameters passed to a variadic template into an array with fixed length. For that purpose I wrote the following helper function templates template<typename ForwardIterator, typename T> void fill(ForwardIterator i) { } template<typename ForwardIterator, typename T, T head, T... tail> void fill(ForwardIterato...

show template in joomla (parameter)

I know it is possible in Joomla! to set the template temporarily to another template with an URL parameter. Does anyone remember the parameter? And how should the template be indicated? I expect something like index.php?template=mytemplate ...

Partial specialization with reference template parameter fails to compile in VS2005

I have code that boils down to the following: template <typename T> struct Foo {}; template <typename T, const Foo<T>& I> struct FooBar {}; //////// template <typename T> struct Baz {}; template <typename T, const Foo<T>& I> struct Baz< FooBar<T,I> > { static void func(FooBar<T,I>& value); }; //////// struct MyStruct { static con...

Text replacement for multiple script/config files

I am doing some sort of science with a combination of Python, bash scripts and configuration files with weird syntaxes from old C programs. To run different tests, I have to tune (open text file, edit and save) a number of these files, but it is getting harder and harder to remember which files to edit. Also, the tasks are very repetitiv...

Looking for fastest and least-programming-required path to implement a web site with user submitted content with voting and comments

I'm looking to throw up a web site that supports user submitted entries and allows voting and comments. Similar in form and function to FMyLife. Basic requirements of site: Users can submit text entries - generally 1 liners Enters can be up or down voted Comments allowed - presentation collapseable Would like the fastest path possi...

Template Class Link-Time Error

Possible Duplicate: Why can templates only be implemented in the header file?? Hi, I have a c++ project which consists of several header and source files. In order to modify the class with a template, I found that all the method definitions must be included in the header file itself, else resulting in a link-time error. What ...

Where can I get a theme/template suitable for a webapp?

I'm building a simple web application that is mainly going to be displaying small tables of data back to the user. The problem is I can't do design to save my life. I need a simple web 2.0 style template that is CSS/HTML compliant. I know about http://themeforest.net and http://www.oswd.org/. Just wondering if there are any other sites t...

C++ Template Classes Circular Dependency Problem

We have two classes: template<typename T, typename Size, typename Stack, typename Sparse> class Matrix and template<typename T, typename Size> class Iterator Matrix should be able to return begin and end iterators and Iterator will keep a referrence to the Matrix to access the elements via it's interface. We don't want Iterator t...

Modify style for last module in a particular area in Joomla!

I am making a custom Joomla! template which should allow for multiple modules in the right column. Everything is working fine, and I am using "modules.php" to create a custom HTML wrapper for each module in the column. Only problem is - I need to remove the bottom border from the last module that appears in that column, whichever one it ...