templates

change HeaderTemplate of AJAX toolkit TabContainer

Hi Guys, I have a Tab Panel which has a text Upcoming Birthdays and i run a query to find if there are any upcoming birthdays and bind them to a datalist. so i want to show the count of birthdays as Upcoming Birthday(1) or Upcoming Birthday(2) but i cant find any way from code behind to do this my tab index is 2 and even if i do this ...

Confusing function lookup with templates in C++

Starting with the following (using gcc version 4.0.1): namespace name { template <typename T> void foo(const T& t) { bar(t); } template <typename T> void bar(const T& t) { baz(t); } void baz(int) { std::cout << "baz(int)\n"; } } If I add (in the global namespace) struct test {}; void bar(co...

Button Style with Different Icons

Hi, i have 5 buttons on my navigation grid. Each button has a different icon. In the button's style, which element do i use to place the image into when im on my main screen? any suggestions would be helpful. Thanks.. ...

How to design a masterpage for a website? Is there any template?

HI I am going to create a website, So I need to have a master page for all my own pages. But its difficult to design it from scratch, Is there any template I use and just changing for example the colors, font sizes, ...? ...

ASP.Net Gridview: get rid of redundant controls in templates

In a gridview I want to allow editing and inserting data. The Insert row should be in the footer row. But that row is not existing if the datasource is empty. So I have to create an emptydatatemplate and repeat all of my controls. Together with the edittemplate I have the same set of cells and controls three times, like this examples sho...

Client Side Templates in javascript how to bind data

I'm using Client Side templates in my JavaScript. $create(Sys.UI.DataView, { data: data }, null, null, $get("id")); Where i have JSON result in "data", which has 100 record. So ths template binding all the 100 record. How can i efficiently pass required amount of data. ex: 10 record. ...

Assigning Unique Numerical Identifiers to Instances of a Templated Class

Core problem: I want to be able to take an instance of a templated class, say: template<class a, class b, class c> class foo; foo<int, float, double>; and then do something like: foo<int, float, double>::value; //Evaluates to a unique number foo<long, float, double>::value; //Evaluates to a different unique number foo<int, float, d...

flex index.html template

i see that that template has some code to see if the client has the required version, and it does stuff if it has or it doesn't and there is a <object> tag inside <noscript> question: if the stuff is gonna work with the <object> tag anyway why would you need all that stuff above with the control of version if it has or not ? ...

Templated class function T: How to find out if T is a pointer?

As a follow-up to this question: I need to decide in a class function like this: template< typename T > bool Class::Fun <T*> ( T& variable ) {...} whether T is a pointer or not. In the question cited above the answer was to use partial template specialization. As far as I've found out this is not possible for class functions. Is this...

Is autoescape off in django safe?

I want to display some html in django 1.0 templates and to do that I have been doing something like this: {% autoescape off %}{{ var.text }}{% endautoescape %} and I am just wondering how safe this is? Am I still protected against sql injection and cross site scripting and other vulnerabilities like that? ===Edit ======= This text ...

Partial specialization of a class template in derived class affects base class

I have a metafunction: struct METAFUNCION { template<class T> struct apply { typedef T type; }; }; Then I define a helper: template<class T1, class T2> struct HELPER { }; And then I have second metafunction which derives from the METAFUNCTION above and defines partial specialization of apply struct: struct METAFUNCION2...

Ambiguous template, Code Warrior

The following code compiles in Visual C++ and gcc, but fails with Code Warrior The complaint is that the call to the template is ambiguous -- can't decide between doIt( M* ) and doIt( M const* ), even though in each case, the parameter is unambiguously cost or non-const. Irritatingly, if I supply the second template argument, it decides...

How to do templates in php like this?

I am going over/studying the facebook code that was leaked in 2007, I notice 1 function they call several times on on all the pages is this tpl_set(param1,param2) function I am going to assume this is something to do with templates, The function has 2 parameters/variables passed into it, it looks like the first 1 is the name of the t...

C++ Template Specialization

The following template specialization code template<typename T1, typename T2> void spec1() { } Test case 1 template< typename T1> //compile error void spec1<int>() { } Test case 2 template< typename T2> //compile error void spec1<int>() { } generates a error C2768: 'spec1' : illegal use of explicit template arguments compil...

How is insert iterator work in c++

there is insert iterator in database template library or other library, Can someone tell me how it work ? Thanks! ...

C# Design template containers?

I have been trying to find a good guide to create a templated control. I am trying to display a few pictures on several different parts of my website so I wanted to add a template control to allow me to modify the HTML before it renders. Something like: <cc1:photos runat="server" id="myPhotos"> <photoCell> <img src="<%# photo %>" al...

Casting pointer as template argument: Comeau & MSVC compile, GCC fails

Consider the following code: template<int* a> class base {}; int main() { base<(int*)0> test; return 0; } Both Comeau and MSVC compile this without issues (except for Comeau warning about an unused variable), while GCC fails on the base<(int*)0> test; line, stating In function `int main()': a casts to a type other than...

How can I use MSBuild to export another project as a Visual Studio template project?

Here's what I'm trying to achieve. I have a number of projects in C# and VB which I wish to export as template projects as part of my automated build process. Exporting templates is easy to do interactively, but I need to do it as part of my automated build process. Further, the template projects must actually be built prior to exporting...

Django: passing an argument to a method on a template variable

I am using the lxml library to define a variable (category) in a view. lxml provides a method .get to retrieve custom attributes. I'd like to use it in the template like so: {{ category.get("foo") }} I know that when using template variables it is unnecessary to use parenthesis, but I get the following error: {{ category.get "foo" }}...

C++ Templates and Factories

I've been playing with C++ for a few years now, and want to become adept at using and factories. Are there some good web tutorials and/or textbooks that cover this well? I started programming prior to the wide use of the term "patterns" ('80's)... but when I first saw the term I recognized the "pattern" of it's usage. A good referenc...