templates

Distributing microsoft.visualstudio.texttemplating.dll with custom app

We are writing an app that will use T4 to generate Flex/Actionscript to compile into SWF. We would like to distribute this app to users who will not have VS. I've searched and searched and could not find any info anywhere on redistributing microsoft.visualstudio.texttemplating.dll with your apps, except on this code plex project (http://...

Priority when choosing overloaded template functions in C++

I have the following problem: class Base { }; class Derived : public Base { }; class Different { }; class X { public: template <typename T> static const char *func(T *data) { // Do something generic... return "Generic"; } static const char *func(Base *data) { // Do something specific... return "Specific";...

Ext.util.Format.undef functionality for null values

I have a json property that might be null, and I'd prefer to keep it that way for other reasons. When I include that property in an Ext.Template with '{myProp}' it sometimes renders as the word "null" when I want it to render as an empty string. {myProp:undef} only hunts for undefined, not null. What's the best way to get this done gi...

Ruby templates: How to pass variables into inlined ERB?

Hello! I have an ERB template inlined into Ruby code: require 'erb' DATA = { :a => "HELLO", :b => "WORLD", } template = ERB.new <<-EOF current key is: <%= current %> current value is: <%= DATA[current] %> EOF DATA.keys.each do |current| result = template.result outputFile = File.new(current.to_s,File::CREAT|File::TRUNC|File::R...

Wordpress Shortcode in Theme, Trying to use Gallery

We are using SuperSlidShow Plugin to display gallery of images in our post. However when I write shortcode [gallery] in my post/page images appear correctly, but can anyone guide me if I want to fix this [gallery] shortcode in the theme itself like page.php/post.php so that images will appear on all pages. We have images for every page/p...

Template Partial Specialization - any real-world example?

I am pondering about partial specialization. While I understand the idea, I haven't seen any real-world usage of this technique. Full specialization is used in many places in STL so I don't have a problem with that. Could you educate me about a real-world example where partial specialization is used? If the example is in STL that would b...

How do you unit test templating code?

For example, I have a piece of code that's generating a SQL*Loader control file from this template (using Python): template = """ LOAD DATA INFILE '%(file_path)s' APPEND INTO TABLE %(table_name)s FIELDS TERMINATED BY "%(delimiter)" OPTIONALLY ENCLOSED BY "" (\n%(column_specifications)s\n) """ There are only two ways that I can think o...

How can I force the type of an array when initialized in Scala?

Basically, I have an array like this: val base_length = Array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0 ); And when scala sees it, it wants to do this: base_length: Array[Int] = Array(...) But I would prefer for it to do this: base_length: Array[Byte] =...

WPF User control or Template? How would i create a Template using Blend?

Hi, How would i create a window template using Blend? My application will be sharing many pages with the same layout. One of my major concerns is what will happen when i need to make a change to the template. Will this update all of the pages automatically? Should i just use a usercontrol and add it to everypage? ...

Customized new JUnit templates in Eclipse?

I've spent a few hours searching for this, and can't find it, so I'm asking. Why here? How can I customize Eclipse so that when I create a new JUnit test class or method, it includes different items? For other source, I'd just go into Window->Preferences, and change the templates. But for JUnit, that doesn't seem to be possible. I...

Hints on parsing

I want to implement a minimal templating language like Template Toolkit but much more simple. I don't want to use an existing implementation/library, but start from scratch because I want to learn something from it and I want to completely understand it in order to adopt it to my needs. The end product should be in C but I will probably ...

Executing php from another file

Hi guys, i have 1 template-file, which is included into main file. some.template: ... <?php echo '!'; ?> ... in main file i read file into 1 variable and display it. Of course, php script doesn't run there. How can i do that, what i want? Thanks ...

StringTemplate for runtime code gen?

Hi, I am working on a project that generates code at runtime based on meta-model. I've used vb.net xml literals for this, but today I ran accross StringTemplate project. Has anybody successfully used this library in C# project. ...

Subsonic 3.0.0.3 not generating parameters for stored procedures

I have a SQL Server 2008 database with a bunch of stored procedures. When I use the ActiveRecord Template provided with Subsonic 3.0.0.3, it generates methods for all of my stored procedures, but they do not have any parameters. I am dbo on the server and can execute the stored procedures with no issue from Management studio. Example St...

custom ASP.NET template control without placeholder tags

Let's say I have a custom template control, that can be used in pages like so: <AR:CustomControl runat="server"> <ViewTemplate> <span>stuff</span> </ViewTemplate> </AR:ModalLink> Since there is only one template field, the element isn't really necessary. Is there a way I can edit my control so it can be used like? <...

Way to determine proper predicate for templated types

Suppose I have a function which looks like this: template <class In, class In2> void func(In first, In last, In2 first2); I would like this function to call another function which accepts a predicate. My initial instinct was to do something like this: template <class In, class In2> void func(In first, In last, In2 first2) { typed...

End user licence agreement template

Somewhere in the web i found this version of EULA! You have no rights Please read carefully 1 So what is the best practice on creating the end user licence agreement? Visiting a laywer or searching and modifing a ready one generic template? Could you povide me a point to start? ...

How can I make a blogger.com template?

How can I make a template for blogger.com? ...

C++ template, linking error

I have a problem in calling a template class I have. I declared a new type name Array, which is a template; In the .hpp file: template <typename T> class Array { public: Array(); }; In the .cpp file: template <typename T> Array<T>::Array() { //Do something } In main: Array<int> arr; I get Linkage error: unresolved external s...

Looking for Document Templates for a Developer Guide

I'm looking for a document template and some writing/style guides to structure the content of a Developer Guide for a subsystem I am about to hand off to a client. This goes beyond documenting the public API - I want to walk developers through an easy process of writing a client for my subsystem, teaching them the API and other things th...