templates

Css div template

Hello all My biggest problem in developing web projects is appearance. Is out there any kind of template divs? I mean like ready-css boxes with maybe header-content separation which are customizable and beatiful. I know how to make one of these but i don't have time to do different ones every now and then. Thank you ...

WPF MenuItem header text is partially hidden

Hi, I templated the way items shows up in a menu, but, for an unknown reason, I am having trouble displaying the whole text in the MenuItem. Here is a screen capture of the problem: Here is the markup code I used to template it: <ItemsPanelTemplate x:Key="SideBarItemsPanelTemplate"> <StackPanel Orientation="Vertical"/> </ItemsPan...

Use $safeprojectname$ (Template Project) in msbuild targets

Hi, I have a VS2008 Template Project. This project has a script.targets (MSBUILD). I want that when I create new project from Template Project, I use $safeprojectname$ value in my targets file. is it possible ?? sample MSbuild targets <Project InitialTargets="Install" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; ...

Solve this Error ,while using 'export' keyword in templates?

Program :main.cpp struct X { int x; }; export template <class T> T const& min(T const&, T const&); int main() { return min(2, 3); } x.cpp struct X { int x; }; export template <class T> T const& min(T const &a, T const &b) { return a<b ? a : b; } error:Compiling with gcc export.cpp...

In Jinja2 whats the easiest way to set all the keys to be the values of a dictionary ?

I've got a dashboard that namespaces the context for each dashboard item. Is there a quick way I can set all the values of a dictionary to the keys in a template? I want to reuse templates and not always namespace my variables. My context can be simplified to look something like this: { "business": {"businesses": [], "new_promotion...

Style for Textbox Silverlight

I want to make a simple style for the textbox. I want to retain everything about the standard textbox look and feel except one item. OnFocus on want to be able to change the border color of the textbox. I have written the following and it does work. However, everything is restyled, I have to declare height, the look and feel of the no...

Resolving a Circular Dependency between Template Classes

I have two classes, Foo<T> and Bar<T>, derived from Base. Each overrides a method virtual Base* convert(ID) const, where ID is an instance of a type that uniquely identifies a particular instantiation of Foo or Bar (pretend it's an enum). The problem is that Foo::convert() needs to be able to return a Bar instance, and likewise Bar::conv...

How do I use different drupal page templates?

Hello, I have two page template files, one that is just 'page.tpl.php' and another for a subset of pages. How can I apply this other template for only certain pages and the rest just default to page.tpl.php? Thanks! I am on Drupal 6. ...

What are pros and cons of using binding instead of template language?

Hello, all, I would like to know what are pros and cons of using JSON or XML binding versus using template languages like Velocity or FreeMaker? What approach is certainly preferable in what situations? ...

Doubt about compile time code generation

I have a requirement something like void doSomeThing(int x) { ..... } void fun() { #ifdef XXXX_1_YYYY doSomeThing(XXXX_1_YYYY); #endif //XXXX_1_YYYY #ifdef XXXX_2_YYYY doSomeThing(XXXX_2_YYYY); #endif //XXXX_2_YYYY #ifdef XXXX_3_YYYY doSomeThing(XXXX_3_YYYY); #endif //XXXX_3_YYYY #ifdef XXXX_4_YYYY doSomeThing(XXXX_4_YYYY)...

design question C++

I have just read an article about the Curiously Recurring Template Pattern. And you can use it simulate virtual function with templates. For example: template<class T> struct A { void func() { static_cast<T*>(this)->func(); } }; struct B : public A<B> { void func() { cout << "B" << endl; } };` However, if we have many subcla...

Mask / Zero out area outside specified ROI

Greetings! I am working on a project using OpenCV on template matching, and I want to limit the search region on an image. Image is captured continuously from a camera. Is there any way to Zero / mask out image outside ROI defined, so that template matching process can be specific on remaining region, faster and accurate? Thanks is ad...

Why are cv-qualifiers in template parameters ignored?

I had some code that was failing to compile, which amounts to something like what's shown below. After some digging around, I came across paragraph 14.1 note 5, which states: The top-level cv-qualifiers on the template-parameter are ignored when determining its type. My code looks like this: #include <iostream> #include <t...

how to declare templated map::iterator within a templated class. following code Says ; expected when compiled

the following code says error: expected ‘;’ before ‘forwit’ error: expected ‘;’ before ‘revit’ template<class T> class mapping { public: map<T,int> forw; map<int,T> rev; int curr; //typeof(forw)::iterator temp; map<T,int>::iterator forwit; map<int,T>::iterator revit; }; // }; // JVC: This was present, bu...

How to set a controlparameter to the value of gridtemplatecolumn dropdownlist??

Hi, I have a radgrid in which there are 5 columns. one of the column is gridtemplatecolumn in which the itemtemplate is a label and edititemtemplate is dropdownlist. Code is as given below: <telerik:GridTemplateColumn DataField="GameId" HeaderText="Game Id" SortExpression="GameId" UniqueName="GameId"> ...

Accessing protected member of template parameter

I have a template class for which I need to access a protected member function of the template parameter, like this: class Foo { protected: void foo() {} }; template<typename T> class Bar { public: static void bar(T& self){self.foo();} }; ... Foo f; Bar<Foo>::bar(f); My problem is getting access to the protected method. I tri...

Adding methods to template specialization

I have a templated C++ class that exposes a number of methods, e.g template<int X, int Y> class MyBuffer { public: MyBuffer<X,Y> method1(); }; Now, I want to expose additional methods to this class if X == Y. I have done this by subclassing MyBuffer, template<int X> class MyRegularBuffer : public MyBuffer<X,X> { public: MyRe...

Why does this template have an error in Xcode but not Visual Studio?

I am getting an error in Xcode when using templates in C++. Can someone tell me what is wrong? The first version reports an error in Xcode, but not in Visual Studio. // Version 1: Error in Xcode, but not Visual Studio template<typename LengthT, typename VertexT> int MyGraphAlgorithm(...arguments omitted...) { using namespace boost; ...

Template instantiation refused with function-local classes

Possible Duplicate: How to use local classes with templates? g++ 4.4 is refusing to compile a call to a template function taking a function-local class as a template parameter. Like so: // Given this: template <typename C> int f(const C& c) { return c.g(); } // This compiles fine: struct C1 { int g() const { return 42...

How does this "size of array" template function work?

Possible Duplicates: Can someone explain this template code that gives me the size of an array? Magic arguments in function templates Can someone explain how this code works? I know that the purpose of this code is to get the length of an array, but I don't know how this code works: template<typename T, int size> int GetArr...