templates

the django template and combine {{ }}

Hello, I start with django, and I have a little problem. Well, I have a tuple (top) and I wanted to display an element of it according to another template value (date, which is a datetime type). So, I did that : {{top.date.day}} Well it doesn't work, so I tried it : {{ top.{{date.day}} }} And it didn't work neither. So what is...

Should i go with Asp.net Ajax 4.0 client templating?

I have been investing sometime in client templating in Ajax 4.0. However now i seem to have some doubt if the choice is right. I hear that Microsoft is investing heavily in jquery templating jquery.tmpl plugin and in general for client side Ajax JQuery seem to be what is recommended. However jquery.tmpl is in early stages for me to consi...

MVC2 ValidationMessage in template.master not rendering

I implemented the template.master technique described by Brad Wilson in this posting but I changed line 31 of his EditorTemplates/Template.master from: <%= Html.ValidationMessage("", "*") %> to: <%= Html.ValidationMessage(ViewData.ModelMetadata.PropertyName)%> so that the actual validation text will be displayed next to the control...

Unmanaged C++ template in managed C++ throws bad image?

I have a Managed C++ dll which dynamically links with an unmanaged C++ dll. The managed C++ derives several unmanaged classes from abstract interfaces in the unmanaged dll. This works fine. ---------- // uses macro __declspec(dllexport) class EXPORT_API ICustomer { public: virtual void PlaceOrder() = 0; // }; -----< LocalCustomer...

C++ Template Specialization Compilation

I'm going to outline my problem in detail to explain what I'm trying to achieve, the question is in the last paragraph if you wish to ignore the details of my problem. I have a problem with a class design in which I wish to pass a value of any type into push() and pop() functions which will convert the value passed into a string represe...

reporting website templates

Hi. I am starting my work to develop an intranet reporting website in php and html. I wanted to know if there are any templates for page layout, so that i can quickly select the look of the page and then start all my coding for the reporting system. i would really appreciate if anyone could help me with few links. ofcourse, i am lookin...

Template friend

I'd like to do the following: template <typename T> struct foo { template <typename S> friend struct foo<S>; private: // ... }; but my compiler (VC8) chokes on it: error C3857: 'foo<T>': multiple template parameter lists are not allowed I'd like to have all possible instantiations of template struct foo friends of foo<...

typedef declaration of template class

is there a difference, from prospective of meta-programming for example, between the two declarations? template<typename T> struct matrix { typedef matrix self_type; // or typedef matrix<T> self_type; }; thank you ...

C++ template function gets erronous default values

I have hit upon a real brain scorcher in C++, it has never happened to me before. The gist of the problem is that upon invocation of my (template) function the arguments I have defined defaults for have their values scrambled. It only happens if I call the function with the defaults. My template function is declared like this: templat...

Template specialization with struct and bool

I have a template class in which I am specializing a couple of methods. For some reason, when I added a specialization for a struct, it seems to be conflicting with the specialization for bool. I am getting a type conversion error because it is trying to set the struct = bool (resolving to the wrong specialization). Here is some code ...

Porting shell scripts to ruby erb templates, suggestions and advice ?

I am using Puppet for automating configuration management across hosts. It can use erb templates to set up configuration files of various services like apache, postfix etc. across different hosts Till now we were using shell scripts full of sed, awk, grep filters and such, and now I need to port that code to ruby erb templates. Let's...

WPF: Dynamic Actions in Template

Hi, I've defined a control Template for a progressbar to make it look like a thermometer ... now i want it to change its color when reaching a certain value (for example .. when the progressbar has the value 70, its color should change to yellow) Currently the color of PART_Indicator is bound to the background color of the progressbar ...

Template friend and nested classes

Hello, please consider the following code: template <typename T> struct foo { template <typename S> struct bar { template <typename> friend struct bar; }; }; I'd like all instantiations of foo<T>::bar to be friends of foo<T>::bar<S> for any S. If bar is not a nested template, the syntax above works just fine. B...

C++ compile-time constant detection

Tbere're cases when a library source is available, and it has to support variable parameters in general, but in practice these parameters are commonly constants. Then it may be possible to optimize things by special handling of constant parameters (eg. use static arrays instead of heap allocation), but for that its necessary to determin...

Looking for a preprocessor to fill in static files

What I'm looking for would allow me to take something like this: index.html.template: <html> <body> <# include ("body.html.template") #> </body> </html> body.html.template: Hello World! <# include("text.txt") #> text.txt: 4 And turn it into this: <html> <body> Hello World! 4 </body> </html> While the example is HTML, I would...

Rails 3: @template variable inside controllers is nil

Hi all, i've started using rails 3 beta3 and I have see that the @template variable inside controllers is nil. How I can call helpers methods inside a controller? Thx ...

C++ templates and "no matching function to call"

I'm getting a strange error. I have a function of the following signature: template <typename DATA, DATA max> static bool ConvertCbYCrYToRGB(const Characteristic space, const DATA *input, DATA *output, const int pixels) { Which is later called like this: case kByte: return ConvertCbYCrYToRGB<U8, 0xFF>(space, (const U8 *)input, (...

C++ Template function default value

Hi, is it possible to define default value for variables of a template functions in C++? something like below: template<class T> T sum(T a, T b, T c=????) { return a + b + c; } ...

Xcode uses old version of templates?

My install of Xcode 3.2.3 created a project with different template files than those of my classmates. We all created a navigation-based app that used core data. I suspect that my templates are somehow left over from previous installs, whereas my classmates all have current templates. Anyone else experienced this? Any suggestions for m...

test Wpf Control performance

Specifically for data binding and templates, is there a good way to test the performance of my controls in these respects. I would like to know how much time applying the template and initializing the data binding takes. I am using both Wpf Performance Suite and ANTS Profiler but neither seems to provide information on these aspects. ...