templates

Converting an application to use dlls. class 'std::map<_Kty,_Ty>' needs to have dll-interface to be used by clients of class

This seems to be a common error, but most people online choose to just ignore the warning and move on. I do not wish to ignore the warning. Basically, when using __declspec(dllexport) to convert a project to use dlls, the compiler has trouble dealing with templates and stl objects. An explanation of the problem, and suggested solution...

Are There Any Good Open-Source Mac Application Templates

I am looking to make a Mac version of one of my iPhone apps and was looking for a good ay to hit the ground running. I know how to code in Objective-c and Cocoa, and I know how to piece something together from scratch if I have to, but I am looking for an easier way. Are there any open-source templates for coding Mac desktop applicatio...

Using EditorFor<> to render a drop-down list

So far we can use Html.EditorFor() to dynamically render the appropriate template for a datatype - e.g. string, int, or a custom type, say 'Address'. Now I want to use EditorFor() to render a 'Parent' field. I want a drop-down containing every row, and the user picks a parent from this drop-down. The 'Parent' template has access to the...

Magento: change advanced search layout

I want to change the advanced search layout to my needs. Instead of select boxes I want to have radio buttons with a picture and text in the description. For one button the layout is: [button][image][text] Thank you, Ivo Trompert ...

Where can I find good Silverlight application XAML templates & themes ?

Any suggestions would be appreciated. Does not have to be free. ...

SQL Server Templates - How Do I Escape The Less Than Character?

I like to use SQL Server 2005 templates to run frequently used queries. You can include parameters in your templates using this syntax: <LastName, varchar, 'Bob'> I have a query that needs the less than or equals to operator <= but unfortunately the SQL Server 2005 template interprets that as the start of a parameter. I have been unab...

error returning std::set<T>::iterator in template

I'm making a template wrapper around std::set. Why do I get error for Begin() function declaration? template <class T> class CSafeSet { public: CSafeSet(); ~CSafeSet(); std::set<T>::iterator Begin(); private: std::set<T> _Set; }; error: type ‘std::set, std::allocator<_CharT> >’ is not derived ...

How does the Jinja2 "recursive" tag actually work?

I'm trying to write a very simple, tree-walking template in jinja2, using some custom objects with overloaded special methods (getattr, getitem, etc) It seems straightforward, and the equivalent python walk of the tree works fine, but there's something about the way that Jinja's recursion works that I don't understand. The code is show...

Wordpress : template tags get_page()

not sure if this is programming enough or if it should go to superuser, which is not programming AT ALL. I leave it to the mod to decide. I created a menu using get_pages() and specifying the parent id. This parent id has children and sub-children and sub-subchildren. I need each of these (sub)children to have the parent id displayed, a...

Accessing a method from a templated derived class without using virtual functions in c++?

How do I get around this? I clearly cannot make the value() method virtual as I won't know what type it is beforehand, and may not know this when accessing the method from b: class Base { public: Base() { } virtual ~Base() { } private: int m_anotherVariable; }; template <typename T> class Derived : public Base { public: ...

Inheritance and templates in C++ - why are methods invisible?

When a template publicly inherits from another template, aren't the base public methods supposed to be accessible? template <int a> class Test { public: Test() {} int MyMethod1() { return a; } }; template <int b> class Another : public Test<b> { public: Another() {} void MyMethod2() { MyMethod1(); } }; int ...

Why is the compiler not selecting my function-template overload in the following example?

Given the following function templates: #include <vector> #include <utility> struct Base { }; struct Derived : Base { }; // #1 template <typename T1, typename T2> void f(const T1& a, const T2& b) { }; // #2 template <typename T1, typename T2> void f(const std::vector<std::pair<T1, T2> >& v, Base* p) { }; Why is it that the followin...

Passing template classes as arguments to methods...

I have a class method with a signature like this: // someheader.h class Blah { ... void DoSomeWork(class Screen& p); .. }; The Screen class however is supposed to turn into a template now, something like... template <int width, int height> class Screen { ... So my question is, how should I change the method's prototype in somehea...

How to add ProjectItem element in a VS project template that references a file that does not exist in the template?

How do I define a Visual Studio project template such that the include attribute references a non-existent file? That is, the file will exist once the resulting csproj is in place. But the file does not exist within the vs template zip. I have this: <ProjectItem ReplaceParameters="True" TargetFileName="..\GlobalVersionInfo.cs"> <...

Sitecore values -- Template > Standard Values > Branch > Item

OK, here's the process I took... create a new template "Mail Message" create a "__Standard Values" item for the template edit the "Subject" field in the standard values item: "Monthly email newsletter" create a branch for the template do NOT set the Subject field in the branch item create an item from the branch I would expect the...

Creating a new primitive type

Is there a way to create a new type that is like one of the basic types (eg char), and can be implcitly converted between, but will resolve diffrently in templates, such that for example, the following code works? typedef char utf8; template<typename T>void f(T c); template<> void f<char>(char c) { std::cout << "ascii " << c << std:...

Linked Themes/Generic.xaml Files will not work in visual studio 2008

i have a project that i am doing and i need to share the code between silverlight and WPF Assembly problem is that even though the wpf assembly is the owner of that file and the silverlight assembly only has a link to the file, all of the build actions are page everything is correct. if i make the silverlight assembly the owner then silv...

Is this delegate usage good or bad?

This question is being asked because I have no prior experience with delegate best practices I have a unordered lists in html, where the structure is the same throughout my site, but the content of the lists may differ. Examples: List of object A <ul> <li> <ul> <li>A.someMember1</li> <li>A.someMember2</li> <li>...

How do I make WPF ListView items repeat horizontally AND vertically?

Hi, I have a listview where I would like to display things horizontally. That works fine, but now I would need to have them display like in a Windows Explorer type. For example : A B C D E F G H I or A B C D E F G H I Is it possible in a listview? ...

g++ doesn't like template method chaining on template var?

I'm trying to compile with g++ some code previously developed under Visual C++ 2008 Express Edition, and it looks like g++ won't let me call a template method on a reference returned by a method of a template variable. I was able to narrow the problem down to the following code: class Inner { public: template<typename T> T get() con...