Search Results

Search found 3563 results on 143 pages for 'templates'.

Page 13/143 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • How do I make a class whose interface matches double, but upon which templates can be specialized?

    - by Neil G
    How do I make a class whose interface matches double, but whose templated types do not dynamic cast to double? The reason is that I have a run-time type system, and I want to be able to have a type that works just like double: template<int min_value, int max_value> class BoundedDouble: public double {}; And then inherit use template specialization to get run-time information about that type: template<typename T> class Type { etc. } template<int min_value, int max_value> class Type<BoundedDouble<min_value, max_value>> { int min() const { return min_value; } etc. } But, you can't inherit from double...

    Read the article

  • Templates --> How to decipher, decide if necessary and create?

    - by ML
    Hi All, I have a few classes in a project that I inherited that are really old, last I knew they compiled with CodeWarrior 8. I am not in XCode 3.2 Here is an example of what I struggle with: template <class registeredObject> typename std::vector<registeredObject>::iterator FxRegistry<registeredObject>::begin(void) { return mRegistryList.begin(); } The errors are: no 'typename std::vector<registeredObject, std::allocator<_CharT> >::iterator FxRegistry<registeredObject>::begin()' member function declared in class 'FxRegistry<registeredObject>' template definition of non-template 'typename std::vector<registeredObject, std::allocator<_CharT> >::iterator FxRegistry<registeredObject>::begin()' How do I decide how to solve these and where do I start looking?

    Read the article

  • Function templates for arbitrary STL containers containing arbitrary types.

    - by Chad Brewbaker
    I have an arbitrary STL container C, which contains elements of an arbitrary type T. I want to create an std::vector that has a copy of all the elements. What is the cleanest way to do this? template <typename C> void myfunction(C container){ /*Derive the type T of elements within the container*/ std::vector<T> mystack; /* Iterate over container and push_back() the elements into mystack*/ }

    Read the article

  • Specializing function templates outside class temp. definition - what is the correct way of doing t

    - by LoudNPossiblyRight
    I am attempting to specialize a function template that is a member of a template class. The two of them have different template parameters. The template function specialization inside the temp. class definition is never called and the one func. spec. outside the class definition does not even compile. Should i expect this to work in the first place, and if so, what do i have to change in this code to both compile and make it work correctly: using VS2010 #include<iostream> using namespace std; template <typename T> class klass{ public: template <typename U> void func(const U &u){ cout << "I AM A TEMPLATE FUNC" << endl; } //THIS NEVER GETS CALLED !!! template <> void klass<T>::func(const string &s){ cout << "I AM A STRING SPECIALIST" << endl; } }; //THIS SPECIALIZATION WILL NOT COMPILE !!! template <typename T> template <> void klass<T>::func(const double &s){ cout << "I AM A DOUBLE SPECIALIST" << endl; } int main(){ double d = 3.14159265; klass<int> k; k.func(1234567890); k.func("string"); k.func(3.14159265); return 0; }

    Read the article

  • How to write curiously recurring templates with more than 2 layers of inheritance?

    - by Kyle
    All the material I've read on Curiously Recurring Template Pattern seems to one layer of inheritance, ie Base and Derived : Base<Derived>. What if I want to take it one step further? #include <iostream> using std::cout; template<typename LowestDerivedClass> class A { public: LowestDerivedClass& get() { return *static_cast<LowestDerivedClass*>(this); } void print() { cout << "A\n"; } }; template<typename LowestDerivedClass> class B : public A<LowestDerivedClass> { public: void print() { cout << "B\n"; } }; class C : public B<C> { public: void print() { cout << "C\n"; } }; int main() { C c; c.get().print(); // B b; // Intentionally bad syntax, // b.get().print(); // to demonstrate what I'm trying to accomplish return 0; } How can I rewrite this code to compile without errors (and output "C\nB\n")?

    Read the article

  • Online Cv examples

    - by Reza M.
    I'm a soon to be software engineer, hopefully... I wanted to start my online cv... As I looked around, I found the old school types where its just a plain text while the new ones are all colorful but seem overpowering. I was thinking of a more section wise cv. One that would link to categories. But here is the thing, I'm a noob at this ... Any hints, help, or examples would be much appreciated. In short, I would want a cv plus a portfolio that would be able to work on all different browsers. So my question: Any examples or guidelines or templates, to creating a perfect ONLINE cv preferably with portfolio?

    Read the article

  • Eclipse Code Templates with Cobol

    - by Bruno Brant
    People, My team is just beginning to learn how to use COBOL on Eclipse (as part of the Rational Developer for System Z package) and one of our most desired features are code templates or code snippets. What we'd like to have is a code completion based on snippets just like we have on Java. For example, when I type try and hit ctrl-space Eclipse shows me a list of completion options, where one of those is create a try/catch block. Well, in COBOL one could leverage this when creating, for example, embedded SQL blocks, like EXEC SQL SELECT field, field, field, FROM table WHERE field = value, field = value END-EXEC. However, for some reason, it seems that Eclipse treats COBOL a little differently (no wonder why) from other languages. As such, when looking for the code templates in the preferences menu for COBOL, its appearance is very different from the Java one. The question is: how does one uses Eclipse's code templates with COBOL?

    Read the article

  • Ruby on Rails: having two xmlbuilder templates per action , one for errors one for regular output

    - by randombits
    What's the best way to handle having two templates (or should it be one, DRY?) for xml builder templates? I'm building a web api with Rails and wanted to see an example of how to have a view that does regular output vs one that does error output. I've been using @obj.to_xml for a while, but my requirements have changed and require me building my own error templates. do you typically have both views in one with a condition above for errors such as app/views/myresource/create.xml.builder unless @myobj.errors.empty? // xml for errors here? end // regular xml view

    Read the article

  • Git & Web-design: handling multiple customized templates

    - by o_O Tync
    I'm developing a CMS (with Django, but that doesn't matter) and have chosen GIT. Installations will vary in: Configs Database contents Media Templates First 3 are not a problem with git: we simply don't need these :) While developing, I have 1 default template with related media. Later, each customer will receive his own design based on default templates (some slight customization). I'm not going to support each of the custom templates as I introduce new features. Modularity helps with this but is not a 100% solution. Do you have any experience to share?

    Read the article

  • Are SharePoint site templates really less performant than site definitions?

    - by Jim
    So, it seems in the SharePoint blogosphere that everybody just copies and pastes the same bullet points from other blogs. One bullet point I've seen is that SharePoint site templates are less performant than site definitions because site definitions are stored on the file system. Is that true? It seems odd that site templates would be less performant. It's my understanding that all site content lives in a database, whether you use a site template or a site definition. A site template is applied once to the database, and from then on the site should not care if the content was created using a site template or not. So, does anybody have an architectural reason why a site template would be less performant than a site definition? Edit: Links to the blogs that say there is a performance difference: From MSDN: Because it is slow to store templates in and retrieve them from the database, site templates can result in slower performance. From DevX: However, user templates in SharePoint can lead to performance problems and may not be the best approach if you're trying to create a set of reusable templates for an entire organization. From IT Footprint: Because it is slow to store templates in and retrieve them from the database, site templates can result in slower performance. Templates in the database are compiled and executed every time a page is rendered. From Branding SharePoint:Custom site definitions hold the following advantages over custom templates: Data is stored directly on the Web servers, so performance is typically better. At a minimum, I think the above articles are incomplete, and I think several are misleading based on what I know of SharePoints architecture. I read another blog post that argued against the performance differences, but I can't find the link.

    Read the article

  • Smarty debug mode not displaying included templates.

    - by Kyle Sevenoaks
    On www.euroworker.no/order I have set Smarty's debug mode on with {debug output=html} in the header, so it will debug every page. But it says: Smarty Debug Console included templates & config files (load time in seconds): no templates included And after a list of template variables, {$cart} Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 561962 bytes) in /home/euroworkerno/www/library/smarty/libs/plugins/modifier.debug_print_var.php on line 30 It also doesn't display a list of templates for any url.. This is strange, can anyone point me to why it won't display the lit of .tpls? I need to find some HTML comments that someone has left in to rid IE of a display bug. Thanks.

    Read the article

  • Merging two templates in iText

    - by Shaggy Frog
    Let's say I have two PDF templates created with Adobe Acrobat, which are both single-page, 8.5x11 documents. The first template (A.pdf) has content for the top half of the page. The second template (B.pdf) has content for the bottom half of the page. (It just so happens the content in both templates does not "overlap" each other.) I would like to use iText to take these two templates and create a single, "merged" template from it (C.pdf) that is only a single page (with A.pdf's content on the top half and B.pdf's content on the bottom half). (I do not want to "merge" these two files into a 2-page document. I need the final product to be a single page.) I will be running iText in a servlet environment (Tomcat 6) but I don't think that makes a difference to the answer. Is this possible?

    Read the article

  • Reporting. MS Word templates population required

    - by Andrew Florko
    Application we developed fills MS Word templates with data from Database. Customers require to have ability edit Word templates via MS Word (change style, font, layout e.t.c) with no additional software to be installed and no training. AFAIK, Sql Reporting Services and Crystal Reports can't populate MS Word templates produced in MS Word. So we implemented our custom solution that maps .net classes onto xml-saved MS Word documents. It looks like we declare class MyTemplate { // maps to [age] field declared in ms document straight in the text int Age { get; set; } // maps to table by attributes applied to property (omitted) List<Person> Persons { get; set; } } We also implemented images insertion. Are there any free libraries for this task or may be you use your own MS-word templators in your projects?

    Read the article

  • Building a template engine - starting point

    - by Anirudh
    We're building a Django-based project with a template component. This component will be separate from the project as such and can be Django/Python, Node, Java or whatever works. The template has to be rendered into HTML. The templates will contain references to objects with properties that are defined in the DB, say, a Bus. For eg, it could be something like [object type="vehicle" weight="heavy"] and it would have to pull a random object from the DB fulfilling the criteria : type="vehicle" weight="heavy" (bus/truck/jet) and then substitute that tag with an image, say, of a Bus. Also it would have to be able to handle some processing. Eg: What is [X type="integer" lte="10"] + [Y type="integer" lte="10"] [option X+Y correct_ans="true"] [option X-Y correct_ans="false"] [option X+y+1 correct_ans="false"] The engine would be expected to fill in a random integer value <= 10 for X and Y and show radioboxes for each of the options. Would also have to store the fact that the first option is the correct answer. Does it to make sense to write something from the scratch? Or is it better to use an existing templating system (like Django's own templating system) as a starting point? Any suggestions on how I can approach this?

    Read the article

  • Spring Cleaning

    - by Tim Dexter
    I recently got a shiny new laptop; moving my shiz from old to new, was not the nightmare it used to be. I have gotten into the habit of using a second hard drive in the media bay where the CDROM normally sits. That drive contains my life's work with BIP. I can pull it out and plug it into another machine very easily. I have been sorting through some old directories and files, archiving some, sharing others with colleagues. For instance, a little dated but if you were looking for a list of Publisher reports available in EBS R12.1, here it is. Im trying to track down a more recent R12 instance and will re-post the document. I also found another gem; its a little out there in terms of usefulness but Im sharing it none the less. You can embed, locally or remotely reference SVG graphics (in XML format) and bring the images into the BIP outputs. Template and sample data here. A nice set of templates showing page number control and page suppression - they will need some explanation, so I'll save them for another post. The list goes on but I'll save them for later. Back to the clean up!

    Read the article

  • Oracle VM Templates Enable Oracle Real Application Clusters Deployment Up to 10 Times Faster than VMware vSphere

    - by Angela Poth
    Oracle VM - Quantifying the Value of Application-Driven DeploymentThe recently published report by the Evaluator Group, “Oracle VM – Quantifying The Value of Application-Driven Virtualization,“ validates Oracle’s ease of use and time savings over VMware vSphere 5. The report found that users can deploy Oracle Real Application Clusters up to 10 times faster with Oracle VM templates than VMware vSphere. Using Oracle VM templates users can deploy E-Business Suites nearly 7 times faster than VMware vSphere."Oracle VM’s application-driven architecture was built to enable rapid deployment of enterprise applications, with simplified integrated lifecycle management, to fully support Oracle applications. Our testing has demonstrated 90 percent improvement deploying Oracle Real Application Clusters 11g R2 using Oracle VM Templates and a similar improvement of 85 percent for the Oracle E-Business Suite 12.1.1. This clearly shows that Templates can provide real value to customers and should become an essential component for enabling rapid enterprise application deployment and management," said Leah Schoeb, Senior Partner, Evaluator Group.Read the Press Release Get a copy of the Evaluator Group Report: Oracle VM – Quantifying The Value of Application-Driven Virtualization

    Read the article

  • Oracle 11g RAC 11.1.0.7 on OEL 5.4 templates for Oracle VM released!

    - by wim.coekaerts
    We just released 2 new template packs for Oracle VM on our e-delivery website. The RAC team spent a lot of time building these fine templates for Oracle VM including elaborate documentation for both test and production usage. The documentation is included in the tar/zip files. Have fun ! you can go to http://edelivery.oracle.com/oraclevm Product Pack : Oracle VM templates Platform : x86 32 bit or x86 64 bit Oracle VM Templates for Oracle RAC Media Pack for x86 (32 bit) Oracle VM Templates for Oracle RAC Media Pack for x86_64 (64 bit) Freely downloadable OEL (+OEL/JeOS) and Oracle VM and free download of the trial version of Oracle 11g RAC.

    Read the article

  • Alternative to Canned Response in Gmail

    - by Stuck
    I have a mailbox that i share with a colleague. We want a good way to store templates for e-mails that we send often like answers to common questions and so on. We have tried to use Canned Response to store this templates but that GUI really sucks and is kind of unusable for other things then signatures and stuff. Is anyone aware of a good alternative to this? We need to be able to share this templates. So it must be stored "in the cloud". We want "as easy access" as possible directly in gmail. A firefox plugin would be fine since we both use Firefox. We use both Mac and PC so the solution must be cross-platform. Anyone have any ideas on how to solve this?

    Read the article

  • xslt apply-templates in second level

    - by m00sila
    I cannot wrap <panel> tags to second level individual items as shown in Expected result bellow. But with the xslt i have written, all 1.x get into single node. Please help me. Source xml <root> <step id="1"> <content> <text> 1.0 Sample first level step text </text> </content> <content/> <step> <content> <text> 1.1 Sample second level step text </text> </content> </step> <step> <content> <text> 1.2 Sample second level step text </text> </content> </step> <step> <content> <text> 1.3 Sample second level step text </text> </content> </step> </step> </root> Expected output <panel> <panel> 1.0 Sample first level step text </panel> <panel> 1.1 Sample second level step text </panel> <panel> 1.2 Sample second level step text </panel> <panel> 1.3 Sample second level step text </panel> </panel> My XSLT <xsl:template match="/"> <panel> <xsl:apply-templates/> </panel> </xsl:template> <xsl:template match="root/step" > <panel> <panel> <xsl:apply-templates select ="content/text/node()"></xsl:apply-templates> </panel> <panel> <xsl:apply-templates select ="step/content/text/node()"></xsl:apply-templates> </panel> </panel> </xsl:template>

    Read the article

  • All hail the Excel Queen

    - by Tim Dexter
    An excellent question this past week from dear ol Blighty; actually from Brian at Nextgen Clearing Ltd in the big smoke (London). Brian was developing an excel template and wanted to be able to reference the data fields multiple times inside the Excel template. Damn good question and I of course has some wacky solutions, from macros and cell referencing in Excel to pre-processing the data with an XSL stylesheet to copy the data multiple times so it could be referenced multiple times. All completely outlandish, enter our Queen of Excel, Shirley from the development team. Shirley is singlehandedly responsible for the Excel templates, I put her through six months of hell a few years back, with a host of Excel template requirements. She was more than up to the challenge and has developed some great features. One of those, is the ability to use the hidden XDO_METADATA sheet to map the data to custom named fields so they can be used multiple times in the template. So simple and very neat! Excel template and regular Excel users will know that you can only use the naming function once ie the names have to be unique across the workbook so you can not reuse a cell/group name. To get around this you can just come up with as many cell names as you want and map them in the XDO_METADATA sheet to the data columns/fields in your XML data set:. For example: XDO_?DEPTNO_SUMMARY?  <?DEPTNO?> XDO_?DNAME_SUMMARY?  <?DNAME?> XDO_GROUP_?G_D_DETAIL? <xsl:for-each-group select=".//G_D" group-by="./DEPTNO"> XDO_?DEPTNO_DETAIL? <?DEPTNO?> As you can see DEPTNO has been referenced twice and mapped to different named values in the left hand column. These values can then be used to name individual cells in the Excel template. You'll also notice a mix of Publisher <? ...?> and native XSL commands. So the world is your oyster on the mapping and the complexity you might need for calculations or string manipulation. Shirley has kindly built out a sample Excel template, data and result here so you can see how it all hangs together. the XDO_METADATA sheet is hidden, just right click on the sheet names and use the Unhide command to show it.

    Read the article

  • How to specialize a c++ variadic template?

    - by Serge
    I'm trying to understand c++ variadic templates. I'm not much aware of the correct language to use to explain what I'd like to achieve, so it might be simpler if I provide a bit of code which illustrate what I'd like to achieve. #include <iostream> #include <string> using namespace std; template<int ...A> class TestTemplate1 { public: string getString() { return "Normal"; } }; template<int T, int ...A> string TestTemplate1<2, A...>::getString() { return "Specialized"; } template<typename ...A> class TestTemplate2 { }; int main() { TestTemplate1<1, 2, 3, 4> t1_1; TestTemplate1<1, 2> t1_2; TestTemplate1<> t1_3; TestTemplate1<2> t1_4; TestTemplate2<> t2_1; TestTemplate2<int, double> t2_2; cout << t1_1.getString() << endl; cout << t1_2.getString() << endl; cout << t1_3.getString() << endl; cout << t1_4.getString() << endl; } This throws several errors. error C2333: 'TestTemplate1<::getString' : error in function declaration; skipping function body error C2333: 'TestTemplate1<1,2,3,4::getString' : error in function declaration; skipping function body error C2333: 'TestTemplate1<1,2::getString' : error in function declaration; skipping function body error C2333: 'TestTemplate1<2::getString' : error in function declaration; skipping function body error C2977: 'TestTemplate1' : too many template arguments error C2995: 'std::string TestTemplate1::getString(void)' : function template has already been defined error C3860: template argument list following class template name must list parameters in the order used in template parameter list How can I have a specialized behavior for every TestTemplate1<2, ...> instances like t1_4?

    Read the article

  • IntelliSense for Razor Hosting in non-Web Applications

    - by Rick Strahl
    When I posted my Razor Hosting article a couple of weeks ago I got a number of questions on how to get IntelliSense to work inside of Visual Studio while editing your templates. The answer to this question is mainly dependent on how Visual Studio recognizes assemblies, so a little background is required. If you open a template just on its own as a standalone file by clicking on it say in Explorer, Visual Studio will open up with the template in the editor, but you won’t get any IntelliSense on any of your related assemblies that you might be using by default. It’ll give Intellisense on base System namespace, but not on your imported assembly types. This makes sense: Visual Studio has no idea what the assembly associations for the single file are. There are two options available to you to make IntelliSense work for templates: Add the templates as included files to your non-Web project Add a BIN folder to your template’s folder and add all assemblies required there Including Templates in your Host Project By including templates into your Razor hosting project, Visual Studio will pick up the project’s assembly references and make IntelliSense available for any of the custom types in your project and on your templates. To see this work I moved the \Templates folder from the samples from the Debug\Bin folder into the project root and included the templates in the WinForm sample project. Here’s what this looks like in Visual Studio after the templates have been included:   Notice that I take my original example and type cast the Context object to the specific type that it actually represents – namely CustomContext – by using a simple code block: @{ CustomContext Model = Context as CustomContext; } After that assignment my Model local variable is in scope and IntelliSense works as expected. Note that you also will need to add any namespaces with the using command in this case: @using RazorHostingWinForm which has to be defined at the very top of a Razor document. BTW, while you can only pass in a single Context 'parameter’ to the template with the default template I’ve provided realize that you can also assign a complex object to Context. For example you could have a container object that references a variety of other objects which you can then cast to the appropriate types as needed: @{ ContextContainer container = Context as ContextContainer; CustomContext Model = container.Model; CustomDAO DAO = container.DAO; } and so forth. IntelliSense for your Custom Template Notice also that you can get IntelliSense for the top level template by specifying an inherits tag at the top of the document: @inherits RazorHosting.RazorTemplateFolderHost By specifying the above you can then get IntelliSense on your base template’s properties. For example, in my base template there are Request and Response objects. This is very useful especially if you end up creating custom templates that include your custom business objects as you can get effectively see full IntelliSense from the ‘page’ level down. For Html Help Builder for example, I’d have a Help object on the page and assuming I have the references available I can see all the way into that Help object without even having to do anything fancy. Note that the @inherits key is a GREAT and easy way to override the base template you normally specify as the default template. It allows you to create a custom template and as long as it inherits from the base template it’ll work properly. Since the last post I’ve also made some changes in the base template that allow hooking up some simple initialization logic so it gets much more easy to create custom templates and hook up custom objects with an IntializeTemplate() hook function that gets called with the Context and a Configuration object. These objects are objects you can pass in at runtime from your host application and then assign to custom properties on your template. For example the default implementation for RazorTemplateFolderHost does this: public override void InitializeTemplate(object context, object configurationData) { // Pick up configuration data and stuff into Request object RazorFolderHostTemplateConfiguration config = configurationData as RazorFolderHostTemplateConfiguration; this.Request.TemplatePath = config.TemplatePath; this.Request.TemplateRelativePath = config.TemplateRelativePath; // Just use the entire ConfigData as the model, but in theory // configData could contain many objects or values to set on // template properties this.Model = config.ConfigData as TModel; } to set up a strongly typed Model and the Request object. You can do much more complex hookups here of course and create complex base template pages that contain all the objects that you need in your code with strong typing. Adding a Bin folder to your Template’s Root Path Including templates in your host project works if you own the project and you’re the only one modifying the templates. However, if you are distributing the Razor engine as a templating/scripting solution as part of your application or development tool the original project is likely not available and so that approach is not practical. Another option you have is to add a Bin folder and add all the related assemblies into it. You can also add a Web.Config file with assembly references for any GAC’d assembly references that need to be associated with the templates. Between the web.config and bin folder Visual Studio can figure out how to provide IntelliSense. The Bin folder should contain: The RazorHosting.dll Your host project’s EXE or DLL – renamed to .dll if it’s an .exe Any external (bin folder) dependent assemblies Note that you most likely also want a reference to the host project if it contains references that are going to be used in templates. Visual Studio doesn’t recognize an EXE reference so you have to rename the EXE to DLL to make it work. Apparently the binary signature of EXE and DLL files are identical and it just works – learn something new everyday… For GAC assembly references you can add a web.config file to your template root. The Web.config file then should contain any full assembly references to GAC components: <configuration> <system.web> <compilation debug="true"> <assemblies> <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> <add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </assemblies> </compilation> </system.web> </configuration> And with that you should get full IntelliSense. Note that if you add a BIN folder and you also have the templates in your Visual Studio project Visual Studio will complain about reference conflicts as it’s effectively seeing both the project references and the ones in the bin folder. So it’s probably a good idea to use one or the other but not both at the same time :-) Seeing IntelliSense in your Razor templates is a big help for users of your templates. If you’re shipping an application level scripting solution especially it’ll be real useful for your template consumers/users to be able to get some quick help on creating customized templates – after all that’s what templates are all about – easy customization. Making sure that everything is referenced in your bin folder and web.config is a good idea and it’s great to see that Visual Studio (and presumably WebMatrix/Visual Web Developer as well) will be able to pick up your custom IntelliSense in Razor templates.© Rick Strahl, West Wind Technologies, 2005-2011Posted in Razor  

    Read the article

  • TFS Client APIs for creating workitem templates?

    - by amazedsaint
    Of course, it is pretty possible to create work items, get a list of work items etc in TFS. In addition to this, we need to have the functionality of allowing our users to create their own work item templates, for various file types. Whether the TFS Client APIs are capable of uploading work item templates to TFS server?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >