templates

C++ STD::Vector using templated function taking abnormally long to run

The following function operates with two values for T. One is 4 bytes (same as a DWORD). The other is 64 bytes. The Buffer is designed to store objects in its cache, and have them retrieved at a later date. When using the 64 byte structure, the total amount of time in the function jumps dramatically. The seek time in the vector, the...

Conversion of the type of a Template class?

Hi folks, I have a class named "baseClass". From this class I inherit a class names "inheritedClass" (public class inheritedClass: baseClass) The baseClass contains a public function that returns a HashSet<baseClass>. When called from the inheritedClass, the return type is obviously still HashSet<baseClass>, but I need a HashSet<inheri...

Differences in Django Template Inheritance between 0.96 and 1.0?

Now that Google App Engine natively supports Django 1.0, I updated with the following code: from google.appengine.dist import use_library use_library('django', '1.0') I am now getting template errors relating to template inheritance. For instance, if I have: {% extends "../base.html" %} Referring to a base.html in the parent direct...

Are free functions implicitly inlined if defined without a previous declaration in C++?

Is the following free function implicitly inlined in C++, similar to how member functions are implicitly inlined if defined in the class definition? void func() { ... } Do template functions behave the same way? ...

A function pointer that points to a function that takes an object of a template class with said function pointer as template argument. Possible?

x__x I want to do something like this: typedef long (* fp)(BaseWindow< fp > & wnd, HWND hwnd, long wparam, long lparam); But I get a compile error: error C2065: 'fp' : undeclared identifier Is it possible to implement this somehow? ...

Photoshop Templates

Does anyone know any good tutorials for designing a website from a photoshop template? ...

Is there any way to combine transparency and "ajax usability" with HTML templates

I'm using HTML_Template_Flexy in PHP but the question should apply to any language or template library. I am outputting a list of relatively complex objects. In the beginning I just iterated over a list of the objects and called a toHtml method on them. When I was about to have my layout designer look over the template I noticed that it...

PHP: Separating Business and Presentional logic, is it worth it?

Possible Duplicate: Why should I use templating system in PHP? I was just curious as to how many developers actually do this? Up to this time I haven't and I was just curious to whether it really helps make things look cleaner and easier to follow. I've heard using template engines like Smarty help out, but I've also heard the ...

Template class inside class template in c++

Hello, noob here still experimenting with templates. Trying to write a message processing class template template <typename T> class MessageProcessor { //constructor, destructor defined //Code using t_ and other functions foo( void ) { //More code in a perfectly fine method } private: T *t_ }; All defined in a header file. ...

Tools for managing Text Templates / Boilerplate Code or Snippets ?

I am looking for freely available tools to help manage text templates (e.g. for writing emails or other letters), boilerplate code and other snippets. Preferably something open source or at least freeware. Ideally, it would not be specific to managing source code, but would generally help manage all sorts of ASCII chunks (or maybe ev...

Using auto and decltype in C++0x

I'm trying to learn the currently accepted features of c++0x and I'm having trouble with auto and decltype. As a learning exercise I'm extending the std class list with some generic functions. template<class _Ty, class _Ax = allocator<_Ty>> class FList : public std::list<_Ty, _Ax> { public: void iter(const function<void (_Ty)>& f) ...

WPF : Define binding's default

Hi, In WPF, I would like to be able to template how my bindings are applied by default. For instance, I want to write : Text="{Binding Path=PedigreeName}" But it would be as if I had typed : Text="{Binding Path=PedigreeName, Mode=TwoWay, UpdateSourceTrigger=LostFocus, NotifyOnValidationError=True, ValidatesOnDataErrors=True, Valid...

are there master templates in html?

I have to build a html website, which will contain about 50+ pages. The whole website will have a common look and feel. I wanted to know if there is a provision of master templates in building html websites, so that like in asp.net i can make a master page and then build html pages deriving from the master page. That way if i have to add...

Overloaded member function pointer to template

Hi! I'm try to store member function pointers by templates like this. (This is a simplified version of my real code) template<class Arg1> void connect(void (T::*f)(Arg1)) { //Do some stuff } template<class Arg1> void connect(void (T::*f)()) { //Do some stuff } class GApp { public: void foo() {} void foo(double ...

Name resolution in templates

I was reading about the template name resolution here. Just to get the feel of the things I replicated the code like this: void f (char c) { std::cout<<"f(char)\n"; } template <class T> void g(T t) { f(1); f(T(1)); f(t); d++; } double d; void f(int n) { std::cout<<"f(int)\n"; } void test() { std::cout<<"Fir...

Can one unroll a loop when working with an integer template parameter?

I have the following code: template <int size> inline uint hashfn( const char* pStr ) { uint result = *pStr; switch ( size ) { case 10: result *= 4; result += *pStr; case 9: result *= 4; result += *pStr; ... ... case 2: result *= 4; result += *p...

string replacement in page created from template

I've got some aspx pages being created by the user from a template. Included is some string replacement (anyting with ${fieldname}), so a portion of the template looks like this: <% string title = @"${title}"; %> <title><%=HttpUtility.HtmlEncode(title) %></title> When an aspx file is created from this template, the ${title} gets r...

Easiest way to echo HTML in PHP?

I want to conditionally output HTML to generate a page, so what's the easiest way to echo multiline snippets of HTML in PHP 4+? Would I need to use a template framework like SmartyPants? echo '<html>' + '\n'; // I'm sure there's a better way! echo '<head>' + '\n'; echo '</head>' + '\n'; echo '<body>' + '\n'; echo '...

Magento: Including a module template into the checkout process

Hi, I'm trying to include a custom template into the checkout process on the shipping page. I want that template to adopt the functionality of its parent template so I can use any of the shipping variables within the template. However I can't get magento to load the template. Here is my XML (the header scripts are adding successfully...

How to create a new stored procedure template for Visual Studio?

I would like to create a template for new stored procedures for our development team. However, I can't seem to create template items for Database objects. I know for DLL/C#-related items, it's as simple as "File > Export Template ..." How can I add new SQL templates to my Database project? Here's my template: IF EXISTS (select 1 fro...