Hi,
I want to create a template class in C#, for example:
public class Foo<T>
where T must inherit from a known class.
I cant seem to find the syntax for that.
Thanks, Malki.
Heyy there,
i have an application, and in my urls.py i have something like that:
urlpatterns = patterns('',
url(r'^profile_view/(?P<id>\d+)/$',
profile_view,
name='profile_view'),)
meaning that the profile_view function has id as a parameter. Now, i want to call that function from…
This code:
template <typename T>
struct A
{
T t;
void DoSomething()
{
t.SomeFunction();
}
};
struct B
{
};
A<B> a;
is easily compiled without any complaints, as long as I never call a.DoSomething().
However, if I define DoSomething as a virtual function, I will get a compile error saying that B…
Looking to expand a current J2EE project using JSTL and Apache Torque with some sort of templateengine so we can easily modify the views.
Any suggestions?
I'm trying to learn templates and I've run into this confounding error. I'm declaring some functions in a header file and I want to make a separate implementation file where the functions will be defined. Here's the code that calls the header (dum.cpp):
#include <iostream>
#include <vector>
#include <string>
#include…
The following example is working when I manualy replace T wirh char *, but why is not working as it is:
template <typename T>
class A{
public:
A(const T _t) { }
};
int main(){
const char * c = "asdf";
A<char *> a(c);
}
When compiling with gcc, I get this error:
test.cpp: In function 'int main()':
test.cpp:10:…
Hello, I have some template function and I want to call it using define in c++:
#define CONFIG(key, type, def) getValue<type>(key, def);
Of course, it won't work. Could I make something like this?
I want to display a certain in the template only if a certain GET variable is set....I thought using {% if request.get.my_var %} would work, but it's not giving me the results.
Hi, this is a post detailing my search for the most enjoyable way for a hobbyist game programmer to sweeten his free time with making a game.
My requirements:
I looked at Flash first, I made a couple of small games but I'm doubtful of the performance. I would like to make a fairly large strategy game, with several hundred units…
I ran into the following error recently in Visual Studio 2010 while trying to port Phil Haack’s excellent T4CSS template which was originally built for Visual Studio 2008. The Problem Error Compiling transformation: Metadata file 'dotless.Core' could not be found In “T4 speak”, this simply means that you have…
I'm trying to customize the javascript that Dashcode uses. So that I won't step on Apple's Project Templates, I want to make a custom project template that would appear as a choice after you click "New Project." I have been able to modify one of the existing templates (like, Custom, Browser, Utility, RSS, and Podcast).
I can…
Hello, I am after a very lightweight templateengine that supports / can be embedded inside Android programs. I've looked at the MiniTemplator (I think that is how you spell it) and that looks great but it loads in only from file and I need to load templates from string and I am not fully confident in changing that code lol.
…
Hi,
I have two data templates, one of which is the subset of another like below:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:igEditors="http://infragistics.com/Editors"
xmlns:sys="clr-namespace:System;assembly=mscorlib"…
I've got this weird crashing happening when creating a C# Word 2007 Template Project in Visual Studio 2008. The IDE tells me that it's creating the project (it does create the solution and C# vsproj as well as the dotx and cs files). Then the IDE just crashes - no errors, messages, etc. When I try devenv /SafeMode it still…
I have a powerpoint template which i want diverse group to fill that up. The challnge i am facing is people are not sticking to the guidelines given in terms of font size, font colour and space for each sections. I am looking for a solution where i can restrict the powerpoint template so that the respondants do not go…
I do not understand why this code is not valid:
#include <vector>
template <typename T>
class A{
public:
A() { v.clear(); }
std::vector<A<T> *>::const_iterator begin(){
return v.begin();
}
private:
std::vector<A<T> *> v;
};
When compiling it with gcc,…
Hi,
I am building a template system for emailing people that currently works in the format of:
$array['key1'] = "text;
$array['key2'] = "more text";
<!--key1--> // replaced with *text*
<!--key2--> // replaced with *more text*
For this particular project I have a nested array with this kind of…
Hi!
I want to include an initialized data structure in my request object, making it accessible in the context object from my templates. What I'm doing right now is passing it manually and tiresome within all my views:
render_to_response(...., ( {'menu': RequestContext(request)}))
The request object…
The Dynamic Tab Shell template does expose a method on the Tab.java class that allows you to get access to the ADF binding container for a tab. At least in theory this works, because in practice this call always returns a null value (a bug is filed for this).
To work around the problem, you can use…
I'm using xml.sax with unicode strings of XML as input, originally entered in from a web form. On my local machine (python 2.5, using the default xmlreader expat, running through app engine), it works fine. However, the exact same code and input strings on production app engine servers fail with "not…
I'm pulling some RSS feeds into a datastore in App Engine to serve up to an iPhone app. I use cron to schedule updating the RSS every x minutes. Each task only parses one RSS feed (which has 15-20 items). I frequently get warnings about high CPU usage in the App Engine dashboard, so I'm looking for…
Hi guys,
I want to implement a media recommendation engine. I saw a similar posts on this, but I think my requirements are bit different from those, so posting here.
Here is the deal.
I want to implement a recommendation engine for media players like VLC, which would be an engine that has to…