templates

simply way to add another webapp framework to my project.

one webapp project has many url and i have to change this: ('/addTopic', AddTopic), ('/delTopic', DeleteTopic), ('/addPost', AddPost), ('/delPost', DeletePost), to this: ('/tribes/addTopic', AddTopic), ('/tribes/delTopic', DeleteTopic), ('/tribes/addPost', AddPost), ('/tribes/delPost', DeletePost), but ,if i add this to my ...

Custom Template Iterator Reference

Hi, Can any one recommend a good resource to refer on writing C++ custom template iterators?? Thank You! ...

Haml Inherit Templates

I'm using Haml (Haml/Sass 3.0.9 - Classy Cassidy) stand-alone to generate static HTML. I want to create a shared layout template that all my other templates inherit. Layout.haml %html %head %title Test Template %body .Content Content.haml SOMEHOW INHERIT Layout.haml SOMEHOW Change the title of the page "My Content". %p...

C++ Lock-Free templated ObjectPool

do they exist ? *added to clarify: is there any usable library that implement lock-free (which is threadsafe and might be implement spinlock or other lightweight synchronization) ObjectPool ( http://en.wikipedia.org/wiki/Object_pool_pattern ) written in C++ language using template? ...

Guidelines to an Iterator Class

Hi, I have a Red Black tree implemented in c++. It supports the functionality of a STL map. Tree nodes contain keys and the values mapped. I want to write an iterator class for this, but I'm stuck with how to do it. Should I make it an inner class of the Tree class? Can anyone give me some guidelines on how to write it + some resources...

Visual Studio 2010 Shell Isolated template broken

I am following a tutorial for creating a Visual Studio Isolated Shell application. When I get to step number 4 I a dialog with the following text: A problem was encountered creating the sub project 'VSShellStub1'. The template specified cannot be found. Please check that the full path is correct. I've tried this on two separate m...

Friends, templates, overloading <<

I'm trying to use friend functions to overload << and templates to get familiar with templates. I do not know what these compile errors are: Point.cpp:11: error: shadows template parm 'class T' Point.cpp:12: error: declaration of 'const Point<T>& T' for this file #include "Point.h" template <class T> Point<T>::Point() : xCoordinat...

Table Template with Rich UI

Hello, I'm trying to find a html (or maybe flash) table template with rich ui features. I googled it, but couldn't find something that has a rich ui, also looked through jquery, still no luck. Before going any deeper search, I believe someone may have suggestions for me. Thanks. ...

whats the best way to parse and replace the string with its values ?

I may have string like, """Hello, %(name)s, how are you today, here is amount needed: %(partner_id.account_id.debit_amount)d """ what would be the best solution for such template may i need to combine regular expression and eval, input string may differ like $partner_id.account_id.debit_amount$ - for the moment I've kept as python st...

how can we set safe template tag for admin change_form.html

how can we set safe template tag for admin change_form.html, I want to display HTML data instead of TextArea Input for admin form, I've a django field which is excluded in admin form, that field contains HTML data - which is dynamically generated - u can say reporting data, I want to display that HTML data with safe templatetag below t...

How to check a complex condition in Smarty(PHP)

I need to display a section or another in a smarty template. My condition is simple: if a smarty value starts with a string I should display one section, otherwise the other smarty section should be displayed. I can change only the tpl files. {php} if (substr($url,0,4) != 'http') { {/php} section 1 ...

how to use erb to output file after binding

Hi, I got the following example: require 'erb' names = [] names.push( { 'first' => "Jack", 'last' => "Herrington" } ) names.push( { 'first' => "LoriLi", 'last' => "Herrington" } ) names.push( { 'first' => "Megan", 'last' => "Herrington" } ) myname = "John Smith" File.open( ARGV[0] ) { |fh| erb = ERB.new( fh.read ) print erb.result...

Friends, templates, overloading << linker errors

I had some good insight to an earlier post regarding this, but I have no idea what these compile errors mean that I could use some assistant on. Templates, friends, and overloading are all new, so 3 in 1 is giving me some problems... 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall Point<double>::Point<double>...

Confused with implicit and explicit template declarations

I'm getting confused with implicit and explicit declarations. I don't know why you need to explicitly say or at certain times. For example, In my main.cpp #include <iostream> #include "Point.h" int main() { Point<int> i(5, 4); Point<double> *j = new Point<double> (5.2, 3.3); std::cout << i << *j; Point<int> k; ...

django complex model and template

I remodel my objects using ManyToMany relationship using "through" as it's guided here: link text class Receipt(models.Model): name = models.CharField(max_length=128) (...) components = models.ManyToManyField(Product, through='ReceiptComponent') class Admin: pass def __unicode__(self): return self.name def url(self...

Conversion between different template instantiation of the same template

I am trying to write an operator which converts between the differnt types of the same implementation. This is the sample code: template <class T = int> class A { public: A() : m_a(0){} template <class U> operator A<U>() { A<U> u; u.m_a = m_a; return u; } private: int m_a; }; int main(...

Visual C++ Compiler allows dependent-name as a type without "typename"?

Hello, Today one of my friends told me that the following code compiles well on his Visual Studio 2008: #include <vector> struct A { static int const const_iterator = 100; }; int i; template <typename T> void PrintAll(const T & obj) { T::const_iterator *i; } int main() { std::vector<int> v; A a; PrintAll(a); PrintAll(v); ...

C++ boost mpl vector

I understand that the following code won't work, as i is a runtime parameter and not a compile time parameter. But i want to know, whether there is a way to achieve the same. i have a list of classes and i need to call a template function, with each of these classes. void GucTable::refreshSessionParams() { typedef boost::mpl::vect...

Check for request.GET variable in the template

I want to display a certain in the template only if a certain GET variable is set....I thought using {% if request.get.my_var %} would work, but it's not giving me the results. ...

problem with template inheritance

I'm trying to understand whay i get an error on this code: (the error is under g++ unix compiler. VS is compiling OK) template<class T> class A { public: T t; public: A(const T& t1) : t(t1) {} virtual void Print() const { cout<<*this<<endl;} friend ostream& operator<<(ostream& out, const A<T>& a) { out<<"I'm ...