Hi,
I am using Ubuntu 9.04
I just installed ruby and rails in my system and the webrick server seems to have been installed without any errors.
I created a "demo" rails app and created a controller 'say'. Then i created a view template 'hello.rhtml'
I started the server and entered http://localhost:3000/say/hello in my browser.
But t...
Is it possible to specialize a templatized method for enums?
Something like (the invalid code below):
template <typename T>
void f(T value);
template <>
void f<enum T>(T value);
In the case it's not possible, then supposing I have specializations for a number of types, like int, unsigned int, long long, unsigned long long, etc, then...
background: url({{ MEDIA_URL }}/bg.jpg);
That does not work, because this Django template function only works in .html!
...
I have a project that I am working on in django. There are a lot of instances where I:
raise Http404("this is an error")
and it creates a nice 404 page for me with the error message "this is an error" written on it. I now want to create a custom error page and have it still display the message, but I can't figure out how. I'm sure it'...
I know this
on the javascript programming
if(a==b){}else{}
same code on the blogger blog template syntax
<b:if cond='a==b'>
<b:else/>
</b:if>
I need, how to do following on the blogger
if(a==b) || (c==a) how to create multi conditional expression ?
data:blog.url.substring(40) how to subtract data:blog.url string. ?
data:blog.ur...
Pimpl's are a source of boilerplate in a lot of C++ code. They seem like the kind of thing that a combination of macros, templates, and maybe a little external tool help could solve, but I'm not sure what the easiest way would be. I've seen templates that help do some of the lifting but not much -- you still end up needing to write forwa...
Refer to: http://stackoverflow.com/questions/1613454/retrieving-one-element-and-filter-by-another
In the above linked posting, I don't understand why the two template blocks don't get executed upon in the incoming XML at the same time. As far I can can see, the XSL risks the second template executing for every Document element whether i...
I have a template class defined like so:
template <class T>
class Command {
public:
virtual T HandleSuccess(std::string response) = 0;
virtual std::string FullCommand() const = 0;
// ... other methods here ...
};
Will C++ allow me to create a non-template subclass of a template class? What I mean is can I do something like...
How do i make it so that as the first div expands...the lower div will automatically go lower, due to the height of the first div now is larger?
Is this display? Or Position?
...
I remember doing this in Delphi 7, but I don't remember how, or it is different in the new Delphi IDE. But how do I add a new template to the items gallery?
So then it will show up under the File / New menu.
...
Hi everybody.
I have a problem concerning nested templates and the overriding of the assignment operator.
Say i want to have a refcounting class template _reference. This _reference for now simply
holds a pointer to the ref-counted object. The problem now is that this all works fine,
as long as im doing this with simple classes or str...
After answering this question I was trying to find is_complete template in Boost library and I realized that there is no such template in Boost.TypeTraits. Why there is no such template in Boost library? How it should look like?
//! Check whether type complete
template<typename T>
struct is_complete
{
static const bool value = ( si...
I want to somehow merge templates like these into one:
template <class Result, class T1, class T2>
class StupidAdd
{
public:
T1 _a; T2 _b;
StupidAdd(T1 a, T2 b):_a(a),_b(b) {}
Result operator()() { return _a+_b; }
};
template <class Result, class T1, class T2>
class StupidSub
{
public:
T1 _a; T2 _b;
StupidSub(T1 a, ...
Hello, I have the following code that compiles and works well:
template<typename T>
T GetGlobal(const char *name);
template<>
int GetGlobal<int>(const char *name);
template<>
double GetGlobal<double>(const char *name);
However I want to remove the "default" function. That is, I want to make all calls to GetGlobal<t> where 't' is not...
I'm using Smarty and PHP. If I have a template (either as a file or as a string), is there some way to get smarty to parse that file/string and return an array with all the smarty variables in that template?
e.g.: I want something like this:
$mystring = "Hello {$name}. How are you on this fine {$dayofweek} morning";
$vars = $smarty->ma...
I am working on two wrapper classes that define real and complex data types. Each class defines overloaded constructors, as well as the four arithmetic operators +,-,*,/ and five assignment operators =,+= etc. In order to avoid repeating code, I was thinking of using template functions when the left- and right-hand-side arguments of an o...
Im stuck again with templates.
say, i want to implement a guicell - system. each guicell can contain a number of child-guicells. so far, so tree-structure. in std-c++ i would go for sthg. like:
template <typename T>
class tree
{
public:
void add (T *o) { _m_children.push_back (o); }
void remove (T *o) { ... };
list<T*>...
I'm not an experienced C++ programmer and I'm having problems compiling. I've got a Heap class that uses a template:
template <class T>
class Heap
{
public:
Heap(const vector<T>& values);
private:
vector<T> d;
// etc.
};
And then in a separate implementation file:
template <class T>
Heap<T>::Heap(const vector<T>& val...
Hi, I'm trying to figure out the most efficient way to implement RoR-style partials/collections for a PHP template class that I'm writing. For those who aren't familiar with rails, I want to iterate over a template fragment (say a table row or list item) located in a separate file. I want to do this without resorting to eval or placing a...
What is the fastest way to store templates? In a database (SQL Server) or a file? Those template can be from 1KB to ~15KB (usually 1-3KB).
After reading the template, I'm parsing it with Regex to HTML. I've <div>[Block Parameter="Value" Parameters2="SomeValue" ...]</div> for example, so please consider that.
Thanks.
...