templates

EDI X12 Templates in Python (Most likely django or jinja) (w/ sqlalchemy)

My Case: I'm working on a system that will need to create various X12 files for health care (insurance) transactions and inquiries (Specifically 270 Eligibility and 837 Claim). I know there are good tools out there (pyx12 specifically) for converting between XML and X12, and actually I've gone as far as importing some components from ...

Is there any Tables lib/code for in memory manipulation in C++

I've started doing my own "struct of arrays" coding, but wondered if anyone knew of libs or templates that were already out there for doing intense data transform stuff on memory constrained hardware. I suppose what I'm looking for is a sort of "in memory" container that allows me to queue up insertions until a sync point, and mid itera...

Simple simple template returning odd numbers?

EDIT BEFORE YOU READ: Sorry.. I didn't add newline so it appeared jumbled, I can't delete the question because I'm not registered yet, sorry for wasting your time guys. I just used a template for the first time (for finding MIN of two numbers) instead of a macro, and I liked it! But when I tried to modify and make my own template it fai...

Fixing "comparison is always false ..." warning in GCC.

I'm having a problem which I'm sure is simple to fix but I'm at a loss... I have a template that performs the following code: T value = d; if ( std::numeric_limits< T >::is_signed ) { if ( value < 0 ) { *this += _T( "-" ); value = -(signed)value; } } Now for, obvious reasons, GCC is giving me a warning...

Is it possible to prevent a base template reloading using django's template inheritance?

In the header region of my base template (main.html), I've placed an HTML5 media player which pulls in content uploaded through my admin interface. What I'm attempting to do is, when the tracks have been loaded once, have the media player remain unaffected by internal site navigation. In other words, the media player keeps playing but ...

Separating Logic/Style in PHP properly

Hi Mates, I'm just wondering what is the best way to separate logic components from the layout in a PHP web project? The content is stored in MySQL, the logic is PHP and the templates are HTML/CSS of course. My question is, how to solve this issue best (without using a CMS). greetz, poeschlorn ...

Problem using jqote2 with struts2 taglib

If I try to add jqote2 variable declaration into struts2 tablig, such as name attribute. For "<" and ">" character, struts2 will escape them into < and > to client browser, and make jqote2 unable to locate variable defined in struts2 tag attribute, example below: <script type="text/html" id="priceRowTemplate"> <![CDATA[ <tr>...

Get Model Field Name in Template

In a template for a view I would like to use the name of a field and not just the value. So for example if I have this: class Test(models.Model): name = models.CharField(max_length=2, verbose_name = 'Your name') age = models.PositiveSmallIntegerField(max_length=3) I would like to be able to do {{ name.get_field_name_display }} which...

std::map::const_iterator template compilation error

I have a template class that contains a std::map that stores pointers to T which refuses to compile: template <class T> class Foo { public: // The following line won't compile std::map<int, T*>::const_iterator begin() const { return items.begin(); } private: std::map<int, T*> items; }; gcc gives me the following error: error: ...

PHP Template Engine

How can I improve the script below to be able to add global template parts such as start and end of the page? <?php class simpleTemplate { var $variables; var $variables_callback; var $contents; var $preg; var $regexps; // Constructor, initialize default variables functio...

App Engine template values not showing

Hi everyone. I'm trying to read a line from a static file and insert it into a template in Google App engine using the Webapp framework. However, the line does not render, not matter what I try. Is there something that I'm overlooking? main.py: def get(self): ... question = randomLine("data/questions.csv") data = question....

C++ template instantiation restrictions

I have a method foo in class C which either calls foo_1 or foo_2. This method foo() has to be defined in C because foo() is pure virtual in BaseClass and I actually have to make objects of type C. Code below: template <class T> class C:public BaseClass{ void foo() { if (something()) foo_1; else foo_2; } void foo_1() { ...

Static check const char* contains spaces

Is there a way to check (assert) at compile time wether a const char* contains spaces or not? Something like: const char* cstr1 = "ok"; const char* cstr2 = "very bad"; check( cstr1 ); //OK check( cstr2 ); //Fail to compile The type is the same, but it may be possible to define some tricky template metaprogramming tecnique to do it. ...

Technique for Using Templates and Virtual Functions

A while back I learned about the Curiously Recurring Template Pattern (http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern), and it reminded me of a technique I had used to implement an event queue cache. The basic idea is that we take advantage of a Base class pointer to store a container of homogeneous pointer types. How...

Templates with Facelets and calling action from template's component ?

Hello everyone ! I'm a newbie in JSF, facelet, richfaces... and I understood managed beans, methods called within JSF components However, I wanted to use facelets template with the ui:composition, ui:define, like master pages in asp.net But I have an action that's meant to be called in a masterpage component... and I keep having the s...

Cannot dynamic_cast void* to templated class

The exact error I'm getting is: Cannot dynamic_cast 'object' (of type 'void*') to type 'class udDator(int)*' (source is not a pointer to a class) This is happening inside an overridden operator delete. I'm attempting to create a templated memory management class that can inherit into any other class, managing memory through references...

Should lambda decay to function pointer in templated code?

I read somewhere that a lambda function should decay to function pointer if the capture list is empty. The only reference I can find now is n3052. With g++ (4.5 & 4.6) it works as expected, unless the lambda is declared within template code. For example the following code compiles: void foo() { void (*f)(void) = []{}; } But it do...

Latex template for journal / magazine

Hi, we are trying to publish a free magazine with technical articles, papers and tutorials about mobile development. We decided to use latex instead of, ie. InDesign . Can anyone recommend some latex templates for journal/magazines as a starting point, so we don't have to build from scratch? Thanks ...

standard structure for C header and source files

Is there any standardized structure of C source and header files? I'm thinking about something like this (example for C source file): // static variables // public variables // static methods // public methods ...

C++: Fill array according to template parameter

Hello, Essentially, the situation is as follows: I have a class template (using one template parameter length of type int) and want to introduce a static array. This array should be of length length and contain the elements 1 to length. The code looks as follows up to now: template<int length> class myClass{ static int array[leng...